x-runtime-lib 0.8.198 → 0.8.199

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,2 +1,2 @@
1
- import { NodePair } from "@/types";
1
+ import { NodePair } from '@/types';
2
2
  export declare function spawn(type: string, subtype: string): NodePair | undefined;
package/dist/index.js CHANGED
@@ -1500,7 +1500,7 @@ function useElementSlotProperty(e, p, m, g) {
1500
1500
  }), onUnmounted(() => {
1501
1501
  e.eventBus.off(`property/${m}/get`, _), e.eventBus.off(`property/${m}/set`, v);
1502
1502
  }), watch(g, (g, _) => {
1503
- e.hooks.onPropertyChange(makePropertyId("elementAdaptSlotProperty", "globality", makePropertyKeyOfElementSlot(p.value.basic.key, e.slotId, m)), g, _, e.instance), e.parent && e.parent.hooks.onPropertyChange(makePropertyId("elementSlotProperty", e.nodeId, makePropertyKeyOfElementSlot(p.value.basic.key, e.slotId, m)), g, _, e.instance);
1503
+ e.hooks.onPropertyChange(makePropertyId("elementAdaptSlotProperty", "globality", makePropertyKeyOfElementSlot(p.value.basic.key, e.slotId, m)), g, _, e.instance);
1504
1504
  }, { immediate: !0 });
1505
1505
  }
