x-block-lib 0.4.41 → 0.4.43

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.
@@ -15,39 +15,9 @@ interface FuncInfo {
15
15
  sort: number;
16
16
  }
17
17
  export declare function getAllFuncInfos(spaceid: string): FuncInfo[];
18
- export declare function getFuncInfo(id: string): {
19
- id: string;
20
- spaceid: string;
21
- name: string;
22
- sort: number;
23
- dev: string;
24
- prod: string;
25
- inputs: {
26
- id: string;
27
- name: string;
28
- type: string;
29
- }[];
30
- outputs: {
31
- id: string;
32
- name: string;
33
- type: string;
34
- }[];
35
- };
18
+ export declare function getFuncInfo(id: string): import("../../../state").Func;
36
19
  export declare function genFuncOpts(spaceid: string): Blockly.MenuOption[];
37
- export declare function getActiveFunc(): {
38
- id: string;
39
- name: string;
40
- inputs: {
41
- id: string;
42
- name: string;
43
- type: string;
44
- }[];
45
- outputs: {
46
- id: string;
47
- name: string;
48
- type: string;
49
- }[];
50
- };
20
+ export declare function getActiveFunc(): import("../../../state").ActiveFunc;
51
21
  export declare function getActiveFuncOutputInfo(id: string): {
52
22
  id: string;
53
23
  name: string;
@@ -5,10 +5,6 @@ interface SpaceInfo {
5
5
  sort: number;
6
6
  }
7
7
  export declare function getAllSpaceInfos(): SpaceInfo[];
8
- export declare function getSpaceInfo(id: string): {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- };
8
+ export declare function getSpaceInfo(id: string): import("../../../state").ComputeSpace;
13
9
  export declare function genSpaceOpts(): Blockly.MenuOption[];
14
10
  export {};
@@ -5,10 +5,6 @@ interface SpaceInfo {
5
5
  sort: number;
6
6
  }
7
7
  export declare function getAllSpaceInfos(): SpaceInfo[];
8
- export declare function getSpaceInfo(id: string): {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- };
8
+ export declare function getSpaceInfo(id: string): import("../../../state").DataSpace;
13
9
  export declare function genSpaceOpts(): Blockly.MenuOption[];
14
10
  export {};
@@ -16,22 +16,6 @@ interface TableInfo {
16
16
  sort: number;
17
17
  }
18
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
- };
19
+ export declare function getTableInfo(id: string): import("../../../state").Table;
36
20
  export declare function genTableOpts(spaceid: string): Blockly.MenuOption[];
37
21
  export {};
