x-block-lib 0.4.43 → 0.4.44

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.
@@ -1,21 +1,7 @@
1
1
  import * as Blockly from 'blockly/core';
2
- interface FuncInfo {
3
- id: string;
4
- name: string;
5
- inputs: {
6
- id: string;
7
- name: string;
8
- type: string;
9
- }[];
10
- outputs: {
11
- id: string;
12
- name: string;
13
- type: string;
14
- }[];
15
- sort: number;
16
- }
17
- export declare function getAllFuncInfos(spaceid: string): FuncInfo[];
18
- export declare function getFuncInfo(id: string): import("../../../state").Func;
2
+ import { Func } from '../../../state';
3
+ export declare function getAllFuncInfos(spaceid: string): Func[];
4
+ export declare function getFuncInfo(id: string): Func;
19
5
  export declare function genFuncOpts(spaceid: string): Blockly.MenuOption[];
20
6
  export declare function getActiveFunc(): import("../../../state").ActiveFunc;
21
7
  export declare function getActiveFuncOutputInfo(id: string): {
@@ -24,4 +10,3 @@ export declare function getActiveFuncOutputInfo(id: string): {
24
10
  type: string;
25
11
  } | undefined;
26
12
  export declare function genActiveFuncOutputOpts(): Blockly.MenuOption[];
27
- export {};
@@ -1,10 +1,5 @@
1
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): import("../../../state").ComputeSpace;
2
+ import { ComputeSpace } from '../../../state';
3
+ export declare function getAllSpaceInfos(): ComputeSpace[];
4
+ export declare function getSpaceInfo(id: string): ComputeSpace;
9
5
  export declare function genSpaceOpts(): Blockly.MenuOption[];
10
- export {};
@@ -1,10 +1,5 @@
1
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): import("../../../state").DataSpace;
2
+ import { DataSpace } from '../../../state';
3
+ export declare function getAllSpaceInfos(): DataSpace[];
4
+ export declare function getSpaceInfo(id: string): DataSpace;
9
5
  export declare function genSpaceOpts(): Blockly.MenuOption[];
10
- export {};
@@ -1,21 +1,5 @@
1
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): import("../../../state").Table;
2
+ import { Table } from '../../../state';
3
+ export declare function getAllTableInfos(spaceid: string): Table[];
4
+ export declare function getTableInfo(id: string): Table;
20
5
  export declare function genTableOpts(spaceid: string): Blockly.MenuOption[];
21
- export {};
@@ -0,0 +1,12 @@
1
+ import * as Blockly from 'blockly/core';
2
+ interface DirInfo {
3
+ id: string;
4
+ name: string;
5
+ }
6
+ export declare function getAllDirInfos(spaceid: string): DirInfo[];
7
+ export declare function getDirInfo(spaceid: string, id: string): {
8
+ id: string;
9
+ name: string;
10
+ } | undefined;
11
+ export declare function genDirOpts(spaceid: string): Blockly.MenuOption[];
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import * as Blockly from 'blockly/core';
2
+ import { ResourceEntry } from '../../../state';
3
+ export declare function getAllResourceInfos(spaceid: string, dirid: string): ResourceEntry[];
4
+ export declare function getResourceInfo(spaceid: string, id: string): ResourceEntry | undefined;
5
+ export declare function genResourceOpts(spaceid: string, dirid: string): Blockly.MenuOption[];
@@ -0,0 +1,5 @@
1
+ import * as Blockly from 'blockly/core';
2
+ import { ResourceSpace } from '../../../state';
3
+ export declare function getAllSpaceInfos(): ResourceSpace[];
4
+ export declare function getSpaceInfo(id: string): ResourceSpace;
5
+ export declare function genSpaceOpts(): Blockly.MenuOption[];
package/dist/index.js CHANGED
@@ -250,6 +250,10 @@ function Ct(e, t) {
250
250
  }
251
251
  }