1506
1506
  function useElementSlotRender(e, p, m) {
@@ -10776,8 +10776,6 @@ var PromiseManager = class {
10776
10776
  let { kind: m, nodeId: g, propertyKey: _ } = unwrapPropertyId(e), v = this.getNode(g);
10777
10777
  if (!v) throw Error("node not found");
10778
10778
  if (m === "elementProperty") return await this.getElementProperty(e, v, _);
10779
- if (m === "elementSlotProperty") return await this.getElementSlotProperty(e, g, _);
10780
- if (m === "multipleElementSlotProperty") return await this.getMultipleElementSlotProperty(e, g, _, p);
10781
10779
  if (m === "refProperty") return await this.getRefProperty(e, g, _);
10782
10780
  if (m === "multipleRefProperty") return await this.getMultipleRefProperty(e, g, _, p);
10783
10781
  if (m === "customSlotProperty") return await this.getCustomSlotProperty(e, g, _);
@@ -10791,21 +10789,6 @@ var PromiseManager = class {
10791
10789
  if (!this.isValidOfElementProperty(p.basic.key, m)) throw console.warn(`Sandbox/getElementProperty invalid element property id=${e}`), Error("invalid element property");
10792
10790
  return getField(p, m);
10793
10791
  }
10794
- async getElementSlotProperty(e, p, m) {
10795
- let { elementKey: g, slotKey: _, propertyKey: v } = unwrapPropertyKeyOfElementSlot(m), y = this.children[`${p}/${_}`];
10796
- if (!y) throw Error("sandbox not found");
10797
- if (!y.isValidOfElementSlotProperty(g, _, v)) throw console.warn(`Sandbox/getElementSlotProperty invalid element slot property id=${e}`), Error("invalid element slot property");
10798
- let b = { value: void 0 };
10799
- return y.eventBus.emit(`property/${v}/get`, { result: b }), b.value;
10800
- }
10801
- async getMultipleElementSlotProperty(e, p, m, g) {
10802
- if (!g) throw Error("instance not available");
10803
- let { elementKey: _, slotKey: v, propertyKey: y } = unwrapPropertyKeyOfElementSlot(m), b = this.children[`${p}/${v}/${g}`];
10804
- if (!b) throw Error("sandbox not found");
10805
- if (!b.isValidOfElementSlotProperty(_, v, y)) throw console.warn(`Sandbox/getMultipleElementSlotProperty invalid element slot property id=${e}`), Error("invalid element slot property");
10806
- let x = { value: void 0 };
10807
- return b.eventBus.emit(`property/${y}/get`, { result: x }), x.value;
10808
- }
10809
10792
  async getRefProperty(e, p, m) {
10810
10793
  let g = this.children[p];
10811
10794
  if (!g) throw Error("sandbox not found");
@@ -10853,8 +10836,6 @@ var PromiseManager = class {
10853
10836
  let { kind: g, nodeId: v, propertyKey: y } = unwrapPropertyId(e), b = this.getNode(v);
10854
10837
  if (!b) throw Error("node not found");
10855
10838
  if (p = cloneDeep_default(p), g === "elementProperty") await this.setElementProperty(e, p, y, b);
10856
- else if (g === "elementSlotProperty") await this.setElementSlotProperty(e, p, v, y);
10857
- else if (g === "multipleElementSlotProperty") await this.setMultipleElementSlotProperty(e, p, v, y, m);
10858
10839
  else if (g === "refProperty") await this.setRefProperty(e, p, v, y);
10859
10840
  else if (g === "multipleRefProperty") await this.setMultipleRefProperty(e, p, v, y, m);
10860
10841
  else if (g === "customSlotProperty") await this.setCustomSlotProperty(e, p, v, y);
@@ -10870,25 +10851,6 @@ var PromiseManager = class {
10870
10851
  let v = getField(_, m);
10871
10852
  isEqual_default(p, v) || (setField(_, m, p), this.hooks.onPropertyChange(e, p, v));
10872
10853
  }
10873
- async setElementSlotProperty(e, p, m, _) {
10874
- let { elementKey: v, slotKey: y, propertyKey: b } = unwrapPropertyKeyOfElementSlot(_), x = this.children[`${m}/${y}`];
10875
- if (!x) throw Error("sandbox not found");
10876
- if (!x.isValidOfElementSlotProperty(v, y, b)) throw console.warn(`Sandbox/setElementSlotProperty invalid element slot property id=${e}`), Error("invalid element slot property");
10877
- let S = { value: void 0 };
10878
- x.eventBus.emit(`property/${b}/get`, { result: S });
10879
- let C = S.value;
10880
- isEqual_default(p, C) || x.eventBus.emit(`property/${b}/set`, p);
10881
- }
10882
- async setMultipleElementSlotProperty(e, p, m, _, v) {
10883
- if (!v) throw Error("instance not available");
10884
- let { elementKey: y, slotKey: b, propertyKey: x } = unwrapPropertyKeyOfElementSlot(_), S = this.children[`${m}/${b}/${v}`];
10885
- if (!S) throw Error("sandbox not found");
10886
- if (!S.isValidOfElementSlotProperty(y, b, x)) throw console.warn(`Sandbox/setMultipleElementSlotProperty invalid element slot property id=${e}`), Error("invalid element slot property");
10887
- let C = { value: void 0 };
10888
- S.eventBus.emit(`property/${x}/get`, { result: C });
10889
- let w = C.value;
10890
- isEqual_default(p, w) || S.eventBus.emit(`property/${x}/set`, p);
10891
- }
10892
10854
  async setRefProperty(e, p, m, _) {
10893
10855
  let v = this.children[m];
10894
10856
  if (!v) throw Error("sandbox not found");
@@ -10962,14 +10924,12 @@ var PromiseManager = class {
10962
10924
  this.debugTrace(makeFuncInfo("callMethod", e, p, m));
10963
10925
  let { kind: g, nodeId: _, methodKey: v } = unwrapMethodId(e), y = this.getNode(_);
10964
10926
  if (!y) throw Error("node not found");
10965
- if (g === "elementMethod") await this.callElementMethod(e, m, y.basic.key, v);
10966
- else if (g === "elementSlotMethod") await this.callElementSlotMethod(e, m, _, v);
10967
- else if (g === "multipeElementSlotMethod") await this.callMultipleElementSlotMethod(e, p, m, _, v);
10968
- else if (g === "refMethod") await this.callRefMethod(e, m, _, v);
10969
- else if (g === "multipleRefMethod") await this.callMultipleRefMethod(e, p, m, _, v);
10970
- else if (g === "elementAdaptSlotMethod") await this.callElementAdaptSlotMethod(e, m, v);
10971
- else if (g === "customAdaptSlotMethod") await this.callCustomAdaptSlotMethod(e, m, v);
10972
- else throw Error("not implemented method kind");
10927
+ if (g === "elementMethod") return await this.callElementMethod(e, m, y.basic.key, v);
10928
+ if (g === "refMethod") return await this.callRefMethod(e, m, _, v);
10929
+ if (g === "multipleRefMethod") return await this.callMultipleRefMethod(e, p, m, _, v);
10930
+ if (g === "elementAdaptSlotMethod") return await this.callElementAdaptSlotMethod(e, m, v);
10931
+ if (g === "customAdaptSlotMethod") return await this.callCustomAdaptSlotMethod(e, m, v);
10932
+ throw Error("not implemented method kind");
10973
10933
  }
10974
10934
  async callElementMethod(e, p, m, g) {
10975
10935
  if (!this.isValidOfElementMethod(m, g)) throw console.log(`Sandbox/callElementMethod invalid element method id=${e}`), Error("invalid element method");
@@ -10980,27 +10940,6 @@ var PromiseManager = class {
10980
10940
  outputs: _
10981
10941
  }), _;
10982
10942
  }
10983
- async callElementSlotMethod(e, p, m, g) {
10984
- let { elementKey: _, slotKey: v, methodKey: y } = unwrapMethodKeyOfElementSlot(g), b = this.children[`${m}/${v}`];
10985
- if (!b) throw Error("sandbox not found");
10986
- if (!b.isValidOfElementSlotMethod(_, v, y)) throw console.warn(`Sandbox/callElementSlotMethod invalid element slot method id=${e}`), Error("invalid element slot method");
10987
- let x = {};
10988
- return b.eventBus.emit(`method/${y}`, {
10989
- inputs: p,
10990
- outputs: x
10991
- }), x;
10992
- }
10993
- async callMultipleElementSlotMethod(e, p, m, g, _) {
10994
- if (!p) throw Error("instance not available");
10995
- let { elementKey: v, slotKey: y, methodKey: b } = unwrapMethodKeyOfElementSlot(_), x = this.children[`${g}/${y}/${p}`];
10996
- if (!x) throw Error("sandbox not found");
10997
- if (!x.isValidOfElementSlotMethod(v, y, b)) throw console.warn(`Sandbox/callMultipleElementSlotMethod invalid element slot method id=${e}`), Error("invalid element slot method");
10998
- let S = {};
10999
- return x.eventBus.emit(`method/${b}`, {
11000
- inputs: m,
11001
- outputs: S
11002
- }), S;
11003
- }
11004
10943
  async callRefMethod(e, p, m, g) {
11005
10944
  let _ = this.children[m];
11006
10945
  if (!_) throw Error("sandbox not found");
@@ -11019,7 +10958,8 @@ var PromiseManager = class {
11019
10958
  let { elementKey: g, slotKey: _, methodKey: v } = unwrapMethodKeyOfElementSlot(m);
11020
10959
  if (!this.isValidOfElementSlotMethod(g, _, v)) throw console.warn(`Sandbox/callElementAdaptSlotMethod invalid element slot method id=${e}`), Error("invalid element slot method");
11021
10960
  let y = {};
11022
- return this.eventBus.emit(`method/${_}/${v}`, {
10961
+ return this.eventBus.emit(`method/${v}`, {
10962
+ instance: this.instance,
11023
10963
  inputs: p,
11024
10964
  outputs: y
11025
10965
  }), y;
@@ -54,8 +54,6 @@ export declare class Sandbox {
54
54
  isValidOfCustomSlotProperty(slotId: string, propertyId: string): boolean;
55
55
  getProperty(id: string, instance?: string): Promise<any>;
56
56
  private getElementProperty;
57
- private getElementSlotProperty;
58
- private getMultipleElementSlotProperty;
59
57
  private getRefProperty;
60
58
  private getMultipleRefProperty;
61
59
  private getCustomSlotProperty;
@@ -65,8 +63,6 @@ export declare class Sandbox {
65
63
  private getCustomAdaptSlotProperty;
66
64
  setProperty(id: string, newValue: any, instance?: string): Promise<void>;
67
65
  private setElementProperty;
68
- private setElementSlotProperty;
69
- private setMultipleElementSlotProperty;
70
66
  private setRefProperty;
71
67
  private setMultipleRefProperty;
72
68
  private setCustomSlotProperty;
@@ -78,10 +74,8 @@ export declare class Sandbox {
78
74
  isValidOfElementSlotMethod(elementKey: string, slotKey: string, methodKey: string): boolean;
79
75
  isValidOfCustomMethod(methodId: string): boolean;
80
76
  isValidOfCustomSlotMethod(slotId: string, methodId: string): boolean;
81
- callMethod(id: string, instance: string, inputs: Inputs): Promise<void>;
77
+ callMethod(id: string, instance: string, inputs: Inputs): Promise<any>;
82
78
  private callElementMethod;
83
- private callElementSlotMethod;
84
- private callMultipleElementSlotMethod;
85
79
  private callRefMethod;
86
80
  private callMultipleRefMethod;
87
81
  private callElementAdaptSlotMethod;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.198",
4
+ "version": "0.8.199",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",