diff --git a/locales/en.yml b/locales/en.yml index 804a2f9d..52746d70 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -2697,6 +2697,7 @@ tools: title-schema-validation-errors: Schema Validation Errors label-indent-size-0-compact: 'Indent size (0 = Compact):' repair-json: Repair JSON + label-auto-height: Auto Height externalAccess: >- This tool may download a JSON schema from https://www.schemastore.org when validation is requested. No data is send externally. diff --git a/src/tools/json-editor/json-editor.vue b/src/tools/json-editor/json-editor.vue index 0dc19965..513c903d 100644 --- a/src/tools/json-editor/json-editor.vue +++ b/src/tools/json-editor/json-editor.vue @@ -26,7 +26,7 @@ const { t } = useI18n(); const styleStore = useStyleStore(); -const jsonText = ref('{ "a": { "array": [1, 2, 3] } }'); +const jsonText = useITStorage('json-editor:data', '{ "a": { "array": [1, 2, 3] } }'); const jsonPath = ref(''); function updateJsonPath(selection: JSONEditorSelection) { @@ -46,7 +46,8 @@ function updateJsonPath(selection: JSONEditorSelection) { } const jsonSchemaInputElement = ref(); -const schemaData = useITStorage('json-linter:schema-data', ''); +const schemaData = useITStorage('json-editor:schema-data', ''); +const autoHeight = useITStorage('json-editor:auto-height', false); const schemaUrl = useQueryParamOrStorage({ name: 'schema', @@ -74,10 +75,17 @@ const formattedJson = computed(() => {