@nordcraft/runtime 1.0.88 → 1.0.90
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/custom-element.main.esm.js +24 -24
- package/dist/custom-element.main.esm.js.map +4 -4
- package/dist/page.main.esm.js +3 -3
- package/dist/page.main.esm.js.map +4 -4
- package/dist/src/components/createComponent.js +37 -36
- package/dist/src/components/createComponent.js.map +1 -1
- package/dist/src/components/createElement.js +0 -2
- package/dist/src/components/createElement.js.map +1 -1
- package/dist/src/components/createNode.js +12 -4
- package/dist/src/components/createNode.js.map +1 -1
- package/dist/src/components/createNode.test.d.ts +1 -0
- package/dist/src/components/createNode.test.js +608 -0
- package/dist/src/components/createNode.test.js.map +1 -0
- package/dist/src/components/meta.d.ts +3 -0
- package/dist/src/components/meta.js +18 -0
- package/dist/src/components/meta.js.map +1 -0
- package/dist/src/components/meta.test.d.ts +1 -0
- package/dist/src/components/meta.test.js +80 -0
- package/dist/src/components/meta.test.js.map +1 -0
- package/dist/src/components/renderComponent.js +2 -4
- package/dist/src/components/renderComponent.js.map +1 -1
- package/dist/src/editor/postMessageToEditor.d.ts +2 -0
- package/dist/src/editor/postMessageToEditor.js +4 -0
- package/dist/src/editor/postMessageToEditor.js.map +1 -0
- package/dist/src/editor-preview.main.js +12 -13
- package/dist/src/editor-preview.main.js.map +1 -1
- package/dist/src/page.main.js +46 -59
- package/dist/src/page.main.js.map +1 -1
- package/dist/src/styles/CustomPropertyStyleSheet.d.ts +0 -1
- package/dist/src/styles/CustomPropertyStyleSheet.js +1 -1
- package/dist/src/styles/CustomPropertyStyleSheet.js.map +1 -1
- package/dist/src/styles/CustomPropertyStyleSheet.test.js +2 -5
- package/dist/src/styles/CustomPropertyStyleSheet.test.js.map +1 -1
- package/dist/src/utils/BatchQueue.d.ts +1 -0
- package/dist/src/utils/BatchQueue.js +2 -1
- package/dist/src/utils/BatchQueue.js.map +1 -1
- package/dist/src/utils/getComponent.d.ts +5 -0
- package/dist/src/utils/getComponent.js +8 -0
- package/dist/src/utils/getComponent.js.map +1 -0
- package/dist/src/utils/getComponent.test.d.ts +1 -0
- package/dist/src/utils/getComponent.test.js +24 -0
- package/dist/src/utils/getComponent.test.js.map +1 -0
- package/dist/src/utils/markSelectedElement.d.ts +1 -0
- package/dist/src/utils/markSelectedElement.js +9 -0
- package/dist/src/utils/markSelectedElement.js.map +1 -0
- package/dist/src/utils/subscribeCustomProperty.d.ts +3 -3
- package/dist/src/utils/subscribeCustomProperty.js +2 -3
- package/dist/src/utils/subscribeCustomProperty.js.map +1 -1
- package/package.json +3 -3
- package/src/components/createComponent.ts +57 -51
- package/src/components/createElement.ts +0 -2
- package/src/components/createNode.test.ts +686 -0
- package/src/components/createNode.ts +17 -6
- package/src/components/meta.test.ts +90 -0
- package/src/components/meta.ts +23 -0
- package/src/components/renderComponent.ts +2 -4
- package/src/editor/postMessageToEditor.ts +5 -0
- package/src/editor-preview.main.ts +12 -15
- package/src/page.main.ts +47 -59
- package/src/styles/CustomPropertyStyleSheet.test.ts +2 -7
- package/src/styles/CustomPropertyStyleSheet.ts +1 -2
- package/src/utils/BatchQueue.ts +2 -2
- package/src/utils/getComponent.test.ts +29 -0
- package/src/utils/getComponent.ts +15 -0
- package/src/utils/markSelectedElement.ts +8 -0
- package/src/utils/subscribeCustomProperty.ts +1 -5
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import '../../happydom';
|
|
3
|
+
import { signal } from '../signal/signal';
|
|
4
|
+
import { customPropertiesStylesheet } from '../utils/subscribeCustomProperty';
|
|
5
|
+
import { createNode } from './createNode';
|
|
6
|
+
describe('createNode()', () => {
|
|
7
|
+
test('it can render basic nodes', () => {
|
|
8
|
+
const parentElement = document.createElement('div');
|
|
9
|
+
const nodes = createNode({
|
|
10
|
+
ctx: {
|
|
11
|
+
isRootComponent: false,
|
|
12
|
+
component: {
|
|
13
|
+
name: 'My Component',
|
|
14
|
+
nodes: {
|
|
15
|
+
'test-node-id': {
|
|
16
|
+
type: 'element',
|
|
17
|
+
tag: 'div',
|
|
18
|
+
children: ['test-node-id.0', 'test-node-id.1'],
|
|
19
|
+
attrs: {},
|
|
20
|
+
events: {},
|
|
21
|
+
},
|
|
22
|
+
'test-node-id.0': {
|
|
23
|
+
type: 'text',
|
|
24
|
+
value: { type: 'value', value: 'Item 1' },
|
|
25
|
+
},
|
|
26
|
+
'test-node-id.1': {
|
|
27
|
+
type: 'text',
|
|
28
|
+
value: { type: 'value', value: 'Item 2' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
34
|
+
dataSignal: signal({
|
|
35
|
+
Attributes: {},
|
|
36
|
+
Variables: {},
|
|
37
|
+
}),
|
|
38
|
+
path: 'test-node',
|
|
39
|
+
id: 'test-node-id',
|
|
40
|
+
parentElement,
|
|
41
|
+
instance: {},
|
|
42
|
+
});
|
|
43
|
+
expect(nodes.length).toBe(1);
|
|
44
|
+
expect(nodes[0].outerHTML).toMatchInlineSnapshot(`"<div data-node-id="test-node-id" data-id="test-node" data-component="My Component" class="cYXIdv"><span data-node-id="test-node-id.0" data-id="test-node.0" data-component="My Component" data-node-type="text">Item 1</span><span data-node-id="test-node-id.1" data-id="test-node.1" data-component="My Component" data-node-type="text">Item 2</span></div>"`);
|
|
45
|
+
});
|
|
46
|
+
test('repeat nodes should keep the same node references when items are shuffled/added/removed', () => {
|
|
47
|
+
// In this test, we update the signal to change the order of the content in the repeat.
|
|
48
|
+
// We use repeatKey, so the nodes should simply be moved in the DOM instead of recreated.
|
|
49
|
+
const parentElement = document.createElement('div');
|
|
50
|
+
document.body.appendChild(parentElement);
|
|
51
|
+
const item1 = { id: 'i1', name: 'Item 1' };
|
|
52
|
+
const item2 = { id: 'i2', name: 'Item 2' };
|
|
53
|
+
const item3 = { id: 'i3', name: 'Item 3' };
|
|
54
|
+
const dataSignal = signal({
|
|
55
|
+
Attributes: {},
|
|
56
|
+
Variables: {
|
|
57
|
+
items: [item1, item2, item3],
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const ctx = {
|
|
61
|
+
isRootComponent: false,
|
|
62
|
+
component: {
|
|
63
|
+
name: 'My Component',
|
|
64
|
+
nodes: {
|
|
65
|
+
'repeat-node-id': {
|
|
66
|
+
type: 'element',
|
|
67
|
+
tag: 'div',
|
|
68
|
+
repeat: { type: 'path', path: ['Variables', 'items'] },
|
|
69
|
+
repeatKey: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
70
|
+
children: ['text-node-id'],
|
|
71
|
+
attrs: {},
|
|
72
|
+
events: {},
|
|
73
|
+
customProperties: {
|
|
74
|
+
'--color': {
|
|
75
|
+
syntax: {
|
|
76
|
+
type: 'primitive',
|
|
77
|
+
name: 'color',
|
|
78
|
+
},
|
|
79
|
+
formula: {
|
|
80
|
+
type: 'value',
|
|
81
|
+
value: 'red',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
'text-node-id': {
|
|
87
|
+
type: 'text',
|
|
88
|
+
value: { type: 'path', path: ['ListItem', 'Item', 'name'] },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
root: document,
|
|
93
|
+
formulaCache: {},
|
|
94
|
+
env: { runtime: 'page' },
|
|
95
|
+
};
|
|
96
|
+
const nodes = createNode({
|
|
97
|
+
ctx,
|
|
98
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
99
|
+
dataSignal,
|
|
100
|
+
path: '0.0.0',
|
|
101
|
+
id: 'repeat-node-id',
|
|
102
|
+
parentElement,
|
|
103
|
+
instance: {},
|
|
104
|
+
});
|
|
105
|
+
// Custom properties stylesheet should be created and have the custom property from the node
|
|
106
|
+
const sheet = customPropertiesStylesheet?.getStyleSheet();
|
|
107
|
+
expect(sheet).toBeTruthy();
|
|
108
|
+
expect(sheet?.cssRules.length).toBe(3);
|
|
109
|
+
expect(sheet?.cssRules[0].cssText).toBe('[data-id="0.0.0"] { --color: red; }');
|
|
110
|
+
parentElement.append(...nodes);
|
|
111
|
+
expect(parentElement.children.length).toBe(3);
|
|
112
|
+
const element1 = parentElement.children[0];
|
|
113
|
+
const element2 = parentElement.children[1];
|
|
114
|
+
const element3 = parentElement.children[2];
|
|
115
|
+
expect(element1.textContent).toBe('Item 1');
|
|
116
|
+
expect(element1.getAttribute('data-id')).toBe('0.0.0');
|
|
117
|
+
expect(element2.textContent).toBe('Item 2');
|
|
118
|
+
expect(element2.getAttribute('data-id')).toBe('0.0.0(1)');
|
|
119
|
+
expect(element3.textContent).toBe('Item 3');
|
|
120
|
+
expect(element3.getAttribute('data-id')).toBe('0.0.0(2)');
|
|
121
|
+
// Shuffle the items: [3, 1, 2]
|
|
122
|
+
dataSignal.update((data) => {
|
|
123
|
+
return {
|
|
124
|
+
...data,
|
|
125
|
+
Variables: {
|
|
126
|
+
...data.Variables,
|
|
127
|
+
items: [item3, item1, item2],
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
// After update, elements should be shuffled but the same objects
|
|
132
|
+
expect(parentElement.children.length).toBe(3);
|
|
133
|
+
// Check text content first
|
|
134
|
+
expect(parentElement.children[0].textContent).toBe('Item 3');
|
|
135
|
+
expect(parentElement.children[1].textContent).toBe('Item 1');
|
|
136
|
+
expect(parentElement.children[2].textContent).toBe('Item 2');
|
|
137
|
+
// Check identities (do not use test-toBe for DOM nodes is annoying to compare and we are only interested in the reference match)
|
|
138
|
+
expect(parentElement.children[0] === element3).toBeTruthy();
|
|
139
|
+
expect(parentElement.children[0].getAttribute('data-id')).toBe(`0.0.0(2)`);
|
|
140
|
+
expect(parentElement.children[1] === element1).toBeTruthy();
|
|
141
|
+
expect(parentElement.children[1].getAttribute('data-id')).toBe(`0.0.0`);
|
|
142
|
+
expect(parentElement.children[2] === element2).toBeTruthy();
|
|
143
|
+
expect(parentElement.children[2].getAttribute('data-id')).toBe(`0.0.0(1)`);
|
|
144
|
+
// Remove last item in the list
|
|
145
|
+
dataSignal.update((data) => {
|
|
146
|
+
return {
|
|
147
|
+
...data,
|
|
148
|
+
Variables: {
|
|
149
|
+
...data.Variables,
|
|
150
|
+
items: [item3, item1],
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
expect(parentElement.children.length).toBe(2);
|
|
155
|
+
expect(parentElement.children[0] === element3).toBeTruthy();
|
|
156
|
+
expect(parentElement.children[0].getAttribute('data-id')).toBe(`0.0.0(2)`);
|
|
157
|
+
expect(parentElement.children[1] === element1).toBeTruthy();
|
|
158
|
+
expect(parentElement.children[1].getAttribute('data-id')).toBe(`0.0.0`);
|
|
159
|
+
// Make sure element 2 is removed from the DOM
|
|
160
|
+
expect(element2.parentElement === null).toBeTruthy();
|
|
161
|
+
// Should have cleaned the unused custom property from the stylesheet
|
|
162
|
+
expect(sheet?.cssRules.length).toBe(2);
|
|
163
|
+
// The rules should be correct for the remaining elements
|
|
164
|
+
expect(sheet?.cssRules[0].cssText).toBe('[data-id="0.0.0"] { --color: red; }');
|
|
165
|
+
expect(sheet?.cssRules[1].cssText).toBe('[data-id="0.0.0(2)"] { --color: red; }');
|
|
166
|
+
// Add the same item multiple times
|
|
167
|
+
dataSignal.update((data) => {
|
|
168
|
+
return {
|
|
169
|
+
...data,
|
|
170
|
+
Variables: {
|
|
171
|
+
...data.Variables,
|
|
172
|
+
items: [item3, item1, item3, item3],
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
// Should have 4 elements and each should have a different data-id, as a duplicate repeatKey should undo any reuse optimizations
|
|
177
|
+
expect(parentElement.children.length).toBe(4);
|
|
178
|
+
// Expect all data-ids to be unique
|
|
179
|
+
const dataIds = new Set();
|
|
180
|
+
for (const child of parentElement.children) {
|
|
181
|
+
const dataId = child.getAttribute('data-id');
|
|
182
|
+
expect(dataId).toBeTruthy();
|
|
183
|
+
expect(dataIds.has(dataId), `Duplicate data-id found: ${dataId}, all ids: ${[...parentElement.children].map((c) => c.getAttribute('data-id'))}`).toBeFalsy();
|
|
184
|
+
dataIds.add(dataId);
|
|
185
|
+
}
|
|
186
|
+
// Custom properties stylesheet should be cleaned up after all nodes are removed
|
|
187
|
+
dataSignal.destroy();
|
|
188
|
+
expect(sheet?.cssRules.length).toBe(0);
|
|
189
|
+
});
|
|
190
|
+
test('conditional nodes should remove and recreate elements on toggle', () => {
|
|
191
|
+
const parentElement = document.createElement('div');
|
|
192
|
+
document.body.appendChild(parentElement);
|
|
193
|
+
const dataSignal = signal({
|
|
194
|
+
Attributes: { show: true },
|
|
195
|
+
});
|
|
196
|
+
const ctx = {
|
|
197
|
+
isRootComponent: false,
|
|
198
|
+
component: {
|
|
199
|
+
name: 'My Component',
|
|
200
|
+
nodes: {
|
|
201
|
+
'conditional-node': {
|
|
202
|
+
type: 'element',
|
|
203
|
+
tag: 'div',
|
|
204
|
+
condition: { type: 'path', path: ['Attributes', 'show'] },
|
|
205
|
+
children: ['child-node'],
|
|
206
|
+
attrs: {},
|
|
207
|
+
events: {},
|
|
208
|
+
},
|
|
209
|
+
'child-node': {
|
|
210
|
+
type: 'text',
|
|
211
|
+
value: { type: 'value', value: 'Hello' },
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
root: document,
|
|
216
|
+
env: { runtime: 'page' },
|
|
217
|
+
formulaCache: {},
|
|
218
|
+
toddle: {
|
|
219
|
+
getCustomFormula: () => undefined,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
const nodes = createNode({
|
|
223
|
+
ctx,
|
|
224
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
225
|
+
dataSignal,
|
|
226
|
+
path: 'cond',
|
|
227
|
+
id: 'conditional-node',
|
|
228
|
+
parentElement,
|
|
229
|
+
instance: {},
|
|
230
|
+
});
|
|
231
|
+
parentElement.append(...nodes);
|
|
232
|
+
expect(parentElement.children.length).toBe(1);
|
|
233
|
+
const firstElement = parentElement.children[0];
|
|
234
|
+
expect(firstElement.textContent).toBe('Hello');
|
|
235
|
+
// Toggle off
|
|
236
|
+
dataSignal.update((data) => ({
|
|
237
|
+
...data,
|
|
238
|
+
Attributes: { ...data.Attributes, show: false },
|
|
239
|
+
}));
|
|
240
|
+
expect(parentElement.children.length).toBe(0);
|
|
241
|
+
expect(firstElement.parentElement).toBeNull();
|
|
242
|
+
// Toggle on again
|
|
243
|
+
dataSignal.update((data) => ({
|
|
244
|
+
...data,
|
|
245
|
+
Attributes: { ...data.Attributes, show: true },
|
|
246
|
+
}));
|
|
247
|
+
expect(parentElement.children.length).toBe(1);
|
|
248
|
+
const secondElement = parentElement.children[0];
|
|
249
|
+
expect(secondElement.textContent).toBe('Hello');
|
|
250
|
+
// Identity should be different because conditional nodes recreate on toggle
|
|
251
|
+
expect(secondElement === firstElement).toBeFalsy();
|
|
252
|
+
});
|
|
253
|
+
test('nested repeats should maintain node references for unchanged items', () => {
|
|
254
|
+
const parentElement = document.createElement('div');
|
|
255
|
+
document.body.appendChild(parentElement);
|
|
256
|
+
const itemA = {
|
|
257
|
+
id: 'A',
|
|
258
|
+
subItems: [
|
|
259
|
+
{ id: '1', val: 'A1' },
|
|
260
|
+
{ id: '2', val: 'A2' },
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
const itemB = {
|
|
264
|
+
id: 'B',
|
|
265
|
+
subItems: [
|
|
266
|
+
{ id: '3', val: 'B3' },
|
|
267
|
+
{ id: '4', val: 'B4' },
|
|
268
|
+
],
|
|
269
|
+
};
|
|
270
|
+
const dataSignal = signal({
|
|
271
|
+
Attributes: {},
|
|
272
|
+
Variables: {
|
|
273
|
+
items: [itemA, itemB],
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
const ctx = {
|
|
277
|
+
isRootComponent: false,
|
|
278
|
+
component: {
|
|
279
|
+
name: 'My Component',
|
|
280
|
+
nodes: {
|
|
281
|
+
'outer-repeat': {
|
|
282
|
+
type: 'element',
|
|
283
|
+
tag: 'div',
|
|
284
|
+
repeat: { type: 'path', path: ['Variables', 'items'] },
|
|
285
|
+
repeatKey: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
286
|
+
children: ['inner-repeat'],
|
|
287
|
+
attrs: {
|
|
288
|
+
class: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
289
|
+
},
|
|
290
|
+
events: {},
|
|
291
|
+
},
|
|
292
|
+
'inner-repeat': {
|
|
293
|
+
type: 'element',
|
|
294
|
+
tag: 'span',
|
|
295
|
+
repeat: { type: 'path', path: ['ListItem', 'Item', 'subItems'] },
|
|
296
|
+
repeatKey: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
297
|
+
children: ['text-node'],
|
|
298
|
+
attrs: {},
|
|
299
|
+
events: {},
|
|
300
|
+
},
|
|
301
|
+
'text-node': {
|
|
302
|
+
type: 'text',
|
|
303
|
+
value: { type: 'path', path: ['ListItem', 'Item', 'val'] },
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
root: document,
|
|
308
|
+
env: { runtime: 'page' },
|
|
309
|
+
formulaCache: {},
|
|
310
|
+
toddle: {
|
|
311
|
+
getCustomFormula: () => undefined,
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
const nodes = createNode({
|
|
315
|
+
ctx,
|
|
316
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
317
|
+
dataSignal,
|
|
318
|
+
path: 'nested',
|
|
319
|
+
id: 'outer-repeat',
|
|
320
|
+
parentElement,
|
|
321
|
+
instance: {},
|
|
322
|
+
});
|
|
323
|
+
parentElement.append(...nodes);
|
|
324
|
+
const outerA = parentElement.querySelector('.A');
|
|
325
|
+
const outerB = parentElement.querySelector('.B');
|
|
326
|
+
const innerA1 = outerA.children[0];
|
|
327
|
+
const innerB3 = outerB.children[0];
|
|
328
|
+
expect(innerA1.textContent).toBe('A1');
|
|
329
|
+
expect(innerB3.textContent).toBe('B3');
|
|
330
|
+
// Shuffle outer items
|
|
331
|
+
dataSignal.update((data) => ({
|
|
332
|
+
...data,
|
|
333
|
+
Variables: {
|
|
334
|
+
...data.Variables,
|
|
335
|
+
items: [itemB, itemA],
|
|
336
|
+
},
|
|
337
|
+
}));
|
|
338
|
+
expect(parentElement.children[0] === outerB).toBeTruthy();
|
|
339
|
+
expect(parentElement.children[1] === outerA).toBeTruthy();
|
|
340
|
+
// Inner items should still be the same objects
|
|
341
|
+
expect(outerB.children[0] === innerB3).toBeTruthy();
|
|
342
|
+
expect(outerA.children[0] === innerA1).toBeTruthy();
|
|
343
|
+
// Update subItems of B
|
|
344
|
+
const newItemB = {
|
|
345
|
+
...itemB,
|
|
346
|
+
subItems: [
|
|
347
|
+
{ id: '4', val: 'B4' },
|
|
348
|
+
{ id: '3', val: 'B3' },
|
|
349
|
+
],
|
|
350
|
+
};
|
|
351
|
+
dataSignal.update((data) => ({
|
|
352
|
+
...data,
|
|
353
|
+
Variables: {
|
|
354
|
+
...data.Variables,
|
|
355
|
+
items: [newItemB, itemA],
|
|
356
|
+
},
|
|
357
|
+
}));
|
|
358
|
+
// Outer B should still be same reference?
|
|
359
|
+
// Wait, createNode reuses by key. newItemB has same ID 'B'.
|
|
360
|
+
expect(parentElement.children[0] === outerB).toBeTruthy();
|
|
361
|
+
// Inner sequence of B should have changed, but inner elements preserved
|
|
362
|
+
expect(outerB.children[0].textContent).toBe('B4');
|
|
363
|
+
expect(outerB.children[1].textContent).toBe('B3');
|
|
364
|
+
expect(outerB.children[1] === innerB3).toBeTruthy();
|
|
365
|
+
});
|
|
366
|
+
test('repeat nodes should handle prepending items efficiently', () => {
|
|
367
|
+
const parentElement = document.createElement('div');
|
|
368
|
+
document.body.appendChild(parentElement);
|
|
369
|
+
const item2 = { id: '2' };
|
|
370
|
+
const item3 = { id: '3' };
|
|
371
|
+
const dataSignal = signal({
|
|
372
|
+
Attributes: {},
|
|
373
|
+
Variables: { items: [item2, item3] },
|
|
374
|
+
});
|
|
375
|
+
const ctx = {
|
|
376
|
+
isRootComponent: false,
|
|
377
|
+
component: {
|
|
378
|
+
name: 'My Component',
|
|
379
|
+
nodes: {
|
|
380
|
+
repeat: {
|
|
381
|
+
type: 'element',
|
|
382
|
+
tag: 'div',
|
|
383
|
+
repeat: { type: 'path', path: ['Variables', 'items'] },
|
|
384
|
+
repeatKey: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
385
|
+
children: ['text'],
|
|
386
|
+
attrs: {},
|
|
387
|
+
events: {},
|
|
388
|
+
},
|
|
389
|
+
text: {
|
|
390
|
+
type: 'text',
|
|
391
|
+
value: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
root: document,
|
|
396
|
+
env: { runtime: 'page' },
|
|
397
|
+
formulaCache: {},
|
|
398
|
+
toddle: { getCustomFormula: () => undefined },
|
|
399
|
+
};
|
|
400
|
+
const nodes = createNode({
|
|
401
|
+
ctx,
|
|
402
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
403
|
+
dataSignal,
|
|
404
|
+
path: 'prepend',
|
|
405
|
+
id: 'repeat',
|
|
406
|
+
parentElement,
|
|
407
|
+
instance: {},
|
|
408
|
+
});
|
|
409
|
+
parentElement.append(...nodes);
|
|
410
|
+
const el2 = parentElement.children[0];
|
|
411
|
+
const el3 = parentElement.children[1];
|
|
412
|
+
// Prepend item 1
|
|
413
|
+
const item1 = { id: '1' };
|
|
414
|
+
dataSignal.update((data) => ({
|
|
415
|
+
...data,
|
|
416
|
+
Variables: { ...data.Variables, items: [item1, item2, item3] },
|
|
417
|
+
}));
|
|
418
|
+
expect(parentElement.children.length).toBe(3);
|
|
419
|
+
expect(parentElement.children[0].textContent).toBe('1');
|
|
420
|
+
expect(parentElement.children[1] === el2).toBeTruthy();
|
|
421
|
+
expect(parentElement.children[2] === el3).toBeTruthy();
|
|
422
|
+
});
|
|
423
|
+
test('repeat nodes with duplicate keys should still render all items but without reuse optimizations', () => {
|
|
424
|
+
const parentElement = document.createElement('div');
|
|
425
|
+
document.body.appendChild(parentElement);
|
|
426
|
+
const item1 = { id: 'i1', name: 'Item 1' };
|
|
427
|
+
const item2 = { id: 'i2', name: 'Item 2' };
|
|
428
|
+
const item3 = { id: 'i3', name: 'Item 3' };
|
|
429
|
+
const dataSignal = signal({
|
|
430
|
+
Attributes: {},
|
|
431
|
+
Variables: {
|
|
432
|
+
items: [],
|
|
433
|
+
},
|
|
434
|
+
});
|
|
435
|
+
const ctx = {
|
|
436
|
+
isRootComponent: false,
|
|
437
|
+
component: {
|
|
438
|
+
name: 'My Component',
|
|
439
|
+
nodes: {
|
|
440
|
+
repeat: {
|
|
441
|
+
type: 'element',
|
|
442
|
+
tag: 'div',
|
|
443
|
+
repeat: { type: 'path', path: ['Variables', 'items'] },
|
|
444
|
+
repeatKey: { type: 'path', path: ['ListItem', 'Item', 'id'] },
|
|
445
|
+
children: ['text'],
|
|
446
|
+
attrs: {},
|
|
447
|
+
events: {},
|
|
448
|
+
},
|
|
449
|
+
text: {
|
|
450
|
+
type: 'text',
|
|
451
|
+
value: { type: 'path', path: ['ListItem', 'Item', 'name'] },
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
root: document,
|
|
456
|
+
env: { runtime: 'page' },
|
|
457
|
+
formulaCache: {},
|
|
458
|
+
toddle: { getCustomFormula: () => undefined },
|
|
459
|
+
};
|
|
460
|
+
const nodes = createNode({
|
|
461
|
+
ctx,
|
|
462
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
463
|
+
dataSignal,
|
|
464
|
+
id: 'repeat',
|
|
465
|
+
path: '0',
|
|
466
|
+
instance: {},
|
|
467
|
+
parentElement,
|
|
468
|
+
});
|
|
469
|
+
parentElement.append(...nodes);
|
|
470
|
+
// Update with duplicate keys
|
|
471
|
+
dataSignal.update((data) => ({
|
|
472
|
+
...data,
|
|
473
|
+
Variables: { ...data.Variables, items: [item1] },
|
|
474
|
+
}));
|
|
475
|
+
expect(parentElement.children.length).toBe(1);
|
|
476
|
+
expect(parentElement.children[0].textContent).toBe('Item 1');
|
|
477
|
+
// Update with all items, including duplicate key
|
|
478
|
+
dataSignal.update((data) => ({
|
|
479
|
+
...data,
|
|
480
|
+
Variables: { ...data.Variables, items: [item1, item2] },
|
|
481
|
+
}));
|
|
482
|
+
dataSignal.update((data) => ({
|
|
483
|
+
...data,
|
|
484
|
+
Variables: { ...data.Variables, items: [item1, item2, item3] },
|
|
485
|
+
}));
|
|
486
|
+
expect(parentElement.children.length).toBe(3);
|
|
487
|
+
expect(parentElement.children[0].textContent).toBe('Item 1');
|
|
488
|
+
expect(parentElement.children[1].textContent).toBe('Item 2');
|
|
489
|
+
expect(parentElement.children[2].textContent).toBe('Item 3');
|
|
490
|
+
expect(parentElement.children[0].getAttribute('data-id')).toBe('0');
|
|
491
|
+
expect(parentElement.children[1].getAttribute('data-id')).toBe('0(1)');
|
|
492
|
+
expect(parentElement.children[2].getAttribute('data-id')).toBe('0(2)');
|
|
493
|
+
});
|
|
494
|
+
test('it should have correct order of custom properties overrides if a component root has deep instance styling', () => {
|
|
495
|
+
const parentElement = document.createElement('div');
|
|
496
|
+
document.body.appendChild(parentElement);
|
|
497
|
+
const outermostColor = 'red';
|
|
498
|
+
const middleColor = 'blue';
|
|
499
|
+
const innermostColor = 'green';
|
|
500
|
+
const ctx = {
|
|
501
|
+
isRootComponent: false,
|
|
502
|
+
component: {
|
|
503
|
+
name: 'My_Component',
|
|
504
|
+
nodes: {
|
|
505
|
+
root: {
|
|
506
|
+
type: 'component',
|
|
507
|
+
attrs: {},
|
|
508
|
+
events: {},
|
|
509
|
+
children: [],
|
|
510
|
+
name: 'first_wrapper',
|
|
511
|
+
customProperties: {
|
|
512
|
+
'--color': {
|
|
513
|
+
syntax: {
|
|
514
|
+
type: 'primitive',
|
|
515
|
+
name: 'color',
|
|
516
|
+
},
|
|
517
|
+
formula: {
|
|
518
|
+
type: 'value',
|
|
519
|
+
value: 'red',
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
root: document,
|
|
527
|
+
formulaCache: {},
|
|
528
|
+
env: { runtime: 'preview' },
|
|
529
|
+
stores: {
|
|
530
|
+
theme: signal(null),
|
|
531
|
+
},
|
|
532
|
+
components: [
|
|
533
|
+
{
|
|
534
|
+
name: 'first_wrapper',
|
|
535
|
+
nodes: {
|
|
536
|
+
root: {
|
|
537
|
+
type: 'component',
|
|
538
|
+
attrs: {},
|
|
539
|
+
events: {},
|
|
540
|
+
children: [],
|
|
541
|
+
name: 'second_wrapper',
|
|
542
|
+
customProperties: {
|
|
543
|
+
'--color': {
|
|
544
|
+
syntax: {
|
|
545
|
+
type: 'primitive',
|
|
546
|
+
name: 'color',
|
|
547
|
+
},
|
|
548
|
+
formula: {
|
|
549
|
+
type: 'value',
|
|
550
|
+
value: 'blue',
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: 'second_wrapper',
|
|
559
|
+
nodes: {
|
|
560
|
+
root: {
|
|
561
|
+
type: 'element',
|
|
562
|
+
tag: 'div',
|
|
563
|
+
children: ['text-node'],
|
|
564
|
+
attrs: {},
|
|
565
|
+
events: {},
|
|
566
|
+
customProperties: {
|
|
567
|
+
'--color': {
|
|
568
|
+
syntax: {
|
|
569
|
+
type: 'primitive',
|
|
570
|
+
name: 'color',
|
|
571
|
+
},
|
|
572
|
+
formula: {
|
|
573
|
+
type: 'value',
|
|
574
|
+
value: 'green',
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
'text-node': {
|
|
580
|
+
type: 'text',
|
|
581
|
+
value: { type: 'value', value: 'Hello' },
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
],
|
|
586
|
+
};
|
|
587
|
+
createNode({
|
|
588
|
+
ctx,
|
|
589
|
+
namespace: 'http://www.w3.org/1999/xhtml',
|
|
590
|
+
dataSignal: signal({
|
|
591
|
+
Attributes: {},
|
|
592
|
+
Variables: {},
|
|
593
|
+
}),
|
|
594
|
+
path: '0',
|
|
595
|
+
id: 'root',
|
|
596
|
+
parentElement,
|
|
597
|
+
instance: {},
|
|
598
|
+
});
|
|
599
|
+
const sheet = customPropertiesStylesheet?.getStyleSheet();
|
|
600
|
+
// Test that the order makes sense
|
|
601
|
+
expect(Array.from(sheet?.cssRules ?? []).map((r) => r.cssText)).toEqual([
|
|
602
|
+
`[data-id="0"] { --color: ${innermostColor}; }`,
|
|
603
|
+
`[data-id="0"].first_wrapper\\:root { --color: ${middleColor}; }`,
|
|
604
|
+
`[data-id="0"].My_Component\\:root { --color: ${outermostColor}; }`,
|
|
605
|
+
]);
|
|
606
|
+
});
|
|
607
|
+
});
|
|
608
|
+
//# sourceMappingURL=createNode.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createNode.test.js","sourceRoot":"","sources":["../../../src/components/createNode.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,gBAAgB,CAAA;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC;IAC7B,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,KAAK,GAAG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,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,KAAK,GAAG,0BAA0B,EAAE,aAAa,EAAE,CAAA;QACzD,kCAAkC;QAClC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;YACtE,4BAA4B,cAAc,KAAK;YAC/C,iDAAiD,WAAW,KAAK;YACjE,gDAAgD,cAAc,KAAK;SACpE,CAAC,CAAA;IAAA,CACH,CAAC,CAAA;AAAA,CACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isDefined } from '@nordcraft/core/dist/utils/util';
|
|
2
|
+
export const getDynamicMetaEntries = (meta) => {
|
|
3
|
+
if (!meta) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const dynamicMetaEntries = {};
|
|
7
|
+
for (const key in meta) {
|
|
8
|
+
const entry = meta[key];
|
|
9
|
+
if (isDefined(entry.content) && entry.content.type !== 'value') {
|
|
10
|
+
dynamicMetaEntries[key] = entry;
|
|
11
|
+
}
|
|
12
|
+
else if (Object.values(entry.attrs ?? {}).some((a) => a.type !== 'value')) {
|
|
13
|
+
dynamicMetaEntries[key] = entry;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return dynamicMetaEntries;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/meta.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAA0C,EACf,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,kBAAkB,GAA8B,EAAE,CAAA;IACxD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACvB,IAAI,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC/D,kBAAkB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACjC,CAAC;aAAM,IACL,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAChE,CAAC;YACD,kBAAkB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACjC,CAAC;IACH,CAAC;IACD,OAAO,kBAAkB,CAAA;AAAA,CAC1B,CAAA"}
|