x-block-lib 0.6.40 → 0.6.42
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 +133 -121
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var yc = Object.defineProperty;
|
|
|
11
11
|
var bc = (e, t, n) => t in e ? yc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
12
12
|
var Fs = (e, t, n) => bc(e, typeof t != "symbol" ? t + "" : t, n);
|
|
13
13
|
import { getCurrentScope as Cc, onScopeDispose as Sc, computed as Ne, toValue as Ja, watch as Bt, shallowRef as kc, getCurrentInstance as Wo, onMounted as Jt, defineComponent as lt, onBeforeUnmount as qa, resolveComponent as Pe, createBlock as ht, openBlock as Le, unref as j, withCtx as ft, createVNode as ye, mergeProps as us, useModel as jn, toRefs as Nc, ref as wt, reactive as Lc, h as Ki, nextTick as ps, onUnmounted as Qn, isRef as zt, provide as Bc, inject as Rc, resolveDirective as Dc, withDirectives as Mc, createElementBlock as _t, normalizeStyle as at, createElementVNode as rt, toDisplayString as Xo, withModifiers as Un, mergeModels as Hi, Fragment as Za, renderList as Pc, useId as $i, withKeys as Qa, createCommentVNode as Xt, useTemplateRef as xc } from "vue";
|
|
14
|
-
import { d as C, j as r, O as u, f as Uc, F as er, M as g, E as
|
|
14
|
+
import { d as C, j as r, O as u, f as Uc, F as er, M as g, E as P, r as Ks, u as G, X as Qt, B as k, i as te, a as Gi, b as en, c as qt, e as dt, g as Hs, h as be, C as tr, k as wc, P as ji, N as _s, V as Dn, l as Vt, m as nr, s as Vc, S as He, n as Io, o as hn, p as pn, q as ho, t as Ei, v as Ln, w as $s, G as Ai, x as Yc, T as zo, y as or, z as ir, A as Fc, D as Kc, H as Gs, I as Hc, J as $c } from "./blockly-oznbag5p.js";
|
|
15
15
|
import { openConfirmDlg as Gc, openPromptDlg as jc, eventBus as Ze, messageWarning as sr, useColor as Jo, useSystem as ar, useViewStack as ds } from "x-essential-lib";
|
|
16
16
|
import { elements as Ve, pkgs as Wn, getPropTag as qo, parsePixelStr as Wc, parsePercentStr as Xc } from "x-runtime-lib";
|
|
17
17
|
import { globalState as B } from "x-state-lib";
|
|
@@ -1048,7 +1048,7 @@ function Yn(e, t, n) {
|
|
|
1048
1048
|
var tf = J_(function(e, t, n) {
|
|
1049
1049
|
return e + (n ? "_" : "") + t.toLowerCase();
|
|
1050
1050
|
});
|
|
1051
|
-
class
|
|
1051
|
+
class M extends er {
|
|
1052
1052
|
constructor(t, n, o) {
|
|
1053
1053
|
super(t, n, o);
|
|
1054
1054
|
}
|
|
@@ -1105,9 +1105,9 @@ class P extends er {
|
|
|
1105
1105
|
return "<n/a>";
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
Uc.register("field_dropdown2",
|
|
1108
|
+
Uc.register("field_dropdown2", M);
|
|
1109
1109
|
var me = /* @__PURE__ */ ((e) => (e.STATE_CHANGE = "state_change", e))(me || {});
|
|
1110
|
-
class wr extends
|
|
1110
|
+
class wr extends P.Abstract {
|
|
1111
1111
|
constructor() {
|
|
1112
1112
|
super(...arguments);
|
|
1113
1113
|
Fs(this, "isBlank", !0);
|
|
@@ -1184,7 +1184,7 @@ function Ts(e, t, n, o) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
function Ge(e, t) {
|
|
1186
1186
|
try {
|
|
1187
|
-
|
|
1187
|
+
P.disable(), t.forEach((n) => {
|
|
1188
1188
|
var _;
|
|
1189
1189
|
const [o, i, s, a] = n, c = (_ = e.getInput(o)) == null ? void 0 : _.connection;
|
|
1190
1190
|
if (!c)
|
|
@@ -1204,7 +1204,7 @@ function Ge(e, t) {
|
|
|
1204
1204
|
), l.outputConnection.connect(c);
|
|
1205
1205
|
});
|
|
1206
1206
|
} finally {
|
|
1207
|
-
|
|
1207
|
+
P.enable();
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
1210
|
function to(e) {
|
|
@@ -1410,7 +1410,7 @@ const rf = {
|
|
|
1410
1410
|
name: "",
|
|
1411
1411
|
inputs: [],
|
|
1412
1412
|
outputs: []
|
|
1413
|
-
}, this.appendDummyInput("DUMMY").appendField("%{BKY_UI_V1_CALL_NODE_METHOD_TITLE}").appendField(new
|
|
1413
|
+
}, this.appendDummyInput("DUMMY").appendField("%{BKY_UI_V1_CALL_NODE_METHOD_TITLE}").appendField(new M(() => this.genNodeOpts_()), "NODE").appendField(new M(() => this.genMethodOpts_()), "METHOD"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_UI_V1_CALL_NODE_METHOD_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_CALL_NODE_METHOD_HELPURL}"), this.initData_();
|
|
1414
1414
|
},
|
|
1415
1415
|
initData_: function() {
|
|
1416
1416
|
var i, s;
|
|
@@ -1453,7 +1453,7 @@ const rf = {
|
|
|
1453
1453
|
onchange: function(e) {
|
|
1454
1454
|
if (e.type === me.STATE_CHANGE)
|
|
1455
1455
|
this.checkWarning_();
|
|
1456
|
-
else if (e.type ===
|
|
1456
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
1457
1457
|
const t = e;
|
|
1458
1458
|
if (t.blockId !== this.id)
|
|
1459
1459
|
return;
|
|
@@ -1490,7 +1490,7 @@ const rf = {
|
|
|
1490
1490
|
return;
|
|
1491
1491
|
}
|
|
1492
1492
|
e.removeField("EXTRA1", !0), this.method.key === "add" && e.appendField(
|
|
1493
|
-
new
|
|
1493
|
+
new M(() => this.genElementOpts_()),
|
|
1494
1494
|
"EXTRA1"
|
|
1495
1495
|
);
|
|
1496
1496
|
},
|
|
@@ -1593,7 +1593,7 @@ const lf = {
|
|
|
1593
1593
|
name: "",
|
|
1594
1594
|
inputs: [],
|
|
1595
1595
|
outputs: []
|
|
1596
|
-
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_CALL_NODE_METHOD_AS_TITLE}").appendField(new
|
|
1596
|
+
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_CALL_NODE_METHOD_AS_TITLE}").appendField(new M(() => this.genElementOpts_()), "ELEMENT").appendField(new M(() => this.genMethodOpts_()), "METHOD"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_UI_V1_CALL_NODE_METHOD_AS_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_CALL_NODE_METHOD_AS_HELPURL}"), this.initData_(), this.updateShape_();
|
|
1597
1597
|
},
|
|
1598
1598
|
initData_: function() {
|
|
1599
1599
|
var i, s;
|
|
@@ -1633,7 +1633,7 @@ const lf = {
|
|
|
1633
1633
|
onchange: function(e) {
|
|
1634
1634
|
if (e.type === me.STATE_CHANGE)
|
|
1635
1635
|
this.checkWarning_();
|
|
1636
|
-
else if (e.type ===
|
|
1636
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
1637
1637
|
const t = e;
|
|
1638
1638
|
if (t.blockId !== this.id)
|
|
1639
1639
|
return;
|
|
@@ -1669,7 +1669,7 @@ const lf = {
|
|
|
1669
1669
|
console.assert(!1);
|
|
1670
1670
|
return;
|
|
1671
1671
|
}
|
|
1672
|
-
e.removeField("EXTRA1", !0), this.method.key === "add" && e.appendField(new
|
|
1672
|
+
e.removeField("EXTRA1", !0), this.method.key === "add" && e.appendField(new M(() => In()), "EXTRA1");
|
|
1673
1673
|
},
|
|
1674
1674
|
updateShape2_: function() {
|
|
1675
1675
|
var e, t;
|
|
@@ -1809,7 +1809,7 @@ const _f = {
|
|
|
1809
1809
|
id: "",
|
|
1810
1810
|
name: "",
|
|
1811
1811
|
inputs: []
|
|
1812
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_COMP_METHOD_IMPL_TITLE}").appendField(new
|
|
1812
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_COMP_METHOD_IMPL_TITLE}").appendField(new M(() => this.genMethodOpts_()), "METHOD"), this.appendStatementInput("HANDLE").appendField("%{BKY_UI_DO}"), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_UI_V1_COMP_METHOD_IMPL_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_COMP_METHOD_IMPL_HELPURL}"), this.initData_();
|
|
1813
1813
|
},
|
|
1814
1814
|
initData_: function() {
|
|
1815
1815
|
var n;
|
|
@@ -1839,7 +1839,7 @@ const _f = {
|
|
|
1839
1839
|
onchange: function(e) {
|
|
1840
1840
|
if (e.type === me.STATE_CHANGE)
|
|
1841
1841
|
this.checkWarning_();
|
|
1842
|
-
else if (e.type ===
|
|
1842
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
1843
1843
|
const t = e;
|
|
1844
1844
|
if (t.blockId !== this.id)
|
|
1845
1845
|
return;
|
|
@@ -1896,7 +1896,7 @@ const df = (e, t) => {
|
|
|
1896
1896
|
k[n] = {
|
|
1897
1897
|
init: function() {
|
|
1898
1898
|
this.appendDummyInput().appendField(
|
|
1899
|
-
new
|
|
1899
|
+
new M(() => this.genOpts_()),
|
|
1900
1900
|
"ITEM"
|
|
1901
1901
|
), this.setOutput(!0, o), this.setStyle("prop_blocks"), this.setTooltip(""), this.setHelpUrl("");
|
|
1902
1902
|
},
|
|
@@ -1921,7 +1921,7 @@ const hf = (e, t) => {
|
|
|
1921
1921
|
k[n] = {
|
|
1922
1922
|
init: function() {
|
|
1923
1923
|
this.value = t[0].default ?? "", this.appendDummyInput("DUMMY").appendField(
|
|
1924
|
-
new
|
|
1924
|
+
new M(() => this.genOpts_()),
|
|
1925
1925
|
"TYPE"
|
|
1926
1926
|
), this.setOutput(!0, o), this.setStyle("prop_blocks"), this.setTooltip(""), this.setHelpUrl(""), this.updateShape_();
|
|
1927
1927
|
},
|
|
@@ -1942,7 +1942,7 @@ const hf = (e, t) => {
|
|
|
1942
1942
|
onchange: function(i) {
|
|
1943
1943
|
if (i.type === me.STATE_CHANGE)
|
|
1944
1944
|
this.checkWarning_();
|
|
1945
|
-
else if (i.type ===
|
|
1945
|
+
else if (i.type === P.BLOCK_CHANGE) {
|
|
1946
1946
|
const s = i;
|
|
1947
1947
|
if (s.blockId !== this.id)
|
|
1948
1948
|
return;
|
|
@@ -2019,7 +2019,7 @@ const ff = {
|
|
|
2019
2019
|
id: "",
|
|
2020
2020
|
key: "",
|
|
2021
2021
|
alias: ""
|
|
2022
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_GET_NODE_TITLE}").appendField(new
|
|
2022
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_GET_NODE_TITLE}").appendField(new M(() => this.genNodeOpts_()), "NODE"), this.setOutput(!0, "String"), this.setStyle("variable_blocks"), this.setTooltip("%{BKY_UI_V1_GET_NODE_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_GET_NODE_HELPURL}");
|
|
2023
2023
|
},
|
|
2024
2024
|
initData_: function() {
|
|
2025
2025
|
var n;
|
|
@@ -2049,7 +2049,7 @@ const ff = {
|
|
|
2049
2049
|
onchange: function(e) {
|
|
2050
2050
|
if (e.type === me.STATE_CHANGE)
|
|
2051
2051
|
this.checkWarning_();
|
|
2052
|
-
else if (e.type ===
|
|
2052
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2053
2053
|
const t = e;
|
|
2054
2054
|
if (t.blockId !== this.id)
|
|
2055
2055
|
return;
|
|
@@ -2093,7 +2093,7 @@ const mf = {
|
|
|
2093
2093
|
}, this.prop = {
|
|
2094
2094
|
keys: "",
|
|
2095
2095
|
names: []
|
|
2096
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_GET_NODE_PROP_TITLE}").appendField(new
|
|
2096
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_GET_NODE_PROP_TITLE}").appendField(new M(() => this.genNodeOpts_()), "NODE").appendField(new M(() => this.genPropOpts_()), "PROP"), this.setOutput(!0, null), this.setStyle("prop_blocks"), this.setTooltip("%{BKY_UI_V1_GET_NODE_PROP_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_GET_NODE_PROP_HELPURL}"), this.initData_();
|
|
2097
2097
|
},
|
|
2098
2098
|
initData_: function() {
|
|
2099
2099
|
var i, s;
|
|
@@ -2133,7 +2133,7 @@ const mf = {
|
|
|
2133
2133
|
onchange: function(e) {
|
|
2134
2134
|
if (e.type === me.STATE_CHANGE)
|
|
2135
2135
|
this.checkWarning_();
|
|
2136
|
-
else if (e.type ===
|
|
2136
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2137
2137
|
const t = e;
|
|
2138
2138
|
if (t.blockId !== this.id)
|
|
2139
2139
|
return;
|
|
@@ -2193,7 +2193,7 @@ const gf = {
|
|
|
2193
2193
|
}, this.prop = {
|
|
2194
2194
|
keys: "",
|
|
2195
2195
|
names: []
|
|
2196
|
-
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_GET_NODE_PROP_AS_TITLE}"), this.appendDummyInput().appendField(new
|
|
2196
|
+
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_GET_NODE_PROP_AS_TITLE}"), this.appendDummyInput().appendField(new M(() => this.genElementOpts_()), "ELEMENT").appendField(new M(() => this.genPropOpts_()), "PROP"), this.setOutput(!0, null), this.setStyle("prop_blocks"), this.setTooltip("%{BKY_UI_V1_GET_NODE_PROP_AS_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_GET_NODE_PROP_AS_HELPURL}"), this.initData_();
|
|
2197
2197
|
},
|
|
2198
2198
|
initData_: function() {
|
|
2199
2199
|
var i, s;
|
|
@@ -2233,7 +2233,7 @@ const gf = {
|
|
|
2233
2233
|
onchange: function(e) {
|
|
2234
2234
|
if (e.type === me.STATE_CHANGE)
|
|
2235
2235
|
this.checkWarning_();
|
|
2236
|
-
else if (e.type ===
|
|
2236
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2237
2237
|
const t = e;
|
|
2238
2238
|
if (t.blockId !== this.id)
|
|
2239
2239
|
return;
|
|
@@ -2305,7 +2305,7 @@ const Af = {
|
|
|
2305
2305
|
name: "",
|
|
2306
2306
|
type: ""
|
|
2307
2307
|
}, this.appendDummyInput().appendField("%{BKY_UI_V1_GET_PAGE_ARGUMENT_TITLE}").appendField(
|
|
2308
|
-
new
|
|
2308
|
+
new M(() => this.genArgumentOpts_()),
|
|
2309
2309
|
"ARGUMENT"
|
|
2310
2310
|
), this.setOutput(!0, null), this.setStyle("variable_blocks"), this.setTooltip("%{BKY_UI_V1_GET_PAGE_ARGUMENT_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_GET_PAGE_ARGUMENT_HELPURL}");
|
|
2311
2311
|
},
|
|
@@ -2326,7 +2326,7 @@ const Af = {
|
|
|
2326
2326
|
onchange: function(e) {
|
|
2327
2327
|
if (e.type === me.STATE_CHANGE)
|
|
2328
2328
|
this.checkWarning_();
|
|
2329
|
-
else if (e.type ===
|
|
2329
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2330
2330
|
const t = e;
|
|
2331
2331
|
if (t.blockId !== this.id)
|
|
2332
2332
|
return;
|
|
@@ -2419,8 +2419,8 @@ const yf = {
|
|
|
2419
2419
|
}, this.page = {
|
|
2420
2420
|
id: "",
|
|
2421
2421
|
name: ""
|
|
2422
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_NAVIGATE_TO_TITLE}").appendField(new
|
|
2423
|
-
new
|
|
2422
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_NAVIGATE_TO_TITLE}").appendField(new M(() => this.genAppOpts_()), "APP").appendField(new M(() => this.genPageOpts_()), "PAGE").appendField("%{BKY_UI_MODE}").appendField(
|
|
2423
|
+
new M([
|
|
2424
2424
|
["%{BKY_UI_NAVIGATE_MODE_PUSH}", "push"],
|
|
2425
2425
|
["%{BKY_UI_NAVIGATE_MODE_REPLACE}", "replace"]
|
|
2426
2426
|
]),
|
|
@@ -2465,7 +2465,7 @@ const yf = {
|
|
|
2465
2465
|
onchange: function(e) {
|
|
2466
2466
|
if (e.type === me.STATE_CHANGE)
|
|
2467
2467
|
this.checkWarning_();
|
|
2468
|
-
else if (e.type ===
|
|
2468
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2469
2469
|
const t = e;
|
|
2470
2470
|
if (t.blockId !== this.id)
|
|
2471
2471
|
return;
|
|
@@ -2524,7 +2524,7 @@ const bf = {
|
|
|
2524
2524
|
key: "",
|
|
2525
2525
|
name: "",
|
|
2526
2526
|
params: []
|
|
2527
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_ON_NODE_EVENT_TITLE}").appendField(new
|
|
2527
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_ON_NODE_EVENT_TITLE}").appendField(new M(() => this.genNodeOpts_()), "NODE").appendField(new M(() => this.genEventOpts_()), "EVENT"), this.appendStatementInput("HANDLE").appendField("%{BKY_UI_DO}"), this.setStyle("event_blocks"), this.setTooltip("%{BKY_UI_V1_ON_NODE_EVENT_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_ON_NODE_EVENT_HELPURL}"), this.initData_();
|
|
2528
2528
|
},
|
|
2529
2529
|
initData_: function() {
|
|
2530
2530
|
var i, s;
|
|
@@ -2564,7 +2564,7 @@ const bf = {
|
|
|
2564
2564
|
onchange: function(e) {
|
|
2565
2565
|
if (e.type === me.STATE_CHANGE)
|
|
2566
2566
|
this.checkWarning_();
|
|
2567
|
-
else if (e.type ===
|
|
2567
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2568
2568
|
const t = e;
|
|
2569
2569
|
if (t.blockId !== this.id)
|
|
2570
2570
|
return;
|
|
@@ -2654,7 +2654,7 @@ const Cf = {
|
|
|
2654
2654
|
key: "",
|
|
2655
2655
|
name: "",
|
|
2656
2656
|
params: []
|
|
2657
|
-
}, this.appendValueInput("NODE").appendField("%{BKY_UI_V1_ON_NODE_EVENT_AS_TITLE}").appendField(new
|
|
2657
|
+
}, this.appendValueInput("NODE").appendField("%{BKY_UI_V1_ON_NODE_EVENT_AS_TITLE}").appendField(new M(() => this.genElementOpts_()), "ELEMENT").appendField(new M(() => this.genEventOpts_()), "EVENT"), this.appendStatementInput("HANDLE").appendField("%{BKY_UI_DO}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("event_blocks"), this.setTooltip("%{BKY_UI_V1_ON_NODE_EVENT_AS_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_ON_NODE_EVENT_AS_HELPURL}"), this.initData_();
|
|
2658
2658
|
},
|
|
2659
2659
|
initData_: function() {
|
|
2660
2660
|
var i, s;
|
|
@@ -2694,7 +2694,7 @@ const Cf = {
|
|
|
2694
2694
|
onchange: function(e) {
|
|
2695
2695
|
if (e.type === me.STATE_CHANGE)
|
|
2696
2696
|
this.checkWarning_();
|
|
2697
|
-
else if (e.type ===
|
|
2697
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2698
2698
|
const t = e;
|
|
2699
2699
|
if (t.blockId !== this.id)
|
|
2700
2700
|
return;
|
|
@@ -2884,7 +2884,7 @@ const Nf = {
|
|
|
2884
2884
|
this.comp = {
|
|
2885
2885
|
id: void 0,
|
|
2886
2886
|
name: ""
|
|
2887
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_SELECT_COMP_TITLE}").appendField(new
|
|
2887
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_SELECT_COMP_TITLE}").appendField(new M(() => this.genCompOpts_()), "COMP"), this.setOutput(!0, "Comp"), this.setStyle("prop_blocks"), this.setTooltip("%{BKY_UI_V1_SELECT_COMP_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_SELECT_COMP_HELPURL}"), this.initData_();
|
|
2888
2888
|
},
|
|
2889
2889
|
initData_: function() {
|
|
2890
2890
|
var n;
|
|
@@ -2914,7 +2914,7 @@ const Nf = {
|
|
|
2914
2914
|
onchange: function(e) {
|
|
2915
2915
|
if (e.type === me.STATE_CHANGE)
|
|
2916
2916
|
this.checkWarning_();
|
|
2917
|
-
else if (e.type ===
|
|
2917
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
2918
2918
|
const t = e;
|
|
2919
2919
|
if (t.blockId !== this.id)
|
|
2920
2920
|
return;
|
|
@@ -2957,7 +2957,7 @@ const Lf = {
|
|
|
2957
2957
|
id: "",
|
|
2958
2958
|
name: "",
|
|
2959
2959
|
type: ""
|
|
2960
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_UI_V1_SET_COMP_METHOD_OUTPUT_TITLE}").appendField(new
|
|
2960
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_UI_V1_SET_COMP_METHOD_OUTPUT_TITLE}").appendField(new M(() => this.genMethodOpts_()), "METHOD").appendField(new M(() => this.genOutputOpts_()), "OUTPUT"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_UI_V1_SET_COMP_METHOD_OUTPUT_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_SET_COMP_METHOD_OUTPUT_HELPURL}"), this.initData_();
|
|
2961
2961
|
},
|
|
2962
2962
|
initData_: function() {
|
|
2963
2963
|
var i, s;
|
|
@@ -2996,7 +2996,7 @@ const Lf = {
|
|
|
2996
2996
|
onchange: function(e) {
|
|
2997
2997
|
if (e.type === me.STATE_CHANGE)
|
|
2998
2998
|
this.checkWarning_();
|
|
2999
|
-
else if (e.type ===
|
|
2999
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
3000
3000
|
const t = e;
|
|
3001
3001
|
if (t.blockId !== this.id)
|
|
3002
3002
|
return;
|
|
@@ -3095,7 +3095,7 @@ const Bf = {
|
|
|
3095
3095
|
}, this.prop = {
|
|
3096
3096
|
keys: "",
|
|
3097
3097
|
names: []
|
|
3098
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_UI_V1_SET_NODE_PROP_TITLE}").appendField(new
|
|
3098
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_UI_V1_SET_NODE_PROP_TITLE}").appendField(new M(() => this.genNodeOpts_()), "NODE").appendField(new M(() => this.genPropOpts_()), "PROP"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("prop_blocks"), this.setTooltip("%{BKY_UI_V1_SET_NODE_PROP_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_SET_NODE_PROP_HELPURL}"), this.initData_(), this.isInFlyout && (this.rebuildBlocks_(), this.updateCheck_());
|
|
3099
3099
|
},
|
|
3100
3100
|
initData_: function() {
|
|
3101
3101
|
var i, s;
|
|
@@ -3135,7 +3135,7 @@ const Bf = {
|
|
|
3135
3135
|
onchange: function(e) {
|
|
3136
3136
|
if (e.type === me.STATE_CHANGE)
|
|
3137
3137
|
this.checkWarning_();
|
|
3138
|
-
else if (e.type ===
|
|
3138
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
3139
3139
|
const t = e;
|
|
3140
3140
|
if (t.blockId !== this.id)
|
|
3141
3141
|
return;
|
|
@@ -3215,7 +3215,7 @@ const Rf = {
|
|
|
3215
3215
|
}, this.prop = {
|
|
3216
3216
|
keys: "",
|
|
3217
3217
|
names: []
|
|
3218
|
-
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_SET_NODE_PROP_AS_TITLE}"), this.appendValueInput("VALUE").appendField(new
|
|
3218
|
+
}, this.appendValueInput("NODE").setCheck("String").appendField("%{BKY_UI_V1_SET_NODE_PROP_AS_TITLE}"), this.appendValueInput("VALUE").appendField(new M(() => this.genElementOpts_()), "ELEMENT").appendField(new M(() => this.genPropOpts_()), "PROP"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setInputsInline(!0), this.setStyle("prop_blocks"), this.setTooltip("%{BKY_UI_V1_SET_NODE_PROP_AS_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_SET_NODE_PROP_AS_HELPURL}"), this.initData_(), this.isInFlyout && (this.rebuildBlocks_(), this.updateCheck_());
|
|
3219
3219
|
},
|
|
3220
3220
|
initData_: function() {
|
|
3221
3221
|
var i, s;
|
|
@@ -3255,7 +3255,7 @@ const Rf = {
|
|
|
3255
3255
|
onchange: function(e) {
|
|
3256
3256
|
if (e.type === me.STATE_CHANGE)
|
|
3257
3257
|
this.checkWarning_();
|
|
3258
|
-
else if (e.type ===
|
|
3258
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
3259
3259
|
const t = e;
|
|
3260
3260
|
if (t.blockId !== this.id)
|
|
3261
3261
|
return;
|
|
@@ -3333,7 +3333,7 @@ const Df = {
|
|
|
3333
3333
|
id: "",
|
|
3334
3334
|
name: "",
|
|
3335
3335
|
params: []
|
|
3336
|
-
}, this.appendDummyInput().appendField("%{BKY_UI_V1_TRIGGER_COMP_EVENT_TITLE}").appendField(new
|
|
3336
|
+
}, this.appendDummyInput().appendField("%{BKY_UI_V1_TRIGGER_COMP_EVENT_TITLE}").appendField(new M(() => this.genEventOpts_()), "EVENT"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("event_blocks"), this.setTooltip("%{BKY_UI_V1_TRIGGER_COMP_EVENT_TOOLTIP}"), this.setHelpUrl("%{BKY_UI_V1_TRIGGER_COMP_EVENT_HELPURL}"), this.initData_();
|
|
3337
3337
|
},
|
|
3338
3338
|
initData_: function() {
|
|
3339
3339
|
var n;
|
|
@@ -3363,7 +3363,7 @@ const Df = {
|
|
|
3363
3363
|
onchange: function(e) {
|
|
3364
3364
|
if (e.type === me.STATE_CHANGE)
|
|
3365
3365
|
this.checkWarning_();
|
|
3366
|
-
else if (e.type ===
|
|
3366
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
3367
3367
|
const t = e;
|
|
3368
3368
|
if (t.blockId !== this.id)
|
|
3369
3369
|
return;
|
|
@@ -3649,7 +3649,7 @@ const Uf = {
|
|
|
3649
3649
|
this.key = e, this.name = t, this.locale = n, this.updateShape_();
|
|
3650
3650
|
},
|
|
3651
3651
|
onchange: function(e) {
|
|
3652
|
-
if (e.type ===
|
|
3652
|
+
if (e.type === P.BLOCK_MOVE) {
|
|
3653
3653
|
const t = e;
|
|
3654
3654
|
if (t.blockId !== this.id)
|
|
3655
3655
|
return;
|
|
@@ -3661,7 +3661,7 @@ const Uf = {
|
|
|
3661
3661
|
const t = this.workspace.getBlockById(e.oldParentId);
|
|
3662
3662
|
if (t && xf(t.type, e.oldInputName))
|
|
3663
3663
|
try {
|
|
3664
|
-
|
|
3664
|
+
P.disable();
|
|
3665
3665
|
const o = (n = t.getInput(e.oldInputName)) == null ? void 0 : n.connection;
|
|
3666
3666
|
if (o) {
|
|
3667
3667
|
const i = Ts(
|
|
@@ -3673,7 +3673,7 @@ const Uf = {
|
|
|
3673
3673
|
o.connect(i.outputConnection);
|
|
3674
3674
|
}
|
|
3675
3675
|
} finally {
|
|
3676
|
-
|
|
3676
|
+
P.enable();
|
|
3677
3677
|
}
|
|
3678
3678
|
},
|
|
3679
3679
|
updateShape_: function() {
|
|
@@ -3737,7 +3737,7 @@ const Vf = {
|
|
|
3737
3737
|
name: "",
|
|
3738
3738
|
inputs: [],
|
|
3739
3739
|
outputs: []
|
|
3740
|
-
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new
|
|
3740
|
+
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genFuncOpts_()), "FUNC"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_COMPUTE_V1_CALL_FUNC_TOOLTIP}"), this.setHelpUrl("%{BKY_COMPUTE_V1_CALL_FUNC_HELPURL}"), this.initData_();
|
|
3741
3741
|
},
|
|
3742
3742
|
initData_: function() {
|
|
3743
3743
|
var i, s;
|
|
@@ -3764,8 +3764,8 @@ const Vf = {
|
|
|
3764
3764
|
},
|
|
3765
3765
|
loadExtraState: function(e) {
|
|
3766
3766
|
var t, n, o, i, s, a;
|
|
3767
|
-
this.space.id = ((t = e.space) == null ? void 0 : t.id) ?? "", this.space.name = ((n = e.space) == null ? void 0 : n.name) ?? "", this.func.id = ((o = e.func) == null ? void 0 : o.id) ?? "", this.func.name = ((i = e.func) == null ? void 0 : i.name) ?? "", this.func.inputs = ((s = e.func) == null ? void 0 : s.inputs) ?? [], this.func.outputs = ((a = e.func) == null ? void 0 : a.outputs) ?? [], this.updateShape_(), setTimeout(() => {
|
|
3768
|
-
this.
|
|
3767
|
+
this.space.id = ((t = e.space) == null ? void 0 : t.id) ?? "", this.space.name = ((n = e.space) == null ? void 0 : n.name) ?? "", this.func.id = ((o = e.func) == null ? void 0 : o.id) ?? "", this.func.name = ((i = e.func) == null ? void 0 : i.name) ?? "", this.func.inputs = ((s = e.func) == null ? void 0 : s.inputs) ?? [], this.func.outputs = ((a = e.func) == null ? void 0 : a.outputs) ?? [], this.updateShape_(), this.updateCheck_(), this.updateShadow_(), setTimeout(() => {
|
|
3768
|
+
this.rebuildBlocks_(), this.checkWarning_();
|
|
3769
3769
|
}, 0);
|
|
3770
3770
|
},
|
|
3771
3771
|
genSpaceOpts_: function() {
|
|
@@ -3801,6 +3801,12 @@ const Vf = {
|
|
|
3801
3801
|
this.getInput("INPUT" + i) || (this.appendValueInput("INPUT" + i).setAlign(te.Align.RIGHT).appendField(s), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + i, "OUTPUT0") : this.moveInputBefore("INPUT" + i, "CALLBACK"));
|
|
3802
3802
|
}
|
|
3803
3803
|
},
|
|
3804
|
+
updateCheck_: function() {
|
|
3805
|
+
for (let e = 0; e < this.func.inputs.length; e++) {
|
|
3806
|
+
const { type: t } = this.func.inputs[e], n = this.getInput("INPUT" + e);
|
|
3807
|
+
t === "string" ? n.setCheck("String") : t === "number" ? n.setCheck("Number") : t === "boolean" ? n.setCheck("Boolean") : t === "list" ? n.setCheck("Array") : t === "object" && n.setCheck("Object");
|
|
3808
|
+
}
|
|
3809
|
+
},
|
|
3804
3810
|
updateShadow_: function() {
|
|
3805
3811
|
if (!this.isInsertionMarker())
|
|
3806
3812
|
for (let e = 0; e < this.func.inputs.length; e++) {
|
|
@@ -3854,23 +3860,20 @@ k.call_func_v1 = Vf;
|
|
|
3854
3860
|
r.forBlock.call_func_v1 = function(e) {
|
|
3855
3861
|
const t = r.INDENT, n = r.quote_, o = e, i = n(o.space.id), s = n(o.func.id);
|
|
3856
3862
|
let a = "";
|
|
3857
|
-
|
|
3863
|
+
a += `${t}var __inputs__ = {
|
|
3864
|
+
`, o.func.inputs.forEach(({ id: h }, T) => {
|
|
3858
3865
|
const m = r.valueToCode(
|
|
3859
3866
|
o,
|
|
3860
3867
|
"INPUT" + T,
|
|
3861
3868
|
u.ATOMIC
|
|
3862
3869
|
);
|
|
3863
|
-
a += `${t}
|
|
3864
|
-
`;
|
|
3865
|
-
}), a += `${t}var __inputs__ = {
|
|
3866
|
-
`, o.func.inputs.forEach(({ id: h }) => {
|
|
3867
|
-
a += `${t}${t}${n(h)}: __input_${h}__,
|
|
3870
|
+
a += `${t}${t}${n(h)}: ${m},
|
|
3868
3871
|
`;
|
|
3869
3872
|
}), a += `${t}};`;
|
|
3870
3873
|
const c = n(o.space.name + "/" + o.func.name);
|
|
3871
3874
|
let l = "";
|
|
3872
|
-
o.func.outputs.forEach(({ id: h }
|
|
3873
|
-
l += `${t}var __output_${h}
|
|
3875
|
+
o.func.outputs.forEach(({ id: h }) => {
|
|
3876
|
+
l += `${t}var __output_${h}__ = result[${n(h)}];
|
|
3874
3877
|
`;
|
|
3875
3878
|
});
|
|
3876
3879
|
const _ = r.statementToCode(o, "CALLBACK");
|
|
@@ -3890,7 +3893,7 @@ const Yf = {
|
|
|
3890
3893
|
name: "",
|
|
3891
3894
|
inputs: [],
|
|
3892
3895
|
outputs: []
|
|
3893
|
-
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}");
|
|
3896
|
+
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genFuncOpts_()), "FUNC"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_COMPUTE_V1_CALL_FUNC_INTERNAL_TOOLTIP}"), this.setHelpUrl("%{BKY_COMPUTE_V1_CALL_FUNC_INTERNAL_HELPURL}"), this.initData_();
|
|
3894
3897
|
},
|
|
3895
3898
|
initData_: function() {
|
|
3896
3899
|
var i, s;
|
|
@@ -3917,8 +3920,8 @@ const Yf = {
|
|
|
3917
3920
|
},
|
|
3918
3921
|
loadExtraState: function(e) {
|
|
3919
3922
|
var t, n, o, i, s, a;
|
|
3920
|
-
this.space.id = ((t = e.space) == null ? void 0 : t.id) ?? "", this.space.name = ((n = e.space) == null ? void 0 : n.name) ?? "", this.func.id = ((o = e.func) == null ? void 0 : o.id) ?? "", this.func.name = ((i = e.func) == null ? void 0 : i.name) ?? "", this.func.inputs = ((s = e.func) == null ? void 0 : s.inputs) ?? [], this.func.outputs = ((a = e.func) == null ? void 0 : a.outputs) ?? [], this.updateShape_(), setTimeout(() => {
|
|
3921
|
-
this.
|
|
3923
|
+
this.space.id = ((t = e.space) == null ? void 0 : t.id) ?? "", this.space.name = ((n = e.space) == null ? void 0 : n.name) ?? "", this.func.id = ((o = e.func) == null ? void 0 : o.id) ?? "", this.func.name = ((i = e.func) == null ? void 0 : i.name) ?? "", this.func.inputs = ((s = e.func) == null ? void 0 : s.inputs) ?? [], this.func.outputs = ((a = e.func) == null ? void 0 : a.outputs) ?? [], this.updateShape_(), this.updateCheck_(), this.updateShadow_(), setTimeout(() => {
|
|
3924
|
+
this.rebuildBlocks_(), this.checkWarning_();
|
|
3922
3925
|
}, 0);
|
|
3923
3926
|
},
|
|
3924
3927
|
genSpaceOpts_: function() {
|
|
@@ -3954,6 +3957,12 @@ const Yf = {
|
|
|
3954
3957
|
this.getInput("INPUT" + i) || (this.appendValueInput("INPUT" + i).setAlign(te.Align.RIGHT).appendField(s), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + i, "OUTPUT0") : this.moveInputBefore("INPUT" + i, "CALLBACK"));
|
|
3955
3958
|
}
|
|
3956
3959
|
},
|
|
3960
|
+
updateCheck_: function() {
|
|
3961
|
+
for (let e = 0; e < this.func.inputs.length; e++) {
|
|
3962
|
+
const { type: t } = this.func.inputs[e], n = this.getInput("INPUT" + e);
|
|
3963
|
+
t === "string" ? n.setCheck("String") : t === "number" ? n.setCheck("Number") : t === "boolean" ? n.setCheck("Boolean") : t === "list" ? n.setCheck("Array") : t === "object" && n.setCheck("Object");
|
|
3964
|
+
}
|
|
3965
|
+
},
|
|
3957
3966
|
updateShadow_: function() {
|
|
3958
3967
|
if (!this.isInsertionMarker())
|
|
3959
3968
|
for (let e = 0; e < this.func.inputs.length; e++) {
|
|
@@ -3976,7 +3985,7 @@ const Yf = {
|
|
|
3976
3985
|
const e = [];
|
|
3977
3986
|
for (let t = 0; t < this.func.outputs.length; t++) {
|
|
3978
3987
|
const { id: n, name: o } = this.func.outputs[t];
|
|
3979
|
-
e.push(["OUTPUT" + t, `
|
|
3988
|
+
e.push(["OUTPUT" + t, `__output_${n}__`, o, !1]);
|
|
3980
3989
|
}
|
|
3981
3990
|
Ge(this, e);
|
|
3982
3991
|
},
|
|
@@ -4005,29 +4014,32 @@ const Yf = {
|
|
|
4005
4014
|
};
|
|
4006
4015
|
k.call_func_internal_v1 = Yf;
|
|
4007
4016
|
r.forBlock.call_func_internal_v1 = function(e) {
|
|
4008
|
-
const t = r.INDENT, n = r.quote_, o = e, i = n(o.space.id), s = n(o.func.id)
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4017
|
+
const t = r.INDENT, n = r.quote_, o = e, i = n(o.space.id), s = n(o.func.id);
|
|
4018
|
+
let a = `${t}var __inputs__ = {
|
|
4019
|
+
`;
|
|
4020
|
+
o.func.inputs.forEach(({ id: h }, T) => {
|
|
4021
|
+
const m = r.valueToCode(
|
|
4022
|
+
o,
|
|
4023
|
+
"INPUT" + T,
|
|
4024
|
+
u.ATOMIC
|
|
4012
4025
|
);
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4026
|
+
a += `${t}${t}${n(h)}: ${m},
|
|
4027
|
+
`;
|
|
4028
|
+
}), a += `${t}};`;
|
|
4029
|
+
const c = o.space.name + "/" + o.func.name;
|
|
4030
|
+
let l = "";
|
|
4031
|
+
o.func.outputs.forEach(({ id: h }) => {
|
|
4032
|
+
l += `${t}var __output_${h}__ = __result__.outputs[${n(h)}];
|
|
4017
4033
|
`;
|
|
4018
4034
|
});
|
|
4019
|
-
const
|
|
4035
|
+
const _ = r.statementToCode(o, "CALLBACK");
|
|
4020
4036
|
return `{
|
|
4021
|
-
|
|
4022
|
-
var
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
if (!success) {
|
|
4026
|
-
throw 'call func<${l}> failed, reason: ' + message;
|
|
4037
|
+
${a}
|
|
4038
|
+
var __result__ = __callFuncInternalV1__(${i}, ${s}, __inputs__);
|
|
4039
|
+
if (!__result__.success) {
|
|
4040
|
+
throw 'call func<${c}> failed, reason: ' + __result__.message;
|
|
4027
4041
|
}
|
|
4028
|
-
|
|
4029
|
-
${d}
|
|
4030
|
-
}
|
|
4042
|
+
${l}${_}}
|
|
4031
4043
|
`;
|
|
4032
4044
|
};
|
|
4033
4045
|
C([
|
|
@@ -4095,8 +4107,8 @@ const Ff = {
|
|
|
4095
4107
|
return;
|
|
4096
4108
|
const e = [];
|
|
4097
4109
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
4098
|
-
const {
|
|
4099
|
-
e.push(["INPUT" + t, n
|
|
4110
|
+
const { id: n, name: o } = this.func.inputs[t];
|
|
4111
|
+
e.push(["INPUT" + t, `__input_${n}__`, o, !1]);
|
|
4100
4112
|
}
|
|
4101
4113
|
Ge(this, e);
|
|
4102
4114
|
},
|
|
@@ -4112,9 +4124,9 @@ const Ff = {
|
|
|
4112
4124
|
k.func_entry_v1 = Ff;
|
|
4113
4125
|
r.forBlock.func_entry_v1 = function(e) {
|
|
4114
4126
|
const t = e, n = r.statementToCode(t, "HANDLE"), o = [];
|
|
4115
|
-
for (let
|
|
4116
|
-
const
|
|
4117
|
-
o.push(
|
|
4127
|
+
for (let s = 0; s < t.func.inputs.length; s++) {
|
|
4128
|
+
const { id: a } = t.func.inputs[s];
|
|
4129
|
+
o.push(`__input_${a}__`);
|
|
4118
4130
|
}
|
|
4119
4131
|
return `function __funcEntryV1__(${o.join(", ")}) {
|
|
4120
4132
|
${n}}`;
|
|
@@ -4134,7 +4146,7 @@ const Hf = {
|
|
|
4134
4146
|
id: "",
|
|
4135
4147
|
name: "",
|
|
4136
4148
|
type: ""
|
|
4137
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_TITLE}").appendField(new
|
|
4149
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_TITLE}").appendField(new M(() => this.genOutputOpts_()), "OUTPUT"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_TOOLTIP}"), this.setHelpUrl("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_HELPURL}"), this.initData_();
|
|
4138
4150
|
},
|
|
4139
4151
|
initData_: function() {
|
|
4140
4152
|
var t;
|
|
@@ -4160,7 +4172,7 @@ const Hf = {
|
|
|
4160
4172
|
onchange: function(e) {
|
|
4161
4173
|
if (e.type === me.STATE_CHANGE)
|
|
4162
4174
|
this.checkWarning_();
|
|
4163
|
-
else if (e.type ===
|
|
4175
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
4164
4176
|
const t = e;
|
|
4165
4177
|
if (t.blockId !== this.id)
|
|
4166
4178
|
return;
|
|
@@ -4207,7 +4219,7 @@ const Hf = {
|
|
|
4207
4219
|
};
|
|
4208
4220
|
k.set_func_output_v1 = Hf;
|
|
4209
4221
|
r.forBlock.set_func_output_v1 = function(e) {
|
|
4210
|
-
const t = r.quote_, n = e, {
|
|
4222
|
+
const t = r.quote_, n = e, { id: o, type: i } = n.output;
|
|
4211
4223
|
let s = r.valueToCode(n, "VALUE", u.ATOMIC);
|
|
4212
4224
|
if (s === void 0)
|
|
4213
4225
|
switch (i) {
|
|
@@ -4308,8 +4320,8 @@ const Gf = {
|
|
|
4308
4320
|
name: ""
|
|
4309
4321
|
}, this.column = {
|
|
4310
4322
|
name: ""
|
|
4311
|
-
}, this.appendValueInput("VALUE").appendField(new
|
|
4312
|
-
new
|
|
4323
|
+
}, this.appendValueInput("VALUE").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genTableOpts_()), "TABLE").appendField(new M(() => this.genColumnOpts_()), "COLUMN").appendField(
|
|
4324
|
+
new M([
|
|
4313
4325
|
["=", "EQ"],
|
|
4314
4326
|
["≠", "NEQ"],
|
|
4315
4327
|
["<", "LT"],
|
|
@@ -4371,7 +4383,7 @@ const Gf = {
|
|
|
4371
4383
|
onchange: function(e) {
|
|
4372
4384
|
if (e.type === me.STATE_CHANGE)
|
|
4373
4385
|
this.checkWarning_();
|
|
4374
|
-
else if (e.type ===
|
|
4386
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
4375
4387
|
const t = e;
|
|
4376
4388
|
t.blockId === this.id && t.element === "field" && (t.name === "SPACE" ? this.onSpaceChange_(t.newValue) : t.name === "TABLE" ? this.onTableChange_(t.newValue) : t.name === "COLUMN" && this.onColumnChange_(t.newValue));
|
|
4377
4389
|
}
|
|
@@ -4463,7 +4475,7 @@ k.cond_logic_item_v1 = Wf;
|
|
|
4463
4475
|
const Xf = {
|
|
4464
4476
|
init: function() {
|
|
4465
4477
|
this.itemCount_ = 1, this.appendValueInput("VALUE").setCheck("Condition").appendField(
|
|
4466
|
-
new
|
|
4478
|
+
new M([
|
|
4467
4479
|
["%{BKY_DATA_COND_LOGIC_TYPE_AND}", "AND"],
|
|
4468
4480
|
["%{BKY_DATA_COND_LOGIC_TYPE_OR}", "OR"]
|
|
4469
4481
|
]),
|
|
@@ -4719,7 +4731,7 @@ const Qf = {
|
|
|
4719
4731
|
}, this.table = {
|
|
4720
4732
|
id: "",
|
|
4721
4733
|
name: ""
|
|
4722
|
-
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_COLUMN_TITLE}").appendField(new
|
|
4734
|
+
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_COLUMN_TITLE}").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genTableOpts_()), "TABLE"), this.setMutator(
|
|
4723
4735
|
new en.MutatorIcon(
|
|
4724
4736
|
["select_column_item_v1"],
|
|
4725
4737
|
this
|
|
@@ -4772,7 +4784,7 @@ const Qf = {
|
|
|
4772
4784
|
var t;
|
|
4773
4785
|
if (e.type === me.STATE_CHANGE)
|
|
4774
4786
|
this.checkWarning_();
|
|
4775
|
-
else if (e.type ===
|
|
4787
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
4776
4788
|
const n = e;
|
|
4777
4789
|
if (n.blockId !== this.id)
|
|
4778
4790
|
return;
|
|
@@ -4839,11 +4851,11 @@ const Qf = {
|
|
|
4839
4851
|
}
|
|
4840
4852
|
this.itemCount_ = n.length, this.updateShape_();
|
|
4841
4853
|
try {
|
|
4842
|
-
|
|
4854
|
+
P.disable();
|
|
4843
4855
|
for (let i = 0; i < this.itemCount_; i++)
|
|
4844
4856
|
n[i] && this.setFieldValue(n[i], "COLUMN" + i), o[i] && this.setFieldValue(o[i], "ALIAS" + i);
|
|
4845
4857
|
} finally {
|
|
4846
|
-
|
|
4858
|
+
P.enable();
|
|
4847
4859
|
}
|
|
4848
4860
|
setTimeout(() => {
|
|
4849
4861
|
this.checkWarning_();
|
|
@@ -4866,7 +4878,7 @@ const Qf = {
|
|
|
4866
4878
|
this.removeInput("ADD" + e);
|
|
4867
4879
|
for (let e = 0; e < this.itemCount_; e++)
|
|
4868
4880
|
this.getInput("ADD" + e) || this.appendDummyInput("ADD" + e).setAlign(te.Align.RIGHT).appendField(
|
|
4869
|
-
new
|
|
4881
|
+
new M(() => this.genColumnOpts_()),
|
|
4870
4882
|
"COLUMN" + e
|
|
4871
4883
|
).appendField("%{BKY_DATA_AS}").appendField(
|
|
4872
4884
|
new qt(this.getFieldValue("COLUMN" + e)),
|
|
@@ -4914,7 +4926,7 @@ const em = {
|
|
|
4914
4926
|
}, this.table = {
|
|
4915
4927
|
id: "",
|
|
4916
4928
|
name: ""
|
|
4917
|
-
}, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_TABLE_TITLE}").appendField(new
|
|
4929
|
+
}, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_TABLE_TITLE}").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genTableOpts_()), "TABLE"), this.setOutput(!0, "SelectTable"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_DATA_V1_SELECT_TABLE_TOOLTIP}"), this.setHelpUrl("%{BKY_DATA_V1_SELECT_TABLE_HELPURL}"), this.initData_();
|
|
4918
4930
|
},
|
|
4919
4931
|
initData_: function() {
|
|
4920
4932
|
var i, s;
|
|
@@ -4952,7 +4964,7 @@ const em = {
|
|
|
4952
4964
|
onchange: function(e) {
|
|
4953
4965
|
if (e.type === me.STATE_CHANGE)
|
|
4954
4966
|
this.checkWarning_();
|
|
4955
|
-
else if (e.type ===
|
|
4967
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
4956
4968
|
const t = e;
|
|
4957
4969
|
if (t.blockId !== this.id)
|
|
4958
4970
|
return;
|
|
@@ -5022,7 +5034,7 @@ const om = {
|
|
|
5022
5034
|
}, this.table = {
|
|
5023
5035
|
id: "",
|
|
5024
5036
|
name: ""
|
|
5025
|
-
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_UPDATE_COLUMN_TITLE}").appendField(new
|
|
5037
|
+
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_UPDATE_COLUMN_TITLE}").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genTableOpts_()), "TABLE"), this.setMutator(
|
|
5026
5038
|
new en.MutatorIcon(
|
|
5027
5039
|
["update_column_item_v1"],
|
|
5028
5040
|
this
|
|
@@ -5074,7 +5086,7 @@ const om = {
|
|
|
5074
5086
|
onchange: function(e) {
|
|
5075
5087
|
if (e.type === me.STATE_CHANGE)
|
|
5076
5088
|
this.checkWarning_();
|
|
5077
|
-
else if (e.type ===
|
|
5089
|
+
else if (e.type === P.BLOCK_CHANGE) {
|
|
5078
5090
|
const t = e;
|
|
5079
5091
|
if (t.blockId !== this.id)
|
|
5080
5092
|
return;
|
|
@@ -5134,11 +5146,11 @@ const om = {
|
|
|
5134
5146
|
}
|
|
5135
5147
|
this.itemCount_ = n.length, this.updateShape_();
|
|
5136
5148
|
try {
|
|
5137
|
-
|
|
5149
|
+
P.disable();
|
|
5138
5150
|
for (let i = 0; i < this.itemCount_; i++)
|
|
5139
5151
|
this.setFieldValue(n[i], "COLUMN" + i);
|
|
5140
5152
|
} finally {
|
|
5141
|
-
|
|
5153
|
+
P.enable();
|
|
5142
5154
|
}
|
|
5143
5155
|
setTimeout(() => {
|
|
5144
5156
|
var i;
|
|
@@ -5167,7 +5179,7 @@ const om = {
|
|
|
5167
5179
|
this.removeInput("ADD" + e);
|
|
5168
5180
|
for (let e = 0; e < this.itemCount_; e++)
|
|
5169
5181
|
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(te.Align.RIGHT).appendField(
|
|
5170
|
-
new
|
|
5182
|
+
new M(() => this.genColumnOpts_()),
|
|
5171
5183
|
"COLUMN" + e
|
|
5172
5184
|
);
|
|
5173
5185
|
},
|
|
@@ -5780,11 +5792,11 @@ const gm = {
|
|
|
5780
5792
|
t.outputConnection,
|
|
5781
5793
|
n.outputConnection
|
|
5782
5794
|
)) {
|
|
5783
|
-
|
|
5795
|
+
P.setGroup(e.group);
|
|
5784
5796
|
const o = this.prevBlocks_[0];
|
|
5785
5797
|
o !== t && (t.unplug(), o && !o.isDisposed() && !o.isShadow() && this.getInput("A").connection.connect(o.outputConnection));
|
|
5786
5798
|
const i = this.prevBlocks_[1];
|
|
5787
|
-
i !== n && (n.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(),
|
|
5799
|
+
i !== n && (n.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), P.setGroup(!1);
|
|
5788
5800
|
}
|
|
5789
5801
|
this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
|
|
5790
5802
|
}
|
|
@@ -6126,7 +6138,7 @@ const Em = {
|
|
|
6126
6138
|
s && !s.workspace.connectionChecker.doTypeChecks(
|
|
6127
6139
|
s.outputConnection,
|
|
6128
6140
|
o
|
|
6129
|
-
) && (
|
|
6141
|
+
) && (P.setGroup(e.group), o === this.prevParentConnection_ ? (this.unplug(), o.getSourceBlock().bumpNeighbours()) : (s.unplug(), s.bumpNeighbours()), P.setGroup(!1));
|
|
6130
6142
|
}
|
|
6131
6143
|
this.prevParentConnection_ = o;
|
|
6132
6144
|
}
|
|
@@ -6216,16 +6228,16 @@ const vm = /* @__PURE__ */ new Set([
|
|
|
6216
6228
|
},
|
|
6217
6229
|
onchange: function(e) {
|
|
6218
6230
|
const t = this.workspace;
|
|
6219
|
-
if (!t.isDragging || t.isDragging() || e.type !==
|
|
6231
|
+
if (!t.isDragging || t.isDragging() || e.type !== P.BLOCK_MOVE && e.type !== P.BLOCK_CREATE)
|
|
6220
6232
|
return;
|
|
6221
6233
|
const n = this.getSurroundLoop();
|
|
6222
6234
|
if (this.setWarningText(
|
|
6223
6235
|
n ? null : g.LOOP_FLOW_CONTROL_WARNING
|
|
6224
6236
|
), !this.isInFlyout)
|
|
6225
6237
|
try {
|
|
6226
|
-
|
|
6238
|
+
P.setRecordUndo(!1), this.setDisabledReason(!n, "FLOW_CONTROL_NOT_IN_LOOP");
|
|
6227
6239
|
} finally {
|
|
6228
|
-
|
|
6240
|
+
P.setRecordUndo(!0);
|
|
6229
6241
|
}
|
|
6230
6242
|
}
|
|
6231
6243
|
};
|
|
@@ -7503,14 +7515,14 @@ const Lm = {
|
|
|
7503
7515
|
o.setKeyName(`__param@${t.id}__`, t.name, !1);
|
|
7504
7516
|
else
|
|
7505
7517
|
try {
|
|
7506
|
-
|
|
7518
|
+
P.disable(), o = Ts(
|
|
7507
7519
|
this.workspace,
|
|
7508
7520
|
`__param@${t.id}__`,
|
|
7509
7521
|
t.name,
|
|
7510
7522
|
!1
|
|
7511
7523
|
), o.outputConnection.connect(n);
|
|
7512
7524
|
} finally {
|
|
7513
|
-
|
|
7525
|
+
P.enable();
|
|
7514
7526
|
}
|
|
7515
7527
|
}
|
|
7516
7528
|
}
|
|
@@ -7543,7 +7555,7 @@ const Bm = G.xml, Rm = {
|
|
|
7543
7555
|
var t;
|
|
7544
7556
|
if (e.type === me.STATE_CHANGE)
|
|
7545
7557
|
this.checkWarning_();
|
|
7546
|
-
else if (e.type ===
|
|
7558
|
+
else if (e.type === P.BLOCK_DRAG) {
|
|
7547
7559
|
const n = e;
|
|
7548
7560
|
if (n.isStart || !((t = n.blocks) != null && t.find((o) => o.id === this.id)))
|
|
7549
7561
|
return;
|
|
@@ -7676,8 +7688,8 @@ const Um = {
|
|
|
7676
7688
|
}, this.resource = {
|
|
7677
7689
|
id: "",
|
|
7678
7690
|
name: ""
|
|
7679
|
-
}, this.appendDummyInput().appendField("%{BKY_RESOURCE_V1_SELECT_RESOURCE_TITLE").appendField(new
|
|
7680
|
-
new
|
|
7691
|
+
}, this.appendDummyInput().appendField("%{BKY_RESOURCE_V1_SELECT_RESOURCE_TITLE").appendField(new M(() => this.genSpaceOpts_()), "SPACE").appendField(new M(() => this.genDirOpts_()), "DIR").appendField(
|
|
7692
|
+
new M(() => this.genResourceOpts_()),
|
|
7681
7693
|
"RESOURCE"
|
|
7682
7694
|
), this.setOutput(!0, "Resource"), this.setStyle("resource_blocks"), this.setTooltip("%{BKY_RESOURCE_V1_SELECT_RESOURCE_TOOLTIP}"), this.setHelpUrl("%{BKY_RESOURCE_V1_SELECT_RESOURCE_HELPURL}"), this.initData_();
|
|
7683
7695
|
},
|
|
@@ -9116,7 +9128,7 @@ class tg {
|
|
|
9116
9128
|
const o = n.workspace;
|
|
9117
9129
|
if (!o)
|
|
9118
9130
|
return;
|
|
9119
|
-
o.setResizesEnabled(!1),
|
|
9131
|
+
o.setResizesEnabled(!1), P.setGroup(!0);
|
|
9120
9132
|
const i = o.getTopBlocks(!0);
|
|
9121
9133
|
let s = 0;
|
|
9122
9134
|
for (let a = 0, c; c = i[a]; a++) {
|
|
@@ -9125,7 +9137,7 @@ class tg {
|
|
|
9125
9137
|
const l = c.getRelativeToSurfaceXY();
|
|
9126
9138
|
c.moveBy(-l.x, s - l.y, ["cleanup"]), c.snapToGrid(), s = c.getRelativeToSurfaceXY().y + c.getHeightWidth().height + 100;
|
|
9127
9139
|
}
|
|
9128
|
-
|
|
9140
|
+
P.setGroup(!1), o.setResizesEnabled(!0);
|
|
9129
9141
|
});
|
|
9130
9142
|
}
|
|
9131
9143
|
}
|
|
@@ -12265,8 +12277,8 @@ function IT(e, t) {
|
|
|
12265
12277
|
o(i[l], c.getInput("ENTRY" + l).connection);
|
|
12266
12278
|
} else a === "json_string_v1" || a === "json_number_v1" ? c.setFieldValue(i, "VALUE") : a === "json_boolean_v1" && c.setFieldValue(i ? "true" : "false", "VALUE");
|
|
12267
12279
|
};
|
|
12268
|
-
o(e, n.getInput("JSON").connection),
|
|
12269
|
-
new (
|
|
12280
|
+
o(e, n.getInput("JSON").connection), P.fire(
|
|
12281
|
+
new (P.get(P.FINISHED_LOADING))(t)
|
|
12270
12282
|
);
|
|
12271
12283
|
}
|
|
12272
12284
|
function OT(e) {
|
|
@@ -12358,7 +12370,7 @@ const yT = { class: "position-relative w-100 h-100" }, bT = /* @__PURE__ */ lt({
|
|
|
12358
12370
|
console.assert(!1);
|
|
12359
12371
|
return;
|
|
12360
12372
|
}
|
|
12361
|
-
Kc(l.value), await La(e.locale), _.workspace = TT(c.value, e.type, e.version, e.dark), _.workspace.addChangeListener(
|
|
12373
|
+
Kc(l.value), await La(e.locale), _.workspace = TT(c.value, e.type, e.version, e.dark), _.workspace.addChangeListener(P.disableOrphans), _.workspace.addChangeListener(oe);
|
|
12362
12374
|
const L = document.querySelector(`#${a} .blocklyFlyout`);
|
|
12363
12375
|
new MutationObserver((Ae) => {
|
|
12364
12376
|
Ae.forEach((De) => {
|
|
@@ -12371,16 +12383,16 @@ const yT = { class: "position-relative w-100 h-100" }, bT = /* @__PURE__ */ lt({
|
|
|
12371
12383
|
_.workspace && Hc(_.workspace);
|
|
12372
12384
|
});
|
|
12373
12385
|
async function oe(L) {
|
|
12374
|
-
if (L.type ===
|
|
12386
|
+
if (L.type === P.FINISHED_LOADING) {
|
|
12375
12387
|
al(), e.type !== "json" && Ze.emit("codeUpdate"), d.value = !1;
|
|
12376
12388
|
return;
|
|
12377
12389
|
}
|
|
12378
12390
|
if (!d.value) {
|
|
12379
|
-
if (L.type ===
|
|
12391
|
+
if (L.type === P.VIEWPORT_CHANGE) {
|
|
12380
12392
|
i.value = _.workspace.getScale();
|
|
12381
12393
|
return;
|
|
12382
12394
|
}
|
|
12383
|
-
L.type ===
|
|
12395
|
+
L.type === P.BLOCK_DRAG && (L.isStart ? h.value = !0 : h.value = !1), e.type !== "json" && Ze.emit("codeUpdate");
|
|
12384
12396
|
}
|
|
12385
12397
|
}
|
|
12386
12398
|
const ge = (L) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.42",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"vue-draggable-plus": "^0.6.0",
|
|
33
33
|
"vuetify": "^3.8.1",
|
|
34
34
|
"x-essential-lib": "^0.8.7",
|
|
35
|
-
"x-runtime-lib": "^0.6.
|
|
35
|
+
"x-runtime-lib": "^0.6.47",
|
|
36
36
|
"x-state-lib": "^0.2.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|