jaxs 0.7.2 → 0.7.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 +683 -994
- package/dist/jaxs.js +257 -255
- package/dist/jaxs.umd.cjs +257 -255
- package/package.json +5 -3
package/dist/jaxs.umd.cjs
CHANGED
|
@@ -7,18 +7,22 @@
|
|
|
7
7
|
f((p.jaxs = {})))
|
|
8
8
|
})(this, function (p) {
|
|
9
9
|
'use strict'
|
|
10
|
-
const f = (e
|
|
11
|
-
|
|
10
|
+
const f = (e) => typeof e == 'string',
|
|
11
|
+
v = (e) => Array.isArray(e),
|
|
12
|
+
g = (e) => e !== null && !v(e) && typeof e == 'object',
|
|
13
|
+
rt = (e, t) => t.createElement(e),
|
|
14
|
+
it = (e, t) => {
|
|
12
15
|
for (const s in t) {
|
|
13
16
|
if (s === '__self') continue
|
|
14
17
|
const n = t[s].toString()
|
|
15
18
|
if (s === 'value') {
|
|
16
19
|
const r = e
|
|
17
20
|
r.value !== n && (r.value = n)
|
|
18
|
-
} else
|
|
21
|
+
} else
|
|
22
|
+
f(n) && n.trim() === '' ? e.removeAttribute(s) : e.setAttribute(s, n)
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
|
-
|
|
25
|
+
ot = (e, t, s) => {
|
|
22
26
|
const n = {}
|
|
23
27
|
for (const r in t) {
|
|
24
28
|
const i = t[r],
|
|
@@ -28,12 +32,12 @@
|
|
|
28
32
|
}
|
|
29
33
|
e.eventMaps = n
|
|
30
34
|
},
|
|
31
|
-
|
|
32
|
-
const r =
|
|
33
|
-
return
|
|
35
|
+
ut = (e, t, s, n) => {
|
|
36
|
+
const r = rt(e, n.document)
|
|
37
|
+
return it(r, t), ot(r, s, n.publish), r
|
|
34
38
|
},
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
y = 'http://www.w3.org/2000/svg',
|
|
40
|
+
at = {
|
|
37
41
|
animate: !0,
|
|
38
42
|
animateMotion: !0,
|
|
39
43
|
animateTransform: !0,
|
|
@@ -97,33 +101,33 @@
|
|
|
97
101
|
use: !0,
|
|
98
102
|
view: !0,
|
|
99
103
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const n = s.createElementNS(
|
|
104
|
+
ct = (e, t) => !!(at[e] || (e === 'a' && t === y)),
|
|
105
|
+
lt = (e, t, s) => {
|
|
106
|
+
const n = s.createElementNS(y, e)
|
|
103
107
|
for (const r in t)
|
|
104
108
|
r === '__self' ||
|
|
105
109
|
r === 'xmlns' ||
|
|
106
110
|
n.setAttributeNS(null, r, t[r].toString())
|
|
107
111
|
return n
|
|
108
112
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
class
|
|
113
|
+
ht = (e) => e.namespaceURI === y,
|
|
114
|
+
dt = (e, t) => t.createTextNode(e)
|
|
115
|
+
class pt {
|
|
112
116
|
constructor(t) {
|
|
113
117
|
this.value = t.toString()
|
|
114
118
|
}
|
|
115
119
|
render(t) {
|
|
116
|
-
const s =
|
|
120
|
+
const s = dt(this.value, t.document)
|
|
117
121
|
return (s.__jsx = 'TextNode'), [s]
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
const mt = (e) => typeof e == 'string' || typeof e == 'number',
|
|
125
|
+
ft = (e) => new pt(e),
|
|
126
|
+
bt = (e) => (mt(e) ? ft(e) : e),
|
|
127
|
+
S = (e) => vt(e).map(bt).flat(),
|
|
128
|
+
vt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
|
|
129
|
+
T = (e, t = {}) => S(e || t.children || []),
|
|
130
|
+
gt = (e, t = '') => {
|
|
127
131
|
const s = {},
|
|
128
132
|
n = {}
|
|
129
133
|
for (const r in e) {
|
|
@@ -133,27 +137,27 @@
|
|
|
133
137
|
n[a] = i ? i.toString() : ''
|
|
134
138
|
} else {
|
|
135
139
|
if (i === !1) continue
|
|
136
|
-
r === '__source' ? (s.__source = e.__source) : (s[r] =
|
|
140
|
+
r === '__source' ? (s.__source = e.__source) : (s[r] = yt(r, i, t))
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
return { attributes: s, events: n }
|
|
140
144
|
},
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
yt = (e, t, s = '') => (t == null ? s : t.toString()),
|
|
146
|
+
Et = (e, t) => {
|
|
143
147
|
const s = e || {},
|
|
144
|
-
n =
|
|
148
|
+
n = T(t, s)
|
|
145
149
|
return (s.children = s.children || n), s
|
|
146
150
|
},
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
j = (e, t, s, n = []) => e.reduce(At(t, s), n).flat(),
|
|
152
|
+
At = (e, t) => (s, n) =>
|
|
149
153
|
n
|
|
150
154
|
? Array.isArray(n)
|
|
151
|
-
?
|
|
155
|
+
? j(n, e, t, s)
|
|
152
156
|
: (n.render(e, t).forEach((r) => s.push(r)), s)
|
|
153
157
|
: s
|
|
154
|
-
class
|
|
158
|
+
class O {
|
|
155
159
|
constructor(t) {
|
|
156
|
-
this.collection =
|
|
160
|
+
this.collection = S(t)
|
|
157
161
|
}
|
|
158
162
|
render(t, s) {
|
|
159
163
|
this.parentElement = s
|
|
@@ -161,7 +165,7 @@
|
|
|
161
165
|
return this.attachToParent(n), n
|
|
162
166
|
}
|
|
163
167
|
generateDom(t) {
|
|
164
|
-
return
|
|
168
|
+
return j(this.collection, t, this.parentElement)
|
|
165
169
|
}
|
|
166
170
|
attachToParent(t) {
|
|
167
171
|
if (this.parentElement === void 0) return
|
|
@@ -169,7 +173,7 @@
|
|
|
169
173
|
t.forEach((n) => s.appendChild(n))
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
|
-
class
|
|
176
|
+
class xt {
|
|
173
177
|
constructor(t, s) {
|
|
174
178
|
;(this.type = t), (this.attributes = s)
|
|
175
179
|
}
|
|
@@ -197,14 +201,14 @@
|
|
|
197
201
|
return `${this.type}${t}${s}${n}`
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
|
-
class
|
|
204
|
+
class wt {
|
|
201
205
|
constructor(t, s, n = []) {
|
|
202
206
|
this.type = t
|
|
203
|
-
const { events: r, attributes: i } =
|
|
207
|
+
const { events: r, attributes: i } = gt(s)
|
|
204
208
|
;(this.events = r),
|
|
205
209
|
(this.attributes = i),
|
|
206
|
-
(this.isSvg =
|
|
207
|
-
(this.children = new
|
|
210
|
+
(this.isSvg = ct(this.type, this.attributes.xmlns)),
|
|
211
|
+
(this.children = new O(n))
|
|
208
212
|
}
|
|
209
213
|
render(t) {
|
|
210
214
|
const s = this.generateDom(t)
|
|
@@ -214,24 +218,24 @@
|
|
|
214
218
|
return this.isSvg ? this.generateSvgDom(t) : this.generateHtmlDom(t)
|
|
215
219
|
}
|
|
216
220
|
generateHtmlDom(t) {
|
|
217
|
-
const s =
|
|
221
|
+
const s = ut(this.type, this.attributes, this.events, t)
|
|
218
222
|
return (s.__jsx = this.jsxKey()), s
|
|
219
223
|
}
|
|
220
224
|
generateSvgDom(t) {
|
|
221
|
-
const s =
|
|
225
|
+
const s = lt(this.type, this.attributes, t.document)
|
|
222
226
|
return (s.__jsx = this.jsxKey()), s
|
|
223
227
|
}
|
|
224
228
|
jsxKey() {
|
|
225
|
-
return new
|
|
229
|
+
return new xt(this.type, this.attributes).generate()
|
|
226
230
|
}
|
|
227
231
|
}
|
|
228
|
-
const
|
|
229
|
-
typeof e == 'string' ? new
|
|
230
|
-
|
|
231
|
-
const s =
|
|
232
|
-
return new
|
|
232
|
+
const M = (e, t, ...s) =>
|
|
233
|
+
typeof e == 'string' ? new wt(e, t, s) : e(Et(t, s))
|
|
234
|
+
M.fragment = (e, t) => {
|
|
235
|
+
const s = T(t, e)
|
|
236
|
+
return new O(s)
|
|
233
237
|
}
|
|
234
|
-
class
|
|
238
|
+
class Nt {
|
|
235
239
|
constructor(t, s, n) {
|
|
236
240
|
;(this.template = t),
|
|
237
241
|
(this.selector = s),
|
|
@@ -256,44 +260,44 @@
|
|
|
256
260
|
return this.renderKit.document.querySelector(this.selector)
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
|
-
const
|
|
260
|
-
const n = new
|
|
263
|
+
const _t = (e, t, s) => {
|
|
264
|
+
const n = new Nt(e, t, s)
|
|
261
265
|
return n.renderAndAttach(s), n
|
|
262
266
|
},
|
|
263
|
-
|
|
264
|
-
|
|
267
|
+
k = 'go-to-href',
|
|
268
|
+
$ = 'go-to',
|
|
265
269
|
b = 'navigation:location-change',
|
|
266
|
-
|
|
267
|
-
|
|
270
|
+
D = 'navigation:route-change',
|
|
271
|
+
St = Object.freeze(
|
|
268
272
|
Object.defineProperty(
|
|
269
273
|
{
|
|
270
274
|
__proto__: null,
|
|
271
|
-
linkNavigationEvent:
|
|
275
|
+
linkNavigationEvent: k,
|
|
272
276
|
locationChangeEvent: b,
|
|
273
|
-
navigationEvent:
|
|
274
|
-
routeChangeEvent:
|
|
277
|
+
navigationEvent: $,
|
|
278
|
+
routeChangeEvent: D,
|
|
275
279
|
},
|
|
276
280
|
Symbol.toStringTag,
|
|
277
281
|
{ value: 'Module' },
|
|
278
282
|
),
|
|
279
283
|
),
|
|
280
|
-
|
|
284
|
+
P = (e) => {
|
|
281
285
|
e.create('route', { host: '', path: '', query: {} })
|
|
282
286
|
},
|
|
283
|
-
|
|
287
|
+
V = (e) => {
|
|
284
288
|
const t = e.closest('[href]')
|
|
285
289
|
return (t && t.getAttribute('href')) || ''
|
|
286
290
|
},
|
|
287
|
-
|
|
291
|
+
E = (e, { publish: t, window: s }) => {
|
|
288
292
|
s.history.pushState(null, '', e), t(b, null)
|
|
289
293
|
},
|
|
290
|
-
|
|
294
|
+
F = (e, t) => {
|
|
291
295
|
if (!e || !e.target) return
|
|
292
296
|
e.preventDefault()
|
|
293
|
-
const s =
|
|
294
|
-
|
|
297
|
+
const s = V(e.target)
|
|
298
|
+
E(s, t)
|
|
295
299
|
},
|
|
296
|
-
|
|
300
|
+
L = (e) =>
|
|
297
301
|
e
|
|
298
302
|
.replace(/^\?/, '')
|
|
299
303
|
.split('&')
|
|
@@ -302,45 +306,45 @@
|
|
|
302
306
|
const n = s.split('=')
|
|
303
307
|
return (t[n[0]] = n[1]), t
|
|
304
308
|
}, {}),
|
|
305
|
-
|
|
309
|
+
z = (e, t) => {
|
|
306
310
|
const { state: s, publish: n, window: r } = t,
|
|
307
311
|
{ host: i, pathname: a, search: l } = r.location,
|
|
308
312
|
u = a,
|
|
309
|
-
d =
|
|
313
|
+
d = L(l),
|
|
310
314
|
c = { host: i, path: u, query: d }
|
|
311
|
-
s.store('route').update(c), n(
|
|
315
|
+
s.store('route').update(c), n(D, c)
|
|
312
316
|
},
|
|
313
|
-
|
|
317
|
+
B = (e) => {
|
|
314
318
|
const { subscribe: t } = e
|
|
315
|
-
t(
|
|
316
|
-
t(
|
|
317
|
-
|
|
319
|
+
t(k, F),
|
|
320
|
+
t($, (s, n) => {
|
|
321
|
+
E(s, n)
|
|
318
322
|
})
|
|
319
323
|
},
|
|
320
|
-
|
|
324
|
+
K = (e) => {
|
|
321
325
|
const { publish: t, subscribe: s, state: n, window: r } = e
|
|
322
|
-
|
|
326
|
+
P(n), r.addEventListener('popstate', () => t(b, null)), s(b, z)
|
|
323
327
|
},
|
|
324
|
-
|
|
328
|
+
R = (e) => {
|
|
325
329
|
setTimeout(() => e.publish(b, null), 0)
|
|
326
330
|
},
|
|
327
|
-
|
|
328
|
-
|
|
331
|
+
U = (e) => {
|
|
332
|
+
K(e), B(e), R(e)
|
|
329
333
|
},
|
|
330
|
-
|
|
334
|
+
Tt = Object.freeze(
|
|
331
335
|
Object.defineProperty(
|
|
332
336
|
{
|
|
333
337
|
__proto__: null,
|
|
334
|
-
publishLocation:
|
|
335
|
-
startNavigation:
|
|
336
|
-
subscribeToHistoryChange:
|
|
337
|
-
subscribeToNavigation:
|
|
338
|
+
publishLocation: R,
|
|
339
|
+
startNavigation: U,
|
|
340
|
+
subscribeToHistoryChange: K,
|
|
341
|
+
subscribeToNavigation: B,
|
|
338
342
|
},
|
|
339
343
|
Symbol.toStringTag,
|
|
340
344
|
{ value: 'Module' },
|
|
341
345
|
),
|
|
342
346
|
)
|
|
343
|
-
class
|
|
347
|
+
class C {
|
|
344
348
|
constructor({
|
|
345
349
|
window: t,
|
|
346
350
|
document: s,
|
|
@@ -360,19 +364,19 @@
|
|
|
360
364
|
(this.roots = [])
|
|
361
365
|
}
|
|
362
366
|
render(t, s) {
|
|
363
|
-
const n =
|
|
367
|
+
const n = _t(t, s, this.renderKit)
|
|
364
368
|
return this.roots.push(n), n
|
|
365
369
|
}
|
|
366
370
|
startNavigation() {
|
|
367
|
-
|
|
371
|
+
U(this)
|
|
368
372
|
}
|
|
369
373
|
}
|
|
370
|
-
const
|
|
371
|
-
Object.defineProperty({ __proto__: null, App:
|
|
374
|
+
const jt = Object.freeze(
|
|
375
|
+
Object.defineProperty({ __proto__: null, App: C }, Symbol.toStringTag, {
|
|
372
376
|
value: 'Module',
|
|
373
377
|
}),
|
|
374
378
|
)
|
|
375
|
-
class
|
|
379
|
+
class I {
|
|
376
380
|
constructor() {
|
|
377
381
|
this.lookup = {}
|
|
378
382
|
}
|
|
@@ -395,7 +399,7 @@
|
|
|
395
399
|
this.lookup[t] || (this.lookup[t] = [])
|
|
396
400
|
}
|
|
397
401
|
}
|
|
398
|
-
class
|
|
402
|
+
class q {
|
|
399
403
|
constructor() {
|
|
400
404
|
this.lookup = []
|
|
401
405
|
}
|
|
@@ -410,7 +414,7 @@
|
|
|
410
414
|
return this.lookup.filter((s) => s.matcher.test(t))
|
|
411
415
|
}
|
|
412
416
|
}
|
|
413
|
-
class
|
|
417
|
+
class Ot {
|
|
414
418
|
constructor({ publish: t, event: s, payload: n, timer: r }) {
|
|
415
419
|
;(this.setNewTimeout = () => {
|
|
416
420
|
this.stopped ||
|
|
@@ -447,7 +451,7 @@
|
|
|
447
451
|
((this.callCount += 1), this.publish(this.event, this.payload))
|
|
448
452
|
}
|
|
449
453
|
}
|
|
450
|
-
const
|
|
454
|
+
const Mt = (e) => {
|
|
451
455
|
const { offset: t, period: s } = e,
|
|
452
456
|
n = ({ callCount: r }) => (t && r == 0 ? t : s)
|
|
453
457
|
return {
|
|
@@ -457,16 +461,16 @@
|
|
|
457
461
|
timer: n,
|
|
458
462
|
}
|
|
459
463
|
},
|
|
460
|
-
|
|
464
|
+
kt = (e) => {
|
|
461
465
|
let t
|
|
462
|
-
'timer' in e ? (t = e) : (t =
|
|
463
|
-
const s = new
|
|
466
|
+
'timer' in e ? (t = e) : (t = Mt(e))
|
|
467
|
+
const s = new Ot(t)
|
|
464
468
|
return s.start(), s.stop
|
|
465
469
|
}
|
|
466
|
-
class
|
|
470
|
+
class J {
|
|
467
471
|
constructor() {
|
|
468
|
-
;(this.exactSubscriptions = new
|
|
469
|
-
(this.fuzzySubscriptions = new
|
|
472
|
+
;(this.exactSubscriptions = new I()),
|
|
473
|
+
(this.fuzzySubscriptions = new q()),
|
|
470
474
|
(this.currentIndex = 0)
|
|
471
475
|
}
|
|
472
476
|
subscribe(t, s) {
|
|
@@ -496,48 +500,46 @@
|
|
|
496
500
|
return { eventName: t, ...this.options, publish: this.publish.bind(this) }
|
|
497
501
|
}
|
|
498
502
|
}
|
|
499
|
-
const
|
|
500
|
-
const e = new
|
|
503
|
+
const G = () => {
|
|
504
|
+
const e = new J()
|
|
501
505
|
return {
|
|
502
506
|
bus: e,
|
|
503
507
|
publish: (n, r) => e.publish(n, r),
|
|
504
508
|
subscribe: (n, r) => e.subscribe(n, r),
|
|
505
509
|
}
|
|
506
510
|
},
|
|
507
|
-
|
|
511
|
+
$t = Object.freeze(
|
|
508
512
|
Object.defineProperty(
|
|
509
513
|
{
|
|
510
514
|
__proto__: null,
|
|
511
|
-
ExactSubscriptions:
|
|
512
|
-
FuzzySubscriptions:
|
|
513
|
-
JaxsBus:
|
|
514
|
-
createBus:
|
|
515
|
-
publishPeriodically:
|
|
515
|
+
ExactSubscriptions: I,
|
|
516
|
+
FuzzySubscriptions: q,
|
|
517
|
+
JaxsBus: J,
|
|
518
|
+
createBus: G,
|
|
519
|
+
publishPeriodically: kt,
|
|
516
520
|
},
|
|
517
521
|
Symbol.toStringTag,
|
|
518
522
|
{ value: 'Module' },
|
|
519
523
|
),
|
|
520
524
|
),
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
Pt = (e, t) =>
|
|
526
|
-
!(E(e) && E(t)) || !Dt(e, t)
|
|
525
|
+
Dt = (e, t) => e === t,
|
|
526
|
+
Pt = (e, t) => Object.keys(e).length === Object.keys(t).length,
|
|
527
|
+
Vt = (e, t) =>
|
|
528
|
+
!(g(e) && g(t)) || !Pt(e, t)
|
|
527
529
|
? !1
|
|
528
530
|
: Object.keys(e).every((s) => {
|
|
529
531
|
const n = e[s],
|
|
530
532
|
r = t[s]
|
|
531
533
|
return A(n, r)
|
|
532
534
|
}),
|
|
533
|
-
|
|
535
|
+
Ft = (e, t) =>
|
|
534
536
|
!(v(e) && v(t)) || e.length !== t.length
|
|
535
537
|
? !1
|
|
536
538
|
: e.every((s, n) => {
|
|
537
539
|
const r = t[n]
|
|
538
540
|
return A(s, r)
|
|
539
541
|
}),
|
|
540
|
-
A = (e, t) => (
|
|
542
|
+
A = (e, t) => (g(e) ? Vt(e, t) : v(e) ? Ft(e, t) : Dt(e, t))
|
|
541
543
|
class x {
|
|
542
544
|
constructor(t) {
|
|
543
545
|
;(this.name = t.name),
|
|
@@ -581,7 +583,7 @@
|
|
|
581
583
|
return this.store.value
|
|
582
584
|
}
|
|
583
585
|
}
|
|
584
|
-
class
|
|
586
|
+
class Lt extends w {
|
|
585
587
|
updateAttribute(t, s) {
|
|
586
588
|
const n = { ...this.value }
|
|
587
589
|
;(n[t] = s), this.update(n)
|
|
@@ -601,8 +603,8 @@
|
|
|
601
603
|
;(s[t] = n), this.update(s)
|
|
602
604
|
}
|
|
603
605
|
}
|
|
604
|
-
const
|
|
605
|
-
class
|
|
606
|
+
const zt = (e) => new Lt(e)
|
|
607
|
+
class Bt extends w {
|
|
606
608
|
push(t) {
|
|
607
609
|
const s = [...this.value, t]
|
|
608
610
|
this.update(s)
|
|
@@ -643,8 +645,8 @@
|
|
|
643
645
|
this.update(s)
|
|
644
646
|
}
|
|
645
647
|
}
|
|
646
|
-
const
|
|
647
|
-
class
|
|
648
|
+
const Kt = (e) => new Bt(e)
|
|
649
|
+
class Rt extends w {
|
|
648
650
|
toggle() {
|
|
649
651
|
const t = !this.value
|
|
650
652
|
this.update(t)
|
|
@@ -656,9 +658,9 @@
|
|
|
656
658
|
this.update(!1)
|
|
657
659
|
}
|
|
658
660
|
}
|
|
659
|
-
const
|
|
661
|
+
const Ut = { object: zt, list: Kt, boolean: (e) => new Rt(e) },
|
|
660
662
|
N = 'state'
|
|
661
|
-
class
|
|
663
|
+
class H {
|
|
662
664
|
constructor(t) {
|
|
663
665
|
;(this.publisher = t),
|
|
664
666
|
(this.stores = {}),
|
|
@@ -704,22 +706,22 @@
|
|
|
704
706
|
return `${this.eventNamePrefix}:${t}`
|
|
705
707
|
}
|
|
706
708
|
}
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
+
const Q = (e) => new H(e),
|
|
710
|
+
Ct = Object.freeze(
|
|
709
711
|
Object.defineProperty(
|
|
710
712
|
{
|
|
711
713
|
__proto__: null,
|
|
712
|
-
State:
|
|
714
|
+
State: H,
|
|
713
715
|
Store: x,
|
|
714
|
-
createState:
|
|
716
|
+
createState: Q,
|
|
715
717
|
eventName: N,
|
|
716
|
-
updaters:
|
|
718
|
+
updaters: Ut,
|
|
717
719
|
},
|
|
718
720
|
Symbol.toStringTag,
|
|
719
721
|
{ value: 'Module' },
|
|
720
722
|
),
|
|
721
723
|
)
|
|
722
|
-
class
|
|
724
|
+
class It {
|
|
723
725
|
constructor(t) {
|
|
724
726
|
this.setupDomEnvironment(t)
|
|
725
727
|
}
|
|
@@ -729,7 +731,7 @@
|
|
|
729
731
|
this.setupState(),
|
|
730
732
|
this.addBusOptions(),
|
|
731
733
|
this.setRenderKit(),
|
|
732
|
-
new
|
|
734
|
+
new C({
|
|
733
735
|
window: this.window,
|
|
734
736
|
document: this.document,
|
|
735
737
|
publish: this.publish,
|
|
@@ -749,11 +751,11 @@
|
|
|
749
751
|
: ((this.window = window), (this.document = document))
|
|
750
752
|
}
|
|
751
753
|
setupBus() {
|
|
752
|
-
const { publish: t, subscribe: s, bus: n } =
|
|
754
|
+
const { publish: t, subscribe: s, bus: n } = G()
|
|
753
755
|
;(this.publish = t), (this.subscribe = s), (this.bus = n)
|
|
754
756
|
}
|
|
755
757
|
setupState() {
|
|
756
|
-
this.state =
|
|
758
|
+
this.state = Q(this.publish)
|
|
757
759
|
}
|
|
758
760
|
addBusOptions() {
|
|
759
761
|
this.bus.addListenerOptions({
|
|
@@ -772,8 +774,8 @@
|
|
|
772
774
|
}
|
|
773
775
|
}
|
|
774
776
|
}
|
|
775
|
-
const
|
|
776
|
-
const s = new
|
|
777
|
+
const qt = (e = {}) => {
|
|
778
|
+
const s = new It(e).setup()
|
|
777
779
|
return s.startNavigation(), s
|
|
778
780
|
}
|
|
779
781
|
var o = ((e) => (
|
|
@@ -790,37 +792,37 @@
|
|
|
790
792
|
(e[(e.changeText = 10)] = 'changeText'),
|
|
791
793
|
e
|
|
792
794
|
))(o || {})
|
|
793
|
-
const
|
|
795
|
+
const Jt = Object.freeze(
|
|
794
796
|
Object.defineProperty(
|
|
795
797
|
{ __proto__: null, ChangeInstructionTypes: o },
|
|
796
798
|
Symbol.toStringTag,
|
|
797
799
|
{ value: 'Module' },
|
|
798
800
|
),
|
|
799
801
|
),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
802
|
+
Gt = (e, t) => ({ source: e, target: t, type: o.changeText, data: {} }),
|
|
803
|
+
Ht = (e, t) => ({ source: e, target: t, type: o.replaceNode, data: {} }),
|
|
804
|
+
Qt = (e, t, s) => ({
|
|
803
805
|
source: e,
|
|
804
806
|
target: t,
|
|
805
807
|
data: s,
|
|
806
808
|
type: o.removeAttribute,
|
|
807
809
|
}),
|
|
808
|
-
|
|
809
|
-
|
|
810
|
+
Wt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addAttribute }),
|
|
811
|
+
Xt = (e, t, s) => ({
|
|
810
812
|
source: e,
|
|
811
813
|
target: t,
|
|
812
814
|
data: s,
|
|
813
815
|
type: o.updateAttribute,
|
|
814
816
|
}),
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
817
|
+
Yt = (e, t, s) => ({ source: e, target: t, data: s, type: o.removeEvent }),
|
|
818
|
+
Zt = (e, t, s) => ({ source: e, target: t, data: s, type: o.addEvent }),
|
|
819
|
+
te = (e, t, s) => ({ source: e, target: t, data: s, type: o.updateEvent }),
|
|
820
|
+
W = (e) => ({ source: e, target: e, type: o.removeNode, data: {} }),
|
|
819
821
|
_ = (e, t) => ({ target: e, source: e, type: o.insertNode, data: t }),
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
class
|
|
822
|
+
ee = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
|
|
823
|
+
se = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
|
|
824
|
+
X = { index: -1 }
|
|
825
|
+
class ne {
|
|
824
826
|
constructor() {
|
|
825
827
|
this.map = {}
|
|
826
828
|
}
|
|
@@ -835,7 +837,7 @@
|
|
|
835
837
|
pullMatch(t) {
|
|
836
838
|
const s = t && t.__jsx
|
|
837
839
|
return !s || !(this.map[s] && this.map[s].length)
|
|
838
|
-
?
|
|
840
|
+
? X
|
|
839
841
|
: this.map[s].shift()
|
|
840
842
|
}
|
|
841
843
|
clear(t) {
|
|
@@ -852,11 +854,11 @@
|
|
|
852
854
|
return Object.values(this.map).flat()
|
|
853
855
|
}
|
|
854
856
|
}
|
|
855
|
-
const
|
|
856
|
-
const t = new
|
|
857
|
+
const Y = (e) => {
|
|
858
|
+
const t = new ne()
|
|
857
859
|
return t.populate(e), t
|
|
858
860
|
},
|
|
859
|
-
|
|
861
|
+
Z = (e, t, s = !1) => {
|
|
860
862
|
const n = [],
|
|
861
863
|
r = e.attributes,
|
|
862
864
|
i = r.length,
|
|
@@ -876,8 +878,8 @@
|
|
|
876
878
|
}
|
|
877
879
|
c
|
|
878
880
|
? h.value !== c.value &&
|
|
879
|
-
n.push(
|
|
880
|
-
: n.push(
|
|
881
|
+
n.push(Xt(e, t, { name: h.name, value: c.value, isSvg: s }))
|
|
882
|
+
: n.push(Qt(e, t, { name: h.name, isSvg: s }))
|
|
881
883
|
}
|
|
882
884
|
}
|
|
883
885
|
for (u = 0; u < l; u++) {
|
|
@@ -891,12 +893,12 @@
|
|
|
891
893
|
break
|
|
892
894
|
}
|
|
893
895
|
}
|
|
894
|
-
c || n.push(
|
|
896
|
+
c || n.push(Wt(e, t, { name: h.name, value: h.value, isSvg: s }))
|
|
895
897
|
}
|
|
896
898
|
}
|
|
897
899
|
return n
|
|
898
900
|
},
|
|
899
|
-
|
|
901
|
+
re = (e, t) => {
|
|
900
902
|
const s = [],
|
|
901
903
|
n = e.eventMaps,
|
|
902
904
|
r = t.eventMaps,
|
|
@@ -909,60 +911,60 @@
|
|
|
909
911
|
d
|
|
910
912
|
? d.busEvent !== u.busEvent &&
|
|
911
913
|
s.push(
|
|
912
|
-
|
|
914
|
+
te(e, t, {
|
|
913
915
|
name: l,
|
|
914
916
|
targetValue: d.listener,
|
|
915
917
|
sourceValue: u.listener,
|
|
916
918
|
}),
|
|
917
919
|
)
|
|
918
|
-
: s.push(
|
|
920
|
+
: s.push(Yt(e, t, { name: u.domEvent, value: u.listener }))
|
|
919
921
|
}),
|
|
920
922
|
a.forEach((l) => {
|
|
921
923
|
const u = n[l],
|
|
922
924
|
d = r[l]
|
|
923
|
-
u || s.push(
|
|
925
|
+
u || s.push(Zt(e, t, { name: d.domEvent, value: d.listener }))
|
|
924
926
|
}),
|
|
925
927
|
s
|
|
926
928
|
)
|
|
927
929
|
},
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
if (
|
|
930
|
+
ie = (e) => e.tagName !== 'INPUT',
|
|
931
|
+
oe = (e, t) => e.value === t.value,
|
|
932
|
+
ue = (e, t) => {
|
|
933
|
+
if (ie(e) || oe(e, t)) return []
|
|
932
934
|
const s = e,
|
|
933
935
|
n = t
|
|
934
|
-
return [
|
|
936
|
+
return [ee(s, n, { name: 'value', value: n.value })]
|
|
935
937
|
},
|
|
936
|
-
|
|
937
|
-
const s =
|
|
938
|
-
n =
|
|
939
|
-
r =
|
|
938
|
+
ae = (e, t) => {
|
|
939
|
+
const s = Z(e, t),
|
|
940
|
+
n = re(e, t),
|
|
941
|
+
r = ue(e, t)
|
|
940
942
|
return s.concat(n).concat(r)
|
|
941
943
|
},
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
944
|
+
ce = (e, t) => Z(e, t, !0),
|
|
945
|
+
le = (e, t) => (e.textContent !== t.textContent ? [Gt(e, t)] : []),
|
|
946
|
+
he = (e, t, s) => {
|
|
945
947
|
let n = []
|
|
946
|
-
if (e.nodeType === 1 &&
|
|
948
|
+
if (e.nodeType === 1 && ht(e)) {
|
|
947
949
|
const r = e,
|
|
948
950
|
i = t,
|
|
949
|
-
a =
|
|
951
|
+
a = ce(r, i),
|
|
950
952
|
l = s(r.childNodes, i.childNodes, r)
|
|
951
953
|
n = a.concat(l)
|
|
952
954
|
} else if (e.nodeType === 1) {
|
|
953
955
|
const r = e,
|
|
954
956
|
i = t,
|
|
955
|
-
a =
|
|
957
|
+
a = ae(r, i),
|
|
956
958
|
l = s(r.childNodes, i.childNodes, r)
|
|
957
959
|
n = a.concat(l)
|
|
958
|
-
} else e.nodeType === 3 && (n =
|
|
960
|
+
} else e.nodeType === 3 && (n = le(e, t))
|
|
959
961
|
return n
|
|
960
962
|
},
|
|
961
|
-
|
|
963
|
+
tt = (e, t, s) => {
|
|
962
964
|
const n = [],
|
|
963
|
-
r =
|
|
964
|
-
i =
|
|
965
|
-
a =
|
|
965
|
+
r = de(e, t),
|
|
966
|
+
i = Y(e),
|
|
967
|
+
a = Y(t),
|
|
966
968
|
l = []
|
|
967
969
|
let u = 0
|
|
968
970
|
for (; u < r; u++) {
|
|
@@ -977,136 +979,136 @@
|
|
|
977
979
|
: c
|
|
978
980
|
? a.check(c)
|
|
979
981
|
? n.push(_(h, { parent: s, index: u }))
|
|
980
|
-
: (i.clear(c), n.push(
|
|
982
|
+
: (i.clear(c), n.push(Ht(c, h)))
|
|
981
983
|
: n.push(_(h, { parent: s, index: u }))
|
|
982
|
-
} else c && i.pullMatch(c).element && n.push(
|
|
984
|
+
} else c && i.pullMatch(c).element && n.push(W(c))
|
|
983
985
|
}
|
|
984
986
|
i.remaining().forEach(({ element: c }) => {
|
|
985
|
-
n.push(
|
|
987
|
+
n.push(W(c))
|
|
986
988
|
})
|
|
987
989
|
const d = l.reduce(
|
|
988
|
-
(c, { source: h, target: m }) => c.concat(
|
|
990
|
+
(c, { source: h, target: m }) => c.concat(he(h, m, tt)),
|
|
989
991
|
[],
|
|
990
992
|
)
|
|
991
|
-
return n.concat(d).sort(
|
|
993
|
+
return n.concat(d).sort(se)
|
|
992
994
|
},
|
|
993
|
-
|
|
995
|
+
de = (e, t) => {
|
|
994
996
|
const s = e.length,
|
|
995
997
|
n = t.length
|
|
996
998
|
return s > n ? s : n
|
|
997
999
|
},
|
|
998
|
-
|
|
999
|
-
const n =
|
|
1000
|
+
pe = (e, t, s) => {
|
|
1001
|
+
const n = tt(e, t, s)
|
|
1000
1002
|
return (
|
|
1001
1003
|
n.forEach((r) => {
|
|
1002
|
-
|
|
1004
|
+
me(r)
|
|
1003
1005
|
}),
|
|
1004
1006
|
n
|
|
1005
1007
|
)
|
|
1006
1008
|
},
|
|
1007
|
-
|
|
1008
|
-
;(
|
|
1009
|
+
me = (e) => {
|
|
1010
|
+
;(Se[e.type] || fe)(e)
|
|
1009
1011
|
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
+
fe = (e) => {},
|
|
1013
|
+
be = (e) => {
|
|
1012
1014
|
const { source: t, target: s } = e
|
|
1013
1015
|
t.nodeValue = s.textContent
|
|
1014
1016
|
},
|
|
1015
|
-
|
|
1017
|
+
ve = (e) => {
|
|
1016
1018
|
const { source: t } = e
|
|
1017
1019
|
t.remove()
|
|
1018
1020
|
},
|
|
1019
|
-
|
|
1021
|
+
ge = (e) => {
|
|
1020
1022
|
const { target: t, data: s } = e,
|
|
1021
1023
|
{ parent: n, index: r } = s,
|
|
1022
1024
|
i = n.childNodes[r]
|
|
1023
1025
|
i ? i && i !== t && n.insertBefore(t, i) : n.appendChild(t)
|
|
1024
1026
|
},
|
|
1025
|
-
|
|
1027
|
+
ye = (e) => {
|
|
1026
1028
|
const { source: t, target: s } = e
|
|
1027
1029
|
t.replaceWith(s)
|
|
1028
1030
|
},
|
|
1029
|
-
|
|
1031
|
+
Ee = (e) => {
|
|
1030
1032
|
const { source: t, data: s } = e,
|
|
1031
1033
|
{ name: n, isSvg: r } = s
|
|
1032
1034
|
r ? t.removeAttributeNS(null, n) : t.removeAttribute(n)
|
|
1033
1035
|
},
|
|
1034
|
-
|
|
1036
|
+
et = (e) => {
|
|
1035
1037
|
const { source: t, data: s } = e,
|
|
1036
1038
|
{ name: n, value: r, isSvg: i } = s
|
|
1037
1039
|
i ? t.setAttributeNS(null, n, r) : t.setAttribute(n, r)
|
|
1038
1040
|
},
|
|
1039
|
-
Ee = (e) => {
|
|
1040
|
-
tt(e)
|
|
1041
|
-
},
|
|
1042
1041
|
Ae = (e) => {
|
|
1042
|
+
et(e)
|
|
1043
|
+
},
|
|
1044
|
+
xe = (e) => {
|
|
1043
1045
|
const t = e.data,
|
|
1044
1046
|
s = e.source,
|
|
1045
1047
|
{ name: n, value: r } = t
|
|
1046
1048
|
s.removeEventListener(n, r)
|
|
1047
1049
|
},
|
|
1048
|
-
|
|
1050
|
+
we = (e) => {
|
|
1049
1051
|
const t = e.data,
|
|
1050
1052
|
s = e.source,
|
|
1051
1053
|
{ name: n, value: r } = t
|
|
1052
1054
|
s.addEventListener(n, r)
|
|
1053
1055
|
},
|
|
1054
|
-
|
|
1056
|
+
Ne = (e) => {
|
|
1055
1057
|
const t = e.data,
|
|
1056
1058
|
s = e.source,
|
|
1057
1059
|
{ name: n, sourceValue: r, targetValue: i } = t
|
|
1058
1060
|
s.removeEventListener(n, r), s.addEventListener(n, i)
|
|
1059
1061
|
},
|
|
1060
|
-
|
|
1062
|
+
_e = (e) => {
|
|
1061
1063
|
const t = e.data,
|
|
1062
1064
|
s = e.source,
|
|
1063
1065
|
{ value: n } = t
|
|
1064
1066
|
s.value = n
|
|
1065
1067
|
},
|
|
1066
|
-
|
|
1067
|
-
[o.changeText]:
|
|
1068
|
-
[o.removeNode]:
|
|
1069
|
-
[o.insertNode]:
|
|
1070
|
-
[o.replaceNode]:
|
|
1071
|
-
[o.removeAttribute]:
|
|
1072
|
-
[o.addAttribute]:
|
|
1073
|
-
[o.updateAttribute]:
|
|
1074
|
-
[o.removeEvent]:
|
|
1075
|
-
[o.addEvent]:
|
|
1076
|
-
[o.updateEvent]:
|
|
1077
|
-
[o.changeValue]:
|
|
1068
|
+
Se = {
|
|
1069
|
+
[o.changeText]: be,
|
|
1070
|
+
[o.removeNode]: ve,
|
|
1071
|
+
[o.insertNode]: ge,
|
|
1072
|
+
[o.replaceNode]: ye,
|
|
1073
|
+
[o.removeAttribute]: Ee,
|
|
1074
|
+
[o.addAttribute]: et,
|
|
1075
|
+
[o.updateAttribute]: Ae,
|
|
1076
|
+
[o.removeEvent]: xe,
|
|
1077
|
+
[o.addEvent]: we,
|
|
1078
|
+
[o.updateEvent]: Ne,
|
|
1079
|
+
[o.changeValue]: _e,
|
|
1078
1080
|
},
|
|
1079
|
-
|
|
1081
|
+
Te = (e, t, s) => {
|
|
1080
1082
|
const n = [...t]
|
|
1081
1083
|
return (
|
|
1082
1084
|
e.forEach((r) => {
|
|
1083
|
-
|
|
1085
|
+
je(r, n, s)
|
|
1084
1086
|
}),
|
|
1085
1087
|
n
|
|
1086
1088
|
)
|
|
1087
1089
|
},
|
|
1088
|
-
|
|
1089
|
-
const n =
|
|
1090
|
+
je = (e, t, s) => {
|
|
1091
|
+
const n = $e[e.type]
|
|
1090
1092
|
n && n(e, t, s)
|
|
1091
1093
|
},
|
|
1092
|
-
|
|
1094
|
+
Oe = (e, t) => {
|
|
1093
1095
|
const { source: s } = e,
|
|
1094
1096
|
n = t.indexOf(s)
|
|
1095
1097
|
n >= 0 && t.splice(n, 1)
|
|
1096
1098
|
},
|
|
1097
|
-
|
|
1099
|
+
Me = (e, t, s) => {
|
|
1098
1100
|
const { target: n } = e,
|
|
1099
1101
|
r = e.data,
|
|
1100
1102
|
{ index: i, parent: a } = r
|
|
1101
1103
|
s === a && t.splice(i, 0, n)
|
|
1102
1104
|
},
|
|
1103
|
-
|
|
1105
|
+
ke = (e, t) => {
|
|
1104
1106
|
const { target: s, source: n } = e,
|
|
1105
1107
|
r = t.indexOf(n)
|
|
1106
1108
|
r >= 0 && (t[r] = s)
|
|
1107
1109
|
},
|
|
1108
|
-
|
|
1109
|
-
class
|
|
1110
|
+
$e = { [o.removeNode]: Oe, [o.insertNode]: Me, [o.replaceNode]: ke }
|
|
1111
|
+
class De {
|
|
1110
1112
|
constructor({
|
|
1111
1113
|
Template: t,
|
|
1112
1114
|
subscriptions: s,
|
|
@@ -1143,8 +1145,8 @@
|
|
|
1143
1145
|
this.parentElement = n
|
|
1144
1146
|
}
|
|
1145
1147
|
const t = this.generateDom(this.renderKit),
|
|
1146
|
-
s =
|
|
1147
|
-
this.dom =
|
|
1148
|
+
s = pe(this.dom, t, this.parentElement)
|
|
1149
|
+
this.dom = Te(s, this.dom, this.parentElement)
|
|
1148
1150
|
}
|
|
1149
1151
|
subscribeForRerender() {
|
|
1150
1152
|
const { subscribe: t } = this.renderKit
|
|
@@ -1156,36 +1158,19 @@
|
|
|
1156
1158
|
return `${N}:${t}`
|
|
1157
1159
|
}
|
|
1158
1160
|
}
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
+
const Pe = (e) => e,
|
|
1162
|
+
st = ({ Template: e, viewModel: t, subscriptions: s }) => (
|
|
1161
1163
|
(s = s || []),
|
|
1162
|
-
(t = t ||
|
|
1164
|
+
(t = t || Pe),
|
|
1163
1165
|
(n) =>
|
|
1164
|
-
new
|
|
1165
|
-
),
|
|
1166
|
-
Pe = Object.freeze(
|
|
1167
|
-
Object.defineProperty(
|
|
1168
|
-
{
|
|
1169
|
-
__proto__: null,
|
|
1170
|
-
createRouteState: D,
|
|
1171
|
-
events: _t,
|
|
1172
|
-
extractQueryParams: F,
|
|
1173
|
-
findHref: P,
|
|
1174
|
-
navigate: y,
|
|
1175
|
-
onLinkClick: V,
|
|
1176
|
-
onLocationChange: L,
|
|
1177
|
-
start: St,
|
|
1178
|
-
},
|
|
1179
|
-
Symbol.toStringTag,
|
|
1180
|
-
{ value: 'Module' },
|
|
1181
|
-
),
|
|
1166
|
+
new De({ Template: e, viewModel: t, subscriptions: s, attributes: n })
|
|
1182
1167
|
),
|
|
1183
1168
|
Ve =
|
|
1184
1169
|
(e) =>
|
|
1185
1170
|
({ path: t }) =>
|
|
1186
1171
|
t === e,
|
|
1187
1172
|
Fe = () => !0,
|
|
1188
|
-
|
|
1173
|
+
nt =
|
|
1189
1174
|
(e) =>
|
|
1190
1175
|
({ route: t }) => {
|
|
1191
1176
|
const s = e.find((n) => n.match(t))
|
|
@@ -1193,28 +1178,45 @@
|
|
|
1193
1178
|
},
|
|
1194
1179
|
Le = Object.freeze(
|
|
1195
1180
|
Object.defineProperty(
|
|
1196
|
-
{ __proto__: null, buildRouter:
|
|
1181
|
+
{ __proto__: null, buildRouter: nt, catchAll: Fe, exactPathMatch: Ve },
|
|
1197
1182
|
Symbol.toStringTag,
|
|
1198
1183
|
{ value: 'Module' },
|
|
1199
1184
|
),
|
|
1200
1185
|
),
|
|
1201
1186
|
ze = () => ({ render: (e, t) => [] }),
|
|
1202
1187
|
Be = (e) => {
|
|
1203
|
-
const t =
|
|
1204
|
-
return
|
|
1188
|
+
const t = nt(e)
|
|
1189
|
+
return st({
|
|
1205
1190
|
Template: ({ route: n }) => (t({ route: n }) || ze)(),
|
|
1206
1191
|
subscriptions: ['route'],
|
|
1207
1192
|
})
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1193
|
+
},
|
|
1194
|
+
Ke = Object.freeze(
|
|
1195
|
+
Object.defineProperty(
|
|
1196
|
+
{
|
|
1197
|
+
__proto__: null,
|
|
1198
|
+
createRouteState: P,
|
|
1199
|
+
events: St,
|
|
1200
|
+
extractQueryParams: L,
|
|
1201
|
+
findHref: V,
|
|
1202
|
+
navigate: E,
|
|
1203
|
+
onLinkClick: F,
|
|
1204
|
+
onLocationChange: z,
|
|
1205
|
+
start: Tt,
|
|
1206
|
+
},
|
|
1207
|
+
Symbol.toStringTag,
|
|
1208
|
+
{ value: 'Module' },
|
|
1209
|
+
),
|
|
1210
|
+
)
|
|
1211
|
+
;(p.JaxsTypes = Jt),
|
|
1212
|
+
(p.appBuilding = jt),
|
|
1213
|
+
(p.bind = st),
|
|
1214
|
+
(p.createApp = qt),
|
|
1215
|
+
(p.jsx = M),
|
|
1216
|
+
(p.messageBus = $t),
|
|
1217
|
+
(p.navigation = Ke),
|
|
1216
1218
|
(p.routedView = Be),
|
|
1217
1219
|
(p.routing = Le),
|
|
1218
|
-
(p.state =
|
|
1220
|
+
(p.state = Ct),
|
|
1219
1221
|
Object.defineProperty(p, Symbol.toStringTag, { value: 'Module' })
|
|
1220
1222
|
})
|