@vidact/runtime 0.2.0-beta.0 → 0.2.0-beta.4
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/CHANGELOG.md +37 -0
- package/README.md +1 -1
- package/dist/actions.d.ts +32 -30
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +251 -266
- package/dist/actions.js.map +1 -1
- package/dist/async.d.ts +20 -17
- package/dist/async.d.ts.map +1 -1
- package/dist/async.js +18 -17
- package/dist/async.js.map +1 -1
- package/dist/compiled/async-resource.d.ts +9 -6
- package/dist/compiled/async-resource.d.ts.map +1 -1
- package/dist/compiled/async-resource.js +69 -77
- package/dist/compiled/async-resource.js.map +1 -1
- package/dist/compiled/core.d.ts +136 -147
- package/dist/compiled/core.d.ts.map +1 -1
- package/dist/compiled/core.js +2669 -2985
- package/dist/compiled/core.js.map +1 -1
- package/dist/compiled/types.d.ts +44 -56
- package/dist/compiled/types.d.ts.map +1 -1
- package/dist/compiled/types.js +10 -6
- package/dist/compiled/types.js.map +1 -1
- package/dist/compiled/validation.d.ts +4 -1
- package/dist/compiled/validation.d.ts.map +1 -1
- package/dist/compiled/validation.js +17 -20
- package/dist/compiled/validation.js.map +1 -1
- package/dist/component-spread.d.ts +5 -3
- package/dist/component-spread.d.ts.map +1 -1
- package/dist/component-spread.js +49 -67
- package/dist/component-spread.js.map +1 -1
- package/dist/concurrent.d.ts +20 -18
- package/dist/concurrent.d.ts.map +1 -1
- package/dist/concurrent.js +191 -210
- package/dist/concurrent.js.map +1 -1
- package/dist/direct-dom.d.ts +17 -12
- package/dist/direct-dom.d.ts.map +1 -1
- package/dist/direct-dom.js +187 -221
- package/dist/direct-dom.js.map +1 -1
- package/dist/dom/attributes.d.ts +9 -6
- package/dist/dom/attributes.d.ts.map +1 -1
- package/dist/dom/attributes.js +65 -47
- package/dist/dom/attributes.js.map +1 -1
- package/dist/dom/events.d.ts +5 -2
- package/dist/dom/events.d.ts.map +1 -1
- package/dist/dom/events.js +53 -65
- package/dist/dom/events.js.map +1 -1
- package/dist/dom/forms.d.ts +9 -6
- package/dist/dom/forms.d.ts.map +1 -1
- package/dist/dom/forms.js +152 -198
- package/dist/dom/forms.js.map +1 -1
- package/dist/dom/intrinsic.d.ts +17 -15
- package/dist/dom/intrinsic.d.ts.map +1 -1
- package/dist/dom/intrinsic.js +48 -50
- package/dist/dom/intrinsic.js.map +1 -1
- package/dist/dom/namespace.d.ts +4 -1
- package/dist/dom/namespace.d.ts.map +1 -1
- package/dist/dom/namespace.js +25 -28
- package/dist/dom/namespace.js.map +1 -1
- package/dist/dom/namespaces.d.ts +11 -8
- package/dist/dom/namespaces.d.ts.map +1 -1
- package/dist/dom/namespaces.js +14 -12
- package/dist/dom/namespaces.js.map +1 -1
- package/dist/dom/properties.d.ts +18 -16
- package/dist/dom/properties.d.ts.map +1 -1
- package/dist/dom/properties.js +273 -296
- package/dist/dom/properties.js.map +1 -1
- package/dist/dom/style-properties.d.ts +4 -1
- package/dist/dom/style-properties.d.ts.map +1 -1
- package/dist/dom/style-properties.js +49 -45
- package/dist/dom/style-properties.js.map +1 -1
- package/dist/dom/styles.d.ts +5 -2
- package/dist/dom/styles.d.ts.map +1 -1
- package/dist/dom/styles.js +47 -67
- package/dist/dom/styles.js.map +1 -1
- package/dist/dom-forms.d.ts +4 -1
- package/dist/dom-forms.d.ts.map +1 -1
- package/dist/dom-forms.js +16 -13
- package/dist/dom-forms.js.map +1 -1
- package/dist/dom-styles.d.ts +4 -1
- package/dist/dom-styles.d.ts.map +1 -1
- package/dist/dom-styles.js +10 -7
- package/dist/dom-styles.js.map +1 -1
- package/dist/framework-hydrate.d.ts +20 -17
- package/dist/framework-hydrate.d.ts.map +1 -1
- package/dist/framework-hydrate.js +128 -146
- package/dist/framework-hydrate.js.map +1 -1
- package/dist/framework-protocol.d.ts +27 -25
- package/dist/framework-protocol.d.ts.map +1 -1
- package/dist/framework-protocol.js +173 -211
- package/dist/framework-protocol.js.map +1 -1
- package/dist/framework.d.ts +34 -32
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +74 -93
- package/dist/framework.js.map +1 -1
- package/dist/hydrate.d.ts +11 -8
- package/dist/hydrate.d.ts.map +1 -1
- package/dist/hydrate.js +13 -9
- package/dist/hydrate.js.map +1 -1
- package/dist/hydration-bridge.d.ts +61 -58
- package/dist/hydration-bridge.d.ts.map +1 -1
- package/dist/hydration-bridge.js +67 -66
- package/dist/hydration-bridge.js.map +1 -1
- package/dist/hydration.d.ts +31 -28
- package/dist/hydration.d.ts.map +1 -1
- package/dist/hydration.js +376 -462
- package/dist/hydration.js.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +11 -13
- package/dist/indexed-list.d.ts +8 -5
- package/dist/indexed-list.d.ts.map +1 -1
- package/dist/indexed-list.js +14 -7
- package/dist/indexed-list.js.map +1 -1
- package/dist/jsx-runtime.d.ts +10 -8
- package/dist/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx-runtime.js +28 -23
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/keyed-list.d.ts +13 -14
- package/dist/keyed-list.d.ts.map +1 -1
- package/dist/keyed-list.js +132 -160
- package/dist/keyed-list.js.map +1 -1
- package/dist/metadata.d.ts +6 -3
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +131 -164
- package/dist/metadata.js.map +1 -1
- package/dist/nested-prop.d.ts +4 -2
- package/dist/nested-prop.d.ts.map +1 -1
- package/dist/nested-prop.js +17 -16
- package/dist/nested-prop.js.map +1 -1
- package/dist/profiling.d.ts +11 -8
- package/dist/profiling.d.ts.map +1 -1
- package/dist/profiling.js +17 -17
- package/dist/profiling.js.map +1 -1
- package/dist/protocol.d.ts +5 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +8 -5
- package/dist/protocol.js.map +1 -1
- package/dist/raw-html.d.ts +5 -2
- package/dist/raw-html.d.ts.map +1 -1
- package/dist/raw-html.js +86 -146
- package/dist/raw-html.js.map +1 -1
- package/dist/ref.d.ts +8 -3
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +10 -2
- package/dist/ref.js.map +1 -1
- package/dist/renderable-protocol.d.ts +26 -8
- package/dist/renderable-protocol.d.ts.map +1 -1
- package/dist/renderable-protocol.js +30 -9
- package/dist/renderable-protocol.js.map +1 -1
- package/dist/renderable.d.ts +27 -22
- package/dist/renderable.d.ts.map +1 -1
- package/dist/renderable.js +141 -133
- package/dist/renderable.js.map +1 -1
- package/dist/retained-ui.d.ts +9 -6
- package/dist/retained-ui.d.ts.map +1 -1
- package/dist/retained-ui.js +12 -10
- package/dist/retained-ui.js.map +1 -1
- package/dist/root.d.ts +18 -15
- package/dist/root.d.ts.map +1 -1
- package/dist/root.js +73 -85
- package/dist/root.js.map +1 -1
- package/dist/scheduler.d.ts +10 -8
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +97 -105
- package/dist/scheduler.js.map +1 -1
- package/dist/server-framework.d.ts +45 -42
- package/dist/server-framework.d.ts.map +1 -1
- package/dist/server-framework.js +209 -217
- package/dist/server-framework.js.map +1 -1
- package/dist/server.d.ts +130 -128
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +592 -706
- package/dist/server.js.map +1 -1
- package/dist/shared/promise.d.ts +6 -3
- package/dist/shared/promise.d.ts.map +1 -1
- package/dist/shared/promise.js +21 -19
- package/dist/shared/promise.js.map +1 -1
- package/dist/source-mask.d.ts +9 -6
- package/dist/source-mask.d.ts.map +1 -1
- package/dist/source-mask.js +45 -63
- package/dist/source-mask.js.map +1 -1
- package/dist/spread.d.ts +5 -2
- package/dist/spread.d.ts.map +1 -1
- package/dist/spread.js +79 -99
- package/dist/spread.js.map +1 -1
- package/dist/state-slot.d.ts +18 -15
- package/dist/state-slot.d.ts.map +1 -1
- package/dist/state-slot.js +43 -42
- package/dist/state-slot.js.map +1 -1
- package/dist/testing.d.ts +9 -6
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +16 -12
- package/dist/testing.js.map +1 -1
- package/package.json +8 -7
- package/src/actions.ts +415 -0
- package/src/async.ts +78 -0
- package/src/compiled/async-resource.ts +113 -0
- package/src/compiled/core.ts +4026 -0
- package/src/compiled/types.ts +96 -0
- package/src/compiled/validation.ts +23 -0
- package/src/component-spread.ts +86 -0
- package/src/concurrent.ts +310 -0
- package/src/direct-dom.ts +365 -0
- package/src/dom/attributes.ts +55 -0
- package/src/dom/events.ts +93 -0
- package/src/dom/forms.ts +220 -0
- package/src/dom/intrinsic.ts +94 -0
- package/src/dom/namespace.ts +30 -0
- package/src/dom/namespaces.ts +14 -0
- package/src/dom/properties.ts +355 -0
- package/src/dom/style-properties.ts +46 -0
- package/src/dom/styles.ts +86 -0
- package/src/dom-forms.ts +23 -0
- package/src/dom-styles.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/framework-hydrate.ts +224 -0
- package/src/framework-protocol.ts +335 -0
- package/src/framework.ts +161 -0
- package/src/hydrate.ts +38 -0
- package/src/hydration-bridge.ts +183 -0
- package/src/hydration.ts +556 -0
- package/src/index.ts +92 -0
- package/src/indexed-list.ts +20 -0
- package/src/jsx-runtime.ts +55 -0
- package/src/keyed-list.ts +233 -0
- package/src/metadata.ts +212 -0
- package/src/nested-prop.ts +27 -0
- package/src/profiling.ts +43 -0
- package/src/protocol.ts +8 -0
- package/src/raw-html.ts +206 -0
- package/src/ref.ts +13 -0
- package/src/renderable-protocol.ts +63 -0
- package/src/renderable.ts +283 -0
- package/src/retained-ui.ts +19 -0
- package/src/root.ts +122 -0
- package/src/scheduler.ts +136 -0
- package/src/server-framework.ts +397 -0
- package/src/server.ts +1143 -0
- package/src/shared/promise.ts +28 -0
- package/src/source-mask.ts +83 -0
- package/src/spread.ts +131 -0
- package/src/state-slot.ts +76 -0
- package/src/testing.ts +27 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/keyed-list.js
CHANGED
|
@@ -1,180 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const currentParent = end.parentNode;
|
|
96
|
-
const cleanup = currentParent === null
|
|
97
|
-
? [undefined, false]
|
|
98
|
-
: disposeRecords(currentParent, records);
|
|
99
|
-
records = [];
|
|
100
|
-
start.remove();
|
|
101
|
-
end.remove();
|
|
102
|
-
if (cleanup[1])
|
|
103
|
-
throw cleanup[0];
|
|
104
|
-
};
|
|
105
|
-
return { dispose, parent: () => end.parentNode, update };
|
|
1
|
+
import { claimHydrationArrayRange, finishHydrationArrayRange, withHydrationInsertion } from "./hydration-bridge.js";
|
|
2
|
+
//#region src/keyed-list.ts
|
|
3
|
+
const DEV = typeof __VIDACT_DEV__ === "undefined" || __VIDACT_DEV__;
|
|
4
|
+
function createKeyedList(parent, options, before = null) {
|
|
5
|
+
const hydratedRange = claimHydrationArrayRange(parent);
|
|
6
|
+
const start = hydratedRange?.[0] ?? document.createComment(DEV ? "vidact:list" : "");
|
|
7
|
+
const end = hydratedRange?.[1] ?? document.createComment(DEV ? "/vidact:list" : "");
|
|
8
|
+
if (hydratedRange === void 0) {
|
|
9
|
+
parent.insertBefore(start, before);
|
|
10
|
+
parent.insertBefore(end, before);
|
|
11
|
+
}
|
|
12
|
+
let disposed = false;
|
|
13
|
+
let hydrationPending = hydratedRange !== void 0;
|
|
14
|
+
let records = [];
|
|
15
|
+
const update = (values) => {
|
|
16
|
+
if (disposed) throw new Error(DEV ? "cannot update a disposed keyed list" : "V801");
|
|
17
|
+
const currentParent = end.parentNode;
|
|
18
|
+
if (currentParent === null || start.parentNode !== currentParent) throw new Error(DEV ? "cannot update a detached keyed list" : "V802");
|
|
19
|
+
const keys = values.map(options.key);
|
|
20
|
+
assertValidKeys(keys);
|
|
21
|
+
assertUniqueKeys(keys);
|
|
22
|
+
const previousByKey = /* @__PURE__ */ new Map();
|
|
23
|
+
for (const record of records) previousByKey.set(record[0], record);
|
|
24
|
+
const created = [];
|
|
25
|
+
const retained = [];
|
|
26
|
+
let nextRecords;
|
|
27
|
+
try {
|
|
28
|
+
nextRecords = values.map((value, index) => {
|
|
29
|
+
const key = keys[index];
|
|
30
|
+
const previous = previousByKey.get(key);
|
|
31
|
+
if (previous !== void 0) {
|
|
32
|
+
previousByKey.delete(key);
|
|
33
|
+
retained.push([
|
|
34
|
+
previous,
|
|
35
|
+
value,
|
|
36
|
+
index
|
|
37
|
+
]);
|
|
38
|
+
return previous;
|
|
39
|
+
}
|
|
40
|
+
const item = normalizeRenderResult(withHydrationInsertion(parent, end, () => options.render(value, index)));
|
|
41
|
+
const record = [
|
|
42
|
+
key,
|
|
43
|
+
item[0],
|
|
44
|
+
item[1],
|
|
45
|
+
item[2]
|
|
46
|
+
];
|
|
47
|
+
created.push(record);
|
|
48
|
+
return record;
|
|
49
|
+
});
|
|
50
|
+
for (const [record, value, index] of retained) record[2]?.(value, index);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
disposeRecords(currentParent, created);
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
const cleanup = disposeRecords(currentParent, previousByKey.values());
|
|
56
|
+
const activeElement = document.activeElement instanceof HTMLElement && currentParent.contains(document.activeElement) ? document.activeElement : null;
|
|
57
|
+
const selectionControl = activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement ? activeElement : null;
|
|
58
|
+
const selection = selectionControl === null ? null : [selectionControl.selectionStart, selectionControl.selectionEnd];
|
|
59
|
+
let cursor = end;
|
|
60
|
+
for (let recordIndex = nextRecords.length - 1; recordIndex >= 0; recordIndex -= 1) {
|
|
61
|
+
const record = nextRecords[recordIndex];
|
|
62
|
+
for (let nodeIndex = record[1].length - 1; nodeIndex >= 0; nodeIndex -= 1) {
|
|
63
|
+
const node = record[1][nodeIndex];
|
|
64
|
+
if (node.nextSibling !== cursor) moveBefore(currentParent, node, cursor);
|
|
65
|
+
cursor = node;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (activeElement !== null && document.activeElement !== activeElement && currentParent.contains(activeElement)) {
|
|
69
|
+
activeElement.focus({ preventScroll: true });
|
|
70
|
+
if (selectionControl !== null && selection !== null && selection[0] !== null && selection[1] !== null) selectionControl.setSelectionRange(selection[0], selection[1]);
|
|
71
|
+
}
|
|
72
|
+
records = nextRecords;
|
|
73
|
+
if (hydrationPending) {
|
|
74
|
+
hydrationPending = false;
|
|
75
|
+
finishHydrationArrayRange(currentParent, end);
|
|
76
|
+
}
|
|
77
|
+
if (cleanup[1]) throw cleanup[0];
|
|
78
|
+
return created.flatMap((record) => record[1]);
|
|
79
|
+
};
|
|
80
|
+
const dispose = () => {
|
|
81
|
+
if (disposed) return;
|
|
82
|
+
disposed = true;
|
|
83
|
+
const currentParent = end.parentNode;
|
|
84
|
+
const cleanup = currentParent === null ? [void 0, false] : disposeRecords(currentParent, records);
|
|
85
|
+
records = [];
|
|
86
|
+
start.remove();
|
|
87
|
+
end.remove();
|
|
88
|
+
if (cleanup[1]) throw cleanup[0];
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
dispose,
|
|
92
|
+
parent: () => end.parentNode,
|
|
93
|
+
update
|
|
94
|
+
};
|
|
106
95
|
}
|
|
107
96
|
function moveBefore(parent, node, before) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
parent.insertBefore(node, before);
|
|
114
|
-
}
|
|
97
|
+
const statePreservingParent = parent;
|
|
98
|
+
if (statePreservingParent.moveBefore !== void 0 && node.parentNode === parent) statePreservingParent.moveBefore(node, before);
|
|
99
|
+
else parent.insertBefore(node, before);
|
|
115
100
|
}
|
|
116
101
|
function assertValidKeys(keys) {
|
|
117
|
-
|
|
118
|
-
if (typeof key !== 'string' && typeof key !== 'number' && typeof key !== 'bigint') {
|
|
119
|
-
throw new Error(DEV ? `invalid key in keyed list: ${String(key)}` : 'V803');
|
|
120
|
-
}
|
|
121
|
-
}
|
|
102
|
+
for (const key of keys) if (typeof key !== "string" && typeof key !== "number" && typeof key !== "bigint") throw new Error(DEV ? `invalid key in keyed list: ${String(key)}` : "V803");
|
|
122
103
|
}
|
|
123
104
|
function assertUniqueKeys(keys) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
seen.add(key);
|
|
130
|
-
}
|
|
105
|
+
const seen = /* @__PURE__ */ new Set();
|
|
106
|
+
for (const key of keys) {
|
|
107
|
+
if (seen.has(key)) throw new Error(DEV ? `duplicate key in keyed list: ${String(key)}` : "V804");
|
|
108
|
+
seen.add(key);
|
|
109
|
+
}
|
|
131
110
|
}
|
|
132
111
|
function normalizeRenderResult(result) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
112
|
+
if (isNode(result)) return [normalizeNodes([result])];
|
|
113
|
+
if (isNodeArray(result)) return [normalizeNodes(result)];
|
|
114
|
+
return [
|
|
115
|
+
normalizeNodes(result[0]),
|
|
116
|
+
result[1],
|
|
117
|
+
result[2]
|
|
118
|
+
];
|
|
138
119
|
}
|
|
139
120
|
function normalizeNodes(nodes) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
normalized.push(node);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return normalized.length === 0 ? [document.createComment(DEV ? 'vidact:empty' : '')] : normalized;
|
|
121
|
+
const normalized = [];
|
|
122
|
+
for (const node of nodes) if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) normalized.push(...node.childNodes);
|
|
123
|
+
else normalized.push(node);
|
|
124
|
+
return normalized.length === 0 ? [document.createComment(DEV ? "vidact:empty" : "")] : normalized;
|
|
150
125
|
}
|
|
151
126
|
function isNode(value) {
|
|
152
|
-
|
|
127
|
+
return typeof value === "object" && value !== null && "nodeType" in value;
|
|
153
128
|
}
|
|
154
129
|
function isNodeArray(value) {
|
|
155
|
-
|
|
130
|
+
return Array.isArray(value) && (value.length === 0 || isNode(value[0]));
|
|
156
131
|
}
|
|
157
132
|
function removeNodes(parent, nodes) {
|
|
158
|
-
|
|
159
|
-
if (node.parentNode === parent)
|
|
160
|
-
parent.removeChild(node);
|
|
161
|
-
}
|
|
133
|
+
for (const node of nodes) if (node.parentNode === parent) parent.removeChild(node);
|
|
162
134
|
}
|
|
163
135
|
function disposeRecords(parent, records) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
return [firstError, failed];
|
|
136
|
+
let firstError;
|
|
137
|
+
let failed = false;
|
|
138
|
+
for (const record of records) {
|
|
139
|
+
removeNodes(parent, record[1]);
|
|
140
|
+
try {
|
|
141
|
+
record[3]?.();
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (!failed) firstError = error;
|
|
144
|
+
failed = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return [firstError, failed];
|
|
178
148
|
}
|
|
179
|
-
|
|
149
|
+
//#endregion
|
|
150
|
+
export { createKeyedList };
|
|
151
|
+
|
|
180
152
|
//# sourceMappingURL=keyed-list.js.map
|
package/dist/keyed-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyed-list.js","
|
|
1
|
+
{"version":3,"file":"keyed-list.js","names":[],"sources":["../src/keyed-list.ts"],"mappings":";;AA0BA,MAAM,MAAM,OAAO,mBAAmB,eAAe;AAErD,SAAgB,gBACd,QACA,SACA,SAAsB,MACR;CACd,MAAM,gBAAgB,yBAAyB,MAAM;CACrD,MAAM,QAAQ,gBAAgB,MAAM,SAAS,cAAc,MAAM,gBAAgB,EAAE;CACnF,MAAM,MAAM,gBAAgB,MAAM,SAAS,cAAc,MAAM,iBAAiB,EAAE;CAClF,IAAI,kBAAkB,KAAA,GAAW;EAC/B,OAAO,aAAa,OAAO,MAAM;EACjC,OAAO,aAAa,KAAK,MAAM;CACjC;CAEA,IAAI,WAAW;CACf,IAAI,mBAAmB,kBAAkB,KAAA;CACzC,IAAI,UAAwC,CAAC;CAE7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,SAAS;CACb,KAAK,MAAM,UAAU,SAAS;EAC5B,YAAY,QAAQ,OAAO,EAAE;EAC7B,IAAI;GACF,OAAO,EAAE,GAAG;EACd,SAAS,OAAO;GACd,IAAI,CAAC,QAAQ,aAAa;GAC1B,SAAS;EACX;CACF;CACA,OAAO,CAAC,YAAY,MAAM;AAC5B"}
|
package/dist/metadata.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/metadata.d.ts
|
|
2
|
+
declare function installFrameworkMetadataPropRekeying(): void;
|
|
3
|
+
declare function isFrameworkMetadataElement(element: Element, props?: Readonly<Record<string, unknown>> | null): boolean;
|
|
4
|
+
declare function hoistFrameworkMetadata(element: Element): DocumentFragment;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { hoistFrameworkMetadata, installFrameworkMetadataPropRekeying, isFrameworkMetadataElement };
|
|
4
7
|
//# sourceMappingURL=metadata.d.ts.map
|
package/dist/metadata.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","names":[],"sources":["../src/metadata.ts"],"mappings":";iBA6BgB;iBAiBA,2BACd,SAAS,SACT,QAAO,SAAS;iBAuBF,uBAAuB,SAAS,UAAU"}
|