@player-ui/player 0.8.0--canary.307.9621 → 0.8.0-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.
Files changed (214) hide show
  1. package/dist/Player.native.js +11630 -0
  2. package/dist/Player.native.js.map +1 -0
  3. package/dist/cjs/index.cjs +5626 -0
  4. package/dist/cjs/index.cjs.map +1 -0
  5. package/dist/{index.esm.js → index.legacy-esm.js} +2044 -1667
  6. package/dist/{index.cjs.js → index.mjs} +2052 -1761
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +29 -63
  9. package/src/__tests__/data.test.ts +498 -0
  10. package/src/__tests__/flow.test.ts +312 -0
  11. package/src/__tests__/helpers/action-exp.plugin.ts +22 -0
  12. package/src/__tests__/helpers/actions.flow.ts +67 -0
  13. package/src/__tests__/helpers/binding.plugin.ts +125 -0
  14. package/src/__tests__/helpers/expression.plugin.ts +88 -0
  15. package/src/__tests__/helpers/transform-plugin.ts +19 -0
  16. package/src/__tests__/helpers/validation.flow.ts +56 -0
  17. package/src/__tests__/player.test.ts +597 -0
  18. package/src/__tests__/string-resolver.test.ts +186 -0
  19. package/src/__tests__/validation.test.ts +3555 -0
  20. package/src/__tests__/view.test.ts +715 -0
  21. package/src/binding/__tests__/binding.test.ts +113 -0
  22. package/src/binding/__tests__/index.test.ts +208 -0
  23. package/src/binding/__tests__/resolver.test.ts +83 -0
  24. package/src/binding/binding.ts +6 -6
  25. package/src/binding/index.ts +34 -34
  26. package/src/binding/resolver.ts +19 -19
  27. package/src/binding/utils.ts +7 -7
  28. package/src/binding-grammar/__tests__/parser.test.ts +64 -0
  29. package/src/binding-grammar/__tests__/test-utils/ast-cases.ts +198 -0
  30. package/src/binding-grammar/__tests__/test-utils/perf-test.ts +66 -0
  31. package/src/binding-grammar/ast.ts +11 -11
  32. package/src/binding-grammar/custom/index.ts +19 -22
  33. package/src/binding-grammar/ebnf/index.ts +20 -21
  34. package/src/binding-grammar/ebnf/types.ts +13 -13
  35. package/src/binding-grammar/index.ts +4 -4
  36. package/src/binding-grammar/parsimmon/index.ts +14 -14
  37. package/src/controllers/constants/__tests__/index.test.ts +106 -0
  38. package/src/controllers/constants/index.ts +3 -3
  39. package/src/controllers/constants/utils.ts +4 -4
  40. package/src/controllers/data/controller.ts +22 -22
  41. package/src/controllers/data/index.ts +1 -1
  42. package/src/controllers/data/utils.ts +7 -7
  43. package/src/controllers/flow/__tests__/controller.test.ts +195 -0
  44. package/src/controllers/flow/__tests__/flow.test.ts +381 -0
  45. package/src/controllers/flow/controller.ts +13 -13
  46. package/src/controllers/flow/flow.ts +23 -23
  47. package/src/controllers/flow/index.ts +2 -2
  48. package/src/controllers/index.ts +5 -5
  49. package/src/controllers/validation/binding-tracker.ts +71 -59
  50. package/src/controllers/validation/controller.ts +104 -104
  51. package/src/controllers/validation/index.ts +2 -2
  52. package/src/controllers/view/asset-transform.ts +20 -20
  53. package/src/controllers/view/controller.ts +27 -27
  54. package/src/controllers/view/index.ts +4 -4
  55. package/src/controllers/view/store.ts +3 -3
  56. package/src/controllers/view/types.ts +7 -7
  57. package/src/data/__tests__/__snapshots__/dependency-tracker.test.ts.snap +64 -0
  58. package/src/data/__tests__/dependency-tracker.test.ts +146 -0
  59. package/src/data/__tests__/local-model.test.ts +46 -0
  60. package/src/data/__tests__/model.test.ts +78 -0
  61. package/src/data/dependency-tracker.ts +16 -16
  62. package/src/data/index.ts +4 -4
  63. package/src/data/local-model.ts +6 -6
  64. package/src/data/model.ts +17 -17
  65. package/src/data/noop-model.ts +1 -1
  66. package/src/expressions/__tests__/__snapshots__/parser.test.ts.snap +854 -0
  67. package/src/expressions/__tests__/evaluator-functions.test.ts +47 -0
  68. package/src/expressions/__tests__/evaluator.test.ts +410 -0
  69. package/src/expressions/__tests__/parser.test.ts +115 -0
  70. package/src/expressions/__tests__/utils.test.ts +44 -0
  71. package/src/expressions/evaluator-functions.ts +6 -6
  72. package/src/expressions/evaluator.ts +71 -67
  73. package/src/expressions/index.ts +4 -4
  74. package/src/expressions/parser.ts +102 -105
  75. package/src/expressions/types.ts +29 -21
  76. package/src/expressions/utils.ts +32 -21
  77. package/src/index.ts +13 -13
  78. package/src/logger/__tests__/consoleLogger.test.ts +46 -0
  79. package/src/logger/__tests__/noopLogger.test.ts +13 -0
  80. package/src/logger/__tests__/proxyLogger.test.ts +31 -0
  81. package/src/logger/__tests__/tapableLogger.test.ts +41 -0
  82. package/src/logger/consoleLogger.ts +9 -9
  83. package/src/logger/index.ts +5 -5
  84. package/src/logger/noopLogger.ts +1 -1
  85. package/src/logger/proxyLogger.ts +6 -6
  86. package/src/logger/tapableLogger.ts +7 -7
  87. package/src/logger/types.ts +2 -2
  88. package/src/player.ts +60 -58
  89. package/src/plugins/default-exp-plugin.ts +10 -10
  90. package/src/plugins/default-view-plugin.ts +29 -0
  91. package/src/plugins/flow-exp-plugin.ts +6 -6
  92. package/src/schema/__tests__/schema.test.ts +243 -0
  93. package/src/schema/index.ts +2 -2
  94. package/src/schema/schema.ts +24 -24
  95. package/src/schema/types.ts +4 -4
  96. package/src/string-resolver/__tests__/index.test.ts +361 -0
  97. package/src/string-resolver/index.ts +17 -17
  98. package/src/types.ts +17 -17
  99. package/src/utils/__tests__/replaceParams.test.ts +33 -0
  100. package/src/utils/index.ts +1 -1
  101. package/src/utils/replaceParams.ts +1 -1
  102. package/src/validator/__tests__/binding-map-splice.test.ts +53 -0
  103. package/src/validator/__tests__/validation-middleware.test.ts +127 -0
  104. package/src/validator/binding-map-splice.ts +5 -5
  105. package/src/validator/index.ts +4 -4
  106. package/src/validator/registry.ts +1 -1
  107. package/src/validator/types.ts +13 -13
  108. package/src/validator/validation-middleware.ts +15 -15
  109. package/src/view/__tests__/view.immutable.test.ts +269 -0
  110. package/src/view/__tests__/view.test.ts +959 -0
  111. package/src/view/builder/index.test.ts +69 -0
  112. package/src/view/builder/index.ts +3 -3
  113. package/src/view/index.ts +5 -5
  114. package/src/view/parser/__tests__/__snapshots__/parser.test.ts.snap +394 -0
  115. package/src/view/parser/__tests__/parser.test.ts +264 -0
  116. package/src/view/parser/index.ts +43 -33
  117. package/src/view/parser/types.ts +11 -11
  118. package/src/view/parser/utils.ts +5 -5
  119. package/src/view/plugins/__tests__/__snapshots__/template.test.ts.snap +278 -0
  120. package/src/view/plugins/__tests__/applicability.test.ts +265 -0
  121. package/src/view/plugins/__tests__/string.test.ts +122 -0
  122. package/src/view/plugins/__tests__/template.test.ts +724 -0
  123. package/src/view/plugins/applicability.ts +19 -19
  124. package/src/view/plugins/index.ts +4 -5
  125. package/src/view/plugins/options.ts +1 -1
  126. package/src/view/plugins/string-resolver.ts +22 -22
  127. package/src/view/plugins/switch.ts +22 -23
  128. package/src/view/plugins/template-plugin.ts +26 -27
  129. package/src/view/resolver/__tests__/dependencies.test.ts +321 -0
  130. package/src/view/resolver/__tests__/edgecases.test.ts +626 -0
  131. package/src/view/resolver/index.ts +42 -42
  132. package/src/view/resolver/types.ts +21 -20
  133. package/src/view/resolver/utils.ts +9 -9
  134. package/src/view/view.ts +32 -22
  135. package/types/binding/binding.d.ts +50 -0
  136. package/types/binding/index.d.ts +29 -0
  137. package/types/binding/resolver.d.ts +26 -0
  138. package/types/binding/utils.d.ts +12 -0
  139. package/types/binding-grammar/ast.d.ts +67 -0
  140. package/types/binding-grammar/custom/index.d.ts +4 -0
  141. package/types/binding-grammar/ebnf/index.d.ts +4 -0
  142. package/types/binding-grammar/ebnf/types.d.ts +75 -0
  143. package/types/binding-grammar/index.d.ts +5 -0
  144. package/types/binding-grammar/parsimmon/index.d.ts +4 -0
  145. package/types/controllers/constants/index.d.ts +45 -0
  146. package/types/controllers/constants/utils.d.ts +6 -0
  147. package/types/controllers/data/controller.d.ts +45 -0
  148. package/types/controllers/data/index.d.ts +2 -0
  149. package/types/controllers/data/utils.d.ts +14 -0
  150. package/types/controllers/flow/controller.d.ts +25 -0
  151. package/types/controllers/flow/flow.d.ts +50 -0
  152. package/types/controllers/flow/index.d.ts +3 -0
  153. package/types/controllers/index.d.ts +6 -0
  154. package/types/controllers/validation/binding-tracker.d.ts +32 -0
  155. package/types/controllers/validation/controller.d.ts +151 -0
  156. package/types/controllers/validation/index.d.ts +3 -0
  157. package/types/controllers/view/asset-transform.d.ts +19 -0
  158. package/types/controllers/view/controller.d.ts +37 -0
  159. package/types/controllers/view/index.d.ts +5 -0
  160. package/types/controllers/view/store.d.ts +20 -0
  161. package/types/controllers/view/types.d.ts +16 -0
  162. package/types/data/dependency-tracker.d.ts +49 -0
  163. package/types/data/index.d.ts +5 -0
  164. package/types/data/local-model.d.ts +16 -0
  165. package/types/data/model.d.ts +86 -0
  166. package/types/data/noop-model.d.ts +13 -0
  167. package/types/expressions/evaluator-functions.d.ts +15 -0
  168. package/types/expressions/evaluator.d.ts +52 -0
  169. package/types/expressions/index.d.ts +5 -0
  170. package/types/expressions/parser.d.ts +10 -0
  171. package/types/expressions/types.d.ts +144 -0
  172. package/types/expressions/utils.d.ts +12 -0
  173. package/types/index.d.ts +14 -0
  174. package/types/logger/consoleLogger.d.ts +17 -0
  175. package/types/logger/index.d.ts +6 -0
  176. package/types/logger/noopLogger.d.ts +10 -0
  177. package/types/logger/proxyLogger.d.ts +15 -0
  178. package/types/logger/tapableLogger.d.ts +23 -0
  179. package/types/logger/types.d.ts +6 -0
  180. package/types/player.d.ts +101 -0
  181. package/types/plugins/default-exp-plugin.d.ts +9 -0
  182. package/types/plugins/default-view-plugin.d.ts +9 -0
  183. package/types/plugins/flow-exp-plugin.d.ts +11 -0
  184. package/types/schema/index.d.ts +3 -0
  185. package/types/schema/schema.d.ts +36 -0
  186. package/types/schema/types.d.ts +38 -0
  187. package/types/string-resolver/index.d.ts +30 -0
  188. package/types/types.d.ts +73 -0
  189. package/types/utils/index.d.ts +2 -0
  190. package/types/utils/replaceParams.d.ts +9 -0
  191. package/types/validator/binding-map-splice.d.ts +10 -0
  192. package/types/validator/index.d.ts +5 -0
  193. package/types/validator/registry.d.ts +11 -0
  194. package/types/validator/types.d.ts +53 -0
  195. package/types/validator/validation-middleware.d.ts +36 -0
  196. package/types/view/builder/index.d.ts +35 -0
  197. package/types/view/index.d.ts +6 -0
  198. package/types/view/parser/index.d.ts +52 -0
  199. package/types/view/parser/types.d.ts +109 -0
  200. package/types/view/parser/utils.d.ts +6 -0
  201. package/types/view/plugins/applicability.d.ts +10 -0
  202. package/types/view/plugins/index.d.ts +5 -0
  203. package/types/view/plugins/options.d.ts +4 -0
  204. package/types/view/plugins/string-resolver.d.ts +13 -0
  205. package/types/view/plugins/switch.d.ts +14 -0
  206. package/types/view/plugins/template-plugin.d.ts +33 -0
  207. package/types/view/resolver/index.d.ts +73 -0
  208. package/types/view/resolver/types.d.ts +129 -0
  209. package/types/view/resolver/utils.d.ts +11 -0
  210. package/types/view/view.d.ts +37 -0
  211. package/dist/index.d.ts +0 -1814
  212. package/dist/player.dev.js +0 -11472
  213. package/dist/player.prod.js +0 -2
  214. package/src/view/plugins/plugin.ts +0 -21
