x-runtime-lib 0.8.67 → 0.8.69
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 +18 -15
- package/dist/sandbox/sandbox/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8481,19 +8481,21 @@ function Su(t) {
|
|
|
8481
8481
|
u && u.setCustomProperty(d, a);
|
|
8482
8482
|
} else c === "customProperty" ? t.setCustomProperty(d, a) : c === "elementSlotProperty" || c === "customSlotProperty" ? t.setAdaptSlotProperty(d, a) : console.assert(!1);
|
|
8483
8483
|
}
|
|
8484
|
-
), t.
|
|
8484
|
+
), t.bindAsyncFunction(
|
|
8485
8485
|
"__callMethodV1__",
|
|
8486
|
-
(e, i, o) => {
|
|
8487
|
-
const
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8486
|
+
(e, i, o, s) => {
|
|
8487
|
+
const r = t.pseudoToNative(e), a = t.pseudoToNative(i), c = t.pseudoToNative(o), { kind: p, nodeId: d, methodKey: u } = jo(r);
|
|
8488
|
+
let m;
|
|
8489
|
+
if (p === "elementMethod")
|
|
8490
|
+
m = t.callElementMethod(r, c);
|
|
8491
|
+
else if (p === "referenceMethod") {
|
|
8492
|
+
const y = t.children[d];
|
|
8493
|
+
y && (m = y.callCustomMethod(u, c));
|
|
8494
|
+
} else if (p === "multipleRefMethod") {
|
|
8495
|
+
const y = t.children[d + "/" + a];
|
|
8496
|
+
y && (m = y.callCustomMethod(u, c));
|
|
8497
|
+
} else p === "customMethod" ? m = t.callCustomMethod(u, c) : p === "customSlotMethod" || console.assert(!1);
|
|
8498
|
+
s(t.nativeToPseudo(m)), t.run();
|
|
8497
8499
|
}
|
|
8498
8500
|
), t.bindNativeFunction("__getStateV1__", (e) => {
|
|
8499
8501
|
const i = t.pseudoToNative(e), o = t.getState(i);
|
|
@@ -8757,12 +8759,12 @@ ${Ir(e)}} catch (e) {
|
|
|
8757
8759
|
for (const r of i)
|
|
8758
8760
|
o.push(JSON.stringify(r));
|
|
8759
8761
|
const s = `try {
|
|
8760
|
-
${e}(${o.join(", ")});
|
|
8762
|
+
var __callFunctionResult__ = ${e}(${o.join(", ")});
|
|
8761
8763
|
} catch (e) {
|
|
8762
8764
|
__messageV1__('error', 'run exception: ' + e.message);
|
|
8763
8765
|
}
|
|
8764
8766
|
`;
|
|
8765
|
-
to(s), this.interpreter.appendCode(s), this.interpreter.run();
|
|
8767
|
+
return to(s), this.interpreter.appendCode(s), this.interpreter.run(), this.getVariable("__callFunctionResult__");
|
|
8766
8768
|
}
|
|
8767
8769
|
//--------------------------
|
|
8768
8770
|
// 元素属性
|
|
@@ -8853,7 +8855,8 @@ ${Ir(e)}} catch (e) {
|
|
|
8853
8855
|
return this.eventBus.emit(e, { key: o, inputs: i, outputs: s }), s;
|
|
8854
8856
|
}
|
|
8855
8857
|
callCustomMethod(e, i) {
|
|
8856
|
-
Q(this.mode)
|
|
8858
|
+
if (Q(this.mode))
|
|
8859
|
+
return this.callFunction(`__implementMethod$${e}__`, i);
|
|
8857
8860
|
}
|
|
8858
8861
|
//--------------------------
|
|
8859
8862
|
// 状态
|
|
@@ -36,7 +36,7 @@ export declare class Sandbox {
|
|
|
36
36
|
setVariable(varName: string, value: any): void;
|
|
37
37
|
run(): void;
|
|
38
38
|
runCode(code: string): void;
|
|
39
|
-
callFunction(funcName: string, ...params: any):
|
|
39
|
+
callFunction(funcName: string, ...params: any): any;
|
|
40
40
|
private nodes;
|
|
41
41
|
syncNodes(data: Data | undefined): void;
|
|
42
42
|
getElementPropertyInner(node: any, propertyKeys: PropertyKeys): any;
|
|
@@ -58,7 +58,7 @@ export declare class Sandbox {
|
|
|
58
58
|
} | undefined;
|
|
59
59
|
callCustomMethod(key: string, inputs: {
|
|
60
60
|
[key: string]: any;
|
|
61
|
-
}):
|
|
61
|
+
}): any;
|
|
62
62
|
private states;
|
|
63
63
|
resetStates(): void;
|
|
64
64
|
getState(stateId: string): any;
|