@teleporthq/teleport-uidl-validator 0.19.8 → 0.19.21
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/__tests__/validator/index.ts +10 -1
- package/__tests__/validator/project-sample.json +9 -1
- package/dist/cjs/decoders/component-decoder.js +19 -19
- package/dist/cjs/decoders/component-decoder.js.map +1 -1
- package/dist/cjs/decoders/custom-combinators.js +4 -4
- package/dist/cjs/decoders/custom-combinators.js.map +1 -1
- package/dist/cjs/decoders/project-decoder.d.ts +2 -2
- package/dist/cjs/decoders/project-decoder.js +24 -24
- package/dist/cjs/decoders/project-decoder.js.map +1 -1
- package/dist/cjs/decoders/utils.d.ts +6 -5
- package/dist/cjs/decoders/utils.js +251 -245
- package/dist/cjs/decoders/utils.js.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parser/index.d.ts +2 -1
- package/dist/cjs/parser/index.js +22 -9
- package/dist/cjs/parser/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/validator/index.d.ts +3 -3
- package/dist/cjs/validator/index.js +20 -12
- package/dist/cjs/validator/index.js.map +1 -1
- package/dist/cjs/validator/utils.js +49 -35
- package/dist/cjs/validator/utils.js.map +1 -1
- package/dist/esm/decoders/custom-combinators.js +4 -4
- package/dist/esm/decoders/custom-combinators.js.map +1 -1
- package/dist/esm/decoders/project-decoder.d.ts +2 -2
- package/dist/esm/decoders/project-decoder.js.map +1 -1
- package/dist/esm/decoders/utils.d.ts +6 -5
- package/dist/esm/decoders/utils.js +7 -1
- package/dist/esm/decoders/utils.js.map +1 -1
- package/dist/esm/parser/index.d.ts +2 -1
- package/dist/esm/parser/index.js +18 -6
- package/dist/esm/parser/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/validator/index.d.ts +3 -3
- package/dist/esm/validator/index.js +15 -11
- package/dist/esm/validator/index.js.map +1 -1
- package/dist/esm/validator/utils.js +47 -33
- package/dist/esm/validator/utils.js.map +1 -1
- package/package.json +4 -4
- package/src/decoders/project-decoder.ts +2 -2
- package/src/decoders/utils.ts +18 -9
- package/src/parser/index.ts +24 -1
- package/src/validator/index.ts +7 -3
- package/src/validator/utils.ts +21 -0
|
@@ -1,305 +1,311 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.uidlNodeDecoder = exports.elementNodeDecoder = exports.conditionalNodeDecoder = exports.repeatNodeDecoder = exports.slotNodeDecoder = exports.elementDecoder = exports.designTokensDecoder = void 0;
|
|
3
|
+
exports.classDynamicReferenceDecoder = exports.elementInlineReferencedStyle = exports.elementProjectReferencedStyle = exports.styleConditionsDecoder = exports.elementStyleWithMediaConditionDecoder = exports.elementStyleWithStateConditionDecoder = exports.elementStateDecoder = exports.rawValueDecoder = exports.uidlLinkNodeDecoder = exports.phoneLinkNodeDecoder = exports.uidlMailLinkNodeDecoder = exports.navLinkNodeDecoder = exports.sectionLinkNodeDecoder = exports.urlLinkNodeDecoder = exports.stateChangeEventDecoder = exports.propCallEventDecoder = exports.eventHandlerStatementDecoder = exports.styleDefinitionsDecoder = exports.styleValueDecoder = exports.uidlComponentStyleReference = exports.attributeValueDecoder = exports.importReferenceDecoder = exports.dependencyDecoder = exports.localDependencyDecoder = exports.externaldependencyDecoder = exports.peerDependencyDecoder = exports.outputOptionsDecoder = exports.stateDefinitionsDecoder = exports.propDefinitionsDecoder = exports.stateValueDetailsDecoder = exports.componentSeoDecoder = exports.iconAssetDecoder = exports.canonicalAssetDecoder = exports.fontAssetDecoder = exports.externalStyleAssetDecoder = exports.inlineStyletAssetDecoder = exports.externalScriptAssetDecoder = exports.inlineScriptAssetDecoder = exports.baseAssetDecoder = exports.globalAssetsDecoder = exports.pageOptionsDecoder = exports.stateOrPropDefinitionDecoder = exports.styleSetDefinitionDecoder = exports.tokenReferenceDecoder = exports.projectStyleConditionsDecoder = exports.styleSetStateConditionDecoder = exports.styleSetMediaConditionDecoder = exports.staticValueDecoder = exports.dynamicValueDecoder = exports.referenceTypeDecoder = void 0;
|
|
4
|
+
exports.uidlNodeDecoder = exports.elementNodeDecoder = exports.conditionalNodeDecoder = exports.repeatNodeDecoder = exports.slotNodeDecoder = exports.elementDecoder = exports.designTokensDecoder = exports.elementComponentReferencedStyle = void 0;
|
|
5
5
|
var json_type_validation_1 = require("@mojotech/json-type-validation");
|
|
6
6
|
var custom_combinators_1 = require("./custom-combinators");
|
|
7
7
|
var isValidComponentName = custom_combinators_1.CustomCombinators.isValidComponentName, isValidFileName = custom_combinators_1.CustomCombinators.isValidFileName, isValidElementName = custom_combinators_1.CustomCombinators.isValidElementName, isValidNavLink = custom_combinators_1.CustomCombinators.isValidNavLink;
|
|
8
|
-
exports.referenceTypeDecoder = json_type_validation_1.union(json_type_validation_1.constant('prop'), json_type_validation_1.constant('state'), json_type_validation_1.constant('local'), json_type_validation_1.constant('attr'), json_type_validation_1.constant('children'), json_type_validation_1.constant('token'));
|
|
9
|
-
exports.dynamicValueDecoder = json_type_validation_1.object({
|
|
10
|
-
type: json_type_validation_1.constant('dynamic'),
|
|
11
|
-
content: json_type_validation_1.object({
|
|
8
|
+
exports.referenceTypeDecoder = (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('prop'), (0, json_type_validation_1.constant)('state'), (0, json_type_validation_1.constant)('local'), (0, json_type_validation_1.constant)('attr'), (0, json_type_validation_1.constant)('children'), (0, json_type_validation_1.constant)('token'));
|
|
9
|
+
exports.dynamicValueDecoder = (0, json_type_validation_1.object)({
|
|
10
|
+
type: (0, json_type_validation_1.constant)('dynamic'),
|
|
11
|
+
content: (0, json_type_validation_1.object)({
|
|
12
12
|
referenceType: exports.referenceTypeDecoder,
|
|
13
|
-
id: json_type_validation_1.string(),
|
|
13
|
+
id: (0, json_type_validation_1.string)(),
|
|
14
14
|
}),
|
|
15
15
|
});
|
|
16
|
-
exports.staticValueDecoder = json_type_validation_1.object({
|
|
17
|
-
type: json_type_validation_1.constant('static'),
|
|
18
|
-
content: json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.boolean(), json_type_validation_1.array()),
|
|
19
|
-
});
|
|
20
|
-
exports.styleSetMediaConditionDecoder = json_type_validation_1.object({
|
|
21
|
-
type: json_type_validation_1.constant('screen-size'),
|
|
22
|
-
meta: json_type_validation_1.object({
|
|
23
|
-
maxWidth: json_type_validation_1.number(),
|
|
24
|
-
maxHeight: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
25
|
-
minHeight: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
26
|
-
minWidth: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
16
|
+
exports.staticValueDecoder = (0, json_type_validation_1.object)({
|
|
17
|
+
type: (0, json_type_validation_1.constant)('static'),
|
|
18
|
+
content: (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)(), (0, json_type_validation_1.array)()),
|
|
19
|
+
});
|
|
20
|
+
exports.styleSetMediaConditionDecoder = (0, json_type_validation_1.object)({
|
|
21
|
+
type: (0, json_type_validation_1.constant)('screen-size'),
|
|
22
|
+
meta: (0, json_type_validation_1.object)({
|
|
23
|
+
maxWidth: (0, json_type_validation_1.number)(),
|
|
24
|
+
maxHeight: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
25
|
+
minHeight: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
26
|
+
minWidth: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
27
27
|
}),
|
|
28
|
-
content: json_type_validation_1.dict(json_type_validation_1.union(exports.staticValueDecoder, json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.lazy(function () { return exports.tokenReferenceDecoder; }))),
|
|
28
|
+
content: (0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.lazy)(function () { return exports.tokenReferenceDecoder; }))),
|
|
29
29
|
});
|
|
30
|
-
exports.styleSetStateConditionDecoder = json_type_validation_1.object({
|
|
31
|
-
type: json_type_validation_1.constant('element-state'),
|
|
32
|
-
meta: json_type_validation_1.object({
|
|
33
|
-
state: json_type_validation_1.lazy(function () { return exports.elementStateDecoder; }),
|
|
30
|
+
exports.styleSetStateConditionDecoder = (0, json_type_validation_1.object)({
|
|
31
|
+
type: (0, json_type_validation_1.constant)('element-state'),
|
|
32
|
+
meta: (0, json_type_validation_1.object)({
|
|
33
|
+
state: (0, json_type_validation_1.lazy)(function () { return exports.elementStateDecoder; }),
|
|
34
34
|
}),
|
|
35
|
-
content: json_type_validation_1.dict(json_type_validation_1.union(exports.staticValueDecoder, json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.lazy(function () { return exports.tokenReferenceDecoder; }))),
|
|
36
|
-
});
|
|
37
|
-
exports.projectStyleConditionsDecoder = json_type_validation_1.union(exports.styleSetMediaConditionDecoder, exports.styleSetStateConditionDecoder);
|
|
38
|
-
exports.tokenReferenceDecoder = json_type_validation_1.object({
|
|
39
|
-
type: json_type_validation_1.constant('dynamic'),
|
|
40
|
-
content: json_type_validation_1.object({
|
|
41
|
-
referenceType: json_type_validation_1.constant('token'),
|
|
42
|
-
id: json_type_validation_1.string(),
|
|
35
|
+
content: (0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.lazy)(function () { return exports.tokenReferenceDecoder; }))),
|
|
36
|
+
});
|
|
37
|
+
exports.projectStyleConditionsDecoder = (0, json_type_validation_1.union)(exports.styleSetMediaConditionDecoder, exports.styleSetStateConditionDecoder);
|
|
38
|
+
exports.tokenReferenceDecoder = (0, json_type_validation_1.object)({
|
|
39
|
+
type: (0, json_type_validation_1.constant)('dynamic'),
|
|
40
|
+
content: (0, json_type_validation_1.object)({
|
|
41
|
+
referenceType: (0, json_type_validation_1.constant)('token'),
|
|
42
|
+
id: (0, json_type_validation_1.string)(),
|
|
43
43
|
}),
|
|
44
44
|
});
|
|
45
|
-
exports.styleSetDefinitionDecoder = json_type_validation_1.object({
|
|
46
|
-
type: json_type_validation_1.union(json_type_validation_1.constant('reusable-project-style-map'), json_type_validation_1.constant('reusable-component-style-map')),
|
|
47
|
-
conditions: json_type_validation_1.optional(json_type_validation_1.array(exports.projectStyleConditionsDecoder)),
|
|
48
|
-
content: json_type_validation_1.dict(json_type_validation_1.union(exports.staticValueDecoder, json_type_validation_1.string(), json_type_validation_1.number(), exports.tokenReferenceDecoder)),
|
|
45
|
+
exports.styleSetDefinitionDecoder = (0, json_type_validation_1.object)({
|
|
46
|
+
type: (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('reusable-project-style-map'), (0, json_type_validation_1.constant)('reusable-component-style-map')),
|
|
47
|
+
conditions: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)(exports.projectStyleConditionsDecoder)),
|
|
48
|
+
content: (0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), exports.tokenReferenceDecoder)),
|
|
49
49
|
});
|
|
50
50
|
// TODO: Implement decoder for () => void
|
|
51
|
-
exports.stateOrPropDefinitionDecoder = json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.boolean(), json_type_validation_1.array(json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.object())), json_type_validation_1.object());
|
|
52
|
-
exports.pageOptionsDecoder = json_type_validation_1.object({
|
|
53
|
-
componentName: json_type_validation_1.optional(isValidComponentName()),
|
|
54
|
-
navLink: json_type_validation_1.optional(isValidNavLink()),
|
|
55
|
-
fileName: json_type_validation_1.optional(isValidFileName()),
|
|
56
|
-
});
|
|
57
|
-
exports.globalAssetsDecoder = json_type_validation_1.union(json_type_validation_1.lazy(function () { return exports.inlineScriptAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.externalScriptAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.inlineStyletAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.externalStyleAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.fontAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.canonicalAssetDecoder; }), json_type_validation_1.lazy(function () { return exports.iconAssetDecoder; }));
|
|
58
|
-
exports.baseAssetDecoder = json_type_validation_1.object({
|
|
59
|
-
options: json_type_validation_1.optional(json_type_validation_1.object({
|
|
60
|
-
async: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
61
|
-
defer: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
62
|
-
target: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
51
|
+
exports.stateOrPropDefinitionDecoder = (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)(), (0, json_type_validation_1.array)((0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.object)())), (0, json_type_validation_1.object)());
|
|
52
|
+
exports.pageOptionsDecoder = (0, json_type_validation_1.object)({
|
|
53
|
+
componentName: (0, json_type_validation_1.optional)(isValidComponentName()),
|
|
54
|
+
navLink: (0, json_type_validation_1.optional)(isValidNavLink()),
|
|
55
|
+
fileName: (0, json_type_validation_1.optional)(isValidFileName()),
|
|
56
|
+
});
|
|
57
|
+
exports.globalAssetsDecoder = (0, json_type_validation_1.union)((0, json_type_validation_1.lazy)(function () { return exports.inlineScriptAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.externalScriptAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.inlineStyletAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.externalStyleAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.fontAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.canonicalAssetDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.iconAssetDecoder; }));
|
|
58
|
+
exports.baseAssetDecoder = (0, json_type_validation_1.object)({
|
|
59
|
+
options: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
60
|
+
async: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
61
|
+
defer: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
62
|
+
target: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
63
63
|
})),
|
|
64
64
|
});
|
|
65
|
-
exports.inlineScriptAssetDecoder = json_type_validation_1.intersection(json_type_validation_1.object({
|
|
66
|
-
type: json_type_validation_1.constant('script'),
|
|
67
|
-
content: json_type_validation_1.string(),
|
|
68
|
-
}), json_type_validation_1.optional(exports.baseAssetDecoder));
|
|
69
|
-
exports.externalScriptAssetDecoder = json_type_validation_1.intersection(json_type_validation_1.object({
|
|
70
|
-
type: json_type_validation_1.constant('script'),
|
|
71
|
-
path: json_type_validation_1.string(),
|
|
72
|
-
}), json_type_validation_1.optional(exports.baseAssetDecoder));
|
|
73
|
-
exports.inlineStyletAssetDecoder = json_type_validation_1.object({
|
|
74
|
-
type: json_type_validation_1.constant('style'),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
exports.inlineScriptAssetDecoder = (0, json_type_validation_1.intersection)((0, json_type_validation_1.object)({
|
|
66
|
+
type: (0, json_type_validation_1.constant)('script'),
|
|
67
|
+
content: (0, json_type_validation_1.string)(),
|
|
68
|
+
}), (0, json_type_validation_1.optional)(exports.baseAssetDecoder));
|
|
69
|
+
exports.externalScriptAssetDecoder = (0, json_type_validation_1.intersection)((0, json_type_validation_1.object)({
|
|
70
|
+
type: (0, json_type_validation_1.constant)('script'),
|
|
71
|
+
path: (0, json_type_validation_1.string)(),
|
|
72
|
+
}), (0, json_type_validation_1.optional)(exports.baseAssetDecoder));
|
|
73
|
+
exports.inlineStyletAssetDecoder = (0, json_type_validation_1.object)({
|
|
74
|
+
type: (0, json_type_validation_1.constant)('style'),
|
|
75
|
+
attrs: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.boolean)(), (0, json_type_validation_1.number)()))),
|
|
76
|
+
content: (0, json_type_validation_1.string)(),
|
|
77
|
+
});
|
|
78
|
+
exports.externalStyleAssetDecoder = (0, json_type_validation_1.object)({
|
|
79
|
+
type: (0, json_type_validation_1.constant)('style'),
|
|
80
|
+
path: (0, json_type_validation_1.string)(),
|
|
81
|
+
});
|
|
82
|
+
exports.fontAssetDecoder = (0, json_type_validation_1.object)({
|
|
83
|
+
type: (0, json_type_validation_1.constant)('font'),
|
|
84
|
+
attrs: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.boolean)(), (0, json_type_validation_1.number)()))),
|
|
85
|
+
path: (0, json_type_validation_1.string)(),
|
|
86
|
+
});
|
|
87
|
+
exports.canonicalAssetDecoder = (0, json_type_validation_1.object)({
|
|
88
|
+
type: (0, json_type_validation_1.constant)('canonical'),
|
|
89
|
+
path: (0, json_type_validation_1.string)(),
|
|
90
|
+
});
|
|
91
|
+
exports.iconAssetDecoder = (0, json_type_validation_1.object)({
|
|
92
|
+
type: (0, json_type_validation_1.constant)('icon'),
|
|
93
|
+
path: (0, json_type_validation_1.string)(),
|
|
94
|
+
options: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
95
|
+
iconType: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
96
|
+
iconSizes: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
95
97
|
})),
|
|
96
98
|
});
|
|
97
|
-
exports.componentSeoDecoder = json_type_validation_1.object({
|
|
98
|
-
title: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
99
|
-
metaTags: json_type_validation_1.optional(json_type_validation_1.array(json_type_validation_1.dict(json_type_validation_1.string()))),
|
|
100
|
-
assets: json_type_validation_1.optional(json_type_validation_1.array(exports.globalAssetsDecoder)),
|
|
99
|
+
exports.componentSeoDecoder = (0, json_type_validation_1.object)({
|
|
100
|
+
title: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
101
|
+
metaTags: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)((0, json_type_validation_1.dict)((0, json_type_validation_1.string)()))),
|
|
102
|
+
assets: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)(exports.globalAssetsDecoder)),
|
|
101
103
|
});
|
|
102
|
-
exports.stateValueDetailsDecoder = json_type_validation_1.object({
|
|
103
|
-
value: json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.boolean()),
|
|
104
|
-
pageOptions: json_type_validation_1.optional(exports.pageOptionsDecoder),
|
|
105
|
-
seo: json_type_validation_1.optional(exports.componentSeoDecoder),
|
|
104
|
+
exports.stateValueDetailsDecoder = (0, json_type_validation_1.object)({
|
|
105
|
+
value: (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)()),
|
|
106
|
+
pageOptions: (0, json_type_validation_1.optional)(exports.pageOptionsDecoder),
|
|
107
|
+
seo: (0, json_type_validation_1.optional)(exports.componentSeoDecoder),
|
|
106
108
|
});
|
|
107
|
-
exports.propDefinitionsDecoder = json_type_validation_1.object({
|
|
108
|
-
type: json_type_validation_1.union(json_type_validation_1.constant('string'), json_type_validation_1.constant('boolean'), json_type_validation_1.constant('number'), json_type_validation_1.constant('array'), json_type_validation_1.constant('func'), json_type_validation_1.constant('object'), json_type_validation_1.constant('children')),
|
|
109
|
-
defaultValue: json_type_validation_1.optional(exports.stateOrPropDefinitionDecoder),
|
|
110
|
-
isRequired: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
109
|
+
exports.propDefinitionsDecoder = (0, json_type_validation_1.object)({
|
|
110
|
+
type: (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('string'), (0, json_type_validation_1.constant)('boolean'), (0, json_type_validation_1.constant)('number'), (0, json_type_validation_1.constant)('array'), (0, json_type_validation_1.constant)('func'), (0, json_type_validation_1.constant)('object'), (0, json_type_validation_1.constant)('children')),
|
|
111
|
+
defaultValue: (0, json_type_validation_1.optional)(exports.stateOrPropDefinitionDecoder),
|
|
112
|
+
isRequired: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
111
113
|
});
|
|
112
|
-
exports.stateDefinitionsDecoder = json_type_validation_1.object({
|
|
113
|
-
type: json_type_validation_1.union(json_type_validation_1.constant('string'), json_type_validation_1.constant('boolean'), json_type_validation_1.constant('number'), json_type_validation_1.constant('array'), json_type_validation_1.constant('func'), json_type_validation_1.constant('object'), json_type_validation_1.constant('children')),
|
|
114
|
+
exports.stateDefinitionsDecoder = (0, json_type_validation_1.object)({
|
|
115
|
+
type: (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('string'), (0, json_type_validation_1.constant)('boolean'), (0, json_type_validation_1.constant)('number'), (0, json_type_validation_1.constant)('array'), (0, json_type_validation_1.constant)('func'), (0, json_type_validation_1.constant)('object'), (0, json_type_validation_1.constant)('children')),
|
|
114
116
|
defaultValue: exports.stateOrPropDefinitionDecoder,
|
|
115
|
-
values: json_type_validation_1.optional(json_type_validation_1.array(exports.stateValueDetailsDecoder)),
|
|
116
|
-
});
|
|
117
|
-
exports.outputOptionsDecoder = json_type_validation_1.object({
|
|
118
|
-
componentClassName: json_type_validation_1.optional(isValidComponentName()),
|
|
119
|
-
fileName: json_type_validation_1.optional(isValidFileName()),
|
|
120
|
-
styleFileName: json_type_validation_1.optional(isValidFileName()),
|
|
121
|
-
templateFileName: json_type_validation_1.optional(isValidFileName()),
|
|
122
|
-
moduleName: json_type_validation_1.optional(isValidFileName()),
|
|
123
|
-
folderPath: json_type_validation_1.optional(json_type_validation_1.array(isValidFileName())),
|
|
124
|
-
});
|
|
125
|
-
exports.peerDependencyDecoder = json_type_validation_1.object({
|
|
126
|
-
type: json_type_validation_1.constant('package'),
|
|
127
|
-
version: json_type_validation_1.string(),
|
|
128
|
-
path: json_type_validation_1.string(),
|
|
129
|
-
});
|
|
130
|
-
exports.externaldependencyDecoder = json_type_validation_1.object({
|
|
131
|
-
type: json_type_validation_1.union(json_type_validation_1.constant('library'), json_type_validation_1.constant('package')),
|
|
132
|
-
path: json_type_validation_1.string(),
|
|
133
|
-
version: json_type_validation_1.string(),
|
|
134
|
-
meta: json_type_validation_1.optional(json_type_validation_1.object({
|
|
135
|
-
namedImport: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
136
|
-
originalName: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
137
|
-
importJustPath: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
138
|
-
useAsReference: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
117
|
+
values: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)(exports.stateValueDetailsDecoder)),
|
|
118
|
+
});
|
|
119
|
+
exports.outputOptionsDecoder = (0, json_type_validation_1.object)({
|
|
120
|
+
componentClassName: (0, json_type_validation_1.optional)(isValidComponentName()),
|
|
121
|
+
fileName: (0, json_type_validation_1.optional)(isValidFileName()),
|
|
122
|
+
styleFileName: (0, json_type_validation_1.optional)(isValidFileName()),
|
|
123
|
+
templateFileName: (0, json_type_validation_1.optional)(isValidFileName()),
|
|
124
|
+
moduleName: (0, json_type_validation_1.optional)(isValidFileName()),
|
|
125
|
+
folderPath: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)(isValidFileName())),
|
|
126
|
+
});
|
|
127
|
+
exports.peerDependencyDecoder = (0, json_type_validation_1.object)({
|
|
128
|
+
type: (0, json_type_validation_1.constant)('package'),
|
|
129
|
+
version: (0, json_type_validation_1.string)(),
|
|
130
|
+
path: (0, json_type_validation_1.string)(),
|
|
131
|
+
});
|
|
132
|
+
exports.externaldependencyDecoder = (0, json_type_validation_1.object)({
|
|
133
|
+
type: (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('library'), (0, json_type_validation_1.constant)('package')),
|
|
134
|
+
path: (0, json_type_validation_1.string)(),
|
|
135
|
+
version: (0, json_type_validation_1.string)(),
|
|
136
|
+
meta: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
137
|
+
namedImport: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
138
|
+
originalName: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
139
|
+
importJustPath: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
140
|
+
useAsReference: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
139
141
|
})),
|
|
140
142
|
});
|
|
141
|
-
exports.localDependencyDecoder = json_type_validation_1.object({
|
|
142
|
-
type: json_type_validation_1.constant('local'),
|
|
143
|
-
path: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
144
|
-
meta: json_type_validation_1.optional(json_type_validation_1.object({
|
|
145
|
-
namedImport: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
146
|
-
originalName: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
147
|
-
importJustPath: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
143
|
+
exports.localDependencyDecoder = (0, json_type_validation_1.object)({
|
|
144
|
+
type: (0, json_type_validation_1.constant)('local'),
|
|
145
|
+
path: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
146
|
+
meta: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
147
|
+
namedImport: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
148
|
+
originalName: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
149
|
+
importJustPath: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
148
150
|
})),
|
|
149
151
|
});
|
|
150
|
-
exports.dependencyDecoder = json_type_validation_1.union(exports.localDependencyDecoder, exports.externaldependencyDecoder);
|
|
151
|
-
exports.importReferenceDecoder = json_type_validation_1.object({
|
|
152
|
-
type: json_type_validation_1.constant('import'),
|
|
153
|
-
content: json_type_validation_1.object({
|
|
154
|
-
id: json_type_validation_1.string(),
|
|
152
|
+
exports.dependencyDecoder = (0, json_type_validation_1.union)(exports.localDependencyDecoder, exports.externaldependencyDecoder);
|
|
153
|
+
exports.importReferenceDecoder = (0, json_type_validation_1.object)({
|
|
154
|
+
type: (0, json_type_validation_1.constant)('import'),
|
|
155
|
+
content: (0, json_type_validation_1.object)({
|
|
156
|
+
id: (0, json_type_validation_1.string)(),
|
|
155
157
|
}),
|
|
156
158
|
});
|
|
157
|
-
exports.attributeValueDecoder = json_type_validation_1.union(exports.dynamicValueDecoder, exports.staticValueDecoder, exports.importReferenceDecoder);
|
|
158
|
-
exports.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
159
|
+
exports.attributeValueDecoder = (0, json_type_validation_1.union)(exports.dynamicValueDecoder, exports.staticValueDecoder, exports.importReferenceDecoder, (0, json_type_validation_1.lazy)(function () { return exports.uidlComponentStyleReference; }));
|
|
160
|
+
exports.uidlComponentStyleReference = (0, json_type_validation_1.object)({
|
|
161
|
+
type: (0, json_type_validation_1.constant)('comp-style'),
|
|
162
|
+
content: (0, json_type_validation_1.string)(),
|
|
163
|
+
});
|
|
164
|
+
exports.styleValueDecoder = (0, json_type_validation_1.union)(exports.staticValueDecoder, exports.dynamicValueDecoder);
|
|
165
|
+
exports.styleDefinitionsDecoder = (0, json_type_validation_1.dict)(exports.styleValueDecoder);
|
|
166
|
+
exports.eventHandlerStatementDecoder = (0, json_type_validation_1.union)((0, json_type_validation_1.lazy)(function () { return exports.propCallEventDecoder; }), (0, json_type_validation_1.lazy)(function () { return exports.stateChangeEventDecoder; }));
|
|
167
|
+
exports.propCallEventDecoder = (0, json_type_validation_1.object)({
|
|
168
|
+
type: (0, json_type_validation_1.constant)('propCall'),
|
|
169
|
+
calls: (0, json_type_validation_1.string)(),
|
|
170
|
+
args: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)((0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)()))),
|
|
171
|
+
});
|
|
172
|
+
exports.stateChangeEventDecoder = (0, json_type_validation_1.object)({
|
|
173
|
+
type: (0, json_type_validation_1.constant)('stateChange'),
|
|
174
|
+
modifies: (0, json_type_validation_1.string)(),
|
|
175
|
+
newState: (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)()),
|
|
176
|
+
});
|
|
177
|
+
exports.urlLinkNodeDecoder = (0, json_type_validation_1.object)({
|
|
178
|
+
type: (0, json_type_validation_1.constant)('url'),
|
|
179
|
+
content: (0, json_type_validation_1.object)({
|
|
180
|
+
url: (0, json_type_validation_1.union)(exports.attributeValueDecoder, (0, json_type_validation_1.string)()),
|
|
181
|
+
newTab: (0, json_type_validation_1.withDefault)(false, (0, json_type_validation_1.boolean)()),
|
|
176
182
|
}),
|
|
177
183
|
});
|
|
178
|
-
exports.sectionLinkNodeDecoder = json_type_validation_1.object({
|
|
179
|
-
type: json_type_validation_1.constant('section'),
|
|
180
|
-
content: json_type_validation_1.dict(json_type_validation_1.string()),
|
|
184
|
+
exports.sectionLinkNodeDecoder = (0, json_type_validation_1.object)({
|
|
185
|
+
type: (0, json_type_validation_1.constant)('section'),
|
|
186
|
+
content: (0, json_type_validation_1.dict)((0, json_type_validation_1.string)()),
|
|
181
187
|
});
|
|
182
|
-
exports.navLinkNodeDecoder = json_type_validation_1.object({
|
|
183
|
-
type: json_type_validation_1.constant('navlink'),
|
|
184
|
-
content: json_type_validation_1.object({
|
|
185
|
-
routeName: json_type_validation_1.string(),
|
|
188
|
+
exports.navLinkNodeDecoder = (0, json_type_validation_1.object)({
|
|
189
|
+
type: (0, json_type_validation_1.constant)('navlink'),
|
|
190
|
+
content: (0, json_type_validation_1.object)({
|
|
191
|
+
routeName: (0, json_type_validation_1.string)(),
|
|
186
192
|
}),
|
|
187
193
|
});
|
|
188
|
-
exports.uidlMailLinkNodeDecoder = json_type_validation_1.object({
|
|
189
|
-
type: json_type_validation_1.constant('mail'),
|
|
190
|
-
content: json_type_validation_1.object({
|
|
191
|
-
mail: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
192
|
-
subject: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
193
|
-
body: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
194
|
+
exports.uidlMailLinkNodeDecoder = (0, json_type_validation_1.object)({
|
|
195
|
+
type: (0, json_type_validation_1.constant)('mail'),
|
|
196
|
+
content: (0, json_type_validation_1.object)({
|
|
197
|
+
mail: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
198
|
+
subject: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
199
|
+
body: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
194
200
|
}),
|
|
195
201
|
});
|
|
196
|
-
exports.phoneLinkNodeDecoder = json_type_validation_1.object({
|
|
197
|
-
type: json_type_validation_1.constant('phone'),
|
|
198
|
-
content: json_type_validation_1.object({
|
|
199
|
-
phone: json_type_validation_1.string(),
|
|
202
|
+
exports.phoneLinkNodeDecoder = (0, json_type_validation_1.object)({
|
|
203
|
+
type: (0, json_type_validation_1.constant)('phone'),
|
|
204
|
+
content: (0, json_type_validation_1.object)({
|
|
205
|
+
phone: (0, json_type_validation_1.string)(),
|
|
200
206
|
}),
|
|
201
207
|
});
|
|
202
|
-
exports.uidlLinkNodeDecoder = json_type_validation_1.union(exports.urlLinkNodeDecoder, exports.sectionLinkNodeDecoder, exports.navLinkNodeDecoder, exports.uidlMailLinkNodeDecoder, exports.phoneLinkNodeDecoder);
|
|
203
|
-
exports.rawValueDecoder = json_type_validation_1.object({
|
|
204
|
-
type: json_type_validation_1.constant('raw'),
|
|
205
|
-
content: json_type_validation_1.string(),
|
|
208
|
+
exports.uidlLinkNodeDecoder = (0, json_type_validation_1.union)(exports.urlLinkNodeDecoder, exports.sectionLinkNodeDecoder, exports.navLinkNodeDecoder, exports.uidlMailLinkNodeDecoder, exports.phoneLinkNodeDecoder);
|
|
209
|
+
exports.rawValueDecoder = (0, json_type_validation_1.object)({
|
|
210
|
+
type: (0, json_type_validation_1.constant)('raw'),
|
|
211
|
+
content: (0, json_type_validation_1.string)(),
|
|
206
212
|
});
|
|
207
|
-
exports.elementStateDecoder = json_type_validation_1.oneOf(json_type_validation_1.constant('hover'), json_type_validation_1.constant('active'), json_type_validation_1.constant('focus'), json_type_validation_1.constant('focus-within'), json_type_validation_1.constant('focus-visible'), json_type_validation_1.constant('disabled'), json_type_validation_1.constant('visited'), json_type_validation_1.constant('checked'), json_type_validation_1.constant('link'));
|
|
208
|
-
exports.elementStyleWithStateConditionDecoder = json_type_validation_1.object({
|
|
209
|
-
conditionType: json_type_validation_1.constant('element-state'),
|
|
213
|
+
exports.elementStateDecoder = (0, json_type_validation_1.oneOf)((0, json_type_validation_1.constant)('hover'), (0, json_type_validation_1.constant)('active'), (0, json_type_validation_1.constant)('focus'), (0, json_type_validation_1.constant)('focus-within'), (0, json_type_validation_1.constant)('focus-visible'), (0, json_type_validation_1.constant)('disabled'), (0, json_type_validation_1.constant)('visited'), (0, json_type_validation_1.constant)('checked'), (0, json_type_validation_1.constant)('link'));
|
|
214
|
+
exports.elementStyleWithStateConditionDecoder = (0, json_type_validation_1.object)({
|
|
215
|
+
conditionType: (0, json_type_validation_1.constant)('element-state'),
|
|
210
216
|
content: exports.elementStateDecoder,
|
|
211
217
|
});
|
|
212
|
-
exports.elementStyleWithMediaConditionDecoder = json_type_validation_1.object({
|
|
213
|
-
conditionType: json_type_validation_1.constant('screen-size'),
|
|
214
|
-
minHeight: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
215
|
-
maxHeight: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
216
|
-
minWidth: json_type_validation_1.optional(json_type_validation_1.number()),
|
|
217
|
-
maxWidth: json_type_validation_1.number(),
|
|
218
|
-
});
|
|
219
|
-
exports.styleConditionsDecoder = json_type_validation_1.union(exports.elementStyleWithMediaConditionDecoder, exports.elementStyleWithStateConditionDecoder);
|
|
220
|
-
exports.elementProjectReferencedStyle = json_type_validation_1.object({
|
|
221
|
-
type: json_type_validation_1.constant('style-map'),
|
|
222
|
-
content: json_type_validation_1.object({
|
|
223
|
-
mapType: json_type_validation_1.constant('project-referenced'),
|
|
224
|
-
conditions: json_type_validation_1.optional(json_type_validation_1.array(exports.styleConditionsDecoder)),
|
|
225
|
-
referenceId: json_type_validation_1.string(),
|
|
218
|
+
exports.elementStyleWithMediaConditionDecoder = (0, json_type_validation_1.object)({
|
|
219
|
+
conditionType: (0, json_type_validation_1.constant)('screen-size'),
|
|
220
|
+
minHeight: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
221
|
+
maxHeight: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
222
|
+
minWidth: (0, json_type_validation_1.optional)((0, json_type_validation_1.number)()),
|
|
223
|
+
maxWidth: (0, json_type_validation_1.number)(),
|
|
224
|
+
});
|
|
225
|
+
exports.styleConditionsDecoder = (0, json_type_validation_1.union)(exports.elementStyleWithMediaConditionDecoder, exports.elementStyleWithStateConditionDecoder);
|
|
226
|
+
exports.elementProjectReferencedStyle = (0, json_type_validation_1.object)({
|
|
227
|
+
type: (0, json_type_validation_1.constant)('style-map'),
|
|
228
|
+
content: (0, json_type_validation_1.object)({
|
|
229
|
+
mapType: (0, json_type_validation_1.constant)('project-referenced'),
|
|
230
|
+
conditions: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)(exports.styleConditionsDecoder)),
|
|
231
|
+
referenceId: (0, json_type_validation_1.string)(),
|
|
226
232
|
}),
|
|
227
233
|
});
|
|
228
|
-
exports.elementInlineReferencedStyle = json_type_validation_1.object({
|
|
229
|
-
type: json_type_validation_1.constant('style-map'),
|
|
230
|
-
content: json_type_validation_1.object({
|
|
231
|
-
mapType: json_type_validation_1.constant('inlined'),
|
|
232
|
-
conditions: json_type_validation_1.array(exports.styleConditionsDecoder),
|
|
233
|
-
styles: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.union(exports.attributeValueDecoder, json_type_validation_1.string(), json_type_validation_1.number()))),
|
|
234
|
+
exports.elementInlineReferencedStyle = (0, json_type_validation_1.object)({
|
|
235
|
+
type: (0, json_type_validation_1.constant)('style-map'),
|
|
236
|
+
content: (0, json_type_validation_1.object)({
|
|
237
|
+
mapType: (0, json_type_validation_1.constant)('inlined'),
|
|
238
|
+
conditions: (0, json_type_validation_1.array)(exports.styleConditionsDecoder),
|
|
239
|
+
styles: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.attributeValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)()))),
|
|
234
240
|
}),
|
|
235
241
|
});
|
|
236
|
-
exports.classDynamicReferenceDecoder = json_type_validation_1.object({
|
|
237
|
-
type: json_type_validation_1.constant('dynamic'),
|
|
238
|
-
content: json_type_validation_1.object({
|
|
239
|
-
referenceType: json_type_validation_1.union(json_type_validation_1.constant('prop'), json_type_validation_1.constant('comp')),
|
|
240
|
-
id: json_type_validation_1.string(),
|
|
242
|
+
exports.classDynamicReferenceDecoder = (0, json_type_validation_1.object)({
|
|
243
|
+
type: (0, json_type_validation_1.constant)('dynamic'),
|
|
244
|
+
content: (0, json_type_validation_1.object)({
|
|
245
|
+
referenceType: (0, json_type_validation_1.union)((0, json_type_validation_1.constant)('prop'), (0, json_type_validation_1.constant)('comp')),
|
|
246
|
+
id: (0, json_type_validation_1.string)(),
|
|
241
247
|
}),
|
|
242
248
|
});
|
|
243
|
-
exports.elementComponentReferencedStyle = json_type_validation_1.object({
|
|
244
|
-
type: json_type_validation_1.constant('style-map'),
|
|
245
|
-
content: json_type_validation_1.object({
|
|
246
|
-
mapType: json_type_validation_1.constant('component-referenced'),
|
|
247
|
-
content: json_type_validation_1.union(json_type_validation_1.string(), exports.staticValueDecoder, exports.classDynamicReferenceDecoder),
|
|
249
|
+
exports.elementComponentReferencedStyle = (0, json_type_validation_1.object)({
|
|
250
|
+
type: (0, json_type_validation_1.constant)('style-map'),
|
|
251
|
+
content: (0, json_type_validation_1.object)({
|
|
252
|
+
mapType: (0, json_type_validation_1.constant)('component-referenced'),
|
|
253
|
+
content: (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), exports.staticValueDecoder, exports.classDynamicReferenceDecoder),
|
|
248
254
|
}),
|
|
249
255
|
});
|
|
250
|
-
exports.designTokensDecoder = json_type_validation_1.dict(json_type_validation_1.union(exports.staticValueDecoder, json_type_validation_1.string(), json_type_validation_1.number()));
|
|
251
|
-
exports.elementDecoder = json_type_validation_1.object({
|
|
252
|
-
elementType: json_type_validation_1.string(),
|
|
253
|
-
semanticType: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
254
|
-
name: json_type_validation_1.optional(isValidElementName()),
|
|
255
|
-
key: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
256
|
-
dependency: json_type_validation_1.optional(exports.dependencyDecoder),
|
|
257
|
-
style: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.union(exports.attributeValueDecoder, json_type_validation_1.string(), json_type_validation_1.number()))),
|
|
258
|
-
attrs: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.union(exports.attributeValueDecoder, json_type_validation_1.string(), json_type_validation_1.number()))),
|
|
259
|
-
events: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.array(exports.eventHandlerStatementDecoder))),
|
|
260
|
-
abilities: json_type_validation_1.optional(json_type_validation_1.object({
|
|
261
|
-
link: json_type_validation_1.optional(exports.uidlLinkNodeDecoder),
|
|
256
|
+
exports.designTokensDecoder = (0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.staticValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)()));
|
|
257
|
+
exports.elementDecoder = (0, json_type_validation_1.object)({
|
|
258
|
+
elementType: (0, json_type_validation_1.string)(),
|
|
259
|
+
semanticType: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
260
|
+
name: (0, json_type_validation_1.optional)(isValidElementName()),
|
|
261
|
+
key: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
262
|
+
dependency: (0, json_type_validation_1.optional)(exports.dependencyDecoder),
|
|
263
|
+
style: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.attributeValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)()))),
|
|
264
|
+
attrs: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.attributeValueDecoder, (0, json_type_validation_1.string)(), (0, json_type_validation_1.number)()))),
|
|
265
|
+
events: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.array)(exports.eventHandlerStatementDecoder))),
|
|
266
|
+
abilities: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
267
|
+
link: (0, json_type_validation_1.optional)(exports.uidlLinkNodeDecoder),
|
|
262
268
|
})),
|
|
263
|
-
children: json_type_validation_1.optional(json_type_validation_1.array(json_type_validation_1.lazy(function () { return exports.uidlNodeDecoder; }))),
|
|
264
|
-
referencedStyles: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.union(exports.elementInlineReferencedStyle, exports.elementProjectReferencedStyle, exports.elementComponentReferencedStyle))),
|
|
265
|
-
selfClosing: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
266
|
-
ignore: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
267
|
-
});
|
|
268
|
-
exports.slotNodeDecoder = json_type_validation_1.object({
|
|
269
|
-
type: json_type_validation_1.constant('slot'),
|
|
270
|
-
content: json_type_validation_1.union(json_type_validation_1.object({
|
|
271
|
-
name: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
272
|
-
fallback: json_type_validation_1.optional(json_type_validation_1.union(exports.staticValueDecoder, exports.dynamicValueDecoder, json_type_validation_1.lazy(function () { return exports.elementNodeDecoder; }))),
|
|
273
|
-
}), json_type_validation_1.object({})),
|
|
274
|
-
});
|
|
275
|
-
exports.repeatNodeDecoder = json_type_validation_1.object({
|
|
276
|
-
type: json_type_validation_1.constant('repeat'),
|
|
277
|
-
content: json_type_validation_1.object({
|
|
278
|
-
node: json_type_validation_1.lazy(function () { return exports.elementNodeDecoder; }),
|
|
279
|
-
dataSource: json_type_validation_1.optional(exports.attributeValueDecoder),
|
|
280
|
-
meta: json_type_validation_1.optional(json_type_validation_1.object({
|
|
281
|
-
useIndex: json_type_validation_1.optional(json_type_validation_1.boolean()),
|
|
282
|
-
iteratorName: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
283
|
-
dataSourceIdentifier: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
284
|
-
iteratorKey: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
269
|
+
children: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)((0, json_type_validation_1.lazy)(function () { return exports.uidlNodeDecoder; }))),
|
|
270
|
+
referencedStyles: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(exports.elementInlineReferencedStyle, exports.elementProjectReferencedStyle, exports.elementComponentReferencedStyle))),
|
|
271
|
+
selfClosing: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
272
|
+
ignore: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
273
|
+
});
|
|
274
|
+
exports.slotNodeDecoder = (0, json_type_validation_1.object)({
|
|
275
|
+
type: (0, json_type_validation_1.constant)('slot'),
|
|
276
|
+
content: (0, json_type_validation_1.union)((0, json_type_validation_1.object)({
|
|
277
|
+
name: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
278
|
+
fallback: (0, json_type_validation_1.optional)((0, json_type_validation_1.union)(exports.staticValueDecoder, exports.dynamicValueDecoder, (0, json_type_validation_1.lazy)(function () { return exports.elementNodeDecoder; }))),
|
|
279
|
+
}), (0, json_type_validation_1.object)({})),
|
|
280
|
+
});
|
|
281
|
+
exports.repeatNodeDecoder = (0, json_type_validation_1.object)({
|
|
282
|
+
type: (0, json_type_validation_1.constant)('repeat'),
|
|
283
|
+
content: (0, json_type_validation_1.object)({
|
|
284
|
+
node: (0, json_type_validation_1.lazy)(function () { return exports.elementNodeDecoder; }),
|
|
285
|
+
dataSource: (0, json_type_validation_1.optional)(exports.attributeValueDecoder),
|
|
286
|
+
meta: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
287
|
+
useIndex: (0, json_type_validation_1.optional)((0, json_type_validation_1.boolean)()),
|
|
288
|
+
iteratorName: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
289
|
+
dataSourceIdentifier: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
290
|
+
iteratorKey: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
285
291
|
})),
|
|
286
292
|
}),
|
|
287
293
|
});
|
|
288
|
-
exports.conditionalNodeDecoder = json_type_validation_1.object({
|
|
289
|
-
type: json_type_validation_1.constant('conditional'),
|
|
290
|
-
content: json_type_validation_1.object({
|
|
291
|
-
node: json_type_validation_1.lazy(function () { return exports.uidlNodeDecoder; }),
|
|
294
|
+
exports.conditionalNodeDecoder = (0, json_type_validation_1.object)({
|
|
295
|
+
type: (0, json_type_validation_1.constant)('conditional'),
|
|
296
|
+
content: (0, json_type_validation_1.object)({
|
|
297
|
+
node: (0, json_type_validation_1.lazy)(function () { return exports.uidlNodeDecoder; }),
|
|
292
298
|
reference: exports.dynamicValueDecoder,
|
|
293
|
-
value: json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.boolean()),
|
|
294
|
-
condition: json_type_validation_1.optional(json_type_validation_1.object({
|
|
295
|
-
conditions: json_type_validation_1.array(json_type_validation_1.object({ operation: json_type_validation_1.string(), operand: json_type_validation_1.optional(json_type_validation_1.union(json_type_validation_1.string(), json_type_validation_1.number(), json_type_validation_1.boolean())) })),
|
|
296
|
-
matchingCriteria: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
299
|
+
value: (0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)()),
|
|
300
|
+
condition: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
301
|
+
conditions: (0, json_type_validation_1.array)((0, json_type_validation_1.object)({ operation: (0, json_type_validation_1.string)(), operand: (0, json_type_validation_1.optional)((0, json_type_validation_1.union)((0, json_type_validation_1.string)(), (0, json_type_validation_1.number)(), (0, json_type_validation_1.boolean)())) })),
|
|
302
|
+
matchingCriteria: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
297
303
|
})),
|
|
298
304
|
}),
|
|
299
305
|
});
|
|
300
|
-
exports.elementNodeDecoder = json_type_validation_1.object({
|
|
301
|
-
type: json_type_validation_1.constant('element'),
|
|
306
|
+
exports.elementNodeDecoder = (0, json_type_validation_1.object)({
|
|
307
|
+
type: (0, json_type_validation_1.constant)('element'),
|
|
302
308
|
content: exports.elementDecoder,
|
|
303
309
|
});
|
|
304
|
-
exports.uidlNodeDecoder = json_type_validation_1.union(exports.elementNodeDecoder, exports.dynamicValueDecoder, exports.staticValueDecoder, exports.rawValueDecoder, exports.conditionalNodeDecoder, exports.repeatNodeDecoder, exports.slotNodeDecoder, json_type_validation_1.string());
|
|
310
|
+
exports.uidlNodeDecoder = (0, json_type_validation_1.union)(exports.elementNodeDecoder, exports.dynamicValueDecoder, exports.staticValueDecoder, exports.rawValueDecoder, exports.conditionalNodeDecoder, exports.repeatNodeDecoder, exports.slotNodeDecoder, (0, json_type_validation_1.string)());
|
|
305
311
|
//# sourceMappingURL=utils.js.map
|