@@ -0,0 +1,69 @@
1
+ import { describe, test, expect } from "vitest";
2
+ import { Builder } from ".";
3
+ import { NodeType } from "../parser";
4
+
5
+ test("asset", () => {
6
+ const result = Builder.asset({ id: "foo", type: "text" });
7
+ expect(result.type).toBe(NodeType.Asset);
8
+ expect(result.value.type).toBe("text");
9
+ });
10
+
11
+ describe("value", () => {
12
+ test("with no parameters", () => {
13
+ const result = Builder.value();
14
+ expect(result.type).toBe(NodeType.Value);
15
+ expect(result.value).toBeUndefined();
16
+ });
17
+
18
+ test("with parameters", () => {
19
+ const result = Builder.value({ foo: true });
20
+ expect(result.type).toBe(NodeType.Value);
21
+ expect(result.value.foo).toBe(true);
22
+ });
23
+ });
24
+
25
+ describe("multiNode", () => {
26
+ test("sets the parent node on all nodes", () => {
27
+ const v1 = Builder.value({ id: 1 });
28
+ const v2 = Builder.value({ id: 2 });
29
+ const result = Builder.multiNode(v1, v2);
30
+
31
+ expect(result.type).toBe(NodeType.MultiNode);
32
+ expect(v1.parent).toBe(result);
33
+ expect(v2.parent).toBe(result);
34
+ });
35
+ });
36
+
37
+ describe("addChild", () => {
38
+ test("sets the parent on the child node", () => {
39
+ const asset = Builder.asset({ id: "asset", type: "text" });
40
+ const value = Builder.value({ id: 2 });
41
+ Builder.addChild(asset, "childValue", value);
42
+
43
+ expect(value.parent).toBe(asset);
44
+ });
45
+ test("returns the original node", () => {
46
+ const original = Builder.asset({ id: "asset", type: "text" });
47
+ const value = Builder.value({ id: 2 });
48
+ const updated = Builder.addChild(original, "childValue", value);
49
+
50
+ expect(updated).toBe(original);
51
+ });
52
+ test("appends to an existing child array", () => {
53
+ const parent = Builder.asset({ id: "asset", type: "text" });
54
+ const v1 = Builder.value({ id: 1 });
55
+ const v2 = Builder.value({ id: 2 });
56
+ Builder.addChild(parent, "first", v1);
57
+ Builder.addChild(parent, "second", v2);
58
+
59
+ expect(parent.children).toHaveLength(2);
60
+ });
61
+
62
+ test("handles an array of path segments", () => {
63
+ const asset = Builder.asset({ id: "asset", type: "text" });
64
+ const value = Builder.value({ id: 2 });
65
+ Builder.addChild(asset, ["path1", "path2"], value);
66
+
67
+ expect(asset.children?.[0].path).toStrictEqual(["path1", "path2"]);
68
+ });
69
+ });
@@ -1,5 +1,5 @@
1
- import type { Node, AnyAssetType } from '../parser';
2
- import { NodeType } from '../parser';
1
+ import type { Node, AnyAssetType } from "../parser";
2
+ import { NodeType } from "../parser";
3
3
 
