@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
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
dynamicNode,
|
|
24
24
|
elementNode,
|
|
25
25
|
} from '@teleporthq/teleport-uidl-builders'
|
|
26
|
+
import { ComponentUIDL, UIDLStyleInlineAsset } from '@teleporthq/teleport-types'
|
|
27
|
+
import { parseProjectJSON } from '../../src/parser'
|
|
26
28
|
|
|
27
29
|
const uidl = component(
|
|
28
30
|
'Repeat Component',
|
|
@@ -120,7 +122,7 @@ describe('Validate UIDL', () => {
|
|
|
120
122
|
const validator = new Validator()
|
|
121
123
|
// @ts-ignore
|
|
122
124
|
expect(() =>
|
|
123
|
-
validator.validateComponentContent(componentUidlWithEventModifierUndefined)
|
|
125
|
+
validator.validateComponentContent(componentUidlWithEventModifierUndefined as ComponentUIDL)
|
|
124
126
|
).toThrow(Error)
|
|
125
127
|
|
|
126
128
|
// expect(validationResult.errorMsg).toBe(
|
|
@@ -214,3 +216,10 @@ describe('Validate UIDL', () => {
|
|
|
214
216
|
})
|
|
215
217
|
})
|
|
216
218
|
})
|
|
219
|
+
|
|
220
|
+
describe('Parses UIDL and then converts the key-values to key-static-nodes', () => {
|
|
221
|
+
it('Parsers key-values in attrs and converts to UIDL nodes', () => {
|
|
222
|
+
const parsedUIDL = parseProjectJSON(projectUidlSample)
|
|
223
|
+
expect((parsedUIDL.globals.assets[0] as UIDLStyleInlineAsset)?.attrs).toBeDefined()
|
|
224
|
+
})
|
|
225
|
+
})
|
|
@@ -5,7 +5,15 @@
|
|
|
5
5
|
"language": "en",
|
|
6
6
|
"title": "UIDL v0.6 Project"
|
|
7
7
|
},
|
|
8
|
-
"assets": [
|
|
8
|
+
"assets": [
|
|
9
|
+
{
|
|
10
|
+
"type": "style",
|
|
11
|
+
"attrs": {
|
|
12
|
+
"data-type": "default-styles"
|
|
13
|
+
},
|
|
14
|
+
"content": "body{font-family: 'Roboto', sans-serif; color: #2c3e50; -webkit-font-smoothing: antialiased; font-size: 16px;} a{color:inherit; text-decoration: none}"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
9
17
|
"meta": []
|
|
10
18
|
},
|
|
11
19
|
"root": {
|
|
@@ -3,28 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.rootComponentUIDLDecoder = exports.componentUIDLDecoder = void 0;
|
|
4
4
|
var json_type_validation_1 = require("@mojotech/json-type-validation");
|
|
5
5
|
var utils_1 = require("./utils");
|
|
6
|
-
exports.componentUIDLDecoder = json_type_validation_1.object({
|
|
7
|
-
name: json_type_validation_1.withDefault('MyComponent', json_type_validation_1.string()),
|
|
6
|
+
exports.componentUIDLDecoder = (0, json_type_validation_1.object)({
|
|
7
|
+
name: (0, json_type_validation_1.withDefault)('MyComponent', (0, json_type_validation_1.string)()),
|
|
8
8
|
node: utils_1.elementNodeDecoder,
|
|
9
|
-
stateDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.stateDefinitionsDecoder)),
|
|
10
|
-
propDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.propDefinitionsDecoder)),
|
|
11
|
-
styleSetDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.styleSetDefinitionDecoder)),
|
|
12
|
-
importDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.externaldependencyDecoder)),
|
|
13
|
-
outputOptions: json_type_validation_1.optional(utils_1.outputOptionsDecoder),
|
|
14
|
-
seo: json_type_validation_1.optional(utils_1.componentSeoDecoder),
|
|
9
|
+
stateDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.stateDefinitionsDecoder)),
|
|
10
|
+
propDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.propDefinitionsDecoder)),
|
|
11
|
+
styleSetDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.styleSetDefinitionDecoder)),
|
|
12
|
+
importDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.externaldependencyDecoder)),
|
|
13
|
+
outputOptions: (0, json_type_validation_1.optional)(utils_1.outputOptionsDecoder),
|
|
14
|
+
seo: (0, json_type_validation_1.optional)(utils_1.componentSeoDecoder),
|
|
15
15
|
});
|
|
16
|
-
exports.rootComponentUIDLDecoder = json_type_validation_1.object({
|
|
17
|
-
name: json_type_validation_1.withDefault('App', json_type_validation_1.string()),
|
|
16
|
+
exports.rootComponentUIDLDecoder = (0, json_type_validation_1.object)({
|
|
17
|
+
name: (0, json_type_validation_1.withDefault)('App', (0, json_type_validation_1.string)()),
|
|
18
18
|
node: utils_1.elementNodeDecoder,
|
|
19
|
-
stateDefinitions: json_type_validation_1.dict(utils_1.stateDefinitionsDecoder),
|
|
20
|
-
propDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.propDefinitionsDecoder)),
|
|
21
|
-
importDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.externaldependencyDecoder)),
|
|
22
|
-
peerDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.peerDependencyDecoder)),
|
|
23
|
-
styleSetDefinitions: json_type_validation_1.optional(json_type_validation_1.dict(utils_1.styleSetDefinitionDecoder)),
|
|
24
|
-
outputOptions: json_type_validation_1.optional(utils_1.outputOptionsDecoder),
|
|
25
|
-
seo: json_type_validation_1.optional(utils_1.componentSeoDecoder),
|
|
26
|
-
designLanguage: json_type_validation_1.optional(json_type_validation_1.object({
|
|
27
|
-
tokens: json_type_validation_1.optional(utils_1.designTokensDecoder),
|
|
19
|
+
stateDefinitions: (0, json_type_validation_1.dict)(utils_1.stateDefinitionsDecoder),
|
|
20
|
+
propDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.propDefinitionsDecoder)),
|
|
21
|
+
importDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.externaldependencyDecoder)),
|
|
22
|
+
peerDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.peerDependencyDecoder)),
|
|
23
|
+
styleSetDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.styleSetDefinitionDecoder)),
|
|
24
|
+
outputOptions: (0, json_type_validation_1.optional)(utils_1.outputOptionsDecoder),
|
|
25
|
+
seo: (0, json_type_validation_1.optional)(utils_1.componentSeoDecoder),
|
|
26
|
+
designLanguage: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
27
|
+
tokens: (0, json_type_validation_1.optional)(utils_1.designTokensDecoder),
|
|
28
28
|
})),
|
|
29
29
|
});
|
|
30
30
|
//# sourceMappingURL=component-decoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-decoder.js","sourceRoot":"","sources":["../../../src/decoders/component-decoder.ts"],"names":[],"mappings":";;;AAAA,uEAOuC;AAEvC,iCAUgB;AAEH,QAAA,oBAAoB,GAA4B,6BAAM,
|
|
1
|
+
{"version":3,"file":"component-decoder.js","sourceRoot":"","sources":["../../../src/decoders/component-decoder.ts"],"names":[],"mappings":";;;AAAA,uEAOuC;AAEvC,iCAUgB;AAEH,QAAA,oBAAoB,GAA4B,IAAA,6BAAM,EAAC;IAClE,IAAI,EAAE,IAAA,kCAAW,EAAC,aAAa,EAAE,IAAA,6BAAM,GAAE,CAAC;IAC1C,IAAI,EAAE,0BAAkB;IACxB,gBAAgB,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,+BAAuB,CAAC,CAAC;IACzD,eAAe,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,8BAAsB,CAAC,CAAC;IACvD,mBAAmB,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,iCAAyB,CAAC,CAAC;IAC9D,iBAAiB,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,iCAAyB,CAAC,CAAC;IAC5D,aAAa,EAAE,IAAA,+BAAQ,EAAC,4BAAoB,CAAC;IAC7C,GAAG,EAAE,IAAA,+BAAQ,EAAC,2BAAmB,CAAC;CACnC,CAAC,CAAA;AAEW,QAAA,wBAAwB,GAAgC,IAAA,6BAAM,EAAC;IAC1E,IAAI,EAAE,IAAA,kCAAW,EAAC,KAAK,EAAE,IAAA,6BAAM,GAAE,CAAC;IAClC,IAAI,EAAE,0BAAkB;IACxB,gBAAgB,EAAE,IAAA,2BAAI,EAAC,+BAAuB,CAAC;IAC/C,eAAe,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,8BAAsB,CAAC,CAAC;IACvD,iBAAiB,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,iCAAyB,CAAC,CAAC;IAC5D,eAAe,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,6BAAqB,CAAC,CAAC;IACtD,mBAAmB,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,iCAAyB,CAAC,CAAC;IAC9D,aAAa,EAAE,IAAA,+BAAQ,EAAC,4BAAoB,CAAC;IAC7C,GAAG,EAAE,IAAA,+BAAQ,EAAC,2BAAmB,CAAC;IAClC,cAAc,EAAE,IAAA,+BAAQ,EACtB,IAAA,6BAAM,EAAC;QACL,MAAM,EAAE,IAAA,+BAAQ,EAAC,2BAAmB,CAAC;KACtC,CAAC,CACH;CACF,CAAC,CAAA"}
|
|
@@ -17,7 +17,7 @@ var CustomCombinators = /** @class */ (function () {
|
|
|
17
17
|
else if (json.length === 0) {
|
|
18
18
|
throw new Error("Component Name cannot be empty");
|
|
19
19
|
}
|
|
20
|
-
throw new Error("Invalid Component name, got "
|
|
20
|
+
throw new Error("Invalid Component name, got ".concat(json));
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
CustomCombinators.isValidNavLink = function () {
|
|
@@ -26,7 +26,7 @@ var CustomCombinators = /** @class */ (function () {
|
|
|
26
26
|
if (json && typeof json === 'string' && navLinkRegex.test(json)) {
|
|
27
27
|
return json_type_validation_1.Result.ok(json);
|
|
28
28
|
}
|
|
29
|
-
throw new Error("Invalid link attribute, received "
|
|
29
|
+
throw new Error("Invalid link attribute, received ".concat(json));
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
CustomCombinators.isValidFileName = function () {
|
|
@@ -38,7 +38,7 @@ var CustomCombinators = /** @class */ (function () {
|
|
|
38
38
|
else if (json.length === 0) {
|
|
39
39
|
throw new Error("File Name cannot be empty");
|
|
40
40
|
}
|
|
41
|
-
throw new Error("Invalid File name, received "
|
|
41
|
+
throw new Error("Invalid File name, received ".concat(json));
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
CustomCombinators.isValidElementName = function () {
|
|
@@ -50,7 +50,7 @@ var CustomCombinators = /** @class */ (function () {
|
|
|
50
50
|
else if (json.length === 0) {
|
|
51
51
|
throw new Error("Name attribute cannot be empty");
|
|
52
52
|
}
|
|
53
|
-
throw new Error("Invalid name attribute, received "
|
|
53
|
+
throw new Error("Invalid name attribute, received ".concat(json));
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
return CustomCombinators;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-combinators.js","sourceRoot":"","sources":["../../../src/decoders/custom-combinators.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,uEAAqE;AAQrE;IACE,aAAa;IACb,2BAA4B,MAAyC;QAAzC,WAAM,GAAN,MAAM,CAAmC;IAAG,CAAC;IAElE,sCAAoB,GAA3B;QACE,OAAO,IAAI,iBAAiB,CAAS,UAAC,IAAY;YAChD,IAAM,kBAAkB,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAA;YAC7D,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ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{
|
|
2
|
+
import { VUIDLGlobalProjectValues, WebManifest, VProjectUIDL } from '@teleporthq/teleport-types';
|
|
3
3
|
export declare const webManifestDecoder: Decoder<WebManifest>;
|
|
4
|
-
export declare const globalProjectValuesDecoder: Decoder<
|
|
4
|
+
export declare const globalProjectValuesDecoder: Decoder<VUIDLGlobalProjectValues>;
|
|
5
5
|
export declare const projectUIDLDecoder: Decoder<VProjectUIDL>;
|
|
@@ -4,35 +4,35 @@ exports.projectUIDLDecoder = exports.globalProjectValuesDecoder = exports.webMan
|
|
|
4
4
|
var json_type_validation_1 = require("@mojotech/json-type-validation");
|
|
5
5
|
var utils_1 = require("./utils");
|
|
6
6
|
var component_decoder_1 = require("./component-decoder");
|
|
7
|
-
exports.webManifestDecoder = json_type_validation_1.object({
|
|
8
|
-
short_name: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
9
|
-
name: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
10
|
-
icons: json_type_validation_1.optional(json_type_validation_1.array(json_type_validation_1.object({ src: json_type_validation_1.string(), type: json_type_validation_1.string(), sizes: json_type_validation_1.string() }))),
|
|
11
|
-
start_url: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
12
|
-
background_color: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
13
|
-
display: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
14
|
-
orientation: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
15
|
-
scope: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
16
|
-
theme_color: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
7
|
+
exports.webManifestDecoder = (0, json_type_validation_1.object)({
|
|
8
|
+
short_name: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
9
|
+
name: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
10
|
+
icons: (0, json_type_validation_1.optional)((0, json_type_validation_1.array)((0, json_type_validation_1.object)({ src: (0, json_type_validation_1.string)(), type: (0, json_type_validation_1.string)(), sizes: (0, json_type_validation_1.string)() }))),
|
|
11
|
+
start_url: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
12
|
+
background_color: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
13
|
+
display: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
14
|
+
orientation: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
15
|
+
scope: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
16
|
+
theme_color: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
17
17
|
});
|
|
18
|
-
exports.globalProjectValuesDecoder = json_type_validation_1.object({
|
|
19
|
-
settings: json_type_validation_1.object({
|
|
20
|
-
title: json_type_validation_1.string(),
|
|
21
|
-
language: json_type_validation_1.string(),
|
|
18
|
+
exports.globalProjectValuesDecoder = (0, json_type_validation_1.object)({
|
|
19
|
+
settings: (0, json_type_validation_1.object)({
|
|
20
|
+
title: (0, json_type_validation_1.string)(),
|
|
21
|
+
language: (0, json_type_validation_1.string)(),
|
|
22
22
|
}),
|
|
23
|
-
customCode: json_type_validation_1.optional(json_type_validation_1.object({
|
|
24
|
-
head: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
25
|
-
body: json_type_validation_1.optional(json_type_validation_1.string()),
|
|
23
|
+
customCode: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
24
|
+
head: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
25
|
+
body: (0, json_type_validation_1.optional)((0, json_type_validation_1.string)()),
|
|
26
26
|
})),
|
|
27
|
-
meta: json_type_validation_1.array(json_type_validation_1.dict(json_type_validation_1.string())),
|
|
28
|
-
assets: json_type_validation_1.array(utils_1.globalAssetsDecoder),
|
|
29
|
-
manifest: json_type_validation_1.optional(exports.webManifestDecoder),
|
|
30
|
-
variables: json_type_validation_1.optional(json_type_validation_1.dict(json_type_validation_1.string())),
|
|
27
|
+
meta: (0, json_type_validation_1.array)((0, json_type_validation_1.dict)((0, json_type_validation_1.string)())),
|
|
28
|
+
assets: (0, json_type_validation_1.array)(utils_1.globalAssetsDecoder),
|
|
29
|
+
manifest: (0, json_type_validation_1.optional)(exports.webManifestDecoder),
|
|
30
|
+
variables: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)((0, json_type_validation_1.string)())),
|
|
31
31
|
});
|
|
32
|
-
exports.projectUIDLDecoder = json_type_validation_1.object({
|
|
33
|
-
name: json_type_validation_1.string(),
|
|
32
|
+
exports.projectUIDLDecoder = (0, json_type_validation_1.object)({
|
|
33
|
+
name: (0, json_type_validation_1.string)(),
|
|
34
34
|
globals: exports.globalProjectValuesDecoder,
|
|
35
35
|
root: component_decoder_1.rootComponentUIDLDecoder,
|
|
36
|
-
components: json_type_validation_1.optional(json_type_validation_1.dict(component_decoder_1.componentUIDLDecoder)),
|
|
36
|
+
components: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(component_decoder_1.componentUIDLDecoder)),
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=project-decoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-decoder.js","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":";;;AAAA,uEAA+F;AAE/F,iCAA6C;AAC7C,yDAAoF;AAEvE,QAAA,kBAAkB,GAAyB,6BAAM,
|
|
1
|
+
{"version":3,"file":"project-decoder.js","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":";;;AAAA,uEAA+F;AAE/F,iCAA6C;AAC7C,yDAAoF;AAEvE,QAAA,kBAAkB,GAAyB,IAAA,6BAAM,EAAC;IAC7D,UAAU,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IAC9B,IAAI,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IACxB,KAAK,EAAE,IAAA,+BAAQ,EAAC,IAAA,4BAAK,EAA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AA;AAEW,QAAA,kBAAkB,GAA0B,IAAA,6BAAM,EAAC;IAC9D,IAAI,EAAE,IAAA,6BAAM,GAAE;IACd,OAAO,EAAE,kCAA0B;IACnC,IAAI,EAAE,4CAAwB;IAC9B,UAAU,EAAE,IAAA,+BAAQ,EAAC,IAAA,2BAAI,EAAC,wCAAoB,CAAC,CAAC;CACjD,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Decoder } from '@mojotech/json-type-validation';
|
|
2
|
-
import { UIDLStaticValue, ReferenceType, UIDLDynamicReference, UIDLPropDefinition, UIDLStateDefinition, UIDLStateValueDetails, UIDLPageOptions, UIDLComponentOutputOptions, UIDLDependency, UIDLStyleDefinitions, UIDLStyleValue, UIDLAttributeValue, UIDLEventHandlerStatement, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLRawValue, UIDLElementStyleStates, UIDLStyleStateCondition, UIDLStyleMediaQueryScreenSizeCondition, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle,
|
|
2
|
+
import { UIDLStaticValue, ReferenceType, UIDLDynamicReference, UIDLPropDefinition, UIDLStateDefinition, UIDLStateValueDetails, UIDLPageOptions, UIDLComponentOutputOptions, UIDLDependency, UIDLStyleDefinitions, UIDLStyleValue, UIDLAttributeValue, UIDLEventHandlerStatement, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLRawValue, UIDLElementStyleStates, UIDLStyleStateCondition, UIDLStyleMediaQueryScreenSizeCondition, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, VUIDLComponentSEO, VUIDLGlobalAsset, UIDLExternalDependency, UIDLLocalDependency, UIDLPeerDependency, UIDLImportReference, UIDLStyleSetTokenReference, VUIDLStyleSetDefnition, VUIDLElement, VUIDLSlotNode, VUIDLConditionalNode, VUIDLRepeatNode, VUIDLElementNode, VUIDLNode, VUIDLElementNodeInlineReferencedStyle, VUIDLSectionLinkNode, VUIDLLinkNode, VUIDLURLLinkNode, VUIDLStyleSetConditions, VUIDLStyleSetMediaCondition, VUIDLStyleSetStateCondition, VUIDLDesignTokens, UIDLPropCallEvent, UIDLStateModifierEvent, UIDLScriptExternalAsset, UIDLScriptInlineAsset, VUIDLStyleInlineAsset, UIDLStyleExternalAsset, VUIDLFontAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLAssetBase, VUIDLElementNodeClassReferencedStyle, UIDLCompDynamicReference, UIDLComponentStyleReference } from '@teleporthq/teleport-types';
|
|
3
3
|
export declare const referenceTypeDecoder: Decoder<ReferenceType>;
|
|
4
4
|
export declare const dynamicValueDecoder: Decoder<UIDLDynamicReference>;
|
|
5
5
|
export declare const staticValueDecoder: Decoder<UIDLStaticValue>;
|
|
@@ -10,16 +10,16 @@ export declare const tokenReferenceDecoder: Decoder<UIDLStyleSetTokenReference>;
|
|
|
10
10
|
export declare const styleSetDefinitionDecoder: Decoder<VUIDLStyleSetDefnition>;
|
|
11
11
|
export declare const stateOrPropDefinitionDecoder: Decoder<string | number | boolean | Record<string, unknown> | (string | number | Record<string, unknown>)[]>;
|
|
12
12
|
export declare const pageOptionsDecoder: Decoder<UIDLPageOptions>;
|
|
13
|
-
export declare const globalAssetsDecoder: Decoder<
|
|
13
|
+
export declare const globalAssetsDecoder: Decoder<VUIDLGlobalAsset>;
|
|
14
14
|
export declare const baseAssetDecoder: Decoder<UIDLAssetBase>;
|
|
15
15
|
export declare const inlineScriptAssetDecoder: Decoder<UIDLScriptInlineAsset>;
|
|
16
16
|
export declare const externalScriptAssetDecoder: Decoder<UIDLScriptExternalAsset>;
|
|
17
|
-
export declare const inlineStyletAssetDecoder: Decoder<
|
|
17
|
+
export declare const inlineStyletAssetDecoder: Decoder<VUIDLStyleInlineAsset>;
|
|
18
18
|
export declare const externalStyleAssetDecoder: Decoder<UIDLStyleExternalAsset>;
|
|
19
|
-
export declare const fontAssetDecoder: Decoder<
|
|
19
|
+
export declare const fontAssetDecoder: Decoder<VUIDLFontAsset>;
|
|
20
20
|
export declare const canonicalAssetDecoder: Decoder<UIDLCanonicalAsset>;
|
|
21
21
|
export declare const iconAssetDecoder: Decoder<UIDLIconAsset>;
|
|
22
|
-
export declare const componentSeoDecoder: Decoder<
|
|
22
|
+
export declare const componentSeoDecoder: Decoder<VUIDLComponentSEO>;
|
|
23
23
|
export declare const stateValueDetailsDecoder: Decoder<UIDLStateValueDetails>;
|
|
24
24
|
export declare const propDefinitionsDecoder: Decoder<UIDLPropDefinition>;
|
|
25
25
|
export declare const stateDefinitionsDecoder: Decoder<UIDLStateDefinition>;
|
|
@@ -30,6 +30,7 @@ export declare const localDependencyDecoder: Decoder<UIDLLocalDependency>;
|
|
|
30
30
|
export declare const dependencyDecoder: Decoder<UIDLDependency>;
|
|
31
31
|
export declare const importReferenceDecoder: Decoder<UIDLImportReference>;
|
|
32
32
|
export declare const attributeValueDecoder: Decoder<UIDLAttributeValue>;
|
|
33
|
+
export declare const uidlComponentStyleReference: Decoder<UIDLComponentStyleReference>;
|
|
33
34
|
export declare const styleValueDecoder: Decoder<UIDLStyleValue>;
|
|
34
35
|
export declare const styleDefinitionsDecoder: Decoder<UIDLStyleDefinitions>;
|
|
35
36
|
export declare const eventHandlerStatementDecoder: Decoder<UIDLEventHandlerStatement>;
|