@ekzo-dev/vanilla-jsoneditor
Advanced tools
Comparing version 0.18.0 to 0.18.1
{ | ||
"name": "@ekzo-dev/vanilla-jsoneditor", | ||
"description": "Aurelia JSON Editor adapter", | ||
"version": "0.18.0", | ||
"version": "0.18.1", | ||
"homepage": "https://github.com/ekzo-dev/aurelia-components/tree/main/packages-adapters/vanilla-json-editor", | ||
@@ -12,5 +12,5 @@ "repository": { | ||
"dependencies": { | ||
"@types/json-schema": "^7.0.9", | ||
"immutable-json-patch": "^5.1.0", | ||
"vanilla-jsoneditor": "~0.18.3" | ||
"@types/json-schema": "^7.0.14", | ||
"immutable-json-patch": "^5.1.3", | ||
"vanilla-jsoneditor": "~0.18.13" | ||
}, | ||
@@ -22,7 +22,6 @@ "main": "src/index.ts", | ||
"scripts": { | ||
"lint:js": "eslint src test --ext .js,.ts", | ||
"lint:css": "sass-lint -c .sass-lint.yml \"src/**/*.scss\"", | ||
"lint:html": "htmlhint -c .htmlhintrc src", | ||
"lint": "npm run lint:js && npm run lint:html && npm run lint:css", | ||
"pretest": "npm run lint", | ||
"lint:js": "eslint src --ext .js,.ts", | ||
"lint:css": "stylelint \"**/*.*css\" --allow-empty-input", | ||
"lint:html": "prettier \"**/*.html\" --no-error-on-unmatched-pattern", | ||
"lint:all": "npm run lint:js && npm run lint:html && npm run lint:css", | ||
"start": "webpack serve", | ||
@@ -55,4 +54,3 @@ "build": "rimraf dist && webpack --env production", | ||
"access": "public" | ||
}, | ||
"gitHead": "94042937b5f57ad8c7dd22f45ec6651e20c73b82" | ||
} | ||
} |
import { Meta, Story, StoryFnAureliaReturnType } from '@storybook/aurelia'; | ||
import { JsonEditor } from './json-editor'; | ||
import { selectControl } from '../../../../.storybook/helpers'; | ||
import { JsonEditor } from './json-editor'; | ||
const meta: Meta = { | ||
@@ -6,0 +8,0 @@ title: 'VanillaJsoneditor / JsonEditor', |
@@ -1,26 +0,30 @@ | ||
import { bindable, BindingMode, customElement, ICustomElementViewModel } from 'aurelia'; | ||
import { ICustomElementController } from '@aurelia/runtime-html'; | ||
import template from './json-editor.html'; | ||
import './json-editor.css'; | ||
import type { JSONPatchDocument, JSONPath, JSONValue } from 'immutable-json-patch'; | ||
import type { | ||
JSONEditor, | ||
JSONContent, | ||
TextContent, | ||
Content, | ||
ContentErrors, | ||
JSONPatchResult, | ||
RenderValueProps, | ||
RenderValueComponentDescription, | ||
MenuItem, | ||
QueryLanguage, | ||
TransformModalOptions, | ||
JSONContent, | ||
JSONEditor, | ||
JSONEditorSelection, | ||
JSONParser, | ||
JSONPatchResult, | ||
JSONPathParser, | ||
MenuItem, | ||
OnChangeStatus, | ||
QueryLanguage, | ||
RenderMenuContext, | ||
RenderValueComponentDescription, | ||
RenderValueProps, | ||
TextContent, | ||
TransformModalOptions, | ||
Validator, | ||
} from 'vanilla-jsoneditor'; | ||
import type { JSONValue, JSONPath, JSONPatchDocument } from 'immutable-json-patch'; | ||
import { ICustomElementController } from '@aurelia/runtime-html'; | ||
import { bindable, BindingMode, customElement, ICustomElementViewModel } from 'aurelia'; | ||
import { coerceBoolean } from '../utils'; | ||
import template from './json-editor.html'; | ||
import './json-editor.css'; | ||
@@ -194,6 +198,9 @@ @customElement({ | ||
} | ||
break; | ||
case 'theme': | ||
this.importTheme(); | ||
break; | ||
default: | ||
@@ -212,2 +219,3 @@ this.editor?.updateProps({ | ||
const props: Record<string, any> = {}; | ||
Object.keys(this.$controller.definition.bindables).forEach((name) => { | ||
@@ -231,6 +239,9 @@ if (this[name] !== undefined) { | ||
} else { | ||
this.contentCache = JSON.parse((content as TextContent).text); | ||
this.contentCache = JSON.parse((content as TextContent).text) as JSONValue; | ||
} | ||
this.content = this.contentCache; | ||
} catch (e) {} | ||
} catch (e) { | ||
// ignore partially invalid JSON output | ||
} | ||
@@ -237,0 +248,0 @@ this.onChange && this.onChange(content, previousContent, changeStatus); |
226
8598
8
Updated@types/json-schema@^7.0.14
Updatedimmutable-json-patch@^5.1.3
Updatedvanilla-jsoneditor@~0.18.13