4
4
  /**
5
5
  * Functions for building AST nodes (relatively) easily
@@ -62,7 +62,7 @@ export class Builder {
62
62
  static addChild<N extends Node.BaseWithChildren<NT>, NT extends NodeType>(
63
63
  node: N,
64
64
  path: Node.PathSegment | Node.PathSegment[],
65
- child: Node.Node
65
+ child: Node.Node,
66
66
  ) {
67
67
  // eslint-disable-next-line no-param-reassign
68
68
  child.parent = node as Node.Node;
package/src/view/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './view';
2
- export * from './resolver';
3
- export * from './parser';
4
- export * from './builder';
5
- export * from './plugins';
1
+ export * from "./view";
2
+ export * from "./resolver";
3
+ export * from "./parser";
4
+ export * from "./builder";
5
+ export * from "./plugins";
@@ -0,0 +1,394 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`generates the correct AST > parses an exp array 1`] = `
4
+ {
5
+ "children": [
6
+ {
7
+ "path": [
8
+ "exp",
9
+ ],
10
+ "value": {
11
+ "override": true,
12
+ "parent": [Circular],
13
+ "type": "multi-node",
14
+ "values": [
15
+ {
16
+ "parent": [Circular],
17
+ "type": "value",
18
+ "value": "{{please}} = "work"",
19
+ },
20
+ ],
21
+ },
22
+ },
23
+ ],
24
+ "type": "asset",
25
+ "value": {
26
+ "id": "foo",
27
+ "type": "action",
28
+ },
29
+ }
30
+ `;
31
+
32
+ exports[`generates the correct AST > parses an object 1`] = `
33
+ {
34
+ "children": [
35
+ {
36
+ "path": [
37
+ "asset",
38
+ ],
39
+ "value": {
40
+ "parent": [Circular],
41
+ "type": "asset",
42
+ "value": {
43
+ "type": "bar",
44
+ },
45
+ },
46
+ },
47
+ ],
48
+ "type": "value",
49
+ "value": undefined,
50
+ }
51
+ `;
52
+
53
+ exports[`generates the correct AST > works with applicability things 1`] = `
54
+ {
55
+ "expression": "{{baz}}",
56
+ "type": "applicability",
57
+ "value": {
58
+ "parent": [Circular],
59
+ "type": "value",
60
+ "value": {
61
+ "foo": "bar",
62
+ },
63
+ },
64
+ }
65
+ `;
66
+
67
+ exports[`generates the correct AST > works with applicability things 2`] = `
68
+ {
69
+ "children": [
70
+ {
71
+ "path": [
72
+ "asset",
73
+ ],
74
+ "value": {
75
+ "children": [
76
+ {
77
+ "path": [
78
+ "values",
79
+ ],
80
+ "value": {
81
+ "override": true,
82
+ "parent": [Circular],
83
+ "type": "multi-node",
84
+ "values": [
85
+ {
86
+ "expression": "{{foo}}",
87
+ "parent": [Circular],
88
+ "type": "applicability",
89
+ "value": {
90
+ "parent": [Circular],
91
+ "type": "value",
92
+ "value": {
93
+ "value": "foo",
94
+ },
95
+ },
96
+ },
97
+ {
98
+ "parent": [Circular],
99
+ "type": "value",
100
+ "value": {
101
+ "value": "bar",
102
+ },
103
+ },
104
+ ],
105
+ },
106
+ },
107
+ ],
108
+ "parent": [Circular],
109
+ "type": "asset",
110
+ "value": undefined,
111
+ },
112
+ },
113
+ ],
114
+ "type": "value",
115
+ "value": undefined,
116
+ }
117
+ `;
118
+
119
+ exports[`generates the correct AST > works with applicability things 3`] = `
120
+ {
121
+ "children": [
122
+ {
123
+ "path": [
124
+ "asset",
125
+ ],
126
+ "value": {
127
+ "children": [
128
+ {
129
+ "path": [
130
+ "someProp",
131
+ ],
132
+ "value": {
133
+ "expression": "{{foo}}",
134
+ "parent": [Circular],
135
+ "type": "applicability",
136
+ "value": {
137
+ "parent": [Circular],
138
+ "type": "value",
139
+ "value": {
140
+ "description": {
141
+ "value": "description",
142
+ },
143
+ "label": {
144
+ "value": "label",
145
+ },
146
+ },
147
+ },
148
+ },
149
+ },
150
+ ],
151
+ "parent": [Circular],
152
+ "type": "asset",
153
+ "value": undefined,
154
+ },
155
+ },
156
+ ],
157
+ "type": "value",
158
+ "value": undefined,
159
+ }
160
+ `;
161
+
162
+ exports[`generates the correct AST > works with applicability things 4`] = `
163
+ {
164
+ "children": [
165
+ {
166
+ "path": [
167
+ "asset",
168
+ ],
169
+ "value": {
170
+ "children": [
171
+ {
172
+ "path": [
173
+ "someProp",
174
+ "asset",
175
+ ],
176
+ "value": {
177
+ "expression": "{{foo}}",
178
+ "parent": [Circular],
179
+ "type": "applicability",
180
+ "value": {
181
+ "parent": [Circular],
182
+ "type": "asset",
183
+ "value": {
184
+ "type": "someAsset",
185
+ },
186
+ },
187
+ },
188
+ },
189
+ ],
190
+ "parent": [Circular],
191
+ "type": "asset",
192
+ "value": undefined,
193
+ },
194
+ },
195
+ ],
196
+ "type": "value",
197
+ "value": undefined,
198
+ }
199
+ `;
200
+
201
+ exports[`generates the correct AST when using switch plugin > works with asset wrapped objects 1`] = `
202
+ {
203
+ "children": [
204
+ {
205
+ "path": [
206
+ "title",
207
+ "asset",
208
+ ],
209
+ "value": {
210
+ "parent": [Circular],
211
+ "type": "asset",
212
+ "value": {
213
+ "id": "businessprofile-tile-screen-yoy-subtitle",
214
+ "type": "text",
215
+ "value": "If it's changed since last year, let us know. Feel free to pick more than one.",
216
+ },
217
+ },
218
+ },
219
+ ],
220
+ "type": "value",
221
+ "value": {
222
+ "id": "toughView",
223
+ "type": "view",
224
+ },
225
+ }
226
+ `;
227
+
228
+ exports[`generates the correct AST when using switch plugin > works with objects in a multiNode 1`] = `
229
+ {
230
+ "children": [
231
+ {
232
+ "path": [
233
+ "title",
234
+ "asset",
235
+ ],
236
+ "value": {
237
+ "children": [
238
+ {
239
+ "path": [
240
+ "values",
241
+ ],
242
+ "value": {
243
+ "override": true,
244
+ "parent": [Circular],
245
+ "type": "multi-node",
246
+ "values": [
247
+ {
248
+ "children": [
249
+ {
250
+ "path": [
251
+ "asset",
252
+ ],
253
+ "value": {
254
+ "parent": [Circular],
255
+ "type": "asset",
256
+ "value": {
257
+ "id": "businessprofile-tile-screen-yoy-subtitle-1",
258
+ "type": "text",
259
+ "value": "If it's changed since last year, let us know. Feel free to pick more than one.",
260
+ },
261
+ },
262
+ },
263
+ ],
264
+ "parent": [Circular],
265
+ "type": "value",
266
+ "value": undefined,
267
+ },
268
+ {
269
+ "children": [
270
+ {
271
+ "path": [
272
+ "asset",
273
+ ],
274
+ "value": {
275
+ "parent": [Circular],
276
+ "type": "asset",
277
+ "value": {
278
+ "id": "businessprofile-tile-screen-yoy-subtitle-2",
279
+ "type": "text",
280
+ "value": "More text",
281
+ },
282
+ },
283
+ },
284
+ ],
285
+ "parent": [Circular],
286
+ "type": "value",
287
+ "value": undefined,
288
+ },
289
+ ],
290
+ },
291
+ },
292
+ ],
293
+ "parent": [Circular],
294
+ "type": "asset",
295
+ "value": {
296
+ "id": "someMultiNode",
297
+ "type": "type",
298
+ },
299
+ },
300
+ },
301
+ ],
302
+ "type": "value",
303
+ "value": {
304
+ "id": "toughView",
305
+ "type": "view",
306
+ },
307
+ }
308
+ `;
309
+
310
+ exports[`parseView > parses a simple view 1`] = `
311
+ {
312
+ "children": [
313
+ {
314
+ "path": [
315
+ "fields",
316
+ "asset",
317
+ ],
318
+ "value": {
319
+ "children": [
320
+ {
321
+ "path": [
322
+ "values",
323
+ ],
324
+ "value": {
325
+ "override": true,
326
+ "parent": [Circular],
327
+ "type": "multi-node",
328
+ "values": [
329
+ {
330
+ "children": [
331
+ {
332
+ "path": [
333
+ "asset",
334
+ ],
335
+ "value": {
336
+ "parent": [Circular],
337
+ "type": "asset",
338
+ "value": {
339
+ "id": "text-asset",
340
+ "type": "text",
341
+ "value": "bar",
342
+ },
343
+ },
344
+ },
345
+ ],
346
+ "parent": [Circular],
347
+ "type": "value",
348
+ "value": undefined,
349
+ },
350
+ {
351
+ "children": [
352
+ {
353
+ "path": [
354
+ "asset",
355
+ ],
356
+ "value": {
357
+ "expression": "foo.bar",
358
+ "parent": [Circular],
359
+ "type": "applicability",
360
+ "value": {
361
+ "parent": [Circular],
362
+ "type": "asset",
363
+ "value": {
364
+ "id": "input-asset",
365
+ "type": "input",
366
+ },
367
+ },
368
+ },
369
+ },
370
+ ],
371
+ "parent": [Circular],
372
+ "type": "value",
373
+ "value": undefined,
374
+ },
375
+ ],
376
+ },
377
+ },
378
+ ],
379
+ "parent": [Circular],
380
+ "type": "asset",
381
+ "value": {
382
+ "id": "foo-asset",
383
+ "type": "collection",
384
+ },
385
+ },
386
+ },
387
+ ],
388
+ "type": "view",
389
+ "value": {
390
+ "id": "foo-view",
391
+ "type": "viewtype",
392
+ },
393
+ }
394
+ `;