x-block-lib 0.8.78 → 0.8.80
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 +36 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2725,21 +2725,33 @@ s.forBlock.call_app_method_v1 = function(t) {
|
|
|
2725
2725
|
const { kind: r, nodeId: u, methodKey: h } = ee(o.method.id), l = eo(r, u, h);
|
|
2726
2726
|
if (o.method.outputs && o.method.outputs.length > 0) {
|
|
2727
2727
|
const d = s.statementToCode(o, "HANDLE");
|
|
2728
|
-
return `{
|
|
2728
|
+
return `try {
|
|
2729
2729
|
const __outputs__ = await ${l}(${i}, ${a});
|
|
2730
|
-
${c}${d}}
|
|
2730
|
+
${c}${d}} catch (e) {
|
|
2731
|
+
__messageV1__('error', e.message)
|
|
2732
|
+
}
|
|
2731
2733
|
`;
|
|
2732
2734
|
} else
|
|
2733
|
-
return `
|
|
2735
|
+
return `try {
|
|
2736
|
+
await ${l}(${i}, ${a});
|
|
2737
|
+
} catch (e) {
|
|
2738
|
+
__messageV1__('error', e.message)
|
|
2739
|
+
}
|
|
2734
2740
|
`;
|
|
2735
2741
|
} else if (o.method.outputs && o.method.outputs.length > 0) {
|
|
2736
2742
|
const r = s.statementToCode(o, "HANDLE");
|
|
2737
|
-
return `{
|
|
2743
|
+
return `try {
|
|
2738
2744
|
const __outputs__ = await __callMethodV1__(${n(o.method.id)}, ${i}, ${a});
|
|
2739
|
-
${c}${r}}
|
|
2745
|
+
${c}${r}} catch (e) {
|
|
2746
|
+
__messageV1__('error', e.message)
|
|
2747
|
+
}
|
|
2740
2748
|
`;
|
|
2741
2749
|
} else
|
|
2742
|
-
return `
|
|
2750
|
+
return `try {
|
|
2751
|
+
await __callMethodV1__(${n(o.method.id)}, ${i}, ${a});
|
|
2752
|
+
} catch (e) {
|
|
2753
|
+
__messageV1__('error', e.message)
|
|
2754
|
+
}
|
|
2743
2755
|
`;
|
|
2744
2756
|
};
|
|
2745
2757
|
const rs = {
|
|
@@ -2822,24 +2834,33 @@ const rs = {
|
|
|
2822
2834
|
}, 0);
|
|
2823
2835
|
},
|
|
2824
2836
|
updateShape_: function() {
|
|
2825
|
-
for (let
|
|
2826
|
-
const
|
|
2827
|
-
|
|
2837
|
+
for (let e = this.method.inputs?.length ?? 0; this.getInput("INPUT" + e); e++) {
|
|
2838
|
+
const n = this.getInput("INPUT" + e)?.connection?.targetBlock();
|
|
2839
|
+
n && n.dispose(), this.removeInput("INPUT" + e);
|
|
2828
2840
|
}
|
|
2829
2841
|
if (this.method.inputs)
|
|
2830
|
-
for (let
|
|
2831
|
-
this.getInput("INPUT" +
|
|
2842
|
+
for (let e = 0; e < this.method.inputs.length; e++)
|
|
2843
|
+
this.getInput("INPUT" + e) || (this.appendValueInput("INPUT" + e), this.moveInputBefore("INPUT" + e, "HANDLE"));
|
|
2844
|
+
let t = !1;
|
|
2845
|
+
if (this.method.kind === "multipleSlotMethod" && (t = !0), t)
|
|
2846
|
+
this.getInput("INSTANCE") || this.appendValueInput("INSTANCE").setAlign(k.Align.RIGHT).appendField("%{BKY_APP_INSTANCE}").setCheck("String"), this.method.inputs && this.method.inputs.length > 0 && this.moveInputBefore("INSTANCE", "INPUT0");
|
|
2847
|
+
else if (this.getInput("INSTANCE")) {
|
|
2848
|
+
const e = this.getInput("INSTANCE").connection.targetBlock();
|
|
2849
|
+
e && e.dispose(), this.removeInput("INSTANCE");
|
|
2850
|
+
}
|
|
2832
2851
|
},
|
|
2833
2852
|
ensureBlocks_: function() {
|
|
2834
2853
|
if (this.isInsertionMarker())
|
|
2835
2854
|
return;
|
|
2836
|
-
const t =
|
|
2855
|
+
const t = [];
|
|
2856
|
+
this.getInput("INSTANCE") && t.push(["INSTANCE", "__instance__", "x-runtime-lib.instance", !0]);
|
|
2857
|
+
const e = no(this.method.kind);
|
|
2837
2858
|
if (this.method.inputs)
|
|
2838
2859
|
for (let n = 0; n < this.method.inputs.length; n++) {
|
|
2839
2860
|
const { key: o, name: i } = this.method.inputs[n];
|
|
2840
|
-
|
|
2861
|
+
t.push(["INPUT" + n, `__input$${o}__`, i, e]);
|
|
2841
2862
|
}
|
|
2842
|
-
j(this,
|
|
2863
|
+
j(this, t);
|
|
2843
2864
|
},
|
|
2844
2865
|
checkWarning_: function() {
|
|
2845
2866
|
const t = q(this.node.id);
|
|
@@ -4440,6 +4461,7 @@ const Ts = S.xml, Es = [
|
|
|
4440
4461
|
},
|
|
4441
4462
|
{
|
|
4442
4463
|
type: "implement_app_method_v1",
|
|
4464
|
+
inputs: ["INSTANCE"],
|
|
4443
4465
|
prefixInputs: ["INPUT"]
|
|
4444
4466
|
},
|
|
4445
4467
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.80",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"vue-router": "^4.6.4",
|
|
39
39
|
"vuetify": "^3.11.4",
|
|
40
40
|
"x-essential-lib": "^0.9.20",
|
|
41
|
-
"x-runtime-lib": "^0.8.
|
|
41
|
+
"x-runtime-lib": "^0.8.153",
|
|
42
42
|
"x-state-lib": "^0.3.33"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|