@json-layout/vocabulary 0.3.0 → 0.5.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/normalize.js +2 -2
- package/src/normalized-layout/index.js +1 -1
- package/src/normalized-layout/schema.js +9 -5
- package/src/normalized-layout/schema.json +8 -5
- package/src/normalized-layout/types.ts +5 -4
- package/src/normalized-layout/validate.js +2 -2
- package/types/normalized-layout/index.d.ts +2 -2
- package/types/normalized-layout/index.d.ts.map +1 -1
- package/types/normalized-layout/schema.d.ts +5 -2
- package/types/normalized-layout/types.d.ts +5 -4
- package/types/normalized-layout/types.d.ts.map +1 -1
- package/types/normalized-layout/validate.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-layout/vocabulary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Main JSON Layout vocabulary as JSON schemas and Typescript types. Also contains some small utility functions to validate and normalize annotations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/src/normalize.js
CHANGED
|
@@ -152,8 +152,8 @@ function getPartialCompObject (layoutKeyword) {
|
|
|
152
152
|
* @returns {Expression}
|
|
153
153
|
*/
|
|
154
154
|
function normalizeExpression (expression, defaultType = 'js-eval') {
|
|
155
|
-
if (typeof expression === 'string') return { type: defaultType, expr: expression }
|
|
156
|
-
else return {
|
|
155
|
+
if (typeof expression === 'string') return { type: defaultType, expr: expression, pure: true }
|
|
156
|
+
else return { pure: true, type: defaultType, ...expression }
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -35,7 +35,7 @@ import schema from './schema.js'
|
|
|
35
35
|
* @typedef {import('./types.js').Combobox} Combobox
|
|
36
36
|
* @typedef {import('./types.js').Cols} Cols
|
|
37
37
|
* @typedef {import('./types.js').ColsObj} ColsObj
|
|
38
|
-
* @typedef {import('./types.js').
|
|
38
|
+
* @typedef {import('./types.js').StateNodeOptionsBase} StateNodeOptionsBase
|
|
39
39
|
* @typedef {import('./types.js').Slot} Slot
|
|
40
40
|
* @typedef {{ errors: any, (layoutKeyword: any): layoutKeyword is NormalizedLayout }} ValidateNormalizedLayout
|
|
41
41
|
*/
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
81
|
"options": {
|
|
82
|
-
"$ref": "#/$defs/state-node-options"
|
|
82
|
+
"$ref": "#/$defs/state-node-options-base"
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
},
|
|
@@ -869,7 +869,8 @@ export default {
|
|
|
869
869
|
"type": "object",
|
|
870
870
|
"required": [
|
|
871
871
|
"type",
|
|
872
|
-
"expr"
|
|
872
|
+
"expr",
|
|
873
|
+
"pure"
|
|
873
874
|
],
|
|
874
875
|
"properties": {
|
|
875
876
|
"type": {
|
|
@@ -883,6 +884,9 @@ export default {
|
|
|
883
884
|
"expr": {
|
|
884
885
|
"type": "string"
|
|
885
886
|
},
|
|
887
|
+
"pure": {
|
|
888
|
+
"type": "boolean"
|
|
889
|
+
},
|
|
886
890
|
"ref": {
|
|
887
891
|
"type": "integer",
|
|
888
892
|
"readOnly": true
|
|
@@ -962,11 +966,11 @@ export default {
|
|
|
962
966
|
}
|
|
963
967
|
]
|
|
964
968
|
},
|
|
965
|
-
"state-node-options": {
|
|
969
|
+
"state-node-options-base": {
|
|
966
970
|
"type": "object",
|
|
967
971
|
"allOf": [
|
|
968
972
|
{
|
|
969
|
-
"$ref": "#/$defs/state-node-options-lib"
|
|
973
|
+
"$ref": "#/$defs/state-node-options-base-lib"
|
|
970
974
|
},
|
|
971
975
|
{
|
|
972
976
|
"properties": {
|
|
@@ -988,7 +992,7 @@ export default {
|
|
|
988
992
|
}
|
|
989
993
|
]
|
|
990
994
|
},
|
|
991
|
-
"state-node-options-lib": {
|
|
995
|
+
"state-node-options-base-lib": {
|
|
992
996
|
"type": "object",
|
|
993
997
|
"patternProperties": {
|
|
994
998
|
".*": {}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
|
-
"options": {"$ref": "#/$defs/state-node-options"}
|
|
47
|
+
"options": {"$ref": "#/$defs/state-node-options-base"}
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
},
|
|
398
398
|
"expression": {
|
|
399
399
|
"type": "object",
|
|
400
|
-
"required": ["type", "expr"],
|
|
400
|
+
"required": ["type", "expr", "pure"],
|
|
401
401
|
"properties": {
|
|
402
402
|
"type": {
|
|
403
403
|
"type": "string",
|
|
@@ -406,6 +406,9 @@
|
|
|
406
406
|
"expr": {
|
|
407
407
|
"type": "string"
|
|
408
408
|
},
|
|
409
|
+
"pure": {
|
|
410
|
+
"type": "boolean"
|
|
411
|
+
},
|
|
409
412
|
"ref": {
|
|
410
413
|
"type": "integer",
|
|
411
414
|
"readOnly": true
|
|
@@ -458,10 +461,10 @@
|
|
|
458
461
|
}
|
|
459
462
|
]
|
|
460
463
|
},
|
|
461
|
-
"state-node-options": {
|
|
464
|
+
"state-node-options-base": {
|
|
462
465
|
"type": "object",
|
|
463
466
|
"allOf": [
|
|
464
|
-
{"$ref": "#/$defs/state-node-options-lib"},
|
|
467
|
+
{"$ref": "#/$defs/state-node-options-base-lib"},
|
|
465
468
|
{
|
|
466
469
|
"properties": {
|
|
467
470
|
"readOnly": {"type": "boolean", "default": false},
|
|
@@ -471,7 +474,7 @@
|
|
|
471
474
|
}
|
|
472
475
|
]
|
|
473
476
|
},
|
|
474
|
-
"state-node-options-lib": {
|
|
477
|
+
"state-node-options-base-lib": {
|
|
475
478
|
"type": "object",
|
|
476
479
|
"patternProperties": {
|
|
477
480
|
".*": {}
|
|
@@ -13,7 +13,7 @@ export type CompObject = {
|
|
|
13
13
|
component?: Slot;
|
|
14
14
|
[k: string]: unknown;
|
|
15
15
|
};
|
|
16
|
-
options?:
|
|
16
|
+
options?: StateNodeOptionsBase;
|
|
17
17
|
[k: string]: unknown;
|
|
18
18
|
} & (
|
|
19
19
|
| None
|
|
@@ -55,7 +55,7 @@ export type Slot =
|
|
|
55
55
|
| {
|
|
56
56
|
name: string;
|
|
57
57
|
};
|
|
58
|
-
export type
|
|
58
|
+
export type StateNodeOptionsBase = StateNodeOptionsBaseLib & {
|
|
59
59
|
readOnly?: boolean;
|
|
60
60
|
summary?: boolean;
|
|
61
61
|
titleDepth?: number;
|
|
@@ -90,6 +90,7 @@ export interface SwitchStruct {
|
|
|
90
90
|
export interface Expression {
|
|
91
91
|
type: "js-fn" | "js-eval" | "js-tpl";
|
|
92
92
|
expr: string;
|
|
93
|
+
pure: boolean;
|
|
93
94
|
ref?: number;
|
|
94
95
|
[k: string]: unknown;
|
|
95
96
|
}
|
|
@@ -111,9 +112,9 @@ export interface StateNodePropsLib {
|
|
|
111
112
|
export interface StateNodeSlotsLib {
|
|
112
113
|
[k: string]: Slot;
|
|
113
114
|
}
|
|
114
|
-
export interface
|
|
115
|
+
export interface StateNodeOptionsBaseLib {
|
|
115
116
|
/**
|
|
116
|
-
* This interface was referenced by `
|
|
117
|
+
* This interface was referenced by `StateNodeOptionsBaseLib`'s JSON-Schema definition
|
|
117
118
|
* via the `patternProperty` ".*".
|
|
118
119
|
*/
|
|
119
120
|
[k: string]: unknown;
|