@niscorp/nova 0.2.1 → 0.3.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/CHANGELOG.md +64 -0
- package/dist/adapters/dom/components/index.cjs +4 -51
- package/dist/adapters/dom/components/index.cjs.map +1 -1
- package/dist/adapters/dom/index.cjs +22 -686
- package/dist/adapters/dom/index.cjs.map +1 -1
- package/dist/adapters/dom/index.js +3 -3
- package/dist/adapters/dom/server.cjs +14 -411
- package/dist/adapters/dom/server.cjs.map +1 -1
- package/dist/adapters/dom/server.js +3 -3
- package/dist/adapters/react/components/index.cjs +87 -562
- package/dist/adapters/react/components/index.cjs.map +1 -1
- package/dist/adapters/react/components/index.js +4 -4
- package/dist/adapters/react/index.cjs +97 -1815
- package/dist/adapters/react/index.cjs.map +1 -1
- package/dist/adapters/react/index.js +4 -4
- package/dist/adapters/tty/components/index.cjs +3 -44
- package/dist/adapters/tty/components/index.cjs.map +1 -1
- package/dist/adapters/tty/index.cjs +13 -5
- package/dist/adapters/tty/index.cjs.map +1 -1
- package/dist/adapters/tty/index.js +2 -2
- package/dist/adapters/vue/components/index.cjs +88 -639
- package/dist/adapters/vue/components/index.cjs.map +1 -1
- package/dist/adapters/vue/components/index.js +4 -4
- package/dist/adapters/vue/index.cjs +96 -962
- package/dist/adapters/vue/index.cjs.map +1 -1
- package/dist/adapters/vue/index.js +5 -5
- package/dist/agent/index.cjs +13 -151
- package/dist/agent/index.cjs.map +1 -1
- package/dist/chunk-5YQIAS4V.cjs +184 -0
- package/dist/chunk-5YQIAS4V.cjs.map +1 -0
- package/dist/{chunk-F2H7WP6R.js → chunk-7MATRNZZ.js} +5 -5
- package/dist/{chunk-F2H7WP6R.js.map → chunk-7MATRNZZ.js.map} +1 -1
- package/dist/chunk-AGEAMUQR.cjs +436 -0
- package/dist/chunk-AGEAMUQR.cjs.map +1 -0
- package/dist/chunk-D4PUWBN6.cjs +72 -0
- package/dist/chunk-D4PUWBN6.cjs.map +1 -0
- package/dist/chunk-ECFWPZGL.cjs +2117 -0
- package/dist/chunk-ECFWPZGL.cjs.map +1 -0
- package/dist/{chunk-VOD5JA4D.js → chunk-EG45GQOE.js} +3 -3
- package/dist/{chunk-VOD5JA4D.js.map → chunk-EG45GQOE.js.map} +1 -1
- package/dist/chunk-FSUMCJAR.cjs +646 -0
- package/dist/chunk-FSUMCJAR.cjs.map +1 -0
- package/dist/chunk-GV7UC3SS.cjs +33 -0
- package/dist/chunk-GV7UC3SS.cjs.map +1 -0
- package/dist/chunk-HYFNOF7Y.cjs +97 -0
- package/dist/chunk-HYFNOF7Y.cjs.map +1 -0
- package/dist/chunk-KOYRJXTI.cjs +123 -0
- package/dist/chunk-KOYRJXTI.cjs.map +1 -0
- package/dist/chunk-KW34ZKF5.cjs +12 -0
- package/dist/chunk-KW34ZKF5.cjs.map +1 -0
- package/dist/chunk-M3UFIUXK.cjs +318 -0
- package/dist/chunk-M3UFIUXK.cjs.map +1 -0
- package/dist/chunk-OE527MXF.cjs +49 -0
- package/dist/chunk-OE527MXF.cjs.map +1 -0
- package/dist/{chunk-DU2VIJAF.js → chunk-P5SJ3QXJ.js} +3 -3
- package/dist/{chunk-DU2VIJAF.js.map → chunk-P5SJ3QXJ.js.map} +1 -1
- package/dist/chunk-PBPUSZIQ.cjs +808 -0
- package/dist/chunk-PBPUSZIQ.cjs.map +1 -0
- package/dist/chunk-PMKWYOOX.cjs +64 -0
- package/dist/chunk-PMKWYOOX.cjs.map +1 -0
- package/dist/chunk-PNQY6OFB.cjs +132 -0
- package/dist/chunk-PNQY6OFB.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-SVNK5NIK.js → chunk-QLFHYHJ2.js} +4 -4
- package/dist/{chunk-SVNK5NIK.js.map → chunk-QLFHYHJ2.js.map} +1 -1
- package/dist/{chunk-G4LSLLGI.js → chunk-RB4OMSPA.js} +5 -5
- package/dist/{chunk-G4LSLLGI.js.map → chunk-RB4OMSPA.js.map} +1 -1
- package/dist/chunk-UGG7MCX4.cjs +34 -0
- package/dist/chunk-UGG7MCX4.cjs.map +1 -0
- package/dist/chunk-WGZZKCJQ.cjs +157 -0
- package/dist/chunk-WGZZKCJQ.cjs.map +1 -0
- package/dist/{chunk-3JRTELLC.js → chunk-X5JTZ5LW.js} +3 -3
- package/dist/{chunk-3JRTELLC.js.map → chunk-X5JTZ5LW.js.map} +1 -1
- package/dist/{chunk-Y6XVPRYH.js → chunk-XUSKGJRI.js} +2 -2
- package/dist/chunk-XUSKGJRI.js.map +1 -0
- package/dist/chunk-Z7CS43ZT.cjs +808 -0
- package/dist/chunk-Z7CS43ZT.cjs.map +1 -0
- package/dist/chunk-ZYTWQZZC.cjs +623 -0
- package/dist/chunk-ZYTWQZZC.cjs.map +1 -0
- package/dist/devtools/index.cjs +13 -697
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.js +2 -2
- package/dist/document/index.cjs +56 -301
- package/dist/document/index.cjs.map +1 -1
- package/dist/examples/index.cjs +6 -31
- package/dist/examples/index.cjs.map +1 -1
- package/dist/i18n/index.cjs +44 -292
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/index.cjs +335 -3954
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/migrations/index.cjs +7 -590
- package/dist/migrations/index.cjs.map +1 -1
- package/dist/reflect/index.cjs +85 -994
- package/dist/reflect/index.cjs.map +1 -1
- package/dist/reflect/index.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-Y6XVPRYH.js.map +0 -1
|
@@ -1,692 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const said = (name) => {
|
|
23
|
-
const found = Object.entries(element.attributes).find(([key]) => key.toLowerCase() === name)?.[1].trim().toLowerCase();
|
|
24
|
-
return found === void 0 || found === "" ? void 0 : found;
|
|
25
|
-
};
|
|
26
|
-
if (element.tag === "title") return "title";
|
|
27
|
-
if (element.tag === "meta") {
|
|
28
|
-
const [name, property] = [said("name"), said("property")];
|
|
29
|
-
if (name !== void 0) return `meta name ${name}`;
|
|
30
|
-
return property === void 0 ? void 0 : `meta property ${property}`;
|
|
31
|
-
}
|
|
32
|
-
if (element.tag === "link") return (said("rel") ?? "").split(/\s+/).includes("canonical") ? "link canonical" : void 0;
|
|
33
|
-
return void 0;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// src/shell/slot-names.ts
|
|
37
|
-
var CANVAS_SLOT_NAME = "CanvasSlot";
|
|
38
|
-
var ACTION_SLOT_NAME = "ActionSlot";
|
|
39
|
-
|
|
40
|
-
// src/shell/head.ts
|
|
41
|
-
var ATTRIBUTE_NAME = /^[A-Za-z][A-Za-z0-9:._-]*$/;
|
|
42
|
-
var DATA_TYPE = /^application\/([a-z0-9.-]+\+)?json$/i;
|
|
43
|
-
var written = (value) => {
|
|
44
|
-
if (typeof value === "string") return value.trim() === "" ? void 0 : value;
|
|
45
|
-
if (typeof value === "number") return String(value);
|
|
46
|
-
return value === true ? "" : void 0;
|
|
47
|
-
};
|
|
48
|
-
var attributesOf = (what, props, skip = []) => {
|
|
49
|
-
const attributes = {};
|
|
50
|
-
for (const [name, value] of Object.entries(props)) {
|
|
51
|
-
if (skip.includes(name)) continue;
|
|
52
|
-
if (!ATTRIBUTE_NAME.test(name)) return { refused: `${what}: "${name}" is not an attribute\u2019s name` };
|
|
53
|
-
if (/^on/i.test(name)) return { refused: `${what}: \`${name}\` is a handler, and a layout does not run` };
|
|
54
|
-
const text = written(value);
|
|
55
|
-
if (text !== void 0) attributes[name] = text;
|
|
56
|
-
}
|
|
57
|
-
return { attributes };
|
|
58
|
-
};
|
|
59
|
-
var has = (attributes, name) => Object.keys(attributes).some((key) => key.toLowerCase() === name);
|
|
60
|
-
var valueOf = (attributes, name) => Object.entries(attributes).find(([key]) => key.toLowerCase() === name)?.[1] ?? "";
|
|
61
|
-
var textOf = (nodes) => nodes.map((node) => node.type === "text" ? node.value : node.type === "fragment" ? textOf(node.children) : "").join("");
|
|
62
|
-
var titleOf = (node) => {
|
|
63
|
-
const text = textOf(node.children).trim();
|
|
64
|
-
return text === "" ? void 0 : { element: { tag: "title", attributes: {}, text } };
|
|
65
|
-
};
|
|
66
|
-
var metaOf = (node) => {
|
|
67
|
-
const read = attributesOf(HEAD_META_NAME, node.props);
|
|
68
|
-
if ("refused" in read) return read;
|
|
69
|
-
if (has(read.attributes, "http-equiv")) return { refused: `${HEAD_META_NAME}: \`http-equiv\` instructs the browser, and a layout does not` };
|
|
70
|
-
return has(read.attributes, "content") ? { element: { tag: "meta", attributes: read.attributes } } : void 0;
|
|
71
|
-
};
|
|
72
|
-
var linkOf = (node) => {
|
|
73
|
-
const read = attributesOf(HEAD_LINK_NAME, node.props);
|
|
74
|
-
if ("refused" in read) return read;
|
|
75
|
-
if (valueOf(read.attributes, "rel").toLowerCase().split(/\s+/).includes("stylesheet")) return { refused: `${HEAD_LINK_NAME}: a stylesheet styles the page, and a layout does not` };
|
|
76
|
-
return has(read.attributes, "href") ? { element: { tag: "link", attributes: read.attributes } } : void 0;
|
|
77
|
-
};
|
|
78
|
-
var scriptOf = (node) => {
|
|
79
|
-
const read = attributesOf(HEAD_SCRIPT_NAME, node.props, ["data"]);
|
|
80
|
-
if ("refused" in read) return read;
|
|
81
|
-
if (has(read.attributes, "src")) return { refused: `${HEAD_SCRIPT_NAME}: a script with a \`src\` runs, and a layout does not` };
|
|
82
|
-
const type = valueOf(read.attributes, "type");
|
|
83
|
-
if (!DATA_TYPE.test(type)) return { refused: `${HEAD_SCRIPT_NAME}: only a data block may be written (a JSON \`type\`), and "${type}" is not one` };
|
|
84
|
-
const data = node.props["data"];
|
|
85
|
-
if (data === void 0 || data === null || data === "") return void 0;
|
|
86
|
-
return { element: { tag: "script", attributes: read.attributes, text: JSON.stringify(data) } };
|
|
87
|
-
};
|
|
88
|
-
var READERS = {
|
|
89
|
-
[HEAD_TITLE_NAME]: titleOf,
|
|
90
|
-
[HEAD_META_NAME]: metaOf,
|
|
91
|
-
[HEAD_LINK_NAME]: linkOf,
|
|
92
|
-
[HEAD_SCRIPT_NAME]: scriptOf
|
|
93
|
-
};
|
|
94
|
-
var isHeadNode = (node) => node.type === "component" && node.name === HEAD_NAME;
|
|
95
|
-
var headOf = (api) => {
|
|
96
|
-
let heads = 0;
|
|
97
|
-
const said = [];
|
|
98
|
-
const refused = [];
|
|
99
|
-
const open = /* @__PURE__ */ new Set();
|
|
100
|
-
const hold = (nodes, action) => {
|
|
101
|
-
for (const node of nodes) {
|
|
102
|
-
if (node.type === "fragment") {
|
|
103
|
-
hold(node.children, action);
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
if (node.type === "error") {
|
|
107
|
-
refused.push(`${HEAD_NAME}: ${node.message}`);
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (node.type !== "component") continue;
|
|
111
|
-
const read = READERS[node.name];
|
|
112
|
-
if (read === void 0) {
|
|
113
|
-
refused.push(`${HEAD_NAME}: "${node.name}" is not something a head holds`);
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
const found = read(node);
|
|
117
|
-
if (found === void 0) continue;
|
|
118
|
-
if ("refused" in found) {
|
|
119
|
-
refused.push(found.refused);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
const key = headKeyOf(found.element);
|
|
123
|
-
const earlier = key === void 0 ? -1 : said.findIndex((other) => headKeyOf(other.element) === key);
|
|
124
|
-
if (earlier >= 0) said.splice(earlier, 1);
|
|
125
|
-
said.push({ element: found.element, action });
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
const walk = (nodes, action) => {
|
|
129
|
-
for (const node of nodes) {
|
|
130
|
-
if (node.type === "fragment") {
|
|
131
|
-
walk(node.children, action);
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (node.type !== "component") continue;
|
|
135
|
-
if (node.name === HEAD_NAME) {
|
|
136
|
-
heads += 1;
|
|
137
|
-
hold(node.children, action);
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (node.name === CANVAS_SLOT_NAME) {
|
|
141
|
-
const canvasId = node.props["canvasId"];
|
|
142
|
-
if (typeof canvasId !== "string" || canvasId === "" || open.has(canvasId)) continue;
|
|
143
|
-
open.add(canvasId);
|
|
144
|
-
walk(api.canvasTree(canvasId), void 0);
|
|
145
|
-
open.delete(canvasId);
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
const definitionId = node.name === ACTION_SLOT_NAME ? node.props["definitionId"] : void 0;
|
|
149
|
-
walk(node.children, typeof definitionId === "string" ? definitionId : action);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
walk(api.frame(), void 0);
|
|
153
|
-
if (heads === 0) return void 0;
|
|
154
|
-
const actions = [...new Set(said.flatMap((one) => one.action === void 0 ? [] : [one.action]))];
|
|
155
|
-
return { elements: said.map((one) => one.element), actions, refused };
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// src/shell/view.ts
|
|
159
|
-
var hasVisibleContent = (nodes) => nodes.some((node) => {
|
|
160
|
-
if (node.type === "text") return node.value !== "";
|
|
161
|
-
if (node.type === "fragment") return hasVisibleContent(node.children);
|
|
162
|
-
if (node.type === "component" && node.name === ACTION_SLOT_NAME) return hasVisibleContent(node.children);
|
|
163
|
-
if (isHeadNode(node)) return false;
|
|
164
|
-
return true;
|
|
3
|
+
var chunkAGEAMUQR_cjs = require('../../chunk-AGEAMUQR.cjs');
|
|
4
|
+
require('../../chunk-WGZZKCJQ.cjs');
|
|
5
|
+
require('../../chunk-ECFWPZGL.cjs');
|
|
6
|
+
require('../../chunk-PNQY6OFB.cjs');
|
|
7
|
+
require('../../chunk-PBPUSZIQ.cjs');
|
|
8
|
+
require('../../chunk-PMKWYOOX.cjs');
|
|
9
|
+
require('../../chunk-KOYRJXTI.cjs');
|
|
10
|
+
require('../../chunk-GV7UC3SS.cjs');
|
|
11
|
+
require('../../chunk-FSUMCJAR.cjs');
|
|
12
|
+
require('../../chunk-D4PUWBN6.cjs');
|
|
13
|
+
require('../../chunk-KW34ZKF5.cjs');
|
|
14
|
+
require('../../chunk-OE527MXF.cjs');
|
|
15
|
+
require('../../chunk-Q7SFCCGT.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "createDomView", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkAGEAMUQR_cjs.createDomView; }
|
|
165
22
|
});
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
var shellView = (shell) => ({
|
|
171
|
-
api: {
|
|
172
|
-
frame: () => shell.getShellRenderTree(),
|
|
173
|
-
canvasTree: (canvasId) => canvasTreeOf(shell, canvasId),
|
|
174
|
-
// An event that names no origin belongs to the canvas's ACTIVE instance — on
|
|
175
|
-
// a card deck that is the only one drawn. One that names its own (an
|
|
176
|
-
// adapter stamps it at the instance boundary, `scopeDispatch`) keeps it. A
|
|
177
|
-
// canvas with nothing mounted dispatches unstamped.
|
|
178
|
-
dispatch: (canvasId, event) => {
|
|
179
|
-
const active = shell.getState().canvases[canvasId]?.active;
|
|
180
|
-
shell.dispatch(event.origin === void 0 && active !== void 0 ? { ...event, origin: active.id } : event);
|
|
181
|
-
},
|
|
182
|
-
publish: (channel, payload) => shell.publish(channel, payload)
|
|
183
|
-
},
|
|
184
|
-
subscribe: (listener) => {
|
|
185
|
-
let pending = false;
|
|
186
|
-
let stopped = false;
|
|
187
|
-
const changed = () => {
|
|
188
|
-
if (pending || stopped) return;
|
|
189
|
-
pending = true;
|
|
190
|
-
queueMicrotask(() => {
|
|
191
|
-
pending = false;
|
|
192
|
-
if (!stopped) listener();
|
|
193
|
-
});
|
|
194
|
-
};
|
|
195
|
-
const offState = shell.onStateChange(changed);
|
|
196
|
-
const offData = shell.onDataChange(changed);
|
|
197
|
-
return () => {
|
|
198
|
-
stopped = true;
|
|
199
|
-
offState();
|
|
200
|
-
offData();
|
|
201
|
-
};
|
|
202
|
-
}
|
|
23
|
+
Object.defineProperty(exports, "mountShell", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkAGEAMUQR_cjs.mountShell; }
|
|
203
26
|
});
|
|
204
|
-
|
|
205
|
-
// src/document/place-head.ts
|
|
206
|
-
var HEAD_MARK = "data-nova-head";
|
|
207
|
-
var OWN_MARK = "data-nova-own";
|
|
208
|
-
|
|
209
|
-
// src/document/head-keeper.ts
|
|
210
|
-
var TAGS2 = ["title", "meta", "link"];
|
|
211
|
-
var keyOfNode = (node) => {
|
|
212
|
-
const tag = TAGS2.find((name) => name === node.tagName.toLowerCase());
|
|
213
|
-
if (tag !== "title" && tag !== "meta" && tag !== "link") return void 0;
|
|
214
|
-
return headKeyOf({ tag, attributes: Object.fromEntries([...node.attributes].map((attribute) => [attribute.name, attribute.value])) });
|
|
215
|
-
};
|
|
216
|
-
var createHeadKeeper = (doc) => {
|
|
217
|
-
let mine = [];
|
|
218
|
-
let away = [];
|
|
219
|
-
let said;
|
|
220
|
-
const built = (element) => {
|
|
221
|
-
const node = doc.createElement(element.tag);
|
|
222
|
-
for (const [name, value] of Object.entries(element.attributes)) node.setAttribute(name, value);
|
|
223
|
-
node.setAttribute(HEAD_MARK, "");
|
|
224
|
-
if (element.text !== void 0) node.textContent = element.text;
|
|
225
|
-
return node;
|
|
226
|
-
};
|
|
227
|
-
const adopt = () => {
|
|
228
|
-
mine = [...doc.head.querySelectorAll(`[${HEAD_MARK}]`)];
|
|
229
|
-
const view = doc.defaultView;
|
|
230
|
-
for (const stash of doc.head.querySelectorAll(`template[${OWN_MARK}]`)) {
|
|
231
|
-
if (view === null || !(stash instanceof view.HTMLTemplateElement)) continue;
|
|
232
|
-
for (const child of [...stash.content.children]) {
|
|
233
|
-
const key = keyOfNode(child);
|
|
234
|
-
if (key !== void 0) away.push({ key, node: doc.importNode(child, true), before: null });
|
|
235
|
-
}
|
|
236
|
-
stash.remove();
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
return (elements) => {
|
|
240
|
-
const now = elements ?? [];
|
|
241
|
-
const next = JSON.stringify(now);
|
|
242
|
-
if (said === void 0) {
|
|
243
|
-
if (now.length === 0) return;
|
|
244
|
-
adopt();
|
|
245
|
-
}
|
|
246
|
-
if (next === said) return;
|
|
247
|
-
said = next;
|
|
248
|
-
for (const node of mine) node.remove();
|
|
249
|
-
mine = now.map(built);
|
|
250
|
-
const keys = new Set(now.flatMap((element) => headKeyOf(element) ?? []));
|
|
251
|
-
for (const node of [...doc.head.children]) {
|
|
252
|
-
const key = keyOfNode(node);
|
|
253
|
-
if (key === void 0 || !keys.has(key)) continue;
|
|
254
|
-
away.push({ key, node, before: node.nextSibling });
|
|
255
|
-
node.remove();
|
|
256
|
-
}
|
|
257
|
-
const [back, still] = [away.filter((gone) => !keys.has(gone.key)), away.filter((gone) => keys.has(gone.key))];
|
|
258
|
-
for (const gone of [...back].reverse()) doc.head.insertBefore(gone.node, gone.before !== null && gone.before.parentNode === doc.head ? gone.before : null);
|
|
259
|
-
away = still;
|
|
260
|
-
doc.head.append(...mine);
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// src/adapters/dom/index.ts
|
|
265
|
-
var CANVAS_SLOT = "CanvasSlot";
|
|
266
|
-
var ACTION_SLOT = "ActionSlot";
|
|
267
|
-
var errorEl = (code, message) => {
|
|
268
|
-
const el = document.createElement("div");
|
|
269
|
-
el.setAttribute("data-nova-error", code);
|
|
270
|
-
el.textContent = `${code}: ${message}`;
|
|
271
|
-
return el;
|
|
272
|
-
};
|
|
273
|
-
var equal = (a, b) => {
|
|
274
|
-
if (Object.is(a, b)) return true;
|
|
275
|
-
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
276
|
-
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
277
|
-
const keys = Object.keys(a);
|
|
278
|
-
if (keys.length !== Object.keys(b).length) return false;
|
|
279
|
-
return keys.every((key) => Object.hasOwn(b, key) && equal(Reflect.get(a, key), Reflect.get(b, key)));
|
|
280
|
-
};
|
|
281
|
-
var withoutValue = (props) => {
|
|
282
|
-
const { value: _value, ...rest } = props;
|
|
283
|
-
return rest;
|
|
284
|
-
};
|
|
285
|
-
var sameNodes = (a, b) => a.length === b.length && a.every((node, i) => node === b[i]);
|
|
286
|
-
var flat = (kids) => {
|
|
287
|
-
const nodes = [];
|
|
288
|
-
for (let i = 0; i < kids.length; i += 1) {
|
|
289
|
-
const dom = kids[i]?.dom ?? [];
|
|
290
|
-
for (let j = 0; j < dom.length; j += 1) {
|
|
291
|
-
const node = dom[j];
|
|
292
|
-
if (node !== void 0) nodes.push(node);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return nodes;
|
|
296
|
-
};
|
|
297
|
-
var canvasIdOf = (node) => {
|
|
298
|
-
const canvasId = node.props["canvasId"];
|
|
299
|
-
return typeof canvasId === "string" ? canvasId : "";
|
|
300
|
-
};
|
|
301
|
-
var slotOf = (node) => {
|
|
302
|
-
if (node.name === CANVAS_SLOT) return node.props["canvasId"];
|
|
303
|
-
if (node.name === ACTION_SLOT) return node.props["instanceId"];
|
|
304
|
-
return void 0;
|
|
305
|
-
};
|
|
306
|
-
var keyed = (items, nodeOf) => {
|
|
307
|
-
const seen = /* @__PURE__ */ new Map();
|
|
308
|
-
return items.map((item, i) => {
|
|
309
|
-
const key = renderNodeKey(nodeOf(item), i);
|
|
310
|
-
const count = seen.get(key) ?? 0;
|
|
311
|
-
seen.set(key, count + 1);
|
|
312
|
-
return [count === 0 ? key : `${key}#${count}`, item];
|
|
313
|
-
});
|
|
314
|
-
};
|
|
315
|
-
var samePlace = (a, b) => {
|
|
316
|
-
if (a.key !== void 0 || b.key !== void 0) return a.key === b.key;
|
|
317
|
-
if (a.type === "component" && b.type === "component") return a.ref !== void 0 || b.ref !== void 0 ? a.ref === b.ref : a.name === b.name;
|
|
318
|
-
if (a.type === "error" && b.type === "error") return a.code === b.code;
|
|
319
|
-
return a.type === b.type;
|
|
320
|
-
};
|
|
321
|
-
var gathered = (nodes) => {
|
|
322
|
-
const fragment = document.createDocumentFragment();
|
|
323
|
-
for (const node of nodes) fragment.appendChild(node);
|
|
324
|
-
return fragment;
|
|
325
|
-
};
|
|
326
|
-
var holdsExactly = (el, nodes) => nodes.length > 0 && el.childNodes.length === nodes.length && nodes.every((node, i) => el.childNodes[i] === node);
|
|
327
|
-
var standing = (stoodAt) => {
|
|
328
|
-
const ends = [];
|
|
329
|
-
const before = [];
|
|
330
|
-
stoodAt.forEach((stood, i) => {
|
|
331
|
-
before[i] = -1;
|
|
332
|
-
if (stood < 0) return;
|
|
333
|
-
let lo = 0;
|
|
334
|
-
let hi = ends.length;
|
|
335
|
-
while (lo < hi) {
|
|
336
|
-
const mid = lo + hi >> 1;
|
|
337
|
-
if ((stoodAt[ends[mid] ?? 0] ?? 0) < stood) lo = mid + 1;
|
|
338
|
-
else hi = mid;
|
|
339
|
-
}
|
|
340
|
-
before[i] = lo > 0 ? ends[lo - 1] ?? -1 : -1;
|
|
341
|
-
ends[lo] = i;
|
|
342
|
-
});
|
|
343
|
-
const run = /* @__PURE__ */ new Set();
|
|
344
|
-
let at = ends[ends.length - 1] ?? -1;
|
|
345
|
-
while (at >= 0) {
|
|
346
|
-
run.add(at);
|
|
347
|
-
at = before[at] ?? -1;
|
|
348
|
-
}
|
|
349
|
-
return run;
|
|
350
|
-
};
|
|
351
|
-
var readValue = (target) => {
|
|
352
|
-
if (target instanceof HTMLInputElement && target.type === "checkbox") return target.checked;
|
|
353
|
-
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) return target.value;
|
|
354
|
-
return "";
|
|
355
|
-
};
|
|
356
|
-
var wireEvents = (el, node, dispatch, field) => {
|
|
357
|
-
if (node.model !== void 0) {
|
|
358
|
-
const ref = node.model.ref;
|
|
359
|
-
const wait = node.props["debounce"];
|
|
360
|
-
const debounce = typeof wait === "number" ? wait : 0;
|
|
361
|
-
let pending;
|
|
362
|
-
const fire = (value) => dispatch({ type: "ui:model", ref, payload: value });
|
|
363
|
-
el.addEventListener("input", (e) => {
|
|
364
|
-
field.stale = true;
|
|
365
|
-
const value = readValue(e.target);
|
|
366
|
-
if (debounce <= 0) {
|
|
367
|
-
fire(value);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (pending !== void 0) clearTimeout(pending.timer);
|
|
371
|
-
const timer = setTimeout(() => {
|
|
372
|
-
pending = void 0;
|
|
373
|
-
fire(value);
|
|
374
|
-
}, debounce);
|
|
375
|
-
pending = { value, timer };
|
|
376
|
-
});
|
|
377
|
-
el.addEventListener(
|
|
378
|
-
"blur",
|
|
379
|
-
() => {
|
|
380
|
-
if (pending === void 0) return;
|
|
381
|
-
clearTimeout(pending.timer);
|
|
382
|
-
const { value } = pending;
|
|
383
|
-
pending = void 0;
|
|
384
|
-
fire(value);
|
|
385
|
-
},
|
|
386
|
-
true
|
|
387
|
-
);
|
|
388
|
-
el.addEventListener("keydown", (e) => {
|
|
389
|
-
if (e instanceof KeyboardEvent) dispatch({ type: "ui:key", ref, key: e.key });
|
|
390
|
-
});
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
if (node.ref !== void 0) {
|
|
394
|
-
const ref = node.ref;
|
|
395
|
-
el.addEventListener("click", (e) => {
|
|
396
|
-
e.stopPropagation();
|
|
397
|
-
const value = node.props["value"];
|
|
398
|
-
dispatch(value === void 0 ? { type: "ui:click", ref } : { type: "ui:click", ref, payload: value });
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
var inInstance = (node, ctx) => {
|
|
403
|
-
if (node.type !== "component" || node.name !== ACTION_SLOT) return ctx;
|
|
404
|
-
const instanceId = node.props["instanceId"];
|
|
405
|
-
if (typeof instanceId !== "string" || instanceId === "") return ctx;
|
|
406
|
-
const outer = ctx.dispatch;
|
|
407
|
-
return { ...ctx, dispatch: (event) => outer(event.origin === void 0 ? { ...event, origin: instanceId } : event) };
|
|
408
|
-
};
|
|
409
|
-
var isTypedIn = (el) => el instanceof HTMLTextAreaElement || el instanceof HTMLInputElement && el.type !== "checkbox" && el.type !== "radio";
|
|
410
|
-
var typingIn = (el) => isTypedIn(el) ? { value: el.value, start: el.selectionStart, end: el.selectionEnd } : void 0;
|
|
411
|
-
var placeCaret = (el, typing) => {
|
|
412
|
-
try {
|
|
413
|
-
el.setSelectionRange(typing.start ?? el.value.length, typing.end ?? el.value.length);
|
|
414
|
-
} catch {
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
var placeUnder = (root, node) => {
|
|
418
|
-
const place = [];
|
|
419
|
-
let at = node;
|
|
420
|
-
while (at !== root) {
|
|
421
|
-
const parent = at.parentNode;
|
|
422
|
-
if (parent === null) return void 0;
|
|
423
|
-
const child = at;
|
|
424
|
-
place.unshift([...parent.childNodes].findIndex((sibling) => sibling === child));
|
|
425
|
-
at = parent;
|
|
426
|
-
}
|
|
427
|
-
return place;
|
|
428
|
-
};
|
|
429
|
-
var nodeUnder = (root, place) => place.reduce((at, index) => at?.childNodes[index], root);
|
|
430
|
-
var createDomView = (root, registry, api, options = {}) => {
|
|
431
|
-
const top = { registry, dispatch: () => void 0, api, ...options.fallback !== void 0 ? { fallback: options.fallback } : {} };
|
|
432
|
-
let mounts = [];
|
|
433
|
-
let drawn = false;
|
|
434
|
-
let writes = 0;
|
|
435
|
-
const refocus = { from: null, to: void 0 };
|
|
436
|
-
const fields = /* @__PURE__ */ new WeakMap();
|
|
437
|
-
const builderOf = (node, ctx) => ctx.registry.get(node.name)?.component ?? ctx.fallback;
|
|
438
|
-
const leaf = (node, ctx, el) => ({ node, ctx, dom: [el], kids: [], host: void 0, cleanups: [], field: { stale: false } });
|
|
439
|
-
const leave = (mount) => {
|
|
440
|
-
if (mount.cleanups.length === 0) return;
|
|
441
|
-
for (const cleanup of mount.cleanups.splice(0)) cleanup();
|
|
442
|
-
};
|
|
443
|
-
const drop = (mount) => {
|
|
444
|
-
leave(mount);
|
|
445
|
-
for (const kid of mount.kids) drop(kid);
|
|
446
|
-
};
|
|
447
|
-
const assemble = (node, ctx, kids, replaced) => {
|
|
448
|
-
if (replaced !== void 0) leave(replaced);
|
|
449
|
-
const builder = builderOf(node, ctx);
|
|
450
|
-
if (builder === void 0) {
|
|
451
|
-
for (const kid of kids) drop(kid);
|
|
452
|
-
return leaf(node, ctx, errorEl("COMPONENT_NOT_FOUND", node.name));
|
|
453
|
-
}
|
|
454
|
-
const children = kids.filter((kid) => !isHeadNode(kid.node)).map((kid) => {
|
|
455
|
-
const [only] = kid.dom;
|
|
456
|
-
if (kid.node.type !== "fragment" && only !== void 0) return only;
|
|
457
|
-
const fragment = document.createDocumentFragment();
|
|
458
|
-
fragment.append(...kid.dom);
|
|
459
|
-
return fragment;
|
|
460
|
-
});
|
|
461
|
-
const cleanups = [];
|
|
462
|
-
const field = { stale: false };
|
|
463
|
-
let holdsOnly = true;
|
|
464
|
-
writes += 1;
|
|
465
|
-
const el = builder({
|
|
466
|
-
props: node.props,
|
|
467
|
-
children,
|
|
468
|
-
dispatch: ctx.dispatch,
|
|
469
|
-
onRemove: (cleanup) => void cleanups.push(cleanup),
|
|
470
|
-
dependsOnChildren: () => {
|
|
471
|
-
holdsOnly = false;
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
el.setAttribute("data-component", node.name);
|
|
475
|
-
if (node.ref !== void 0) el.setAttribute("data-ref", node.ref);
|
|
476
|
-
wireEvents(el, node, ctx.dispatch, field);
|
|
477
|
-
if (node.model !== void 0) fields.set(el, field);
|
|
478
|
-
if (replaced !== void 0 && refocus.from !== null && replaced.dom[0] === refocus.from) refocus.to = el;
|
|
479
|
-
return { node, ctx, dom: [el], kids, host: holdsOnly && holdsExactly(el, flat(kids)) ? el : void 0, cleanups, field };
|
|
480
|
-
};
|
|
481
|
-
const build = (node, parent) => {
|
|
482
|
-
const ctx = inInstance(node, parent);
|
|
483
|
-
writes += 1;
|
|
484
|
-
if (node.type === "text") return leaf(node, ctx, document.createTextNode(node.value));
|
|
485
|
-
if (node.type === "error") return leaf(node, ctx, errorEl(node.code, node.message));
|
|
486
|
-
if (node.type === "fragment") {
|
|
487
|
-
const kids = node.children.map((child) => build(child, ctx));
|
|
488
|
-
return { node, ctx, dom: flat(kids), kids, host: void 0, cleanups: [], field: { stale: false } };
|
|
489
|
-
}
|
|
490
|
-
if (node.name === CANVAS_SLOT) {
|
|
491
|
-
const canvasId = canvasIdOf(node);
|
|
492
|
-
const host = document.createElement("div");
|
|
493
|
-
host.setAttribute("data-canvas", canvasId);
|
|
494
|
-
const canvasCtx = { ...ctx, dispatch: (event) => ctx.api.dispatch(canvasId, event) };
|
|
495
|
-
const kids = canvasId === "" ? [] : ctx.api.canvasTree(canvasId).map((child) => build(child, canvasCtx));
|
|
496
|
-
host.append(...flat(kids));
|
|
497
|
-
return { node, ctx: canvasCtx, dom: [host], kids, host, cleanups: [], field: { stale: false } };
|
|
498
|
-
}
|
|
499
|
-
if (isHeadNode(node)) return { node, ctx, dom: [], kids: [], host: void 0, cleanups: [], field: { stale: false } };
|
|
500
|
-
if (builderOf(node, ctx) === void 0) return leaf(node, ctx, errorEl("COMPONENT_NOT_FOUND", node.name));
|
|
501
|
-
return assemble(node, ctx, node.children.map((child) => build(child, ctx)));
|
|
502
|
-
};
|
|
503
|
-
const place = (host, before, after) => {
|
|
504
|
-
if (sameNodes(before, after)) return;
|
|
505
|
-
const wanted = new Set(after);
|
|
506
|
-
if (host.childNodes.length === before.length && !before.some((node) => wanted.has(node))) {
|
|
507
|
-
host.replaceChildren(gathered(after));
|
|
508
|
-
writes += 1;
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
for (const node of before) {
|
|
512
|
-
if (wanted.has(node) || node.parentNode !== host) continue;
|
|
513
|
-
host.removeChild(node);
|
|
514
|
-
writes += 1;
|
|
515
|
-
}
|
|
516
|
-
const stoodAt = new Map(before.map((node, i) => [node, i]));
|
|
517
|
-
const stays = standing(after.map((node) => stoodAt.get(node) ?? -1));
|
|
518
|
-
let anchor = null;
|
|
519
|
-
let run = [];
|
|
520
|
-
const putIn = () => {
|
|
521
|
-
const [only] = run;
|
|
522
|
-
if (only === void 0) return;
|
|
523
|
-
host.insertBefore(run.length === 1 ? only : gathered(run.reverse()), anchor);
|
|
524
|
-
writes += 1;
|
|
525
|
-
run = [];
|
|
526
|
-
};
|
|
527
|
-
for (let i = after.length - 1; i >= 0; i -= 1) {
|
|
528
|
-
const node = after[i];
|
|
529
|
-
if (node === void 0) continue;
|
|
530
|
-
if (stays.has(i)) {
|
|
531
|
-
putIn();
|
|
532
|
-
anchor = node;
|
|
533
|
-
} else run.push(node);
|
|
534
|
-
}
|
|
535
|
-
putIn();
|
|
536
|
-
};
|
|
537
|
-
const reconcile = (olds, nexts, ctx) => {
|
|
538
|
-
if (olds.length === nexts.length && olds.every((old, i) => samePlace(old.node, nexts[i] ?? old.node))) {
|
|
539
|
-
return olds.map((old, i) => patch(old, nexts[i] ?? old.node, ctx));
|
|
540
|
-
}
|
|
541
|
-
const drawnBy = new Map(keyed(olds, (old) => old.node));
|
|
542
|
-
const kids = keyed(nexts, (next) => next).map(([key, next]) => {
|
|
543
|
-
const old = drawnBy.get(key);
|
|
544
|
-
if (old === void 0) return build(next, ctx);
|
|
545
|
-
drawnBy.delete(key);
|
|
546
|
-
return patch(old, next, ctx);
|
|
547
|
-
});
|
|
548
|
-
for (const gone of drawnBy.values()) drop(gone);
|
|
549
|
-
return kids;
|
|
550
|
-
};
|
|
551
|
-
const patch = (old, next, parent) => {
|
|
552
|
-
const prev = old.node;
|
|
553
|
-
const afresh = () => {
|
|
554
|
-
drop(old);
|
|
555
|
-
return build(next, parent);
|
|
556
|
-
};
|
|
557
|
-
if (prev.type === "text" && next.type === "text") {
|
|
558
|
-
const [node] = old.dom;
|
|
559
|
-
if (prev.value !== next.value && node !== void 0) {
|
|
560
|
-
node.nodeValue = next.value;
|
|
561
|
-
writes += 1;
|
|
562
|
-
}
|
|
563
|
-
old.node = next;
|
|
564
|
-
return old;
|
|
565
|
-
}
|
|
566
|
-
if (prev.type === "fragment" && next.type === "fragment") {
|
|
567
|
-
old.kids = reconcile(old.kids, next.children, old.ctx);
|
|
568
|
-
old.dom = flat(old.kids);
|
|
569
|
-
old.node = next;
|
|
570
|
-
return old;
|
|
571
|
-
}
|
|
572
|
-
if (prev.type !== "component" || next.type !== "component") return equal(prev, next) ? old : afresh();
|
|
573
|
-
if (prev.name !== next.name || !Object.is(slotOf(prev), slotOf(next))) return afresh();
|
|
574
|
-
if (isHeadNode(next)) {
|
|
575
|
-
old.node = next;
|
|
576
|
-
return old;
|
|
577
|
-
}
|
|
578
|
-
if (next.name === CANVAS_SLOT) {
|
|
579
|
-
const host = old.host;
|
|
580
|
-
if (host === void 0) return afresh();
|
|
581
|
-
const canvasId = canvasIdOf(next);
|
|
582
|
-
const before2 = flat(old.kids);
|
|
583
|
-
old.kids = reconcile(old.kids, canvasId === "" ? [] : old.ctx.api.canvasTree(canvasId), old.ctx);
|
|
584
|
-
place(host, before2, flat(old.kids));
|
|
585
|
-
old.node = next;
|
|
586
|
-
return old;
|
|
587
|
-
}
|
|
588
|
-
const [el] = old.dom;
|
|
589
|
-
if (el === void 0) return afresh();
|
|
590
|
-
let own = equal(prev.props, next.props) && prev.ref === next.ref && equal(prev.model, next.model);
|
|
591
|
-
if (next.model !== void 0) {
|
|
592
|
-
const active = el.ownerDocument?.activeElement ?? null;
|
|
593
|
-
if (isTypedIn(active) && el.contains(active)) {
|
|
594
|
-
if (!own && prev.ref === next.ref && equal(prev.model, next.model) && equal(withoutValue(prev.props), withoutValue(next.props))) {
|
|
595
|
-
old.field.stale = true;
|
|
596
|
-
own = true;
|
|
597
|
-
}
|
|
598
|
-
} else if (old.field.stale) {
|
|
599
|
-
own = false;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
const handed = old.host === void 0 ? old.kids.map((kid) => kid.dom) : void 0;
|
|
603
|
-
const before = flat(old.kids);
|
|
604
|
-
const mark = writes;
|
|
605
|
-
const kids = reconcile(old.kids, next.children, old.ctx);
|
|
606
|
-
const after = flat(kids);
|
|
607
|
-
const kept = () => {
|
|
608
|
-
old.kids = kids;
|
|
609
|
-
old.node = next;
|
|
610
|
-
return old;
|
|
611
|
-
};
|
|
612
|
-
if (own) {
|
|
613
|
-
if (old.host !== void 0) {
|
|
614
|
-
if (after.length > 0) {
|
|
615
|
-
place(old.host, before, after);
|
|
616
|
-
return kept();
|
|
617
|
-
}
|
|
618
|
-
} else if (handed !== void 0 && handed.length === kids.length && kids.every((kid, i) => sameNodes(handed[i] ?? [], kid.dom))) {
|
|
619
|
-
if (writes === mark || after.every((node) => el.contains(node))) return kept();
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
return assemble(next, old.ctx, kids, old);
|
|
623
|
-
};
|
|
624
|
-
const render = () => {
|
|
625
|
-
const doc = root.ownerDocument;
|
|
626
|
-
const active = doc.activeElement !== null && root.contains(doc.activeElement) ? doc.activeElement : null;
|
|
627
|
-
const typing = typingIn(active);
|
|
628
|
-
const adopted = !drawn && active !== null ? placeUnder(root, active) : void 0;
|
|
629
|
-
refocus.from = active;
|
|
630
|
-
refocus.to = void 0;
|
|
631
|
-
if (!drawn) root.replaceChildren();
|
|
632
|
-
drawn = true;
|
|
633
|
-
const before = flat(mounts);
|
|
634
|
-
mounts = reconcile(mounts, api.frame(), top);
|
|
635
|
-
place(root, before, flat(mounts));
|
|
636
|
-
const twin = adopted === void 0 ? void 0 : nodeUnder(root, adopted);
|
|
637
|
-
const rebuilt = refocus.to ?? (twin instanceof HTMLElement && twin.tagName === active?.tagName ? twin : void 0);
|
|
638
|
-
const target = rebuilt ?? (active instanceof HTMLElement && active.isConnected ? active : void 0);
|
|
639
|
-
refocus.from = null;
|
|
640
|
-
refocus.to = void 0;
|
|
641
|
-
if (target === void 0 || doc.activeElement === target) return;
|
|
642
|
-
if (rebuilt !== void 0 && typing !== void 0 && isTypedIn(target)) {
|
|
643
|
-
target.value = typing.value;
|
|
644
|
-
const field = fields.get(target);
|
|
645
|
-
if (field !== void 0) field.stale = true;
|
|
646
|
-
}
|
|
647
|
-
target.focus({ preventScroll: true });
|
|
648
|
-
if (typing !== void 0 && isTypedIn(target)) placeCaret(target, typing);
|
|
649
|
-
};
|
|
650
|
-
const destroy = () => {
|
|
651
|
-
for (const mount of mounts) drop(mount);
|
|
652
|
-
mounts = [];
|
|
653
|
-
drawn = false;
|
|
654
|
-
root.replaceChildren();
|
|
655
|
-
};
|
|
656
|
-
return { render, destroy };
|
|
657
|
-
};
|
|
658
|
-
var mountShell = (root, registry, shell, options = {}) => {
|
|
659
|
-
const view = shellView(shell);
|
|
660
|
-
let read = { trees: /* @__PURE__ */ new Map() };
|
|
661
|
-
const api = {
|
|
662
|
-
...view.api,
|
|
663
|
-
frame: () => read.frame ??= view.api.frame(),
|
|
664
|
-
canvasTree: (canvasId) => {
|
|
665
|
-
const held = read.trees.get(canvasId);
|
|
666
|
-
if (held !== void 0) return held;
|
|
667
|
-
const tree = view.api.canvasTree(canvasId);
|
|
668
|
-
read.trees.set(canvasId, tree);
|
|
669
|
-
return tree;
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
const dom = createDomView(root, registry, api, options);
|
|
673
|
-
const keepHead = createHeadKeeper(root.ownerDocument);
|
|
674
|
-
const render = () => {
|
|
675
|
-
read = { trees: /* @__PURE__ */ new Map() };
|
|
676
|
-
dom.render();
|
|
677
|
-
if (root.isConnected) keepHead(headOf(api)?.elements);
|
|
678
|
-
};
|
|
679
|
-
render();
|
|
680
|
-
const stop = view.subscribe(render);
|
|
681
|
-
return {
|
|
682
|
-
destroy: () => {
|
|
683
|
-
stop();
|
|
684
|
-
dom.destroy();
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
exports.createDomView = createDomView;
|
|
690
|
-
exports.mountShell = mountShell;
|
|
691
27
|
//# sourceMappingURL=index.cjs.map
|
|
692
28
|
//# sourceMappingURL=index.cjs.map
|