package/dist/index.js CHANGED
@@ -1074,50 +1074,65 @@ function ur(e, t, n, o, i) {
1074
1074
  function _n(e, t) {
1075
1075
  return ur(e, t);
1076
1076
  }
1077
- const np = {
1078
- apps: {},
1079
- pages: {},
1080
- type: "page",
1081
- activePage: {
1082
- type: "common",
1083
- version: "",
1084
- nodes: {}
1085
- },
1086
- activeComp: {
1087
- type: "common",
1088
- version: "",
1089
- args: [],
1090
- nodes: {}
1091
- }
1092
- }, op = {
1093
- spaces: {},
1094
- funcs: {},
1095
- flows: {},
1096
- type: "func",
1097
- activeFunc: {
1098
- id: "",
1099
- name: "",
1100
- inputs: [],
1101
- outputs: []
1102
- },
1103
- activeFlow: {
1104
- id: "",
1105
- name: ""
1106
- }
1107
- }, ip = {
1108
- spaces: {},
1109
- tables: {}
1110
- }, sp = {
1111
- spaces: {}
1112
- }, rp = {
1113
- props: {}
1114
- }, Le = function() {
1077
+ function np() {
1078
+ return {
1079
+ apps: {},
1080
+ pages: {},
1081
+ type: "page",
1082
+ activePage: {
1083
+ type: "common",
1084
+ version: "",
1085
+ nodes: {}
1086
+ },
1087
+ activeComp: {
1088
+ type: "common",
1089
+ version: "",
1090
+ args: [],
1091
+ nodes: {}
1092
+ }
1093
+ };
1094
+ }
1095
+ function op() {
1096
+ return {
1097
+ spaces: {},
1098
+ funcs: {},
1099
+ flows: {},
1100
+ type: "func",
1101
+ activeFunc: {
1102
+ id: "",
1103
+ name: "",
1104
+ inputs: [],
1105
+ outputs: []
1106
+ },
1107
+ activeFlow: {
1108
+ id: "",
1109
+ name: ""
1110
+ }
1111
+ };
1112
+ }
1113
+ function ip() {
1114
+ return {
1115
+ spaces: {},
1116
+ tables: {}
1117
+ };
1118
+ }
1119
+ function sp() {
1120
+ return {
1121
+ spaces: {}
1122
+ };
1123
+ }
1124
+ function rp() {
1125
+ return {
1126
+ props: {}
1127
+ };
1128
+ }
1129
+ const Le = function() {
1115
1130
  return window.blocklyState || (window.blocklyState = {
1116
- runtime: rp,
1117
- app: np,
1118
- compute: op,
1119
- data: ip,
1120
- resource: sp
1131
+ runtime: rp(),
1132
+ app: np(),
1133
+ compute: op(),
1134
+ data: ip(),
1135
+ resource: sp()
1121
1136
  }), window.blocklyState;
1122
1137
  }();
1123
1138
  function di() {
@@ -11770,13 +11785,13 @@ async function Qh(e) {
11770
11785
  const eg = { install: Hh };
11771
11786
  export {
11772
11787
  Ff as XBlockly,
11773
- np as app,
11774
11788
  Le as blocklyState,
11775
- op as compute,
11776
- ip as data,
11777
11789
  eg as default,
11790
+ np as initApp,
11791
+ op as initCompute,
11792
+ ip as initData,
11793
+ sp as initResource,
11794
+ rp as initRuntime,
11778
11795
  Hh as install,
11779
- Qh as loadLocaleMessageBlock,
11780
- sp as resource,
11781
- rp as runtime
11796
+ Qh as loadLocaleMessageBlock
11782
11797
  };
@@ -45,4 +45,4 @@ export type App = {
45
45
  };
46
46
  };
47
47
  };
48
- export declare const app: App;
48
+ export declare function initApp(): App;
@@ -1,57 +1,64 @@
1
+ export type ComputeSpace = {
2
+ id: string;
3
+ name: string;
4
+ sort: number;
5
+ };
6
+ export type Func = {
7
+ id: string;
8
+ spaceid: string;
9
+ name: string;
10
+ sort: number;
11
+ dev: string;
12
+ prod: string;
13
+ inputs: {
14
+ id: string;
15
+ name: string;
16
+ type: string;
17
+ }[];
18
+ outputs: {
19
+ id: string;
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ };
24
+ export type Flow = {
25
+ id: string;
26
+ spaceid: string;
27
+ name: string;
28
+ sort: number;
29
+ dev: string;
30
+ prod: string;
31
+ };
32
+ export type ActiveFunc = {
33
+ id: string;
34
+ name: string;
35
+ inputs: {
36
+ id: string;
37
+ name: string;
38
+ type: string;
39
+ }[];
40
+ outputs: {
41
+ id: string;
42
+ name: string;
43
+ type: string;
44
+ }[];
45
+ };
46
+ export type ActiveFlow = {
47
+ id: string;
48
+ name: string;
49
+ };
1
50
  export type Compute = {
2
51
  spaces: {
3
- [spaceid: string]: {
4
- id: string;
5
- name: string;
6
- sort: number;
7
- };
52
+ [spaceid: string]: ComputeSpace;
8
53
  };
9
54
  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
- };
55
+ [funcid: string]: Func;
28
56
  };
29
57
  flows: {
30
- [flowid: string]: {
31
- id: string;
32
- spaceid: string;
33
- name: string;
34
- sort: number;
35
- };
58
+ [flowid: string]: Flow;
36
59
  };
37
60
  type: 'func' | 'flow';
38
- activeFunc: {
39
- id: string;
40
- name: string;
41
- inputs: {
42
- id: string;
43
- name: string;
44
- type: string;
45
- }[];
46
- outputs: {
47
- id: string;
48
- name: string;
49
- type: string;
50
- }[];
51
- };
52
- activeFlow: {
53
- id: string;
54
- name: string;
55
- };
61
+ activeFunc: ActiveFunc;
62
+ activeFlow: ActiveFlow;
56
63
  };
57
- export declare const compute: Compute;
64
+ export declare function initCompute(): Compute;
@@ -1,29 +1,31 @@
1
+ export type DataSpace = {
2
+ id: string;
3
+ name: string;
4
+ sort: number;
5
+ };
6
+ export type Table = {
7
+ id: string;
8
+ spaceid: string;
9
+ name: string;
10
+ sort: number;
11
+ columns: {
12
+ id: string;
13
+ name: string;
14
+ type: string;
15
+ extend: string;
16
+ }[];
17
+ indexes: {
18
+ id: string;
19
+ columns: string[];
20
+ unique: boolean;
21
+ }[];
22
+ };
1
23
  export type Data = {
2
24
  spaces: {
3
- [spaceid: string]: {
4
- id: string;
5
- name: string;
6
- sort: number;
7
- };
25
+ [spaceid: string]: DataSpace;
8
26
  };
9
27
  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
- }[];
26
- };
28
+ [tableid: string]: Table;
27
29
  };
28
30
  };
29
- export declare const data: Data;
31
+ export declare function initData(): Data;
@@ -18,6 +18,4 @@ export type Resource = {
18
18
  };
19
19
  };
20
20
  };
21
- export declare const resource: {
22
- spaces: {};
23
- };
21
+ export declare function initResource(): Resource;
@@ -9,6 +9,4 @@ export type Runtime = {
9
9
  };
10
10
  };
11
11
  };
12
- export declare const runtime: {
13
- props: {};
14
- };
12
+ export declare function initRuntime(): Runtime;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.4.41",
4
+ "version": "0.4.43",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",