x-runtime-lib 0.8.204 → 0.8.205
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.
- package/dist/index.js +12 -12
- package/dist/sandbox/sandbox/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10755,7 +10755,7 @@ var PromiseManager = class {
|
|
|
10755
10755
|
getNode(e) {
|
|
10756
10756
|
return this.data.value?.view.nodes[e];
|
|
10757
10757
|
}
|
|
10758
|
-
|
|
10758
|
+
isEqualOfElementSlot(e, p) {
|
|
10759
10759
|
let m = this.getNode("globality");
|
|
10760
10760
|
if (!m) return !1;
|
|
10761
10761
|
let g = m.settings?.adaptSlot;
|
|
@@ -10763,7 +10763,7 @@ var PromiseManager = class {
|
|
|
10763
10763
|
let { kind: _, mainKey: v, slotKey: y } = unwrapSlotId(g);
|
|
10764
10764
|
return !(_ !== "elementSlot" && _ !== "multipleElementSlot" || e !== v || p !== y);
|
|
10765
10765
|
}
|
|
10766
|
-
|
|
10766
|
+
isEqualOfCustomSlot(e, p) {
|
|
10767
10767
|
let m = this.getNode("globality");
|
|
10768
10768
|
if (!m) return !1;
|
|
10769
10769
|
let g = m.settings?.adaptSlot;
|
|
@@ -10852,7 +10852,7 @@ var PromiseManager = class {
|
|
|
10852
10852
|
async getElementAdaptSlotProperty(e, p) {
|
|
10853
10853
|
if (!this.parent) throw errors.notInSlot;
|
|
10854
10854
|
let { elementKey: m, slotKey: g, propertyKey: _ } = unwrapPropertyKeyOfElementSlot(p);
|
|
10855
|
-
if (!this.
|
|
10855
|
+
if (!this.isEqualOfElementSlot(m, g)) throw errors.slotIncompatible;
|
|
10856
10856
|
if (!this.isValidOfElementSlotProperty(m, g, _)) throw console.warn(`Sandbox/getElementAdaptSlotProperty invalid element slot property id=${e}`), errors.invalidElementSlotProperty;
|
|
10857
10857
|
let v = { value: void 0 };
|
|
10858
10858
|
return this.eventBus.emit(`property/${_}/get`, { result: v }), v.value;
|
|
@@ -10860,7 +10860,7 @@ var PromiseManager = class {
|
|
|
10860
10860
|
async getCustomAdaptSlotProperty(e, p) {
|
|
10861
10861
|
if (!this.parent) throw errors.notInSlot;
|
|
10862
10862
|
let { compId: m, slotId: g, propertyId: _ } = unwrapPropertyKeyOfCustomSlot(p);
|
|
10863
|
-
if (!this.
|
|
10863
|
+
if (!this.isEqualOfCustomSlot(m, g)) throw errors.slotIncompatible;
|
|
10864
10864
|
if (!this.isValidOfCustomSlotProperty(m, g, _)) throw console.warn(`Sandbox/getCustomAdaptSlotProperty invalid custom slot property id=${e}`), errors.invalidCustomSlotProperty;
|
|
10865
10865
|
return this.customSlotProperties[_];
|
|
10866
10866
|
}
|
|
@@ -10914,7 +10914,7 @@ var PromiseManager = class {
|
|
|
10914
10914
|
async setElementAdaptSlotProperty(e, p, m) {
|
|
10915
10915
|
if (!this.parent) throw errors.notInSlot;
|
|
10916
10916
|
let { elementKey: _, slotKey: v, propertyKey: y } = unwrapPropertyKeyOfElementSlot(m);
|
|
10917
|
-
if (!this.
|
|
10917
|
+
if (!this.isEqualOfElementSlot(_, v)) throw errors.slotIncompatible;
|
|
10918
10918
|
if (!this.isValidOfElementSlotProperty(_, v, y)) throw console.warn(`Sandbox/setElementAdaptSlotProperty invalid element slot property id=${e}`), errors.invalidElementSlotProperty;
|
|
10919
10919
|
let b = { value: void 0 };
|
|
10920
10920
|
this.eventBus.emit(`property/${y}/get`, { result: b });
|
|
@@ -10924,7 +10924,7 @@ var PromiseManager = class {
|
|
|
10924
10924
|
async setCustomAdaptSlotProperty(e, p, m) {
|
|
10925
10925
|
if (!this.parent) throw errors.notInSlot;
|
|
10926
10926
|
let { compId: _, slotId: v, propertyId: y } = unwrapPropertyKeyOfCustomSlot(m);
|
|
10927
|
-
if (!this.
|
|
10927
|
+
if (!this.isEqualOfCustomSlot(_, v)) throw errors.slotIncompatible;
|
|
10928
10928
|
if (!this.isValidOfCustomSlotProperty(_, v, y)) throw console.warn(`Sandbox/setCustomAdaptSlotProperty invalid custom slot property id=${e}`), errors.invalidCustomSlotProperty;
|
|
10929
10929
|
let b = this.customSlotProperties[y];
|
|
10930
10930
|
isEqual_default(p, b) || (this.customSlotProperties[y] = p, this.hooks.onPropertyChange(e, p, b), this.kind === "customSlot" ? this.parent.hooks.onPropertyChange(makePropertyId("customSlotProperty", this.nodeId, m), p, b) : this.kind === "multipleCustomSlot" && this.parent.hooks.onPropertyChange(makePropertyId("multipleCustomSlotProperty", this.nodeId, m), p, b, this.instance));
|
|
@@ -10984,7 +10984,7 @@ var PromiseManager = class {
|
|
|
10984
10984
|
async callElementAdaptSlotMethod(e, p, m) {
|
|
10985
10985
|
if (!this.parent) throw errors.notInSlot;
|
|
10986
10986
|
let { elementKey: g, slotKey: _, methodKey: v } = unwrapMethodKeyOfElementSlot(m);
|
|
10987
|
-
if (!this.
|
|
10987
|
+
if (!this.isEqualOfElementSlot(g, _)) throw errors.slotIncompatible;
|
|
10988
10988
|
if (!this.isValidOfElementSlotMethod(g, _, v)) throw console.warn(`Sandbox/callElementAdaptSlotMethod invalid element slot method id=${e}`), errors.invalidElementSlotMethod;
|
|
10989
10989
|
let y = {};
|
|
10990
10990
|
return this.eventBus.emit(`method/${v}`, {
|
|
@@ -10996,7 +10996,7 @@ var PromiseManager = class {
|
|
|
10996
10996
|
async callCustomAdaptSlotMethod(e, p, m) {
|
|
10997
10997
|
if (!this.parent) throw errors.notInSlot;
|
|
10998
10998
|
let { compId: g, slotId: _, methodId: v } = unwrapMethodKeyOfCustomSlot(m);
|
|
10999
|
-
if (!this.
|
|
10999
|
+
if (!this.isEqualOfCustomSlot(g, _)) throw errors.slotIncompatible;
|
|
11000
11000
|
if (!this.isValidOfCustomSlotMethod(g, _, v)) throw console.warn(`Sandbox/callCustomAdaptSlotMethod invalid custom slot method id=${e}`), errors.invalidCustomSlotMethod;
|
|
11001
11001
|
if (this.kind === "customSlot") return await this.parent.callFunctionAsync(getImplementMethodName("customSlotMethod", this.nodeId, m), "", p);
|
|
11002
11002
|
if (this.kind === "multipleCustomSlot") return await this.parent.callFunctionAsync(getImplementMethodName("multipleCustomSlotMethod", this.nodeId, m), this.instance, p);
|
|
@@ -11123,28 +11123,28 @@ var PromiseManager = class {
|
|
|
11123
11123
|
async triggerElementAdaptSlotEvent(e, p, m) {
|
|
11124
11124
|
if (!this.parent) throw errors.notInSlot;
|
|
11125
11125
|
let { elementKey: g, slotKey: _, eventKey: v } = unwrapEventKeyOfElementSlot(m);
|
|
11126
|
-
if (!this.
|
|
11126
|
+
if (!this.isEqualOfElementSlot(g, _)) throw errors.slotIncompatible;
|
|
11127
11127
|
if (!this.isValidOfElementSlotEvent(g, _, v)) throw errors.invalidElementSlotEvent;
|
|
11128
11128
|
await this.callFunctionAsync("__triggerEventInner__", e, p);
|
|
11129
11129
|
}
|
|
11130
11130
|
async triggerElementAdaptSlotPropertyChangeEvent(e, p, m) {
|
|
11131
11131
|
if (!this.parent) throw errors.notInSlot;
|
|
11132
11132
|
let { elementKey: g, slotKey: _, eventKey: v } = unwrapEventKeyOfElementSlot(m);
|
|
11133
|
-
if (!this.
|
|
11133
|
+
if (!this.isEqualOfElementSlot(g, _)) throw errors.slotIncompatible;
|
|
11134
11134
|
if (!this.isValidOfElementSlotProperty(g, _, v)) throw errors.invalidElementSlotProperty;
|
|
11135
11135
|
await this.callFunctionAsync("__triggerEventInner__", e, p);
|
|
11136
11136
|
}
|
|
11137
11137
|
async triggerCustomAdaptSlotEvent(e, p, m) {
|
|
11138
11138
|
if (!this.parent) throw errors.notInSlot;
|
|
11139
11139
|
let { compId: g, slotId: _, eventId: v } = unwrapEventKeyOfCustomSlot(m);
|
|
11140
|
-
if (!this.
|
|
11140
|
+
if (!this.isEqualOfCustomSlot(g, _)) throw errors.slotIncompatible;
|
|
11141
11141
|
if (!this.isValidOfCustomSlotEvent(g, _, v)) throw errors.invalidCustomSlotEvent;
|
|
11142
11142
|
await this.callFunctionAsync("__triggerEventInner__", e, p);
|
|
11143
11143
|
}
|
|
11144
11144
|
async triggerCustomAdaptSlotPropertyChangeEvent(e, p, m) {
|
|
11145
11145
|
if (!this.parent) throw errors.notInSlot;
|
|
11146
11146
|
let { compId: g, slotId: _, eventId: v } = unwrapEventKeyOfCustomSlot(m);
|
|
11147
|
-
if (!this.
|
|
11147
|
+
if (!this.isEqualOfCustomSlot(g, _)) throw errors.slotIncompatible;
|
|
11148
11148
|
if (!this.isValidOfCustomSlotProperty(g, _, v)) throw errors.invalidCustomSlotProperty;
|
|
11149
11149
|
await this.callFunctionAsync("__triggerEventInner__", e, p);
|
|
11150
11150
|
}
|
|
@@ -37,8 +37,8 @@ export declare class Sandbox {
|
|
|
37
37
|
callFunctionSync(funcName: string, ...params: any[]): any;
|
|
38
38
|
callFunctionAsync(funcName: string, ...params: any[]): Promise<any>;
|
|
39
39
|
getNode(nodeId: string): Node | undefined;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
isEqualOfElementSlot(elementKey: string, slotKey: string): boolean;
|
|
41
|
+
isEqualOfCustomSlot(compId: string, slotId: string): boolean;
|
|
42
42
|
customProperties: {
|
|
43
43
|
[key: string]: any;
|
|
44
44
|
};
|