x-block-lib 0.9.6 → 0.9.8

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.
@@ -9,7 +9,7 @@ export declare function getAllArgumentInfos(): ArgumentInfo[];
9
9
  export declare function getArgumentInfo(id: string): {
10
10
  key: string;
11
11
  name: string;
12
- type: "string" | "number" | "boolean" | "object" | "array";
12
+ type: "string" | "number" | "boolean" | "object" | "array" | "any";
13
13
  } | undefined;
14
14
  export declare function genArgumentOpts(): Blockly.MenuOption[];
15
15
  export {};
@@ -1,10 +1,16 @@
1
1
  import * as Blockly from 'blockly/core';
2
- import { EventKind, ZField } from 'x-runtime-lib';
2
+ import { Type } from 'x-essential-lib';
3
+ import { EventKind } from 'x-runtime-lib';
4
+ interface Param {
5
+ key: string;
6
+ name: string;
7
+ type: Type;
8
+ }
3
9
  interface EventInfo {
4
10
  id: string;
5
11
  kind: EventKind;
6
12
  names: string[];
7
- params?: ZField[];
13
+ params?: Param[];
8
14
  }
9
15
  export declare function getAllOnEventInfos(nodeId: string): EventInfo[];
10
16
  export declare function getOnEventInfo(id: string): EventInfo | undefined;
@@ -1,11 +1,17 @@
1
1
  import * as Blockly from 'blockly/core';
2
- import { MethodKind, ZField } from 'x-runtime-lib';
2
+ import { Type } from 'x-essential-lib';
3
+ import { MethodKind } from 'x-runtime-lib';
4
+ interface Field {
5
+ key: string;
6
+ name: string;
7
+ type: Type;
8
+ }
3
9
  interface MethodInfo {
4
10
  id: string;
5
11
  kind: MethodKind;
6
12
  names: string[];
7
- inputs?: ZField[];
8
- outputs?: ZField[];
13
+ inputs?: Field[];
14
+ outputs?: Field[];
9
15
  }
10
16
  export declare function getAllCallMethodInfos(nodeId: string): MethodInfo[];
11
17
  export declare function getCallMethodInfo(id: string): MethodInfo | undefined;
@@ -13,7 +19,7 @@ export declare function genCallMethodOpts(nodeId: string): Blockly.MenuOption[];
13
19
  export declare function getAllImplementMethodInfos(nodeId: string): MethodInfo[];
14
20
  export declare function getImplementMethodInfo(id: string): MethodInfo | undefined;
15
21
  export declare function genImplementMethodOpts(nodeId: string): Blockly.MenuOption[];
16
- export declare function getAllImplementMethodOutputInfos(methodId: string): ZField[] | undefined;
17
- export declare function getImplementMethodOutputInfo(methodId: string, outputKey: string): ZField | undefined;
22
+ export declare function getAllImplementMethodOutputInfos(methodId: string): Field[] | undefined;
23
+ export declare function getImplementMethodOutputInfo(methodId: string, outputKey: string): Field | undefined;
18
24
  export declare function genImplementMethodOutputOpts(methodKey: string): Blockly.MenuOption[];
19
25
  export {};
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ function cn(t, e) {
89
89
  return e === "string" ? n = je("") : e === "integer" || e === "decimal" ? n = Rn(0) : e === "boolean" ? n = ks() : e === "enum" || e === "dateTime" ? n = je("") : console.assert(!1), n ? Hn.domToBlock(n, t) : null;
90
90
  }
91
91
  function St(t) {
92
- return t === "string" ? "String" : t === "number" ? "Number" : t === "boolean" ? "Boolean" : t === "array" ? "Array" : t === "object" ? "Object" : (console.assert(!1), null);
92
+ return t === "string" ? "String" : t === "number" ? "Number" : t === "boolean" ? "Boolean" : t === "array" ? "Array" : t === "object" ? "Object" : (t === "any" || console.assert(!1), null);
93
93
  }
94
94
  function Ns(t) {
95
95
  return t.array ? "Array" : t.ui === "dummy" ? null : t.ui === "strInput" ? "String" : t.ui === "numInput" ? "Number" : t.ui === "switch" ? "Boolean" : t.ui === "select" ? me(t.items) : t.ui === "multiTypes" ? me(t.types) : t.ui === "selectComp" ? "Comp" : t.ui === "selectSlot" ? "Slot" : t.ui === "selectAdaptSlot" ? "AdaptSlot" : t.ui === "colorPicker" ? "Color" : (console.assert(!1), null);
@@ -167,7 +167,7 @@ function Rs(t) {
167
167
  }
168
168
  function rt(t) {
169
169
  let e = null;
170
- return t === "string" ? e = yt("") : t === "number" ? e = Te(0) : t === "boolean" ? e = Ee(!1) : t === "array" ? e = uo() : t === "object" ? e = Ss() : console.assert(!1), e;
170
+ return t === "string" ? e = yt("") : t === "number" ? e = Te(0) : t === "boolean" ? e = Ee(!1) : t === "array" ? e = uo() : t === "object" ? e = Ss() : t === "any" ? e = null : console.assert(!1), e;
171
171
  }
172
172
  function Ds(t) {
173
173
  let e = null;
@@ -1960,7 +1960,7 @@ function te(t, e) {
1960
1960
  const m = f.slots.find((T) => T.key === d);
1961
1961
  if (m && m.properties)
1962
1962
  for (const T of m.properties)
1963
- c.push({
1963
+ e === "write" && T.readonly || c.push({
1964
1964
  id: Tt(
1965
1965
  "adaptSlotElementProperty",
1966
1966
  t,
@@ -10299,7 +10299,7 @@ ce.getText_ = function() {
10299
10299
  return eo(n, o);
10300
10300
  } else if (this.name === "EVENT") {
10301
10301
  const { kind: n, names: o } = e.event;
10302
- return console.log(e.event), be(n, o);
10302
+ return be(n, o);
10303
10303
  } else if (this.name === "METHOD") {
10304
10304
  const { kind: n, names: o } = e.method;
10305
10305
  return Pe(n, o);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.9.6",
4
+ "version": "0.9.8",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -37,8 +37,8 @@
37
37
  "vue-i18n": "^11.2.8",
38
38
  "vue-router": "^4.6.4",
39
39
  "vuetify": "^3.11.6",
40
- "x-essential-lib": "^0.9.20",
41
- "x-runtime-lib": "^0.8.166",
40
+ "x-essential-lib": "^0.9.21",
41
+ "x-runtime-lib": "^0.8.169",
42
42
  "x-state-lib": "^0.3.34"
43
43
  },
44
44
  "devDependencies": {