252
252
  const Wa = A.xml, za = [
253
+ {
254
+ type: "add_data_v1",
255
+ inputs: ["SUCCESS", "MESSAGE", "DATA"]
256
+ },
253
257
  {
254
258
  type: "call_func_v1",
255
259
  prefixInputs: ["OUTPUT"]
@@ -259,21 +263,9 @@ const Wa = A.xml, za = [
259
263
  prefixInputs: ["OUTPUT"]
260
264
  },
261
265
  {
262
- type: "data_add_v1",
263
- inputs: ["SUCCESS", "MESSAGE", "DATA"]
264
- },
265
- {
266
- type: "data_delete_v1",
266
+ type: "delete_data_v1",
267
267
  inputs: ["SUCCESS", "MESSAGE"]
268
268
  },
269
- {
270
- type: "data_query_v1",
271
- inputs: ["SUCCESS", "MESSAGE", "MAINDATA", "EXTRADATA"]
272
- },
273
- {
274
- type: "data_update_v1",
275
- inputs: ["SUCCESS", "MESSAGE", "DATA"]
276
- },
277
269
  {
278
270
  type: "func_entry_v1",
279
271
  prefixInputs: ["INPUT"]
@@ -281,6 +273,14 @@ const Wa = A.xml, za = [
281
273
  {
282
274
  type: "procedure_def_v1",
283
275
  prefixInputs: ["ARG"]
276
+ },
277
+ {
278
+ type: "query_data_v1",
279
+ inputs: ["SUCCESS", "MESSAGE", "MAINDATA", "EXTRADATA"]
280
+ },
281
+ {
282
+ type: "update_data_v1",
283
+ inputs: ["SUCCESS", "MESSAGE", "DATA"]
284
284
  }
285
285
  ];
286
286
  function Ja(e, t) {
@@ -2320,7 +2320,7 @@ c.forBlock.select_column_v1 = function(e) {
2320
2320
  s.push(`{ name: ${_}, alias: ${d} }`);
2321
2321
  }
2322
2322
  const r = JSON.stringify(s);
2323
- return [`{ spaceid: ${t(o)}, tableid: ${t(i)}, columns: ${r} }`, u.ATOMIC];
2323
+ return [`{spaceid:${t(o)},tableid:${t(i)},columns:${r}}`, u.ATOMIC];
2324
2324
  };
2325
2325
  const Ap = {
2326
2326
  init: function() {
@@ -2647,7 +2647,7 @@ c.forBlock.update_column_v1 = function(e) {
2647
2647
  s.push({ name: _, value: d });
2648
2648
  }
2649
2649
  const r = JSON.stringify(s);
2650
- return [`{ spaceid: ${t(o)}, tableid: ${t(i)}, columns: ${r} }`, u.ATOMIC];
2650
+ return [`{spaceid:${t(o)},tableid:${t(i)},columns:${r}}`, u.ATOMIC];
2651
2651
  };
2652
2652
  const Cp = {
2653
2653
  init: function() {
@@ -1,21 +1,24 @@
1
- export interface DirNode {
1
+ export interface DirEntry {
2
2
  id: string;
3
3
  name: string;
4
- children: DirNode[];
4
+ children: DirEntry[];
5
5
  }
6
+ export interface ResourceEntry {
7
+ id: string;
8
+ dirid: string;
9
+ name: string;
10
+ sort: number;
11
+ }
12
+ export type ResourceSpace = {
13
+ id: string;
14
+ name: string;
15
+ sort: number;
16
+ dirTree: DirEntry;
17
+ resources: ResourceEntry[];
18
+ };
6
19
  export type Resource = {
7
20
  spaces: {
8
- [spaceid: string]: {
9
- id: string;
10
- name: string;
11
- sort: number;
12
- dirTree: DirNode;
13
- resources: {
14
- id: string;
15
- dirid: string;
16
- name: string;
17
- }[];
18
- };
21
+ [spaceid: string]: ResourceSpace;
19
22
  };
20
23
  };
21
24
  export declare function initResource(): Resource;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.4.43",
4
+ "version": "0.4.44",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,24 +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): SpaceInfo | undefined;
9
- export declare function genSpaceOpts(): Blockly.MenuOption[];
10
- interface DirInfo {
11
- id: string;
12
- name: string;
13
- }
14
- export declare function getAllDirInfos(spaceid: string): DirInfo[];
15
- export declare function getDirInfo(spaceid: string, id: string): DirInfo | undefined;
16
- export declare function genDirOpts(spaceid: string): Blockly.MenuOption[];
17
- interface ResourceInfo {
18
- id: string;
19
- name: string;
20
- }
21
- export declare function getAllResourceInfos(spaceid: string, dirid: string): ResourceInfo[];
22
- export declare function getResourceInfo(spaceid: string, id: string): ResourceInfo | null;
23
- export declare function genResourceOpts(spaceid: string, dirid: string): Blockly.MenuOption[];
24
- export {};