@json-layout/core
Advanced tools
+1
-1
| { | ||
| "name": "@json-layout/core", | ||
| "version": "0.21.1", | ||
| "version": "0.22.0", | ||
| "description": "Compilation and state management utilities for JSON Layout.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+16
-8
@@ -12,7 +12,7 @@ // compileStatic is meant to produce a serializable result | ||
| import { makeSkeletonTree } from './skeleton-tree.js' | ||
| import { resolveRefs } from './utils/resolve-refs.js' | ||
| import { resolveLocaleRefs } from './utils/resolve-refs.js' | ||
| import clone from '../utils/clone.js' | ||
| import { standardComponents } from '@json-layout/vocabulary' | ||
| export { resolveRefs } from './utils/resolve-refs.js' | ||
| export { resolveLocaleRefs } from './utils/resolve-refs.js' | ||
@@ -107,5 +107,4 @@ /** | ||
| const schema = /** @type {import('ajv').SchemaObject} */(clone(_schema)) | ||
| schema.$id = schema.$id ?? '_jl' | ||
| resolveRefs(schema, options.ajv, options.locale) | ||
| const getJSONRef = resolveLocaleRefs(schema, options.ajv, options.locale) | ||
@@ -120,6 +119,15 @@ /** @type {string[]} */ | ||
| const validationErrors = {} | ||
| /** @type {Record<string, import('./types.js').SkeletonTree>} */ | ||
| const skeletonTrees = {} | ||
| const skeletonTree = makeSkeletonTree( | ||
| // makeSkeletonTree also mutates the schema (adding some error messages) | ||
| const mainTreePointer = `${schema.$id}#` | ||
| // @ts-ignore | ||
| skeletonTrees[mainTreePointer] = 'recursing' | ||
| skeletonTrees[mainTreePointer] = makeSkeletonTree( | ||
| schema, | ||
| schema.$id, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validatePointers, | ||
@@ -129,6 +137,5 @@ validationErrors, | ||
| expressionsDefinitions, | ||
| `${schema.$id}#`, | ||
| mainTreePointer, | ||
| 'main' | ||
| ) | ||
| options.ajv.addSchema(schema) | ||
@@ -175,3 +182,4 @@ | ||
| schema, | ||
| skeletonTree, | ||
| mainTree: mainTreePointer, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -178,0 +186,0 @@ validationErrors, |
@@ -82,3 +82,4 @@ // import Debug from 'debug' | ||
| ast.exports.compiledLayout = { | ||
| skeletonTree: compiledLayout.skeletonTree, | ||
| mainTree: compiledLayout.mainTree, | ||
| skeletonTrees: clone(compiledLayout.skeletonTrees), | ||
| normalizedLayouts: clone(compiledLayout.normalizedLayouts), | ||
@@ -85,0 +86,0 @@ validates: {}, |
| // import Debug from 'debug' | ||
| import { normalizeLayoutFragment, isSwitchStruct, isGetItemsExpression, isGetItemsFetch, isItemsLayout, getSchemaFragmentType } from '@json-layout/vocabulary' | ||
| import { makeSkeletonTree } from './skeleton-tree.js' | ||
| import { partialResolveRefs } from './utils/resolve-refs.js' | ||
| /** | ||
| * @param {any} schema | ||
| * @param {any} rawSchema | ||
| * @param {string} sourceSchemaId | ||
| * @param {import('./index.js').CompileOptions} options | ||
| * @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef | ||
| * @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees | ||
| * @param {string[]} validates | ||
@@ -13,3 +17,3 @@ * @param {Record<string, string[]>} validationErrors | ||
| * @param {string | number} key | ||
| * @param {string} pointer | ||
| * @param {string} currentPointer | ||
| * @param {string | null} parentPointer | ||
@@ -23,4 +27,7 @@ * @param {boolean} required | ||
| export function makeSkeletonNode ( | ||
| schema, | ||
| rawSchema, | ||
| sourceSchemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -31,3 +38,3 @@ validationErrors, | ||
| key, | ||
| pointer, | ||
| currentPointer, | ||
| parentPointer, | ||
@@ -39,6 +46,16 @@ required, | ||
| ) { | ||
| let schemaId = sourceSchemaId | ||
| let schema = rawSchema | ||
| let pointer = currentPointer | ||
| let refFragment | ||
| if (schema.$ref) { | ||
| [refFragment, schemaId, pointer] = getJSONRef(sourceSchemaId, schema.$ref) | ||
| schema = {...rawSchema, ...refFragment} | ||
| delete schema.$ref | ||
| } | ||
| schema = partialResolveRefs(schema, schemaId, getJSONRef) | ||
| const { type, nullable } = knownType ? { type: knownType, nullable: false } : getSchemaFragmentType(schema) | ||
| // improve on ajv error messages based on ajv-errors (https://ajv.js.org/packages/ajv-errors.html) | ||
| schema.errorMessage = schema.errorMessage ?? {} | ||
| rawSchema.errorMessage = rawSchema.errorMessage ?? {} | ||
| if (!normalizedLayouts[pointer]) { | ||
@@ -145,3 +162,6 @@ const normalizationResult = normalizeLayoutFragment( | ||
| schema.properties[propertyKey], | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -164,3 +184,6 @@ validationErrors, | ||
| dependentSchema, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -186,3 +209,6 @@ validationErrors, | ||
| schema.allOf[i], | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -223,3 +249,3 @@ validationErrors, | ||
| } | ||
| /** @type {import('./types.js').SkeletonTree[]} */ | ||
| /** @type {string[]} */ | ||
| const childrenTrees = [] | ||
@@ -231,12 +257,21 @@ /** @type {string[]} */ | ||
| delete schema.oneOf[i].title | ||
| childrenTrees.push(makeSkeletonTree( | ||
| schema.oneOf[i], | ||
| options, | ||
| validates, | ||
| validationErrors, | ||
| normalizedLayouts, | ||
| expressions, | ||
| `${oneOfPointer}/${i}`, | ||
| title | ||
| )) | ||
| const childTreePointer = `${oneOfPointer}/${i}` | ||
| if (!skeletonTrees[childTreePointer]) { | ||
| // @ts-ignore | ||
| skeletonTrees[childTreePointer] = 'recursing' | ||
| skeletonTrees[childTreePointer] = makeSkeletonTree( | ||
| schema.oneOf[i], | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
| validationErrors, | ||
| normalizedLayouts, | ||
| expressions, | ||
| childTreePointer, | ||
| title | ||
| ) | ||
| } | ||
| childrenTrees.push(childTreePointer) | ||
| } | ||
@@ -249,3 +284,3 @@ node.children = node.children ?? [] | ||
| childrenTrees, | ||
| pure: childrenTrees[0].root.pure, | ||
| pure: skeletonTrees[childrenTrees[0]]?.root.pure, | ||
| propertyKeys: [], | ||
@@ -263,3 +298,6 @@ roPropertyKeys: [] | ||
| schema.then, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -282,3 +320,6 @@ validationErrors, | ||
| schema.else, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -315,3 +356,6 @@ validationErrors, | ||
| itemSchema, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -328,6 +372,12 @@ validationErrors, | ||
| } else { | ||
| node.childrenTrees = [ | ||
| makeSkeletonTree( | ||
| const childTreePointer = `${pointer}/items` | ||
| if (!skeletonTrees[childTreePointer]) { | ||
| // @ts-ignore | ||
| skeletonTrees[childTreePointer] = 'recursing' | ||
| skeletonTrees[childTreePointer] = makeSkeletonTree( | ||
| schema.items, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -337,13 +387,18 @@ validationErrors, | ||
| expressions, | ||
| `${pointer}/items`, | ||
| childTreePointer, | ||
| schema.items.title | ||
| ) | ||
| ] | ||
| } | ||
| node.childrenTrees = [childTreePointer] | ||
| } | ||
| } | ||
| for (const child of node.children || []) if (!child.pure) node.pure = false | ||
| for (const childTree of node.childrenTrees || []) if (!childTree.root.pure) node.pure = false | ||
| for (const child of node.children || []) { | ||
| if (!child.pure) node.pure = false | ||
| } | ||
| for (const childTree of node.childrenTrees || []) { | ||
| if (!skeletonTrees[childTree]?.root?.pure) node.pure = false | ||
| } | ||
| return node | ||
| } |
@@ -8,3 +8,6 @@ // import Debug from 'debug' | ||
| * @param {any} schema | ||
| * @param {string} schemaId | ||
| * @param {import('./index.js').CompileOptions} options | ||
| * @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef | ||
| * @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees | ||
| * @param {string[]} validates | ||
@@ -20,3 +23,6 @@ * @param {Record<string, string[]>} validationErrors | ||
| schema, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
@@ -29,5 +35,19 @@ validationErrors, | ||
| ) { | ||
| const root = makeSkeletonNode(schema, options, validates, validationErrors, normalizedLayouts, expressions, '', pointer, null, true) | ||
| validates.push(pointer) | ||
| const root = makeSkeletonNode( | ||
| schema, | ||
| schemaId, | ||
| options, | ||
| getJSONRef, | ||
| skeletonTrees, | ||
| validates, | ||
| validationErrors, | ||
| normalizedLayouts, | ||
| expressions, | ||
| '', | ||
| pointer, | ||
| null, | ||
| true | ||
| ) | ||
| validates.push(root.pointer) | ||
| return { title, root } | ||
| } |
@@ -44,3 +44,4 @@ import type ajvModule from 'ajv/dist/2019.js' | ||
| schema?: SchemaObject | ||
| skeletonTree: SkeletonTree | ||
| mainTree: string, | ||
| skeletonTrees: Record<string, SkeletonTree> | ||
| validates: Record<string, ValidateFunction> | ||
@@ -74,5 +75,5 @@ validationErrors: Record<string, string[]> | ||
| children?: SkeletonNode[] // optional children in the case of arrays and object nodes | ||
| childrenTrees?: SkeletonTree[] // other trees that can be instantiated with separate validation (for example in the case of new array items of oneOfs, etc) | ||
| childrenTrees?: string[] // other trees that can be instantiated with separate validation (for example in the case of new array items of oneOfs, etc) | ||
| required?: boolean | ||
| nullable?: boolean | ||
| } |
| import ajvModule from 'ajv/dist/2019.js' | ||
| import clone from '../../utils/clone.js' | ||
| const Ajv = ajvModule.default | ||
| /** | ||
| * @param {Record<string, import('ajv').SchemaObject>} schemas | ||
| * @param {string} ref | ||
| * @param {ajvModule.default} ajv | ||
| * @returns {[any, string]} | ||
| * @returns {(schemaId: string, ref: string) => [any, string, string]} | ||
| */ | ||
| const getJSONRef = (schemas, ref, ajv) => { | ||
| const [schemaId, pointer] = ref.split('#') | ||
| schemas[schemaId] = schemas[schemaId] ?? (ajv.getSchema(schemaId)?.schema) | ||
| if (!schemas[schemaId]) throw new Error(`reference not found ${schemaId}`) | ||
| const pointerParts = pointer.split('/').filter(p => !!p) | ||
| const { value: fragment } = pointerParts.reduce((a, pointerPart) => { | ||
| a.path.push(pointerPart) | ||
| if (!(pointerPart in a.value)) throw new Error(`reference not found ${schemaId}#${a.path.join('/')}`) | ||
| a.value = a.value[pointerPart] | ||
| return a | ||
| }, { path: ['/'], value: schemas[schemaId] }) | ||
| return [fragment, schemaId] | ||
| const prepareGetJSONRef = (schemas, ajv) => | ||
| { | ||
| return (sourceSchemaId, ref) => { | ||
| const fullRef = ajv.opts.uriResolver.resolve(sourceSchemaId, ref) | ||
| const [schemaId, pointer] = fullRef.split('#') | ||
| schemas[schemaId] = schemas[schemaId] ?? (ajv.getSchema(schemaId)?.schema) | ||
| if (!schemas[schemaId]) throw new Error(`reference not found ${schemaId}`) | ||
| const pointerParts = pointer.split('/').filter(p => !!p) | ||
| const { value: fragment } = pointerParts.reduce((a, pointerPart) => { | ||
| a.path.push(pointerPart) | ||
| if (!(pointerPart in a.value)) throw new Error(`reference not found ${schemaId}#${a.path.join('/')}`) | ||
| a.value = a.value[pointerPart] | ||
| return a | ||
| }, { path: /** @type {string[]} */([]), value: schemas[schemaId] }) | ||
| return [fragment, schemaId, fullRef] | ||
| } | ||
| } | ||
| /** | ||
| * @param {Record<string, import('ajv').SchemaObject>} schemas | ||
| * mutates a schema by replacing ~$locale~ in all refs | ||
| * @param {import('ajv').SchemaObject} schema | ||
| * @param {ajvModule.default} ajv | ||
| * @param {string} locale | ||
| * @returns {(schemaId: string, ref: string) => [any, string, string]} | ||
| */ | ||
| export function resolveLocaleRefs (schema, ajv, locale = 'en') { | ||
| if (!schema.$id) throw new Error('missing schema id') | ||
| const getJSONRef = prepareGetJSONRef({ [schema.$id]: schema }, ajv) | ||
| /** @type {any[]} */ | ||
| const recursed = [] | ||
| recurseResolveLocale(schema, schema.$id, getJSONRef, locale, recursed) | ||
| return getJSONRef | ||
| } | ||
| /** | ||
| * @param {import('ajv').SchemaObject} schemaFragment | ||
| * @param {string} schemaId | ||
| * @param {ajvModule.default} ajv | ||
| * @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef | ||
| * @param {string} locale | ||
| * @returns {import('ajv').SchemaObject} | ||
| * @param {any[]} recursed | ||
| */ | ||
| const recurse = (schemas, schemaFragment, schemaId, ajv, locale = 'en') => { | ||
| const recurseResolveLocale = (schemaFragment, schemaId, getJSONRef, locale, recursed) => { | ||
| if (recursed.includes(schemaFragment)) return | ||
| recursed.push(schemaFragment) | ||
| for (const key of Object.keys(schemaFragment)) { | ||
| if (schemaFragment[key] && typeof schemaFragment[key] === 'object') { | ||
| if ('$ref' in schemaFragment[key]) { | ||
| const fullRef = ajv.opts.uriResolver.resolve(schemaId, schemaFragment[key].$ref).replace('~$locale~', locale) | ||
| const fullRefDefaultLocale = ajv.opts.uriResolver.resolve(schemaId, schemaFragment[key].$ref).replace('~$locale~', 'en') | ||
| const ref = schemaFragment[key].$ref.replace('~$locale~', locale) | ||
| const refDefaultLocale = schemaFragment[key].$ref.replace('~$locale~', 'en') | ||
| let refFragment, refSchemaId | ||
| try { | ||
| [refFragment, refSchemaId] = getJSONRef(schemas, fullRef, ajv) | ||
| [refFragment, refSchemaId] = getJSONRef(schemaId, ref) | ||
| schemaFragment[key].$ref = ref | ||
| } catch (err) { | ||
| [refFragment, refSchemaId] = getJSONRef(schemas, fullRefDefaultLocale, ajv) | ||
| [refFragment, refSchemaId] = getJSONRef(schemaId, refDefaultLocale) | ||
| schemaFragment[key].$ref = refDefaultLocale | ||
| } | ||
| if (typeof refFragment === 'object' && !Array.isArray(refFragment)) { | ||
| schemaFragment[key] = { ...refFragment, ...schemaFragment[key] } | ||
| delete schemaFragment[key].$ref | ||
| if (typeof refFragment === 'string') { | ||
| schemaFragment[key] = refFragment | ||
| } else { | ||
| schemaFragment[key] = refFragment | ||
| recurseResolveLocale(refFragment, refSchemaId, getJSONRef, locale, recursed) | ||
| } | ||
| recurse(schemas, schemaFragment[key], refSchemaId, ajv, locale) | ||
| } else { | ||
| recurse(schemas, schemaFragment[key], schemaId, ajv, locale) | ||
| recurseResolveLocale(schemaFragment[key], schemaId, getJSONRef, locale, recursed) | ||
| } | ||
| } | ||
| } | ||
| return schemaFragment | ||
| } | ||
| /** | ||
| * partially resolve a schema but not recursively, used for layout normalization | ||
| * @param {import('ajv').SchemaObject} schema | ||
| * @param {ajvModule.default} ajv | ||
| * @param {string} locale | ||
| * @returns {import('ajv').SchemaObject} | ||
| * @param {string} schemaId | ||
| * @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef | ||
| */ | ||
| export function resolveRefs (schema, ajv, locale = 'en') { | ||
| if (!schema.$id) throw new Error('missing schema id') | ||
| return recurse({ [schema.$id]: schema }, schema, schema.$id, ajv ?? new Ajv(), locale) | ||
| } | ||
| export function partialResolveRefs (schema, schemaId, getJSONRef) { | ||
| let clonedSchema = null | ||
| if (schema.items && schema.items.$ref) { | ||
| const [refFragment] = getJSONRef(schemaId, schema.items.$ref) | ||
| clonedSchema = clonedSchema ?? clone(schema) | ||
| clonedSchema.items = { ...refFragment, ... schema.items } | ||
| } | ||
| if (schema.properties) { | ||
| for (const key in schema.properties) { | ||
| if (schema.properties[key].$ref) { | ||
| const [refFragment] = getJSONRef(schemaId, schema.properties[key].$ref) | ||
| clonedSchema = clonedSchema ?? clone(schema) | ||
| clonedSchema.properties[key] = { ...refFragment, ... schema.properties[key] } | ||
| } | ||
| } | ||
| } | ||
| if (schema.oneOf) { | ||
| for (let i = 0; i < schema.oneOf.length; i++) { | ||
| if (schema.oneOf[i].$ref) { | ||
| const [refFragment] = getJSONRef(schemaId, schema.oneOf[i].$ref) | ||
| clonedSchema = clonedSchema ?? clone(schema) | ||
| clonedSchema.oneOf[i] = { ...refFragment, ... schema.oneOf[i] } | ||
| } | ||
| } | ||
| } | ||
| if (schema.anyOf) { | ||
| for (let i = 0; i < schema.anyOf.length; i++) { | ||
| if (schema.anyOf[i].$ref) { | ||
| const [refFragment] = getJSONRef(schemaId, schema.anyOf[i].$ref) | ||
| clonedSchema = clonedSchema ?? clone(schema) | ||
| clonedSchema.anyOf[i] = { ...refFragment, ... schema.anyOf[i] } | ||
| } | ||
| } | ||
| } | ||
| if (schema.allOf) { | ||
| for (let i = 0; i < schema.allOf.length; i++) { | ||
| if (schema.allOf[i].$ref) { | ||
| const [refFragment] = getJSONRef(schemaId, schema.allOf[i].$ref) | ||
| clonedSchema = clonedSchema ?? clone(schema) | ||
| clonedSchema.allOf[i] = { ...refFragment, ... schema.allOf[i] } | ||
| } | ||
| } | ||
| } | ||
| return clonedSchema ?? schema | ||
| } |
+11
-7
@@ -230,3 +230,3 @@ // eslint-disable-next-line import/no-named-default | ||
| this.initValidationState() | ||
| this.activeItems = {} | ||
| this.activatedItems = {} | ||
| this.updateState() | ||
@@ -299,3 +299,3 @@ this.handleAutofocus() | ||
| const createStateTreeContext = { | ||
| activeItems: this.activeItems, | ||
| activatedItems: this.activatedItems, | ||
| autofocusTarget: this._autofocusTarget, | ||
@@ -327,3 +327,2 @@ initial: !this._lastCreateStateTreeContext, | ||
| } | ||
| this.activeItems = createStateTreeContext.activeItems | ||
| this.files = shallowProduceArray(this.files, createStateTreeContext.files) | ||
@@ -422,3 +421,3 @@ } | ||
| if (activateKey !== undefined) { | ||
| this.activeItems = produce(this.activeItems, draft => { draft[node.fullKey] = activateKey }) | ||
| this.activatedItems = produce(this.activatedItems, draft => { draft[node.fullKey] = activateKey }) | ||
| this._autofocusTarget = node.fullKey + '/' + activateKey | ||
@@ -632,3 +631,3 @@ } | ||
| */ | ||
| activeItems | ||
| activatedItems | ||
@@ -640,3 +639,3 @@ /** | ||
| activateItem (node, key) { | ||
| this.activeItems = produce(this.activeItems, draft => { draft[node.fullKey] = key }) | ||
| this.activatedItems = produce(this.activatedItems, draft => { draft[node.fullKey] = key }) | ||
| this._autofocusTarget = node.fullKey + '/' + key | ||
@@ -655,3 +654,8 @@ if (node.key === '$oneOf') { | ||
| deactivateItem (node) { | ||
| this.activeItems = produce(this.activeItems, draft => { delete draft[node.fullKey] }) | ||
| // also deactivate children oneOf for example | ||
| this.activatedItems = produce(this.activatedItems, draft => { | ||
| for (const key in draft) { | ||
| if (key.startsWith(node.fullKey)) delete draft[key] | ||
| } | ||
| }) | ||
| this.updateState() | ||
@@ -658,0 +662,0 @@ } |
@@ -70,3 +70,3 @@ import { isSwitchStruct, childIsCompObject, isCompositeLayout, isFocusableLayout, isItemsLayout, isGetItemsExpression, isGetItemsFetch } from '@json-layout/vocabulary' | ||
| const produceStateNodeData = produce((draft, parentDataPath, children, additionalPropertiesErrors, propertyKeys, removePropertyKeys) => { | ||
| if (propertyKeys) { | ||
| if (propertyKeys && (propertyKeys.length || children?.length)) { | ||
| for (const key of Object.keys(draft)) { | ||
@@ -163,3 +163,6 @@ if (!propertyKeys.includes(key)) delete draft[key] | ||
| const matchChildError = (error, skeleton, dataPath, parentDataPath) => { | ||
| if (!error.schemaPath.startsWith(skeleton.pointer)) return false | ||
| if (!( | ||
| error.schemaPath === skeleton.pointer || | ||
| error.schemaPath.startsWith(skeleton.pointer + '/') | ||
| )) return false | ||
| if (error.instancePath.startsWith(dataPath)) return true | ||
@@ -267,3 +270,3 @@ return false | ||
| if (skeleton.pure && reusedNode && !reusedNode.error && !reusedNode.childError) { | ||
| cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validationState, context.activeItems, context.initial, data] | ||
| cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validationState, context.activatedItems, context.initial, data] | ||
| if (context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey)) { | ||
@@ -340,3 +343,3 @@ return reusedNode | ||
| /** @type {number} */ | ||
| const activeChildTreeIndex = fullKey in context.activeItems ? context.activeItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[childTree.root.pointer](data)) | ||
| const activeChildTreeIndex = fullKey in context.activatedItems ? context.activatedItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[compiledLayout.skeletonTrees[childTree].root.pointer](data)) | ||
| if (activeChildTreeIndex !== -1) { | ||
@@ -351,6 +354,5 @@ context.errors = context.errors?.filter(error => { | ||
| }) | ||
| context.activeItems = produce(context.activeItems, draft => { draft[fullKey] = activeChildTreeIndex }) | ||
| const activeChildKey = `${fullKey}/${activeChildTreeIndex}` | ||
| if (context.autofocusTarget === fullKey) context.autofocusTarget = activeChildKey | ||
| const activeChildTree = skeleton.childrenTrees[activeChildTreeIndex] | ||
| const activeChildTree = compiledLayout.skeletonTrees[skeleton.childrenTrees[activeChildTreeIndex]] | ||
| children = [ | ||
@@ -380,3 +382,3 @@ createStateNode( | ||
| const arrayData = /** @type {unknown[]} */(data ?? []) | ||
| const childSkeleton = /** @type {import('../index.js').SkeletonNode} */(skeleton?.childrenTrees?.[0]?.root) | ||
| const childSkeleton = /** @type {import('../index.js').SkeletonNode} */(skeleton?.childrenTrees?.[0] && compiledLayout.skeletonTrees[skeleton?.childrenTrees?.[0]]?.root) | ||
| const listItemOptions = layout.listEditMode === 'inline' ? options : produceReadonlyArrayItemOptions(options) | ||
@@ -391,3 +393,3 @@ children = [] | ||
| context, | ||
| (layout.listEditMode === 'inline-single' && context.activeItems[fullKey] === i) ? options : listItemOptions, | ||
| (layout.listEditMode === 'inline-single' && context.activatedItems[fullKey] === i) ? options : listItemOptions, | ||
| compiledLayout, | ||
@@ -430,3 +432,4 @@ i, | ||
| let nodeData = children | ||
| /** @type {unknown} */ | ||
| let nodeData = typeof data === 'object' && !(data instanceof File) | ||
| ? produceStateNodeData( | ||
@@ -433,0 +436,0 @@ /** @type {Record<string, unknown>} */(data ?? {}), |
@@ -65,3 +65,3 @@ import { type ErrorObject } from 'ajv/dist/2019.js' | ||
| files: FileRef[] | ||
| activeItems: Record<string, number> | ||
| activatedItems: Record<string, number> | ||
| autofocusTarget: string | null | ||
@@ -80,3 +80,3 @@ initial: boolean | ||
| // [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentWidth, validationState, activeItems, initial, data] | ||
| // [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentWidth, validationState, activatedItems, initial, data] | ||
| export type StateNodeCacheKey = [ | ||
@@ -83,0 +83,0 @@ StateNodeOptions, |
| /** | ||
| * @param {object} _schema | ||
| * @param {PartialCompileOptions} [partialOptions] | ||
| * @returns {CompiledLayout} | ||
| */ | ||
| export function compile(_schema: object, partialOptions?: import("./types.js").PartialCompileOptions | undefined): CompiledLayout; | ||
| export { resolveRefs } from "./utils/resolve-refs.js"; | ||
| /** @type {(draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions} */ | ||
| export const produceCompileOptions: (draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions; | ||
| export type SkeletonTree = import('./types.js').SkeletonTree; | ||
| export type SkeletonNode = import('./types.js').SkeletonNode; | ||
| export type CompiledLayout = import('./types.js').CompiledLayout; | ||
| export type CompileOptions = import('./types.js').CompileOptions; | ||
| export type PartialCompileOptions = import('./types.js').PartialCompileOptions; | ||
| export type CompiledExpression = import('./types.js').CompiledExpression; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AAgGA;;;;GAIG;AACH,iCAJW,MAAM,4EAEJ,cAAc,CAkF1B;;AAnJD,yGAAyG;AACzG,4CADmB,qBAAqB,cAAc,qBAAqB,KAAK,qBAAqB,CAQnG;2BAxBW,OAAO,YAAY,EAAE,YAAY;2BACjC,OAAO,YAAY,EAAE,YAAY;6BACjC,OAAO,YAAY,EAAE,cAAc;6BACnC,OAAO,YAAY,EAAE,cAAc;oCACnC,OAAO,YAAY,EAAE,qBAAqB;iCAC1C,OAAO,YAAY,EAAE,kBAAkB"} |
| /** | ||
| * @param {import('./index.js').CompiledLayout} compiledLayout | ||
| * @returns {string} | ||
| */ | ||
| export function serialize(compiledLayout: import('./index.js').CompiledLayout): string; | ||
| //# sourceMappingURL=serialize.d.ts.map |
| {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CAkFlB"} |
| /** | ||
| * @param {any} schema | ||
| * @param {import('./index.js').CompileOptions} options | ||
| * @param {string[]} validates | ||
| * @param {Record<string, string[]>} validationErrors | ||
| * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts | ||
| * @param {import('@json-layout/vocabulary').Expression[]} expressions | ||
| * @param {string | number} key | ||
| * @param {string} pointer | ||
| * @param {string | null} parentPointer | ||
| * @param {boolean} required | ||
| * @param {string} [condition] | ||
| * @param {boolean} [dependent] | ||
| * @param {string} [knownType] | ||
| * @returns {import('./types.js').SkeletonNode} | ||
| */ | ||
| export function makeSkeletonNode(schema: any, options: import('./index.js').CompileOptions, validates: string[], validationErrors: Record<string, string[]>, normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], key: string | number, pointer: string, parentPointer: string | null, required: boolean, condition?: string | undefined, dependent?: boolean | undefined, knownType?: string | undefined): import('./types.js').SkeletonNode; | ||
| //# sourceMappingURL=skeleton-node.d.ts.map |
| {"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,yCAfW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,oBACR,OAAO,MAAM,EAAE,MAAM,EAAE,CAAC,qBACxB,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,OAC9C,MAAM,GAAG,MAAM,WACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,OAAO,oGAIL,OAAO,YAAY,EAAE,YAAY,CAwT7C"} |
| /** | ||
| * @param {any} schema | ||
| * @param {import('./index.js').CompileOptions} options | ||
| * @param {string[]} validates | ||
| * @param {Record<string, string[]>} validationErrors | ||
| * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts | ||
| * @param {import('@json-layout/vocabulary').Expression[]} expressions | ||
| * @param {string} pointer | ||
| * @param {string} title | ||
| * @returns {import('./types.js').SkeletonTree} | ||
| */ | ||
| export function makeSkeletonTree(schema: any, options: import('./index.js').CompileOptions, validates: string[], validationErrors: Record<string, string[]>, normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], pointer: string, title: string): import('./types.js').SkeletonTree; | ||
| //# sourceMappingURL=skeleton-tree.d.ts.map |
| {"version":3,"file":"skeleton-tree.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-tree.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,yCAVW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,oBACR,OAAO,MAAM,EAAE,MAAM,EAAE,CAAC,qBACxB,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,WAC9C,MAAM,SACN,MAAM,GACJ,OAAO,YAAY,EAAE,YAAY,CAe7C"} |
| import type ajvModule from 'ajv/dist/2019.js'; | ||
| import type MarkdownIt from 'markdown-it'; | ||
| import { type ComponentInfo, type BaseCompObject, type NormalizedLayout, type StateNodeOptionsBase, type Expression } from '@json-layout/vocabulary'; | ||
| import { type ValidateFunction, type SchemaObject } from 'ajv/dist/2019.js'; | ||
| import { type Display } from '../state/utils/display.js'; | ||
| import { type LocaleMessages } from '../i18n/types.js'; | ||
| export interface ParentContextExpression { | ||
| data: unknown; | ||
| parent: ParentContextExpression | undefined | null; | ||
| } | ||
| export type CompiledExpression = (data: any, options: StateNodeOptionsBase, context: object, display: Display, layout: BaseCompObject, validates: Record<string, ValidateFunction>, rootData?: unknown, parent?: ParentContextExpression | null) => any; | ||
| export interface CompileOptions { | ||
| ajv: ajvModule.default; | ||
| ajvOptions?: ajvModule.Options; | ||
| code: boolean; | ||
| markdown: (text: string) => string; | ||
| markdownItOptions?: MarkdownIt.Options; | ||
| locale: string; | ||
| messages: LocaleMessages; | ||
| optionsKeys: string[]; | ||
| components: Record<string, ComponentInfo>; | ||
| } | ||
| export type PartialCompileOptions = Partial<Omit<CompileOptions, 'messages'>> & { | ||
| messages?: Partial<LocaleMessages>; | ||
| components?: Record<string, Omit<ComponentInfo, 'name'>>; | ||
| }; | ||
| export interface CompiledLayout { | ||
| options?: CompileOptions; | ||
| schema?: SchemaObject; | ||
| skeletonTree: SkeletonTree; | ||
| validates: Record<string, ValidateFunction>; | ||
| validationErrors: Record<string, string[]>; | ||
| normalizedLayouts: Record<string, NormalizedLayout>; | ||
| expressions: CompiledExpression[]; | ||
| locale: string; | ||
| messages: LocaleMessages; | ||
| components: Record<string, Omit<ComponentInfo, 'schema'>>; | ||
| localizeErrors: (errors: ajvModule.ErrorObject[]) => void; | ||
| } | ||
| export interface SkeletonTree { | ||
| title: string; | ||
| root: SkeletonNode; | ||
| } | ||
| export interface SkeletonNode { | ||
| key: string | number; | ||
| pointer: string; | ||
| parentPointer: string | null; | ||
| pure: boolean; | ||
| propertyKeys: string[]; | ||
| roPropertyKeys: string[]; | ||
| condition?: Expression; | ||
| children?: SkeletonNode[]; | ||
| childrenTrees?: SkeletonTree[]; | ||
| required?: boolean; | ||
| nullable?: boolean; | ||
| } | ||
| //# sourceMappingURL=types.d.ts.map |
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,UAAU,MAAM,aAAa,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AE,YAAY,EAAE,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"} |
| /** | ||
| * @param {import('ajv').SchemaObject} schema | ||
| * @param {ajvModule.default} ajv | ||
| * @param {string} locale | ||
| * @returns {import('ajv').SchemaObject} | ||
| */ | ||
| export function resolveRefs(schema: import('ajv').SchemaObject, ajv: ajvModule.default, locale?: string): import('ajv').SchemaObject; | ||
| import ajvModule from 'ajv/dist/2019.js'; | ||
| //# sourceMappingURL=resolve-refs.d.ts.map |
| {"version":3,"file":"resolve-refs.d.ts","sourceRoot":"","sources":["../../../src/compile/utils/resolve-refs.js"],"names":[],"mappings":"AA2DA;;;;;GAKG;AACH,oCALW,OAAO,KAAK,EAAE,YAAY,OAC1B,UAAU,OAAO,WACjB,MAAM,GACJ,OAAO,KAAK,EAAE,YAAY,CAKtC;sBApEqB,kBAAkB"} |
| declare const _default: import('./types.js').LocaleMessages; | ||
| export default _default; | ||
| //# sourceMappingURL=en.d.ts.map |
| {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"} |
| declare const _default: import('./types.js').LocaleMessages; | ||
| export default _default; | ||
| //# sourceMappingURL=fr.d.ts.map |
| {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"} |
| declare const _default: Record<string, import('./types.js').LocaleMessages>; | ||
| export default _default; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.js"],"names":[],"mappings":"wBAGW,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,cAAc,CAAC"} |
| export interface CompileOptionsMessages { | ||
| errorOneOf: string; | ||
| errorRequired: string; | ||
| } | ||
| export interface StateOptionsMessages { | ||
| addItem: string; | ||
| delete: string; | ||
| edit: string; | ||
| close: string; | ||
| duplicate: string; | ||
| sort: string; | ||
| up: string; | ||
| down: string; | ||
| showHelp: string; | ||
| mdeLink1: string; | ||
| mdeLink2: string; | ||
| mdeImg1: string; | ||
| mdeImg2: string; | ||
| mdeTable1: string; | ||
| mdeTable2: string; | ||
| bold: string; | ||
| italic: string; | ||
| heading: string; | ||
| quote: string; | ||
| unorderedList: string; | ||
| orderedList: string; | ||
| createLink: string; | ||
| insertImage: string; | ||
| createTable: string; | ||
| preview: string; | ||
| mdeGuide: string; | ||
| undo: string; | ||
| redo: string; | ||
| } | ||
| export type LocaleMessages = CompileOptionsMessages & StateOptionsMessages; | ||
| //# sourceMappingURL=types.d.ts.map |
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,oBAAoB,CAAA"} |
| export * from "./compile/index.js"; | ||
| export * from "./state/index.js"; | ||
| export { default as i18n } from "./i18n/index.js"; | ||
| export { default as clone } from "./utils/clone.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""} |
| export { Display } from "./utils/display.js"; | ||
| /** | ||
| * @typedef {import('./types.js').StateNode} StateNode | ||
| * @typedef {import('./types.js').StateTree} StateTree | ||
| * @typedef {import('./types.js').StatefulLayoutOptions} StatefulLayoutOptions | ||
| * @typedef {import('./types.js').StatefulLayoutEvents} StatefulLayoutEvents | ||
| * @typedef {import('./types.js').CreateStateTreeContext} CreateStateTreeContext | ||
| * @typedef {import('./types.js').TextFieldNode} TextFieldNode | ||
| * @typedef {import('./types.js').TextareaNode} TextareaNode | ||
| * @typedef {import('./types.js').NumberFieldNode} NumberFieldNode | ||
| * @typedef {import('./types.js').SliderNode} SliderNode | ||
| * @typedef {import('./types.js').SectionNode} SectionNode | ||
| * @typedef {import('./types.js').SelectNode} SelectNode | ||
| * @typedef {import('./types.js').AutocompleteNode} AutocompleteNode | ||
| * @typedef {import('./types.js').RadioGroupNode} RadioGroupNode | ||
| * @typedef {import('./types.js').CheckboxGroupNode} CheckboxGroupNode | ||
| * @typedef {import('./types.js').SwitchGroupNode} SwitchGroupNode | ||
| * @typedef {import('./types.js').ComboboxNode} ComboboxNode | ||
| * @typedef {import('./types.js').CheckboxNode} CheckboxNode | ||
| * @typedef {import('./types.js').SwitchNode} SwitchNode | ||
| * @typedef {import('./types.js').ColorPickerNode} ColorPickerNode | ||
| * @typedef {import('./types.js').DatePickerNode} DatePickerNode | ||
| * @typedef {import('./types.js').DateTimePickerNode} DateTimePickerNode | ||
| * @typedef {import('./types.js').TimePickerNode} TimePickerNode | ||
| * @typedef {import('./types.js').ExpansionPanelsNode} ExpansionPanelsNode | ||
| * @typedef {import('./types.js').TabsNode} TabsNode | ||
| * @typedef {import('./types.js').VerticalTabsNode} VerticalTabsNode | ||
| * @typedef {import('./types.js').StepperNode} StepperNode | ||
| * @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode | ||
| * @typedef {import('./types.js').ListNode} ListNode | ||
| * @typedef {import('./types.js').FileInputNode} FileInputNode | ||
| * @typedef {import('./types.js').FileRef} FileRef | ||
| */ | ||
| /** @type {(node: StateNode | undefined) => node is SectionNode} */ | ||
| export const isSection: (node: StateNode | undefined) => node is import("./types.js").SectionNode; | ||
| /** @type {(node: StateNode | undefined, components: Record<string, import('@json-layout/vocabulary').ComponentInfo>) => node is SelectNode | ComboboxNode | AutocompleteNode} */ | ||
| export const isItemsNode: (node: StateNode | undefined, components: Record<string, import('@json-layout/vocabulary').ComponentInfo>) => node is import("./types.js").SelectNode | import("./types.js").AutocompleteNode | import("./types.js").ComboboxNode; | ||
| export class StatefulLayout { | ||
| /** | ||
| * @param {import("../index.js").CompiledLayout} compiledLayout | ||
| * @param {import("../index.js").SkeletonTree} skeletonTree | ||
| * @param {Partial<StatefulLayoutOptions>} options | ||
| * @param {unknown} [data] | ||
| */ | ||
| constructor(compiledLayout: import("../index.js").CompiledLayout, skeletonTree: import("../index.js").SkeletonTree, options: Partial<StatefulLayoutOptions>, data?: unknown); | ||
| /** | ||
| * @readonly | ||
| * @type {import('mitt').Emitter<StatefulLayoutEvents>} | ||
| */ | ||
| readonly events: import('mitt').Emitter<StatefulLayoutEvents>; | ||
| /** | ||
| * @private | ||
| * @readonly | ||
| * @type {import('../index.js').CompiledLayout} | ||
| */ | ||
| private readonly _compiledLayout; | ||
| get compiledLayout(): import("../compile/types.js").CompiledLayout; | ||
| /** | ||
| * @private | ||
| * @type {StateTree} | ||
| */ | ||
| private _stateTree; | ||
| get stateTree(): import("./types.js").StateTree; | ||
| /** | ||
| * @readonly | ||
| * @type {import('../index.js').SkeletonTree} | ||
| */ | ||
| readonly skeletonTree: import('../index.js').SkeletonTree; | ||
| /** | ||
| * @private | ||
| * @type {Display} | ||
| */ | ||
| private _display; | ||
| get display(): Display; | ||
| /** | ||
| * @private | ||
| * @type {import('./types.js').ValidationState} | ||
| */ | ||
| private _validationState; | ||
| /** | ||
| * @private | ||
| * @param {Partial<import('./types.js').ValidationState>} validationState | ||
| */ | ||
| set validationState(arg: import("./types.js").ValidationState); | ||
| /** | ||
| * @returns {import('./types.js').ValidationState} | ||
| */ | ||
| get validationState(): import("./types.js").ValidationState; | ||
| /** | ||
| * @private | ||
| * @type {StatefulLayoutOptions} | ||
| */ | ||
| private _options; | ||
| /** | ||
| * @param {Partial<StatefulLayoutOptions>} options | ||
| */ | ||
| set options(arg: import("./types.js").StatefulLayoutOptions); | ||
| /** | ||
| * @returns {StatefulLayoutOptions} | ||
| */ | ||
| get options(): import("./types.js").StatefulLayoutOptions; | ||
| /** | ||
| * @private | ||
| * @type {unknown} | ||
| */ | ||
| private _data; | ||
| set data(arg: unknown); | ||
| get data(): unknown; | ||
| /** | ||
| * @private | ||
| * @type {unknown} | ||
| */ | ||
| private _previousData; | ||
| /** | ||
| * @private | ||
| * @type {boolean} | ||
| */ | ||
| private _dataWaitingForBlur; | ||
| /** | ||
| * @private | ||
| * @type {CreateStateTreeContext} | ||
| */ | ||
| private _lastCreateStateTreeContext; | ||
| /** | ||
| * @private | ||
| * @type {string | null} | ||
| */ | ||
| private _autofocusTarget; | ||
| /** | ||
| * @private | ||
| * @type {string | null} | ||
| */ | ||
| private _previousAutofocusTarget; | ||
| /** | ||
| * @type {FileRef[]} | ||
| */ | ||
| files: FileRef[]; | ||
| /** | ||
| * @type {Record<string, number>} | ||
| */ | ||
| activeItems: Record<string, number>; | ||
| /** | ||
| * @private | ||
| * @param {Partial<StatefulLayoutOptions>} options | ||
| */ | ||
| private prepareOptions; | ||
| /** | ||
| * @private | ||
| */ | ||
| private initValidationState; | ||
| /** | ||
| * @private | ||
| */ | ||
| private updateState; | ||
| /** | ||
| * @private | ||
| */ | ||
| private emitData; | ||
| /** | ||
| * @private | ||
| * @param {boolean} rehydrate | ||
| */ | ||
| private createStateTree; | ||
| validate(): void; | ||
| resetValidation(): void; | ||
| /** | ||
| * @returns {boolean} | ||
| */ | ||
| get valid(): boolean; | ||
| /** | ||
| * @returns {string[]} | ||
| */ | ||
| get errors(): string[]; | ||
| /** | ||
| * @returns {boolean} | ||
| */ | ||
| get hasHiddenError(): boolean; | ||
| /** | ||
| * @private | ||
| * @param {StateNode} node | ||
| * @returns {import('../compile/types.js').ParentContextExpression | null} | ||
| */ | ||
| private getParentContextExpression; | ||
| /** | ||
| * @param {StateNode} node | ||
| * @param {import('@json-layout/vocabulary').Expression} expression | ||
| * @param {any} data | ||
| * @returns {any} | ||
| */ | ||
| evalNodeExpression(node: StateNode, expression: import('@json-layout/vocabulary').Expression, data: any): any; | ||
| /** | ||
| * @private | ||
| * @param {StateNode} node | ||
| * @param {unknown} data | ||
| * @param {boolean} [validated] | ||
| * @param {number} [activateKey] | ||
| */ | ||
| private applyInput; | ||
| /** | ||
| * @private | ||
| * @type {null | [StateNode, unknown, boolean, number | undefined, ReturnType<typeof setTimeout>]} | ||
| */ | ||
| private debouncedInput; | ||
| applyDebouncedInput(): void; | ||
| /** | ||
| * @param {StateNode} node | ||
| * @param {unknown} data | ||
| * @param {number} [activateKey] | ||
| */ | ||
| input(node: StateNode, data: unknown, activateKey?: number | undefined): void; | ||
| /** | ||
| * @param {StateNode} node | ||
| */ | ||
| blur(node: StateNode): void; | ||
| /** | ||
| * @param {StateNode} node | ||
| */ | ||
| validateNodeRecurse(node: StateNode): void; | ||
| /** | ||
| * @private | ||
| * @type {Record<string, {key: any, appliedQ: boolean, items: import('@json-layout/vocabulary').SelectItems}>} | ||
| */ | ||
| private _itemsCache; | ||
| /** | ||
| * @private | ||
| * @param {StateNode} node | ||
| * @param {string} q | ||
| * @returns {Promise<{appliedQ: boolean, items: import('@json-layout/vocabulary').SelectItems}>} | ||
| */ | ||
| private getItemsWithoutCache; | ||
| /** | ||
| * @param {StateNode} node | ||
| * @param {string} q | ||
| * @returns {Promise<import('@json-layout/vocabulary').SelectItems>} | ||
| */ | ||
| getItems(node: StateNode, q?: string): Promise<import('@json-layout/vocabulary').SelectItems>; | ||
| /** | ||
| * @param {StateNode} node | ||
| * @param {any} rawItem | ||
| * @returns {import('@json-layout/vocabulary').SelectItem} | ||
| */ | ||
| prepareSelectItem(node: StateNode, rawItem: any): import('@json-layout/vocabulary').SelectItem; | ||
| /** | ||
| * @param {StateNode} node | ||
| * @param {number} key | ||
| */ | ||
| activateItem(node: StateNode, key: number): void; | ||
| /** | ||
| * @param {StateNode} node | ||
| */ | ||
| deactivateItem(node: StateNode): void; | ||
| handleAutofocus(): void; | ||
| } | ||
| export type StateNode = import('./types.js').StateNode; | ||
| export type StateTree = import('./types.js').StateTree; | ||
| export type StatefulLayoutOptions = import('./types.js').StatefulLayoutOptions; | ||
| export type StatefulLayoutEvents = import('./types.js').StatefulLayoutEvents; | ||
| export type CreateStateTreeContext = import('./types.js').CreateStateTreeContext; | ||
| export type TextFieldNode = import('./types.js').TextFieldNode; | ||
| export type TextareaNode = import('./types.js').TextareaNode; | ||
| export type NumberFieldNode = import('./types.js').NumberFieldNode; | ||
| export type SliderNode = import('./types.js').SliderNode; | ||
| export type SectionNode = import('./types.js').SectionNode; | ||
| export type SelectNode = import('./types.js').SelectNode; | ||
| export type AutocompleteNode = import('./types.js').AutocompleteNode; | ||
| export type RadioGroupNode = import('./types.js').RadioGroupNode; | ||
| export type CheckboxGroupNode = import('./types.js').CheckboxGroupNode; | ||
| export type SwitchGroupNode = import('./types.js').SwitchGroupNode; | ||
| export type ComboboxNode = import('./types.js').ComboboxNode; | ||
| export type CheckboxNode = import('./types.js').CheckboxNode; | ||
| export type SwitchNode = import('./types.js').SwitchNode; | ||
| export type ColorPickerNode = import('./types.js').ColorPickerNode; | ||
| export type DatePickerNode = import('./types.js').DatePickerNode; | ||
| export type DateTimePickerNode = import('./types.js').DateTimePickerNode; | ||
| export type TimePickerNode = import('./types.js').TimePickerNode; | ||
| export type ExpansionPanelsNode = import('./types.js').ExpansionPanelsNode; | ||
| export type TabsNode = import('./types.js').TabsNode; | ||
| export type VerticalTabsNode = import('./types.js').VerticalTabsNode; | ||
| export type StepperNode = import('./types.js').StepperNode; | ||
| export type OneOfSelectNode = import('./types.js').OneOfSelectNode; | ||
| export type ListNode = import('./types.js').ListNode; | ||
| export type FileInputNode = import('./types.js').FileInputNode; | ||
| export type FileRef = import('./types.js').FileRef; | ||
| import { Display } from './utils/display.js'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,mEAAmE;AACnE,+BADkB,SAAS,GAAG,SAAS,8CACoC;AAE3E,iLAAiL;AACjL,iCADkB,SAAS,GAAG,SAAS,cAAc,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,aAAa,CAAC,yHACnB;AAoCjG;IAgIE;;;;;OAKG;IACH,4BALW,OAAO,aAAa,EAAE,cAAc,gBACpC,OAAO,aAAa,EAAE,YAAY,WAClC,QAAQ,qBAAqB,CAAC,SAC9B,OAAO,EAejB;IAlJD;;;OAGG;IACH,iBAFU,OAAO,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAEhD;IAEN;;;;OAIG;IACH,iCAAe;IACf,mEAAqD;IAErD;;;OAGG;IAEH,mBAAU;IACV,gDAA2C;IAE3C;;;OAGG;IACH,uBAFU,OAAO,aAAa,EAAE,YA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JW,SAAS,WACT,GAAG,GACD,OAAO,yBAAyB,EAAE,UAAU,CAoBxD;IAOD;;;OAGG;IACH,mBAHW,SAAS,OACT,MAAM,QAWhB;IAED;;OAEG;IACH,qBAFW,SAAS,QAKnB;IAED,wBASC;CACF;wBAzoBY,OAAO,YAAY,EAAE,SAAS;wBAC9B,OAAO,YAAY,EAAE,SAAS;oCAC9B,OAAO,YAAY,EAAE,qBAAqB;mCAC1C,OAAO,YAAY,EAAE,oBAAoB;qCACzC,OAAO,YAAY,EAAE,sBAAsB;4BAC3C,OAAO,YAAY,EAAE,aAAa;2BAClC,OAAO,YAAY,EAAE,YAAY;8BACjC,OAAO,YAAY,EAAE,eAAe;yBACpC,OAAO,YAAY,EAAE,UAAU;0BAC/B,OAAO,YAAY,EAAE,WAAW;yBAChC,OAAO,YAAY,EAAE,UAAU;+BAC/B,OAAO,YAAY,EAAE,gBAAgB;6BACrC,OAAO,YAAY,EAAE,cAAc;gCACnC,OAAO,YAAY,EAAE,iBAAiB;8BACtC,OAAO,YAAY,EAAE,eAAe;2BACpC,OAAO,YAAY,EAAE,YAAY;2BACjC,OAAO,YAAY,EAAE,YAAY;yBACjC,OAAO,YAAY,EAAE,UAAU;8BAC/B,OAAO,YAAY,EAAE,eAAe;6BACpC,OAAO,YAAY,EAAE,cAAc;iCACnC,OAAO,YAAY,EAAE,kBAAkB;6BACvC,OAAO,YAAY,EAAE,cAAc;kCACnC,OAAO,YAAY,EAAE,mBAAmB;uBACxC,OAAO,YAAY,EAAE,QAAQ;+BAC7B,OAAO,YAAY,EAAE,gBAAgB;0BACrC,OAAO,YAAY,EAAE,WAAW;8BAChC,OAAO,YAAY,EAAE,eAAe;uBACpC,OAAO,YAAY,EAAE,QAAQ;4BAC7B,OAAO,YAAY,EAAE,aAAa;sBAClC,OAAO,YAAY,EAAE,OAAO;wBApCjB,oBAAoB"} |
| /** | ||
| * @param {import('../index.js').CompiledExpression[]} expressions | ||
| * @param {import('@json-layout/vocabulary').Expression} expression | ||
| * @param {any} data | ||
| * @param {import('./types.js').StateNodeOptions} options | ||
| * @param {import('./utils/display.js').Display} display | ||
| * @param {import('@json-layout/vocabulary').BaseCompObject} layout | ||
| * @param {Record<string, import('ajv').ValidateFunction>} validates | ||
| * @param {unknown} rootData | ||
| * @param {import('../compile/types.js').ParentContextExpression | null} parentContext | ||
| * @returns {any} | ||
| */ | ||
| export function evalExpression(expressions: import('../index.js').CompiledExpression[], expression: import('@json-layout/vocabulary').Expression, data: any, options: import('./types.js').StateNodeOptions, display: import('./utils/display.js').Display, layout: import('@json-layout/vocabulary').BaseCompObject, validates: Record<string, import('ajv').ValidateFunction>, rootData: unknown, parentContext: import('../compile/types.js').ParentContextExpression | null): any; | ||
| /** | ||
| * | ||
| * @param {import('./types.js').CreateStateTreeContext} context | ||
| * @param {import('./types.js').StateNodeOptions} parentOptions | ||
| * @param {import('../index.js').CompiledLayout} compiledLayout | ||
| * @param {string | number} key | ||
| * @param {string} fullKey | ||
| * @param {string | null} parentFullKey | ||
| * @param {string} dataPath | ||
| * @param {string | null} parentDataPath | ||
| * @param {import('../index.js').SkeletonNode} skeleton | ||
| * @param {import('@json-layout/vocabulary').Child | null} childDefinition | ||
| * @param {import('./utils/display.js').Display} parentDisplay | ||
| * @param {unknown} data | ||
| * @param {import('../compile/types.js').ParentContextExpression | null} parentContext | ||
| * @param {import('./types.js').ValidationState} validationState | ||
| * @param {import('./types.js').StateNode} [reusedNode] | ||
| * @returns {import('./types.js').StateNode} | ||
| */ | ||
| export function createStateNode(context: import('./types.js').CreateStateTreeContext, parentOptions: import('./types.js').StateNodeOptions, compiledLayout: import('../index.js').CompiledLayout, key: string | number, fullKey: string, parentFullKey: string | null, dataPath: string, parentDataPath: string | null, skeleton: import('../index.js').SkeletonNode, childDefinition: import('@json-layout/vocabulary').Child | null, parentDisplay: import('./utils/display.js').Display, data: unknown, parentContext: import('../compile/types.js').ParentContextExpression | null, validationState: import('./types.js').ValidationState, reusedNode?: import("./types.js").StateNode | undefined): import('./types.js').StateNode; | ||
| /** @type {(draft: any, node: import('./types.js').StateNode, data: unknown) => any} */ | ||
| export const producePatchedData: (draft: any, node: import('./types.js').StateNode, data: unknown) => any; | ||
| //# sourceMappingURL=state-node.d.ts.map |
| {"version":3,"file":"state-node.d.ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"AAsKA;;;;;;;;;;;GAWG;AACH,4CAXW,OAAO,aAAa,EAAE,kBAAkB,EAAE,cAC1C,OAAO,yBAAyB,EAAE,UAAU,QAC5C,GAAG,WACH,OAAO,YAAY,EAAE,gBAAgB,WACrC,OAAO,oBAAoB,EAAE,OAAO,UACpC,OAAO,yBAAyB,EAAE,cAAc,aAChD,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,gBAAgB,CAAC,YAC9C,OAAO,iBACP,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,IAAI,GAC1D,GAAG,CAef;AA+BD;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAjBW,OAAO,YAAY,EAAE,sBAAsB,iBAC3C,OAAO,YAAY,EAAE,gBAAgB,kBACrC,OAAO,aAAa,EAAE,cAAc,OACpC,MAAM,GAAG,MAAM,WACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,MAAM,kBACN,MAAM,GAAG,IAAI,YACb,OAAO,aAAa,EAAE,YAAY,mBAClC,OAAO,yBAAyB,EAAE,KAAK,GAAG,IAAI,iBAC9C,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,iBACP,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,IAAI,mBAC5D,OAAO,YAAY,EAAE,eAAe,4DAElC,OAAO,YAAY,EAAE,SAAS,CA0R1C;AAED,uFAAuF;AACvF,yCADmB,GAAG,QAAQ,OAAO,YAAY,EAAE,SAAS,QAAQ,OAAO,KAAK,GAAG,CAOjF"} |
| /** | ||
| * @param {import('./types.js').CreateStateTreeContext} context | ||
| * @param {import('./types.js').StatefulLayoutOptions} options | ||
| * @param {import('../index.js').CompiledLayout} compiledLayout | ||
| * @param {import('../index.js').SkeletonTree} skeleton | ||
| * @param {import('./utils/display.js').Display} display | ||
| * @param {unknown} data | ||
| * @param {import('./types.js').ValidationState} validationState | ||
| * @param {import('./types.js').StateTree} [reusedStateTree] | ||
| * @returns {import('./types.js').StateTree} | ||
| */ | ||
| export function createStateTree(context: import('./types.js').CreateStateTreeContext, options: import('./types.js').StatefulLayoutOptions, compiledLayout: import('../index.js').CompiledLayout, skeleton: import('../index.js').SkeletonTree, display: import('./utils/display.js').Display, data: unknown, validationState: import('./types.js').ValidationState, reusedStateTree?: import("./types.js").StateTree | undefined): import('./types.js').StateTree; | ||
| //# sourceMappingURL=state-tree.d.ts.map |
| {"version":3,"file":"state-tree.d.ts","sourceRoot":"","sources":["../../src/state/state-tree.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;GAUG;AACH,yCAVW,OAAO,YAAY,EAAE,sBAAsB,WAC3C,OAAO,YAAY,EAAE,qBAAqB,kBAC1C,OAAO,aAAa,EAAE,cAAc,YACpC,OAAO,aAAa,EAAE,YAAY,WAClC,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,mBACP,OAAO,YAAY,EAAE,eAAe,iEAElC,OAAO,YAAY,EAAE,SAAS,CAmD1C"} |
| import { type ErrorObject } from 'ajv/dist/2019.js'; | ||
| import { type BaseCompObject, type Cols, type StateNodeOptionsBase, type TextField, type Textarea, type NumberField, type Slider, type Checkbox, type Switch, type DatePicker, type DateTimePicker, type TimePicker, type ColorPicker, type Section, type OneOfSelect, type Select, type Autocomplete, type Tabs, type VerticalTabs, type ExpansionPanels, type Stepper, type List, type Combobox, type FileInput, type Child, type StateNodePropsLib } from '@json-layout/vocabulary'; | ||
| import { type SkeletonTree, type SkeletonNode, type StatefulLayout, type CompiledLayout } from '../index.js'; | ||
| import { type LocaleMessages } from '../i18n/types.js'; | ||
| export interface StateNode { | ||
| key: string | number; | ||
| fullKey: string; | ||
| parentFullKey: string | null; | ||
| dataPath: string; | ||
| parentDataPath: string | null; | ||
| skeleton: SkeletonNode; | ||
| layout: BaseCompObject; | ||
| cols: Cols; | ||
| data: unknown; | ||
| error: string | undefined; | ||
| childError: boolean | undefined; | ||
| validated: boolean; | ||
| width: number; | ||
| options: StateNodeOptions; | ||
| messages: LocaleMessages; | ||
| autofocus?: boolean; | ||
| autofocusChild?: string | number; | ||
| props?: StateNodePropsLib; | ||
| itemsCacheKey: any; | ||
| children?: StateNode[]; | ||
| } | ||
| export interface StateTree { | ||
| root: StateNode; | ||
| valid: boolean; | ||
| } | ||
| export interface CreateStateTreeContext { | ||
| errors?: ErrorObject[]; | ||
| additionalPropertiesErrors?: ErrorObject[]; | ||
| files: FileRef[]; | ||
| activeItems: Record<string, number>; | ||
| autofocusTarget: string | null; | ||
| initial: boolean; | ||
| rehydrate: boolean; | ||
| cacheKeys: Record<string, StateNodeCacheKey>; | ||
| rootData: unknown; | ||
| nodes: StateNode[]; | ||
| } | ||
| export interface FileRef { | ||
| file: File; | ||
| dataPath: string; | ||
| } | ||
| export type StateNodeCacheKey = [ | ||
| StateNodeOptions, | ||
| CompiledLayout, | ||
| string, | ||
| SkeletonNode, | ||
| Child | null, | ||
| number, | ||
| ValidationState, | ||
| Record<string, number>, | ||
| boolean, | ||
| unknown | ||
| ]; | ||
| export interface ValidationState { | ||
| initialized: boolean; | ||
| validatedForm: boolean; | ||
| validatedChildren: string[]; | ||
| } | ||
| export type StatefulLayoutEvents = { | ||
| data: any; | ||
| update: StatefulLayout; | ||
| autofocus: string; | ||
| }; | ||
| export type StateNodeOptions = Required<StateNodeOptionsBase & { | ||
| context: Record<string, any>; | ||
| messages: LocaleMessages; | ||
| }>; | ||
| export type StatefulLayoutOptions = StateNodeOptions & { | ||
| width: number; | ||
| }; | ||
| export type TextFieldNode = Omit<StateNode, 'children'> & { | ||
| layout: TextField; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type TextareaNode = Omit<StateNode, 'children'> & { | ||
| layout: Textarea; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type NumberFieldNode = Omit<StateNode, 'children'> & { | ||
| layout: NumberField; | ||
| data: number | undefined | null; | ||
| }; | ||
| export type SliderNode = Omit<StateNode, 'children'> & { | ||
| layout: Slider; | ||
| data: number | undefined | null; | ||
| }; | ||
| export type CheckboxNode = Omit<StateNode, 'children'> & { | ||
| layout: Checkbox; | ||
| data: boolean | undefined | null; | ||
| }; | ||
| export type SwitchNode = Omit<StateNode, 'children'> & { | ||
| layout: Switch; | ||
| data: boolean | undefined | null; | ||
| }; | ||
| export type DatePickerNode = Omit<StateNode, 'children'> & { | ||
| layout: DatePicker; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type DateTimePickerNode = Omit<StateNode, 'children'> & { | ||
| layout: DateTimePicker; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type TimePickerNode = Omit<StateNode, 'children'> & { | ||
| layout: TimePicker; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type ColorPickerNode = Omit<StateNode, 'children'> & { | ||
| layout: ColorPicker; | ||
| data: string | undefined | null; | ||
| }; | ||
| export type SectionNode = StateNode & { | ||
| layout: Section; | ||
| children: StateNode[]; | ||
| }; | ||
| export type OneOfSelectNode = StateNode & { | ||
| layout: OneOfSelect; | ||
| data: Record<string, unknown>; | ||
| childrenTrees: SkeletonTree[]; | ||
| }; | ||
| export type SelectNode = Omit<StateNode, 'children'> & { | ||
| layout: Select; | ||
| data: any; | ||
| }; | ||
| export type AutocompleteNode = Omit<StateNode, 'children'> & { | ||
| layout: Autocomplete; | ||
| data: any; | ||
| }; | ||
| export type RadioGroupNode = Omit<StateNode, 'children'> & { | ||
| layout: Select; | ||
| data: any; | ||
| }; | ||
| export type CheckboxGroupNode = Omit<StateNode, 'children'> & { | ||
| layout: Select; | ||
| data: any; | ||
| }; | ||
| export type SwitchGroupNode = Omit<StateNode, 'children'> & { | ||
| layout: Select; | ||
| data: any; | ||
| }; | ||
| export type TabsNode = StateNode & { | ||
| layout: Tabs; | ||
| children: StateNode[]; | ||
| }; | ||
| export type VerticalTabsNode = StateNode & { | ||
| layout: VerticalTabs; | ||
| children: StateNode[]; | ||
| }; | ||
| export type ExpansionPanelsNode = StateNode & { | ||
| layout: ExpansionPanels; | ||
| children: StateNode[]; | ||
| }; | ||
| export type StepperNode = StateNode & { | ||
| layout: Stepper; | ||
| children: StateNode[]; | ||
| }; | ||
| export type ListNode = StateNode & { | ||
| layout: List; | ||
| data: any[]; | ||
| children: StateNode[]; | ||
| childrenTrees: SkeletonTree[]; | ||
| }; | ||
| export type ComboboxNode = Omit<StateNode, 'children'> & { | ||
| layout: Combobox; | ||
| data: any[]; | ||
| }; | ||
| export type FileInputNode = Omit<StateNode, 'children'> & { | ||
| layout: FileInput; | ||
| data: object | undefined | null; | ||
| }; | ||
| //# sourceMappingURL=types.d.ts.map |
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa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AS,GAAG;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA;AAE1E,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA;AAE1F,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA;AAEhG,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA;AAEhF,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAC;IAAC,aAAa,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAEtH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAAA;AAE1F,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;CAAE,CAAA"} |
| /** | ||
| * @param {Display} parentDisplay | ||
| * @param {import("@json-layout/vocabulary").ColsObj | undefined} colsObj | ||
| * @returns {[Display, import("@json-layout/vocabulary").Cols]} | ||
| */ | ||
| export function getChildDisplay(parentDisplay: Display, colsObj: import("@json-layout/vocabulary").ColsObj | undefined): [Display, import("@json-layout/vocabulary").Cols]; | ||
| export class Display { | ||
| /** | ||
| * @param {number} width | ||
| */ | ||
| constructor(width: number); | ||
| /** | ||
| * @readonly | ||
| * @type {number} | ||
| */ | ||
| readonly width: number; | ||
| /** @returns {BreakPointName} */ | ||
| get name(): BreakPointName; | ||
| /** @returns {boolean} */ | ||
| get xs(): boolean; | ||
| /** @returns {boolean} */ | ||
| get sm(): boolean; | ||
| /** @returns {boolean} */ | ||
| get smAndDown(): boolean; | ||
| /** @returns {boolean} */ | ||
| get smAndUp(): boolean; | ||
| /** @returns {boolean} */ | ||
| get md(): boolean; | ||
| /** @returns {boolean} */ | ||
| get mdAndDown(): boolean; | ||
| /** @returns {boolean} */ | ||
| get mobile(): boolean; | ||
| /** @returns {boolean} */ | ||
| get mdAndUp(): boolean; | ||
| /** @returns {boolean} */ | ||
| get lg(): boolean; | ||
| /** @returns {boolean} */ | ||
| get lgAndDown(): boolean; | ||
| /** @returns {boolean} */ | ||
| get lgAndUp(): boolean; | ||
| /** @returns {boolean} */ | ||
| get xl(): boolean; | ||
| /** @returns {boolean} */ | ||
| get xlAndDown(): boolean; | ||
| /** @returns {boolean} */ | ||
| get xlAndUp(): boolean; | ||
| /** @returns {boolean} */ | ||
| get xxl(): boolean; | ||
| } | ||
| export type BreakPointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; | ||
| //# sourceMappingURL=display.d.ts.map |
| {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../src/state/utils/display.js"],"names":[],"mappings":"AAoHA;;;;GAIG;AACH,+CAJW,OAAO,WACP,OAAO,yBAAyB,EAAE,OAAO,GAAG,SAAS,GACnD,CAAC,OAAO,EAAE,OAAO,yBAAyB,EAAE,IAAI,CAAC,CAY7D;AAjHD;IAOE;;OAEG;IACH,mBAFW,MAAM,EAIhB;IAXD;;;OAGG;IACH,gBAFU,MAAM,CAEX;IASL,gCAAgC;IAChC,2BAKC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,sBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,mBAEC;CACF;6BAhHa,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK"} |
| /** | ||
| * @template ItemType | ||
| * @param {ItemType[]} previousArray | ||
| * @param {ItemType[]} newArray | ||
| * @returns {ItemType[]} | ||
| */ | ||
| export function shallowProduceArray<ItemType>(previousArray?: ItemType[], newArray?: ItemType[]): ItemType[]; | ||
| /** | ||
| * @param {Record<string, any>} previousObj | ||
| * @param {Record<string, any>} newObj | ||
| * @returns {Record<string, any>} | ||
| */ | ||
| export function shallowProduceObject(previousObj?: Record<string, any>, newObj?: Record<string, any>): Record<string, any>; | ||
| /** | ||
| * @template ItemType | ||
| * @param {any[]} a1 | ||
| * @param {any[]} a2 | ||
| * @returns {boolean} | ||
| */ | ||
| export function shallowEqualArray<ItemType>(a1?: any[], a2?: any[]): boolean; | ||
| //# sourceMappingURL=immutable.d.ts.map |
| {"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/state/utils/immutable.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,6GAIC;AAED;;;;GAIG;AACH,mDAJW,OAAO,MAAM,EAAE,GAAG,CAAC,WACnB,OAAO,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,MAAM,EAAE,GAAG,CAAC,CAW/B;AAED;;;;;GAKG;AACH,iDAJW,GAAG,EAAE,OACL,GAAG,EAAE,GACH,OAAO,CAMnB"} |
| /** @type {string[]} */ | ||
| export const commonjsDeps: string[]; | ||
| /** @type {string[][]} */ | ||
| export const commonjsDepsPaths: string[][]; | ||
| //# sourceMappingURL=build.d.ts.map |
| {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/utils/build.js"],"names":[],"mappings":"AAEA,uBAAuB;AACvB,2BADW,MAAM,EAAE,CAUlB;AAED,yBAAyB;AACzB,gCADW,MAAM,EAAE,EAAE,CAUpB"} |
| declare function _default(o: any): any; | ||
| export default _default; | ||
| //# sourceMappingURL=clone.d.ts.map |
| {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/utils/clone.js"],"names":[],"mappings":"AAoCE,uCAyBC"} |
| /** | ||
| * @typedef {{key: string, description: string, default?: any, values?: Record<string, any>}[]} DocOptions | ||
| */ | ||
| /** @type {DocOptions} */ | ||
| export const compileOptions: DocOptions; | ||
| /** @type {DocOptions} */ | ||
| export const runtimeOptions: DocOptions; | ||
| export type DocOptions = { | ||
| key: string; | ||
| description: string; | ||
| default?: any; | ||
| values?: Record<string, any>; | ||
| }[]; | ||
| //# sourceMappingURL=doc-options.d.ts.map |
| {"version":3,"file":"doc-options.d.ts","sourceRoot":"","sources":["../../src/utils/doc-options.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH,yBAAyB;AACzB,wCA+BC;AAED,yBAAyB;AACzB,wCAoGC;yBA1IY;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,CAAA;CAAC,EAAE"} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
103140
-28.58%22
-64.52%2667
-18.54%