x-state-lib 0.1.0 → 0.1.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/index.js CHANGED
@@ -1,13 +1,19 @@
1
1
  import { elements as k } from "x-runtime-lib";
2
2
  function Wt() {
3
3
  return {
4
- apps: [],
5
- appid: "",
6
- type: "page",
7
- subtype: "",
8
- version: "",
9
- args: [],
10
- nodes: []
4
+ appList: [],
5
+ activeApp: {
6
+ id: "",
7
+ compGroups: [],
8
+ comps: []
9
+ },
10
+ activeObject: {
11
+ type: "page",
12
+ subtype: "",
13
+ version: "",
14
+ args: [],
15
+ nodes: []
16
+ }
11
17
  };
12
18
  }
13
19
  function qt() {
@@ -18,9 +24,7 @@ function qt() {
18
24
  }
19
25
  function Yt() {
20
26
  return {
21
- spaces: {},
22
- funcs: {},
23
- flows: {},
27
+ spaces: [],
24
28
  activeFunc: {
25
29
  id: "",
26
30
  name: "",
@@ -35,8 +39,7 @@ function Yt() {
35
39
  }
36
40
  function Xt() {
37
41
  return {
38
- spaces: {},
39
- tables: {}
42
+ spaces: []
40
43
  };
41
44
  }
42
45
  function Jt() {
@@ -78,15 +81,15 @@ function wt(t) {
78
81
  var e = x(t);
79
82
  return e == se || e == ce || e == ie || e == ue;
80
83
  }
81
- var B = l["__core-js_shared__"], et = function() {
82
- var t = /[^.]+$/.exec(B && B.keys && B.keys.IE_PROTO || "");
84
+ var L = l["__core-js_shared__"], et = function() {
85
+ var t = /[^.]+$/.exec(L && L.keys && L.keys.IE_PROTO || "");
83
86
  return t ? "Symbol(src)_1." + t : "";
84
87
  }();
85
88
  function fe(t) {
86
89
  return !!et && et in t;
87
90
  }
88
91
  var pe = Function.prototype, le = pe.toString;
89
- function _(t) {
92
+ function v(t) {
90
93
  if (t != null) {
91
94
  try {
92
95
  return le.call(t);
@@ -99,23 +102,23 @@ function _(t) {
99
102
  }
100
103
  return "";
101
104
  }
102
- var ge = /[\\^$.*+?()[\]{}|]/g, be = /^\[object .+?Constructor\]$/, de = Function.prototype, he = Object.prototype, ye = de.toString, _e = he.hasOwnProperty, ve = RegExp(
103
- "^" + ye.call(_e).replace(ge, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
105
+ var ge = /[\\^$.*+?()[\]{}|]/g, be = /^\[object .+?Constructor\]$/, de = Function.prototype, he = Object.prototype, ye = de.toString, ve = he.hasOwnProperty, _e = RegExp(
106
+ "^" + ye.call(ve).replace(ge, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
104
107
  );
105
108
  function Te(t) {
106
109
  if (!I(t) || fe(t))
107
110
  return !1;
108
- var e = wt(t) ? ve : be;
109
- return e.test(_(t));
111
+ var e = wt(t) ? _e : be;
112
+ return e.test(v(t));
110
113
  }
111
114
  function je(t, e) {
112
115
  return t == null ? void 0 : t[e];
113
116
  }
114
- function v(t, e) {
117
+ function _(t, e) {
115
118
  var r = je(t, e);
116
119
  return Te(r) ? r : void 0;
117
120
  }
118
- var U = v(l, "WeakMap"), rt = Object.create, $e = /* @__PURE__ */ function() {
121
+ var U = _(l, "WeakMap"), rt = Object.create, $e = /* @__PURE__ */ function() {
119
122
  function t() {
120
123
  }
121
124
  return function(e) {
@@ -136,7 +139,7 @@ function me(t, e) {
136
139
  }
137
140
  var nt = function() {
138
141
  try {
139
- var t = v(Object, "defineProperty");
142
+ var t = _(Object, "defineProperty");
140
143
  return t({}, "", {}), t;
141
144
  } catch {
142
145
  }
@@ -197,15 +200,15 @@ var Fe = "[object Arguments]";
197
200
  function at(t) {
198
201
  return C(t) && x(t) == Fe;
199
202
  }
200
- var Ct = Object.prototype, Me = Ct.hasOwnProperty, De = Ct.propertyIsEnumerable, Be = at(/* @__PURE__ */ function() {
203
+ var Ct = Object.prototype, Me = Ct.hasOwnProperty, De = Ct.propertyIsEnumerable, Le = at(/* @__PURE__ */ function() {
201
204
  return arguments;
202
205
  }()) ? at : function(t) {
203
206
  return C(t) && Me.call(t, "callee") && !De.call(t, "callee");
204
207
  };
205
- function Le() {
208
+ function Be() {
206
209
  return !1;
207
210
  }
208
- var It = typeof exports == "object" && exports && !exports.nodeType && exports, ot = It && typeof module == "object" && module && !module.nodeType && module, Ue = ot && ot.exports === It, it = Ue ? l.Buffer : void 0, ze = it ? it.isBuffer : void 0, Et = ze || Le, Ge = "[object Arguments]", Ne = "[object Array]", Re = "[object Boolean]", He = "[object Date]", Ke = "[object Error]", Ve = "[object Function]", We = "[object Map]", qe = "[object Number]", Ye = "[object Object]", Xe = "[object RegExp]", Je = "[object Set]", Ze = "[object String]", Qe = "[object WeakMap]", ke = "[object ArrayBuffer]", tr = "[object DataView]", er = "[object Float32Array]", rr = "[object Float64Array]", nr = "[object Int8Array]", ar = "[object Int16Array]", or = "[object Int32Array]", ir = "[object Uint8Array]", sr = "[object Uint8ClampedArray]", cr = "[object Uint16Array]", ur = "[object Uint32Array]", i = {};
211
+ var It = typeof exports == "object" && exports && !exports.nodeType && exports, ot = It && typeof module == "object" && module && !module.nodeType && module, Ue = ot && ot.exports === It, it = Ue ? l.Buffer : void 0, ze = it ? it.isBuffer : void 0, Et = ze || Be, Ge = "[object Arguments]", Ne = "[object Array]", Re = "[object Boolean]", He = "[object Date]", Ke = "[object Error]", Ve = "[object Function]", We = "[object Map]", qe = "[object Number]", Ye = "[object Object]", Xe = "[object RegExp]", Je = "[object Set]", Ze = "[object String]", Qe = "[object WeakMap]", ke = "[object ArrayBuffer]", tr = "[object DataView]", er = "[object Float32Array]", rr = "[object Float64Array]", nr = "[object Int8Array]", ar = "[object Int16Array]", or = "[object Int32Array]", ir = "[object Uint8Array]", sr = "[object Uint8ClampedArray]", cr = "[object Uint16Array]", ur = "[object Uint32Array]", i = {};
209
212
  i[er] = i[rr] = i[nr] = i[ar] = i[or] = i[ir] = i[sr] = i[cr] = i[ur] = !0;
210
213
  i[Ge] = i[Ne] = i[ke] = i[Re] = i[tr] = i[He] = i[Ke] = i[Ve] = i[We] = i[qe] = i[Ye] = i[Xe] = i[Je] = i[Ze] = i[Qe] = !1;
211
214
  function fr(t) {
@@ -216,15 +219,15 @@ function K(t) {
216
219
  return t(e);
217
220
  };
218
221
  }
219
- var Ft = typeof exports == "object" && exports && !exports.nodeType && exports, O = Ft && typeof module == "object" && module && !module.nodeType && module, pr = O && O.exports === Ft, L = pr && $t.process, $ = function() {
222
+ var Ft = typeof exports == "object" && exports && !exports.nodeType && exports, O = Ft && typeof module == "object" && module && !module.nodeType && module, pr = O && O.exports === Ft, B = pr && $t.process, $ = function() {
220
223
  try {
221
224
  var t = O && O.require && O.require("util").types;
222
- return t || L && L.binding && L.binding("util");
225
+ return t || B && B.binding && B.binding("util");
223
226
  } catch {
224
227
  }
225
228
  }(), st = $ && $.isTypedArray, lr = st ? K(st) : fr, gr = Object.prototype, br = gr.hasOwnProperty;
226
229
  function Mt(t, e) {
227
- var r = R(t), n = !r && Be(t), s = !r && !n && Et(t), c = !r && !n && !s && lr(t), o = r || n || s || c, u = o ? Ee(t.length, String) : [], f = u.length;
230
+ var r = R(t), n = !r && Le(t), s = !r && !n && Et(t), c = !r && !n && !s && lr(t), o = r || n || s || c, u = o ? Ee(t.length, String) : [], f = u.length;
228
231
  for (var p in t)
229
232
  (e || br.call(t, p)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
230
233
  (p == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
@@ -239,7 +242,7 @@ function Dt(t, e) {
239
242
  };
240
243
  }
241
244
  var dr = Dt(Object.keys, Object), hr = Object.prototype, yr = hr.hasOwnProperty;
242
- function _r(t) {
245
+ function vr(t) {
243
246
  if (!H(t))
244
247
  return dr(t);
245
248
  var e = [];
@@ -248,9 +251,9 @@ function _r(t) {
248
251
  return e;
249
252
  }
250
253
  function V(t) {
251
- return xt(t) ? Mt(t) : _r(t);
254
+ return xt(t) ? Mt(t) : vr(t);
252
255
  }
253
- function vr(t) {
256
+ function _r(t) {
254
257
  var e = [];
255
258
  if (t != null)
256
259
  for (var r in Object(t))
@@ -260,7 +263,7 @@ function vr(t) {
260
263
  var Tr = Object.prototype, jr = Tr.hasOwnProperty;
261
264
  function $r(t) {
262
265
  if (!I(t))
263
- return vr(t);
266
+ return _r(t);
264
267
  var e = H(t), r = [];
265
268
  for (var n in t)
266
269
  n == "constructor" && (e || !jr.call(t, n)) || r.push(n);
@@ -269,7 +272,7 @@ function $r(t) {
269
272
  function W(t) {
270
273
  return xt(t) ? Mt(t, !0) : $r(t);
271
274
  }
272
- var S = v(Object, "create");
275
+ var S = _(Object, "create");
273
276
  function mr() {
274
277
  this.__data__ = S ? S(null) : {}, this.size = 0;
275
278
  }
@@ -317,13 +320,13 @@ function M(t, e) {
317
320
  return r;
318
321
  return -1;
319
322
  }
320
- var Dr = Array.prototype, Br = Dr.splice;
321
- function Lr(t) {
323
+ var Dr = Array.prototype, Lr = Dr.splice;
324
+ function Br(t) {
322
325
  var e = this.__data__, r = M(e, t);
323
326
  if (r < 0)
324
327
  return !1;
325
328
  var n = e.length - 1;
326
- return r == n ? e.pop() : Br.call(e, r, 1), --this.size, !0;
329
+ return r == n ? e.pop() : Lr.call(e, r, 1), --this.size, !0;
327
330
  }
328
331
  function Ur(t) {
329
332
  var e = this.__data__, r = M(e, t);
@@ -344,11 +347,11 @@ function b(t) {
344
347
  }
345
348
  }
346
349
  b.prototype.clear = Mr;
347
- b.prototype.delete = Lr;
350
+ b.prototype.delete = Br;
348
351
  b.prototype.get = Ur;
349
352
  b.prototype.has = zr;
350
353
  b.prototype.set = Gr;
351
- var P = v(l, "Map");
354
+ var P = _(l, "Map");
352
355
  function Nr() {
353
356
  this.size = 0, this.__data__ = {
354
357
  hash: new y(),
@@ -390,12 +393,12 @@ m.prototype.delete = Hr;
390
393
  m.prototype.get = Kr;
391
394
  m.prototype.has = Vr;
392
395
  m.prototype.set = Wr;
393
- function Bt(t, e) {
396
+ function Lt(t, e) {
394
397
  for (var r = -1, n = e.length, s = t.length; ++r < n; )
395
398
  t[s + r] = e[r];
396
399
  return t;
397
400
  }
398
- var Lt = Dt(Object.getPrototypeOf, Object);
401
+ var Bt = Dt(Object.getPrototypeOf, Object);
399
402
  function qr() {
400
403
  this.__data__ = new b(), this.size = 0;
401
404
  }
@@ -462,7 +465,7 @@ function sn(t, e) {
462
465
  }
463
466
  var cn = Object.getOwnPropertySymbols, Gt = cn ? function(t) {
464
467
  for (var e = []; t; )
465
- Bt(e, q(t)), t = Lt(t);
468
+ Lt(e, q(t)), t = Bt(t);
466
469
  return e;
467
470
  } : zt;
468
471
  function un(t, e) {
@@ -470,7 +473,7 @@ function un(t, e) {
470
473
  }
471
474
  function Nt(t, e, r) {
472
475
  var n = e(t);
473
- return R(t) ? n : Bt(n, r(t));
476
+ return R(t) ? n : Lt(n, r(t));
474
477
  }
475
478
  function fn(t) {
476
479
  return Nt(t, V, q);
@@ -478,9 +481,9 @@ function fn(t) {
478
481
  function pn(t) {
479
482
  return Nt(t, W, Gt);
480
483
  }
481
- var z = v(l, "DataView"), G = v(l, "Promise"), N = v(l, "Set"), lt = "[object Map]", ln = "[object Object]", gt = "[object Promise]", bt = "[object Set]", dt = "[object WeakMap]", ht = "[object DataView]", gn = _(z), bn = _(P), dn = _(G), hn = _(N), yn = _(U), g = x;
484
+ var z = _(l, "DataView"), G = _(l, "Promise"), N = _(l, "Set"), lt = "[object Map]", ln = "[object Object]", gt = "[object Promise]", bt = "[object Set]", dt = "[object WeakMap]", ht = "[object DataView]", gn = v(z), bn = v(P), dn = v(G), hn = v(N), yn = v(U), g = x;
482
485
  (z && g(new z(new ArrayBuffer(1))) != ht || P && g(new P()) != lt || G && g(G.resolve()) != gt || N && g(new N()) != bt || U && g(new U()) != dt) && (g = function(t) {
483
- var e = x(t), r = e == ln ? t.constructor : void 0, n = r ? _(r) : "";
486
+ var e = x(t), r = e == ln ? t.constructor : void 0, n = r ? v(r) : "";
484
487
  if (n)
485
488
  switch (n) {
486
489
  case gn:
@@ -496,10 +499,10 @@ var z = v(l, "DataView"), G = v(l, "Promise"), N = v(l, "Set"), lt = "[object Ma
496
499
  }
497
500
  return e;
498
501
  });
499
- var _n = Object.prototype, vn = _n.hasOwnProperty;
502
+ var vn = Object.prototype, _n = vn.hasOwnProperty;
500
503
  function Tn(t) {
501
504
  var e = t.length, r = new t.constructor(e);
502
- return e && typeof t[0] == "string" && vn.call(t, "index") && (r.index = t.index, r.input = t.input), r;
505
+ return e && typeof t[0] == "string" && _n.call(t, "index") && (r.index = t.index, r.input = t.input), r;
503
506
  }
504
507
  var yt = l.Uint8Array;
505
508
  function Y(t) {
@@ -515,15 +518,15 @@ function mn(t) {
515
518
  var e = new t.constructor(t.source, $n.exec(t));
516
519
  return e.lastIndex = t.lastIndex, e;
517
520
  }
518
- var _t = j ? j.prototype : void 0, vt = _t ? _t.valueOf : void 0;
521
+ var vt = j ? j.prototype : void 0, _t = vt ? vt.valueOf : void 0;
519
522
  function wn(t) {
520
- return vt ? Object(vt.call(t)) : {};
523
+ return _t ? Object(_t.call(t)) : {};
521
524
  }
522
525
  function An(t, e) {
523
526
  var r = e ? Y(t.buffer) : t.buffer;
524
527
  return new t.constructor(r, t.byteOffset, t.length);
525
528
  }
526
- var On = "[object Boolean]", Sn = "[object Date]", Pn = "[object Map]", xn = "[object Number]", Cn = "[object RegExp]", In = "[object Set]", En = "[object String]", Fn = "[object Symbol]", Mn = "[object ArrayBuffer]", Dn = "[object DataView]", Bn = "[object Float32Array]", Ln = "[object Float64Array]", Un = "[object Int8Array]", zn = "[object Int16Array]", Gn = "[object Int32Array]", Nn = "[object Uint8Array]", Rn = "[object Uint8ClampedArray]", Hn = "[object Uint16Array]", Kn = "[object Uint32Array]";
529
+ var On = "[object Boolean]", Sn = "[object Date]", Pn = "[object Map]", xn = "[object Number]", Cn = "[object RegExp]", In = "[object Set]", En = "[object String]", Fn = "[object Symbol]", Mn = "[object ArrayBuffer]", Dn = "[object DataView]", Ln = "[object Float32Array]", Bn = "[object Float64Array]", Un = "[object Int8Array]", zn = "[object Int16Array]", Gn = "[object Int32Array]", Nn = "[object Uint8Array]", Rn = "[object Uint8ClampedArray]", Hn = "[object Uint16Array]", Kn = "[object Uint32Array]";
527
530
  function Vn(t, e, r) {
528
531
  var n = t.constructor;
529
532
  switch (e) {
@@ -534,8 +537,8 @@ function Vn(t, e, r) {
534
537
  return new n(+t);
535
538
  case Dn:
536
539
  return jn(t, r);
537
- case Bn:
538
540
  case Ln:
541
+ case Bn:
539
542
  case Un:
540
543
  case zn:
541
544
  case Gn:
@@ -558,7 +561,7 @@ function Vn(t, e, r) {
558
561
  }
559
562
  }
560
563
  function Wn(t) {
561
- return typeof t.constructor == "function" && !H(t) ? $e(Lt(t)) : {};
564
+ return typeof t.constructor == "function" && !H(t) ? $e(Bt(t)) : {};
562
565
  }
563
566
  var qn = "[object Map]";
564
567
  function Yn(t) {
@@ -568,8 +571,8 @@ var Tt = $ && $.isMap, Xn = Tt ? K(Tt) : Yn, Jn = "[object Set]";
568
571
  function Zn(t) {
569
572
  return C(t) && g(t) == Jn;
570
573
  }
571
- var jt = $ && $.isSet, Qn = jt ? K(jt) : Zn, kn = 1, ta = 2, ea = 4, Rt = "[object Arguments]", ra = "[object Array]", na = "[object Boolean]", aa = "[object Date]", oa = "[object Error]", Ht = "[object Function]", ia = "[object GeneratorFunction]", sa = "[object Map]", ca = "[object Number]", Kt = "[object Object]", ua = "[object RegExp]", fa = "[object Set]", pa = "[object String]", la = "[object Symbol]", ga = "[object WeakMap]", ba = "[object ArrayBuffer]", da = "[object DataView]", ha = "[object Float32Array]", ya = "[object Float64Array]", _a = "[object Int8Array]", va = "[object Int16Array]", Ta = "[object Int32Array]", ja = "[object Uint8Array]", $a = "[object Uint8ClampedArray]", ma = "[object Uint16Array]", wa = "[object Uint32Array]", a = {};
572
- a[Rt] = a[ra] = a[ba] = a[da] = a[na] = a[aa] = a[ha] = a[ya] = a[_a] = a[va] = a[Ta] = a[sa] = a[ca] = a[Kt] = a[ua] = a[fa] = a[pa] = a[la] = a[ja] = a[$a] = a[ma] = a[wa] = !0;
574
+ var jt = $ && $.isSet, Qn = jt ? K(jt) : Zn, kn = 1, ta = 2, ea = 4, Rt = "[object Arguments]", ra = "[object Array]", na = "[object Boolean]", aa = "[object Date]", oa = "[object Error]", Ht = "[object Function]", ia = "[object GeneratorFunction]", sa = "[object Map]", ca = "[object Number]", Kt = "[object Object]", ua = "[object RegExp]", fa = "[object Set]", pa = "[object String]", la = "[object Symbol]", ga = "[object WeakMap]", ba = "[object ArrayBuffer]", da = "[object DataView]", ha = "[object Float32Array]", ya = "[object Float64Array]", va = "[object Int8Array]", _a = "[object Int16Array]", Ta = "[object Int32Array]", ja = "[object Uint8Array]", $a = "[object Uint8ClampedArray]", ma = "[object Uint16Array]", wa = "[object Uint32Array]", a = {};
575
+ a[Rt] = a[ra] = a[ba] = a[da] = a[na] = a[aa] = a[ha] = a[ya] = a[va] = a[_a] = a[Ta] = a[sa] = a[ca] = a[Kt] = a[ua] = a[fa] = a[pa] = a[la] = a[ja] = a[$a] = a[ma] = a[wa] = !0;
573
576
  a[oa] = a[Ht] = a[ga] = !1;
574
577
  function E(t, e, r, n, s, c) {
575
578
  var o, u = e & kn, f = e & ta, p = e & ea;
@@ -647,22 +650,22 @@ function xa(t) {
647
650
  }), e;
648
651
  }
649
652
  const Ea = function() {
650
- return window.blocklyState || (window.blocklyState = {
653
+ return window.state || (window.state = {
651
654
  base: qt(),
652
655
  runtime: Pa(),
653
656
  app: Wt(),
654
657
  compute: Yt(),
655
658
  data: Xt(),
656
659
  resource: Jt()
657
- }), window.blocklyState;
660
+ }), window.state;
658
661
  }();
659
662
  export {
660
- Ea as blocklyState,
661
663
  Ia as buildProps,
662
664
  Wt as initApp,
663
665
  qt as initBase,
664
666
  Yt as initCompute,
665
667
  Xt as initData,
666
668
  Jt as initResource,
667
- Pa as initRuntime
669
+ Pa as initRuntime,
670
+ Ea as state
668
671
  };
@@ -1,4 +1,4 @@
1
- export type App = {
1
+ type AppListEntry = {
2
2
  id: string;
3
3
  name: string;
4
4
  pages: {
@@ -6,23 +6,41 @@ export type App = {
6
6
  name: string;
7
7
  }[];
8
8
  };
9
- export type Arg = {
9
+ type CompGroup = {
10
10
  id: string;
11
11
  name: string;
12
- type: string;
12
+ position: number;
13
13
  };
14
- export type Node = {
14
+ type Comp = {
15
15
  id: string;
16
- key: string;
17
- alias: string;
16
+ groupid: string;
17
+ name: string;
18
+ position: number;
19
+ };
20
+ type ActiveApp = {
21
+ id: '';
22
+ compGroups: CompGroup[];
23
+ comps: Comp[];
18
24
  };
19
- export type App2 = {
20
- apps: App[];
21
- appid: '';
25
+ type ActiveObject = {
22
26
  type: 'page' | 'comp';
23
27
  subtype: string;
24
28
  version: string;
25
- args: Arg[];
26
- nodes: Node[];
29
+ args: {
30
+ id: string;
31
+ name: string;
32
+ type: string;
33
+ }[];
34
+ nodes: {
35
+ id: string;
36
+ key: string;
37
+ alias: string;
38
+ }[];
39
+ };
40
+ export type App = {
41
+ appList: AppListEntry[];
42
+ activeApp: ActiveApp;
43
+ activeObject: ActiveObject;
27
44
  };
28
- export declare function initApp(): App2;
45
+ export declare function initApp(): App;
46
+ export {};
@@ -1,15 +1,13 @@
1
- export type ComputeSpace = {
1
+ type FuncGroup = {
2
2
  id: string;
3
3
  name: string;
4
- sort: number;
4
+ position: number;
5
5
  };
6
- export type Func = {
6
+ type Func = {
7
7
  id: string;
8
8
  spaceid: string;
9
+ groupid: string;
9
10
  name: string;
10
- sort: number;
11
- dev: string;
12
- prod: string;
13
11
  inputs: {
14
12
  id: string;
15
13
  name: string;
@@ -20,16 +18,34 @@ export type Func = {
20
18
  name: string;
21
19
  type: string;
22
20
  }[];
21
+ dev: string;
22
+ prod: string;
23
+ position: number;
24
+ };
25
+ type FlowGroup = {
26
+ id: string;
27
+ name: string;
28
+ position: number;
23
29
  };
24
- export type Flow = {
30
+ type Flow = {
25
31
  id: string;
26
32
  spaceid: string;
33
+ groupid: string;
27
34
  name: string;
28
- sort: number;
29
35
  dev: string;
30
36
  prod: string;
37
+ position: number;
38
+ };
39
+ type Space = {
40
+ id: string;
41
+ name: string;
42
+ funcGroups: FuncGroup[];
43
+ funcs: Func[];
44
+ flowGroups: FlowGroup[];
45
+ flows: Flow[];
46
+ position: number;
31
47
  };
32
- export type ActiveFunc = {
48
+ type ActiveFunc = {
33
49
  id: string;
34
50
  name: string;
35
51
  inputs: {
@@ -43,21 +59,14 @@ export type ActiveFunc = {
43
59
  type: string;
44
60
  }[];
45
61
  };
46
- export type ActiveFlow = {
62
+ type ActiveFlow = {
47
63
  id: string;
48
64
  name: string;
49
65
  };
50
66
  export type Compute = {
51
- spaces: {
52
- [spaceid: string]: ComputeSpace;
53
- };
54
- funcs: {
55
- [funcid: string]: Func;
56
- };
57
- flows: {
58
- [flowid: string]: Flow;
59
- };
67
+ spaces: Space[];
60
68
  activeFunc: ActiveFunc;
61
69
  activeFlow: ActiveFlow;
62
70
  };
63
71
  export declare function initCompute(): Compute;
72
+ export {};
@@ -1,13 +1,7 @@
1
- export type DataSpace = {
2
- id: string;
3
- name: string;
4
- sort: number;
5
- };
6
- export type Table = {
1
+ type Table = {
7
2
  id: string;
8
3
  spaceid: string;
9
4
  name: string;
10
- sort: number;
11
5
  columns: {
12
6
  id: string;
13
7
  name: string;
@@ -19,13 +13,16 @@ export type Table = {
19
13
  columns: string[];
20
14
  unique: boolean;
21
15
  }[];
16
+ position: number;
17
+ };
18
+ type Space = {
19
+ id: string;
20
+ name: string;
21
+ tables: Table[];
22
+ position: number;
22
23
  };
23
24
  export type Data = {
24
- spaces: {
25
- [spaceid: string]: DataSpace;
26
- };
27
- tables: {
28
- [tableid: string]: Table;
29
- };
25
+ spaces: Space[];
30
26
  };
31
27
  export declare function initData(): Data;
28
+ export {};
@@ -1,15 +1,15 @@
1
- import { App2 } from './app';
1
+ import { App } from './app';
2
2
  import { Base } from './base';
3
3
  import { Compute } from './compute';
4
4
  import { Data } from './data';
5
5
  import { Resource } from './resource';
6
6
  import { Runtime } from './runtime';
7
- export type BlocklyState = {
7
+ export type State = {
8
8
  base: Base;
9
9
  runtime: Runtime;
10
- app: App2;
10
+ app: App;
11
11
  compute: Compute;
12
12
  data: Data;
13
13
  resource: Resource;
14
14
  };
15
- export declare const blocklyState: BlocklyState;
15
+ export declare const state: State;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-state-lib",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "lodash-es": "^4.17.21",
26
26
  "vue": "^3.5.12",
27
27
  "vuetify": "^3.7.3",
28
- "x-runtime-lib": "^0.5.18"
28
+ "x-runtime-lib": "^0.5.19"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@eslint/js": "^10.0.0",
@@ -45,6 +45,6 @@
45
45
  "vite": "^5.4.9",
46
46
  "vite-plugin-css-injected-by-js": "^3.5.2",
47
47
  "vite-plugin-vuetify": "^2.0.4",
48
- "vue-tsc": "^2.1.6"
48
+ "vue-tsc": "^2.2.0"
49
49
  }
50
50
  }