jaxs 0.9.1 → 0.9.2

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 CHANGED
@@ -51,6 +51,12 @@ export declare const ArrayModifiers: {
51
51
  ) => T[]
52
52
  insertAt: <T>(originalCollection: T[], index: number, item: T) => T[]
53
53
  appendIfUnique: <T>(originalCollection: T[], item: T) => T[]
54
+ push: <T>(array: T[], item: T) => number
55
+ pop: <T>(array: T[]) => T
56
+ unshift: <T>(array: T[], item: T) => number
57
+ shift: <T>(array: T[]) => T
58
+ sortBy: <T>(array: T[], sorter: (a: T, b: T) => number) => T[]
59
+ includes: <T>(array: T[], item: T) => boolean
54
60
  }
55
61
 
56
62
  declare type AttributeInstructionData = {
package/dist/jaxs.js CHANGED
@@ -1,5 +1,11 @@
1
- const O = (e, t) => e.reduce((s, r) => (r !== t && s.push(r), s), []),
2
- M = (e, t) => e.reduce((s, r) => (t(r) || s.push(r), s), []),
1
+ const O = (e, t) => {
2
+ for (let s = e.length - 1; s >= 0; s--) e[s] === t && e.splice(s, 1)
3
+ return e
4
+ },
5
+ M = (e, t) => {
6
+ for (let s = e.length - 1; s >= 0; s--) t(e[s]) && e.splice(s, 1)
7
+ return e
8
+ },
3
9
  k = (e, t, s) => (e.splice(t, 0, s), e),
4
10
  $ = (e, t) => (e.includes(t) || e.push(t), e),
5
11
  Ve = {
@@ -7,6 +13,18 @@ const O = (e, t) => e.reduce((s, r) => (r !== t && s.push(r), s), []),
7
13
  removeBy: M,
8
14
  insertAt: k,
9
15
  appendIfUnique: $,
16
+ push: (e, t) => e.push(t),
17
+ // mutates
18
+ pop: (e) => e.pop(),
19
+ // mutates
20
+ unshift: (e, t) => e.unshift(t),
21
+ // mutates
22
+ shift: (e) => e.shift(),
23
+ // mutates
24
+ sortBy: (e, t) => e.sort(t),
25
+ // mutates
26
+ includes: (e, t) => e.includes(t),
27
+ // reader
10
28
  }
11
29
  class ct {
12
30
  constructor(t) {
@@ -47,7 +65,7 @@ const f = (e) => new ct(e),
47
65
  isTrue: (e) => f(e).isTrue(),
48
66
  isFalse: (e) => f(e).isFalse(),
49
67
  }
50
- class lt {
68
+ class ht {
51
69
  constructor(t) {
52
70
  this.store = t
53
71
  }
@@ -102,7 +120,7 @@ class lt {
102
120
  $(s, t), this.update(s)
103
121
  }
104
122
  }
105
- const m = (e) => new lt(e),
123
+ const m = (e) => new ht(e),
106
124
  ze = {
107
125
  push: (e, t) => m(e).push(t),
108
126
  pop: (e) => m(e).pop(),
@@ -116,7 +134,7 @@ const m = (e) => new lt(e),
116
134
  includes: (e, t) => m(e).includes(t),
117
135
  appendIfUnique: (e, t) => m(e).appendIfUnique(t),
118
136
  }
119
- class ht {
137
+ class lt {
120
138
  constructor(t) {
121
139
  this.store = t
122
140
  }
@@ -155,7 +173,7 @@ class ht {
155
173
  return !!this.value[t]
156
174
  }
157
175
  }
158
- const b = (e) => new ht(e),
176
+ const b = (e) => new lt(e),
159
177
  Ke = {
160
178
  reset: (e) => b(e).reset(),
161
179
  resetAttribute: (e, t) => b(e).resetAttribute(t),
@@ -167,13 +185,13 @@ const b = (e) => new ht(e),
167
185
  pt = (e) => typeof e == 'number',
168
186
  D = (e) => typeof e == 'string',
169
187
  v = (e) => Array.isArray(e),
170
- y = (e) => e !== null && !v(e) && typeof e == 'object',
188
+ g = (e) => e !== null && !v(e) && typeof e == 'object',
171
189
  Re = {
172
190
  boolean: dt,
173
191
  number: pt,
174
192
  string: D,
175
193
  array: v,
176
- object: y,
194
+ object: g,
177
195
  },
178
196
  mt = (e, t) => t.createElement(e),
179
197
  ft = (e, t) => {
@@ -206,7 +224,7 @@ const b = (e) => new ht(e),
206
224
  return ft(n, t), bt(n, s, r.publish), n
207
225
  },
208
226
  w = 'http://www.w3.org/2000/svg',
209
- gt = {
227
+ yt = {
210
228
  animate: !0,
211
229
  animateMotion: !0,
212
230
  animateTransform: !0,
@@ -270,7 +288,7 @@ const b = (e) => new ht(e),
270
288
  use: !0,
271
289
  view: !0,
272
290
  },
273
- yt = (e, t) => !!(gt[e] || (e === 'a' && t === w)),
291
+ gt = (e, t) => !!(yt[e] || (e === 'a' && t === w)),
274
292
  Et = (e, t, s) => {
275
293
  const r = s.createElementNS(w, e)
276
294
  for (const n in t)
@@ -295,7 +313,7 @@ const Nt = (e) => typeof e == 'string' || typeof e == 'number',
295
313
  St = (e) => (Nt(e) ? _t(e) : e),
296
314
  P = (e) => Tt(e).map(St).flat(),
297
315
  Tt = (e) => (Array.isArray(e) ? e.flat() : e ? [e] : []),
298
- F = (e, t = {}) => P(e || t.children || []),
316
+ B = (e, t = {}) => P(e || t.children || []),
299
317
  jt = (e, t = '') => {
300
318
  const s = {},
301
319
  r = {}
@@ -317,14 +335,14 @@ const Nt = (e) => typeof e == 'string' || typeof e == 'number',
317
335
  Ot = (e, t, s = '') => (t == null ? s : t.toString()),
318
336
  Mt = (e, t) => {
319
337
  const s = e || {},
320
- r = F(t, s)
338
+ r = B(t, s)
321
339
  return (s.children = s.children || r), s
322
340
  },
323
- B = (e, t, s, r = []) => e.reduce(kt(t, s), r).flat(),
341
+ F = (e, t, s, r = []) => e.reduce(kt(t, s), r).flat(),
324
342
  kt = (e, t) => (s, r) =>
325
343
  r
326
344
  ? Array.isArray(r)
327
- ? B(r, e, t, s)
345
+ ? F(r, e, t, s)
328
346
  : (r.render(e, t).forEach((n) => s.push(n)), s)
329
347
  : s
330
348
  class V {
@@ -337,7 +355,7 @@ class V {
337
355
  return this.attachToParent(r), r
338
356
  }
339
357
  generateDom(t) {
340
- return B(this.collection, t, this.parentElement)
358
+ return F(this.collection, t, this.parentElement)
341
359
  }
342
360
  attachToParent(t) {
343
361
  if (this.parentElement === void 0) return
@@ -377,7 +395,7 @@ class Dt {
377
395
  const { events: n, attributes: i } = jt(s)
378
396
  ;(this.events = n),
379
397
  (this.attributes = i),
380
- (this.isSvg = yt(this.type, this.attributes.xmlns)),
398
+ (this.isSvg = gt(this.type, this.attributes.xmlns)),
381
399
  (this.children = new V(r))
382
400
  }
383
401
  render(t) {
@@ -402,10 +420,10 @@ class Dt {
402
420
  const Pt = (e, t, ...s) =>
403
421
  typeof e == 'string' ? new Dt(e, t, s) : e(Mt(t, s))
404
422
  Pt.fragment = (e, t) => {
405
- const s = F(t, e)
423
+ const s = B(t, e)
406
424
  return new V(s)
407
425
  }
408
- class Ft {
426
+ class Bt {
409
427
  constructor(t, s, r) {
410
428
  ;(this.template = t),
411
429
  (this.selector = s),
@@ -430,20 +448,20 @@ class Ft {
430
448
  return this.renderKit.document.querySelector(this.selector)
431
449
  }
432
450
  }
433
- const Bt = (e, t, s) => {
434
- const r = new Ft(e, t, s)
451
+ const Ft = (e, t, s) => {
452
+ const r = new Bt(e, t, s)
435
453
  return r.renderAndAttach(s), r
436
454
  },
437
455
  L = 'go-to-href',
438
456
  z = 'go-to',
439
- g = 'navigation:location-change',
457
+ y = 'navigation:location-change',
440
458
  K = 'navigation:route-change',
441
459
  Vt = /* @__PURE__ */ Object.freeze(
442
460
  /* @__PURE__ */ Object.defineProperty(
443
461
  {
444
462
  __proto__: null,
445
463
  linkNavigationEvent: L,
446
- locationChangeEvent: g,
464
+ locationChangeEvent: y,
447
465
  navigationEvent: z,
448
466
  routeChangeEvent: K,
449
467
  },
@@ -463,7 +481,7 @@ const Bt = (e, t, s) => {
463
481
  return (t && t.getAttribute('href')) || ''
464
482
  },
465
483
  N = ({ payload: e, publish: t, window: s }) => {
466
- s.history.pushState(null, '', e), t(g, null)
484
+ s.history.pushState(null, '', e), t(y, null)
467
485
  },
468
486
  q = (e) => {
469
487
  const t = e.payload
@@ -481,43 +499,43 @@ const Bt = (e, t, s) => {
481
499
  const r = s.split('=')
482
500
  return (t[r[0]] = r[1]), t
483
501
  }, {}),
484
- C = (e) => {
502
+ J = (e) => {
485
503
  const { state: t, publish: s, window: r } = e,
486
504
  { host: n, pathname: i, search: a } = r.location,
487
505
  c = i,
488
506
  u = I(a),
489
- h = {
507
+ l = {
490
508
  host: n,
491
509
  path: c,
492
510
  query: u,
493
511
  }
494
- t.store('route').update(h), s(K, h)
512
+ t.store('route').update(l), s(K, l)
495
513
  },
496
- J = (e) => {
514
+ G = (e) => {
497
515
  const { subscribe: t } = e
498
516
  t(L, q),
499
517
  t(z, (s) => {
500
518
  N(s)
501
519
  })
502
520
  },
503
- G = (e) => {
521
+ H = (e) => {
504
522
  const { publish: t, subscribe: s, state: r, window: n } = e
505
- R(r), n.addEventListener('popstate', () => t(g, null)), s(g, C)
523
+ R(r), n.addEventListener('popstate', () => t(y, null)), s(y, J)
506
524
  },
507
- H = (e) => {
508
- setTimeout(() => e.publish(g, null), 0)
525
+ C = (e) => {
526
+ setTimeout(() => e.publish(y, null), 0)
509
527
  },
510
528
  Q = (e) => {
511
- G(e), J(e), H(e)
529
+ H(e), G(e), C(e)
512
530
  },
513
531
  Lt = /* @__PURE__ */ Object.freeze(
514
532
  /* @__PURE__ */ Object.defineProperty(
515
533
  {
516
534
  __proto__: null,
517
- publishLocation: H,
535
+ publishLocation: C,
518
536
  startNavigation: Q,
519
- subscribeToHistoryChange: G,
520
- subscribeToNavigation: J,
537
+ subscribeToHistoryChange: H,
538
+ subscribeToNavigation: G,
521
539
  },
522
540
  Symbol.toStringTag,
523
541
  { value: 'Module' },
@@ -543,7 +561,7 @@ class W {
543
561
  (this.roots = [])
544
562
  }
545
563
  render(t, s) {
546
- const r = Bt(t, s, this.renderKit)
564
+ const r = Ft(t, s, this.renderKit)
547
565
  return this.roots.push(r), r
548
566
  }
549
567
  startNavigation() {
@@ -722,7 +740,7 @@ const tt = () => {
722
740
  Ut = (e, t) => e === t,
723
741
  qt = (e, t) => Object.keys(e).length === Object.keys(t).length,
724
742
  et = (e, t) =>
725
- !(y(e) && y(t)) || !qt(e, t)
743
+ !(g(e) && g(t)) || !qt(e, t)
726
744
  ? !1
727
745
  : Object.keys(e).every((s) => {
728
746
  const r = e[s],
@@ -736,7 +754,7 @@ const tt = () => {
736
754
  const n = t[r]
737
755
  return E(s, n)
738
756
  }),
739
- E = (e, t) => (y(e) ? et(e, t) : v(e) ? st(e, t) : Ut(e, t)),
757
+ E = (e, t) => (g(e) ? et(e, t) : v(e) ? st(e, t) : Ut(e, t)),
740
758
  Ie = {
741
759
  objects: et,
742
760
  arrays: st,
@@ -833,7 +851,7 @@ class rt {
833
851
  }
834
852
  }
835
853
  const nt = (e) => new rt(e),
836
- Ce = /* @__PURE__ */ Object.freeze(
854
+ Je = /* @__PURE__ */ Object.freeze(
837
855
  /* @__PURE__ */ Object.defineProperty(
838
856
  {
839
857
  __proto__: null,
@@ -898,7 +916,7 @@ class It {
898
916
  }
899
917
  }
900
918
  }
901
- const Je = (e = {}) => {
919
+ const Ge = (e = {}) => {
902
920
  const s = new It(e).setup()
903
921
  return s.startNavigation(), s
904
922
  }
@@ -916,7 +934,7 @@ var o = /* @__PURE__ */ ((e) => (
916
934
  (e[(e.changeText = 10)] = 'changeText'),
917
935
  e
918
936
  ))(o || {})
919
- const Ge = /* @__PURE__ */ Object.freeze(
937
+ const He = /* @__PURE__ */ Object.freeze(
920
938
  /* @__PURE__ */ Object.defineProperty(
921
939
  {
922
940
  __proto__: null,
@@ -926,25 +944,25 @@ const Ge = /* @__PURE__ */ Object.freeze(
926
944
  { value: 'Module' },
927
945
  ),
928
946
  ),
929
- Ct = (e, t) => ({
947
+ Jt = (e, t) => ({
930
948
  source: e,
931
949
  target: t,
932
950
  type: o.changeText,
933
951
  data: {},
934
952
  }),
935
- Jt = (e, t) => ({
953
+ Gt = (e, t) => ({
936
954
  source: e,
937
955
  target: t,
938
956
  type: o.replaceNode,
939
957
  data: {},
940
958
  }),
941
- Gt = (e, t, s) => ({
959
+ Ht = (e, t, s) => ({
942
960
  source: e,
943
961
  target: t,
944
962
  data: s,
945
963
  type: o.removeAttribute,
946
964
  }),
947
- Ht = (e, t, s) => ({
965
+ Ct = (e, t, s) => ({
948
966
  source: e,
949
967
  target: t,
950
968
  data: s,
@@ -1039,46 +1057,46 @@ const j = (e) => {
1039
1057
  i = n.length,
1040
1058
  a = t.attributes,
1041
1059
  c = a.length
1042
- let u, h, d
1060
+ let u, l, d
1043
1061
  for (u = 0; u < i; u++) {
1044
1062
  d = null
1045
- const l = n.item(u)
1046
- if (l) {
1047
- for (h = 0; h < c; h++) {
1048
- const p = a.item(h)
1049
- if (p && l.name == p.name) {
1063
+ const h = n.item(u)
1064
+ if (h) {
1065
+ for (l = 0; l < c; l++) {
1066
+ const p = a.item(l)
1067
+ if (p && h.name == p.name) {
1050
1068
  d = p
1051
1069
  break
1052
1070
  }
1053
1071
  }
1054
1072
  d
1055
- ? l.value !== d.value &&
1073
+ ? h.value !== d.value &&
1056
1074
  r.push(
1057
1075
  Qt(e, t, {
1058
- name: l.name,
1076
+ name: h.name,
1059
1077
  value: d.value,
1060
1078
  isSvg: s,
1061
1079
  }),
1062
1080
  )
1063
- : r.push(Gt(e, t, { name: l.name, isSvg: s }))
1081
+ : r.push(Ht(e, t, { name: h.name, isSvg: s }))
1064
1082
  }
1065
1083
  }
1066
1084
  for (u = 0; u < c; u++) {
1067
1085
  d = null
1068
- const l = a.item(u)
1069
- if (l) {
1070
- for (h = 0; h < i; h++) {
1071
- const p = n.item(h)
1072
- if (p && p.name == l.name) {
1086
+ const h = a.item(u)
1087
+ if (h) {
1088
+ for (l = 0; l < i; l++) {
1089
+ const p = n.item(l)
1090
+ if (p && p.name == h.name) {
1073
1091
  d = p
1074
1092
  break
1075
1093
  }
1076
1094
  }
1077
1095
  d ||
1078
1096
  r.push(
1079
- Ht(e, t, {
1080
- name: l.name,
1081
- value: l.value,
1097
+ Ct(e, t, {
1098
+ name: h.name,
1099
+ value: h.value,
1082
1100
  isSvg: s,
1083
1101
  }),
1084
1102
  )
@@ -1095,13 +1113,13 @@ const j = (e) => {
1095
1113
  return (
1096
1114
  i.forEach((c) => {
1097
1115
  const u = r[c],
1098
- h = n[c]
1099
- h
1100
- ? h.busEvent !== u.busEvent &&
1116
+ l = n[c]
1117
+ l
1118
+ ? l.busEvent !== u.busEvent &&
1101
1119
  s.push(
1102
1120
  Yt(e, t, {
1103
1121
  name: c,
1104
- targetValue: h.listener,
1122
+ targetValue: l.listener,
1105
1123
  sourceValue: u.listener,
1106
1124
  }),
1107
1125
  )
@@ -1114,12 +1132,12 @@ const j = (e) => {
1114
1132
  }),
1115
1133
  a.forEach((c) => {
1116
1134
  const u = r[c],
1117
- h = n[c]
1135
+ l = n[c]
1118
1136
  u ||
1119
1137
  s.push(
1120
1138
  Xt(e, t, {
1121
- name: h.domEvent,
1122
- value: h.listener,
1139
+ name: l.domEvent,
1140
+ value: l.listener,
1123
1141
  }),
1124
1142
  )
1125
1143
  }),
@@ -1141,7 +1159,7 @@ const j = (e) => {
1141
1159
  return s.concat(r).concat(n)
1142
1160
  },
1143
1161
  ue = (e, t) => it(e, t, !0),
1144
- ae = (e, t) => (e.textContent !== t.textContent ? [Ct(e, t)] : []),
1162
+ ae = (e, t) => (e.textContent !== t.textContent ? [Jt(e, t)] : []),
1145
1163
  ce = (e, t, s) => {
1146
1164
  let r = []
1147
1165
  if (e.nodeType === 1 && At(e)) {
@@ -1161,17 +1179,17 @@ const j = (e) => {
1161
1179
  },
1162
1180
  ot = (e, t, s) => {
1163
1181
  const r = [],
1164
- n = le(e, t),
1182
+ n = he(e, t),
1165
1183
  i = j(e),
1166
1184
  a = j(t),
1167
1185
  c = []
1168
1186
  let u = 0
1169
1187
  for (; u < n; u++) {
1170
1188
  const d = e[u],
1171
- l = t[u]
1172
- if (l && a.check(l)) {
1173
- const p = i.pullMatch(l)
1174
- a.clear(l),
1189
+ h = t[u]
1190
+ if (h && a.check(h)) {
1191
+ const p = i.pullMatch(h)
1192
+ a.clear(h),
1175
1193
  p.element
1176
1194
  ? (p.index !== u &&
1177
1195
  r.push(
@@ -1182,30 +1200,30 @@ const j = (e) => {
1182
1200
  ),
1183
1201
  c.push({
1184
1202
  source: p.element,
1185
- target: l,
1203
+ target: h,
1186
1204
  }))
1187
1205
  : d
1188
1206
  ? a.check(d)
1189
- ? r.push(A(l, { parent: s, index: u }))
1190
- : (i.clear(d), r.push(Jt(d, l)))
1191
- : r.push(A(l, { parent: s, index: u }))
1207
+ ? r.push(A(h, { parent: s, index: u }))
1208
+ : (i.clear(d), r.push(Gt(d, h)))
1209
+ : r.push(A(h, { parent: s, index: u }))
1192
1210
  } else d && i.pullMatch(d).element && r.push(S(d))
1193
1211
  }
1194
1212
  i.remaining().forEach(({ element: d }) => {
1195
1213
  r.push(S(d))
1196
1214
  })
1197
- const h = c.reduce(
1198
- (d, { source: l, target: p }) => d.concat(ce(l, p, ot)),
1215
+ const l = c.reduce(
1216
+ (d, { source: h, target: p }) => d.concat(ce(h, p, ot)),
1199
1217
  [],
1200
1218
  )
1201
- return r.concat(h).sort(te)
1219
+ return r.concat(l).sort(te)
1202
1220
  },
1203
- le = (e, t) => {
1221
+ he = (e, t) => {
1204
1222
  const s = e.length,
1205
1223
  r = t.length
1206
1224
  return s > r ? s : r
1207
1225
  },
1208
- he = (e, t, s) => {
1226
+ le = (e, t, s) => {
1209
1227
  const r = ot(e, t, s)
1210
1228
  return (
1211
1229
  r.forEach((n) => {
@@ -1236,7 +1254,7 @@ const j = (e) => {
1236
1254
  const { source: t, target: s } = e
1237
1255
  t.replaceWith(s)
1238
1256
  },
1239
- ge = (e) => {
1257
+ ye = (e) => {
1240
1258
  const { source: t, data: s } = e,
1241
1259
  { name: r, isSvg: n } = s
1242
1260
  n ? t.removeAttributeNS(null, r) : t.removeAttribute(r)
@@ -1246,7 +1264,7 @@ const j = (e) => {
1246
1264
  { name: r, value: n, isSvg: i } = s
1247
1265
  i ? t.setAttributeNS(null, r, n) : t.setAttribute(r, n)
1248
1266
  },
1249
- ye = (e) => {
1267
+ ge = (e) => {
1250
1268
  ut(e)
1251
1269
  },
1252
1270
  Ee = (e) => {
@@ -1278,9 +1296,9 @@ const j = (e) => {
1278
1296
  [o.removeNode]: fe,
1279
1297
  [o.insertNode]: be,
1280
1298
  [o.replaceNode]: ve,
1281
- [o.removeAttribute]: ge,
1299
+ [o.removeAttribute]: ye,
1282
1300
  [o.addAttribute]: ut,
1283
- [o.updateAttribute]: ye,
1301
+ [o.updateAttribute]: ge,
1284
1302
  [o.removeEvent]: Ee,
1285
1303
  [o.addEvent]: Ae,
1286
1304
  [o.updateEvent]: xe,
@@ -1352,7 +1370,7 @@ class ke {
1352
1370
  this.parentElement = r
1353
1371
  }
1354
1372
  const t = this.generateDom(this.renderKit),
1355
- s = he(this.dom, t, this.parentElement)
1373
+ s = le(this.dom, t, this.parentElement)
1356
1374
  this.dom = _e(s, this.dom, this.parentElement)
1357
1375
  }
1358
1376
  subscribeForRerender() {
@@ -1376,32 +1394,32 @@ const $e = (e) => e,
1376
1394
  (e) =>
1377
1395
  ({ path: t }) =>
1378
1396
  t === e,
1379
- Fe = () => !0,
1397
+ Be = () => !0,
1380
1398
  at =
1381
1399
  (e) =>
1382
1400
  ({ route: t }) => {
1383
1401
  const s = e.find((r) => r.match(t))
1384
1402
  return s && s.Partial
1385
1403
  },
1386
- He = /* @__PURE__ */ Object.freeze(
1404
+ Ce = /* @__PURE__ */ Object.freeze(
1387
1405
  /* @__PURE__ */ Object.defineProperty(
1388
1406
  {
1389
1407
  __proto__: null,
1390
1408
  buildRouter: at,
1391
- catchAll: Fe,
1409
+ catchAll: Be,
1392
1410
  exactPathMatch: Pe,
1393
1411
  },
1394
1412
  Symbol.toStringTag,
1395
1413
  { value: 'Module' },
1396
1414
  ),
1397
1415
  ),
1398
- Be = () => ({
1416
+ Fe = () => ({
1399
1417
  render: (e, t) => [],
1400
1418
  }),
1401
1419
  Qe = (e) => {
1402
1420
  const t = at(e)
1403
1421
  return De({
1404
- Template: ({ route: r }) => (t({ route: r }) || Be)(),
1422
+ Template: ({ route: r }) => (t({ route: r }) || Fe)(),
1405
1423
  subscriptions: ['route'],
1406
1424
  })
1407
1425
  },
@@ -1415,7 +1433,7 @@ const $e = (e) => e,
1415
1433
  findHref: U,
1416
1434
  navigate: N,
1417
1435
  onLinkClick: q,
1418
- onLocationChange: C,
1436
+ onLocationChange: J,
1419
1437
  start: Lt,
1420
1438
  },
1421
1439
  Symbol.toStringTag,
@@ -1427,16 +1445,16 @@ export {
1427
1445
  Le as BooleanStore,
1428
1446
  Ie as Equality,
1429
1447
  Re as Is,
1430
- Ge as JaxsTypes,
1448
+ He as JaxsTypes,
1431
1449
  ze as ListStore,
1432
1450
  Ke as RecordStore,
1433
1451
  Ue as appBuilding,
1434
1452
  De as bind,
1435
- Je as createApp,
1453
+ Ge as createApp,
1436
1454
  Pt as jsx,
1437
1455
  qe as messageBus,
1438
1456
  We as navigation,
1439
1457
  Qe as routedView,
1440
- He as routing,
1441
- Ce as state,
1458
+ Ce as routing,
1459
+ Je as state,
1442
1460
  }
package/dist/jaxs.umd.cjs CHANGED
@@ -7,11 +7,28 @@
7
7
  b((l.jaxs = {})))
8
8
  })(this, function (l) {
9
9
  'use strict'
10
- const b = (e, t) => e.reduce((s, r) => (r !== t && s.push(r), s), []),
11
- j = (e, t) => e.reduce((s, r) => (t(r) || s.push(r), s), []),
10
+ const b = (e, t) => {
11
+ for (let s = e.length - 1; s >= 0; s--) e[s] === t && e.splice(s, 1)
12
+ return e
13
+ },
14
+ j = (e, t) => {
15
+ for (let s = e.length - 1; s >= 0; s--) t(e[s]) && e.splice(s, 1)
16
+ return e
17
+ },
12
18
  O = (e, t, s) => (e.splice(t, 0, s), e),
13
19
  M = (e, t) => (e.includes(t) || e.push(t), e),
14
- dt = { remove: b, removeBy: j, insertAt: O, appendIfUnique: M }
20
+ dt = {
21
+ remove: b,
22
+ removeBy: j,
23
+ insertAt: O,
24
+ appendIfUnique: M,
25
+ push: (e, t) => e.push(t),
26
+ pop: (e) => e.pop(),
27
+ unshift: (e, t) => e.unshift(t),
28
+ shift: (e) => e.shift(),
29
+ sortBy: (e, t) => e.sort(t),
30
+ includes: (e, t) => e.includes(t),
31
+ }
15
32
  class pt {
16
33
  constructor(t) {
17
34
  this.store = t
@@ -43,7 +60,7 @@
43
60
  }
44
61
  }
45
62
  const v = (e) => new pt(e),
46
- mt = {
63
+ ft = {
47
64
  toggle: (e) => v(e).toggle(),
48
65
  setTrue: (e) => v(e).setTrue(),
49
66
  setFalse: (e) => v(e).setFalse(),
@@ -51,7 +68,7 @@
51
68
  isTrue: (e) => v(e).isTrue(),
52
69
  isFalse: (e) => v(e).isFalse(),
53
70
  }
54
- class ft {
71
+ class mt {
55
72
  constructor(t) {
56
73
  this.store = t
57
74
  }
@@ -106,19 +123,19 @@
106
123
  M(s, t), this.update(s)
107
124
  }
108
125
  }
109
- const f = (e) => new ft(e),
126
+ const m = (e) => new mt(e),
110
127
  bt = {
111
- push: (e, t) => f(e).push(t),
112
- pop: (e) => f(e).pop(),
113
- unshift: (e, t) => f(e).unshift(t),
114
- shift: (e) => f(e).shift(),
115
- sortBy: (e, t) => f(e).sortBy(t),
116
- insertAt: (e, t, s) => f(e).insertAt(t, s),
117
- remove: (e, t) => f(e).remove(t),
118
- removeBy: (e, t) => f(e).removeBy(t),
119
- reset: (e) => f(e).reset(),
120
- includes: (e, t) => f(e).includes(t),
121
- appendIfUnique: (e, t) => f(e).appendIfUnique(t),
128
+ push: (e, t) => m(e).push(t),
129
+ pop: (e) => m(e).pop(),
130
+ unshift: (e, t) => m(e).unshift(t),
131
+ shift: (e) => m(e).shift(),
132
+ sortBy: (e, t) => m(e).sortBy(t),
133
+ insertAt: (e, t, s) => m(e).insertAt(t, s),
134
+ remove: (e, t) => m(e).remove(t),
135
+ removeBy: (e, t) => m(e).removeBy(t),
136
+ reset: (e) => m(e).reset(),
137
+ includes: (e, t) => m(e).includes(t),
138
+ appendIfUnique: (e, t) => m(e).appendIfUnique(t),
122
139
  }
123
140
  class vt {
124
141
  constructor(t) {
@@ -159,20 +176,20 @@
159
176
  return !!this.value[t]
160
177
  }
161
178
  }
162
- const g = (e) => new vt(e),
163
- gt = {
164
- reset: (e) => g(e).reset(),
165
- resetAttribute: (e, t) => g(e).resetAttribute(t),
166
- updateAttribute: (e, t, s) => g(e).updateAttribute(t, s),
167
- updateAttributes: (e, t) => g(e).updateAttributes(t),
168
- attributeTruthy: (e, t) => g(e).attributeTruthy(t),
179
+ const y = (e) => new vt(e),
180
+ yt = {
181
+ reset: (e) => y(e).reset(),
182
+ resetAttribute: (e, t) => y(e).resetAttribute(t),
183
+ updateAttribute: (e, t, s) => y(e).updateAttribute(t, s),
184
+ updateAttributes: (e, t) => y(e).updateAttributes(t),
185
+ attributeTruthy: (e, t) => y(e).attributeTruthy(t),
169
186
  },
170
- yt = (e) => typeof e == 'boolean',
187
+ gt = (e) => typeof e == 'boolean',
171
188
  Et = (e) => typeof e == 'number',
172
189
  k = (e) => typeof e == 'string',
173
- y = (e) => Array.isArray(e),
174
- A = (e) => e !== null && !y(e) && typeof e == 'object',
175
- At = { boolean: yt, number: Et, string: k, array: y, object: A },
190
+ g = (e) => Array.isArray(e),
191
+ A = (e) => e !== null && !g(e) && typeof e == 'object',
192
+ At = { boolean: gt, number: Et, string: k, array: g, object: A },
176
193
  wt = (e, t) => t.createElement(e),
177
194
  Nt = (e, t) => {
178
195
  for (const s in t) {
@@ -478,31 +495,31 @@
478
495
  d = { host: n, path: c, query: u }
479
496
  t.store('route').update(d), s(z, d)
480
497
  },
481
- C = (e) => {
498
+ J = (e) => {
482
499
  const { subscribe: t } = e
483
500
  t(V, U),
484
501
  t(L, (s) => {
485
502
  S(s)
486
503
  })
487
504
  },
488
- J = (e) => {
505
+ G = (e) => {
489
506
  const { publish: t, subscribe: s, state: r, window: n } = e
490
507
  K(r), n.addEventListener('popstate', () => t(E, null)), s(E, I)
491
508
  },
492
- G = (e) => {
509
+ H = (e) => {
493
510
  setTimeout(() => e.publish(E, null), 0)
494
511
  },
495
- H = (e) => {
496
- J(e), C(e), G(e)
512
+ C = (e) => {
513
+ G(e), J(e), H(e)
497
514
  },
498
- Ct = Object.freeze(
515
+ Jt = Object.freeze(
499
516
  Object.defineProperty(
500
517
  {
501
518
  __proto__: null,
502
- publishLocation: G,
503
- startNavigation: H,
504
- subscribeToHistoryChange: J,
505
- subscribeToNavigation: C,
519
+ publishLocation: H,
520
+ startNavigation: C,
521
+ subscribeToHistoryChange: G,
522
+ subscribeToNavigation: J,
506
523
  },
507
524
  Symbol.toStringTag,
508
525
  { value: 'Module' },
@@ -532,10 +549,10 @@
532
549
  return this.roots.push(r), r
533
550
  }
534
551
  startNavigation() {
535
- H(this)
552
+ C(this)
536
553
  }
537
554
  }
538
- const Jt = Object.freeze(
555
+ const Gt = Object.freeze(
539
556
  Object.defineProperty({ __proto__: null, App: Q }, Symbol.toStringTag, {
540
557
  value: 'Module',
541
558
  }),
@@ -578,7 +595,7 @@
578
595
  return this.lookup.filter((s) => s.matcher.test(t))
579
596
  }
580
597
  }
581
- class Gt {
598
+ class Ht {
582
599
  constructor({ publish: t, event: s, payload: r, timer: n }) {
583
600
  ;(this.setNewTimeout = () => {
584
601
  this.stopped ||
@@ -615,7 +632,7 @@
615
632
  ((this.callCount += 1), this.publish(this.event, this.payload))
616
633
  }
617
634
  }
618
- const Ht = (e) => {
635
+ const Ct = (e) => {
619
636
  const { offset: t, period: s } = e,
620
637
  r = ({ callCount: n }) => (t && n == 0 ? t : s)
621
638
  return {
@@ -627,8 +644,8 @@
627
644
  },
628
645
  Qt = (e) => {
629
646
  let t
630
- 'timer' in e ? (t = e) : (t = Ht(e))
631
- const s = new Gt(t)
647
+ 'timer' in e ? (t = e) : (t = Ct(e))
648
+ const s = new Ht(t)
632
649
  return s.start(), s.stop
633
650
  }
634
651
  class Y {
@@ -702,13 +719,13 @@
702
719
  return w(r, n)
703
720
  }),
704
721
  et = (e, t) =>
705
- !(y(e) && y(t)) || e.length !== t.length
722
+ !(g(e) && g(t)) || e.length !== t.length
706
723
  ? !1
707
724
  : e.every((s, r) => {
708
725
  const n = t[r]
709
726
  return w(s, n)
710
727
  }),
711
- w = (e, t) => (A(e) ? tt(e, t) : y(e) ? et(e, t) : Xt(e, t)),
728
+ w = (e, t) => (A(e) ? tt(e, t) : g(e) ? et(e, t) : Xt(e, t)),
712
729
  Zt = { objects: tt, arrays: et, equal: w }
713
730
  class _ {
714
731
  constructor(t) {
@@ -895,7 +912,7 @@
895
912
  de = (e, t, s) => ({ source: e, target: t, type: o.changeValue, data: s }),
896
913
  pe = (e, t) => (e.type > t.type ? 1 : e.type < t.type ? -1 : 0),
897
914
  it = { index: -1 }
898
- class me {
915
+ class fe {
899
916
  constructor() {
900
917
  this.map = {}
901
918
  }
@@ -928,7 +945,7 @@
928
945
  }
929
946
  }
930
947
  const ot = (e) => {
931
- const t = new me()
948
+ const t = new fe()
932
949
  return t.populate(e), t
933
950
  },
934
951
  ut = (e, t, s = !1) => {
@@ -943,9 +960,9 @@
943
960
  const h = n.item(u)
944
961
  if (h) {
945
962
  for (d = 0; d < c; d++) {
946
- const m = a.item(d)
947
- if (m && h.name == m.name) {
948
- p = m
963
+ const f = a.item(d)
964
+ if (f && h.name == f.name) {
965
+ p = f
949
966
  break
950
967
  }
951
968
  }
@@ -960,9 +977,9 @@
960
977
  const h = a.item(u)
961
978
  if (h) {
962
979
  for (d = 0; d < i; d++) {
963
- const m = n.item(d)
964
- if (m && m.name == h.name) {
965
- p = m
980
+ const f = n.item(d)
981
+ if (f && f.name == h.name) {
982
+ p = f
966
983
  break
967
984
  }
968
985
  }
@@ -971,7 +988,7 @@
971
988
  }
972
989
  return r
973
990
  },
974
- fe = (e, t) => {
991
+ me = (e, t) => {
975
992
  const s = [],
976
993
  r = e.eventMaps,
977
994
  n = t.eventMaps,
@@ -1002,16 +1019,16 @@
1002
1019
  },
1003
1020
  be = (e) => e.tagName !== 'INPUT',
1004
1021
  ve = (e, t) => e.value === t.value,
1005
- ge = (e, t) => {
1022
+ ye = (e, t) => {
1006
1023
  if (be(e) || ve(e, t)) return []
1007
1024
  const s = e,
1008
1025
  r = t
1009
1026
  return [de(s, r, { name: 'value', value: r.value })]
1010
1027
  },
1011
- ye = (e, t) => {
1028
+ ge = (e, t) => {
1012
1029
  const s = ut(e, t),
1013
- r = fe(e, t),
1014
- n = ge(e, t)
1030
+ r = me(e, t),
1031
+ n = ye(e, t)
1015
1032
  return s.concat(r).concat(n)
1016
1033
  },
1017
1034
  Ee = (e, t) => ut(e, t, !0),
@@ -1027,7 +1044,7 @@
1027
1044
  } else if (e.nodeType === 1) {
1028
1045
  const n = e,
1029
1046
  i = t,
1030
- a = ye(n, i),
1047
+ a = ge(n, i),
1031
1048
  c = s(n.childNodes, i.childNodes, n)
1032
1049
  r = a.concat(c)
1033
1050
  } else e.nodeType === 3 && (r = Ae(e, t))
@@ -1044,11 +1061,11 @@
1044
1061
  const p = e[u],
1045
1062
  h = t[u]
1046
1063
  if (h && a.check(h)) {
1047
- const m = i.pullMatch(h)
1064
+ const f = i.pullMatch(h)
1048
1065
  a.clear(h),
1049
- m.element
1050
- ? (m.index !== u && r.push(T(m.element, { parent: s, index: u })),
1051
- c.push({ source: m.element, target: h }))
1066
+ f.element
1067
+ ? (f.index !== u && r.push(T(f.element, { parent: s, index: u })),
1068
+ c.push({ source: f.element, target: h }))
1052
1069
  : p
1053
1070
  ? a.check(p)
1054
1071
  ? r.push(T(h, { parent: s, index: u }))
@@ -1060,7 +1077,7 @@
1060
1077
  r.push(nt(p))
1061
1078
  })
1062
1079
  const d = c.reduce(
1063
- (p, { source: h, target: m }) => p.concat(we(h, m, at)),
1080
+ (p, { source: h, target: f }) => p.concat(we(h, f, at)),
1064
1081
  [],
1065
1082
  )
1066
1083
  return r.concat(d).sort(pe)
@@ -1231,27 +1248,27 @@
1231
1248
  return `${x}:${t}`
1232
1249
  }
1233
1250
  }
1234
- const Ce = (e) => e,
1251
+ const Je = (e) => e,
1235
1252
  lt = ({ Template: e, viewModel: t, subscriptions: s }) => (
1236
1253
  (s = s || []),
1237
- (t = t || Ce),
1254
+ (t = t || Je),
1238
1255
  (r) =>
1239
1256
  new Ie({ Template: e, viewModel: t, subscriptions: s, attributes: r })
1240
1257
  ),
1241
- Je =
1258
+ Ge =
1242
1259
  (e) =>
1243
1260
  ({ path: t }) =>
1244
1261
  t === e,
1245
- Ge = () => !0,
1262
+ He = () => !0,
1246
1263
  ht =
1247
1264
  (e) =>
1248
1265
  ({ route: t }) => {
1249
1266
  const s = e.find((r) => r.match(t))
1250
1267
  return s && s.Partial
1251
1268
  },
1252
- He = Object.freeze(
1269
+ Ce = Object.freeze(
1253
1270
  Object.defineProperty(
1254
- { __proto__: null, buildRouter: ht, catchAll: Ge, exactPathMatch: Je },
1271
+ { __proto__: null, buildRouter: ht, catchAll: He, exactPathMatch: Ge },
1255
1272
  Symbol.toStringTag,
1256
1273
  { value: 'Module' },
1257
1274
  ),
@@ -1275,27 +1292,27 @@
1275
1292
  navigate: S,
1276
1293
  onLinkClick: U,
1277
1294
  onLocationChange: I,
1278
- start: Ct,
1295
+ start: Jt,
1279
1296
  },
1280
1297
  Symbol.toStringTag,
1281
1298
  { value: 'Module' },
1282
1299
  ),
1283
1300
  )
1284
1301
  ;(l.ArrayModifiers = dt),
1285
- (l.BooleanStore = mt),
1302
+ (l.BooleanStore = ft),
1286
1303
  (l.Equality = Zt),
1287
1304
  (l.Is = At),
1288
1305
  (l.JaxsTypes = re),
1289
1306
  (l.ListStore = bt),
1290
- (l.RecordStore = gt),
1291
- (l.appBuilding = Jt),
1307
+ (l.RecordStore = yt),
1308
+ (l.appBuilding = Gt),
1292
1309
  (l.bind = lt),
1293
1310
  (l.createApp = se),
1294
1311
  (l.jsx = F),
1295
1312
  (l.messageBus = Wt),
1296
1313
  (l.navigation = Xe),
1297
1314
  (l.routedView = We),
1298
- (l.routing = He),
1315
+ (l.routing = Ce),
1299
1316
  (l.state = te),
1300
1317
  Object.defineProperty(l, Symbol.toStringTag, { value: 'Module' })
1301
1318
  })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "jaxs",
3
3
  "description": "Modular J/TSX application framework",
4
4
  "private": false,
5
- "version": "0.9.1",
5
+ "version": "0.9.2",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "build": "vite build; npm run lint",