jaxs 0.4.0 → 0.4.3
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/jaxs.d.ts +250 -243
- package/dist/jaxs.js +369 -289
- package/dist/jaxs.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/jaxs.js
CHANGED
|
@@ -1,66 +1,129 @@
|
|
|
1
1
|
const tt = (e, t) => t.createElement(e), et = (e, t) => {
|
|
2
2
|
for (const s in t) {
|
|
3
3
|
if (s === "__self") continue;
|
|
4
|
-
const
|
|
5
|
-
s === "value" ? e.value =
|
|
4
|
+
const r = t[s].toString();
|
|
5
|
+
s === "value" ? e.value = r : e.setAttribute(s, r);
|
|
6
6
|
}
|
|
7
7
|
}, st = (e, t, s) => {
|
|
8
|
-
const
|
|
9
|
-
for (const
|
|
10
|
-
const o = t[
|
|
11
|
-
e.addEventListener(
|
|
12
|
-
domEvent:
|
|
8
|
+
const r = {};
|
|
9
|
+
for (const n in t) {
|
|
10
|
+
const o = t[n], c = (h) => s(o, h);
|
|
11
|
+
e.addEventListener(n, c), r[n] = {
|
|
12
|
+
domEvent: n,
|
|
13
13
|
busEvent: o,
|
|
14
|
-
listener:
|
|
14
|
+
listener: c
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
e.eventMaps =
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
return et(
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
e.eventMaps = r;
|
|
18
|
+
}, rt = (e, t, s, r) => {
|
|
19
|
+
const n = tt(e, r.document);
|
|
20
|
+
return et(n, t), st(n, s, r.publish), n;
|
|
21
|
+
}, E = "http://www.w3.org/2000/svg", nt = {
|
|
22
|
+
animate: !0,
|
|
23
|
+
animateMotion: !0,
|
|
24
|
+
animateTransform: !0,
|
|
25
|
+
circle: !0,
|
|
26
|
+
clipPath: !0,
|
|
27
|
+
defs: !0,
|
|
28
|
+
desc: !0,
|
|
29
|
+
ellipse: !0,
|
|
30
|
+
feBlend: !0,
|
|
31
|
+
feColorMatrix: !0,
|
|
32
|
+
feComponentTransfer: !0,
|
|
33
|
+
feComposite: !0,
|
|
34
|
+
feConvolveMatrix: !0,
|
|
35
|
+
feDiffuseLighting: !0,
|
|
36
|
+
feDisplacementMap: !0,
|
|
37
|
+
feDistantLight: !0,
|
|
38
|
+
feDropShadow: !0,
|
|
39
|
+
feFlood: !0,
|
|
40
|
+
feFuncA: !0,
|
|
41
|
+
feFuncB: !0,
|
|
42
|
+
feFuncG: !0,
|
|
43
|
+
feFuncR: !0,
|
|
44
|
+
feGaussianBlur: !0,
|
|
45
|
+
feImage: !0,
|
|
46
|
+
feMerge: !0,
|
|
47
|
+
feMergeNode: !0,
|
|
48
|
+
feMorphology: !0,
|
|
49
|
+
feOffset: !0,
|
|
50
|
+
fePointLight: !0,
|
|
51
|
+
feSpecularLighting: !0,
|
|
52
|
+
feSpotLight: !0,
|
|
53
|
+
feTile: !0,
|
|
54
|
+
feTurbulence: !0,
|
|
55
|
+
filter: !0,
|
|
56
|
+
foreignObject: !0,
|
|
57
|
+
g: !0,
|
|
58
|
+
image: !0,
|
|
59
|
+
line: !0,
|
|
60
|
+
linearGradient: !0,
|
|
61
|
+
marker: !0,
|
|
62
|
+
mask: !0,
|
|
63
|
+
metadata: !0,
|
|
64
|
+
mpath: !0,
|
|
65
|
+
path: !0,
|
|
66
|
+
pattern: !0,
|
|
67
|
+
polygon: !0,
|
|
68
|
+
polyline: !0,
|
|
69
|
+
radialGradient: !0,
|
|
70
|
+
rect: !0,
|
|
71
|
+
script: !0,
|
|
72
|
+
set: !0,
|
|
73
|
+
stop: !0,
|
|
74
|
+
style: !0,
|
|
75
|
+
svg: !0,
|
|
76
|
+
switch: !0,
|
|
77
|
+
symbol: !0,
|
|
78
|
+
text: !0,
|
|
79
|
+
textPath: !0,
|
|
80
|
+
title: !0,
|
|
81
|
+
tspan: !0,
|
|
82
|
+
use: !0,
|
|
83
|
+
view: !0
|
|
84
|
+
}, ot = (e, t) => !!(nt[e] || e === "a" && t === E), it = (e, t, s) => {
|
|
85
|
+
const r = s.createElementNS(E, e);
|
|
86
|
+
for (const n in t)
|
|
87
|
+
n === "__self" || n === "xmlns" || r.setAttributeNS(null, n, t[n].toString());
|
|
88
|
+
return r;
|
|
89
|
+
}, ut = (e) => e.namespaceURI === E, at = (e, t) => t.createTextNode(e);
|
|
27
90
|
class ct {
|
|
28
91
|
constructor(t) {
|
|
29
|
-
this.value = t.toString()
|
|
92
|
+
this.value = t.toString();
|
|
30
93
|
}
|
|
31
94
|
render(t) {
|
|
32
95
|
const s = at(this.value, t.document);
|
|
33
96
|
return s.__jsx = "TextNode", [s];
|
|
34
97
|
}
|
|
35
98
|
}
|
|
36
|
-
const
|
|
37
|
-
const s = {},
|
|
38
|
-
for (const
|
|
39
|
-
const o = e[
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
|
|
99
|
+
const ht = (e) => typeof e == "string" || typeof e == "number", lt = (e) => new ct(e), dt = (e) => ht(e) ? lt(e) : e, pt = (e) => mt(e).map(dt).flat(), mt = (e) => Array.isArray(e) ? e.flat() : e ? [e] : [], j = (e, t = {}) => e || t.children || [], ft = (e, t = "") => {
|
|
100
|
+
const s = {}, r = {};
|
|
101
|
+
for (const n in e) {
|
|
102
|
+
const o = e[n];
|
|
103
|
+
if (n.match(/^on.+/i)) {
|
|
104
|
+
const c = n.slice(2).toLowerCase();
|
|
105
|
+
r[c] = o ? o.toString() : "";
|
|
43
106
|
} else {
|
|
44
107
|
if (o === !1) continue;
|
|
45
|
-
|
|
108
|
+
n === "__source" ? s.__source = e.__source : s[n] = bt(n, o, t);
|
|
46
109
|
}
|
|
47
110
|
}
|
|
48
111
|
return {
|
|
49
112
|
attributes: s,
|
|
50
|
-
events:
|
|
113
|
+
events: r
|
|
51
114
|
};
|
|
52
|
-
},
|
|
53
|
-
const s = e || {},
|
|
54
|
-
return s.children = s.children ||
|
|
55
|
-
}, k = (e, t, s = []) => e.reduce(gt(t), s).flat(), gt = (e) => (t, s) => s ? Array.isArray(s) ? k(s, e, t) : (s.render(e).forEach((
|
|
56
|
-
class
|
|
57
|
-
constructor(t
|
|
58
|
-
this.collection = pt(t
|
|
115
|
+
}, bt = (e, t, s = "") => t == null ? s : t.toString(), vt = (e, t) => {
|
|
116
|
+
const s = e || {}, r = j(t, s);
|
|
117
|
+
return s.children = s.children || r, s;
|
|
118
|
+
}, k = (e, t, s = []) => e.reduce(gt(t), s).flat(), gt = (e) => (t, s) => s ? Array.isArray(s) ? k(s, e, t) : (s.render(e).forEach((r) => t.push(r)), t) : t;
|
|
119
|
+
class M {
|
|
120
|
+
constructor(t) {
|
|
121
|
+
this.collection = pt(t);
|
|
59
122
|
}
|
|
60
123
|
render(t, s) {
|
|
61
124
|
this.parentElement = s;
|
|
62
|
-
const
|
|
63
|
-
return this.attachToParent(
|
|
125
|
+
const r = this.generateDom(t);
|
|
126
|
+
return this.attachToParent(r), r;
|
|
64
127
|
}
|
|
65
128
|
generateDom(t) {
|
|
66
129
|
return k(this.collection, t);
|
|
@@ -68,7 +131,7 @@ class O {
|
|
|
68
131
|
attachToParent(t) {
|
|
69
132
|
if (this.parentElement === void 0) return;
|
|
70
133
|
const s = this.parentElement;
|
|
71
|
-
t.forEach((
|
|
134
|
+
t.forEach((r) => s.appendChild(r));
|
|
72
135
|
}
|
|
73
136
|
}
|
|
74
137
|
class yt {
|
|
@@ -80,20 +143,20 @@ class yt {
|
|
|
80
143
|
}
|
|
81
144
|
sourceKey() {
|
|
82
145
|
if (this.attributes.__source) {
|
|
83
|
-
const { fileName: t, lineNumber: s, columnNumber:
|
|
84
|
-
return `${t}:${s}:${
|
|
146
|
+
const { fileName: t, lineNumber: s, columnNumber: r } = this.attributes.__source;
|
|
147
|
+
return `${t}:${s}:${r}`;
|
|
85
148
|
}
|
|
86
149
|
}
|
|
87
150
|
createKeyFromAttributes() {
|
|
88
|
-
const t = this.attributes.id ? `#${this.attributes.id}` : "", s = this.attributes.type ? `[type=${this.attributes.type}]` : "",
|
|
89
|
-
return `${this.type}${t}${s}${
|
|
151
|
+
const t = this.attributes.id ? `#${this.attributes.id}` : "", s = this.attributes.type ? `[type=${this.attributes.type}]` : "", r = this.attributes.name ? `[name=${this.attributes.name}]` : "";
|
|
152
|
+
return `${this.type}${t}${s}${r}`;
|
|
90
153
|
}
|
|
91
154
|
}
|
|
92
155
|
class Et {
|
|
93
|
-
constructor(t, s,
|
|
156
|
+
constructor(t, s, r = []) {
|
|
94
157
|
this.type = t;
|
|
95
|
-
const { events:
|
|
96
|
-
this.events =
|
|
158
|
+
const { events: n, attributes: o } = ft(s);
|
|
159
|
+
this.events = n, this.attributes = o, this.isSvg = ot(this.type, this.attributes.xmlns), this.children = new M(r);
|
|
97
160
|
}
|
|
98
161
|
render(t) {
|
|
99
162
|
const s = this.generateDom(t);
|
|
@@ -103,7 +166,7 @@ class Et {
|
|
|
103
166
|
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t);
|
|
104
167
|
}
|
|
105
168
|
generateHtmlDom(t) {
|
|
106
|
-
const s =
|
|
169
|
+
const s = rt(
|
|
107
170
|
this.type,
|
|
108
171
|
this.attributes,
|
|
109
172
|
this.events,
|
|
@@ -112,7 +175,7 @@ class Et {
|
|
|
112
175
|
return s.__jsx = this.jsxKey(), s;
|
|
113
176
|
}
|
|
114
177
|
generateSvgDom(t) {
|
|
115
|
-
const s =
|
|
178
|
+
const s = it(this.type, this.attributes, t.document);
|
|
116
179
|
return s.__jsx = this.jsxKey(), s;
|
|
117
180
|
}
|
|
118
181
|
jsxKey() {
|
|
@@ -122,11 +185,11 @@ class Et {
|
|
|
122
185
|
const xt = (e, t, ...s) => typeof e == "string" ? new Et(e, t, s) : e(vt(t, s));
|
|
123
186
|
xt.fragment = (e, t) => {
|
|
124
187
|
const s = j(t, e);
|
|
125
|
-
return new
|
|
188
|
+
return new M(s);
|
|
126
189
|
};
|
|
127
190
|
class At {
|
|
128
|
-
constructor(t, s,
|
|
129
|
-
this.template = t, this.selector = s, this.renderKit =
|
|
191
|
+
constructor(t, s, r) {
|
|
192
|
+
this.template = t, this.selector = s, this.renderKit = r, this.dom = [];
|
|
130
193
|
}
|
|
131
194
|
renderAndAttach(t) {
|
|
132
195
|
this.parentElement = this.getParentElement(), this.dom = this.render({ ...t, parent: this.parentElement }), this.parentElement && this.attach();
|
|
@@ -143,89 +206,89 @@ class At {
|
|
|
143
206
|
return this.renderKit.document.querySelector(this.selector);
|
|
144
207
|
}
|
|
145
208
|
}
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
},
|
|
209
|
+
const wt = (e, t, s) => {
|
|
210
|
+
const r = new At(e, t, s);
|
|
211
|
+
return r.renderAndAttach(s), r;
|
|
212
|
+
}, O = "go-to-href", m = "navigation:location-change", F = "navigation:route-change", St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
150
213
|
__proto__: null,
|
|
151
|
-
linkNavigationEvent:
|
|
214
|
+
linkNavigationEvent: O,
|
|
152
215
|
locationChangeEvent: m,
|
|
153
|
-
routeChangeEvent:
|
|
154
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
216
|
+
routeChangeEvent: F
|
|
217
|
+
}, Symbol.toStringTag, { value: "Module" })), T = (e) => {
|
|
155
218
|
e.createRecord("route", {
|
|
156
219
|
host: "",
|
|
157
220
|
path: "",
|
|
158
221
|
query: {}
|
|
159
222
|
});
|
|
160
|
-
},
|
|
223
|
+
}, $ = (e) => {
|
|
161
224
|
const t = e.closest("[href]");
|
|
162
225
|
return t && t.getAttribute("href") || "";
|
|
163
226
|
}, D = (e, { publish: t, window: s }) => {
|
|
164
227
|
s.history.pushState(null, "", e), t(m, null);
|
|
165
|
-
},
|
|
228
|
+
}, L = (e, t) => {
|
|
166
229
|
if (!e || !e.target) return;
|
|
167
230
|
e.preventDefault();
|
|
168
|
-
const s =
|
|
231
|
+
const s = $(e.target);
|
|
169
232
|
D(s, t);
|
|
170
|
-
},
|
|
233
|
+
}, B = (e) => e.replace(/^\?/, "").split("&").reduce((t, s) => {
|
|
171
234
|
if (!s) return t;
|
|
172
|
-
const
|
|
173
|
-
return t[
|
|
235
|
+
const r = s.split("=");
|
|
236
|
+
return t[r[0]] = r[1], t;
|
|
174
237
|
}, {}), P = (e, t) => {
|
|
175
|
-
const { state: s, publish:
|
|
238
|
+
const { state: s, publish: r, window: n } = t, { host: o, pathname: c, search: h } = n.location, i = c, d = B(h), a = {
|
|
176
239
|
host: o,
|
|
177
240
|
path: i,
|
|
178
241
|
query: d
|
|
179
242
|
};
|
|
180
|
-
s.store("route").update(
|
|
243
|
+
s.store("route").update(a), r(F, a);
|
|
181
244
|
}, U = (e) => {
|
|
182
245
|
const { subscribe: t } = e;
|
|
183
|
-
t(
|
|
184
|
-
},
|
|
185
|
-
const { publish: t, subscribe: s, state:
|
|
186
|
-
|
|
187
|
-
}, K = (e) => {
|
|
188
|
-
setTimeout(() => e.publish(m, null), 0);
|
|
246
|
+
t(O, L);
|
|
247
|
+
}, z = (e) => {
|
|
248
|
+
const { publish: t, subscribe: s, state: r, window: n } = e;
|
|
249
|
+
T(r), n.addEventListener("popstate", () => t(m, null)), s(m, P);
|
|
189
250
|
}, V = (e) => {
|
|
190
|
-
|
|
191
|
-
},
|
|
251
|
+
setTimeout(() => e.publish(m, null), 0);
|
|
252
|
+
}, K = (e) => {
|
|
253
|
+
z(e), U(e), V(e);
|
|
254
|
+
}, _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
192
255
|
__proto__: null,
|
|
193
|
-
publishLocation:
|
|
194
|
-
startNavigation:
|
|
195
|
-
subscribeToHistoryChange:
|
|
256
|
+
publishLocation: V,
|
|
257
|
+
startNavigation: K,
|
|
258
|
+
subscribeToHistoryChange: z,
|
|
196
259
|
subscribeToNavigation: U
|
|
197
260
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
198
261
|
class R {
|
|
199
|
-
constructor({ window: t, document: s, publish:
|
|
200
|
-
this.window = t, this.document = s, this.publish =
|
|
262
|
+
constructor({ window: t, document: s, publish: r, subscribe: n, bus: o, state: c, renderKit: h }) {
|
|
263
|
+
this.window = t, this.document = s, this.publish = r, this.subscribe = n, this.bus = o, this.state = c, this.renderKit = h, this.roots = [];
|
|
201
264
|
}
|
|
202
265
|
render(t, s) {
|
|
203
|
-
const
|
|
204
|
-
return this.roots.push(
|
|
266
|
+
const r = wt(t, s, this.renderKit);
|
|
267
|
+
return this.roots.push(r), r;
|
|
205
268
|
}
|
|
206
269
|
startNavigation() {
|
|
207
|
-
|
|
270
|
+
K(this);
|
|
208
271
|
}
|
|
209
272
|
}
|
|
210
273
|
const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
211
274
|
__proto__: null,
|
|
212
275
|
App: R
|
|
213
276
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
214
|
-
class
|
|
277
|
+
class q {
|
|
215
278
|
constructor() {
|
|
216
279
|
this.lookup = {};
|
|
217
280
|
}
|
|
218
|
-
add(t, s,
|
|
281
|
+
add(t, s, r) {
|
|
219
282
|
this.ensureArrayFor(t);
|
|
220
|
-
const
|
|
283
|
+
const n = {
|
|
221
284
|
listener: s,
|
|
222
|
-
index:
|
|
285
|
+
index: r,
|
|
223
286
|
matcher: t
|
|
224
287
|
};
|
|
225
|
-
return this.lookup[t].push(
|
|
288
|
+
return this.lookup[t].push(n), () => this.remove(n);
|
|
226
289
|
}
|
|
227
290
|
remove(t) {
|
|
228
|
-
this.lookup[t.matcher] && (this.lookup[t.matcher] = this.lookup[t.matcher].reduce((s,
|
|
291
|
+
this.lookup[t.matcher] && (this.lookup[t.matcher] = this.lookup[t.matcher].reduce((s, r) => (r !== t && s.push(r), s), []));
|
|
229
292
|
}
|
|
230
293
|
matches(t) {
|
|
231
294
|
return this.lookup[t] || [];
|
|
@@ -234,20 +297,20 @@ class J {
|
|
|
234
297
|
this.lookup[t] || (this.lookup[t] = []);
|
|
235
298
|
}
|
|
236
299
|
}
|
|
237
|
-
class
|
|
300
|
+
class J {
|
|
238
301
|
constructor() {
|
|
239
302
|
this.lookup = [];
|
|
240
303
|
}
|
|
241
|
-
add(t, s,
|
|
242
|
-
const
|
|
304
|
+
add(t, s, r) {
|
|
305
|
+
const n = {
|
|
243
306
|
listener: s,
|
|
244
|
-
index:
|
|
307
|
+
index: r,
|
|
245
308
|
matcher: t
|
|
246
309
|
};
|
|
247
|
-
return this.lookup.push(
|
|
310
|
+
return this.lookup.push(n), () => this.remove(n);
|
|
248
311
|
}
|
|
249
312
|
remove(t) {
|
|
250
|
-
this.lookup = this.lookup.reduce((s,
|
|
313
|
+
this.lookup = this.lookup.reduce((s, r) => (r !== t && s.push(r), s), []);
|
|
251
314
|
}
|
|
252
315
|
matches(t) {
|
|
253
316
|
return this.lookup.filter(
|
|
@@ -257,26 +320,26 @@ class q {
|
|
|
257
320
|
}
|
|
258
321
|
class H {
|
|
259
322
|
constructor() {
|
|
260
|
-
this.exactSubscriptions = new
|
|
323
|
+
this.exactSubscriptions = new q(), this.fuzzySubscriptions = new J(), this.currentIndex = 0;
|
|
261
324
|
}
|
|
262
325
|
subscribe(t, s) {
|
|
263
|
-
let
|
|
264
|
-
return typeof t == "string" ?
|
|
326
|
+
let r;
|
|
327
|
+
return typeof t == "string" ? r = this.exactSubscriptions.add(
|
|
265
328
|
t,
|
|
266
329
|
s,
|
|
267
330
|
this.currentIndex
|
|
268
|
-
) :
|
|
331
|
+
) : r = this.fuzzySubscriptions.add(
|
|
269
332
|
t,
|
|
270
333
|
s,
|
|
271
334
|
this.currentIndex
|
|
272
|
-
), this.currentIndex += 1,
|
|
335
|
+
), this.currentIndex += 1, r;
|
|
273
336
|
}
|
|
274
337
|
publish(t, s) {
|
|
275
338
|
[
|
|
276
339
|
...this.exactSubscriptions.matches(t),
|
|
277
340
|
...this.fuzzySubscriptions.matches(t)
|
|
278
|
-
].sort((
|
|
279
|
-
|
|
341
|
+
].sort((n, o) => n.index - o.index).forEach((n) => {
|
|
342
|
+
n.listener(s, this.listenerOptions(t));
|
|
280
343
|
});
|
|
281
344
|
}
|
|
282
345
|
addListenerOptions(t) {
|
|
@@ -294,22 +357,22 @@ const I = () => {
|
|
|
294
357
|
const e = new H();
|
|
295
358
|
return {
|
|
296
359
|
bus: e,
|
|
297
|
-
publish: (
|
|
298
|
-
subscribe: (
|
|
360
|
+
publish: (r, n) => e.publish(r, n),
|
|
361
|
+
subscribe: (r, n) => e.subscribe(r, n)
|
|
299
362
|
};
|
|
300
363
|
}, me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
301
364
|
__proto__: null,
|
|
302
|
-
ExactSubscriptions:
|
|
303
|
-
FuzzySubscriptions:
|
|
365
|
+
ExactSubscriptions: q,
|
|
366
|
+
FuzzySubscriptions: J,
|
|
304
367
|
JaxsBus: H,
|
|
305
368
|
createBus: I
|
|
306
369
|
}, Symbol.toStringTag, { value: "Module" })), f = (e) => Array.isArray(e), g = (e) => e !== null && !f(e) && typeof e == "object", Nt = (e, t) => e === t, jt = (e, t) => Object.keys(e).length === Object.keys(t).length, kt = (e, t) => !(g(e) && g(t)) || !jt(e, t) ? !1 : Object.keys(e).every((s) => {
|
|
307
|
-
const
|
|
308
|
-
return
|
|
309
|
-
}),
|
|
310
|
-
const
|
|
311
|
-
return
|
|
312
|
-
}),
|
|
370
|
+
const r = e[s], n = t[s];
|
|
371
|
+
return x(r, n);
|
|
372
|
+
}), Mt = (e, t) => !(f(e) && f(t)) || e.length !== t.length ? !1 : e.every((s, r) => {
|
|
373
|
+
const n = t[r];
|
|
374
|
+
return x(s, n);
|
|
375
|
+
}), x = (e, t) => g(e) ? kt(e, t) : f(e) ? Mt(e, t) : Nt(e, t);
|
|
313
376
|
class b {
|
|
314
377
|
constructor(t) {
|
|
315
378
|
this.store = t;
|
|
@@ -324,9 +387,9 @@ class b {
|
|
|
324
387
|
return this.store.value;
|
|
325
388
|
}
|
|
326
389
|
addUpdaterFunction(t, s) {
|
|
327
|
-
this.constructor.prototype[t] = (...
|
|
328
|
-
const
|
|
329
|
-
this.update(
|
|
390
|
+
this.constructor.prototype[t] = (...r) => {
|
|
391
|
+
const n = s(this.value, ...r);
|
|
392
|
+
this.update(n);
|
|
330
393
|
};
|
|
331
394
|
}
|
|
332
395
|
addUpdaterFunctions(t) {
|
|
@@ -334,7 +397,13 @@ class b {
|
|
|
334
397
|
this.addUpdaterFunction(s, t[s]);
|
|
335
398
|
}
|
|
336
399
|
}
|
|
337
|
-
class
|
|
400
|
+
class A extends b {
|
|
401
|
+
addUpdaterFunction(t, s) {
|
|
402
|
+
this.constructor.prototype[t] = (...r) => {
|
|
403
|
+
const n = s(this.value, ...r);
|
|
404
|
+
this.update(n);
|
|
405
|
+
};
|
|
406
|
+
}
|
|
338
407
|
push(t) {
|
|
339
408
|
const s = [...this.value, t];
|
|
340
409
|
this.update(s);
|
|
@@ -361,8 +430,8 @@ class x extends b {
|
|
|
361
430
|
s.sort(t), this.update(s);
|
|
362
431
|
}
|
|
363
432
|
insertAt(t, s) {
|
|
364
|
-
const
|
|
365
|
-
|
|
433
|
+
const r = [...this.value];
|
|
434
|
+
r.splice(t, 0, s), this.update(r);
|
|
366
435
|
}
|
|
367
436
|
}
|
|
368
437
|
class y {
|
|
@@ -383,7 +452,7 @@ class y {
|
|
|
383
452
|
this.updateValue(t);
|
|
384
453
|
}
|
|
385
454
|
updateValue(t) {
|
|
386
|
-
|
|
455
|
+
x(this._value, t) || (this._value = t, this.parent.notify(this.name));
|
|
387
456
|
}
|
|
388
457
|
getUpdatedValue(t) {
|
|
389
458
|
return t(this.value);
|
|
@@ -395,10 +464,10 @@ class y {
|
|
|
395
464
|
this.updater.addUpdaterFunction(t, s);
|
|
396
465
|
}
|
|
397
466
|
addSorter(t, s) {
|
|
398
|
-
this.updater instanceof
|
|
467
|
+
this.updater instanceof A && this.updater.addSorter(t, s);
|
|
399
468
|
}
|
|
400
469
|
}
|
|
401
|
-
class
|
|
470
|
+
class G extends b {
|
|
402
471
|
toggle() {
|
|
403
472
|
const t = !this.value;
|
|
404
473
|
this.update(t);
|
|
@@ -409,37 +478,49 @@ class Q extends b {
|
|
|
409
478
|
setFalse() {
|
|
410
479
|
this.update(!1);
|
|
411
480
|
}
|
|
481
|
+
addUpdaterFunction(t, s) {
|
|
482
|
+
this.constructor.prototype[t] = (...r) => {
|
|
483
|
+
const n = s(this.value, ...r);
|
|
484
|
+
this.update(n);
|
|
485
|
+
};
|
|
486
|
+
}
|
|
412
487
|
}
|
|
413
|
-
class
|
|
488
|
+
class C extends b {
|
|
489
|
+
addUpdaterFunction(t, s) {
|
|
490
|
+
this.constructor.prototype[t] = (...r) => {
|
|
491
|
+
const n = s(this.value, ...r);
|
|
492
|
+
this.update(n);
|
|
493
|
+
};
|
|
494
|
+
}
|
|
414
495
|
updateAttribute(t, s) {
|
|
415
|
-
const
|
|
416
|
-
|
|
496
|
+
const r = { ...this.value };
|
|
497
|
+
r[t] = s, this.update(r);
|
|
417
498
|
}
|
|
418
499
|
}
|
|
419
|
-
const
|
|
420
|
-
class
|
|
500
|
+
const w = "state";
|
|
501
|
+
class Q {
|
|
421
502
|
constructor(t) {
|
|
422
|
-
this.publisher = t, this.stores = {}, this.eventNamePrefix =
|
|
503
|
+
this.publisher = t, this.stores = {}, this.eventNamePrefix = w, this.notifications = /* @__PURE__ */ new Set(), this.inTransaction = !1;
|
|
423
504
|
}
|
|
424
505
|
create(t, s) {
|
|
425
|
-
const
|
|
506
|
+
const r = new y({
|
|
426
507
|
name: t,
|
|
427
508
|
parent: this,
|
|
428
509
|
value: s
|
|
429
510
|
});
|
|
430
|
-
return this.stores[t] =
|
|
511
|
+
return this.stores[t] = r, r;
|
|
431
512
|
}
|
|
432
513
|
createBoolean(t, s) {
|
|
433
|
-
const
|
|
434
|
-
return
|
|
514
|
+
const r = this.create(t, s);
|
|
515
|
+
return r.updater = new G(r), r;
|
|
435
516
|
}
|
|
436
517
|
createRecord(t, s) {
|
|
437
|
-
const
|
|
438
|
-
return
|
|
518
|
+
const r = this.create(t, s);
|
|
519
|
+
return r.updater = new C(r), r;
|
|
439
520
|
}
|
|
440
521
|
createList(t, s) {
|
|
441
|
-
const
|
|
442
|
-
return
|
|
522
|
+
const r = this.create(t, s);
|
|
523
|
+
return r.updater = new A(r), r;
|
|
443
524
|
}
|
|
444
525
|
store(t) {
|
|
445
526
|
return this.stores[t] || new y({
|
|
@@ -452,7 +533,7 @@ class G {
|
|
|
452
533
|
return this.store(t).value;
|
|
453
534
|
}
|
|
454
535
|
getAll(t) {
|
|
455
|
-
return t.reduce((s,
|
|
536
|
+
return t.reduce((s, r) => (s[r] = this.get(r), s), {});
|
|
456
537
|
}
|
|
457
538
|
notify(t) {
|
|
458
539
|
this.inTransaction ? this.notifications.add(t) : this.publish(t);
|
|
@@ -478,18 +559,17 @@ class G {
|
|
|
478
559
|
return `${this.eventNamePrefix}:${t}`;
|
|
479
560
|
}
|
|
480
561
|
}
|
|
481
|
-
const
|
|
562
|
+
const W = (e) => new Q(e), fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
482
563
|
__proto__: null,
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
eventName: A
|
|
564
|
+
State: Q,
|
|
565
|
+
Store: y,
|
|
566
|
+
StoreUpdaterBoolean: G,
|
|
567
|
+
StoreUpdaterList: A,
|
|
568
|
+
StoreUpdaterObject: C,
|
|
569
|
+
createState: W,
|
|
570
|
+
eventName: w
|
|
491
571
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
492
|
-
class
|
|
572
|
+
class Ot {
|
|
493
573
|
constructor(t) {
|
|
494
574
|
this.setupDomEnvironment(t);
|
|
495
575
|
}
|
|
@@ -508,11 +588,11 @@ class $t {
|
|
|
508
588
|
t.window ? (this.window = t.window, this.document = this.window.document) : t.document ? (this.window = t.document.defaultView, this.document = t.document) : (this.window = window, this.document = document);
|
|
509
589
|
}
|
|
510
590
|
setupBus() {
|
|
511
|
-
const { publish: t, subscribe: s, bus:
|
|
512
|
-
this.publish = t, this.subscribe = s, this.bus =
|
|
591
|
+
const { publish: t, subscribe: s, bus: r } = I();
|
|
592
|
+
this.publish = t, this.subscribe = s, this.bus = r;
|
|
513
593
|
}
|
|
514
594
|
setupState() {
|
|
515
|
-
this.state =
|
|
595
|
+
this.state = W(this.publish);
|
|
516
596
|
}
|
|
517
597
|
addBusOptions() {
|
|
518
598
|
this.bus.addListenerOptions({
|
|
@@ -531,82 +611,82 @@ class $t {
|
|
|
531
611
|
};
|
|
532
612
|
}
|
|
533
613
|
}
|
|
534
|
-
const
|
|
535
|
-
const s = new
|
|
614
|
+
const be = (e = {}) => {
|
|
615
|
+
const s = new Ot(e).setup();
|
|
536
616
|
return s.startNavigation(), s;
|
|
537
617
|
};
|
|
538
|
-
var
|
|
618
|
+
var u = /* @__PURE__ */ ((e) => (e[e.removeNode = 0] = "removeNode", e[e.insertNode = 1] = "insertNode", e[e.replaceNode = 2] = "replaceNode", e[e.removeAttribute = 3] = "removeAttribute", e[e.addAttribute = 4] = "addAttribute", e[e.updateAttribute = 5] = "updateAttribute", e[e.removeEvent = 6] = "removeEvent", e[e.addEvent = 7] = "addEvent", e[e.updateEvent = 8] = "updateEvent", e[e.changeValue = 9] = "changeValue", e[e.changeText = 10] = "changeText", e))(u || {});
|
|
539
619
|
const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
540
620
|
__proto__: null,
|
|
541
|
-
ChangeInstructionTypes:
|
|
542
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
621
|
+
ChangeInstructionTypes: u
|
|
622
|
+
}, Symbol.toStringTag, { value: "Module" })), Ft = (e, t) => ({
|
|
543
623
|
source: e,
|
|
544
624
|
target: t,
|
|
545
|
-
type:
|
|
625
|
+
type: u.changeText,
|
|
546
626
|
data: {}
|
|
547
|
-
}),
|
|
627
|
+
}), Tt = (e, t) => ({
|
|
548
628
|
source: e,
|
|
549
629
|
target: t,
|
|
550
|
-
type:
|
|
630
|
+
type: u.replaceNode,
|
|
551
631
|
data: {}
|
|
552
|
-
}),
|
|
632
|
+
}), $t = (e, t, s) => ({
|
|
553
633
|
source: e,
|
|
554
634
|
target: t,
|
|
555
635
|
data: s,
|
|
556
|
-
type:
|
|
636
|
+
type: u.removeAttribute
|
|
557
637
|
}), Dt = (e, t, s) => ({
|
|
558
638
|
source: e,
|
|
559
639
|
target: t,
|
|
560
640
|
data: s,
|
|
561
|
-
type:
|
|
562
|
-
}),
|
|
641
|
+
type: u.addAttribute
|
|
642
|
+
}), Lt = (e, t, s) => ({
|
|
563
643
|
source: e,
|
|
564
644
|
target: t,
|
|
565
645
|
data: s,
|
|
566
|
-
type:
|
|
567
|
-
}),
|
|
646
|
+
type: u.updateAttribute
|
|
647
|
+
}), Bt = (e, t, s) => ({
|
|
568
648
|
source: e,
|
|
569
649
|
target: t,
|
|
570
650
|
data: s,
|
|
571
|
-
type:
|
|
651
|
+
type: u.removeEvent
|
|
572
652
|
}), Pt = (e, t, s) => ({
|
|
573
653
|
source: e,
|
|
574
654
|
target: t,
|
|
575
655
|
data: s,
|
|
576
|
-
type:
|
|
656
|
+
type: u.addEvent
|
|
577
657
|
}), Ut = (e, t, s) => ({
|
|
578
658
|
source: e,
|
|
579
659
|
target: t,
|
|
580
660
|
data: s,
|
|
581
|
-
type:
|
|
661
|
+
type: u.updateEvent
|
|
582
662
|
}), S = (e) => ({
|
|
583
663
|
source: e,
|
|
584
664
|
target: e,
|
|
585
665
|
// for type crap only
|
|
586
|
-
type:
|
|
666
|
+
type: u.removeNode,
|
|
587
667
|
data: {}
|
|
588
668
|
}), v = (e, t) => ({
|
|
589
669
|
target: e,
|
|
590
670
|
source: e,
|
|
591
671
|
// for type crap only
|
|
592
|
-
type:
|
|
672
|
+
type: u.insertNode,
|
|
593
673
|
data: t
|
|
594
|
-
}),
|
|
674
|
+
}), zt = (e, t, s) => ({
|
|
595
675
|
source: e,
|
|
596
676
|
target: t,
|
|
597
|
-
type:
|
|
677
|
+
type: u.changeValue,
|
|
598
678
|
data: s
|
|
599
|
-
}),
|
|
600
|
-
class
|
|
679
|
+
}), Vt = (e, t) => e.type > t.type ? 1 : e.type < t.type ? -1 : 0, _ = { index: -1 };
|
|
680
|
+
class Kt {
|
|
601
681
|
constructor() {
|
|
602
682
|
this.map = {};
|
|
603
683
|
}
|
|
604
684
|
populate(t) {
|
|
605
|
-
t.forEach((s,
|
|
606
|
-
const
|
|
607
|
-
|
|
685
|
+
t.forEach((s, r) => {
|
|
686
|
+
const n = s.__jsx;
|
|
687
|
+
n && (this.map[n] = this.map[n] || [], this.map[n].push({
|
|
608
688
|
element: s,
|
|
609
|
-
index:
|
|
689
|
+
index: r
|
|
610
690
|
}));
|
|
611
691
|
});
|
|
612
692
|
}
|
|
@@ -617,8 +697,8 @@ class Vt {
|
|
|
617
697
|
clear(t) {
|
|
618
698
|
const s = t && t.__jsx;
|
|
619
699
|
if (!(s && this.map[s] && this.map[s].length)) return;
|
|
620
|
-
const
|
|
621
|
-
this.map[s] =
|
|
700
|
+
const r = this.map[s];
|
|
701
|
+
this.map[s] = r.reduce((n, o) => (o.element !== t && n.push(o), n), []);
|
|
622
702
|
}
|
|
623
703
|
check(t) {
|
|
624
704
|
const s = t && t.__jsx;
|
|
@@ -628,46 +708,46 @@ class Vt {
|
|
|
628
708
|
return Object.values(this.map).flat();
|
|
629
709
|
}
|
|
630
710
|
}
|
|
631
|
-
const
|
|
632
|
-
const t = new
|
|
711
|
+
const N = (e) => {
|
|
712
|
+
const t = new Kt();
|
|
633
713
|
return t.populate(e), t;
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
let i, d,
|
|
714
|
+
}, X = (e, t, s = !1) => {
|
|
715
|
+
const r = [], n = e.attributes, o = n.length, c = t.attributes, h = c.length;
|
|
716
|
+
let i, d, a;
|
|
637
717
|
for (i = 0; i < o; i++) {
|
|
638
|
-
|
|
639
|
-
const l =
|
|
718
|
+
a = null;
|
|
719
|
+
const l = n.item(i);
|
|
640
720
|
if (l) {
|
|
641
721
|
for (d = 0; d < h; d++) {
|
|
642
|
-
const p =
|
|
722
|
+
const p = c.item(d);
|
|
643
723
|
if (p && l.name == p.name) {
|
|
644
|
-
|
|
724
|
+
a = p;
|
|
645
725
|
break;
|
|
646
726
|
}
|
|
647
727
|
}
|
|
648
|
-
|
|
649
|
-
|
|
728
|
+
a ? l.value !== a.value && r.push(
|
|
729
|
+
Lt(e, t, {
|
|
650
730
|
name: l.name,
|
|
651
|
-
value:
|
|
731
|
+
value: a.value,
|
|
652
732
|
isSvg: s
|
|
653
733
|
})
|
|
654
|
-
) :
|
|
655
|
-
|
|
734
|
+
) : r.push(
|
|
735
|
+
$t(e, t, { name: l.name, isSvg: s })
|
|
656
736
|
);
|
|
657
737
|
}
|
|
658
738
|
}
|
|
659
739
|
for (i = 0; i < h; i++) {
|
|
660
|
-
|
|
661
|
-
const l =
|
|
740
|
+
a = null;
|
|
741
|
+
const l = c.item(i);
|
|
662
742
|
if (l) {
|
|
663
743
|
for (d = 0; d < o; d++) {
|
|
664
|
-
const p =
|
|
744
|
+
const p = n.item(d);
|
|
665
745
|
if (p && p.name == l.name) {
|
|
666
|
-
|
|
746
|
+
a = p;
|
|
667
747
|
break;
|
|
668
748
|
}
|
|
669
749
|
}
|
|
670
|
-
|
|
750
|
+
a || r.push(
|
|
671
751
|
Dt(e, t, {
|
|
672
752
|
name: l.name,
|
|
673
753
|
value: l.value,
|
|
@@ -676,11 +756,11 @@ const w = (e) => {
|
|
|
676
756
|
);
|
|
677
757
|
}
|
|
678
758
|
}
|
|
679
|
-
return
|
|
759
|
+
return r;
|
|
680
760
|
}, Rt = (e, t) => {
|
|
681
|
-
const s = [],
|
|
761
|
+
const s = [], r = e.eventMaps, n = t.eventMaps, o = Object.keys(r), c = Object.keys(n);
|
|
682
762
|
return o.forEach((h) => {
|
|
683
|
-
const i =
|
|
763
|
+
const i = r[h], d = n[h];
|
|
684
764
|
d ? d.busEvent !== i.busEvent && s.push(
|
|
685
765
|
Ut(e, t, {
|
|
686
766
|
name: h,
|
|
@@ -688,13 +768,13 @@ const w = (e) => {
|
|
|
688
768
|
sourceValue: i.listener
|
|
689
769
|
})
|
|
690
770
|
) : s.push(
|
|
691
|
-
|
|
771
|
+
Bt(e, t, {
|
|
692
772
|
name: i.domEvent,
|
|
693
773
|
value: i.listener
|
|
694
774
|
})
|
|
695
775
|
);
|
|
696
|
-
}),
|
|
697
|
-
const i =
|
|
776
|
+
}), c.forEach((h) => {
|
|
777
|
+
const i = r[h], d = n[h];
|
|
698
778
|
i || s.push(
|
|
699
779
|
Pt(e, t, {
|
|
700
780
|
name: d.domEvent,
|
|
@@ -702,40 +782,40 @@ const w = (e) => {
|
|
|
702
782
|
})
|
|
703
783
|
);
|
|
704
784
|
}), s;
|
|
705
|
-
},
|
|
706
|
-
if (
|
|
785
|
+
}, qt = (e) => e.tagName !== "INPUT", Jt = (e, t) => e.value === t.value, Ht = (e, t) => {
|
|
786
|
+
if (qt(e) || Jt(e, t))
|
|
707
787
|
return [];
|
|
708
|
-
const s = e,
|
|
709
|
-
return [
|
|
788
|
+
const s = e, r = t;
|
|
789
|
+
return [zt(s, r, { name: "value", value: r.value })];
|
|
710
790
|
}, It = (e, t) => {
|
|
711
|
-
const s =
|
|
712
|
-
return s.concat(
|
|
713
|
-
},
|
|
714
|
-
let
|
|
715
|
-
if (e.nodeType === 1 &&
|
|
716
|
-
const
|
|
717
|
-
|
|
791
|
+
const s = X(e, t), r = Rt(e, t), n = Ht(e, t);
|
|
792
|
+
return s.concat(r).concat(n);
|
|
793
|
+
}, Gt = (e, t) => X(e, t, !0), Ct = (e, t) => e.textContent !== t.textContent ? [Ft(e, t)] : [], Qt = (e, t, s) => {
|
|
794
|
+
let r = [];
|
|
795
|
+
if (e.nodeType === 1 && ut(e)) {
|
|
796
|
+
const n = e, o = t, c = Gt(n, o), h = s(
|
|
797
|
+
n.childNodes,
|
|
718
798
|
o.childNodes,
|
|
719
|
-
|
|
799
|
+
n
|
|
720
800
|
);
|
|
721
|
-
|
|
801
|
+
r = c.concat(h);
|
|
722
802
|
} else if (e.nodeType === 1) {
|
|
723
|
-
const
|
|
724
|
-
|
|
803
|
+
const n = e, o = t, c = It(n, o), h = s(
|
|
804
|
+
n.childNodes,
|
|
725
805
|
o.childNodes,
|
|
726
|
-
|
|
806
|
+
n
|
|
727
807
|
);
|
|
728
|
-
|
|
729
|
-
} else e.nodeType === 3 && (
|
|
730
|
-
return
|
|
731
|
-
},
|
|
732
|
-
const
|
|
808
|
+
r = c.concat(h);
|
|
809
|
+
} else e.nodeType === 3 && (r = Ct(e, t));
|
|
810
|
+
return r;
|
|
811
|
+
}, Y = (e, t, s) => {
|
|
812
|
+
const r = [], n = Wt(e, t), o = N(e), c = N(t), h = [];
|
|
733
813
|
let i = 0;
|
|
734
|
-
for (; i <
|
|
735
|
-
const
|
|
736
|
-
if (l &&
|
|
814
|
+
for (; i < n; i++) {
|
|
815
|
+
const a = e[i], l = t[i];
|
|
816
|
+
if (l && c.check(l)) {
|
|
737
817
|
const p = o.pullMatch(l);
|
|
738
|
-
|
|
818
|
+
c.clear(l), p.element ? (p.index !== i && r.push(
|
|
739
819
|
v(p.element, {
|
|
740
820
|
parent: s,
|
|
741
821
|
index: i
|
|
@@ -743,35 +823,35 @@ const w = (e) => {
|
|
|
743
823
|
), h.push({
|
|
744
824
|
source: p.element,
|
|
745
825
|
target: l
|
|
746
|
-
})) :
|
|
826
|
+
})) : a ? c.check(a) ? r.push(
|
|
747
827
|
v(l, { parent: s, index: i })
|
|
748
|
-
) : (o.clear(
|
|
749
|
-
|
|
750
|
-
)) :
|
|
828
|
+
) : (o.clear(a), r.push(
|
|
829
|
+
Tt(a, l)
|
|
830
|
+
)) : r.push(
|
|
751
831
|
v(l, { parent: s, index: i })
|
|
752
832
|
);
|
|
753
|
-
} else
|
|
833
|
+
} else a && o.pullMatch(a).element && r.push(S(a));
|
|
754
834
|
}
|
|
755
|
-
o.remaining().forEach(({ element:
|
|
756
|
-
|
|
835
|
+
o.remaining().forEach(({ element: a }) => {
|
|
836
|
+
r.push(S(a));
|
|
757
837
|
});
|
|
758
838
|
const d = h.reduce(
|
|
759
|
-
(
|
|
760
|
-
|
|
839
|
+
(a, { source: l, target: p }) => a.concat(
|
|
840
|
+
Qt(l, p, Y)
|
|
761
841
|
),
|
|
762
842
|
[]
|
|
763
843
|
);
|
|
764
|
-
return
|
|
765
|
-
},
|
|
766
|
-
const s = e.length,
|
|
767
|
-
return s >
|
|
768
|
-
},
|
|
769
|
-
|
|
770
|
-
|
|
844
|
+
return r.concat(d).sort(Vt);
|
|
845
|
+
}, Wt = (e, t) => {
|
|
846
|
+
const s = e.length, r = t.length;
|
|
847
|
+
return s > r ? s : r;
|
|
848
|
+
}, Xt = (e, t, s) => {
|
|
849
|
+
Y(e, t, s).forEach((n) => {
|
|
850
|
+
Yt(n);
|
|
771
851
|
});
|
|
852
|
+
}, Yt = (e) => {
|
|
853
|
+
(he[e.type] || Zt)(e);
|
|
772
854
|
}, Zt = (e) => {
|
|
773
|
-
(he[e.type] || Ct)(e);
|
|
774
|
-
}, Ct = (e) => {
|
|
775
855
|
}, te = (e) => {
|
|
776
856
|
const { source: t, target: s } = e;
|
|
777
857
|
t.nodeValue = s.textContent;
|
|
@@ -779,47 +859,47 @@ const w = (e) => {
|
|
|
779
859
|
const { source: t } = e;
|
|
780
860
|
t.remove();
|
|
781
861
|
}, se = (e) => {
|
|
782
|
-
const { target: t, data: s } = e, { parent:
|
|
783
|
-
o ? o && o !== t &&
|
|
784
|
-
},
|
|
862
|
+
const { target: t, data: s } = e, { parent: r, index: n } = s, o = r.childNodes[n];
|
|
863
|
+
o ? o && o !== t && r.insertBefore(t, o) : r.appendChild(t);
|
|
864
|
+
}, re = (e) => {
|
|
785
865
|
const { source: t, target: s } = e;
|
|
786
866
|
t.replaceWith(s);
|
|
787
|
-
},
|
|
788
|
-
const { source: t, data: s } = e, { name:
|
|
789
|
-
|
|
790
|
-
},
|
|
791
|
-
const { source: t, data: s } = e, { name:
|
|
792
|
-
o ? t.setAttributeNS(null,
|
|
867
|
+
}, ne = (e) => {
|
|
868
|
+
const { source: t, data: s } = e, { name: r, isSvg: n } = s;
|
|
869
|
+
n ? t.removeAttributeNS(null, r) : t.removeAttribute(r);
|
|
870
|
+
}, Z = (e) => {
|
|
871
|
+
const { source: t, data: s } = e, { name: r, value: n, isSvg: o } = s;
|
|
872
|
+
o ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n);
|
|
793
873
|
}, oe = (e) => {
|
|
794
|
-
|
|
874
|
+
Z(e);
|
|
795
875
|
}, ie = (e) => {
|
|
796
|
-
const t = e.data, s = e.source, { name:
|
|
797
|
-
s.removeEventListener(
|
|
876
|
+
const t = e.data, s = e.source, { name: r, value: n } = t;
|
|
877
|
+
s.removeEventListener(r, n);
|
|
878
|
+
}, ue = (e) => {
|
|
879
|
+
const t = e.data, s = e.source, { name: r, value: n } = t;
|
|
880
|
+
s.addEventListener(r, n);
|
|
798
881
|
}, ae = (e) => {
|
|
799
|
-
const t = e.data, s = e.source, { name: n,
|
|
800
|
-
s.
|
|
882
|
+
const t = e.data, s = e.source, { name: r, sourceValue: n, targetValue: o } = t;
|
|
883
|
+
s.removeEventListener(r, n), s.addEventListener(r, o);
|
|
801
884
|
}, ce = (e) => {
|
|
802
|
-
const t = e.data, s = e.source, {
|
|
803
|
-
s.
|
|
804
|
-
}, ue = (e) => {
|
|
805
|
-
const t = e.data, s = e.source, { value: n } = t;
|
|
806
|
-
s.value = n;
|
|
885
|
+
const t = e.data, s = e.source, { value: r } = t;
|
|
886
|
+
s.value = r;
|
|
807
887
|
}, he = {
|
|
808
|
-
[
|
|
809
|
-
[
|
|
810
|
-
[
|
|
811
|
-
[
|
|
812
|
-
[
|
|
813
|
-
[
|
|
814
|
-
[
|
|
815
|
-
[
|
|
816
|
-
[
|
|
817
|
-
[
|
|
818
|
-
[
|
|
888
|
+
[u.changeText]: te,
|
|
889
|
+
[u.removeNode]: ee,
|
|
890
|
+
[u.insertNode]: se,
|
|
891
|
+
[u.replaceNode]: re,
|
|
892
|
+
[u.removeAttribute]: ne,
|
|
893
|
+
[u.addAttribute]: Z,
|
|
894
|
+
[u.updateAttribute]: oe,
|
|
895
|
+
[u.removeEvent]: ie,
|
|
896
|
+
[u.addEvent]: ue,
|
|
897
|
+
[u.updateEvent]: ae,
|
|
898
|
+
[u.changeValue]: ce
|
|
819
899
|
};
|
|
820
900
|
class le {
|
|
821
|
-
constructor({ Template: t, subscriptions: s, attributes:
|
|
822
|
-
this.Template = t, this.viewModel =
|
|
901
|
+
constructor({ Template: t, subscriptions: s, attributes: r, viewModel: n }) {
|
|
902
|
+
this.Template = t, this.viewModel = n, this.attributes = r, this.subscriptions = s, this.dom = [], this.parentElement = null;
|
|
823
903
|
}
|
|
824
904
|
render(t) {
|
|
825
905
|
return this.parentElement = t.parent, this.renderKit = t, this.subscribeForRerender(), this.dom = this.generateDom(t), this.dom;
|
|
@@ -830,8 +910,8 @@ class le {
|
|
|
830
910
|
...this.viewModel(
|
|
831
911
|
t.state.getAll(this.subscriptions)
|
|
832
912
|
)
|
|
833
|
-
},
|
|
834
|
-
return
|
|
913
|
+
}, r = this.Template(s);
|
|
914
|
+
return r ? r.render(t) : [];
|
|
835
915
|
}
|
|
836
916
|
rerender() {
|
|
837
917
|
if (!this.parentElement && this.dom[0]) {
|
|
@@ -839,7 +919,7 @@ class le {
|
|
|
839
919
|
this.parentElement = s;
|
|
840
920
|
}
|
|
841
921
|
const t = this.generateDom(this.renderKit);
|
|
842
|
-
|
|
922
|
+
Xt(this.dom, t, this.parentElement), this.parentElement && (this.dom = Array.from(this.parentElement.childNodes));
|
|
843
923
|
}
|
|
844
924
|
subscribeForRerender() {
|
|
845
925
|
const { subscribe: t } = this.renderKit;
|
|
@@ -848,31 +928,31 @@ class le {
|
|
|
848
928
|
});
|
|
849
929
|
}
|
|
850
930
|
eventName(t) {
|
|
851
|
-
return `${
|
|
931
|
+
return `${w}:${t}`;
|
|
852
932
|
}
|
|
853
933
|
}
|
|
854
934
|
const de = (e) => e, ge = ({
|
|
855
935
|
Template: e,
|
|
856
936
|
viewModel: t,
|
|
857
937
|
subscriptions: s
|
|
858
|
-
}) => (s = s || [], t = t || de, (
|
|
938
|
+
}) => (s = s || [], t = t || de, (r) => new le({ Template: e, viewModel: t, subscriptions: s, attributes: r })), ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
859
939
|
__proto__: null,
|
|
860
|
-
createRouteState:
|
|
861
|
-
events:
|
|
862
|
-
extractQueryParams:
|
|
863
|
-
findHref:
|
|
940
|
+
createRouteState: T,
|
|
941
|
+
events: St,
|
|
942
|
+
extractQueryParams: B,
|
|
943
|
+
findHref: $,
|
|
864
944
|
navigate: D,
|
|
865
|
-
onLinkClick:
|
|
945
|
+
onLinkClick: L,
|
|
866
946
|
onLocationChange: P,
|
|
867
|
-
start:
|
|
947
|
+
start: _t
|
|
868
948
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
869
949
|
export {
|
|
870
950
|
ve as JaxsTypes,
|
|
871
951
|
pe as appBuilding,
|
|
872
952
|
ge as bind,
|
|
873
|
-
|
|
953
|
+
be as createApp,
|
|
874
954
|
xt as jsx,
|
|
875
955
|
me as messageBus,
|
|
876
956
|
ye as navigation,
|
|
877
|
-
|
|
957
|
+
fe as state
|
|
878
958
|
};
|