x-block-lib 0.4.40 → 0.4.41

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.
@@ -33,6 +33,8 @@ declare const _default: {
33
33
  CROSS_TAB_COPY: string;
34
34
  CROSS_TAB_PASTE: string;
35
35
  NO_OPTION: string;
36
+ BUTTON_NO_COMPUTE: string;
37
+ BUTTON_NO_TABLE: string;
36
38
  CATEGORY_CALC: string;
37
39
  CATEGORY_COLOR: string;
38
40
  CATEGORY_DATA: string;
@@ -47,8 +49,6 @@ declare const _default: {
47
49
  CATEGORY_TEXT: string;
48
50
  CATEGORY_TIME: string;
49
51
  CATEGORY_VARIABLE: string;
50
- DESC_NO_COMPUTE_GUIDE: string;
51
- DESC_NO_TABLE_GUIDE: string;
52
52
  LABEL_BOOLEAN: string;
53
53
  LABEL_CONDITION: string;
54
54
  LABEL_CREATE_VARIABLE: string;
@@ -33,6 +33,8 @@ declare const _default: {
33
33
  CROSS_TAB_COPY: string;
34
34
  CROSS_TAB_PASTE: string;
35
35
  NO_OPTION: string;
36
+ BUTTON_NO_COMPUTE: string;
37
+ BUTTON_NO_TABLE: string;
36
38
  CATEGORY_CALC: string;
37
39
  CATEGORY_COLOR: string;
38
40
  CATEGORY_DATA: string;
@@ -47,8 +49,6 @@ declare const _default: {
47
49
  CATEGORY_TEXT: string;
48
50
  CATEGORY_TIMER: string;
49
51
  CATEGORY_VARIABLE: string;
50
- DESC_NO_COMPUTE_GUIDE: string;
51
- DESC_NO_MODEL_GUIDE: string;
52
52
  LABEL_BOOLEAN: string;
53
53
  LABEL_CONDITION: string;
54
54
  LABEL_CREATE_VARIABLE: string;
@@ -9,13 +9,6 @@ export declare function getAppInfo(id: string): {
9
9
  id: string;
10
10
  name: string;
11
11
  sort: number;
12
- pages: {
13
- [pageid: string]: {
14
- id: string;
15
- name: string;
16
- sort: number;
17
- };
18
- };
19
12
  };
20
13
  export declare function genAppOpts(): Blockly.MenuOption[];
21
14
  interface PageInfo {
@@ -24,10 +17,11 @@ interface PageInfo {
24
17
  sort: number;
25
18
  }
26
19
  export declare function getAllPageInfos(appid: string): PageInfo[];
27
- export declare function getPageInfo(appid: string, id: string): {
20
+ export declare function getPageInfo(id: string): {
28
21
  id: string;
22
+ appid: string;
29
23
  name: string;
30
24
  sort: number;
31
- } | undefined;
25
+ };
32
26
  export declare function genPageOpts(appid: string): Blockly.MenuOption[];
33
27
  export {};
@@ -15,8 +15,9 @@ interface FuncInfo {
15
15
  sort: number;
16
16
  }
17
17
  export declare function getAllFuncInfos(spaceid: string): FuncInfo[];
18
- export declare function getFuncInfo(spaceid: string, id: string): {
18
+ export declare function getFuncInfo(id: string): {
19
19
  id: string;
20
+ spaceid: string;
20
21
  name: string;
21
22
  sort: number;
22
23
  dev: string;
@@ -31,7 +32,7 @@ export declare function getFuncInfo(spaceid: string, id: string): {
31
32
  name: string;
32
33
  type: string;
33
34
  }[];
34
- } | undefined;
35
+ };
35
36
  export declare function genFuncOpts(spaceid: string): Blockly.MenuOption[];
36
37
  export declare function getActiveFunc(): {
37
38
  id: string;
@@ -9,32 +9,6 @@ export declare function getSpaceInfo(id: string): {
9
9
  id: string;
10
10
  name: string;
11
11
  sort: number;
12
- funcs: {
13
- [funcid: string]: {
14
- id: string;
15
- name: string;
16
- sort: number;
17
- dev: string;
18
- prod: string;
19
- inputs: {
20
- id: string;
21
- name: string;
22
- type: string;
23
- }[];
24
- outputs: {
25
- id: string;
26
- name: string;
27
- type: string;
28
- }[];
29
- };
30
- };
31
- flows: {
32
- [flowid: string]: {
33
- id: string;
34
- name: string;
35
- sort: number;
36
- };
37
- };
38
12
  };
39
13
  export declare function genSpaceOpts(): Blockly.MenuOption[];
40
14
  export {};
@@ -0,0 +1,14 @@
1
+ import * as Blockly from 'blockly/core';
2
+ interface SpaceInfo {
3
+ id: string;
4
+ name: string;
5
+ sort: number;
6
+ }
7
+ export declare function getAllSpaceInfos(): SpaceInfo[];
8
+ export declare function getSpaceInfo(id: string): {
9
+ id: string;
10
+ name: string;
11
+ sort: number;
12
+ };
13
+ export declare function genSpaceOpts(): Blockly.MenuOption[];
14
+ export {};
@@ -0,0 +1,37 @@
1
+ import * as Blockly from 'blockly/core';
2
+ interface TableInfo {
3
+ id: string;
4
+ name: string;
5
+ columns: {
6
+ id: string;
7
+ name: string;
8
+ type: string;
9
+ extend: string;
10
+ }[];
11
+ indexes: {
12
+ id: string;
13
+ columns: string[];
14
+ unique: boolean;
15
+ }[];
16
+ sort: number;
17
+ }
18
+ export declare function getAllTableInfos(spaceid: string): TableInfo[];
19
+ export declare function getTableInfo(id: string): {
20
+ id: string;
21
+ spaceid: string;
22
+ name: string;
23
+ sort: number;
24
+ columns: {
25
+ id: string;
26
+ name: string;
27
+ type: string;
28
+ extend: string;
29
+ }[];
30
+ indexes: {
31
+ id: string;
32
+ columns: string[];
33
+ unique: boolean;
34
+ }[];
35
+ };
36
+ export declare function genTableOpts(spaceid: string): Blockly.MenuOption[];
37
+ export {};
package/dist/index.js CHANGED
@@ -1076,6 +1076,7 @@ function _n(e, t) {
1076
1076
  }
1077
1077
  const np = {
1078
1078
  apps: {},
1079
+ pages: {},
1079
1080
  type: "page",
1080
1081
  activePage: {
1081
1082
  type: "common",
@@ -1090,6 +1091,8 @@ const np = {
1090
1091
  }
1091
1092
  }, op = {
1092
1093
  spaces: {},
1094
+ funcs: {},
1095
+ flows: {},
1093
1096
  type: "func",
1094
1097
  activeFunc: {
1095
1098
  id: "",
@@ -1102,7 +1105,8 @@ const np = {
1102
1105
  name: ""
1103
1106
  }
1104
1107
  }, ip = {
1105
- spaces: {}
1108
+ spaces: {},
1109
+ tables: {}
1106
1110
  }, sp = {
1107
1111
  spaces: {}
1108
1112
  }, rp = {
@@ -1117,12 +1121,18 @@ const np = {
1117
1121
  }), window.blocklyState;
1118
1122
  }();
1119
1123
  function di() {
1120
- const { spaces: e } = Le.compute, t = [];
1121
- for (const n in e) {
1122
- const o = e[n];
1123
- t.push(o);
1124
+ const { spaces: e, funcs: t } = Le.compute, n = [];
1125
+ for (const o in e) {
1126
+ const i = e[o];
1127
+ let s = !1;
1128
+ for (const r in t)
1129
+ if (t[r].spaceid === o) {
1130
+ s = !0;
1131
+ break;
1132
+ }
1133
+ s && n.push(i);
1124
1134
  }
1125
- return t.sort((n, o) => n.sort - o.sort), t;
1135
+ return n.sort((o, i) => o.sort - i.sort), n;
1126
1136
  }
1127
1137
  function _r(e) {
1128
1138
  return Le.compute.spaces[e];
@@ -1134,19 +1144,15 @@ function pr() {
1134
1144
  }), ht(e);
1135
1145
  }
1136
1146
  function fi(e) {
1137
- const t = [], n = Le.compute.spaces[e];
1138
- if (!n)
1139
- return t;
1140
- for (const o in n.funcs) {
1141
- const i = n.funcs[o];
1142
- t.push(i);
1147
+ const { funcs: t } = Le.compute, n = [];
1148
+ for (const o in t) {
1149
+ const i = t[o];
1150
+ i.spaceid === e && n.push(i);
1143
1151
  }
1144
- return t.sort((o, i) => o.sort - i.sort), t;
1152
+ return n.sort((o, i) => o.sort - i.sort), n;
1145
1153
  }
1146
- function dr(e, t) {
1147
- const n = Le.compute.spaces[e];
1148
- if (n)
1149
- return n.funcs[t];
1154
+ function dr(e) {
1155
+ return Le.compute.funcs[e];
1150
1156
  }
1151
1157
  function fr(e) {
1152
1158
  const t = [];
@@ -1277,7 +1283,7 @@ const lp = {
1277
1283
  return;
1278
1284
  }
1279
1285
  e.name !== this.space.name && (this.space.name = e.name);
1280
- const t = dr(this.space.id, this.func.id);
1286
+ const t = dr(this.func.id);
1281
1287
  if (!t) {
1282
1288
  this.setWarningText(D.WARN_FUNC_NOT_AVAILABLE);
1283
1289
  return;
@@ -1421,7 +1427,7 @@ const cp = {
1421
1427
  return;
1422
1428
  }
1423
1429
  e.name !== this.space.name && (this.space.name = e.name);
1424
- const t = dr(this.space.id, this.func.id);
1430
+ const t = dr(this.func.id);
1425
1431
  if (!t) {
1426
1432
  this.setWarningText(D.WARN_FUNC_NOT_AVAILABLE);
1427
1433
  return;
@@ -1698,12 +1704,18 @@ c.forBlock.add_data_v1 = function(e) {
1698
1704
  `;
1699
1705
  };
1700
1706
  function jt() {
1701
- const e = [], { spaces: t } = Le.data;
1702
- for (const n in t) {
1703
- const o = t[n];
1704
- Object.keys(o.tables).length <= 0 || e.push(o);
1707
+ const e = [], { spaces: t, tables: n } = Le.data;
1708
+ for (const o in t) {
1709
+ const i = t[o];
1710
+ let s = !1;
1711
+ for (const r in n)
1712
+ if (n[r].spaceid === o) {
1713
+ s = !0;
1714
+ break;
1715
+ }
1716
+ s && e.push(i);
1705
1717
  }
1706
- return e.sort((n, o) => n.sort - o.sort), e;
1718
+ return e.sort((o, i) => o.sort - i.sort), e;
1707
1719
  }
1708
1720
  function ft(e) {
1709
1721
  return Le.data.spaces[e];
@@ -1715,19 +1727,15 @@ function lo() {
1715
1727
  }), ht(e);
1716
1728
  }
1717
1729
  function et(e) {
1718
- const t = [], n = Le.data.spaces[e];
1719
- if (!n)
1720
- return t;
1721
- for (const o in n.tables) {
1722
- const i = n.tables[o];
1723
- t.push(i);
1730
+ const { tables: t } = Le.data, n = [];
1731
+ for (const o in t) {
1732
+ const i = t[o];
1733
+ i.spaceid === e && n.push(i);
1724
1734
  }
1725
- return t.sort((o, i) => o.sort - i.sort), t;
1735
+ return n.sort((o, i) => o.sort - i.sort), n;
1726
1736
  }
1727
- function me(e, t) {
1728
- const n = Le.data.spaces[e];
1729
- if (n)
1730
- return n.tables[t];
1737
+ function me(e) {
1738
+ return Le.data.tables[e];
1731
1739
  }
1732
1740
  function co(e) {
1733
1741
  const t = [];
@@ -1809,7 +1817,7 @@ const dp = {
1809
1817
  return co(this.space.id);
1810
1818
  },
1811
1819
  genColumnOpts_: function() {
1812
- const e = [], t = me(this.space.id, this.table.id);
1820
+ const e = [], t = me(this.table.id);
1813
1821
  return t == null || t.columns.forEach((n) => {
1814
1822
  e.push([n.name, n.name]);
1815
1823
  }), ht(e);
@@ -1831,14 +1839,14 @@ const dp = {
1831
1839
  return;
1832
1840
  }
1833
1841
  let n = !1;
1834
- if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.space.id, this.table.id)) {
1842
+ if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.table.id)) {
1835
1843
  const s = (i = et(this.space.id)) == null ? void 0 : i[0];
1836
1844
  this.setFieldValue((s == null ? void 0 : s.name) ?? "", "COLUMN");
1837
1845
  }
1838
1846
  },
1839
1847
  onTableChange_: function(e) {
1840
1848
  var i;
1841
- const t = me(this.space.id, e);
1849
+ const t = me(e);
1842
1850
  if (!t) {
1843
1851
  console.assert(!1);
1844
1852
  return;
@@ -1847,7 +1855,7 @@ const dp = {
1847
1855
  t.id !== this.table.id && (n = !0), this.table.id = t.id, this.table.name = t.name, this.getField("COLUMN").getOptions(!1), n && this.setFieldValue(((i = t.columns) == null ? void 0 : i[0]) ?? "", "COLUMN");
1848
1856
  },
1849
1857
  onColumnChange_: function(e) {
1850
- const t = me(this.space.id, this.table.id);
1858
+ const t = me(this.table.id);
1851
1859
  if (!t) {
1852
1860
  console.assert(!1);
1853
1861
  return;
@@ -1866,7 +1874,7 @@ const dp = {
1866
1874
  return;
1867
1875
  }
1868
1876
  e.name !== this.space.name && (this.space.name = e.name);
1869
- const t = me(this.space.id, this.table.id);
1877
+ const t = me(this.table.id);
1870
1878
  if (!t) {
1871
1879
  this.setWarningText(D.WARN_TABLE_NOT_AVAILABLE);
1872
1880
  return;
@@ -2159,7 +2167,7 @@ const vp = {
2159
2167
  return co(this.space.id);
2160
2168
  },
2161
2169
  genColumnOpts_: function() {
2162
- const e = [], t = me(this.space.id, this.table.id);
2170
+ const e = [], t = me(this.table.id);
2163
2171
  return t == null || t.columns.forEach((n) => {
2164
2172
  e.push([n.name, n.name]);
2165
2173
  }), ht(e);
@@ -2192,13 +2200,13 @@ const vp = {
2192
2200
  return;
2193
2201
  }
2194
2202
  let n = !1;
2195
- if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.space.id, this.table.id)) {
2203
+ if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.table.id)) {
2196
2204
  const s = (i = et(this.space.id)) == null ? void 0 : i[0];
2197
2205
  s ? this.setFieldValue(s.id, "TABLE") : this.setFieldValue("", "TABLE");
2198
2206
  }
2199
2207
  },
2200
2208
  onTableChange_: function(e) {
2201
- const t = me(this.space.id, e);
2209
+ const t = me(e);
2202
2210
  if (!t) {
2203
2211
  console.assert(!1);
2204
2212
  return;
@@ -2273,7 +2281,7 @@ const vp = {
2273
2281
  return;
2274
2282
  }
2275
2283
  e.name !== this.space.name && (this.space.name = e.name);
2276
- const t = me(this.space.id, this.table.id);
2284
+ const t = me(this.table.id);
2277
2285
  if (!t) {
2278
2286
  this.setWarningText(D.WARN_TABLE_NOT_AVAILABLE);
2279
2287
  return;
@@ -2367,13 +2375,13 @@ const Ap = {
2367
2375
  return;
2368
2376
  }
2369
2377
  let n = !1;
2370
- if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.space.id, this.table.id)) {
2378
+ if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.table.id)) {
2371
2379
  const s = (i = et(this.space.id)) == null ? void 0 : i[0];
2372
2380
  s ? this.setFieldValue(s.id, "TABLE") : this.setFieldValue("", "TABLE");
2373
2381
  }
2374
2382
  },
2375
2383
  onTableChange_: function(e) {
2376
- const t = me(this.space.id, e);
2384
+ const t = me(e);
2377
2385
  if (!t) {
2378
2386
  console.assert(!1);
2379
2387
  return;
@@ -2387,7 +2395,7 @@ const Ap = {
2387
2395
  return;
2388
2396
  }
2389
2397
  e.name !== this.space.name && (this.space.name = e.name);
2390
- const t = me(this.space.id, this.table.id);
2398
+ const t = me(this.table.id);
2391
2399
  if (!t) {
2392
2400
  this.setWarningText(D.WARN_TABLE_NOT_AVAILABLE);
2393
2401
  return;
@@ -2466,7 +2474,7 @@ const Ip = {
2466
2474
  return co(this.space.id);
2467
2475
  },
2468
2476
  genColumnOpts_: function() {
2469
- const e = [], t = me(this.space.id, this.table.id);
2477
+ const e = [], t = me(this.table.id);
2470
2478
  return t == null || t.columns.forEach((n) => {
2471
2479
  e.push([n.name, n.name]);
2472
2480
  }), ht(e);
@@ -2490,13 +2498,13 @@ const Ip = {
2490
2498
  return;
2491
2499
  }
2492
2500
  let n = !1;
2493
- if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.space.id, this.table.id)) {
2501
+ if (t.id !== this.space.id && (n = !0), this.space.id = t.id, this.space.name = t.name, this.getField("TABLE").getOptions(!1), n || !me(this.table.id)) {
2494
2502
  const s = (i = et(this.space.id)) == null ? void 0 : i[0];
2495
2503
  this.setFieldValue((s == null ? void 0 : s.id) ?? "", "TABLE");
2496
2504
  }
2497
2505
  },
2498
2506
  onTableChange_: function(e) {
2499
- const t = me(this.space.id, e);
2507
+ const t = me(e);
2500
2508
  if (!t) {
2501
2509
  console.assert(!1);
2502
2510
  return;
@@ -2572,7 +2580,7 @@ const Ip = {
2572
2580
  },
2573
2581
  updateCheck_: function() {
2574
2582
  var t;
2575
- const e = me(this.space.id, this.table.id);
2583
+ const e = me(this.table.id);
2576
2584
  for (let n = 0; n < this.itemCount_; n++) {
2577
2585
  let o = null;
2578
2586
  const i = this.getFieldValue("COLUMN" + n), s = e == null ? void 0 : e.columns.find((r) => r.name === i);
@@ -2600,7 +2608,7 @@ const Ip = {
2600
2608
  return;
2601
2609
  }
2602
2610
  e.name !== this.space.name && (this.space.name = e.name);
2603
- const t = me(this.space.id, this.table.id);
2611
+ const t = me(this.table.id);
2604
2612
  if (!t) {
2605
2613
  this.setWarningText(D.WARN_TABLE_NOT_AVAILABLE);
2606
2614
  return;
@@ -5579,7 +5587,7 @@ function nd() {
5579
5587
  }
5580
5588
  } else {
5581
5589
  const t = document.createElement("button");
5582
- t.setAttribute("text", D.DESC_NO_TABLE_GUIDE), t.setAttribute("callbackKey", "NO_TABLE"), e.push(t);
5590
+ t.setAttribute("text", D.BUTTON_NO_TABLE), t.setAttribute("callbackKey", "NO_TABLE"), e.push(t);
5583
5591
  }
5584
5592
  return e;
5585
5593
  }
@@ -5765,7 +5773,7 @@ const Tr = (e, t, n) => {
5765
5773
  });
5766
5774
  };
5767
5775
  async function rs(e) {
5768
- const t = await Tr(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-dlwi84yy.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-60zrp0tu.js") }), `./msg/${e}.ts`, 3);
5776
+ const t = await Tr(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-b6f90zue.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-db5w8qqg.js") }), `./msg/${e}.ts`, 3);
5769
5777
  Ca(t.default);
5770
5778
  }
5771
5779
  function mr(e) {
@@ -11762,13 +11770,13 @@ async function Qh(e) {
11762
11770
  const eg = { install: Hh };
11763
11771
  export {
11764
11772
  Ff as XBlockly,
11773
+ np as app,
11765
11774
  Le as blocklyState,
11775
+ op as compute,
11776
+ ip as data,
11766
11777
  eg as default,
11767
- np as initApp,
11768
- op as initCompute,
11769
- ip as initData,
11770
- sp as initResource,
11771
- rp as initRuntime,
11772
11778
  Hh as install,
11773
- Qh as loadLocaleMessageBlock
11779
+ Qh as loadLocaleMessageBlock,
11780
+ sp as resource,
11781
+ rp as runtime
11774
11782
  };
@@ -34,6 +34,9 @@ const _ = {
34
34
  CROSS_TAB_COPY: "Copy",
35
35
  CROSS_TAB_PASTE: "Paste",
36
36
  NO_OPTION: "No Option",
37
+ // button
38
+ BUTTON_NO_COMPUTE: "Please go to the layer of 'Compute' to create interface",
39
+ BUTTON_NO_TABLE: "Please go to the layer of 'Data' to create table",
37
40
  // category
38
41
  CATEGORY_CALC: "calc",
39
42
  CATEGORY_COLOR: "color",
@@ -49,9 +52,6 @@ const _ = {
49
52
  CATEGORY_TEXT: "text",
50
53
  CATEGORY_TIME: "time",
51
54
  CATEGORY_VARIABLE: "var",
52
- // desc
53
- DESC_NO_COMPUTE_GUIDE: "Please go to the layer of 'Compute' to create interface",
54
- DESC_NO_TABLE_GUIDE: "Please go to the layer of 'Data' to create table",
55
55
  // label
56
56
  LABEL_BOOLEAN: "Boolean",
57
57
  LABEL_CONDITION: "Condition",
@@ -34,6 +34,9 @@ const _ = {
34
34
  CROSS_TAB_COPY: "拷贝",
35
35
  CROSS_TAB_PASTE: "黏贴",
36
36
  NO_OPTION: "没有选项",
37
+ // button
38
+ BUTTON_NO_COMPUTE: "请到「计算」层创建接口",
39
+ BUTTON_NO_TABLE: "请到「数据」层创建表",
37
40
  // category
38
41
  CATEGORY_CALC: "计算",
39
42
  CATEGORY_COLOR: "颜色",
@@ -49,9 +52,6 @@ const _ = {
49
52
  CATEGORY_TEXT: "文本",
50
53
  CATEGORY_TIMER: "时间",
51
54
  CATEGORY_VARIABLE: "变量",
52
- // desc
53
- DESC_NO_COMPUTE_GUIDE: "请到「计算」层创建接口",
54
- DESC_NO_MODEL_GUIDE: "请到「数据」层创建表",
55
55
  // label
56
56
  LABEL_BOOLEAN: "布尔",
57
57
  LABEL_CONDITION: "条件",
@@ -4,13 +4,14 @@ export type App = {
4
4
  id: string;
5
5
  name: string;
6
6
  sort: number;
7
- pages: {
8
- [pageid: string]: {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- };
13
- };
7
+ };
8
+ };
9
+ pages: {
10
+ [pageid: string]: {
11
+ id: string;
12
+ appid: string;
13
+ name: string;
14
+ sort: number;
14
15
  };
15
16
  };
16
17
  type: 'page' | 'comp';
@@ -44,4 +45,4 @@ export type App = {
44
45
  };
45
46
  };
46
47
  };
47
- export declare const initApp: App;
48
+ export declare const app: App;
@@ -4,32 +4,34 @@ export type Compute = {
4
4
  id: string;
5
5
  name: string;
6
6
  sort: number;
7
- funcs: {
8
- [funcid: string]: {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- dev: string;
13
- prod: string;
14
- inputs: {
15
- id: string;
16
- name: string;
17
- type: string;
18
- }[];
19
- outputs: {
20
- id: string;
21
- name: string;
22
- type: string;
23
- }[];
24
- };
25
- };
26
- flows: {
27
- [flowid: string]: {
28
- id: string;
29
- name: string;
30
- sort: number;
31
- };
32
- };
7
+ };
8
+ };
9
+ funcs: {
10
+ [funcid: string]: {
11
+ id: string;
12
+ spaceid: string;
13
+ name: string;
14
+ sort: number;
15
+ dev: string;
16
+ prod: string;
17
+ inputs: {
18
+ id: string;
19
+ name: string;
20
+ type: string;
21
+ }[];
22
+ outputs: {
23
+ id: string;
24
+ name: string;
25
+ type: string;
26
+ }[];
27
+ };
28
+ };
29
+ flows: {
30
+ [flowid: string]: {
31
+ id: string;
32
+ spaceid: string;
33
+ name: string;
34
+ sort: number;
33
35
  };
34
36
  };
35
37
  type: 'func' | 'flow';
@@ -52,4 +54,4 @@ export type Compute = {
52
54
  name: string;
53
55
  };
54
56
  };
55
- export declare const initCompute: Compute;
57
+ export declare const compute: Compute;
@@ -4,27 +4,26 @@ export type Data = {
4
4
  id: string;
5
5
  name: string;
6
6
  sort: number;
7
- tables: {
8
- [tableid: string]: {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- columns: {
13
- id: string;
14
- name: string;
15
- type: string;
16
- extend: string;
17
- }[];
18
- indexes: {
19
- id: string;
20
- columns: string[];
21
- unique: boolean;
22
- }[];
23
- };
24
- };
7
+ };
8
+ };
9
+ tables: {
10
+ [tableid: string]: {
11
+ id: string;
12
+ spaceid: string;
13
+ name: string;
14
+ sort: number;
15
+ columns: {
16
+ id: string;
17
+ name: string;
18
+ type: string;
19
+ extend: string;
20
+ }[];
21
+ indexes: {
22
+ id: string;
23
+ columns: string[];
24
+ unique: boolean;
25
+ }[];
25
26
  };
26
27
  };
27
28
  };
28
- export declare const initData: {
29
- spaces: {};
30
- };
29
+ export declare const data: Data;
@@ -18,6 +18,6 @@ export type Resource = {
18
18
  };
19
19
  };
20
20
  };
21
- export declare const initResource: {
21
+ export declare const resource: {
22
22
  spaces: {};
23
23
  };
@@ -9,6 +9,6 @@ export type Runtime = {
9
9
  };
10
10
  };
11
11
  };
12
- export declare const initRuntime: {
12
+ export declare const runtime: {
13
13
  props: {};
14
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.4.40",
4
+ "version": "0.4.41",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,66 +0,0 @@
1
- import * as Blockly from 'blockly/core';
2
- interface SpaceInfo {
3
- id: string;
4
- name: string;
5
- sort: number;
6
- }
7
- export declare function getAllSpaceInfos(): SpaceInfo[];
8
- export declare function getSpaceInfo(id: string): {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- tables: {
13
- [tableid: string]: {
14
- id: string;
15
- name: string;
16
- sort: number;
17
- columns: {
18
- id: string;
19
- name: string;
20
- type: string;
21
- extend: string;
22
- }[];
23
- indexes: {
24
- id: string;
25
- columns: string[];
26
- unique: boolean;
27
- }[];
28
- };
29
- };
30
- };
31
- export declare function genSpaceOpts(): Blockly.MenuOption[];
32
- interface TableInfo {
33
- id: string;
34
- name: string;
35
- columns: {
36
- id: string;
37
- name: string;
38
- type: string;
39
- extend: string;
40
- }[];
41
- indexes: {
42
- id: string;
43
- columns: string[];
44
- unique: boolean;
45
- }[];
46
- sort: number;
47
- }
48
- export declare function getAllTableInfos(spaceid: string): TableInfo[];
49
- export declare function getTableInfo(spaceid: string, id: string): {
50
- id: string;
51
- name: string;
52
- sort: number;
53
- columns: {
54
- id: string;
55
- name: string;
56
- type: string;
57
- extend: string;
58
- }[];
59
- indexes: {
60
- id: string;
61
- columns: string[];
62
- unique: boolean;
63
- }[];
64
- } | undefined;
65
- export declare function genTableOpts(spaceid: string): Blockly.MenuOption[];
66
- export {};