@json-layout/core 0.16.1 → 0.16.3

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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/src/state/state-node.js +8 -0
  3. package/types/compile/index.d.ts +16 -0
  4. package/types/compile/index.d.ts.map +1 -0
  5. package/types/compile/serialize.d.ts +6 -0
  6. package/types/compile/serialize.d.ts.map +1 -0
  7. package/types/compile/skeleton-node.d.ts +15 -0
  8. package/types/compile/skeleton-node.d.ts.map +1 -0
  9. package/types/compile/skeleton-tree.d.ts +13 -0
  10. package/types/compile/skeleton-tree.d.ts.map +1 -0
  11. package/types/compile/types.d.ts +50 -0
  12. package/types/compile/types.d.ts.map +1 -0
  13. package/types/compile/utils/resolve-refs.d.ts +9 -0
  14. package/types/compile/utils/resolve-refs.d.ts.map +1 -0
  15. package/types/i18n/en.d.ts +3 -0
  16. package/types/i18n/en.d.ts.map +1 -0
  17. package/types/i18n/fr.d.ts +3 -0
  18. package/types/i18n/fr.d.ts.map +1 -0
  19. package/types/i18n/index.d.ts +3 -0
  20. package/types/i18n/index.d.ts.map +1 -0
  21. package/types/i18n/types.d.ts +35 -0
  22. package/types/i18n/types.d.ts.map +1 -0
  23. package/types/index.d.ts +5 -0
  24. package/types/index.d.ts.map +1 -0
  25. package/types/state/index.d.ts +263 -0
  26. package/types/state/index.d.ts.map +1 -0
  27. package/types/state/state-node.d.ts +35 -0
  28. package/types/state/state-node.d.ts.map +1 -0
  29. package/types/state/state-tree.d.ts +13 -0
  30. package/types/state/state-tree.d.ts.map +1 -0
  31. package/types/state/types.d.ts +162 -0
  32. package/types/state/types.d.ts.map +1 -0
  33. package/types/state/utils/display.d.ts +51 -0
  34. package/types/state/utils/display.d.ts.map +1 -0
  35. package/types/state/utils/immutable.d.ts +21 -0
  36. package/types/state/utils/immutable.d.ts.map +1 -0
  37. package/types/utils/build.d.ts +5 -0
  38. package/types/utils/build.d.ts.map +1 -0
  39. package/types/utils/clone.d.ts +3 -0
  40. package/types/utils/clone.d.ts.map +1 -0
  41. package/types/utils/doc-options.d.ts +14 -0
  42. package/types/utils/doc-options.d.ts.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-layout/core",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "Compilation and state management utilities for JSON Layout.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -319,6 +319,14 @@ export function createStateNode (
319
319
  /** @type {number} */
320
320
  const activeChildTreeIndex = fullKey in context.activeItems ? context.activeItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[childTree.root.pointer](data))
