@teleporthq/teleport-uidl-validator 0.37.1-alpha.0 → 0.37.2
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__/decoder/index.ts +70 -0
- package/__tests__/parser/compoenent-with-state-reference.json +110 -0
- package/__tests__/parser/component-parsing.ts +13 -1
- package/__tests__/validator/index.ts +17 -24
- package/__tests__/validator/project-sample.json +15 -0
- package/dist/cjs/decoders/component-decoder.js +3 -3
- package/dist/cjs/decoders/component-decoder.js.map +1 -1
- package/dist/cjs/decoders/custom-combinators.d.ts +5 -8
- package/dist/cjs/decoders/custom-combinators.d.ts.map +1 -1
- package/dist/cjs/decoders/custom-combinators.js +42 -60
- package/dist/cjs/decoders/custom-combinators.js.map +1 -1
- package/dist/cjs/decoders/project-decoder.d.ts.map +1 -1
- package/dist/cjs/decoders/project-decoder.js +8 -0
- package/dist/cjs/decoders/project-decoder.js.map +1 -1
- package/dist/cjs/decoders/utils.d.ts +12 -8
- package/dist/cjs/decoders/utils.d.ts.map +1 -1
- package/dist/cjs/decoders/utils.js +113 -68
- package/dist/cjs/decoders/utils.js.map +1 -1
- package/dist/cjs/parser/index.d.ts.map +1 -1
- package/dist/cjs/parser/index.js +88 -10
- package/dist/cjs/parser/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/validator/index.d.ts.map +1 -1
- package/dist/cjs/validator/index.js.map +1 -1
- package/dist/cjs/validator/utils.d.ts.map +1 -1
- package/dist/cjs/validator/utils.js +18 -22
- package/dist/cjs/validator/utils.js.map +1 -1
- package/dist/esm/decoders/component-decoder.js +3 -3
- package/dist/esm/decoders/component-decoder.js.map +1 -1
- package/dist/esm/decoders/custom-combinators.d.ts +5 -8
- package/dist/esm/decoders/custom-combinators.d.ts.map +1 -1
- package/dist/esm/decoders/custom-combinators.js +38 -60
- package/dist/esm/decoders/custom-combinators.js.map +1 -1
- package/dist/esm/decoders/project-decoder.d.ts.map +1 -1
- package/dist/esm/decoders/project-decoder.js +10 -2
- package/dist/esm/decoders/project-decoder.js.map +1 -1
- package/dist/esm/decoders/utils.d.ts +12 -8
- package/dist/esm/decoders/utils.d.ts.map +1 -1
- package/dist/esm/decoders/utils.js +113 -68
- package/dist/esm/decoders/utils.js.map +1 -1
- package/dist/esm/parser/index.d.ts.map +1 -1
- package/dist/esm/parser/index.js +88 -10
- package/dist/esm/parser/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/validator/index.d.ts.map +1 -1
- package/dist/esm/validator/index.js.map +1 -1
- package/dist/esm/validator/utils.d.ts.map +1 -1
- package/dist/esm/validator/utils.js +19 -23
- package/dist/esm/validator/utils.js.map +1 -1
- package/package.json +4 -4
- package/src/decoders/component-decoder.ts +3 -3
- package/src/decoders/custom-combinators.ts +33 -51
- package/src/decoders/project-decoder.ts +13 -0
- package/src/decoders/utils.ts +213 -87
- package/src/parser/index.ts +129 -14
- package/src/validator/index.ts +1 -0
- package/src/validator/utils.ts +36 -24
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { UIDLConditionalNode } from '@teleporthq/teleport-types'
|
|
2
|
+
import { conditionalNodeDecoder } from '../../src/decoders/utils'
|
|
3
|
+
|
|
4
|
+
test('decode conditional nodes properly when using dynamic and expression reference', () => {
|
|
5
|
+
const node: UIDLConditionalNode = {
|
|
6
|
+
type: 'conditional',
|
|
7
|
+
content: {
|
|
8
|
+
node: {
|
|
9
|
+
type: 'element',
|
|
10
|
+
content: {
|
|
11
|
+
elementType: 'cms-navigation-button',
|
|
12
|
+
semanticType: 'div',
|
|
13
|
+
name: 'Previous',
|
|
14
|
+
referencedStyles: {
|
|
15
|
+
TQ_Cami9r8BH2: {
|
|
16
|
+
type: 'style-map',
|
|
17
|
+
content: {
|
|
18
|
+
mapType: 'project-referenced',
|
|
19
|
+
referenceId: 'button',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
abilities: {
|
|
24
|
+
link: {
|
|
25
|
+
type: 'navlink',
|
|
26
|
+
content: {
|
|
27
|
+
routeName: {
|
|
28
|
+
type: 'expr',
|
|
29
|
+
content:
|
|
30
|
+
// tslint:disable no-invalid-template-strings
|
|
31
|
+
"`?${new URLSearchParams({...router.query, ['cPage-5iuksa']: parseInt(router.query['cPage-5iuksa']) - 1 || 1})}`",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
style: {
|
|
37
|
+
display: {
|
|
38
|
+
type: 'static',
|
|
39
|
+
content: 'flex',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
children: [
|
|
43
|
+
{
|
|
44
|
+
type: 'element',
|
|
45
|
+
content: {
|
|
46
|
+
elementType: 'text',
|
|
47
|
+
referencedStyles: {},
|
|
48
|
+
abilities: {},
|
|
49
|
+
children: [
|
|
50
|
+
{
|
|
51
|
+
type: 'static',
|
|
52
|
+
content: 'Previous',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
reference: {
|
|
61
|
+
type: 'expr',
|
|
62
|
+
content: 'params?.meta?.pagination.hasPrevPage',
|
|
63
|
+
},
|
|
64
|
+
value: true,
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const result = conditionalNodeDecoder.run(node)
|
|
69
|
+
expect(result.ok).toBeTruthy()
|
|
70
|
+
})
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"stateDefinitions": {
|
|
3
|
+
"isVisible_": {
|
|
4
|
+
"defaultValue": true,
|
|
5
|
+
"type": "boolean"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"node": {
|
|
9
|
+
"type": "element",
|
|
10
|
+
"content": {
|
|
11
|
+
"elementType": "container",
|
|
12
|
+
"semanticType": "div",
|
|
13
|
+
"referencedStyles": {},
|
|
14
|
+
"abilities": {},
|
|
15
|
+
"style": {
|
|
16
|
+
"width": {
|
|
17
|
+
"type": "static",
|
|
18
|
+
"content": "100%"
|
|
19
|
+
},
|
|
20
|
+
"height": {
|
|
21
|
+
"type": "static",
|
|
22
|
+
"content": "400px"
|
|
23
|
+
},
|
|
24
|
+
"display": {
|
|
25
|
+
"type": "static",
|
|
26
|
+
"content": "flex"
|
|
27
|
+
},
|
|
28
|
+
"position": {
|
|
29
|
+
"type": "static",
|
|
30
|
+
"content": "relative"
|
|
31
|
+
},
|
|
32
|
+
"alignItems": {
|
|
33
|
+
"type": "static",
|
|
34
|
+
"content": "center"
|
|
35
|
+
},
|
|
36
|
+
"flexDirection": {
|
|
37
|
+
"type": "static",
|
|
38
|
+
"content": "row"
|
|
39
|
+
},
|
|
40
|
+
"justifyContent": {
|
|
41
|
+
"type": "static",
|
|
42
|
+
"content": "center"
|
|
43
|
+
},
|
|
44
|
+
"gap": {
|
|
45
|
+
"type": "dynamic",
|
|
46
|
+
"content": {
|
|
47
|
+
"referenceType": "token",
|
|
48
|
+
"id": "--dl-space-space-halfunit",
|
|
49
|
+
"fallback": ""
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"children": [
|
|
54
|
+
{
|
|
55
|
+
"type": "conditional",
|
|
56
|
+
"content": {
|
|
57
|
+
"node": {
|
|
58
|
+
"type": "element",
|
|
59
|
+
"content": {
|
|
60
|
+
"elementType": "image",
|
|
61
|
+
"referencedStyles": {},
|
|
62
|
+
"abilities": {},
|
|
63
|
+
"attrs": {
|
|
64
|
+
"src": {
|
|
65
|
+
"type": "dynamic",
|
|
66
|
+
"content": {
|
|
67
|
+
"referenceType": "prop",
|
|
68
|
+
"id": "imagesrc1",
|
|
69
|
+
"fallback": ""
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"alt": {
|
|
73
|
+
"type": "dynamic",
|
|
74
|
+
"content": {
|
|
75
|
+
"referenceType": "prop",
|
|
76
|
+
"id": "imagealt1",
|
|
77
|
+
"fallback": ""
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"style": {
|
|
82
|
+
"width": {
|
|
83
|
+
"type": "static",
|
|
84
|
+
"content": "200px"
|
|
85
|
+
},
|
|
86
|
+
"objectFit": {
|
|
87
|
+
"type": "static",
|
|
88
|
+
"content": "cover"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"children": []
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"reference": {
|
|
95
|
+
"type": "dynamic",
|
|
96
|
+
"content": {
|
|
97
|
+
"referenceType": "state",
|
|
98
|
+
"id": "isVisible_"
|
|
99
|
+
},
|
|
100
|
+
"pos": ""
|
|
101
|
+
},
|
|
102
|
+
"value": false
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"name": "Component",
|
|
109
|
+
"styleSetDefinitions": {}
|
|
110
|
+
}
|
|
@@ -6,9 +6,11 @@ import componentResultJSON from './component-with-proper-values.json'
|
|
|
6
6
|
import componentStyleSetsInputJSON from './component-with-reusalble-styles.json'
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
import componentWithReferencedStylesJSON from './componennt-with-referenced-styles.json'
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
import componentWithStateReferences from './compoenent-with-state-reference.json'
|
|
9
11
|
|
|
10
12
|
import { parseComponentJSON, parseProjectJSON } from '../../src/parser'
|
|
11
|
-
import { ComponentUIDL } from '@teleporthq/teleport-types'
|
|
13
|
+
import { ComponentUIDL, UIDLConditionalNode } from '@teleporthq/teleport-types'
|
|
12
14
|
|
|
13
15
|
describe('parseComponentJSON', () => {
|
|
14
16
|
it('transforms primitive component values', () => {
|
|
@@ -113,4 +115,14 @@ describe('RefernecedStyles for ComponentUIDL', () => {
|
|
|
113
115
|
const result = parseComponentJSON(uidl as unknown as Record<string, unknown>)
|
|
114
116
|
expect(result).toEqual(result)
|
|
115
117
|
})
|
|
118
|
+
|
|
119
|
+
it('Parses reference on a conditional node and changes the state/prop references', () => {
|
|
120
|
+
const result = parseComponentJSON(
|
|
121
|
+
componentWithStateReferences as unknown as Record<string, string>
|
|
122
|
+
)
|
|
123
|
+
const conditionalNode = result.node.content.children?.[0]
|
|
124
|
+
|
|
125
|
+
expect(result.stateDefinitions?.isVisible).toBeDefined()
|
|
126
|
+
expect((conditionalNode as UIDLConditionalNode)?.content.reference.content.id).toBe('isVisible')
|
|
127
|
+
})
|
|
116
128
|
})
|
|
@@ -28,16 +28,23 @@ import { parseProjectJSON } from '../../src/parser'
|
|
|
28
28
|
|
|
29
29
|
const uidl = component(
|
|
30
30
|
'Repeat Component',
|
|
31
|
-
elementNode(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
elementNode(
|
|
32
|
+
'container',
|
|
33
|
+
{ fields: { type: 'dynamic', content: { referenceType: 'prop', id: 'fields["bg Image"]' } } },
|
|
34
|
+
[
|
|
35
|
+
repeatNode(
|
|
36
|
+
elementNode('div', {}, [dynamicNode('local', 'item')]),
|
|
37
|
+
dynamicNode('prop', 'items'),
|
|
38
|
+
{
|
|
39
|
+
useIndex: true,
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
]
|
|
43
|
+
),
|
|
44
|
+
{
|
|
45
|
+
items: definition('array', ['hello', 'world']),
|
|
46
|
+
fields: definition('object', { 'bg Image': 'test' }),
|
|
47
|
+
},
|
|
41
48
|
{ items: definition('array', ['hello', 'world']) }
|
|
42
49
|
)
|
|
43
50
|
|
|
@@ -130,20 +137,6 @@ describe('Validate UIDL', () => {
|
|
|
130
137
|
// "isOpen" is used in events, but not defined. Please add it in stateDefinitions
|
|
131
138
|
// )
|
|
132
139
|
})
|
|
133
|
-
|
|
134
|
-
it('throws an error if event name is empty string', () => {
|
|
135
|
-
const validator = new Validator()
|
|
136
|
-
// @ts-ignore
|
|
137
|
-
expect(() => validator.validateComponentSchema(ComponentUidlElementWithEmptyName)).toThrow(
|
|
138
|
-
Error
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
// expect(validationResult.errorMsg).toBe(
|
|
142
|
-
// UIDL Format Validation Error. Please check the following:
|
|
143
|
-
// - Path undefined: Error: Name attribute cannot be empty.
|
|
144
|
-
// is a undefined
|
|
145
|
-
// )
|
|
146
|
-
})
|
|
147
140
|
})
|
|
148
141
|
|
|
149
142
|
describe('Project UIDL Format', () => {
|
|
@@ -265,6 +265,14 @@
|
|
|
265
265
|
"items": {
|
|
266
266
|
"type": "array",
|
|
267
267
|
"defaultValue": []
|
|
268
|
+
},
|
|
269
|
+
"hero": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"defaultValue": {
|
|
272
|
+
"bg Image": {
|
|
273
|
+
"src": "test"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
268
276
|
}
|
|
269
277
|
},
|
|
270
278
|
"stateDefinitions": {
|
|
@@ -288,6 +296,13 @@
|
|
|
288
296
|
"referenceType": "prop",
|
|
289
297
|
"id": "title"
|
|
290
298
|
}
|
|
299
|
+
},
|
|
300
|
+
"bgImage": {
|
|
301
|
+
"type": "dynamic",
|
|
302
|
+
"content": {
|
|
303
|
+
"referenceType": "prop",
|
|
304
|
+
"id": "hero['bg Image'].src"
|
|
305
|
+
}
|
|
291
306
|
}
|
|
292
307
|
},
|
|
293
308
|
"children": [
|
|
@@ -7,7 +7,7 @@ exports.componentUIDLDecoder = (0, json_type_validation_1.object)({
|
|
|
7
7
|
name: (0, json_type_validation_1.withDefault)('MyComponent', (0, json_type_validation_1.string)()),
|
|
8
8
|
node: utils_1.elementNodeDecoder,
|
|
9
9
|
stateDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.stateDefinitionsDecoder)),
|
|
10
|
-
propDefinitions: (0, json_type_validation_1.
|
|
10
|
+
propDefinitions: (0, json_type_validation_1.withDefault)({}, (0, json_type_validation_1.dict)(utils_1.propDefinitionsDecoder)),
|
|
11
11
|
styleSetDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.styleSetDefinitionDecoder)),
|
|
12
12
|
importDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.externaldependencyDecoder)),
|
|
13
13
|
outputOptions: (0, json_type_validation_1.optional)(utils_1.outputOptionsDecoder),
|
|
@@ -23,10 +23,10 @@ exports.rootComponentUIDLDecoder = (0, json_type_validation_1.object)({
|
|
|
23
23
|
values: (0, json_type_validation_1.array)(utils_1.stateValueDetailsDecoder),
|
|
24
24
|
}),
|
|
25
25
|
})),
|
|
26
|
-
propDefinitions: (0, json_type_validation_1.
|
|
26
|
+
propDefinitions: (0, json_type_validation_1.withDefault)({}, (0, json_type_validation_1.dict)(utils_1.propDefinitionsDecoder)),
|
|
27
27
|
importDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.externaldependencyDecoder)),
|
|
28
28
|
peerDefinitions: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(utils_1.peerDependencyDecoder)),
|
|
29
|
-
styleSetDefinitions: (0, json_type_validation_1.
|
|
29
|
+
styleSetDefinitions: (0, json_type_validation_1.withDefault)({}, (0, json_type_validation_1.dict)(utils_1.styleSetDefinitionDecoder)),
|
|
30
30
|
outputOptions: (0, json_type_validation_1.optional)(utils_1.outputOptionsDecoder),
|
|
31
31
|
seo: (0, json_type_validation_1.optional)(utils_1.componentSeoDecoder),
|
|
32
32
|
designLanguage: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-decoder.js","sourceRoot":"","sources":["../../../src/decoders/component-decoder.ts"],"names":[],"mappings":";;;AAAA,uEASuC;AAEvC,iCAWgB;AAEH,QAAA,oBAAoB,GAA4B,IAAA,6BAAM,EA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I,EAAE,IAAA,6BAAM,GAAE;YACd,YAAY,EAAE,IAAA,6BAAM,GAAE;YACtB,MAAM,EAAE,IAAA,4BAAK,EAAC,gCAAwB,CAAC;SACxC,CAAC;KACH,CAAC,CACH;IACD,eAAe,EAAE,IAAA,kCAAW,EAAC,EAAE,EAAE,IAAA,2BAAI,EAAC,8BAAsB,CAAC,CAAC;IAC9D,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,kCAAW,EAAC,EAAE,EAAE,IAAA,2BAAI,EAAC,iCAAyB,CAAC,CAAC;IACrE,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"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static isValidFileName(): CustomCombinators<string>;
|
|
7
|
-
static isValidElementName(): CustomCombinators<string>;
|
|
8
|
-
}
|
|
1
|
+
import { Decoder } from '@mojotech/json-type-validation';
|
|
2
|
+
export declare const isValidComponentName: (name: string) => Decoder<string>;
|
|
3
|
+
export declare const isValidNavLink: (link: string) => Decoder<string>;
|
|
4
|
+
export declare const isValidFileName: (name: string) => Decoder<string>;
|
|
5
|
+
export declare const isValidElementName: (name: string) => Decoder<string>;
|
|
9
6
|
//# sourceMappingURL=custom-combinators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-combinators.d.ts","sourceRoot":"","sources":["../../../src/decoders/custom-combinators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-combinators.d.ts","sourceRoot":"","sources":["../../../src/decoders/custom-combinators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAOvE,eAAO,MAAM,oBAAoB,SAAU,MAAM,KAAG,QAAQ,MAAM,CAOjE,CAAA;AAED,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,QAAQ,MAAM,CAe3D,CAAA;AAED,eAAO,MAAM,eAAe,SAAU,MAAM,KAAG,QAAQ,MAAM,CAO5D,CAAA;AAED,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,QAAQ,MAAM,CAO/D,CAAA"}
|
|
@@ -1,65 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
/* tslint:disable member-ordering */
|
|
3
|
+
exports.isValidElementName = exports.isValidFileName = exports.isValidNavLink = exports.isValidComponentName = void 0;
|
|
5
4
|
var json_type_validation_1 = require("@mojotech/json-type-validation");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/* These are some custom combinators that comes in handy for us,
|
|
6
|
+
instead of parsing and cross-checking regex again. The combinators,
|
|
7
|
+
can used inside a existing Decoder, since we did not implement any run()
|
|
8
|
+
runWithException() etc */
|
|
9
|
+
var isValidComponentName = function (name) {
|
|
10
|
+
var componentNameRegex = new RegExp('^[A-Z]+[a-zA-Z0-9]*$');
|
|
11
|
+
if (name && typeof name === 'string' && componentNameRegex.test(name)) {
|
|
12
|
+
return (0, json_type_validation_1.succeed)(name);
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
else if (json.length === 0) {
|
|
45
|
-
throw new Error("File Name cannot be empty");
|
|
46
|
-
}
|
|
47
|
-
throw new Error("Invalid File name, received ".concat(json));
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
CustomCombinators.isValidElementName = function () {
|
|
51
|
-
return new CustomCombinators(function (json) {
|
|
52
|
-
var fileNameRegex = new RegExp('^[a-zA-Z]+[a-zA-Z0-9-_]*$');
|
|
53
|
-
if (json && typeof json === 'string' && fileNameRegex.test(json)) {
|
|
54
|
-
return json_type_validation_1.Result.ok(json);
|
|
55
|
-
}
|
|
56
|
-
else if (json.length === 0) {
|
|
57
|
-
throw new Error("Name attribute cannot be empty");
|
|
58
|
-
}
|
|
59
|
-
throw new Error("Invalid name attribute, received ".concat(json));
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
return CustomCombinators;
|
|
63
|
-
}());
|
|
64
|
-
exports.CustomCombinators = CustomCombinators;
|
|
14
|
+
return (0, json_type_validation_1.fail)("Invalid Component name, got ".concat(name));
|
|
15
|
+
};
|
|
16
|
+
exports.isValidComponentName = isValidComponentName;
|
|
17
|
+
var isValidNavLink = function (link) {
|
|
18
|
+
if (!link || typeof link !== 'string') {
|
|
19
|
+
throw new Error("Invalid navLink attribute, received ".concat(link));
|
|
20
|
+
}
|
|
21
|
+
if (link === '**') {
|
|
22
|
+
return (0, json_type_validation_1.succeed)(link);
|
|
23
|
+
}
|
|
24
|
+
var navLinkRegex = new RegExp('/(?:[a-zA-Z0-9-_]+|/[[a-zA-Z]+]|[/[a-zA-Z]+])*');
|
|
25
|
+
if (navLinkRegex.test(link)) {
|
|
26
|
+
return (0, json_type_validation_1.succeed)(link);
|
|
27
|
+
}
|
|
28
|
+
return (0, json_type_validation_1.fail)("Invalid navLink attribute, received ".concat(link));
|
|
29
|
+
};
|
|
30
|
+
exports.isValidNavLink = isValidNavLink;
|
|
31
|
+
var isValidFileName = function (name) {
|
|
32
|
+
var fileNameRegex = new RegExp('^[[a-zA-Z0-9-_.]+]*$');
|
|
33
|
+
if (name && typeof name === 'string' && fileNameRegex.test(name)) {
|
|
34
|
+
return (0, json_type_validation_1.succeed)(name);
|
|
35
|
+
}
|
|
36
|
+
return (0, json_type_validation_1.fail)("Invalid File name, received ".concat(name));
|
|
37
|
+
};
|
|
38
|
+
exports.isValidFileName = isValidFileName;
|
|
39
|
+
var isValidElementName = function (name) {
|
|
40
|
+
var elementNameRefex = new RegExp('^[a-zA-Z]+[a-zA-Z0-9-_]*$');
|
|
41
|
+
if (name && typeof name === 'string' && elementNameRefex.test(name)) {
|
|
42
|
+
return (0, json_type_validation_1.succeed)(name);
|
|
43
|
+
}
|
|
44
|
+
return (0, json_type_validation_1.fail)("Invalid name attribute, received ".concat(name));
|
|
45
|
+
};
|
|
46
|
+
exports.isValidElementName = isValidElementName;
|
|
65
47
|
//# sourceMappingURL=custom-combinators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-combinators.js","sourceRoot":"","sources":["../../../src/decoders/custom-combinators.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"custom-combinators.js","sourceRoot":"","sources":["../../../src/decoders/custom-combinators.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AAEvE;;;yBAGyB;AAElB,IAAM,oBAAoB,GAAG,UAAC,IAAY;IAC/C,IAAM,kBAAkB,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAA;IAC7D,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,kBAAkB,CAAC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I,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACnE,OAAO,IAAA,8BAAO,EAAC,IAAI,CAAC,CAAA;KACrB;IAED,OAAO,IAAA,2BAAI,EAAC,2CAAoC,IAAI,CAAE,CAAC,CAAA;AACzD,CAAC,CAAA;AAPY,QAAA,kBAAkB,sBAO9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-decoder.d.ts","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"project-decoder.d.ts","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAUR,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,4BAA4B,CAAA;AAWnC,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAUlD,CAAA;AAEF,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,wBAAwB,CAgBvE,CAAA;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAkBlD,CAAA;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,YAAY,CAgBnD,CAAA"}
|
|
@@ -50,5 +50,13 @@ exports.projectUIDLDecoder = (0, json_type_validation_1.object)({
|
|
|
50
50
|
root: component_decoder_1.rootComponentUIDLDecoder,
|
|
51
51
|
components: (0, json_type_validation_1.optional)((0, json_type_validation_1.dict)(component_decoder_1.componentUIDLDecoder)),
|
|
52
52
|
resources: (0, json_type_validation_1.optional)(exports.resourcesDecoder),
|
|
53
|
+
internationalization: (0, json_type_validation_1.optional)((0, json_type_validation_1.object)({
|
|
54
|
+
main: (0, json_type_validation_1.object)({
|
|
55
|
+
name: (0, json_type_validation_1.string)(),
|
|
56
|
+
locale: (0, json_type_validation_1.string)(),
|
|
57
|
+
}),
|
|
58
|
+
languages: (0, json_type_validation_1.dict)((0, json_type_validation_1.string)()),
|
|
59
|
+
translations: (0, json_type_validation_1.dict)((0, json_type_validation_1.dict)((0, json_type_validation_1.union)(utils_1.elementNodeDecoder, utils_1.staticValueDecoder))),
|
|
60
|
+
})),
|
|
53
61
|
});
|
|
54
62
|
//# sourceMappingURL=project-decoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-decoder.js","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"project-decoder.js","sourceRoot":"","sources":["../../../src/decoders/project-decoder.ts"],"names":[],"mappings":";;;AAAA,uEAWuC;AAOvC,iCAOgB;AAChB,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,EAAC,IAAA,6BAAM,EAAC,EAAE,GAAG,EAAE,IAAA,6BAAM,GAAE,EAAE,IAAI,EAAE,IAAA,6BAAM,GAAE,EAAE,KAAK,EAAE,IAAA,6BAAM,GAAE,EAAE,CAAC,CAAC,CAAC;IAClF,SAAS,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IAC7B,gBAAgB,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IACpC,OAAO,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IAC3B,WAAW,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IAC/B,KAAK,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;IACzB,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EACD,IAAA,6BAAM,EAAC;QACL,UAAU,EAAE,IAAA,+BAAQ,EAAC,IAAA,6BAAM,GAAE,CAAC;QAC9B,OAAO,EAAE,IAAA,+BAAQ,EACf,IAAA,6BAAM,EAAC;YACL,IAAI,EAAE,IAAA,6BAAM,GAAE;YACd,UAAU,EAAE,IAAA,2BAAI,EAAC,cAAM,OAAA,yBAAiB,EAAjB,CAAiB,CAAC;SAC1C,CAAC,CACH;KACF,CAAC,CACH;CACF,CAAC,CAAA;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;IAChD,SAAS,EAAE,IAAA,+BAAQ,EAAC,wBAAgB,CAAC;IACrC,oBAAoB,EAAE,IAAA,+BAAQ,EAC5B,IAAA,6BAAM,EAAC;QACL,IAAI,EAAE,IAAA,6BAAM,EAAC;YACX,IAAI,EAAE,IAAA,6BAAM,GAAE;YACd,MAAM,EAAE,IAAA,6BAAM,GAAE;SACjB,CAAC;QACF,SAAS,EAAE,IAAA,2BAAI,EAAC,IAAA,6BAAM,GAAE,CAAC;QACzB,YAAY,EAAE,IAAA,2BAAI,EAAC,IAAA,2BAAI,EAAC,IAAA,4BAAK,EAAC,0BAAkB,EAAE,0BAAkB,CAAC,CAAC,CAAC;KACxE,CAAC,CACH;CACF,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Decoder } from '@mojotech/json-type-validation';
|
|
2
|
-
import { UIDLStaticValue, ReferenceType, UIDLDynamicReference,
|
|
2
|
+
import { UIDLStaticValue, ReferenceType, UIDLDynamicReference, UIDLStateDefinition, UIDLPageOptions, UIDLComponentOutputOptions, UIDLDependency, UIDLStyleDefinitions, UIDLStyleValue, VUIDLAttributeValue, UIDLEventHandlerStatement, 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, PagePaginationOptions, VCMSItemUIDLElementNode, VCMSListUIDLElementNode, UIDLInitialPathsData, UIDLInitialPropsData, UIDLExpressionValue, UIDLDynamicLinkNode, UIDLENVValue, UIDLPropValue, UIDLResourceItem, VUIDLNavLinkNode, VUIDLDateTimeNode, UIDLStateValue, UIDLResourceLink, UIDLLocalResource, UIDLExternalResource, VCMSListRepeaterElementNode, UIDLResourceMapper, UIDLInjectValue, VUIDLStateValueDetails, VUIDLCMSMixedTypeNode, UIDLLocalFontAsset, VUIDLPropDefinitions, UIDLGlobalReference, UIDLObjectValue } from '@teleporthq/teleport-types';
|
|
3
3
|
export declare const referenceTypeDecoder: Decoder<ReferenceType>;
|
|
4
|
+
export declare const globalValueDecoder: Decoder<UIDLGlobalReference>;
|
|
4
5
|
export declare const dynamicValueDecoder: Decoder<UIDLDynamicReference>;
|
|
5
6
|
export declare const expressionValueDecoder: Decoder<UIDLExpressionValue>;
|
|
6
7
|
export declare const staticValueDecoder: Decoder<UIDLStaticValue>;
|
|
@@ -9,9 +10,6 @@ export declare const envValueDecoder: Decoder<UIDLENVValue>;
|
|
|
9
10
|
export declare const dyamicFunctionParam: Decoder<UIDLPropValue>;
|
|
10
11
|
export declare const dyamicFunctionStateParam: Decoder<UIDLStateValue>;
|
|
11
12
|
export declare const resourceItemDecoder: Decoder<UIDLResourceItem>;
|
|
12
|
-
export declare const uidlLocalResourcerDecpder: Decoder<UIDLLocalResource>;
|
|
13
|
-
export declare const uidlExternalResourceDecoder: Decoder<UIDLExternalResource>;
|
|
14
|
-
export declare const uidlResourceLinkDecoder: Decoder<UIDLResourceLink>;
|
|
15
13
|
export declare const initialPropsDecoder: Decoder<UIDLInitialPropsData>;
|
|
16
14
|
export declare const initialPathsDecoder: Decoder<UIDLInitialPathsData>;
|
|
17
15
|
export declare const injectValueDecoder: Decoder<UIDLInjectValue>;
|
|
@@ -20,7 +18,7 @@ export declare const styleSetStateConditionDecoder: Decoder<VUIDLStyleSetStateCo
|
|
|
20
18
|
export declare const projectStyleConditionsDecoder: Decoder<VUIDLStyleSetConditions>;
|
|
21
19
|
export declare const tokenReferenceDecoder: Decoder<UIDLStyleSetTokenReference>;
|
|
22
20
|
export declare const styleSetDefinitionDecoder: Decoder<VUIDLStyleSetDefnition>;
|
|
23
|
-
export declare const
|
|
21
|
+
export declare const stateDefinitionsDefaultValueDecoder: Decoder<string | number | boolean | Record<string, unknown> | (string | number | Record<string, unknown>)[]>;
|
|
24
22
|
export declare const globalAssetsDecoder: Decoder<VUIDLGlobalAsset>;
|
|
25
23
|
export declare const baseAssetDecoder: Decoder<UIDLAssetBase>;
|
|
26
24
|
export declare const inlineScriptAssetDecoder: Decoder<UIDLScriptInlineAsset>;
|
|
@@ -28,11 +26,12 @@ export declare const externalScriptAssetDecoder: Decoder<UIDLScriptExternalAsset
|
|
|
28
26
|
export declare const inlineStyletAssetDecoder: Decoder<VUIDLStyleInlineAsset>;
|
|
29
27
|
export declare const externalStyleAssetDecoder: Decoder<UIDLStyleExternalAsset>;
|
|
30
28
|
export declare const fontAssetDecoder: Decoder<VUIDLFontAsset>;
|
|
29
|
+
export declare const localFontDecoder: Decoder<UIDLLocalFontAsset>;
|
|
31
30
|
export declare const canonicalAssetDecoder: Decoder<UIDLCanonicalAsset>;
|
|
32
31
|
export declare const iconAssetDecoder: Decoder<UIDLIconAsset>;
|
|
33
32
|
export declare const componentSeoDecoder: Decoder<VUIDLComponentSEO>;
|
|
34
33
|
export declare const stateValueDetailsDecoder: Decoder<VUIDLStateValueDetails>;
|
|
35
|
-
export declare const propDefinitionsDecoder: Decoder<
|
|
34
|
+
export declare const propDefinitionsDecoder: Decoder<VUIDLPropDefinitions>;
|
|
36
35
|
export declare const pageOptionsPaginationDecoder: Decoder<PagePaginationOptions>;
|
|
37
36
|
export declare const stateDefinitionsDecoder: Decoder<UIDLStateDefinition>;
|
|
38
37
|
export declare const pageOptionsDecoder: Decoder<UIDLPageOptions>;
|
|
@@ -43,7 +42,7 @@ export declare const localDependencyDecoder: Decoder<UIDLLocalDependency>;
|
|
|
43
42
|
export declare const dependencyDecoder: Decoder<UIDLDependency>;
|
|
44
43
|
export declare const resourceMapperDecoder: Decoder<UIDLResourceMapper>;
|
|
45
44
|
export declare const importReferenceDecoder: Decoder<UIDLImportReference>;
|
|
46
|
-
export declare const attributeValueDecoder: Decoder<
|
|
45
|
+
export declare const attributeValueDecoder: Decoder<VUIDLAttributeValue>;
|
|
47
46
|
export declare const uidlComponentStyleReference: Decoder<UIDLComponentStyleReference>;
|
|
48
47
|
export declare const styleValueDecoder: Decoder<UIDLStyleValue>;
|
|
49
48
|
export declare const styleDefinitionsDecoder: Decoder<UIDLStyleDefinitions>;
|
|
@@ -66,14 +65,19 @@ export declare const elementInlineReferencedStyle: Decoder<VUIDLElementNodeInlin
|
|
|
66
65
|
export declare const classDynamicReferenceDecoder: Decoder<UIDLCompDynamicReference>;
|
|
67
66
|
export declare const elementComponentReferencedStyle: Decoder<VUIDLElementNodeClassReferencedStyle>;
|
|
68
67
|
export declare const designTokensDecoder: Decoder<VUIDLDesignTokens>;
|
|
68
|
+
export declare const objectValueDecoder: Decoder<UIDLObjectValue>;
|
|
69
69
|
export declare const elementDecoder: Decoder<VUIDLElement>;
|
|
70
70
|
export declare const slotNodeDecoder: Decoder<VUIDLSlotNode>;
|
|
71
71
|
export declare const repeatNodeDecoder: Decoder<VUIDLRepeatNode>;
|
|
72
72
|
export declare const conditionalNodeDecoder: Decoder<VUIDLConditionalNode>;
|
|
73
73
|
export declare const elementNodeDecoder: Decoder<VUIDLElementNode>;
|
|
74
74
|
export declare const dateTimeNodeDecoder: Decoder<VUIDLDateTimeNode>;
|
|
75
|
+
export declare const uidlLocalResourcerDecpder: Decoder<UIDLLocalResource>;
|
|
76
|
+
export declare const uidlExternalResourceDecoder: Decoder<UIDLExternalResource>;
|
|
77
|
+
export declare const uidlResourceLinkDecoder: Decoder<UIDLResourceLink>;
|
|
75
78
|
export declare const cmsItemNodeDecoder: Decoder<VCMSItemUIDLElementNode>;
|
|
76
|
-
export declare const cmsListRepeaterNodeDecoder: Decoder<VCMSListRepeaterElementNode>;
|
|
77
79
|
export declare const cmsListNodeDecoder: Decoder<VCMSListUIDLElementNode>;
|
|
80
|
+
export declare const cmsListRepeaterNodeDecoder: Decoder<VCMSListRepeaterElementNode>;
|
|
81
|
+
export declare const cmsMixedTypeNodeDecoder: Decoder<VUIDLCMSMixedTypeNode>;
|
|
78
82
|
export declare const uidlNodeDecoder: Decoder<VUIDLNode>;
|
|
79
83
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/decoders/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/decoders/utils.ts"],"names":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