x-state-lib 0.3.11 → 0.3.12

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/index.js CHANGED
@@ -204,7 +204,7 @@ var vt = Object.prototype, je = vt.hasOwnProperty, ve = vt.propertyIsEnumerable,
204
204
  function Te() {
205
205
  return !1;
206
206
  }
207
- var _t = typeof exports == "object" && exports && !exports.nodeType && exports, Z = _t && typeof module == "object" && module && !module.nodeType && module, $e = Z && Z.exports === _t, Q = $e ? f.Buffer : void 0, me = Q ? Q.isBuffer : void 0, Tt = me || Te, we = "[object Arguments]", Ae = "[object Array]", Oe = "[object Boolean]", Se = "[object Date]", Pe = "[object Error]", xe = "[object Function]", Ce = "[object Map]", Ee = "[object Number]", Ie = "[object Object]", Me = "[object RegExp]", De = "[object Set]", Fe = "[object String]", Ue = "[object WeakMap]", Be = "[object ArrayBuffer]", ze = "[object DataView]", Ge = "[object Float32Array]", Le = "[object Float64Array]", Ne = "[object Int8Array]", Re = "[object Int16Array]", Ve = "[object Int32Array]", He = "[object Uint8Array]", Ke = "[object Uint8ClampedArray]", We = "[object Uint16Array]", qe = "[object Uint32Array]", a = {};
207
+ var _t = typeof exports == "object" && exports && !exports.nodeType && exports, Z = _t && typeof module == "object" && module && !module.nodeType && module, me = Z && Z.exports === _t, Q = me ? f.Buffer : void 0, $e = Q ? Q.isBuffer : void 0, Tt = $e || Te, we = "[object Arguments]", Ae = "[object Array]", Oe = "[object Boolean]", Se = "[object Date]", Pe = "[object Error]", xe = "[object Function]", Ce = "[object Map]", Ee = "[object Number]", Ie = "[object Object]", Me = "[object RegExp]", De = "[object Set]", Fe = "[object String]", Ue = "[object WeakMap]", Be = "[object ArrayBuffer]", ze = "[object DataView]", Ge = "[object Float32Array]", Le = "[object Float64Array]", Ne = "[object Int8Array]", Re = "[object Int16Array]", Ve = "[object Int32Array]", He = "[object Uint8Array]", Ke = "[object Uint8ClampedArray]", We = "[object Uint16Array]", qe = "[object Uint32Array]", a = {};
208
208
  a[Ge] = a[Le] = a[Ne] = a[Re] = a[Ve] = a[He] = a[Ke] = a[We] = a[qe] = !0;
209
209
  a[we] = a[Ae] = a[Be] = a[Oe] = a[ze] = a[Se] = a[Pe] = a[xe] = a[Ce] = a[Ee] = a[Ie] = a[Me] = a[De] = a[Fe] = a[Ue] = !1;
210
210
  function Xe(t) {
@@ -215,13 +215,13 @@ function R(t) {
215
215
  return t(e);
216
216
  };
217
217
  }
218
- var $t = typeof exports == "object" && exports && !exports.nodeType && exports, O = $t && typeof module == "object" && module && !module.nodeType && module, Ye = O && O.exports === $t, U = Ye && gt.process, $ = (function() {
218
+ var mt = typeof exports == "object" && exports && !exports.nodeType && exports, O = mt && typeof module == "object" && module && !module.nodeType && module, Ye = O && O.exports === mt, U = Ye && gt.process, m = (function() {
219
219
  try {
220
220
  var t = O && O.require && O.require("util").types;
221
221
  return t || U && U.binding && U.binding("util");
222
222
  } catch {
223
223
  }
224
- })(), k = $ && $.isTypedArray, Je = k ? R(k) : Xe, Ze = Object.prototype, Qe = Ze.hasOwnProperty;
224
+ })(), k = m && m.isTypedArray, Je = k ? R(k) : Xe, Ze = Object.prototype, Qe = Ze.hasOwnProperty;
225
225
  function ke(t, e) {
226
226
  var r = N(t), n = !r && _e(t), i = !r && !n && Tt(t), s = !r && !n && !i && Je(t), c = r || n || i || s, _ = c ? he(t.length, String) : [], g = _.length;
227
227
  for (var u in t)
@@ -232,12 +232,12 @@ function ke(t, e) {
232
232
  ce(u, g))) && _.push(u);
233
233
  return _;
234
234
  }
