@json-layout/core 0.5.0 → 0.7.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 +2 -2
- package/src/compile/skeleton-node.js +2 -0
- package/src/state/index.js +61 -21
- package/src/state/state-node.js +8 -5
- package/src/state/state-tree.js +24 -0
- package/src/state/types.ts +13 -2
- package/src/state/utils/immutable.js +6 -6
- package/types/compile/skeleton-node.d.ts.map +1 -1
- package/types/state/index.d.ts +18 -0
- package/types/state/index.d.ts.map +1 -1
- package/types/state/state-node.d.ts.map +1 -1
- package/types/state/state-tree.d.ts.map +1 -1
- package/types/state/types.d.ts +15 -3
- package/types/state/types.d.ts.map +1 -1
- package/types/state/utils/immutable.d.ts +3 -3
- package/types/state/utils/immutable.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-layout/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Compilation and state management utilities for JSON Layout.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/json-layout/json-layout#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@json-layout/vocabulary": "^0.
|
|
50
|
+
"@json-layout/vocabulary": "^0.7.0",
|
|
51
51
|
"@types/markdown-it": "^13.0.1",
|
|
52
52
|
"ajv": "^8.12.0",
|
|
53
53
|
"ajv-errors": "^3.0.0",
|
|
@@ -75,6 +75,8 @@ export function makeSkeletonNode (
|
|
|
75
75
|
if (defaultData && !compObject.defaultData) compObject.defaultData = { type: 'js-eval', expr: JSON.stringify(defaultData), pure: true }
|
|
76
76
|
if (compObject.defaultData) pushExpression(expressions, compObject.defaultData)
|
|
77
77
|
|
|
78
|
+
if (compObject.transformData) pushExpression(expressions, compObject.transformData)
|
|
79
|
+
|
|
78
80
|
if (isItemsLayout(compObject) && compObject.getItems) {
|
|
79
81
|
if (isGetItemsExpression(compObject.getItems)) pushExpression(expressions, compObject.getItems)
|
|
80
82
|
if (isGetItemsFetch(compObject.getItems)) pushExpression(expressions, compObject.getItems.url)
|
package/src/state/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import { produce } from 'immer'
|
|
|
5
5
|
import { evalExpression, producePatchedData } from './state-node.js'
|
|
6
6
|
import { createStateTree } from './state-tree.js'
|
|
7
7
|
import { Display } from './utils/display.js'
|
|
8
|
-
import { isGetItemsExpression, isGetItemsFetch, isItemsLayout } from '@json-layout/vocabulary'
|
|
8
|
+
import { isFileLayout, isGetItemsExpression, isGetItemsFetch, isItemsLayout } from '@json-layout/vocabulary'
|
|
9
|
+
import { shallowProduceArray } from './utils/immutable.js'
|
|
9
10
|
|
|
10
11
|
export { Display } from './utils/display.js'
|
|
11
12
|
|
|
@@ -35,6 +36,9 @@ export { Display } from './utils/display.js'
|
|
|
35
36
|
* @typedef {import('./types.js').StepperNode} StepperNode
|
|
36
37
|
* @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode
|
|
37
38
|
* @typedef {import('./types.js').ListNode} ListNode
|
|
39
|
+
* @typedef {import('./types.js').FileInputNode} FileInputNode
|
|
40
|
+
* @typedef {import('./types.js').MarkdownNode} MarkdownNode
|
|
41
|
+
* @typedef {import('./types.js').FileRef} FileRef
|
|
38
42
|
*/
|
|
39
43
|
|
|
40
44
|
/** @type {(node: StateNode | undefined) => node is SectionNode} */
|
|
@@ -183,6 +187,11 @@ export class StatefulLayout {
|
|
|
183
187
|
*/
|
|
184
188
|
_previousAutofocusTarget
|
|
185
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @type {FileRef[]}
|
|
192
|
+
*/
|
|
193
|
+
files = []
|
|
194
|
+
|
|
186
195
|
/**
|
|
187
196
|
* @param {import("../index.js").CompiledLayout} compiledLayout
|
|
188
197
|
* @param {import("../index.js").SkeletonTree} skeletonTree
|
|
@@ -247,12 +256,13 @@ export class StatefulLayout {
|
|
|
247
256
|
createStateTree () {
|
|
248
257
|
/** @type {CreateStateTreeContext} */
|
|
249
258
|
const createStateTreeContext = {
|
|
250
|
-
nodes: [],
|
|
251
259
|
activeItems: this.activeItems,
|
|
252
260
|
autofocusTarget: this._autofocusTarget,
|
|
253
261
|
initial: !this._lastCreateStateTreeContext,
|
|
254
262
|
cacheKeys: this._lastCreateStateTreeContext?.cacheKeys ?? {},
|
|
255
|
-
rootData: this._data
|
|
263
|
+
rootData: this._data,
|
|
264
|
+
files: [],
|
|
265
|
+
nodes: []
|
|
256
266
|
}
|
|
257
267
|
this._stateTree = createStateTree(
|
|
258
268
|
createStateTreeContext,
|
|
@@ -273,6 +283,7 @@ export class StatefulLayout {
|
|
|
273
283
|
}
|
|
274
284
|
}
|
|
275
285
|
this.activeItems = createStateTreeContext.activeItems
|
|
286
|
+
this.files = shallowProduceArray(this.files, createStateTreeContext.files)
|
|
276
287
|
}
|
|
277
288
|
|
|
278
289
|
validate () {
|
|
@@ -305,6 +316,20 @@ export class StatefulLayout {
|
|
|
305
316
|
return this._lastCreateStateTreeContext.nodes.findIndex(node => node.error && !node.validated) !== -1
|
|
306
317
|
}
|
|
307
318
|
|
|
319
|
+
/**
|
|
320
|
+
* @private
|
|
321
|
+
* @param {StateNode} node
|
|
322
|
+
* @param {import('@json-layout/vocabulary').Expression} expression
|
|
323
|
+
* @param {any} data
|
|
324
|
+
* @returns {any}
|
|
325
|
+
*/
|
|
326
|
+
evalNodeExpression = (node, expression, data) => {
|
|
327
|
+
// const parentNode = this._stateTree.traverseNode(this._stateTree.root).find(n => n.fullKey === node.parentFullKey)
|
|
328
|
+
const parentNode = this._lastCreateStateTreeContext.nodes.find(n => n.fullKey === node.parentFullKey)
|
|
329
|
+
const parentData = parentNode ? parentNode.data : null
|
|
330
|
+
return evalExpression(this.compiledLayout.expressions, expression, data, node.options, new Display(node.width), parentData, this._data)
|
|
331
|
+
}
|
|
332
|
+
|
|
308
333
|
/**
|
|
309
334
|
* @param {StateNode} node
|
|
310
335
|
* @param {unknown} data
|
|
@@ -312,6 +337,28 @@ export class StatefulLayout {
|
|
|
312
337
|
*/
|
|
313
338
|
input (node, data, activateKey) {
|
|
314
339
|
logDataBinding('received input event from node', node, data)
|
|
340
|
+
|
|
341
|
+
const transformedData = node.layout.transformData && this.evalNodeExpression(node, node.layout.transformData, data)
|
|
342
|
+
|
|
343
|
+
if (isFileLayout(node.layout)) {
|
|
344
|
+
if (transformedData) {
|
|
345
|
+
// @ts-ignore
|
|
346
|
+
data.toJSON = () => transformedData
|
|
347
|
+
} else if (data instanceof File) {
|
|
348
|
+
const fileJSON = { name: data.name, size: data.size, type: data.type }
|
|
349
|
+
// @ts-ignore
|
|
350
|
+
data.toJSON = () => fileJSON
|
|
351
|
+
} else if (Array.isArray(data)) {
|
|
352
|
+
for (const file of data) {
|
|
353
|
+
const fileJSON = { name: file.name, size: file.size, type: file.type }
|
|
354
|
+
// @ts-ignore
|
|
355
|
+
file.toJSON = () => fileJSON
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} else if (transformedData) {
|
|
359
|
+
data = transformedData
|
|
360
|
+
}
|
|
361
|
+
|
|
315
362
|
if (node.options.validateOn === 'input' && !this.validationState.validatedChildren.includes(node.fullKey)) {
|
|
316
363
|
this.validationState = { validatedChildren: this.validationState.validatedChildren.concat([node.fullKey]) }
|
|
317
364
|
}
|
|
@@ -326,7 +373,7 @@ export class StatefulLayout {
|
|
|
326
373
|
}
|
|
327
374
|
const parentNode = this._lastCreateStateTreeContext.nodes.find(p => p.fullKey === node.parentFullKey)
|
|
328
375
|
if (!parentNode) throw new Error(`parent with key "${node.parentFullKey}" not found`)
|
|
329
|
-
const newParentValue = producePatchedData(parentNode.data ?? {}, node, data)
|
|
376
|
+
const newParentValue = producePatchedData(parentNode.data ?? (typeof node.key === 'number' ? [] : {}), node, data)
|
|
330
377
|
this.input(parentNode, newParentValue)
|
|
331
378
|
|
|
332
379
|
if (activateKey !== undefined) {
|
|
@@ -370,21 +417,14 @@ export class StatefulLayout {
|
|
|
370
417
|
|
|
371
418
|
if (node.layout.items) return [node.layout.items, false]
|
|
372
419
|
|
|
373
|
-
/** @type {(expression: import('@json-layout/vocabulary').Expression, data: any) => any} */
|
|
374
|
-
const evalSelectExpression = (expression, data) => {
|
|
375
|
-
const parentNode = this._lastCreateStateTreeContext.nodes.find(n => n.fullKey === node.parentFullKey)
|
|
376
|
-
const parentData = parentNode ? parentNode.data : null
|
|
377
|
-
return evalExpression(this.compiledLayout.expressions, expression, data, node.options, new Display(node.width), parentData, this._data)
|
|
378
|
-
}
|
|
379
|
-
|
|
380
420
|
let rawItems
|
|
381
421
|
let appliedQ = false
|
|
382
422
|
if (node.layout.getItems && isGetItemsExpression(node.layout.getItems)) {
|
|
383
|
-
rawItems =
|
|
423
|
+
rawItems = this.evalNodeExpression(node, node.layout.getItems, null)
|
|
384
424
|
if (!Array.isArray(rawItems)) throw new Error('getItems expression didn\'t return an array')
|
|
385
425
|
}
|
|
386
426
|
if (node.layout.getItems && isGetItemsFetch(node.layout.getItems)) {
|
|
387
|
-
const url = new URL(
|
|
427
|
+
const url = new URL(this.evalNodeExpression(node, node.layout.getItems.url, null))
|
|
388
428
|
let qSearchParam = node.layout.getItems.qSearchParam
|
|
389
429
|
if (!qSearchParam) {
|
|
390
430
|
for (const searchParam of url.searchParams.entries()) {
|
|
@@ -401,26 +441,26 @@ export class StatefulLayout {
|
|
|
401
441
|
|
|
402
442
|
if (rawItems) {
|
|
403
443
|
if (node.layout.getItems?.itemsResults) {
|
|
404
|
-
rawItems =
|
|
444
|
+
rawItems = this.evalNodeExpression(node, node.layout.getItems.itemsResults, rawItems)
|
|
405
445
|
}
|
|
406
446
|
/** @type {import('@json-layout/vocabulary').SelectItems} */
|
|
407
447
|
const items = rawItems.map((/** @type {any} */ rawItem) => {
|
|
408
448
|
/** @type {Partial<import('@json-layout/vocabulary').SelectItem>} */
|
|
409
449
|
const item = {}
|
|
410
450
|
if (typeof rawItem === 'object') {
|
|
411
|
-
item.value = node.layout.getItems?.itemValue ?
|
|
412
|
-
item.key = node.layout.getItems?.itemKey ?
|
|
413
|
-
item.title = node.layout.getItems?.itemTitle ?
|
|
451
|
+
item.value = node.layout.getItems?.itemValue ? this.evalNodeExpression(node, node.layout.getItems.itemValue, rawItem) : (node.layout.getItems?.returnObjects ? rawItem : rawItem.value)
|
|
452
|
+
item.key = node.layout.getItems?.itemKey ? this.evalNodeExpression(node, node.layout.getItems.itemKey, rawItem) : rawItem.key
|
|
453
|
+
item.title = node.layout.getItems?.itemTitle ? this.evalNodeExpression(node, node.layout.getItems.itemTitle, rawItem) : rawItem.title
|
|
414
454
|
item.value = item.value ?? item.key
|
|
415
455
|
item.key = item.key ?? item.value + ''
|
|
416
456
|
item.title = item.title ?? item.key
|
|
417
457
|
if (!item.icon && rawItem.icon) item.icon = rawItem.icon
|
|
418
458
|
} else {
|
|
419
|
-
item.value = node.layout.getItems?.itemValue ?
|
|
420
|
-
item.key = node.layout.getItems?.itemKey ?
|
|
421
|
-
item.title = node.layout.getItems?.itemTitle ?
|
|
459
|
+
item.value = node.layout.getItems?.itemValue ? this.evalNodeExpression(node, node.layout.getItems.itemValue, rawItem) : rawItem
|
|
460
|
+
item.key = node.layout.getItems?.itemKey ? this.evalNodeExpression(node, node.layout.getItems.itemKey, rawItem) : item.value
|
|
461
|
+
item.title = node.layout.getItems?.itemTitle ? this.evalNodeExpression(node, node.layout.getItems.itemTitle, rawItem) : item.value
|
|
422
462
|
}
|
|
423
|
-
if (node.layout.getItems?.itemIcon) item.icon =
|
|
463
|
+
if (node.layout.getItems?.itemIcon) item.icon = this.evalNodeExpression(node, node.layout.getItems?.itemIcon, rawItem)
|
|
424
464
|
return item
|
|
425
465
|
})
|
|
426
466
|
return [items, appliedQ]
|
package/src/state/state-node.js
CHANGED
|
@@ -73,6 +73,13 @@ const produceStateNodeData = produce((draft, parentDataPath, children) => {
|
|
|
73
73
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
74
74
|
if (child.data === undefined) delete draft[child.key]
|
|
75
75
|
else draft[child.key] = child.data
|
|
76
|
+
|
|
77
|
+
if (Array.isArray(draft)) {
|
|
78
|
+
// remove trailing undefined values from tuples
|
|
79
|
+
while (draft.length && draft[draft.length - 1] === undefined) {
|
|
80
|
+
draft.pop()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
})
|
|
@@ -215,10 +222,7 @@ export function createStateNode (
|
|
|
215
222
|
let cacheKey = null
|
|
216
223
|
if (skeleton.pure && reusedNode) {
|
|
217
224
|
cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validationState, context.activeItems, context.initial, data]
|
|
218
|
-
if (context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey))
|
|
219
|
-
context.nodes.push(reusedNode)
|
|
220
|
-
return reusedNode
|
|
221
|
-
}
|
|
225
|
+
if (context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey)) return reusedNode
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
const normalizedLayout = childDefinition && childIsCompObject(childDefinition)
|
|
@@ -390,7 +394,6 @@ export function createStateNode (
|
|
|
390
394
|
children && shallowProduceArray(reusedNode?.children, children)
|
|
391
395
|
)
|
|
392
396
|
|
|
393
|
-
context.nodes.push(node)
|
|
394
397
|
if (cacheKey) context.cacheKeys[fullKey] = cacheKey
|
|
395
398
|
|
|
396
399
|
return node
|
package/src/state/state-tree.js
CHANGED
|
@@ -9,6 +9,21 @@ const produceStateTree = produce(
|
|
|
9
9
|
}
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @generator
|
|
14
|
+
* @param {import('./types.js').StateNode} node
|
|
15
|
+
* @yields {import('./types.js').StateNode}
|
|
16
|
+
* @returns {Generator<import('./types.js').StateNode>}
|
|
17
|
+
*/
|
|
18
|
+
function * traverseNodes (node) {
|
|
19
|
+
yield node
|
|
20
|
+
if (node.children) {
|
|
21
|
+
for (const child of node.children) {
|
|
22
|
+
yield * traverseNodes(child)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
/**
|
|
13
28
|
* @param {import('./types.js').CreateStateTreeContext} context
|
|
14
29
|
* @param {import('./types.js').StatefulLayoutOptions} options
|
|
@@ -56,5 +71,14 @@ export function createStateTree (
|
|
|
56
71
|
reusedStateTree?.root
|
|
57
72
|
)
|
|
58
73
|
|
|
74
|
+
context.nodes = []
|
|
75
|
+
context.files = []
|
|
76
|
+
for (const node of traverseNodes(root)) {
|
|
77
|
+
context.nodes.push(node)
|
|
78
|
+
if (node.data instanceof File) {
|
|
79
|
+
context.files.push({ dataPath: node.dataPath, file: node.data })
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
59
83
|
return produceStateTree(reusedStateTree ?? /** @type {import('./types.js').StateTree} */({}), root, valid)
|
|
60
84
|
}
|
package/src/state/types.ts
CHANGED
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
type Stepper,
|
|
24
24
|
type List,
|
|
25
25
|
type Combobox,
|
|
26
|
+
type Markdown,
|
|
27
|
+
type FileInput,
|
|
26
28
|
type Child
|
|
27
29
|
} from '@json-layout/vocabulary'
|
|
28
30
|
import { type SkeletonTree, type SkeletonNode, type StatefulLayout, type CompiledLayout } from '../index.js'
|
|
@@ -52,17 +54,22 @@ export interface StateNode {
|
|
|
52
54
|
export interface StateTree {
|
|
53
55
|
root: StateNode
|
|
54
56
|
valid: boolean
|
|
55
|
-
title: string
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
export interface CreateStateTreeContext {
|
|
59
60
|
errors?: ErrorObject[]
|
|
60
|
-
|
|
61
|
+
files: FileRef[]
|
|
61
62
|
activeItems: Record<string, number>
|
|
62
63
|
autofocusTarget: string | null
|
|
63
64
|
initial: boolean
|
|
64
65
|
cacheKeys: Record<string, StateNodeCacheKey>
|
|
65
66
|
rootData: unknown
|
|
67
|
+
nodes: StateNode[]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface FileRef {
|
|
71
|
+
file: File
|
|
72
|
+
dataPath: string
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
// [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentWidth, validationState, activeItems, initial, data]
|
|
@@ -145,3 +152,7 @@ export type StepperNode = StateNode & { layout: Stepper, children: StateNode[] }
|
|
|
145
152
|
export type ListNode = StateNode & { layout: List, data: any[], children: StateNode[], childrenTrees: SkeletonTree[] }
|
|
146
153
|
|
|
147
154
|
export type ComboboxNode = Omit<StateNode, 'children'> & { layout: Combobox, data: any[] }
|
|
155
|
+
|
|
156
|
+
export type FileInputNode = Omit<StateNode, 'children'> & { layout: FileInput, data: object | undefined | null }
|
|
157
|
+
|
|
158
|
+
export type MarkdownNode = Omit<StateNode, 'children'> & { layout: Markdown, data: string | undefined | null }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @template ItemType
|
|
3
|
-
* @param {ItemType[]}
|
|
4
|
-
* @param {ItemType[]}
|
|
3
|
+
* @param {ItemType[]} previousArray
|
|
4
|
+
* @param {ItemType[]} newArray
|
|
5
5
|
* @returns {ItemType[]}
|
|
6
6
|
*/
|
|
7
|
-
export function shallowProduceArray (
|
|
8
|
-
if (!
|
|
9
|
-
for (let i = 0; i <
|
|
10
|
-
return
|
|
7
|
+
export function shallowProduceArray (previousArray = [], newArray = []) {
|
|
8
|
+
if (!previousArray || !newArray || previousArray.length !== newArray.length) return newArray
|
|
9
|
+
for (let i = 0; i < previousArray.length; i++) { if (previousArray[i] !== newArray[i]) return newArray }
|
|
10
|
+
return previousArray
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1 +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,
|
|
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,CAyL7C"}
|
package/types/state/index.d.ts
CHANGED
|
@@ -25,6 +25,9 @@ export { Display } from "./utils/display.js";
|
|
|
25
25
|
* @typedef {import('./types.js').StepperNode} StepperNode
|
|
26
26
|
* @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode
|
|
27
27
|
* @typedef {import('./types.js').ListNode} ListNode
|
|
28
|
+
* @typedef {import('./types.js').FileInputNode} FileInputNode
|
|
29
|
+
* @typedef {import('./types.js').MarkdownNode} MarkdownNode
|
|
30
|
+
* @typedef {import('./types.js').FileRef} FileRef
|
|
28
31
|
*/
|
|
29
32
|
/** @type {(node: StateNode | undefined) => node is SectionNode} */
|
|
30
33
|
export const isSection: (node: StateNode | undefined) => node is import("./types.js").SectionNode;
|
|
@@ -116,6 +119,10 @@ export class StatefulLayout {
|
|
|
116
119
|
* @type {string | null}
|
|
117
120
|
*/
|
|
118
121
|
private _previousAutofocusTarget;
|
|
122
|
+
/**
|
|
123
|
+
* @type {FileRef[]}
|
|
124
|
+
*/
|
|
125
|
+
files: FileRef[];
|
|
119
126
|
/**
|
|
120
127
|
* @type {Record<string, number>}
|
|
121
128
|
*/
|
|
@@ -151,6 +158,14 @@ export class StatefulLayout {
|
|
|
151
158
|
* @returns {boolean}
|
|
152
159
|
*/
|
|
153
160
|
get hasHiddenError(): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* @private
|
|
163
|
+
* @param {StateNode} node
|
|
164
|
+
* @param {import('@json-layout/vocabulary').Expression} expression
|
|
165
|
+
* @param {any} data
|
|
166
|
+
* @returns {any}
|
|
167
|
+
*/
|
|
168
|
+
private evalNodeExpression;
|
|
154
169
|
/**
|
|
155
170
|
* @param {StateNode} node
|
|
156
171
|
* @param {unknown} data
|
|
@@ -214,5 +229,8 @@ export type VerticalTabsNode = import('./types.js').VerticalTabsNode;
|
|
|
214
229
|
export type StepperNode = import('./types.js').StepperNode;
|
|
215
230
|
export type OneOfSelectNode = import('./types.js').OneOfSelectNode;
|
|
216
231
|
export type ListNode = import('./types.js').ListNode;
|
|
232
|
+
export type FileInputNode = import('./types.js').FileInputNode;
|
|
233
|
+
export type MarkdownNode = import('./types.js').MarkdownNode;
|
|
234
|
+
export type FileRef = import('./types.js').FileRef;
|
|
217
235
|
import { Display } from './utils/display.js';
|
|
218
236
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,mE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ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state-node.d.ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"AA2IA;;;;;;;;;GASG;AACH,4CATW,OAAO,aAAa,EAAE,kBAAkB,EAAE,cAC1C,OAAO,yBAAyB,EAAE,UAAU,QAC5C,GAAG,WACH,OAAO,YAAY,EAAE,gBAAgB,WACrC,OAAO,oBAAoB,EAAE,OAAO,YACpC,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,CAsM1C;AAED,uFAAuF;AACvF,yCADmB,GAAG,QAAQ,OAAO,YAAY,EAAE,SAAS,QAAQ,OAAO,KAAK,GAAG,CAOjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-tree.d.ts","sourceRoot":"","sources":["../../src/state/state-tree.js"],"names":[],"mappings":"
|
|
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,CAgD1C"}
|
package/types/state/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ErrorObject } from 'ajv';
|
|
2
|
-
import { type CompObject, 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 Child } from '@json-layout/vocabulary';
|
|
2
|
+
import { type CompObject, 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 Markdown, type FileInput, type Child } from '@json-layout/vocabulary';
|
|
3
3
|
import { type SkeletonTree, type SkeletonNode, type StatefulLayout, type CompiledLayout } from '../index.js';
|
|
4
4
|
import { type LocaleMessages } from '../i18n/types.js';
|
|
5
5
|
export interface StateNode {
|
|
@@ -25,16 +25,20 @@ export interface StateNode {
|
|
|
25
25
|
export interface StateTree {
|
|
26
26
|
root: StateNode;
|
|
27
27
|
valid: boolean;
|
|
28
|
-
title: string;
|
|
29
28
|
}
|
|
30
29
|
export interface CreateStateTreeContext {
|
|
31
30
|
errors?: ErrorObject[];
|
|
32
|
-
|
|
31
|
+
files: FileRef[];
|
|
33
32
|
activeItems: Record<string, number>;
|
|
34
33
|
autofocusTarget: string | null;
|
|
35
34
|
initial: boolean;
|
|
36
35
|
cacheKeys: Record<string, StateNodeCacheKey>;
|
|
37
36
|
rootData: unknown;
|
|
37
|
+
nodes: StateNode[];
|
|
38
|
+
}
|
|
39
|
+
export interface FileRef {
|
|
40
|
+
file: File;
|
|
41
|
+
dataPath: string;
|
|
38
42
|
}
|
|
39
43
|
export type StateNodeCacheKey = [
|
|
40
44
|
StateNodeOptions,
|
|
@@ -152,4 +156,12 @@ export type ComboboxNode = Omit<StateNode, 'children'> & {
|
|
|
152
156
|
layout: Combobox;
|
|
153
157
|
data: any[];
|
|
154
158
|
};
|
|
159
|
+
export type FileInputNode = Omit<StateNode, 'children'> & {
|
|
160
|
+
layout: FileInput;
|
|
161
|
+
data: object | undefined | null;
|
|
162
|
+
};
|
|
163
|
+
export type MarkdownNode = Omit<StateNode, 'children'> & {
|
|
164
|
+
layout: Markdown;
|
|
165
|
+
data: string | undefined | null;
|
|
166
|
+
};
|
|
155
167
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EACL,KAAK,UAAU,EACf,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,KAAK,EACX,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAA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|
6
6
|
*/
|
|
7
|
-
export function shallowProduceArray<ItemType>(
|
|
7
|
+
export function shallowProduceArray<ItemType>(previousArray?: ItemType[], newArray?: ItemType[]): ItemType[];
|
|
8
8
|
/**
|
|
9
9
|
* @template ItemType
|
|
10
10
|
* @param {any[]} a1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/state/utils/immutable.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/state/utils/immutable.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,6GAIC;AAED;;;;;GAKG;AACH,iDAJW,GAAG,EAAE,OACL,GAAG,EAAE,GACH,OAAO,CAMnB"}
|