@json-layout/core 0.24.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/compile/index.js +5 -1
- package/src/compile/serialize.js +1 -0
- package/src/compile/skeleton-node.js +175 -130
- package/src/compile/skeleton-tree.js +23 -17
- package/src/compile/types.ts +5 -4
- package/src/i18n/index.js +3 -1
- package/src/i18n/nl.js +33 -0
- package/src/state/state-node.js +20 -9
- package/src/state/state-tree.js +12 -2
- package/src/utils/doc-options.js +5 -5
- package/types/compile/index.d.ts +0 -16
- package/types/compile/index.d.ts.map +0 -1
- package/types/compile/serialize.d.ts +0 -6
- package/types/compile/serialize.d.ts.map +0 -1
- package/types/compile/skeleton-node.d.ts +0 -21
- package/types/compile/skeleton-node.d.ts.map +0 -1
- package/types/compile/skeleton-tree.d.ts +0 -16
- package/types/compile/skeleton-tree.d.ts.map +0 -1
- package/types/compile/types.d.ts +0 -58
- package/types/compile/types.d.ts.map +0 -1
- package/types/compile/utils/resolve-refs.d.ts +0 -17
- package/types/compile/utils/resolve-refs.d.ts.map +0 -1
- package/types/i18n/en.d.ts +0 -3
- package/types/i18n/en.d.ts.map +0 -1
- package/types/i18n/fr.d.ts +0 -3
- package/types/i18n/fr.d.ts.map +0 -1
- package/types/i18n/index.d.ts +0 -3
- package/types/i18n/index.d.ts.map +0 -1
- package/types/i18n/types.d.ts +0 -36
- package/types/i18n/types.d.ts.map +0 -1
- package/types/index.d.ts +0 -5
- package/types/index.d.ts.map +0 -1
- package/types/state/index.d.ts +0 -278
- package/types/state/index.d.ts.map +0 -1
- package/types/state/state-node.d.ts +0 -36
- package/types/state/state-node.d.ts.map +0 -1
- package/types/state/state-tree.d.ts +0 -13
- package/types/state/state-tree.d.ts.map +0 -1
- package/types/state/types.d.ts +0 -173
- package/types/state/types.d.ts.map +0 -1
- package/types/state/utils/display.d.ts +0 -51
- package/types/state/utils/display.d.ts.map +0 -1
- package/types/state/utils/immutable.d.ts +0 -21
- package/types/state/utils/immutable.d.ts.map +0 -1
- package/types/utils/build.d.ts +0 -5
- package/types/utils/build.d.ts.map +0 -1
- package/types/utils/clone.d.ts +0 -3
- package/types/utils/clone.d.ts.map +0 -1
- package/types/utils/doc-options.d.ts +0 -14
- package/types/utils/doc-options.d.ts.map +0 -1
package/src/state/state-node.js
CHANGED
|
@@ -138,6 +138,7 @@ const produceCompositeChildrenOptions = produce((draft, section) => {
|
|
|
138
138
|
})
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
+
* should match if an error belongs to this exact node
|
|
141
142
|
* @param {import('ajv').ErrorObject} error
|
|
142
143
|
* @param {import('../index.js').SkeletonNode} skeleton
|
|
143
144
|
* @param {string} dataPath
|
|
@@ -147,11 +148,12 @@ const produceCompositeChildrenOptions = produce((draft, section) => {
|
|
|
147
148
|
const matchError = (error, skeleton, dataPath, parentDataPath) => {
|
|
148
149
|
const originalError = error.params?.errors?.[0] ?? error
|
|
149
150
|
if (parentDataPath === originalError.instancePath && originalError.params?.missingProperty === skeleton.key) return true
|
|
150
|
-
if (originalError.instancePath === dataPath && originalError.schemaPath === skeleton.pointer) return true
|
|
151
|
+
if (originalError.instancePath === dataPath && (originalError.schemaPath === skeleton.pointer || originalError.schemaPath === skeleton.refPointer)) return true
|
|
151
152
|
return false
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
/**
|
|
156
|
+
* should match if an error belongs to a child of the current node but the child was not displayed
|
|
155
157
|
* @param {import('ajv').ErrorObject} error
|
|
156
158
|
* @param {import('../index.js').SkeletonNode} skeleton
|
|
157
159
|
* @param {string} dataPath
|
|
@@ -159,11 +161,15 @@ const matchError = (error, skeleton, dataPath, parentDataPath) => {
|
|
|
159
161
|
* @returns {boolean}
|
|
160
162
|
*/
|
|
161
163
|
const matchChildError = (error, skeleton, dataPath, parentDataPath) => {
|
|
164
|
+
const originalError = error.params?.errors?.[0] ?? error
|
|
162
165
|
if (!(
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
originalError.schemaPath === skeleton.pointer ||
|
|
167
|
+
originalError.schemaPath.startsWith(skeleton.pointer + '/')
|
|
168
|
+
) && !(
|
|
169
|
+
originalError.schemaPath === skeleton.refPointer ||
|
|
170
|
+
originalError.schemaPath.startsWith(skeleton.refPointer + '/')
|
|
165
171
|
)) return false
|
|
166
|
-
if (
|
|
172
|
+
if (originalError.instancePath.startsWith(dataPath)) return true
|
|
167
173
|
return false
|
|
168
174
|
}
|
|
169
175
|
|
|
@@ -303,7 +309,9 @@ export function createStateNode (
|
|
|
303
309
|
['remove', 'hide'].includes(options.readOnlyPropertiesMode) &&
|
|
304
310
|
skeleton.roPropertyKeys?.includes(/** @type {string} */(childLayout.key))
|
|
305
311
|
) continue
|
|
306
|
-
|
|
312
|
+
let childSkeleton = skeleton
|
|
313
|
+
const childSkeletonKey = skeleton.children?.find(c => compiledLayout.skeletonNodes[c].key === childLayout.key)
|
|
314
|
+
if (childSkeletonKey !== undefined) childSkeleton = compiledLayout.skeletonNodes[childSkeletonKey]
|
|
307
315
|
if (childSkeleton.condition) {
|
|
308
316
|
if (!evalExpression(compiledLayout.expressions, childSkeleton.condition, objectData, parentOptions, display, layout, compiledLayout.validates, context.rootData, parentContext)) {
|
|
309
317
|
continue
|
|
@@ -337,16 +345,19 @@ export function createStateNode (
|
|
|
337
345
|
if (key === '$oneOf' && skeleton.childrenTrees) {
|
|
338
346
|
// find the oneOf child that was either previously selected, if none were selected select the child that is valid with current data
|
|
339
347
|
/** @type {number} */
|
|
340
|
-
const activeChildTreeIndex = fullKey in context.activatedItems ? context.activatedItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[compiledLayout.skeletonTrees[childTree].root
|
|
348
|
+
const activeChildTreeIndex = fullKey in context.activatedItems ? context.activatedItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[compiledLayout.skeletonTrees[childTree].root](data))
|
|
341
349
|
if (activeChildTreeIndex !== -1) {
|
|
342
350
|
context.errors = context.errors?.filter(error => {
|
|
343
351
|
const originalError = error.params?.errors?.[0] ?? error
|
|
352
|
+
// console.log(originalError.schemaPath, skeleton.pointer, skeleton.refPointer)
|
|
344
353
|
// if an item was selected, remove the oneOf error
|
|
345
|
-
if (originalError.schemaPath === skeleton.pointer && originalError.keyword === 'oneOf') return false
|
|
354
|
+
if ((originalError.schemaPath === skeleton.pointer || originalError.schemaPath === skeleton.refPointer) && originalError.keyword === 'oneOf') return false
|
|
346
355
|
// also remove the errors from other children of the oneOf
|
|
347
356
|
if (originalError.schemaPath.startsWith(skeleton.pointer) && !originalError.schemaPath.startsWith(skeleton.pointer + '/' + activeChildTreeIndex)) return false
|
|
357
|
+
if (originalError.schemaPath.startsWith(skeleton.refPointer) && !originalError.schemaPath.startsWith(skeleton.refPointer + '/' + activeChildTreeIndex)) return false
|
|
348
358
|
return true
|
|
349
359
|
})
|
|
360
|
+
// console.log(context.errors?.map(error => error.params?.errors?.[0] ?? error))
|
|
350
361
|
const activeChildKey = `${fullKey}/${activeChildTreeIndex}`
|
|
351
362
|
if (context.autofocusTarget === fullKey) context.autofocusTarget = activeChildKey
|
|
352
363
|
const activeChildTree = compiledLayout.skeletonTrees[skeleton.childrenTrees[activeChildTreeIndex]]
|
|
@@ -360,7 +371,7 @@ export function createStateNode (
|
|
|
360
371
|
fullKey,
|
|
361
372
|
dataPath,
|
|
362
373
|
dataPath,
|
|
363
|
-
activeChildTree.root,
|
|
374
|
+
compiledLayout.skeletonNodes[activeChildTree.root],
|
|
364
375
|
null,
|
|
365
376
|
display,
|
|
366
377
|
data,
|
|
@@ -374,7 +385,7 @@ export function createStateNode (
|
|
|
374
385
|
|
|
375
386
|
if (layout.comp === 'list') {
|
|
376
387
|
const arrayData = /** @type {unknown[]} */(data ?? [])
|
|
377
|
-
const childSkeleton = /** @type {import('../index.js').SkeletonNode} */(skeleton?.childrenTrees?.[0] && compiledLayout.skeletonTrees[skeleton?.childrenTrees?.[0]]?.root)
|
|
388
|
+
const childSkeleton = /** @type {import('../index.js').SkeletonNode} */(skeleton?.childrenTrees?.[0] && compiledLayout.skeletonNodes[compiledLayout.skeletonTrees[skeleton?.childrenTrees?.[0]]?.root])
|
|
378
389
|
const listItemOptions = layout.listEditMode === 'inline' ? options : produceReadonlyArrayItemOptions(options)
|
|
379
390
|
children = []
|
|
380
391
|
let focusChild = context.autofocusTarget === fullKey
|
package/src/state/state-tree.js
CHANGED
|
@@ -45,13 +45,23 @@ export function createStateTree (
|
|
|
45
45
|
validationState,
|
|
46
46
|
reusedStateTree
|
|
47
47
|
) {
|
|
48
|
-
const validate = compiledLayout.validates[skeleton.root
|
|
48
|
+
const validate = compiledLayout.validates[skeleton.root]
|
|
49
49
|
const valid = validate(data)
|
|
50
50
|
if (validate.errors) {
|
|
51
51
|
for (const error of validate.errors) {
|
|
52
52
|
if (error.keyword !== 'errorMessage') compiledLayout.localizeErrors([error])
|
|
53
53
|
}
|
|
54
54
|
context.errors = validate.errors
|
|
55
|
+
if (context.errors.length) {
|
|
56
|
+
for (const error of context.errors) {
|
|
57
|
+
const originalError = error.params?.errors?.[0] ?? error
|
|
58
|
+
// work around this issue https://github.com/ajv-validator/ajv/issues/512
|
|
59
|
+
if (originalError?.parentSchema.__pointer) {
|
|
60
|
+
originalError.schemaPath = originalError?.parentSchema.__pointer
|
|
61
|
+
if (originalError.keyword === 'oneOf') originalError.schemaPath += '/oneOf'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
if ([true, 'error'].includes(options.removeAdditional)) {
|
|
56
66
|
context.additionalPropertiesErrors = validate.errors.filter(error => error.keyword === 'additionalProperties' || error.keyword === 'unevaluatedProperties')
|
|
57
67
|
}
|
|
@@ -65,7 +75,7 @@ export function createStateTree (
|
|
|
65
75
|
null,
|
|
66
76
|
'',
|
|
67
77
|
null,
|
|
68
|
-
skeleton.root,
|
|
78
|
+
compiledLayout.skeletonNodes[skeleton.root],
|
|
69
79
|
null,
|
|
70
80
|
display,
|
|
71
81
|
data,
|
package/src/utils/doc-options.js
CHANGED
|
@@ -124,11 +124,6 @@ export const runtimeOptions = [
|
|
|
124
124
|
false: 'Never remove additional properties (alias "none").'
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
{
|
|
128
|
-
key: 'autofocus',
|
|
129
|
-
description: 'Activate autofocus. The focus will be given to the first input of the form.',
|
|
130
|
-
default: false
|
|
131
|
-
},
|
|
132
127
|
{
|
|
133
128
|
key: 'readOnlyPropertiesMode',
|
|
134
129
|
description: 'Control the way readOnly properties from the schema are managed.',
|
|
@@ -138,5 +133,10 @@ export const runtimeOptions = [
|
|
|
138
133
|
hide: 'Hide the readOnly properties but keep them in the data.',
|
|
139
134
|
show: 'Show the readOnly properties.'
|
|
140
135
|
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: 'autofocus',
|
|
139
|
+
description: 'Activate autofocus. The focus will be given to the first input of the form.',
|
|
140
|
+
default: false
|
|
141
141
|
}
|
|
142
142
|
]
|
package/types/compile/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {object} _schema
|
|
3
|
-
* @param {PartialCompileOptions} [partialOptions]
|
|
4
|
-
* @returns {CompiledLayout}
|
|
5
|
-
*/
|
|
6
|
-
export function compile(_schema: object, partialOptions?: import("./types.js").PartialCompileOptions | undefined): CompiledLayout;
|
|
7
|
-
export { resolveLocaleRefs } from "./utils/resolve-refs.js";
|
|
8
|
-
/** @type {(draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions} */
|
|
9
|
-
export const produceCompileOptions: (draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions;
|
|
10
|
-
export type SkeletonTree = import('./types.js').SkeletonTree;
|
|
11
|
-
export type SkeletonNode = import('./types.js').SkeletonNode;
|
|
12
|
-
export type CompiledLayout = import('./types.js').CompiledLayout;
|
|
13
|
-
export type CompileOptions = import('./types.js').CompileOptions;
|
|
14
|
-
export type PartialCompileOptions = import('./types.js').PartialCompileOptions;
|
|
15
|
-
export type CompiledExpression = import('./types.js').CompiledExpression;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AA0GA;;;;GAIG;AACH,iCAJW,MAAM,4EAEJ,cAAc,CA0F1B;;AApKD,yGAAyG;AACzG,4CADmB,qBAAqB,cAAc,qBAAqB,KAAK,qBAAqB,CAiBnG;2BAjCW,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CAmFlB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {any} rawSchema
|
|
3
|
-
* @param {string} sourceSchemaId
|
|
4
|
-
* @param {import('./index.js').CompileOptions} options
|
|
5
|
-
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
6
|
-
* @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees
|
|
7
|
-
* @param {string[]} validates
|
|
8
|
-
* @param {Record<string, string[]>} validationErrors
|
|
9
|
-
* @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
|
|
10
|
-
* @param {import('@json-layout/vocabulary').Expression[]} expressions
|
|
11
|
-
* @param {string | number} key
|
|
12
|
-
* @param {string} currentPointer
|
|
13
|
-
* @param {string | null} parentPointer
|
|
14
|
-
* @param {boolean} required
|
|
15
|
-
* @param {string} [condition]
|
|
16
|
-
* @param {boolean} [dependent]
|
|
17
|
-
* @param {string} [knownType]
|
|
18
|
-
* @returns {import('./types.js').SkeletonNode}
|
|
19
|
-
*/
|
|
20
|
-
export function makeSkeletonNode(rawSchema: any, sourceSchemaId: string, options: import('./index.js').CompileOptions, getJSONRef: (schemaId: string, ref: string) => [any, string, string], skeletonTrees: Record<string, import('./types.js').SkeletonTree>, validates: string[], validationErrors: Record<string, string[]>, normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], key: string | number, currentPointer: string, parentPointer: string | null, required: boolean, condition?: string | undefined, dependent?: boolean | undefined, knownType?: string | undefined): import('./types.js').SkeletonNode;
|
|
21
|
-
//# sourceMappingURL=skeleton-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,4CAlBW,GAAG,kBACH,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,yBACxB,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,iBACxD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,aACjD,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,kBACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,OAAO,oGAIL,OAAO,YAAY,EAAE,YAAY,CA8W7C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {any} schema
|
|
3
|
-
* @param {string} schemaId
|
|
4
|
-
* @param {import('./index.js').CompileOptions} options
|
|
5
|
-
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
6
|
-
* @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees
|
|
7
|
-
* @param {string[]} validates
|
|
8
|
-
* @param {Record<string, string[]>} validationErrors
|
|
9
|
-
* @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
|
|
10
|
-
* @param {import('@json-layout/vocabulary').Expression[]} expressions
|
|
11
|
-
* @param {string} pointer
|
|
12
|
-
* @param {string} title
|
|
13
|
-
* @returns {import('./types.js').SkeletonTree}
|
|
14
|
-
*/
|
|
15
|
-
export function makeSkeletonTree(schema: any, schemaId: string, options: import('./index.js').CompileOptions, getJSONRef: (schemaId: string, ref: string) => [any, string, string], skeletonTrees: Record<string, import('./types.js').SkeletonTree>, 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;
|
|
16
|
-
//# sourceMappingURL=skeleton-tree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-tree.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-tree.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,yCAbW,GAAG,YACH,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,yBACxB,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,iBACxD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,aACjD,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,CAgC7C"}
|
package/types/compile/types.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type ajvModule from 'ajv/dist/2019.js';
|
|
2
|
-
import type MarkdownIt from 'markdown-it';
|
|
3
|
-
import { type ComponentInfo, type BaseCompObject, type NormalizedLayout, type StateNodeOptionsBase, type Expression } from '@json-layout/vocabulary';
|
|
4
|
-
import { type ValidateFunction, type SchemaObject } from 'ajv/dist/2019.js';
|
|
5
|
-
import { type Display } from '../state/utils/display.js';
|
|
6
|
-
import { type LocaleMessages } from '../i18n/types.js';
|
|
7
|
-
export interface ParentContextExpression {
|
|
8
|
-
data: unknown;
|
|
9
|
-
parent: ParentContextExpression | undefined | null;
|
|
10
|
-
}
|
|
11
|
-
export type CompiledExpression = (data: any, options: StateNodeOptionsBase, context: object, display: Display, layout: BaseCompObject, validates: Record<string, ValidateFunction>, rootData?: unknown, parent?: ParentContextExpression | null) => any;
|
|
12
|
-
export interface CompileOptions {
|
|
13
|
-
ajv: ajvModule.default;
|
|
14
|
-
ajvOptions?: ajvModule.Options;
|
|
15
|
-
code: boolean;
|
|
16
|
-
markdown: (text: string) => string;
|
|
17
|
-
markdownItOptions?: MarkdownIt.Options;
|
|
18
|
-
locale: string;
|
|
19
|
-
messages: LocaleMessages;
|
|
20
|
-
optionsKeys: string[];
|
|
21
|
-
components: Record<string, ComponentInfo>;
|
|
22
|
-
}
|
|
23
|
-
export type PartialCompileOptions = Partial<Omit<CompileOptions, 'messages'>> & {
|
|
24
|
-
messages?: Partial<LocaleMessages>;
|
|
25
|
-
components?: Record<string, Omit<ComponentInfo, 'name'>>;
|
|
26
|
-
};
|
|
27
|
-
export interface CompiledLayout {
|
|
28
|
-
options?: CompileOptions;
|
|
29
|
-
schema?: SchemaObject;
|
|
30
|
-
mainTree: string;
|
|
31
|
-
skeletonTrees: Record<string, SkeletonTree>;
|
|
32
|
-
validates: Record<string, ValidateFunction>;
|
|
33
|
-
validationErrors: Record<string, string[]>;
|
|
34
|
-
normalizedLayouts: Record<string, NormalizedLayout>;
|
|
35
|
-
expressions: CompiledExpression[];
|
|
36
|
-
locale: string;
|
|
37
|
-
messages: LocaleMessages;
|
|
38
|
-
components: Record<string, Omit<ComponentInfo, 'schema'>>;
|
|
39
|
-
localizeErrors: (errors: ajvModule.ErrorObject[]) => void;
|
|
40
|
-
}
|
|
41
|
-
export interface SkeletonTree {
|
|
42
|
-
title: string;
|
|
43
|
-
root: SkeletonNode;
|
|
44
|
-
}
|
|
45
|
-
export interface SkeletonNode {
|
|
46
|
-
key: string | number;
|
|
47
|
-
pointer: string;
|
|
48
|
-
parentPointer: string | null;
|
|
49
|
-
pure: boolean;
|
|
50
|
-
propertyKeys: string[];
|
|
51
|
-
roPropertyKeys: string[];
|
|
52
|
-
condition?: Expression;
|
|
53
|
-
children?: SkeletonNode[];
|
|
54
|
-
childrenTrees?: string[];
|
|
55
|
-
required?: boolean;
|
|
56
|
-
nullable?: boolean;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compile/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mutates a schema by replacing ~$locale~ in all refs
|
|
3
|
-
* @param {import('ajv').SchemaObject} schema
|
|
4
|
-
* @param {ajvModule.default} ajv
|
|
5
|
-
* @param {string} locale
|
|
6
|
-
* @returns {(schemaId: string, ref: string) => [any, string, string]}
|
|
7
|
-
*/
|
|
8
|
-
export function resolveLocaleRefs(schema: import('ajv').SchemaObject, ajv: ajvModule.default, locale?: string): (schemaId: string, ref: string) => [any, string, string];
|
|
9
|
-
/**
|
|
10
|
-
* partially resolve a schema but not recursively, used for layout normalization
|
|
11
|
-
* @param {import('ajv').SchemaObject} schema
|
|
12
|
-
* @param {string} schemaId
|
|
13
|
-
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
14
|
-
*/
|
|
15
|
-
export function partialResolveRefs(schema: import('ajv').SchemaObject, schemaId: string, getJSONRef: (schemaId: string, ref: string) => [any, string, string]): any;
|
|
16
|
-
import ajvModule from 'ajv/dist/2019.js';
|
|
17
|
-
//# sourceMappingURL=resolve-refs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-refs.d.ts","sourceRoot":"","sources":["../../../src/compile/utils/resolve-refs.js"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH,0CALW,OAAO,KAAK,EAAE,YAAY,OAC1B,UAAU,OAAO,WACjB,MAAM,cACO,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CASpE;AAsCD;;;;;GAKG;AACH,2CAJW,OAAO,KAAK,EAAE,YAAY,YAC1B,MAAM,yBACK,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,OA+ClE;sBAjIqB,kBAAkB"}
|
package/types/i18n/en.d.ts
DELETED
package/types/i18n/en.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"}
|
package/types/i18n/fr.d.ts
DELETED
package/types/i18n/fr.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"}
|
package/types/i18n/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.js"],"names":[],"mappings":"wBAGW,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,cAAc,CAAC"}
|
package/types/i18n/types.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export interface CompileOptionsMessages {
|
|
2
|
-
errorOneOf: string;
|
|
3
|
-
errorRequired: string;
|
|
4
|
-
}
|
|
5
|
-
export interface StateOptionsMessages {
|
|
6
|
-
addItem: string;
|
|
7
|
-
delete: string;
|
|
8
|
-
edit: string;
|
|
9
|
-
close: string;
|
|
10
|
-
duplicate: string;
|
|
11
|
-
sort: string;
|
|
12
|
-
up: string;
|
|
13
|
-
down: string;
|
|
14
|
-
showHelp: string;
|
|
15
|
-
mdeLink1: string;
|
|
16
|
-
mdeLink2: string;
|
|
17
|
-
mdeImg1: string;
|
|
18
|
-
mdeImg2: string;
|
|
19
|
-
mdeTable1: string;
|
|
20
|
-
mdeTable2: string;
|
|
21
|
-
bold: string;
|
|
22
|
-
italic: string;
|
|
23
|
-
heading: string;
|
|
24
|
-
quote: string;
|
|
25
|
-
unorderedList: string;
|
|
26
|
-
orderedList: string;
|
|
27
|
-
createLink: string;
|
|
28
|
-
insertImage: string;
|
|
29
|
-
createTable: string;
|
|
30
|
-
preview: string;
|
|
31
|
-
mdeGuide: string;
|
|
32
|
-
undo: string;
|
|
33
|
-
redo: string;
|
|
34
|
-
}
|
|
35
|
-
export type LocaleMessages = CompileOptionsMessages & StateOptionsMessages;
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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"}
|
package/types/index.d.ts
DELETED
package/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|