321
321
  if (activeChildTreeIndex !== -1) {
322
+ context.errors = context.errors?.filter(error => {
323
+ const originalError = error.params?.errors?.[0] ?? error
324
+ // if an item was selected, remove the oneOf error
325
+ if (originalError.schemaPath === skeleton.pointer && originalError.keyword === 'oneOf') return false
326
+ // also remove the errors from other children of the oneOf
327
+ if (originalError.schemaPath.startsWith(skeleton.pointer) && !originalError.schemaPath.startsWith(skeleton.pointer + '/' + activeChildTreeIndex)) return false
328
+ return true
329
+ })
322
330
  context.activeItems = produce(context.activeItems, draft => { draft[fullKey] = activeChildTreeIndex })
323
331
  const activeChildKey = `${fullKey}/${activeChildTreeIndex}`
324
332
  if (context.autofocusTarget === fullKey) context.autofocusTarget = activeChildKey
@@ -0,0 +1,16 @@
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 { resolveRefs } 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
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param {import('./index.js').CompiledLayout} compiledLayout
3
+ * @returns {string}
4
+ */
5
+ export function serialize(compiledLayout: import('./index.js').CompiledLayout): string;
6
+ //# sourceMappingURL=serialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CA+ElB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param {any} schema
3
+ * @param {import('./index.js').CompileOptions} options
4
+ * @param {string[]} validates
5
+ * @param {Record<string, string[]>} validationErrors
6
+ * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
7
+ * @param {import('@json-layout/vocabulary').Expression[]} expressions
8
+ * @param {string | number} key
9
+ * @param {string} pointer
10
+ * @param {string | null} parentPointer
11
+ * @param {boolean} required
12
+ * @returns {import('./types.js').SkeletonNode}
13
+ */
14
+ 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): import('./types.js').SkeletonNode;
15
+ //# sourceMappingURL=skeleton-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,yCAZW,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,GACL,OAAO,YAAY,EAAE,YAAY,CA4N7C"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @param {any} schema
3
+ * @param {import('./index.js').CompileOptions} options
4
+ * @param {string[]} validates
5
+ * @param {Record<string, string[]>} validationErrors
6
+ * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
7
+ * @param {import('@json-layout/vocabulary').Expression[]} expressions
8
+ * @param {string} pointer
9
+ * @param {string} title
10
+ * @returns {import('./types.js').SkeletonTree}
11
+ */
12
+ 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;
13
+ //# sourceMappingURL=skeleton-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,50 @@
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 } 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 type CompiledExpression = (data: any, options: StateNodeOptionsBase, context: object, display: Display, layout: BaseCompObject, rootData?: unknown, parentData?: unknown) => any;
8
+ export interface CompileOptions {
9
+ ajv: ajvModule.default;
10
+ ajvOptions?: ajvModule.Options;
11
+ code: boolean;
12
+ markdown: (text: string) => string;
13
+ markdownItOptions?: MarkdownIt.Options;
14
+ locale: string;
15
+ messages: LocaleMessages;
16
+ optionsKeys: string[];
17
+ components: Record<string, ComponentInfo>;
18
+ }
19
+ export type PartialCompileOptions = Partial<Omit<CompileOptions, 'messages'>> & {
20
+ messages?: Partial<LocaleMessages>;
21
+ components?: Record<string, Omit<ComponentInfo, 'name'>>;
22
+ };
23
+ export interface CompiledLayout {
24
+ options?: CompileOptions;
25
+ schema?: SchemaObject;
26
+ skeletonTree: SkeletonTree;
27
+ validates: Record<string, ValidateFunction>;
28
+ validationErrors: Record<string, string[]>;
29
+ normalizedLayouts: Record<string, NormalizedLayout>;
30
+ expressions: CompiledExpression[];
31
+ locale: string;
32
+ messages: LocaleMessages;
33
+ components: Record<string, Omit<ComponentInfo, 'schema'>>;
34
+ localizeErrors: (errors: ajvModule.ErrorObject[]) => void;
35
+ }
36
+ export interface SkeletonTree {
37
+ title: string;
38
+ root: SkeletonNode;
39
+ }
40
+ export interface SkeletonNode {
41
+ key: string | number;
42
+ pointer: string;
43
+ parentPointer: string | null;
44
+ pure: boolean;
45
+ propertyKeys: string[];
46
+ roPropertyKeys: string[];
47
+ children?: SkeletonNode[];
48
+ childrenTrees?: SkeletonTree[];
49
+ }
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"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,CAAA;AACzC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnI,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAoB,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,OAAO,EAClB,UAAU,CAAC,EAAE,OAAO,KACjB,GAAG,CAAA;AAER,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,SAAS,CAAC,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,SAAS,CAAC,OAAO,CAAA;IAC9B,IAA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AA;CACnB;AAID,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;CAC/B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @param {import('ajv').SchemaObject} schema
3
+ * @param {ajvModule.default} ajv
4
+ * @param {string} locale
5
+ * @returns {import('ajv').SchemaObject}
6
+ */
7
+ export function resolveRefs(schema: import('ajv').SchemaObject, ajv: ajvModule.default, locale?: string): import('ajv').SchemaObject;
8
+ import ajvModule from 'ajv/dist/2019.js';
9
+ //# sourceMappingURL=resolve-refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import('./types.js').LocaleMessages;
2
+ export default _default;
3
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import('./types.js').LocaleMessages;
2
+ export default _default;
3
+ //# sourceMappingURL=fr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.js"],"names":[],"mappings":"wBAAW,OAAO,YAAY,EAAE,cAAc"}
@@ -0,0 +1,3 @@
1
+ declare const _default: Record<string, import('./types.js').LocaleMessages>;
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.js"],"names":[],"mappings":"wBAGW,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,cAAc,CAAC"}
@@ -0,0 +1,35 @@
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
+ duplicate: string;
10
+ sort: string;
11
+ up: string;
12
+ down: string;
13
+ showHelp: string;
14
+ mdeLink1: string;
15
+ mdeLink2: string;
16
+ mdeImg1: string;
17
+ mdeImg2: string;
18
+ mdeTable1: string;
19
+ mdeTable2: string;
20
+ bold: string;
21
+ italic: string;
22
+ heading: string;
23
+ quote: string;
24
+ unorderedList: string;
25
+ orderedList: string;
26
+ createLink: string;
27
+ insertImage: string;
28
+ createTable: string;
29
+ preview: string;
30
+ mdeGuide: string;
31
+ undo: string;
32
+ redo: string;
33
+ }
34
+ export type LocaleMessages = CompileOptionsMessages & StateOptionsMessages;
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
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,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"}
@@ -0,0 +1,5 @@
1
+ export * from "./compile/index.js";
2
+ export * from "./state/index.js";
3
+ export { default as i18n } from "./i18n/index.js";
4
+ export { default as clone } from "./utils/clone.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,263 @@
1
+ export { Display } from "./utils/display.js";
2
+ /**
3
+ * @typedef {import('./types.js').StateNode} StateNode
4
+ * @typedef {import('./types.js').StateTree} StateTree
5
+ * @typedef {import('./types.js').StatefulLayoutOptions} StatefulLayoutOptions
6
+ * @typedef {import('./types.js').StatefulLayoutEvents} StatefulLayoutEvents
7
+ * @typedef {import('./types.js').CreateStateTreeContext} CreateStateTreeContext
8
+ * @typedef {import('./types.js').TextFieldNode} TextFieldNode
9
+ * @typedef {import('./types.js').TextareaNode} TextareaNode
10
+ * @typedef {import('./types.js').NumberFieldNode} NumberFieldNode
11
+ * @typedef {import('./types.js').SliderNode} SliderNode
12
+ * @typedef {import('./types.js').SectionNode} SectionNode
13
+ * @typedef {import('./types.js').SelectNode} SelectNode
14
+ * @typedef {import('./types.js').AutocompleteNode} AutocompleteNode
15
+ * @typedef {import('./types.js').ComboboxNode} ComboboxNode
16
+ * @typedef {import('./types.js').CheckboxNode} CheckboxNode
17
+ * @typedef {import('./types.js').SwitchNode} SwitchNode
18
+ * @typedef {import('./types.js').ColorPickerNode} ColorPickerNode
19
+ * @typedef {import('./types.js').DatePickerNode} DatePickerNode
20
+ * @typedef {import('./types.js').DateTimePickerNode} DateTimePickerNode
21
+ * @typedef {import('./types.js').TimePickerNode} TimePickerNode
22
+ * @typedef {import('./types.js').ExpansionPanelsNode} ExpansionPanelsNode
23
+ * @typedef {import('./types.js').TabsNode} TabsNode
24
+ * @typedef {import('./types.js').VerticalTabsNode} VerticalTabsNode
25
+ * @typedef {import('./types.js').StepperNode} StepperNode
26
+ * @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode
27
+ * @typedef {import('./types.js').ListNode} ListNode
28
+ * @typedef {import('./types.js').FileInputNode} FileInputNode
29
+ * @typedef {import('./types.js').FileRef} FileRef
30
+ */
31
+ /** @type {(node: StateNode | undefined) => node is SectionNode} */
32
+ export const isSection: (node: StateNode | undefined) => node is import("./types.js").SectionNode;
33
+ /** @type {(node: StateNode | undefined, components: Record<string, import('@json-layout/vocabulary').ComponentInfo>) => node is SelectNode | ComboboxNode | AutocompleteNode} */
34
+ 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;
35
+ export class StatefulLayout {
36
+ /**
37
+ * @param {import("../index.js").CompiledLayout} compiledLayout
38
+ * @param {import("../index.js").SkeletonTree} skeletonTree
39
+ * @param {Partial<StatefulLayoutOptions>} options
40
+ * @param {unknown} [data]
41
+ */
42
+ constructor(compiledLayout: import("../index.js").CompiledLayout, skeletonTree: import("../index.js").SkeletonTree, options: Partial<StatefulLayoutOptions>, data?: unknown);
43
+ /**
44
+ * @readonly
45
+ * @type {import('mitt').Emitter<StatefulLayoutEvents>}
46
+ */
47
+ readonly events: import('mitt').Emitter<StatefulLayoutEvents>;
48
+ /**
49
+ * @private
50
+ * @readonly
51
+ * @type {import('../index.js').CompiledLayout}
52
+ */
53
+ private readonly _compiledLayout;
54
+ get compiledLayout(): import("../compile/types.js").CompiledLayout;
55
+ /**
56
+ * @private
57
+ * @type {StateTree}
58
+ */
59
+ private _stateTree;
60
+ get stateTree(): import("./types.js").StateTree;
61
+ /**
62
+ * @readonly
63
+ * @type {import('../index.js').SkeletonTree}
64
+ */
65
+ readonly skeletonTree: import('../index.js').SkeletonTree;
66
+ /**
67
+ * @private
68
+ * @type {Display}
69
+ */
70
+ private _display;
71
+ get display(): Display;
72
+ /**
73
+ * @private
74
+ * @type {import('./types.js').ValidationState}
75
+ */
76
+ private _validationState;
77
+ /**
78
+ * @private
79
+ * @param {Partial<import('./types.js').ValidationState>} validationState
80
+ */
81
+ set validationState(arg: import("./types.js").ValidationState);
82
+ /**
83
+ * @returns {import('./types.js').ValidationState}
84
+ */
85
+ get validationState(): import("./types.js").ValidationState;
86
+ /**
87
+ * @private
88
+ * @type {StatefulLayoutOptions}
89
+ */
90
+ private _options;
91
+ /**
92
+ * @param {Partial<StatefulLayoutOptions>} options
93
+ */
94
+ set options(arg: import("./types.js").StatefulLayoutOptions);
95
+ /**
96
+ * @returns {StatefulLayoutOptions}
97
+ */
98
+ get options(): import("./types.js").StatefulLayoutOptions;
99
+ /**
100
+ * @private
101
+ * @type {unknown}
102
+ */
103
+ private _data;
104
+ set data(arg: unknown);
105
+ get data(): unknown;
106
+ /**
107
+ * @private
108
+ * @type {unknown}
109
+ */
110
+ private _previousData;
111
+ /**
112
+ * @private
113
+ * @type {boolean}
114
+ */
115
+ private _dataWaitingForBlur;
116
+ /**
117
+ * @private
118
+ * @type {CreateStateTreeContext}
119
+ */
120
+ private _lastCreateStateTreeContext;
121
+ /**
122
+ * @private
123
+ * @type {string | null}
124
+ */
125
+ private _autofocusTarget;
126
+ /**
127
+ * @private
128
+ * @type {string | null}
129
+ */
130
+ private _previousAutofocusTarget;
131
+ /**
132
+ * @type {FileRef[]}
133
+ */
134
+ files: FileRef[];
135
+ /**
136
+ * @type {Record<string, number>}
137
+ */
138
+ activeItems: Record<string, number>;
139
+ /**
140
+ * @private
141
+ * @param {Partial<StatefulLayoutOptions>} options
142
+ */
143
+ private prepareOptions;
144
+ /**
145
+ * @private
146
+ */
147
+ private initValidationState;
148
+ /**
149
+ * @private
150
+ */
151
+ private updateState;
152
+ /**
153
+ * @private
154
+ */
155
+ private emitData;
156
+ /**
157
+ * @private
158
+ * @param {boolean} rehydrate
159
+ */
160
+ private createStateTree;
161
+ validate(): void;
162
+ resetValidation(): void;
163
+ /**
164
+ * @returns {boolean}
165
+ */
166
+ get valid(): boolean;
167
+ /**
168
+ * @returns {string[]}
169
+ */
170
+ get errors(): string[];
171
+ /**
172
+ * @returns {boolean}
173
+ */
174
+ get hasHiddenError(): boolean;
175
+ /**
176
+ * @private
177
+ * @param {StateNode} node
178
+ * @param {import('@json-layout/vocabulary').Expression} expression
179
+ * @param {any} data
180
+ * @returns {any}
181
+ */
182
+ private evalNodeExpression;
183
+ /**
184
+ * @private
185
+ * @param {StateNode} node
186
+ * @param {unknown} data
187
+ * @param {boolean} [validated]
188
+ * @param {number} [activateKey]
189
+ */
190
+ private applyInput;
191
+ /**
192
+ * @private
193
+ * @type {null | [StateNode, unknown, boolean, number | undefined, ReturnType<typeof setTimeout>]}
194
+ */
195
+ private debouncedInput;
196
+ applyDebouncedInput(): void;
197
+ /**
198
+ * @param {StateNode} node
199
+ * @param {unknown} data
200
+ * @param {number} [activateKey]
201
+ */
202
+ input(node: StateNode, data: unknown, activateKey?: number | undefined): void;
203
+ /**
204
+ * @param {StateNode} node
205
+ */
206
+ blur(node: StateNode): void;
207
+ /**
208
+ * @param {StateNode} node
209
+ */
210
+ validateNodeRecurse(node: StateNode): void;
211
+ /**
212
+ * @private
213
+ * @param {StateNode} node
214
+ * @param {string} q
215
+ * @returns {Promise<[import('@json-layout/vocabulary').SelectItems, boolean]>}
216
+ */
217
+ private getSourceItems;
218
+ /**
219
+ * @param {StateNode} node
220
+ * @param {string} q
221
+ * @returns {Promise<import('@json-layout/vocabulary').SelectItems>}
222
+ */
223
+ getItems(node: StateNode, q?: string): Promise<import('@json-layout/vocabulary').SelectItems>;
224
+ /**
225
+ * @param {StateNode} node
226
+ * @param {number} key
227
+ */
228
+ activateItem(node: StateNode, key: number): void;
229
+ /**
230
+ * @param {StateNode} node
231
+ */
232
+ deactivateItem(node: StateNode): void;
233
+ handleAutofocus(): void;
234
+ }
235
+ export type StateNode = import('./types.js').StateNode;
236
+ export type StateTree = import('./types.js').StateTree;
237
+ export type StatefulLayoutOptions = import('./types.js').StatefulLayoutOptions;
238
+ export type StatefulLayoutEvents = import('./types.js').StatefulLayoutEvents;
239
+ export type CreateStateTreeContext = import('./types.js').CreateStateTreeContext;
240
+ export type TextFieldNode = import('./types.js').TextFieldNode;
241
+ export type TextareaNode = import('./types.js').TextareaNode;
242
+ export type NumberFieldNode = import('./types.js').NumberFieldNode;
243
+ export type SliderNode = import('./types.js').SliderNode;
244
+ export type SectionNode = import('./types.js').SectionNode;
245
+ export type SelectNode = import('./types.js').SelectNode;
246
+ export type AutocompleteNode = import('./types.js').AutocompleteNode;
247
+ export type ComboboxNode = import('./types.js').ComboboxNode;
248
+ export type CheckboxNode = import('./types.js').CheckboxNode;
249
+ export type SwitchNode = import('./types.js').SwitchNode;
250
+ export type ColorPickerNode = import('./types.js').ColorPickerNode;
251
+ export type DatePickerNode = import('./types.js').DatePickerNode;
252
+ export type DateTimePickerNode = import('./types.js').DateTimePickerNode;
253
+ export type TimePickerNode = import('./types.js').TimePickerNode;
254
+ export type ExpansionPanelsNode = import('./types.js').ExpansionPanelsNode;
255
+ export type TabsNode = import('./types.js').TabsNode;
256
+ export type VerticalTabsNode = import('./types.js').VerticalTabsNode;
257
+ export type StepperNode = import('./types.js').StepperNode;
258
+ export type OneOfSelectNode = import('./types.js').OneOfSelectNode;
259
+ export type ListNode = import('./types.js').ListNode;
260
+ export type FileInputNode = import('./types.js').FileInputNode;
261
+ export type FileRef = import('./types.js').FileRef;
262
+ import { Display } from './utils/display.js';
263
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;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,YAAY,CAEhC;IAEZ;;;OAGG;IAEH,iBAAQ;IACR,uBAAuC;IAEvC;;;OAGG;IAEH,yBAAgB;IAQhB;;;OAGG;IACH,+DAOC;IAlBD;;OAEG;IACH,4DAEC;IAeD;;;OAGG;IAEH,iBAAQ;IAKR;;OAEG;IACH,6DAGC;IAVD;;OAEG;IACH,0DAAuC;IASvC;;;OAGG;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O,YAAY,EAAE,UAAU;0BAC/B,OAAO,YAAY,EAAE,WAAW;yBAChC,OAAO,YAAY,EAAE,UAAU;+BAC/B,OAAO,YAAY,EAAE,gBAAgB;2BACrC,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;wBAjCjB,oBAAoB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @param {import('../index.js').CompiledExpression[]} expressions
3
+ * @param {import('@json-layout/vocabulary').Expression} expression
4
+ * @param {any} data
5
+ * @param {import('./types.js').StateNodeOptions} options
6
+ * @param {import('./utils/display.js').Display} display
7
+ * @param {import('@json-layout/vocabulary').BaseCompObject} layout
8
+ * @param {unknown} rootData
9
+ * @param {unknown} parentData
10
+ * @returns {any}
11
+ */
12
+ 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, rootData: unknown, parentData: unknown): any;
13
+ /**
14
+ *
15
+ * @param {import('./types.js').CreateStateTreeContext} context
16
+ * @param {import('./types.js').StateNodeOptions} parentOptions
17
+ * @param {import('../index.js').CompiledLayout} compiledLayout
18
+ * @param {string | number} key
19
+ * @param {string} fullKey
20
+ * @param {string | null} parentFullKey
21
+ * @param {string} dataPath
22
+ * @param {string | null} parentDataPath
23
+ * @param {import('../index.js').SkeletonNode} skeleton
24
+ * @param {import('@json-layout/vocabulary').Child | null} childDefinition
25
+ * @param {import('./utils/display.js').Display} parentDisplay
26
+ * @param {unknown} data
27
+ * @param {unknown} parentData
28
+ * @param {import('./types.js').ValidationState} validationState
29
+ * @param {import('./types.js').StateNode} [reusedNode]
30
+ * @returns {import('./types.js').StateNode}
31
+ */
32
+ 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, parentData: unknown, validationState: import('./types.js').ValidationState, reusedNode?: import("./types.js").StateNode | undefined): import('./types.js').StateNode;
33
+ /** @type {(draft: any, node: import('./types.js').StateNode, data: unknown) => any} */
34
+ export const producePatchedData: (draft: any, node: import('./types.js').StateNode, data: unknown) => any;
35
+ //# sourceMappingURL=state-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-node.d.ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"AAsKA;;;;;;;;;;GAUG;AACH,4CAVW,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,YAChD,OAAO,cACP,OAAO,GACL,GAAG,CAMf;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,cACP,OAAO,mBACP,OAAO,YAAY,EAAE,eAAe,4DAElC,OAAO,YAAY,EAAE,SAAS,CAyP1C;AAED,uFAAuF;AACvF,yCADmB,GAAG,QAAQ,OAAO,YAAY,EAAE,SAAS,QAAQ,OAAO,KAAK,GAAG,CAOjF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @param {import('./types.js').CreateStateTreeContext} context
3
+ * @param {import('./types.js').StatefulLayoutOptions} options
4
+ * @param {import('../index.js').CompiledLayout} compiledLayout
5
+ * @param {import('../index.js').SkeletonTree} skeleton
6
+ * @param {import('./utils/display.js').Display} display
7
+ * @param {unknown} data
8
+ * @param {import('./types.js').ValidationState} validationState
9
+ * @param {import('./types.js').StateTree} [reusedStateTree]
10
+ * @returns {import('./types.js').StateTree}
11
+ */
12
+ 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;
13
+ //# sourceMappingURL=state-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,162 @@
1
+ import { type ErrorObject } from 'ajv/dist/2019.js';
2
+ 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';
3
+ import { type SkeletonTree, type SkeletonNode, type StatefulLayout, type CompiledLayout } from '../index.js';
4
+ import { type LocaleMessages } from '../i18n/types.js';
5
+ export interface StateNode {
6
+ key: string | number;
7
+ fullKey: string;
8
+ parentFullKey: string | null;
9
+ dataPath: string;
10
+ parentDataPath: string | null;
11
+ skeleton: SkeletonNode;
12
+ layout: BaseCompObject;
13
+ cols: Cols;
14
+ data: unknown;
15
+ error: string | undefined;
16
+ childError: boolean | undefined;
17
+ validated: boolean;
18
+ width: number;
19
+ options: StateNodeOptions;
20
+ messages: LocaleMessages;
21
+ autofocus?: boolean;
22
+ autofocusChild?: string | number;
23
+ props?: StateNodePropsLib;
24
+ children?: StateNode[];
25
+ }
26
+ export interface StateTree {
27
+ root: StateNode;
28
+ valid: boolean;
29
+ }
30
+ export interface CreateStateTreeContext {
31
+ errors?: ErrorObject[];
32
+ additionalPropertiesErrors?: ErrorObject[];
33
+ files: FileRef[];
34
+ activeItems: Record<string, number>;
35
+ autofocusTarget: string | null;
36
+ initial: boolean;
37
+ rehydrate: boolean;
38
+ cacheKeys: Record<string, StateNodeCacheKey>;
39
+ rootData: unknown;
40
+ nodes: StateNode[];
41
+ }
42
+ export interface FileRef {
43
+ file: File;
44
+ dataPath: string;
45
+ }
46
+ export type StateNodeCacheKey = [
47
+ StateNodeOptions,
48
+ CompiledLayout,
49
+ string,
50
+ SkeletonNode,
51
+ Child | null,
52
+ number,
53
+ ValidationState,
54
+ Record<string, number>,
55
+ boolean,
56
+ unknown
57
+ ];
58
+ export interface ValidationState {
59
+ initialized: boolean;
60
+ validatedForm: boolean;
61
+ validatedChildren: string[];
62
+ }
63
+ export type StatefulLayoutEvents = {
64
+ data: any;
65
+ update: StatefulLayout;
66
+ autofocus: string;
67
+ };
68
+ export type StateNodeOptions = Required<StateNodeOptionsBase & {
69
+ context: Record<string, any>;
70
+ messages: LocaleMessages;
71
+ }>;
72
+ export type StatefulLayoutOptions = StateNodeOptions & {
73
+ width: number;
74
+ };
75
+ export type TextFieldNode = Omit<StateNode, 'children'> & {
76
+ layout: TextField;
77
+ data: string | undefined | null;
78
+ };
79
+ export type TextareaNode = Omit<StateNode, 'children'> & {
80
+ layout: Textarea;
81
+ data: string | undefined | null;
82
+ };
83
+ export type NumberFieldNode = Omit<StateNode, 'children'> & {
84
+ layout: NumberField;
85
+ data: number | undefined | null;
86
+ };
87
+ export type SliderNode = Omit<StateNode, 'children'> & {
88
+ layout: Slider;
89
+ data: number | undefined | null;
90
+ };
91
+ export type CheckboxNode = Omit<StateNode, 'children'> & {
92
+ layout: Checkbox;
93
+ data: boolean | undefined | null;
94
+ };
95
+ export type SwitchNode = Omit<StateNode, 'children'> & {
96
+ layout: Switch;
97
+ data: boolean | undefined | null;
98
+ };
99
+ export type DatePickerNode = Omit<StateNode, 'children'> & {
100
+ layout: DatePicker;
101
+ data: string | undefined | null;
102
+ };
103
+ export type DateTimePickerNode = Omit<StateNode, 'children'> & {
104
+ layout: DateTimePicker;
105
+ data: string | undefined | null;
106
+ };
107
+ export type TimePickerNode = Omit<StateNode, 'children'> & {
108
+ layout: TimePicker;
109
+ data: string | undefined | null;
110
+ };
111
+ export type ColorPickerNode = Omit<StateNode, 'children'> & {
112
+ layout: ColorPicker;
113
+ data: string | undefined | null;
114
+ };
115
+ export type SectionNode = StateNode & {
116
+ layout: Section;
117
+ children: StateNode[];
118
+ };
119
+ export type OneOfSelectNode = StateNode & {
120
+ layout: OneOfSelect;
121
+ data: Record<string, unknown>;
122
+ childrenTrees: SkeletonTree[];
123
+ };
124
+ export type SelectNode = Omit<StateNode, 'children'> & {
125
+ layout: Select;
126
+ data: any;
127
+ };
128
+ export type AutocompleteNode = Omit<StateNode, 'children'> & {
129
+ layout: Autocomplete;
130
+ data: any;
131
+ };
132
+ export type TabsNode = StateNode & {
133
+ layout: Tabs;
134
+ children: StateNode[];
135
+ };
136
+ export type VerticalTabsNode = StateNode & {
137
+ layout: VerticalTabs;
138
+ children: StateNode[];
139
+ };
140
+ export type ExpansionPanelsNode = StateNode & {
141
+ layout: ExpansionPanels;
142
+ children: StateNode[];
143
+ };
144
+ export type StepperNode = StateNode & {
145
+ layout: Stepper;
146
+ children: StateNode[];
147
+ };
148
+ export type ListNode = StateNode & {
149
+ layout: List;
150
+ data: any[];
151
+ children: StateNode[];
152
+ childrenTrees: SkeletonTree[];
153
+ };
154
+ export type ComboboxNode = Omit<StateNode, 'children'> & {
155
+ layout: Combobox;
156
+ data: any[];
157
+ };
158
+ export type FileInputNode = Omit<StateNode, 'children'> & {
159
+ layout: FileInput;
160
+ data: object | undefined | null;
161
+ };
162
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"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,e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AAM,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"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @param {Display} parentDisplay
3
+ * @param {import("@json-layout/vocabulary").ColsObj | undefined} colsObj
4
+ * @returns {[Display, import("@json-layout/vocabulary").Cols]}
5
+ */
6
+ export function getChildDisplay(parentDisplay: Display, colsObj: import("@json-layout/vocabulary").ColsObj | undefined): [Display, import("@json-layout/vocabulary").Cols];
7
+ export class Display {
8
+ /**
9
+ * @param {number} width
10
+ */
11
+ constructor(width: number);
12
+ /**
13
+ * @readonly
14
+ * @type {number}
15
+ */
16
+ readonly width: number;
17
+ /** @returns {BreakPointName} */
18
+ get name(): BreakPointName;
19
+ /** @returns {boolean} */
20
+ get xs(): boolean;
21
+ /** @returns {boolean} */
22
+ get sm(): boolean;
23
+ /** @returns {boolean} */
24
+ get smAndDown(): boolean;
25
+ /** @returns {boolean} */
26
+ get smAndUp(): boolean;
27
+ /** @returns {boolean} */
28
+ get md(): boolean;
29
+ /** @returns {boolean} */
30
+ get mdAndDown(): boolean;
31
+ /** @returns {boolean} */
32
+ get mobile(): boolean;
33
+ /** @returns {boolean} */
34
+ get mdAndUp(): boolean;
35
+ /** @returns {boolean} */
36
+ get lg(): boolean;
37
+ /** @returns {boolean} */
38
+ get lgAndDown(): boolean;
39
+ /** @returns {boolean} */
40
+ get lgAndUp(): boolean;
41
+ /** @returns {boolean} */
42
+ get xl(): boolean;
43
+ /** @returns {boolean} */
44
+ get xlAndDown(): boolean;
45
+ /** @returns {boolean} */
46
+ get xlAndUp(): boolean;
47
+ /** @returns {boolean} */
48
+ get xxl(): boolean;
49
+ }
50
+ export type BreakPointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
51
+ //# sourceMappingURL=display.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @template ItemType
3
+ * @param {ItemType[]} previousArray
4
+ * @param {ItemType[]} newArray
5
+ * @returns {ItemType[]}
6
+ */
7
+ export function shallowProduceArray<ItemType>(previousArray?: ItemType[], newArray?: ItemType[]): ItemType[];
8
+ /**
9
+ * @param {Record<string, any>} previousObj
10
+ * @param {Record<string, any>} newObj
11
+ * @returns {Record<string, any>}
12
+ */
13
+ export function shallowProduceObject(previousObj?: Record<string, any>, newObj?: Record<string, any>): Record<string, any>;
14
+ /**
15
+ * @template ItemType
16
+ * @param {any[]} a1
17
+ * @param {any[]} a2
18
+ * @returns {boolean}
19
+ */
20
+ export function shallowEqualArray<ItemType>(a1?: any[], a2?: any[]): boolean;
21
+ //# sourceMappingURL=immutable.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,5 @@
1
+ /** @type {string[]} */
2
+ export const commonjsDeps: string[];
3
+ /** @type {string[][]} */
4
+ export const commonjsDepsPaths: string[][];
5
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"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"}
@@ -0,0 +1,3 @@
1
+ declare function _default(o: any): any;
2
+ export default _default;
3
+ //# sourceMappingURL=clone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/utils/clone.js"],"names":[],"mappings":"AAoCE,uCAyBC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @typedef {{key: string, description: string, default?: any, values?: Record<string, any>}[]} DocOptions
3
+ */
4
+ /** @type {DocOptions} */
5
+ export const compileOptions: DocOptions;
6
+ /** @type {DocOptions} */
7
+ export const runtimeOptions: DocOptions;
8
+ export type DocOptions = {
9
+ key: string;
10
+ description: string;
11
+ default?: any;
12
+ values?: Record<string, any>;
13
+ }[];
14
+ //# sourceMappingURL=doc-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-options.d.ts","sourceRoot":"","sources":["../../src/utils/doc-options.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH,yBAAyB;AACzB,wCA8BC;AAED,yBAAyB;AACzB,wCAoGC;yBAzIY;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"}