@player-ui/types 0.4.0 → 0.4.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +24 -3
- package/dist/xlr/Asset.json +40 -0
- package/dist/xlr/AssetBinding.json +23 -0
- package/dist/xlr/AssetSwitch.json +213 -0
- package/dist/xlr/AssetWrapper.json +34 -0
- package/dist/xlr/AssetWrapperOrSwitch.json +304 -0
- package/dist/xlr/Binding.json +7 -0
- package/dist/xlr/BindingRef.json +7 -0
- package/dist/xlr/DataModel.json +13 -0
- package/dist/xlr/DynamicSwitch.json +96 -0
- package/dist/xlr/Expression.json +21 -0
- package/dist/xlr/ExpressionObject.json +19 -0
- package/dist/xlr/ExpressionRef.json +7 -0
- package/dist/xlr/Flow.json +2278 -0
- package/dist/xlr/FlowResult.json +131 -0
- package/dist/xlr/Navigation.json +783 -0
- package/dist/xlr/NavigationBaseState.json +133 -0
- package/dist/xlr/NavigationFlow.json +746 -0
- package/dist/xlr/NavigationFlowActionState.json +120 -0
- package/dist/xlr/NavigationFlowEndState.json +110 -0
- package/dist/xlr/NavigationFlowExternalState.json +126 -0
- package/dist/xlr/NavigationFlowFlowState.json +125 -0
- package/dist/xlr/NavigationFlowState.json +627 -0
- package/dist/xlr/NavigationFlowTransition.json +12 -0
- package/dist/xlr/NavigationFlowTransitionableState.json +149 -0
- package/dist/xlr/NavigationFlowViewState.json +138 -0
- package/dist/xlr/StaticSwitch.json +96 -0
- package/dist/xlr/Switch.json +71 -0
- package/dist/xlr/SwitchCase.json +51 -0
- package/dist/xlr/Templatable.json +83 -0
- package/dist/xlr/Template.json +65 -0
- package/dist/xlr/View.json +185 -0
- package/dist/xlr/manifest.js +41 -0
- package/dist/xlr/manifest.json +46 -0
- package/package.json +9 -1
- package/src/index.ts +29 -4
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "core/types/src/index.ts",
|
|
3
|
+
"name": "View",
|
|
4
|
+
"type": "conditional",
|
|
5
|
+
"check": {
|
|
6
|
+
"left": {
|
|
7
|
+
"type": "unknown"
|
|
8
|
+
},
|
|
9
|
+
"right": {
|
|
10
|
+
"type": "ref",
|
|
11
|
+
"ref": "Asset",
|
|
12
|
+
"property": "validation"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"value": {
|
|
16
|
+
"true": {
|
|
17
|
+
"type": "and",
|
|
18
|
+
"and": [
|
|
19
|
+
{
|
|
20
|
+
"type": "ref",
|
|
21
|
+
"ref": "T"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "object",
|
|
25
|
+
"properties": {
|
|
26
|
+
"validation": {
|
|
27
|
+
"required": false,
|
|
28
|
+
"node": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"elementType": {
|
|
31
|
+
"name": "CrossfieldReference",
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"type": {
|
|
35
|
+
"required": true,
|
|
36
|
+
"node": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"title": "Reference.type",
|
|
39
|
+
"description": "The name of the referenced validation type\nThis will be used to lookup the proper handler"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"message": {
|
|
43
|
+
"required": false,
|
|
44
|
+
"node": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"title": "Reference.message",
|
|
47
|
+
"description": "An optional means of overriding the default message if the validation is triggered"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"severity": {
|
|
51
|
+
"required": false,
|
|
52
|
+
"node": {
|
|
53
|
+
"name": "Severity",
|
|
54
|
+
"type": "or",
|
|
55
|
+
"or": [
|
|
56
|
+
{
|
|
57
|
+
"type": "string",
|
|
58
|
+
"const": "error"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "string",
|
|
62
|
+
"const": "warning"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"title": "Reference.severity",
|
|
66
|
+
"description": "An optional means of overriding the default severity of the validation if triggered"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"trigger": {
|
|
70
|
+
"required": false,
|
|
71
|
+
"node": {
|
|
72
|
+
"name": "Trigger",
|
|
73
|
+
"type": "or",
|
|
74
|
+
"or": [
|
|
75
|
+
{
|
|
76
|
+
"type": "string",
|
|
77
|
+
"const": "navigation"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "string",
|
|
81
|
+
"const": "change"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "string",
|
|
85
|
+
"const": "load"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"title": "Reference.trigger",
|
|
89
|
+
"description": "When to run this particular validation"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"dataTarget": {
|
|
93
|
+
"required": false,
|
|
94
|
+
"node": {
|
|
95
|
+
"type": "never",
|
|
96
|
+
"title": "CrossfieldReference.dataTarget",
|
|
97
|
+
"description": "Cross-field references and validation must run against the default (deformatted) value"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"displayTarget": {
|
|
101
|
+
"required": false,
|
|
102
|
+
"node": {
|
|
103
|
+
"name": "DisplayTarget",
|
|
104
|
+
"type": "or",
|
|
105
|
+
"or": [
|
|
106
|
+
{
|
|
107
|
+
"type": "string",
|
|
108
|
+
"const": "page"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"type": "string",
|
|
112
|
+
"const": "section"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "string",
|
|
116
|
+
"const": "field"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"title": "Reference.displayTarget",
|
|
120
|
+
"description": "Where the error should be displayed"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"blocking": {
|
|
124
|
+
"required": false,
|
|
125
|
+
"node": {
|
|
126
|
+
"type": "or",
|
|
127
|
+
"or": [
|
|
128
|
+
{
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"title": "Reference.blocking"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "string",
|
|
134
|
+
"const": "once"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"title": "Reference.blocking",
|
|
138
|
+
"description": "If the validation blocks navigation\ntrue/false - always/never block navigation\nonce - only block navigation if the validation has not been triggered before",
|
|
139
|
+
"default": "- true for errors, 'once' for warnings"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"ref": {
|
|
143
|
+
"required": false,
|
|
144
|
+
"node": {
|
|
145
|
+
"type": "ref",
|
|
146
|
+
"ref": "Binding",
|
|
147
|
+
"title": "CrossfieldReference.ref",
|
|
148
|
+
"description": "The binding to associate this validation with"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"additionalProperties": {
|
|
153
|
+
"type": "unknown"
|
|
154
|
+
},
|
|
155
|
+
"title": "CrossfieldReference"
|
|
156
|
+
},
|
|
157
|
+
"title": "validation",
|
|
158
|
+
"description": "Each view can optionally supply a list of validations to run against a particular view"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"additionalProperties": false
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"false": {
|
|
167
|
+
"type": "ref",
|
|
168
|
+
"ref": "T"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"title": "View",
|
|
172
|
+
"genericTokens": [
|
|
173
|
+
{
|
|
174
|
+
"symbol": "T",
|
|
175
|
+
"constraints": {
|
|
176
|
+
"type": "ref",
|
|
177
|
+
"ref": "Asset"
|
|
178
|
+
},
|
|
179
|
+
"default": {
|
|
180
|
+
"type": "ref",
|
|
181
|
+
"ref": "Asset"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const Asset = require('./Asset.json')
|
|
2
|
+
const AssetBinding = require('./AssetBinding.json')
|
|
3
|
+
const SwitchCase = require('./SwitchCase.json')
|
|
4
|
+
const Switch = require('./Switch.json')
|
|
5
|
+
const AssetWrapper = require('./AssetWrapper.json')
|
|
6
|
+
const AssetWrapperOrSwitch = require('./AssetWrapperOrSwitch.json')
|
|
7
|
+
const AssetSwitch = require('./AssetSwitch.json')
|
|
8
|
+
const StaticSwitch = require('./StaticSwitch.json')
|
|
9
|
+
const DynamicSwitch = require('./DynamicSwitch.json')
|
|
10
|
+
const Expression = require('./Expression.json')
|
|
11
|
+
const ExpressionRef = require('./ExpressionRef.json')
|
|
12
|
+
const Binding = require('./Binding.json')
|
|
13
|
+
const BindingRef = require('./BindingRef.json')
|
|
14
|
+
const DataModel = require('./DataModel.json')
|
|
15
|
+
const Navigation = require('./Navigation.json')
|
|
16
|
+
const ExpressionObject = require('./ExpressionObject.json')
|
|
17
|
+
const NavigationFlow = require('./NavigationFlow.json')
|
|
18
|
+
const NavigationFlowTransition = require('./NavigationFlowTransition.json')
|
|
19
|
+
const NavigationBaseState = require('./NavigationBaseState.json')
|
|
20
|
+
const NavigationFlowTransitionableState = require('./NavigationFlowTransitionableState.json')
|
|
21
|
+
const NavigationFlowViewState = require('./NavigationFlowViewState.json')
|
|
22
|
+
const NavigationFlowEndState = require('./NavigationFlowEndState.json')
|
|
23
|
+
const NavigationFlowActionState = require('./NavigationFlowActionState.json')
|
|
24
|
+
const NavigationFlowExternalState = require('./NavigationFlowExternalState.json')
|
|
25
|
+
const NavigationFlowFlowState = require('./NavigationFlowFlowState.json')
|
|
26
|
+
const NavigationFlowState = require('./NavigationFlowState.json')
|
|
27
|
+
const FlowResult = require('./FlowResult.json')
|
|
28
|
+
const Templatable = require('./Templatable.json')
|
|
29
|
+
const Template = require('./Template.json')
|
|
30
|
+
const View = require('./View.json')
|
|
31
|
+
const Flow = require('./Flow.json')
|
|
32
|
+
|
|
33
|
+
module.exports = {
|
|
34
|
+
"pluginName": "Types",
|
|
35
|
+
"capabilities": {
|
|
36
|
+
"Types":[Asset,AssetBinding,SwitchCase,Switch,AssetWrapper,AssetWrapperOrSwitch,AssetSwitch,StaticSwitch,DynamicSwitch,Expression,ExpressionRef,Binding,BindingRef,DataModel,Navigation,ExpressionObject,NavigationFlow,NavigationFlowTransition,NavigationBaseState,NavigationFlowTransitionableState,NavigationFlowViewState,NavigationFlowEndState,NavigationFlowActionState,NavigationFlowExternalState,NavigationFlowFlowState,NavigationFlowState,FlowResult,Templatable,Template,View,Flow],
|
|
37
|
+
},
|
|
38
|
+
"customPrimitives": [
|
|
39
|
+
'Expression','Asset','Binding','AssetWrapper','Schema.DataType','ExpressionHandler'
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginName": "Types",
|
|
3
|
+
"capabilities": {
|
|
4
|
+
"Types": [
|
|
5
|
+
"Asset",
|
|
6
|
+
"AssetBinding",
|
|
7
|
+
"SwitchCase",
|
|
8
|
+
"Switch",
|
|
9
|
+
"AssetWrapper",
|
|
10
|
+
"AssetWrapperOrSwitch",
|
|
11
|
+
"AssetSwitch",
|
|
12
|
+
"StaticSwitch",
|
|
13
|
+
"DynamicSwitch",
|
|
14
|
+
"Expression",
|
|
15
|
+
"ExpressionRef",
|
|
16
|
+
"Binding",
|
|
17
|
+
"BindingRef",
|
|
18
|
+
"DataModel",
|
|
19
|
+
"Navigation",
|
|
20
|
+
"ExpressionObject",
|
|
21
|
+
"NavigationFlow",
|
|
22
|
+
"NavigationFlowTransition",
|
|
23
|
+
"NavigationBaseState",
|
|
24
|
+
"NavigationFlowTransitionableState",
|
|
25
|
+
"NavigationFlowViewState",
|
|
26
|
+
"NavigationFlowEndState",
|
|
27
|
+
"NavigationFlowActionState",
|
|
28
|
+
"NavigationFlowExternalState",
|
|
29
|
+
"NavigationFlowFlowState",
|
|
30
|
+
"NavigationFlowState",
|
|
31
|
+
"FlowResult",
|
|
32
|
+
"Templatable",
|
|
33
|
+
"Template",
|
|
34
|
+
"View",
|
|
35
|
+
"Flow"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"customPrimitives": [
|
|
39
|
+
"Expression",
|
|
40
|
+
"Asset",
|
|
41
|
+
"Binding",
|
|
42
|
+
"AssetWrapper",
|
|
43
|
+
"Schema.DataType",
|
|
44
|
+
"ExpressionHandler"
|
|
45
|
+
]
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/types",
|
|
3
|
-
"version": "0.4.0",
|
|
3
|
+
"version": "0.4.1-next.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -50,6 +50,14 @@
|
|
|
50
50
|
{
|
|
51
51
|
"name": "Kelly Harrop",
|
|
52
52
|
"url": "https://github.com/kharrop"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Alejandro Fimbres",
|
|
56
|
+
"url": "https://github.com/lexfm"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Rafael Campos",
|
|
60
|
+
"url": "https://github.com/rafbcampos"
|
|
53
61
|
}
|
|
54
62
|
]
|
|
55
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -272,17 +272,16 @@ export declare namespace Schema {
|
|
|
272
272
|
/** A Node describes a specific object in the tree */
|
|
273
273
|
export interface Node {
|
|
274
274
|
/** Each property describes a property of the object */
|
|
275
|
-
[key: string]:
|
|
275
|
+
[key: string]: DataTypes;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
export type DataTypes = DataType | RecordType | ArrayType;
|
|
279
|
+
|
|
278
280
|
/** Each prop in the object can have a specific DataType */
|
|
279
281
|
export interface DataType<T = unknown> {
|
|
280
282
|
/** The reference of the base type to use */
|
|
281
283
|
type: string;
|
|
282
284
|
|
|
283
|
-
/** The referenced object represents an array rather than an object */
|
|
284
|
-
isArray?: boolean;
|
|
285
|
-
|
|
286
285
|
/**
|
|
287
286
|
* Any additional validations that are associated with this property
|
|
288
287
|
* These will add to any base validations associated with the "type"
|
|
@@ -304,6 +303,23 @@ export declare namespace Schema {
|
|
|
304
303
|
/** Any additional options */
|
|
305
304
|
[key: string]: unknown;
|
|
306
305
|
}
|
|
306
|
+
/** Determines if the Datatype is a record object */
|
|
307
|
+
export interface RecordType extends DataType {
|
|
308
|
+
/** boolean to define if its a record */
|
|
309
|
+
isRecord: boolean;
|
|
310
|
+
|
|
311
|
+
/** This property is mutually exclusive with RecordType and can not be used with ArrayType */
|
|
312
|
+
isArray?: never;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** Determines if the DataType is an Array Object */
|
|
316
|
+
export interface ArrayType extends DataType {
|
|
317
|
+
/** boolean to define if its an array */
|
|
318
|
+
isArray: boolean;
|
|
319
|
+
|
|
320
|
+
/** This property is mutually exclusive with ArrayType and can not be used with RecordType */
|
|
321
|
+
isRecord?: never;
|
|
322
|
+
}
|
|
307
323
|
}
|
|
308
324
|
|
|
309
325
|
/** Namespace to wrap up core functionality to be used by the Language Service */
|
|
@@ -382,6 +398,15 @@ export declare namespace Validation {
|
|
|
382
398
|
/** Where the error should be displayed */
|
|
383
399
|
displayTarget?: DisplayTarget;
|
|
384
400
|
|
|
401
|
+
/**
|
|
402
|
+
* If the validation blocks navigation
|
|
403
|
+
* true/false - always/never block navigation
|
|
404
|
+
* once - only block navigation if the validation has not been triggered before
|
|
405
|
+
*
|
|
406
|
+
* @default - true for errors, 'once' for warnings
|
|
407
|
+
*/
|
|
408
|
+
blocking?: boolean | 'once';
|
|
409
|
+
|
|
385
410
|
/** Additional props to send down to a Validator */
|
|
386
411
|
[key: string]: unknown;
|
|
387
412
|
}
|