235
- function mt(t, e) {
235
+ function $t(t, e) {
236
236
  return function(r) {
237
237
  return t(e(r));
238
238
  };
239
239
  }
240
- var tr = mt(Object.keys, Object), er = Object.prototype, rr = er.hasOwnProperty;
240
+ var tr = $t(Object.keys, Object), er = Object.prototype, rr = er.hasOwnProperty;
241
241
  function nr(t) {
242
242
  if (!jt(t))
243
243
  return tr(t);
@@ -312,7 +312,7 @@ function _r(t) {
312
312
  function Tr(t) {
313
313
  return M(this.__data__, t) > -1;
314
314
  }
315
- function $r(t, e) {
315
+ function mr(t, e) {
316
316
  var r = this.__data__, n = M(r, t);
317
317
  return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
318
318
  }
@@ -327,9 +327,9 @@ l.prototype.clear = hr;
327
327
  l.prototype.delete = vr;
328
328
  l.prototype.get = _r;
329
329
  l.prototype.has = Tr;
330
- l.prototype.set = $r;
330
+ l.prototype.set = mr;
331
331
  var P = v(f, "Map");
332
- function mr() {
332
+ function $r() {
333
333
  this.size = 0, this.__data__ = {
334
334
  hash: new y(),
335
335
  map: new (P || l)(),
@@ -358,24 +358,24 @@ function Pr(t, e) {
358
358
  var r = D(this, t), n = r.size;
359
359
  return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
360
360
  }
361
- function m(t) {
361
+ function $(t) {
362
362
  var e = -1, r = t == null ? 0 : t.length;
363
363
  for (this.clear(); ++e < r; ) {
364
364
  var n = t[e];
365
365
  this.set(n[0], n[1]);
366
366
  }
367
367
  }
368
- m.prototype.clear = mr;
369
- m.prototype.delete = Ar;
370
- m.prototype.get = Or;
371
- m.prototype.has = Sr;
372
- m.prototype.set = Pr;
368
+ $.prototype.clear = $r;
369
+ $.prototype.delete = Ar;
370
+ $.prototype.get = Or;
371
+ $.prototype.has = Sr;
372
+ $.prototype.set = Pr;
373
373
  function xr(t, e) {
374
374
  for (var r = -1, n = e.length, i = t.length; ++r < n; )
375
375
  t[i + r] = e[r];
376
376
  return t;
377
377
  }
378
- var Cr = mt(Object.getPrototypeOf, Object);
378
+ var Cr = $t(Object.getPrototypeOf, Object);
379
379
  function Er() {
380
380
  this.__data__ = new l(), this.size = 0;
381
381
  }
@@ -396,7 +396,7 @@ function Ur(t, e) {
396
396
  var n = r.__data__;
397
397
  if (!P || n.length < Fr - 1)
398
398
  return n.push([t, e]), this.size = ++r.size, this;
399
- r = this.__data__ = new m(n);
399
+ r = this.__data__ = new $(n);
400
400
  }
401
401
  return r.set(t, e), this.size = r.size, this;
402
402
  }
@@ -481,7 +481,7 @@ function an(t, e) {
481
481
  var r = V(t.buffer);
482
482
  return new t.constructor(r, t.byteOffset, t.length);
483
483
  }
484
- var sn = "[object Boolean]", cn = "[object Date]", un = "[object Map]", fn = "[object Number]", pn = "[object RegExp]", ln = "[object Set]", gn = "[object String]", bn = "[object Symbol]", dn = "[object ArrayBuffer]", hn = "[object DataView]", yn = "[object Float32Array]", jn = "[object Float64Array]", vn = "[object Int8Array]", _n = "[object Int16Array]", Tn = "[object Int32Array]", $n = "[object Uint8Array]", mn = "[object Uint8ClampedArray]", wn = "[object Uint16Array]", An = "[object Uint32Array]";
484
+ var sn = "[object Boolean]", cn = "[object Date]", un = "[object Map]", fn = "[object Number]", pn = "[object RegExp]", ln = "[object Set]", gn = "[object String]", bn = "[object Symbol]", dn = "[object ArrayBuffer]", hn = "[object DataView]", yn = "[object Float32Array]", jn = "[object Float64Array]", vn = "[object Int8Array]", _n = "[object Int16Array]", Tn = "[object Int32Array]", mn = "[object Uint8Array]", $n = "[object Uint8ClampedArray]", wn = "[object Uint16Array]", An = "[object Uint32Array]";
485
485
  function On(t, e, r) {
486
486
  var n = t.constructor;
487
487
  switch (e) {
@@ -497,8 +497,8 @@ function On(t, e, r) {
497
497
  case vn:
498
498
  case _n:
499
499
  case Tn:
500
- case $n:
501
500
  case mn:
501
+ case $n:
502
502
  case wn:
503
503
  case An:
504
504
  return an(t);
@@ -522,11 +522,11 @@ var Pn = "[object Map]";
522
522
  function xn(t) {
523
523
  return C(t) && p(t) == Pn;
524
524
  }
525
- var pt = $ && $.isMap, Cn = pt ? R(pt) : xn, En = "[object Set]";
525
+ var pt = m && m.isMap, Cn = pt ? R(pt) : xn, En = "[object Set]";
526
526
  function In(t) {
527
527
  return C(t) && p(t) == En;
528
528
  }
529
- var lt = $ && $.isSet, Mn = lt ? R(lt) : In, At = "[object Arguments]", Dn = "[object Array]", Fn = "[object Boolean]", Un = "[object Date]", Bn = "[object Error]", Ot = "[object Function]", zn = "[object GeneratorFunction]", Gn = "[object Map]", Ln = "[object Number]", St = "[object Object]", Nn = "[object RegExp]", Rn = "[object Set]", Vn = "[object String]", Hn = "[object Symbol]", Kn = "[object WeakMap]", Wn = "[object ArrayBuffer]", qn = "[object DataView]", Xn = "[object Float32Array]", Yn = "[object Float64Array]", Jn = "[object Int8Array]", Zn = "[object Int16Array]", Qn = "[object Int32Array]", kn = "[object Uint8Array]", to = "[object Uint8ClampedArray]", eo = "[object Uint16Array]", ro = "[object Uint32Array]", o = {};
529
+ var lt = m && m.isSet, Mn = lt ? R(lt) : In, At = "[object Arguments]", Dn = "[object Array]", Fn = "[object Boolean]", Un = "[object Date]", Bn = "[object Error]", Ot = "[object Function]", zn = "[object GeneratorFunction]", Gn = "[object Map]", Ln = "[object Number]", St = "[object Object]", Nn = "[object RegExp]", Rn = "[object Set]", Vn = "[object String]", Hn = "[object Symbol]", Kn = "[object WeakMap]", Wn = "[object ArrayBuffer]", qn = "[object DataView]", Xn = "[object Float32Array]", Yn = "[object Float64Array]", Jn = "[object Int8Array]", Zn = "[object Int16Array]", Qn = "[object Int32Array]", kn = "[object Uint8Array]", to = "[object Uint8ClampedArray]", eo = "[object Uint16Array]", ro = "[object Uint32Array]", o = {};
530
530
  o[At] = o[Dn] = o[Wn] = o[qn] = o[Fn] = o[Un] = o[Xn] = o[Yn] = o[Jn] = o[Zn] = o[Qn] = o[Gn] = o[Ln] = o[St] = o[Nn] = o[Rn] = o[Vn] = o[Hn] = o[kn] = o[to] = o[eo] = o[ro] = !0;
531
531
  o[Bn] = o[Ot] = o[Kn] = !1;
532
532
  function E(t, e, r, n, i, s) {
@@ -605,15 +605,40 @@ function co() {
605
605
  }
606
606
  return t;
607
607
  }
608
- function uo() {
608
+ function uo(t) {
609
+ const e = [];
610
+ for (const r of t)
611
+ e.push({
612
+ key: r.key,
613
+ name: r.name,
614
+ params: [
615
+ {
616
+ key: "oldValue",
617
+ name: "x-runtime-lib.oldValue",
618
+ type: "string"
619
+ },
620
+ {
621
+ key: "newValue",
622
+ name: "x-runtime-lib.newValue",
623
+ type: "string"
624
+ }
625
+ ]
626
+ });
627
+ return e;
628
+ }
629
+ function fo() {
609
630
  const t = {};
610
631
  for (const e in d) {
611
632
  const r = d[e];
612
- r.events.length > 0 && (t[e] = r.events);
633
+ for (const n in r.props)
634
+ [
635
+ ...uo(r.props[n]),
636
+ ...r.events
637
+ ];
613
638
  }
614
639
  return t;
615
640
  }
616
- function fo() {
641
+ function po() {
617
642
  const t = {};
618
643
  for (const e in d) {
619
644
  const r = d[e];
@@ -621,8 +646,8 @@ function fo() {
621
646
  }
622
647
  return t;
623
648
  }
624
- function po() {
625
- const t = so(), e = co(), r = uo(), n = fo();
649
+ function lo() {
650
+ const t = so(), e = co(), r = fo(), n = po();
626
651
  return {
627
652
  props: t,
628
653
  methods: e,
@@ -630,9 +655,9 @@ function po() {
630
655
  slots: n
631
656
  };
632
657
  }
633
- const go = (function() {
658
+ const bo = (function() {
634
659
  return window.globalState || (window.globalState = {
635
- runtime: po(),
660
+ runtime: lo(),
636
661
  app: xt(),
637
662
  compute: Ct(),
638
663
  data: Et(),
@@ -640,10 +665,10 @@ const go = (function() {
640
665
  }), window.globalState;
641
666
  })();
642
667
  export {
643
- go as globalState,
668
+ bo as globalState,
644
669
  xt as initApp,
645
670
  Ct as initCompute,
646
671
  Et as initData,
647
672
  It as initResource,
648
- po as initRuntime
673
+ lo as initRuntime
649
674
  };
@@ -13,7 +13,9 @@ export type Methods = {
13
13
  [key: string]: ZMethod[];
14
14
  };
15
15
  export type Events = {
16
- [key: string]: ZEvent[];
16
+ [key: string]: {
17
+ [tag: string]: ZEvent[];
18
+ };
17
19
  };
18
20
  export type Slots = {
19
21
  [key: string]: ZSlot[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-state-lib",
3
3
  "private": false,
4
- "version": "0.3.11",
4
+ "version": "0.3.12",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",