x-block-lib 0.8.12 → 0.8.14
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 +483 -462
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
License: see project LICENSE
|
|
8
8
|
Touched: 2021
|
|
9
9
|
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.ghost[data-v-4cd8352a]{opacity:.4;pointer-events:none}.blocklyToolbox{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:12px!important}.blocklyToolboxCategoryIcon{display:none!important}.blocklyTreeRowContentContainer{height:28px;display:flex;align-items:center;justify-items:center;overflow:hidden}.blocklyFlyout{z-index:21}`)),document.head.appendChild(l)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
10
|
-
import { provide as lo, inject as _o, defineComponent as st, resolveComponent as D, createBlock as Z, openBlock as
|
|
11
|
-
import { f as go, F as
|
|
12
|
-
import { globalObjects as nt, openConfirmDlg as Yo, openPromptDlg as wo, messageWarning as
|
|
10
|
+
import { provide as lo, inject as _o, defineComponent as st, resolveComponent as D, createBlock as Z, openBlock as b, unref as R, withCtx as tt, createVNode as L, mergeProps as $e, useModel as Rt, ref as It, computed as Y, resolveDirective as po, withDirectives as ho, createElementBlock as Q, normalizeStyle as H, createElementVNode as W, toDisplayString as re, withModifiers as Bt, mergeModels as Pe, Fragment as gn, renderList as fo, useId as Re, onUnmounted as mo, useTemplateRef as bt, withKeys as An, isRef as $t, createCommentVNode as mt, onMounted as on, nextTick as To, onBeforeUnmount as sn, watch as Lt, renderSlot as Eo } from "vue";
|
|
11
|
+
import { f as go, F as In, E as I, r as an, M as On, s as Ao, a as Io, X as Cn, u as v, B as d, j as s, O as c, b as De, i as C, c as ht, d as Oo, e as M, g as h, h as Co, k as w, l as lt, p as Pt, m as z, n as cn, o as S, C as vn, N as et, q as vo, P as Me, t as ve, V as At, v as Ut, w as yn, x as yo, y as ko, S as No, z as Lo, A as So, T as ue, D as kn, G as Bo, H as bo, I as Nn, J as Po, K as Ro, L as Do, Q as Mo, R as Uo, U as Vo, W as xo, Y as Fo } from "./vendor.cenq5uur.js";
|
|
12
|
+
import { globalObjects as nt, openConfirmDlg as Yo, openPromptDlg as wo, messageWarning as Ln, useColor as Vt, useSystem as Sn, useViewStack as He, eventBus as gt } from "x-essential-lib";
|
|
13
13
|
import { elements as J, pkgs as Gt, parsePixelStr as Ko, parsePercentStr as $o, getPropTag as kt, makeTriggerId as Tt } from "x-runtime-lib";
|
|
14
14
|
import { globalState as f } from "x-state-lib";
|
|
15
15
|
import { useI18n as xt } from "vue-i18n";
|
|
16
16
|
import { useDisplay as Ho } from "vuetify";
|
|
17
|
-
function
|
|
17
|
+
function le(t, e) {
|
|
18
18
|
const { i18n: n } = nt;
|
|
19
19
|
let o = "";
|
|
20
20
|
if (e === "regular")
|
|
@@ -50,7 +50,7 @@ function Ge(t, e) {
|
|
|
50
50
|
console.assert(!1);
|
|
51
51
|
return o;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Bn(t, e) {
|
|
54
54
|
const { i18n: n } = nt;
|
|
55
55
|
let o = "";
|
|
56
56
|
if (e === "regular")
|
|
@@ -68,7 +68,7 @@ function Sn(t, e) {
|
|
|
68
68
|
console.assert(!1);
|
|
69
69
|
return o;
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class O extends In {
|
|
72
72
|
constructor(e, n, o) {
|
|
73
73
|
super(e, n, o);
|
|
74
74
|
}
|
|
@@ -98,10 +98,10 @@ class I extends An {
|
|
|
98
98
|
}
|
|
99
99
|
} else if (this.name === "PROP") {
|
|
100
100
|
const { names: o, from: i } = n.prop;
|
|
101
|
-
return
|
|
101
|
+
return Bn(o, i);
|
|
102
102
|
} else if (this.name === "EVENT") {
|
|
103
103
|
const { names: o, from: i } = n.event;
|
|
104
|
-
return
|
|
104
|
+
return le(o, i);
|
|
105
105
|
} else if (this.name === "METHOD") {
|
|
106
106
|
const { names: o, from: i } = n.prop;
|
|
107
107
|
return Ge(o, i);
|
|
@@ -124,31 +124,31 @@ class I extends An {
|
|
|
124
124
|
return "<n/a>";
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
go.register("field_dropdown2",
|
|
128
|
-
var
|
|
129
|
-
class
|
|
127
|
+
go.register("field_dropdown2", O);
|
|
128
|
+
var B = /* @__PURE__ */ ((t) => (t.STATE_CHANGE = "state_change", t))(B || {});
|
|
129
|
+
class bn extends I.Abstract {
|
|
130
130
|
isBlank = !0;
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
an.register(
|
|
133
|
+
an.Type.EVENT,
|
|
134
134
|
"state_change",
|
|
135
|
-
|
|
135
|
+
bn
|
|
136
136
|
);
|
|
137
|
-
const
|
|
137
|
+
const Pn = (t, e, n) => {
|
|
138
138
|
const o = t[e];
|
|
139
139
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((i, a) => {
|
|
140
140
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(a.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : ""))));
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
async function
|
|
144
|
-
const e = await
|
|
143
|
+
async function rn(t) {
|
|
144
|
+
const e = await Pn(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en.jq2w67rd.js"), "./msg/zhHans.ts": () => import("./msg-zhHans.hsanc2zi.js") }), `./msg/${t}.ts`, 3);
|
|
145
145
|
Ao(e.default);
|
|
146
146
|
}
|
|
147
147
|
function p(t) {
|
|
148
|
-
return
|
|
148
|
+
return On[t] ?? t;
|
|
149
149
|
}
|
|
150
150
|
const Ot = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==", Wt = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K";
|
|
151
|
-
function
|
|
151
|
+
function _e(t) {
|
|
152
152
|
const e = t.lastIndexOf("V");
|
|
153
153
|
if (e <= 0 || e >= t.length - 1)
|
|
154
154
|
return console.assert(!1, `invalid key=${t}`), "";
|
|
@@ -171,26 +171,26 @@ function Go(t) {
|
|
|
171
171
|
e++, t = t.getParent();
|
|
172
172
|
return e;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Rn(t) {
|
|
175
175
|
return t.ui === "strInput" ? "string" : t.ui === "numInput" ? "number" : t.ui === "switch" ? "boolean" : "string";
|
|
176
176
|
}
|
|
177
177
|
function Xt(t, e) {
|
|
178
178
|
return !!(t.startsWith("basic.") || !e.ui || e.readonly);
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function ye(t) {
|
|
181
181
|
const e = `<block type="text_v1"><field name="TEXT">${t}</field></block>`;
|
|
182
|
-
return
|
|
182
|
+
return v.xml.textToDom(e);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function un(t) {
|
|
185
185
|
const e = `<block type="math_number_v1"><field name="NUM">${t}</field></block>`;
|
|
186
|
-
return
|
|
186
|
+
return v.xml.textToDom(e);
|
|
187
187
|
}
|
|
188
188
|
function Wo(t) {
|
|
189
|
-
return
|
|
189
|
+
return v.xml.textToDom('<block type="logic_boolean_v1"><field name="BOOL">FALSE</field></block>');
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ue(t, e) {
|
|
192
192
|
let n = null;
|
|
193
|
-
return e === "string" ? n =
|
|
193
|
+
return e === "string" ? n = ye("") : e === "integer" || e === "decimal" ? n = un(0) : e === "boolean" ? n = Wo() : e === "enum" || e === "dateTime" ? n = ye("") : console.assert(!1), n ? Cn.domToBlock(n, t) : null;
|
|
194
194
|
}
|
|
195
195
|
function ot(t) {
|
|
196
196
|
return t === "string" ? "String" : t === "number" ? "Number" : t === "boolean" ? "Boolean" : t === "array" ? "Array" : t === "object" ? "Object" : (console.assert(!1), null);
|
|
@@ -198,7 +198,7 @@ function ot(t) {
|
|
|
198
198
|
function jo(t) {
|
|
199
199
|
return t.ui === "dummy" ? null : t.ui === "strInput" ? "String" : t.ui === "numInput" ? "Number" : t.ui === "switch" ? "Boolean" : t.ui === "select" ? jt(t.items) : t.ui === "multiTypes" ? jt(t.types) : t.ui === "compSelect" ? "Comp" : t.ui === "colorPicker" ? "Color" : (console.assert(!1), null);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Dn(t) {
|
|
202
202
|
return t === "string" ? "String" : t === "integer" || t === "decimal" ? "Number" : t === "boolean" ? "Boolean" : t === "enum" || t === "dateTime" ? "String" : (console.assert(!1), null);
|
|
203
203
|
}
|
|
204
204
|
function We(t, e, n, o) {
|
|
@@ -206,12 +206,12 @@ function We(t, e, n, o) {
|
|
|
206
206
|
<block type="parameter_v1">
|
|
207
207
|
<mutation key="${e}" name="${n}" locale="${o ? "TRUE" : "FALSE"}"/>
|
|
208
208
|
</block>
|
|
209
|
-
`, a =
|
|
210
|
-
return
|
|
209
|
+
`, a = v.xml.textToDom(i);
|
|
210
|
+
return Cn.domToBlock(a, t);
|
|
211
211
|
}
|
|
212
212
|
function F(t, e) {
|
|
213
213
|
try {
|
|
214
|
-
|
|
214
|
+
I.disable(), e.forEach((n) => {
|
|
215
215
|
const [o, i, a, r] = n, u = t.getInput(o)?.connection;
|
|
216
216
|
if (!u)
|
|
217
217
|
return;
|
|
@@ -230,41 +230,41 @@ function F(t, e) {
|
|
|
230
230
|
), l.outputConnection.connect(u);
|
|
231
231
|
});
|
|
232
232
|
} finally {
|
|
233
|
-
|
|
233
|
+
I.enable();
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
function ut(t) {
|
|
237
237
|
const e = `<shadow type="text_v1"><field name="TEXT">${t}</field></shadow>`;
|
|
238
|
-
return
|
|
238
|
+
return v.xml.textToDom(e);
|
|
239
239
|
}
|
|
240
240
|
function Jt(t) {
|
|
241
241
|
const e = `<shadow type="math_number_v1"><field name="NUM">${t}</field></shadow>`;
|
|
242
|
-
return
|
|
242
|
+
return v.xml.textToDom(e);
|
|
243
243
|
}
|
|
244
244
|
function qt(t) {
|
|
245
245
|
const e = `<shadow type="logic_boolean_v1"><field name="BOOL">${t ? "TRUE" : "FALSE"}</field></shadow>`;
|
|
246
|
-
return
|
|
246
|
+
return v.xml.textToDom(e);
|
|
247
247
|
}
|
|
248
248
|
function Xo() {
|
|
249
|
-
return
|
|
249
|
+
return v.xml.textToDom('<shadow type="list_create_v1"></shadow>');
|
|
250
250
|
}
|
|
251
251
|
function Jo() {
|
|
252
|
-
return
|
|
252
|
+
return v.xml.textToDom('<shadow type="object_create_v1"></shadow>');
|
|
253
253
|
}
|
|
254
254
|
function qo(t) {
|
|
255
|
-
const e = `<shadow type="${
|
|
256
|
-
return
|
|
255
|
+
const e = `<shadow type="${_e(t)}"></shadow>`;
|
|
256
|
+
return v.xml.textToDom(e);
|
|
257
257
|
}
|
|
258
258
|
function Qo(t) {
|
|
259
|
-
const e = `<shadow type="${
|
|
260
|
-
return
|
|
259
|
+
const e = `<shadow type="${_e(t)}"></shadow>`;
|
|
260
|
+
return v.xml.textToDom(e);
|
|
261
261
|
}
|
|
262
262
|
function zo(t) {
|
|
263
263
|
const e = `<shadow type="color_picker_v1"><field name="COLOR">${t}</field></shadow>`;
|
|
264
|
-
return
|
|
264
|
+
return v.xml.textToDom(e);
|
|
265
265
|
}
|
|
266
266
|
function Zo() {
|
|
267
|
-
return
|
|
267
|
+
return v.xml.textToDom('<shadow type="select_comp_v1"></shadow>');
|
|
268
268
|
}
|
|
269
269
|
function it(t) {
|
|
270
270
|
let e = null;
|
|
@@ -281,7 +281,7 @@ function ei() {
|
|
|
281
281
|
n.push({ key: o, name: i, type: a });
|
|
282
282
|
return n;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function ln(t) {
|
|
285
285
|
const { activeObject: e, activePage: n } = f.app;
|
|
286
286
|
if (e.type === "page") {
|
|
287
287
|
const o = n.meta.arguments.find((i) => i.id === t);
|
|
@@ -306,7 +306,7 @@ const oi = {
|
|
|
306
306
|
name: "",
|
|
307
307
|
type: "string"
|
|
308
308
|
}, this.appendDummyInput().appendField("%{BKY_APP_V1_GET_PAGE_ARGUMENT_TITLE}").appendField(
|
|
309
|
-
new
|
|
309
|
+
new O(() => this.genArgumentOpts_()),
|
|
310
310
|
"ARGUMENT"
|
|
311
311
|
), this.setOutput(!0, null), this.setStyle("variable_blocks"), this.setTooltip("%{BKY_APP_V1_GET_PAGE_ARGUMENT_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_GET_PAGE_ARGUMENT_HELPURL}");
|
|
312
312
|
},
|
|
@@ -324,9 +324,9 @@ const oi = {
|
|
|
324
324
|
return ni();
|
|
325
325
|
},
|
|
326
326
|
onchange: function(t) {
|
|
327
|
-
if (t.type ===
|
|
327
|
+
if (t.type === B.STATE_CHANGE)
|
|
328
328
|
this.checkWarning_();
|
|
329
|
-
else if (t.type ===
|
|
329
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
330
330
|
const e = t;
|
|
331
331
|
e.blockId === this.id && (e.element === "field" && e.name === "ARGUMENT" && this.onArgumentChange_(e.newValue), setTimeout(() => {
|
|
332
332
|
this.checkWarning_();
|
|
@@ -334,7 +334,7 @@ const oi = {
|
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
336
|
onArgumentChange_: function(t) {
|
|
337
|
-
const e =
|
|
337
|
+
const e = ln(t);
|
|
338
338
|
if (!e) {
|
|
339
339
|
console.assert(!1);
|
|
340
340
|
return;
|
|
@@ -345,7 +345,7 @@ const oi = {
|
|
|
345
345
|
this.setOutput(!0, ot(this.argument.type));
|
|
346
346
|
},
|
|
347
347
|
checkWarning_: function() {
|
|
348
|
-
const t =
|
|
348
|
+
const t = ln(this.argument.key);
|
|
349
349
|
if (!t) {
|
|
350
350
|
this.setWarningText(p("WARN_ARGUMENT_NOT_FOUND"));
|
|
351
351
|
return;
|
|
@@ -363,11 +363,11 @@ s.forBlock.get_page_argument_v1 = function(t) {
|
|
|
363
363
|
return [`__getPageArgumentV1__(${s.quote_(e.argument.key)})`, c.FUNCTION_CALL];
|
|
364
364
|
};
|
|
365
365
|
const ii = (t, e) => {
|
|
366
|
-
const n =
|
|
366
|
+
const n = _e(t), o = jt(t);
|
|
367
367
|
d[n] = {
|
|
368
368
|
init: function() {
|
|
369
369
|
this.appendDummyInput().appendField(
|
|
370
|
-
new
|
|
370
|
+
new O(() => this.genOpts_()),
|
|
371
371
|
"ITEM"
|
|
372
372
|
), this.setOutput(!0, o), this.setStyle("property_blocks"), this.setTooltip(""), this.setHelpUrl("");
|
|
373
373
|
},
|
|
@@ -388,11 +388,11 @@ for (const t in Gt) {
|
|
|
388
388
|
ii(n, e.items[n]);
|
|
389
389
|
}
|
|
390
390
|
const si = (t, e) => {
|
|
391
|
-
const n =
|
|
391
|
+
const n = _e(t), o = jt(t);
|
|
392
392
|
d[n] = {
|
|
393
393
|
init: function() {
|
|
394
394
|
this.value = e[0].default ?? "", this.appendDummyInput("DUMMY").appendField(
|
|
395
|
-
new
|
|
395
|
+
new O(() => this.genOpts_()),
|
|
396
396
|
"TYPE"
|
|
397
397
|
), this.setOutput(!0, o), this.setStyle("property_blocks"), this.setTooltip(""), this.setHelpUrl(""), this.updateShape_();
|
|
398
398
|
},
|
|
@@ -411,9 +411,9 @@ const si = (t, e) => {
|
|
|
411
411
|
return k(a);
|
|
412
412
|
},
|
|
413
413
|
onchange: function(i) {
|
|
414
|
-
if (i.type ===
|
|
414
|
+
if (i.type === B.STATE_CHANGE)
|
|
415
415
|
this.checkWarning_();
|
|
416
|
-
else if (i.type ===
|
|
416
|
+
else if (i.type === I.BLOCK_CHANGE) {
|
|
417
417
|
const a = i;
|
|
418
418
|
a.blockId === this.id && (a.element === "field" && a.name === "TYPE" && this.onTypeChange_(a.newValue), setTimeout(() => {
|
|
419
419
|
this.checkWarning_();
|
|
@@ -441,7 +441,7 @@ const si = (t, e) => {
|
|
|
441
441
|
let u, l;
|
|
442
442
|
if (r.ui === "pixelInput") {
|
|
443
443
|
const _ = Ko(this.value) ?? 0;
|
|
444
|
-
u = new
|
|
444
|
+
u = new De(
|
|
445
445
|
_,
|
|
446
446
|
r.min,
|
|
447
447
|
r.max,
|
|
@@ -452,7 +452,7 @@ const si = (t, e) => {
|
|
|
452
452
|
), l = "px";
|
|
453
453
|
} else if (r.ui === "percentInput") {
|
|
454
454
|
const _ = $o(this.value) ?? 0;
|
|
455
|
-
u = new
|
|
455
|
+
u = new De(
|
|
456
456
|
_,
|
|
457
457
|
r.min,
|
|
458
458
|
r.max,
|
|
@@ -482,7 +482,7 @@ for (const t in Gt) {
|
|
|
482
482
|
for (const n in e.types)
|
|
483
483
|
si(n, e.types[n]);
|
|
484
484
|
}
|
|
485
|
-
const ai =
|
|
485
|
+
const ai = v.xml, ci = {
|
|
486
486
|
init: function() {
|
|
487
487
|
this.appendDummyInput().appendField(
|
|
488
488
|
"%{BKY_APP_V1_APP_BIND_CONTAINER_TITLE}"
|
|
@@ -584,7 +584,7 @@ const ui = {
|
|
|
584
584
|
"Boolean",
|
|
585
585
|
"Array",
|
|
586
586
|
"Object"
|
|
587
|
-
]), t === 0 && this.getInput("ADD" + t).setAlign(
|
|
587
|
+
]), t === 0 && this.getInput("ADD" + t).setAlign(C.Align.RIGHT).appendField("%{BKY_APP_V1_APP_BIND_TITLE}"));
|
|
588
588
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
589
589
|
this.removeInput("ADD" + t);
|
|
590
590
|
},
|
|
@@ -618,49 +618,49 @@ d.app_bind_v1 = ui;
|
|
|
618
618
|
s.forBlock.app_bind_v1 = function() {
|
|
619
619
|
return "";
|
|
620
620
|
};
|
|
621
|
-
function
|
|
621
|
+
function Mn() {
|
|
622
622
|
return f.app.appList;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function _n(t) {
|
|
625
625
|
return f.app.appList.find((e) => e.id === t);
|
|
626
626
|
}
|
|
627
627
|
function li() {
|
|
628
628
|
const t = [];
|
|
629
|
-
return
|
|
629
|
+
return Mn().forEach(({ id: n, name: o }) => {
|
|
630
630
|
t.push([o, n]);
|
|
631
631
|
}), k(t);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Ve(t) {
|
|
634
634
|
const e = f.app.appList.find((n) => n.id === t);
|
|
635
635
|
return e ? e.pages : [];
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function ke(t, e) {
|
|
638
638
|
const n = f.app.appList.find((o) => o.id === t);
|
|
639
639
|
if (n)
|
|
640
640
|
return n.pages.find((o) => o.id === e);
|
|
641
641
|
}
|
|
642
642
|
function _i(t) {
|
|
643
643
|
const e = [];
|
|
644
|
-
return
|
|
644
|
+
return Ve(t).forEach(({ id: o, name: i }) => {
|
|
645
645
|
e.push([i, o]);
|
|
646
646
|
}), k(e);
|
|
647
647
|
}
|
|
648
|
-
const
|
|
648
|
+
const Un = {
|
|
649
649
|
id: "",
|
|
650
650
|
groupid: "",
|
|
651
651
|
name: "",
|
|
652
652
|
position: 0
|
|
653
653
|
};
|
|
654
|
-
function
|
|
654
|
+
function Vn() {
|
|
655
655
|
const { comps: t } = f.app.activeApp;
|
|
656
|
-
return [
|
|
656
|
+
return [Un, ...t];
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return t === "" ?
|
|
658
|
+
function pn(t) {
|
|
659
|
+
return t === "" ? Un : f.app.activeApp.comps.find((e) => e.id === t);
|
|
660
660
|
}
|
|
661
661
|
function pi() {
|
|
662
662
|
const { i18n: t } = nt, e = [];
|
|
663
|
-
return
|
|
663
|
+
return Vn().forEach(({ id: o, name: i }) => {
|
|
664
664
|
let a = i;
|
|
665
665
|
o === "" && (a = t.global.t("x-runtime-lib.notSet")), e.push([a, o]);
|
|
666
666
|
}), k(e);
|
|
@@ -668,7 +668,7 @@ function pi() {
|
|
|
668
668
|
function hi(t) {
|
|
669
669
|
return t === "regular" || t === "property";
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function xe(t) {
|
|
672
672
|
const { props: e } = f.runtime, { activeObject: n } = f.app, o = [], i = kt(n.type, n.subtype);
|
|
673
673
|
if (!i)
|
|
674
674
|
return o;
|
|
@@ -689,7 +689,7 @@ function Ve(t) {
|
|
|
689
689
|
for (const { keys: u, names: l, raw: _ } of e[r.key][i]) {
|
|
690
690
|
if (Xt(u, _))
|
|
691
691
|
continue;
|
|
692
|
-
const T =
|
|
692
|
+
const T = Rn(_);
|
|
693
693
|
o.push({
|
|
694
694
|
key: u,
|
|
695
695
|
names: l,
|
|
@@ -702,7 +702,7 @@ function Ve(t) {
|
|
|
702
702
|
}
|
|
703
703
|
return r.key.startsWith("globality_v") && n.type, o;
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Ne(t, e) {
|
|
706
706
|
const { props: n } = f.runtime, { activeObject: o } = f.app, i = kt(o.type, o.subtype);
|
|
707
707
|
if (!i)
|
|
708
708
|
return;
|
|
@@ -725,7 +725,7 @@ function ke(t, e) {
|
|
|
725
725
|
if (r.key.startsWith("single_ref_v") && console.log("singleRef"), r.key.startsWith("multiple_ref_v") && console.log("multipleRef"), n[r.key] && n[r.key][i]) {
|
|
726
726
|
const l = n[r.key][i].find((_) => _.keys === e);
|
|
727
727
|
if (l) {
|
|
728
|
-
const _ =
|
|
728
|
+
const _ = Rn(l.raw);
|
|
729
729
|
return {
|
|
730
730
|
key: l.keys,
|
|
731
731
|
names: l.names,
|
|
@@ -740,12 +740,12 @@ function ke(t, e) {
|
|
|
740
740
|
r.key.startsWith("globality_v") && o.type;
|
|
741
741
|
}
|
|
742
742
|
function di(t) {
|
|
743
|
-
const e = [], n =
|
|
743
|
+
const e = [], n = xe(t);
|
|
744
744
|
for (const { key: o, names: i, from: a } of n)
|
|
745
|
-
e.push([
|
|
745
|
+
e.push([le(i, a), o]);
|
|
746
746
|
return k(e);
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function xn() {
|
|
749
749
|
const { activeObject: t, activeComp: e } = f.app, n = [];
|
|
750
750
|
if (t.type === "comp")
|
|
751
751
|
for (const o of e.meta.events) {
|
|
@@ -761,7 +761,7 @@ function Vn() {
|
|
|
761
761
|
}
|
|
762
762
|
return n;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function hn(t) {
|
|
765
765
|
const { activeObject: e, activeComp: n } = f.app;
|
|
766
766
|
if (e.type === "comp") {
|
|
767
767
|
const o = n.meta.events.find(
|
|
@@ -781,15 +781,15 @@ function pn(t) {
|
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
783
|
function fi() {
|
|
784
|
-
const t = [], e =
|
|
784
|
+
const t = [], e = xn();
|
|
785
785
|
for (const { key: n, names: o, from: i } of e)
|
|
786
|
-
t.push([
|
|
786
|
+
t.push([le(o, i), n]);
|
|
787
787
|
return k(t);
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Fn(t) {
|
|
790
790
|
return t === "regular" || t === "slot";
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function Fe(t) {
|
|
793
793
|
const { activeObject: e } = f.app, n = [], o = e.nodes.find((a) => a.id === t);
|
|
794
794
|
if (!o)
|
|
795
795
|
return n;
|
|
@@ -806,7 +806,7 @@ function xe(t) {
|
|
|
806
806
|
});
|
|
807
807
|
return i.key.startsWith("single_ref_v") && console.log("singleRef"), i.key.startsWith("multiple_ref_v") && console.log("multipleRef"), i.key.startsWith("globality_v") && e.type, n;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function Le(t, e) {
|
|
810
810
|
const { activeObject: n } = f.app, o = n.nodes.find((r) => r.id === t);
|
|
811
811
|
if (!o)
|
|
812
812
|
return;
|
|
@@ -827,7 +827,7 @@ function Ne(t, e) {
|
|
|
827
827
|
i.key.startsWith("single_ref_v") && console.log("singleRef"), i.key.startsWith("multiple_ref_v") && console.log("multipleRef"), i.key.startsWith("globality_v") && n.type;
|
|
828
828
|
}
|
|
829
829
|
function mi(t) {
|
|
830
|
-
const e = [], n =
|
|
830
|
+
const e = [], n = Fe(t);
|
|
831
831
|
for (const { key: o, names: i, from: a } of n)
|
|
832
832
|
e.push([Ge(i, a), o]);
|
|
833
833
|
return k(e);
|
|
@@ -875,28 +875,28 @@ function yt(t) {
|
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function Yn() {
|
|
879
879
|
const t = [], e = je();
|
|
880
880
|
for (const { key: n, names: o, from: i } of e)
|
|
881
881
|
t.push([Ge(o, i), n]);
|
|
882
882
|
return k(t);
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Ye(t) {
|
|
885
885
|
const e = yt(t);
|
|
886
886
|
return e ? e.outputs : [];
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Se(t, e) {
|
|
889
889
|
const n = yt(t);
|
|
890
890
|
if (n)
|
|
891
891
|
return n.outputs.find((o) => o.key === e);
|
|
892
892
|
}
|
|
893
893
|
function Ti(t) {
|
|
894
|
-
const e = [], n =
|
|
894
|
+
const e = [], n = Ye(t);
|
|
895
895
|
for (const { name: o, key: i } of n)
|
|
896
896
|
e.push([o, i]);
|
|
897
897
|
return k(e);
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function wn(t, e, n) {
|
|
900
900
|
if (!n)
|
|
901
901
|
return !1;
|
|
902
902
|
const { props: o } = f.runtime, { activeObject: i, activeComp: a } = f.app;
|
|
@@ -934,7 +934,7 @@ function G(t) {
|
|
|
934
934
|
console.assert(!1, "invalid element", o.key);
|
|
935
935
|
continue;
|
|
936
936
|
}
|
|
937
|
-
if (!
|
|
937
|
+
if (!wn(i, n, t))
|
|
938
938
|
return !0;
|
|
939
939
|
}
|
|
940
940
|
return !1;
|
|
@@ -949,7 +949,7 @@ function Ft(t) {
|
|
|
949
949
|
console.assert(!1, "invalid element", i.key);
|
|
950
950
|
continue;
|
|
951
951
|
}
|
|
952
|
-
|
|
952
|
+
wn(a, o, t) || n.push({
|
|
953
953
|
id: i.id,
|
|
954
954
|
key: i.key,
|
|
955
955
|
name: a.name,
|
|
@@ -974,7 +974,7 @@ function _t(t) {
|
|
|
974
974
|
alias: n.alias
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function pe(t) {
|
|
978
978
|
const { i18n: e } = nt, n = [], o = Ft(t);
|
|
979
979
|
for (const { id: i, name: a, alias: r } of o) {
|
|
980
980
|
let u = e.global.t(a);
|
|
@@ -1053,17 +1053,17 @@ function Et(t, e) {
|
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function Kn(t, e) {
|
|
1057
1057
|
const n = [], o = Dt(t, e);
|
|
1058
1058
|
for (const { key: i, names: a, meta: r } of o)
|
|
1059
|
-
n.push([
|
|
1059
|
+
n.push([Bn(a, r.from), i]);
|
|
1060
1060
|
return k(n);
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function Xe() {
|
|
1063
1063
|
const { activeObject: t, activePage: e, activeComp: n } = f.app;
|
|
1064
1064
|
return t.type === "page" ? e.meta.states : t.type === "comp" ? n.meta.states : [];
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Qt(t) {
|
|
1067
1067
|
const { activeObject: e, activePage: n, activeComp: o } = f.app;
|
|
1068
1068
|
if (e.type === "page")
|
|
1069
1069
|
return n.meta.states.find((i) => i.id === t);
|
|
@@ -1071,7 +1071,7 @@ function Ye(t) {
|
|
|
1071
1071
|
return o.meta.states.find((i) => i.id === t);
|
|
1072
1072
|
}
|
|
1073
1073
|
function $n() {
|
|
1074
|
-
const t = [], e =
|
|
1074
|
+
const t = [], e = Xe();
|
|
1075
1075
|
for (const { id: n, name: o } of e)
|
|
1076
1076
|
t.push([o, n]);
|
|
1077
1077
|
return k(t);
|
|
@@ -1087,7 +1087,7 @@ const Ei = {
|
|
|
1087
1087
|
names: [],
|
|
1088
1088
|
from: "regular",
|
|
1089
1089
|
params: []
|
|
1090
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_ON_APP_EVENT_TITLE}").appendField(new
|
|
1090
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_ON_APP_EVENT_TITLE}").appendField(new O(() => this.genNodeOpts_()), "NODE").appendField(new O(() => this.genEventOpts_()), "EVENT"), this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.setStyle("event_blocks"), this.setTooltip("%{BKY_APP_V1_ON_APP_EVENT_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_ON_APP_EVENT_HELPURL}"), this.initData_();
|
|
1091
1091
|
},
|
|
1092
1092
|
initData_: function() {
|
|
1093
1093
|
if (this.node.id)
|
|
@@ -1098,7 +1098,7 @@ const Ei = {
|
|
|
1098
1098
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
1099
1099
|
const e = this.getField("NODE");
|
|
1100
1100
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
1101
|
-
const n =
|
|
1101
|
+
const n = xe(this.node.id)?.[0];
|
|
1102
1102
|
if (!n)
|
|
1103
1103
|
return;
|
|
1104
1104
|
this.event.key = n.key, this.event.names = n.names, this.event.from = n.from, this.event.params = n.params;
|
|
@@ -1117,15 +1117,15 @@ const Ei = {
|
|
|
1117
1117
|
}, 0);
|
|
1118
1118
|
},
|
|
1119
1119
|
genNodeOpts_: function() {
|
|
1120
|
-
return
|
|
1120
|
+
return pe("onEvent");
|
|
1121
1121
|
},
|
|
1122
1122
|
genEventOpts_: function() {
|
|
1123
1123
|
return di(this.node.id);
|
|
1124
1124
|
},
|
|
1125
1125
|
onchange: function(t) {
|
|
1126
|
-
if (t.type ===
|
|
1126
|
+
if (t.type === B.STATE_CHANGE)
|
|
1127
1127
|
this.checkWarning_();
|
|
1128
|
-
else if (t.type ===
|
|
1128
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1129
1129
|
const e = t;
|
|
1130
1130
|
e.blockId === this.id && (e.element === "field" && (e.name === "NODE" ? this.onNodeChange_(e.newValue) : e.name === "EVENT" && this.onEventChange_(e.newValue)), setTimeout(() => {
|
|
1131
1131
|
this.checkWarning_();
|
|
@@ -1141,14 +1141,14 @@ const Ei = {
|
|
|
1141
1141
|
const n = this.node.key !== e.key;
|
|
1142
1142
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
1143
1143
|
const o = this.getField("EVENT");
|
|
1144
|
-
if (o.getOptions(!1), n || !
|
|
1145
|
-
const i =
|
|
1144
|
+
if (o.getOptions(!1), n || !Ne(this.node.id, this.event.key)) {
|
|
1145
|
+
const i = xe(this.node.id)?.[0];
|
|
1146
1146
|
o.setValue(i?.key ?? "");
|
|
1147
1147
|
}
|
|
1148
1148
|
this.onEventChange_(o.getValue());
|
|
1149
1149
|
},
|
|
1150
1150
|
onEventChange_: function(t) {
|
|
1151
|
-
const e =
|
|
1151
|
+
const e = Ne(this.node.id, t);
|
|
1152
1152
|
e ? (this.event.key = e.key, this.event.names = e.names, this.event.from = e.from, this.event.params = e.params) : (this.event.key = "", this.event.names = [], this.event.from = "regular", this.event.params = []), this.updateShape_(), setTimeout(() => {
|
|
1153
1153
|
this.ensureBlocks_();
|
|
1154
1154
|
}, 0);
|
|
@@ -1186,7 +1186,7 @@ const Ei = {
|
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
1188
1188
|
t.alias !== this.node.alias && (this.node.alias = t.alias);
|
|
1189
|
-
const e =
|
|
1189
|
+
const e = Ne(this.node.id, this.event.key);
|
|
1190
1190
|
if (!e) {
|
|
1191
1191
|
this.setWarningText(p("WARN_EVENT_NOT_FOUND"));
|
|
1192
1192
|
return;
|
|
@@ -1219,12 +1219,12 @@ const gi = {
|
|
|
1219
1219
|
names: [],
|
|
1220
1220
|
from: "regular",
|
|
1221
1221
|
params: []
|
|
1222
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_TRIGGER_APP_EVENT_TITLE}").appendField(new
|
|
1222
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_TRIGGER_APP_EVENT_TITLE}").appendField(new O(() => this.genEventOpts_()), "EVENT"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("event_blocks"), this.setTooltip("%{BKY_APP_V1_TRIGGER_APP_EVENT_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_TRIGGER_APP_EVENT_HELPURL}"), this.initData_();
|
|
1223
1223
|
},
|
|
1224
1224
|
initData_: function() {
|
|
1225
1225
|
if (this.event.key)
|
|
1226
1226
|
return;
|
|
1227
|
-
const t =
|
|
1227
|
+
const t = xn()?.[0];
|
|
1228
1228
|
if (!t)
|
|
1229
1229
|
return;
|
|
1230
1230
|
this.event.key = t.key, this.event.names = t.names, this.event.from = t.from, this.event.params = t.params;
|
|
@@ -1245,9 +1245,9 @@ const gi = {
|
|
|
1245
1245
|
return fi();
|
|
1246
1246
|
},
|
|
1247
1247
|
onchange: function(t) {
|
|
1248
|
-
if (t.type ===
|
|
1248
|
+
if (t.type === B.STATE_CHANGE)
|
|
1249
1249
|
this.checkWarning_();
|
|
1250
|
-
else if (t.type ===
|
|
1250
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1251
1251
|
const e = t;
|
|
1252
1252
|
e.blockId === this.id && (e.element === "field" && e.name === "EVENT" && this.onEventChange_(e.newValue), setTimeout(() => {
|
|
1253
1253
|
this.checkWarning_();
|
|
@@ -1255,7 +1255,7 @@ const gi = {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
},
|
|
1257
1257
|
onEventChange_: function(t) {
|
|
1258
|
-
const e =
|
|
1258
|
+
const e = hn(t);
|
|
1259
1259
|
e ? (this.event.key = e.key, this.event.names = e.names, this.event.from = e.from, this.event.params = e.params) : (this.event.key = "", this.event.names = [], this.event.from = "regular", this.event.params = []);
|
|
1260
1260
|
},
|
|
1261
1261
|
updateShape_: function() {
|
|
@@ -1282,7 +1282,7 @@ const gi = {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
},
|
|
1284
1284
|
checkWarning_: function() {
|
|
1285
|
-
const t =
|
|
1285
|
+
const t = hn(this.event.key);
|
|
1286
1286
|
if (!t) {
|
|
1287
1287
|
this.setWarningText(p("WARN_EVENT_NOT_FOUND"));
|
|
1288
1288
|
return;
|
|
@@ -1320,7 +1320,7 @@ h([
|
|
|
1320
1320
|
}
|
|
1321
1321
|
]);
|
|
1322
1322
|
s.forBlock.watch_effect_v1 = function(t) {
|
|
1323
|
-
const e =
|
|
1323
|
+
const e = Co(t.id), n = s.statementToCode(t, "HANDLE");
|
|
1324
1324
|
return `function __watchEffect$${e}__() {
|
|
1325
1325
|
${n}};
|
|
1326
1326
|
`;
|
|
@@ -1359,7 +1359,7 @@ const Ai = {
|
|
|
1359
1359
|
}, 0);
|
|
1360
1360
|
},
|
|
1361
1361
|
updateShape_: function() {
|
|
1362
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT").appendField("%{BKY_APP_RETURN}"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("TEXT") || (this.appendValueInput("TEXT").setCheck("String").setAlign(
|
|
1362
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT").appendField("%{BKY_APP_RETURN}"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("TEXT") || (this.appendValueInput("TEXT").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_APP_TEXT}"), this.moveInputBefore("TEXT", "RESULT")), this.getInput("TITLE") || (this.appendValueInput("TITLE").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_APP_TITLE}"), this.moveInputBefore("TITLE", "TEXT"));
|
|
1363
1363
|
},
|
|
1364
1364
|
updateShadow_: function() {
|
|
1365
1365
|
if (this.isInsertionMarker())
|
|
@@ -1396,7 +1396,7 @@ const Ii = {
|
|
|
1396
1396
|
}, 0);
|
|
1397
1397
|
},
|
|
1398
1398
|
updateShape_: function() {
|
|
1399
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT").appendField("%{BKY_APP_RETURN}"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("VALUE") || (this.appendValueInput("VALUE").setCheck("String").setAlign(
|
|
1399
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT").appendField("%{BKY_APP_RETURN}"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("VALUE") || (this.appendValueInput("VALUE").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_APP_VALUE}"), this.moveInputBefore("VALUE", "RESULT")), this.getInput("LABEL") || (this.appendValueInput("LABEL").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_APP_LABEL}"), this.moveInputBefore("LABEL", "VALUE")), this.getInput("TITLE") || (this.appendValueInput("TITLE").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_APP_TITLE}"), this.moveInputBefore("TITLE", "LABEL"));
|
|
1400
1400
|
},
|
|
1401
1401
|
updateShadow_: function() {
|
|
1402
1402
|
if (this.isInsertionMarker())
|
|
@@ -1466,7 +1466,7 @@ const Oi = {
|
|
|
1466
1466
|
from: "regular",
|
|
1467
1467
|
inputs: [],
|
|
1468
1468
|
outputs: []
|
|
1469
|
-
}, this.appendDummyInput("DUMMY").appendField("%{BKY_APP_V1_CALL_APP_METHOD_TITLE}").appendField(new
|
|
1469
|
+
}, this.appendDummyInput("DUMMY").appendField("%{BKY_APP_V1_CALL_APP_METHOD_TITLE}").appendField(new O(() => this.genNodeOpts_()), "NODE").appendField(new O(() => this.genMethodOpts_()), "METHOD"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_APP_V1_CALL_APP_METHOD_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_CALL_APP_METHOD_HELPURL}"), this.initData_();
|
|
1470
1470
|
},
|
|
1471
1471
|
initData_: function() {
|
|
1472
1472
|
if (this.node.id)
|
|
@@ -1477,7 +1477,7 @@ const Oi = {
|
|
|
1477
1477
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
1478
1478
|
const e = this.getField("NODE");
|
|
1479
1479
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
1480
|
-
const n =
|
|
1480
|
+
const n = Fe(this.node.id)?.[0];
|
|
1481
1481
|
if (!n)
|
|
1482
1482
|
return;
|
|
1483
1483
|
this.method.key = n.key, this.method.names = n.names, this.method.from = n.from, this.method.inputs = n.inputs, this.method.outputs = n.outputs;
|
|
@@ -1496,15 +1496,15 @@ const Oi = {
|
|
|
1496
1496
|
}, 0);
|
|
1497
1497
|
},
|
|
1498
1498
|
genNodeOpts_: function() {
|
|
1499
|
-
return
|
|
1499
|
+
return pe("callMethod");
|
|
1500
1500
|
},
|
|
1501
1501
|
genMethodOpts_: function() {
|
|
1502
1502
|
return mi(this.node.id);
|
|
1503
1503
|
},
|
|
1504
1504
|
onchange: function(t) {
|
|
1505
|
-
if (t.type ===
|
|
1505
|
+
if (t.type === B.STATE_CHANGE)
|
|
1506
1506
|
this.checkWarning_();
|
|
1507
|
-
else if (t.type ===
|
|
1507
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1508
1508
|
const e = t;
|
|
1509
1509
|
e.blockId === this.id && (e.element === "field" && (e.name === "NODE" ? this.onNodeChange_(e.newValue) : e.name === "METHOD" && this.onMethodChange_(e.newValue)), setTimeout(() => {
|
|
1510
1510
|
this.checkWarning_();
|
|
@@ -1520,14 +1520,14 @@ const Oi = {
|
|
|
1520
1520
|
const n = this.node.key !== e.key;
|
|
1521
1521
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
1522
1522
|
const o = this.getField("METHOD");
|
|
1523
|
-
if (o.getOptions(!1), n || !
|
|
1524
|
-
const i =
|
|
1523
|
+
if (o.getOptions(!1), n || !Le(this.node.id, this.method.key)) {
|
|
1524
|
+
const i = Fe(this.node.id)?.[0];
|
|
1525
1525
|
o.setValue(i?.key ?? "");
|
|
1526
1526
|
}
|
|
1527
1527
|
this.onMethodChange_(o.getValue());
|
|
1528
1528
|
},
|
|
1529
1529
|
onMethodChange_: function(t) {
|
|
1530
|
-
const e =
|
|
1530
|
+
const e = Le(this.node.id, t);
|
|
1531
1531
|
e ? (this.method.key = e.key, this.method.names = e.names, this.method.from = e.from, this.method.inputs = e.inputs, this.method.outputs = e.outputs) : (this.method.key = "", this.method.names = [], this.method.from = "regular", this.method.inputs = [], this.method.outputs = []), this.updateShape_(), this.updateShadow_(), setTimeout(() => {
|
|
1532
1532
|
this.ensureBlocks_();
|
|
1533
1533
|
}, 0);
|
|
@@ -1548,7 +1548,7 @@ const Oi = {
|
|
|
1548
1548
|
this.removeInput("INPUT" + t);
|
|
1549
1549
|
for (let t = 0; t < this.method.inputs.length; t++) {
|
|
1550
1550
|
const e = this.method.inputs[t];
|
|
1551
|
-
this.getInput("INPUT" + t) || (this.appendValueInput("INPUT" + t).setAlign(
|
|
1551
|
+
this.getInput("INPUT" + t) || (this.appendValueInput("INPUT" + t).setAlign(C.Align.RIGHT).appendField(On[e.name]), this.method.outputs.length > 0 && this.moveInputBefore("INPUT" + t, "OUTPUT0"));
|
|
1552
1552
|
}
|
|
1553
1553
|
if (this.method.from === "multipleRef")
|
|
1554
1554
|
this.getInput("REF_KEY") || this.appendValueInput("REF_KEY"), this.method.inputs.length > 0 ? this.moveInputBefore("REF_KEY", "INPUT0") : this.method.outputs.length > 0 && this.moveInputBefore("REF_KEY", "OUTPUT0");
|
|
@@ -1570,7 +1570,7 @@ const Oi = {
|
|
|
1570
1570
|
ensureBlocks_: function() {
|
|
1571
1571
|
if (this.isInsertionMarker())
|
|
1572
1572
|
return;
|
|
1573
|
-
const t =
|
|
1573
|
+
const t = Fn(this.method.from), e = [];
|
|
1574
1574
|
for (let n = 0; n < this.method.outputs.length; n++) {
|
|
1575
1575
|
const { key: o, name: i } = this.method.outputs[n];
|
|
1576
1576
|
e.push(["OUTPUT" + n, o, i, t]);
|
|
@@ -1588,7 +1588,7 @@ const Oi = {
|
|
|
1588
1588
|
return;
|
|
1589
1589
|
}
|
|
1590
1590
|
t.alias !== this.node.alias && (this.node.alias = t.alias);
|
|
1591
|
-
const e =
|
|
1591
|
+
const e = Le(this.node.id, this.method.key);
|
|
1592
1592
|
if (!e) {
|
|
1593
1593
|
this.setWarningText(p("WARN_METHOD_NOT_FOUND"));
|
|
1594
1594
|
return;
|
|
@@ -1620,14 +1620,14 @@ s.forBlock.call_app_method_v1 = function(t) {
|
|
|
1620
1620
|
return `__callMethodV1__(${e(o)}, ${e(i)});
|
|
1621
1621
|
`;
|
|
1622
1622
|
};
|
|
1623
|
-
const
|
|
1623
|
+
const Ci = {
|
|
1624
1624
|
init: function() {
|
|
1625
1625
|
this.method = {
|
|
1626
1626
|
key: "",
|
|
1627
1627
|
names: [],
|
|
1628
1628
|
from: "regular",
|
|
1629
1629
|
inputs: []
|
|
1630
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_IMPL_APP_METHOD_TITLE}").appendField(new
|
|
1630
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_IMPL_APP_METHOD_TITLE}").appendField(new O(() => this.genMethodOpts_()), "METHOD"), this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}"), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_APP_V1_IMPL_APP_METHOD_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_IMPL_APP_METHOD_HELPURL}"), this.initData_();
|
|
1631
1631
|
},
|
|
1632
1632
|
initData_: function() {
|
|
1633
1633
|
const t = je()?.[0];
|
|
@@ -1648,12 +1648,12 @@ const vi = {
|
|
|
1648
1648
|
}, 0);
|
|
1649
1649
|
},
|
|
1650
1650
|
genMethodOpts_: function() {
|
|
1651
|
-
return
|
|
1651
|
+
return Yn();
|
|
1652
1652
|
},
|
|
1653
1653
|
onchange: function(t) {
|
|
1654
|
-
if (t.type ===
|
|
1654
|
+
if (t.type === B.STATE_CHANGE)
|
|
1655
1655
|
this.checkWarning_();
|
|
1656
|
-
else if (t.type ===
|
|
1656
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1657
1657
|
const e = t;
|
|
1658
1658
|
e.blockId === this.id && (e.element === "field" && e.name === "METHOD" && this.onMethodChange_(e.newValue), setTimeout(() => {
|
|
1659
1659
|
this.checkWarning_();
|
|
@@ -1677,7 +1677,7 @@ const vi = {
|
|
|
1677
1677
|
ensureBlocks_: function() {
|
|
1678
1678
|
if (this.isInsertionMarker())
|
|
1679
1679
|
return;
|
|
1680
|
-
const t =
|
|
1680
|
+
const t = Fn(this.method.from), e = [];
|
|
1681
1681
|
for (let n = 0; n < this.method.inputs.length; n++) {
|
|
1682
1682
|
const { key: o, name: i } = this.method.inputs[n];
|
|
1683
1683
|
e.push(["INPUT" + n, o, i, t]);
|
|
@@ -1697,14 +1697,14 @@ const vi = {
|
|
|
1697
1697
|
this.setWarningText(null);
|
|
1698
1698
|
}
|
|
1699
1699
|
};
|
|
1700
|
-
d.impl_app_method_v1 =
|
|
1700
|
+
d.impl_app_method_v1 = Ci;
|
|
1701
1701
|
s.forBlock.impl_app_method_v1 = function(t) {
|
|
1702
1702
|
const e = t;
|
|
1703
1703
|
return `{
|
|
1704
1704
|
${s.statementToCode(e, "HANDLE")}}
|
|
1705
1705
|
`;
|
|
1706
1706
|
};
|
|
1707
|
-
const
|
|
1707
|
+
const vi = {
|
|
1708
1708
|
init: function() {
|
|
1709
1709
|
this.method = {
|
|
1710
1710
|
key: "",
|
|
@@ -1714,7 +1714,7 @@ const Ci = {
|
|
|
1714
1714
|
key: "",
|
|
1715
1715
|
name: "",
|
|
1716
1716
|
type: "string"
|
|
1717
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_METHOD_OUTPUT_TITLE}").appendField(new
|
|
1717
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_METHOD_OUTPUT_TITLE}").appendField(new O(() => this.genMethodOpts_()), "METHOD").appendField(new O(() => this.genOutputOpts_()), "OUTPUT"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_APP_V1_SET_APP_METHOD_OUTPUT_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_SET_APP_METHOD_OUTPUT_HELPURL}"), this.initData_();
|
|
1718
1718
|
},
|
|
1719
1719
|
initData_: function() {
|
|
1720
1720
|
if (this.method.key)
|
|
@@ -1725,7 +1725,7 @@ const Ci = {
|
|
|
1725
1725
|
this.method.key = t.key, this.method.names = t.names, this.method.from = t.from;
|
|
1726
1726
|
const e = this.getField("METHOD");
|
|
1727
1727
|
e.getOptions(!1), e.setValue(this.method.key);
|
|
1728
|
-
const n =
|
|
1728
|
+
const n = Ye(this.method.key)?.[0];
|
|
1729
1729
|
if (!n)
|
|
1730
1730
|
return;
|
|
1731
1731
|
this.output.key = n.key, this.output.name = n.name, this.output.type = n.type;
|
|
@@ -1743,15 +1743,15 @@ const Ci = {
|
|
|
1743
1743
|
}, 0);
|
|
1744
1744
|
},
|
|
1745
1745
|
genMethodOpts_: function() {
|
|
1746
|
-
return
|
|
1746
|
+
return Yn();
|
|
1747
1747
|
},
|
|
1748
1748
|
genOutputOpts_: function() {
|
|
1749
1749
|
return Ti(this.method.key);
|
|
1750
1750
|
},
|
|
1751
1751
|
onchange: function(t) {
|
|
1752
|
-
if (t.type ===
|
|
1752
|
+
if (t.type === B.STATE_CHANGE)
|
|
1753
1753
|
this.checkWarning_();
|
|
1754
|
-
else if (t.type ===
|
|
1754
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1755
1755
|
const e = t;
|
|
1756
1756
|
e.blockId === this.id && (e.element === "field" && (e.name === "METHOD" ? this.onMethodChange_(e.newValue) : e.name === "OUTPUT" && this.onOutputChange_(e.newValue)), setTimeout(() => {
|
|
1757
1757
|
this.checkWarning_();
|
|
@@ -1767,14 +1767,14 @@ const Ci = {
|
|
|
1767
1767
|
const n = this.method.key !== e.key;
|
|
1768
1768
|
this.method.key = e.key, this.method.names = e.names, this.method.from = e.from;
|
|
1769
1769
|
const o = this.getField("OUTPUT");
|
|
1770
|
-
if (o.getOptions(!1), n || !
|
|
1771
|
-
const i =
|
|
1770
|
+
if (o.getOptions(!1), n || !Se(this.method.key, this.output.key)) {
|
|
1771
|
+
const i = Ye(this.method.key)?.[0];
|
|
1772
1772
|
o.setValue(i?.key ?? "");
|
|
1773
1773
|
}
|
|
1774
1774
|
this.onOutputChange_(o.getValue());
|
|
1775
1775
|
},
|
|
1776
1776
|
onOutputChange_: function(t) {
|
|
1777
|
-
const e =
|
|
1777
|
+
const e = Se(this.method.key, t);
|
|
1778
1778
|
e ? (this.output.key = e.key, this.output.name = e.name, this.output.type = e.type) : (this.output.key = "", this.output.name = "", this.output.type = "string");
|
|
1779
1779
|
},
|
|
1780
1780
|
updateShape_: function() {
|
|
@@ -1798,7 +1798,7 @@ const Ci = {
|
|
|
1798
1798
|
return;
|
|
1799
1799
|
}
|
|
1800
1800
|
t.names !== this.method.names && (this.method.names = t.names);
|
|
1801
|
-
const e =
|
|
1801
|
+
const e = Se(this.method.key, this.output.key);
|
|
1802
1802
|
if (!e) {
|
|
1803
1803
|
this.setWarningText(p("WARN_OUTPUT_NOT_FOUND"));
|
|
1804
1804
|
return;
|
|
@@ -1810,7 +1810,7 @@ const Ci = {
|
|
|
1810
1810
|
this.setWarningText(null);
|
|
1811
1811
|
}
|
|
1812
1812
|
};
|
|
1813
|
-
d.set_app_method_output_v1 =
|
|
1813
|
+
d.set_app_method_output_v1 = vi;
|
|
1814
1814
|
s.forBlock.set_app_method_output_v1 = function(t) {
|
|
1815
1815
|
const e = t;
|
|
1816
1816
|
let n = s.valueToCode(e, "VALUE", c.ATOMIC);
|
|
@@ -1868,18 +1868,18 @@ const yi = {
|
|
|
1868
1868
|
}, this.page = {
|
|
1869
1869
|
id: "",
|
|
1870
1870
|
name: ""
|
|
1871
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_NAVIGATE_TO_TITLE}").appendField(new
|
|
1871
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_NAVIGATE_TO_TITLE}").appendField(new O(() => this.genAppOpts_()), "APP").appendField(new O(() => this.genPageOpts_()), "PAGE"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_APP_V1_NAVIGATE_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_NAVIGATE_HELPURL}"), this.initData_();
|
|
1872
1872
|
},
|
|
1873
1873
|
initData_: function() {
|
|
1874
1874
|
if (this.app.id)
|
|
1875
1875
|
return;
|
|
1876
|
-
const t =
|
|
1876
|
+
const t = Mn()?.[0];
|
|
1877
1877
|
if (!t)
|
|
1878
1878
|
return;
|
|
1879
1879
|
this.app.id = t.id, this.app.name = t.name;
|
|
1880
1880
|
const e = this.getField("APP");
|
|
1881
1881
|
e.getOptions(!1), e.setValue(this.app.id);
|
|
1882
|
-
const n =
|
|
1882
|
+
const n = Ve(this.app.id)?.[0];
|
|
1883
1883
|
if (!n)
|
|
1884
1884
|
return;
|
|
1885
1885
|
this.page.id = n.id, this.page.name = n.name;
|
|
@@ -1904,9 +1904,9 @@ const yi = {
|
|
|
1904
1904
|
return _i(this.app.id);
|
|
1905
1905
|
},
|
|
1906
1906
|
onchange: function(t) {
|
|
1907
|
-
if (t.type ===
|
|
1907
|
+
if (t.type === B.STATE_CHANGE)
|
|
1908
1908
|
this.checkWarning_();
|
|
1909
|
-
else if (t.type ===
|
|
1909
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1910
1910
|
const e = t;
|
|
1911
1911
|
e.blockId === this.id && (e.element === "field" && (e.name === "APP" ? this.onAppChange_(e.newValue) : e.name === "PAGE" && this.onPageChange_(e.newValue)), setTimeout(() => {
|
|
1912
1912
|
this.checkWarning_();
|
|
@@ -1914,7 +1914,7 @@ const yi = {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
},
|
|
1916
1916
|
onAppChange_: function(t) {
|
|
1917
|
-
const e =
|
|
1917
|
+
const e = _n(t);
|
|
1918
1918
|
if (!e) {
|
|
1919
1919
|
console.assert(!1);
|
|
1920
1920
|
return;
|
|
@@ -1922,23 +1922,23 @@ const yi = {
|
|
|
1922
1922
|
const n = this.app.id !== e.id;
|
|
1923
1923
|
this.app.id = e.id, this.app.name = e.name;
|
|
1924
1924
|
const o = this.getField("PAGE");
|
|
1925
|
-
if (o.getOptions(!1), n || !
|
|
1926
|
-
const a =
|
|
1925
|
+
if (o.getOptions(!1), n || !ke(this.app.id, this.page.id)) {
|
|
1926
|
+
const a = Ve(this.app.id)?.[0]?.id ?? "";
|
|
1927
1927
|
o.setValue(a), this.page.id === a && this.onPageChange_(a);
|
|
1928
1928
|
}
|
|
1929
1929
|
},
|
|
1930
1930
|
onPageChange_: function(t) {
|
|
1931
|
-
const e =
|
|
1931
|
+
const e = ke(this.app.id, t);
|
|
1932
1932
|
e ? (this.page.id = e.id, this.page.name = e.name) : (this.page.id = "", this.page.name = "");
|
|
1933
1933
|
},
|
|
1934
1934
|
checkWarning_: function() {
|
|
1935
|
-
const t =
|
|
1935
|
+
const t = _n(this.app.id);
|
|
1936
1936
|
if (!t) {
|
|
1937
1937
|
this.setWarningText(p("WARN_APP_NOT_FOUND"));
|
|
1938
1938
|
return;
|
|
1939
1939
|
}
|
|
1940
1940
|
t.name !== this.app.name && (this.app.name = t.name);
|
|
1941
|
-
const e =
|
|
1941
|
+
const e = ke(this.app.id, this.page.id);
|
|
1942
1942
|
if (!e) {
|
|
1943
1943
|
this.setWarningText(p("WARN_PAGE_NOT_FOUND"));
|
|
1944
1944
|
return;
|
|
@@ -1957,12 +1957,12 @@ const ki = {
|
|
|
1957
1957
|
this.comp = {
|
|
1958
1958
|
id: void 0,
|
|
1959
1959
|
name: ""
|
|
1960
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_SELECT_COMP_TITLE}").appendField(new
|
|
1960
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_SELECT_COMP_TITLE}").appendField(new O(() => this.genCompOpts_()), "COMP"), this.setOutput(!0, "Comp"), this.setStyle("property_blocks"), this.setTooltip("%{BKY_APP_V1_SELECT_COMP_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_SELECT_COMP_HELPURL}"), this.initData_();
|
|
1961
1961
|
},
|
|
1962
1962
|
initData_: function() {
|
|
1963
1963
|
if (this.comp.id !== void 0)
|
|
1964
1964
|
return;
|
|
1965
|
-
const t =
|
|
1965
|
+
const t = Vn()?.[0];
|
|
1966
1966
|
if (!t)
|
|
1967
1967
|
return;
|
|
1968
1968
|
this.comp.id = t.id, this.comp.name = t.name;
|
|
@@ -1983,9 +1983,9 @@ const ki = {
|
|
|
1983
1983
|
return pi();
|
|
1984
1984
|
},
|
|
1985
1985
|
onchange: function(t) {
|
|
1986
|
-
if (t.type ===
|
|
1986
|
+
if (t.type === B.STATE_CHANGE)
|
|
1987
1987
|
this.checkWarning_();
|
|
1988
|
-
else if (t.type ===
|
|
1988
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
1989
1989
|
const e = t;
|
|
1990
1990
|
e.blockId === this.id && (e.element === "field" && e.name === "COMP" && this.onCompChange_(e.newValue), setTimeout(() => {
|
|
1991
1991
|
this.checkWarning_();
|
|
@@ -1993,7 +1993,7 @@ const ki = {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
},
|
|
1995
1995
|
onCompChange_: function(t) {
|
|
1996
|
-
const e =
|
|
1996
|
+
const e = pn(t);
|
|
1997
1997
|
if (!e) {
|
|
1998
1998
|
console.assert(!1);
|
|
1999
1999
|
return;
|
|
@@ -2005,7 +2005,7 @@ const ki = {
|
|
|
2005
2005
|
this.setWarningText(p("WARN_COMP_NOT_FOUND"));
|
|
2006
2006
|
return;
|
|
2007
2007
|
}
|
|
2008
|
-
if (!
|
|
2008
|
+
if (!pn(this.comp.id)) {
|
|
2009
2009
|
this.setWarningText(p("WARN_COMP_NOT_FOUND"));
|
|
2010
2010
|
return;
|
|
2011
2011
|
}
|
|
@@ -2027,7 +2027,7 @@ const Ni = {
|
|
|
2027
2027
|
key: "",
|
|
2028
2028
|
names: [],
|
|
2029
2029
|
from: "regular"
|
|
2030
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_GET_APP_PROP_TITLE}").appendField(new
|
|
2030
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_GET_APP_PROP_TITLE}").appendField(new O(() => this.genNodeOpts_()), "NODE").appendField(new O(() => this.genPropOpts_()), "PROP"), this.setOutput(!0, null), this.setStyle("property_blocks"), this.setTooltip("%{BKY_APP_V1_GET_APP_PROP_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_GET_APP_PROP_HELPURL}"), this.initData_();
|
|
2031
2031
|
},
|
|
2032
2032
|
initData_: function() {
|
|
2033
2033
|
if (this.node.id)
|
|
@@ -2057,15 +2057,15 @@ const Ni = {
|
|
|
2057
2057
|
}, 0);
|
|
2058
2058
|
},
|
|
2059
2059
|
genNodeOpts_: function() {
|
|
2060
|
-
return
|
|
2060
|
+
return pe("getProp");
|
|
2061
2061
|
},
|
|
2062
2062
|
genPropOpts_: function() {
|
|
2063
|
-
return
|
|
2063
|
+
return Kn(this.node.id, "read");
|
|
2064
2064
|
},
|
|
2065
2065
|
onchange: function(t) {
|
|
2066
|
-
if (t.type ===
|
|
2066
|
+
if (t.type === B.STATE_CHANGE)
|
|
2067
2067
|
this.checkWarning_();
|
|
2068
|
-
else if (t.type ===
|
|
2068
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
2069
2069
|
const e = t;
|
|
2070
2070
|
e.blockId === this.id && (e.element === "field" && (e.name === "NODE" ? this.onNodeChange_(e.newValue) : e.name === "PROP" && this.onPropChange_(e.newValue)), setTimeout(() => {
|
|
2071
2071
|
this.checkWarning_();
|
|
@@ -2128,7 +2128,7 @@ const Li = {
|
|
|
2128
2128
|
key: "",
|
|
2129
2129
|
names: [],
|
|
2130
2130
|
from: "regular"
|
|
2131
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_PROP_TITLE}").appendField(new
|
|
2131
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_PROP_TITLE}").appendField(new O(() => this.genNodeOpts_()), "NODE").appendField(new O(() => this.genPropOpts_()), "PROP"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("property_blocks"), this.setTooltip("%{BKY_APP_V1_SET_APP_PROP_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_SET_APP_PROP_HELPURL}"), this.initData_(), this.isInFlyout && this.updateShadow_();
|
|
2132
2132
|
},
|
|
2133
2133
|
initData_: function() {
|
|
2134
2134
|
if (this.node.id)
|
|
@@ -2158,15 +2158,15 @@ const Li = {
|
|
|
2158
2158
|
}, 0);
|
|
2159
2159
|
},
|
|
2160
2160
|
genNodeOpts_: function() {
|
|
2161
|
-
return
|
|
2161
|
+
return pe("setProp");
|
|
2162
2162
|
},
|
|
2163
2163
|
genPropOpts_: function() {
|
|
2164
|
-
return
|
|
2164
|
+
return Kn(this.node.id, "write");
|
|
2165
2165
|
},
|
|
2166
2166
|
onchange: function(t) {
|
|
2167
|
-
if (t.type ===
|
|
2167
|
+
if (t.type === B.STATE_CHANGE)
|
|
2168
2168
|
this.checkWarning_();
|
|
2169
|
-
else if (t.type ===
|
|
2169
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
2170
2170
|
const e = t;
|
|
2171
2171
|
e.blockId === this.id && (e.element === "field" && (e.name === "NODE" ? this.onNodeChange_(e.newValue) : e.name === "PROP" && this.onPropChange_(e.newValue)), setTimeout(() => {
|
|
2172
2172
|
this.checkWarning_();
|
|
@@ -2248,10 +2248,17 @@ const Si = {
|
|
|
2248
2248
|
id: "",
|
|
2249
2249
|
name: "",
|
|
2250
2250
|
type: "string"
|
|
2251
|
-
}, this.appendDummyInput().appendField("%{BKY_APP_V1_GET_APP_STATE_TITLE}").appendField(new
|
|
2251
|
+
}, this.appendDummyInput().appendField("%{BKY_APP_V1_GET_APP_STATE_TITLE}").appendField(new O(() => this.genStateOpts_()), "STATE"), this.setOutput(!0, null), this.setStyle("state_blocks"), this.setTooltip("%{BKY_APP_V1_GET_APP_STATE_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_GET_APP_STATE_HELPURL}"), this.initData_();
|
|
2252
2252
|
},
|
|
2253
2253
|
initData_: function() {
|
|
2254
|
-
this.state.id
|
|
2254
|
+
if (this.state.id)
|
|
2255
|
+
return;
|
|
2256
|
+
const t = Xe()?.[0];
|
|
2257
|
+
if (!t)
|
|
2258
|
+
return;
|
|
2259
|
+
this.state.id = t.id, this.state.name = t.name, this.state.type = t.type;
|
|
2260
|
+
const e = this.getField("STATE");
|
|
2261
|
+
e.getOptions(!1), e.setValue(this.state.id);
|
|
2255
2262
|
},
|
|
2256
2263
|
saveExtraState: function() {
|
|
2257
2264
|
return {
|
|
@@ -2259,15 +2266,27 @@ const Si = {
|
|
|
2259
2266
|
};
|
|
2260
2267
|
},
|
|
2261
2268
|
loadExtraState: function(t) {
|
|
2262
|
-
this.state.id = t.state?.id ?? "", this.state.name = t.state?.name ?? "", this.state.type = t.state?.
|
|
2269
|
+
this.state.id = t.state?.id ?? "", this.state.name = t.state?.name ?? "", this.state.type = t.state?.type ?? "string", setTimeout(() => {
|
|
2263
2270
|
this.checkWarning_();
|
|
2264
2271
|
}, 0);
|
|
2265
2272
|
},
|
|
2266
2273
|
genStateOpts_: function() {
|
|
2267
2274
|
return $n();
|
|
2268
2275
|
},
|
|
2276
|
+
onchange: function(t) {
|
|
2277
|
+
if (t.type === B.STATE_CHANGE)
|
|
2278
|
+
this.checkWarning_();
|
|
2279
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
2280
|
+
const e = t;
|
|
2281
|
+
e.blockId === this.id && e.element === "field" && e.name === "STATE" && this.onStateChange_(e.newValue);
|
|
2282
|
+
}
|
|
2283
|
+
},
|
|
2284
|
+
onStateChange_: function(t) {
|
|
2285
|
+
const e = Qt(t);
|
|
2286
|
+
e ? (this.state.id = e.id, this.state.name = e.name, this.state.type = e.type) : (this.state.id = "", this.state.name = "", this.state.type = "string");
|
|
2287
|
+
},
|
|
2269
2288
|
checkWarning_: function() {
|
|
2270
|
-
const t =
|
|
2289
|
+
const t = Qt(this.state.id);
|
|
2271
2290
|
if (!t) {
|
|
2272
2291
|
this.setWarningText(p("WARN_STATE_NOT_FOUND"));
|
|
2273
2292
|
return;
|
|
@@ -2280,8 +2299,9 @@ const Si = {
|
|
|
2280
2299
|
}
|
|
2281
2300
|
};
|
|
2282
2301
|
d.get_app_state_v1 = Si;
|
|
2283
|
-
s.forBlock.get_app_state_v1 = function() {
|
|
2284
|
-
|
|
2302
|
+
s.forBlock.get_app_state_v1 = function(t) {
|
|
2303
|
+
const e = s.quote_;
|
|
2304
|
+
return [`__getStateV1__(${e(t.state.id)})`, c.ATOMIC];
|
|
2285
2305
|
};
|
|
2286
2306
|
const Bi = {
|
|
2287
2307
|
init: function() {
|
|
@@ -2289,12 +2309,12 @@ const Bi = {
|
|
|
2289
2309
|
id: "",
|
|
2290
2310
|
name: "",
|
|
2291
2311
|
type: "string"
|
|
2292
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_STATE_TITLE}").appendField(new
|
|
2312
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_APP_V1_SET_APP_STATE_TITLE}").appendField(new O(() => this.genStateOpts_()), "STATE"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("state_blocks"), this.setTooltip("%{BKY_APP_V1_SET_APP_STATE_TOOLTIP}"), this.setHelpUrl("%{BKY_APP_V1_SET_APP_STATE_HELPURL}"), this.initData_(), this.isInFlyout && this.updateShadow_();
|
|
2293
2313
|
},
|
|
2294
2314
|
initData_: function() {
|
|
2295
2315
|
if (this.state.id)
|
|
2296
2316
|
return;
|
|
2297
|
-
const t =
|
|
2317
|
+
const t = Xe()?.[0];
|
|
2298
2318
|
if (!t)
|
|
2299
2319
|
return;
|
|
2300
2320
|
this.state.id = t.id, this.state.name = t.name, this.state.type = t.type;
|
|
@@ -2313,13 +2333,13 @@ const Bi = {
|
|
|
2313
2333
|
return $n();
|
|
2314
2334
|
},
|
|
2315
2335
|
onchange: function(t) {
|
|
2316
|
-
if (t.type ===
|
|
2336
|
+
if (t.type === I.BLOCK_CHANGE) {
|
|
2317
2337
|
const e = t;
|
|
2318
2338
|
e.blockId === this.id && e.element === "field" && e.name === "STATE" && this.onStateChange_(e.newValue);
|
|
2319
2339
|
}
|
|
2320
2340
|
},
|
|
2321
2341
|
onStateChange_: function(t) {
|
|
2322
|
-
const e =
|
|
2342
|
+
const e = Qt(t);
|
|
2323
2343
|
e ? (this.state.id = e.id, this.state.name = e.name, this.state.type = e.type) : (this.state.id = "", this.state.name = "", this.state.type = "string"), this.updateShadow_();
|
|
2324
2344
|
},
|
|
2325
2345
|
updateShadow_: function() {
|
|
@@ -2332,7 +2352,7 @@ const Bi = {
|
|
|
2332
2352
|
this.getInput("VALUE").setCheck(e).setShadowDom(n);
|
|
2333
2353
|
},
|
|
2334
2354
|
checkWarning_: function() {
|
|
2335
|
-
const t =
|
|
2355
|
+
const t = Qt(this.state.id);
|
|
2336
2356
|
if (!t) {
|
|
2337
2357
|
this.setWarningText(p("WARN_STATE_NOT_FOUND"));
|
|
2338
2358
|
return;
|
|
@@ -2345,8 +2365,9 @@ const Bi = {
|
|
|
2345
2365
|
}
|
|
2346
2366
|
};
|
|
2347
2367
|
d.set_app_state_v1 = Bi;
|
|
2348
|
-
s.forBlock.set_app_state_v1 = function() {
|
|
2349
|
-
|
|
2368
|
+
s.forBlock.set_app_state_v1 = function(t) {
|
|
2369
|
+
const e = s.quote_, n = t, o = s.valueToCode(n, "VALUE", c.NONE);
|
|
2370
|
+
return `__setStateV1__(${e(n.state.id)}, ${o});
|
|
2350
2371
|
`;
|
|
2351
2372
|
};
|
|
2352
2373
|
h([
|
|
@@ -3052,7 +3073,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
3052
3073
|
`
|
|
3053
3074
|
)}(${e}, ${n}, ${o})`, c.FUNCTION_CALL];
|
|
3054
3075
|
};
|
|
3055
|
-
const bi =
|
|
3076
|
+
const bi = v.xml, Pi = [
|
|
3056
3077
|
{
|
|
3057
3078
|
type: "add_data_v1",
|
|
3058
3079
|
inputs: ["SUCCESS", "MESSAGE", "DATA"]
|
|
@@ -3147,7 +3168,7 @@ const Di = {
|
|
|
3147
3168
|
this.key = t, this.name = e, this.locale = n, this.updateShape_();
|
|
3148
3169
|
},
|
|
3149
3170
|
onchange: function(t) {
|
|
3150
|
-
if (t.type ===
|
|
3171
|
+
if (t.type === I.BLOCK_MOVE) {
|
|
3151
3172
|
const e = t;
|
|
3152
3173
|
if (e.blockId !== this.id)
|
|
3153
3174
|
return;
|
|
@@ -3158,7 +3179,7 @@ const Di = {
|
|
|
3158
3179
|
const e = this.workspace.getBlockById(t.oldParentId);
|
|
3159
3180
|
if (e && Ri(e.type, t.oldInputName))
|
|
3160
3181
|
try {
|
|
3161
|
-
|
|
3182
|
+
I.disable();
|
|
3162
3183
|
const n = e.getInput(t.oldInputName)?.connection;
|
|
3163
3184
|
if (n) {
|
|
3164
3185
|
const o = We(
|
|
@@ -3170,7 +3191,7 @@ const Di = {
|
|
|
3170
3191
|
n.connect(o.outputConnection);
|
|
3171
3192
|
}
|
|
3172
3193
|
} finally {
|
|
3173
|
-
|
|
3194
|
+
I.enable();
|
|
3174
3195
|
}
|
|
3175
3196
|
},
|
|
3176
3197
|
updateShape_: function() {
|
|
@@ -3198,7 +3219,7 @@ function Mt(t) {
|
|
|
3198
3219
|
const e = f.compute.spaces.find((n) => n.id === t);
|
|
3199
3220
|
return e ? e.funcs : [];
|
|
3200
3221
|
}
|
|
3201
|
-
function
|
|
3222
|
+
function Ct(t, e) {
|
|
3202
3223
|
const n = f.compute.spaces.find((o) => o.id === t);
|
|
3203
3224
|
if (n)
|
|
3204
3225
|
return n.funcs.find((o) => o.id === e);
|
|
@@ -3212,7 +3233,7 @@ function Hn(t) {
|
|
|
3212
3233
|
function we() {
|
|
3213
3234
|
return f.compute.activeFunc;
|
|
3214
3235
|
}
|
|
3215
|
-
function
|
|
3236
|
+
function dn(t) {
|
|
3216
3237
|
const { outputs: e } = f.compute.activeFunc;
|
|
3217
3238
|
return e.find((n) => n.id === t);
|
|
3218
3239
|
}
|
|
@@ -3228,7 +3249,7 @@ function Yt(t) {
|
|
|
3228
3249
|
t === "func" && n.funcs.length > 0 && e.push(n), t === "flow" && n.flows.length > 0 && e.push(n);
|
|
3229
3250
|
}), e;
|
|
3230
3251
|
}
|
|
3231
|
-
function
|
|
3252
|
+
function zt(t) {
|
|
3232
3253
|
return f.compute.spaces.find((e) => e.id === t);
|
|
3233
3254
|
}
|
|
3234
3255
|
function Gn(t) {
|
|
@@ -3247,7 +3268,7 @@ const Vi = {
|
|
|
3247
3268
|
name: "",
|
|
3248
3269
|
inputs: [],
|
|
3249
3270
|
outputs: []
|
|
3250
|
-
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new
|
|
3271
|
+
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => 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_();
|
|
3251
3272
|
},
|
|
3252
3273
|
initData_: function() {
|
|
3253
3274
|
if (this.space.id)
|
|
@@ -3283,9 +3304,9 @@ const Vi = {
|
|
|
3283
3304
|
return Hn(this.space.id);
|
|
3284
3305
|
},
|
|
3285
3306
|
onchange: function(t) {
|
|
3286
|
-
if (t.type ===
|
|
3307
|
+
if (t.type === B.STATE_CHANGE)
|
|
3287
3308
|
this.checkWarning_();
|
|
3288
|
-
else if (t.type ===
|
|
3309
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
3289
3310
|
const e = t;
|
|
3290
3311
|
e.blockId === this.id && (e.element === "field" && (e.name === "SPACE" ? this.onSpaceChange_(e.newValue) : e.name === "FUNC" && this.onFuncChange_(e.newValue)), setTimeout(() => {
|
|
3291
3312
|
this.checkWarning_();
|
|
@@ -3293,19 +3314,19 @@ const Vi = {
|
|
|
3293
3314
|
}
|
|
3294
3315
|
},
|
|
3295
3316
|
onSpaceChange_: function(t) {
|
|
3296
|
-
const e =
|
|
3317
|
+
const e = zt(t);
|
|
3297
3318
|
if (!e) {
|
|
3298
3319
|
console.assert(!1);
|
|
3299
3320
|
return;
|
|
3300
3321
|
}
|
|
3301
3322
|
let n = !1;
|
|
3302
|
-
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !
|
|
3323
|
+
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !Ct(this.space.id, this.func.id)) {
|
|
3303
3324
|
const i = Mt(this.space.id)?.[0];
|
|
3304
3325
|
this.setFieldValue(i?.id ?? "", "FUNC");
|
|
3305
3326
|
}
|
|
3306
3327
|
},
|
|
3307
3328
|
onFuncChange_: function(t) {
|
|
3308
|
-
const e =
|
|
3329
|
+
const e = Ct(this.space.id, t);
|
|
3309
3330
|
if (!e) {
|
|
3310
3331
|
console.assert(!1);
|
|
3311
3332
|
return;
|
|
@@ -3332,7 +3353,7 @@ const Vi = {
|
|
|
3332
3353
|
}
|
|
3333
3354
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3334
3355
|
const { name: e } = this.func.inputs[t], n = this.getInput("INPUT" + t);
|
|
3335
|
-
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(
|
|
3356
|
+
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(C.Align.RIGHT).appendField(e, "NAME" + t).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + t, "OUTPUT0") : this.moveInputBefore("INPUT" + t, "CALLBACK"));
|
|
3336
3357
|
}
|
|
3337
3358
|
},
|
|
3338
3359
|
updateCheck_: function() {
|
|
@@ -3359,13 +3380,13 @@ const Vi = {
|
|
|
3359
3380
|
F(this, t);
|
|
3360
3381
|
},
|
|
3361
3382
|
checkWarning_: function() {
|
|
3362
|
-
const t =
|
|
3383
|
+
const t = zt(this.space.id);
|
|
3363
3384
|
if (!t) {
|
|
3364
3385
|
this.setWarningText(p("WARN_SPACE_NOT_FOUND"));
|
|
3365
3386
|
return;
|
|
3366
3387
|
}
|
|
3367
3388
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3368
|
-
const e =
|
|
3389
|
+
const e = Ct(this.space.id, this.func.id);
|
|
3369
3390
|
if (!e) {
|
|
3370
3391
|
this.setWarningText(p("WARN_FUNC_NOT_FOUND"));
|
|
3371
3392
|
return;
|
|
@@ -3418,7 +3439,7 @@ const xi = {
|
|
|
3418
3439
|
name: "",
|
|
3419
3440
|
inputs: [],
|
|
3420
3441
|
outputs: []
|
|
3421
|
-
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new
|
|
3442
|
+
}, this.appendDummyInput().appendField("%{BKY_COMPUTE_CALL}").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => 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_();
|
|
3422
3443
|
},
|
|
3423
3444
|
initData_: function() {
|
|
3424
3445
|
if (this.space.id)
|
|
@@ -3454,9 +3475,9 @@ const xi = {
|
|
|
3454
3475
|
return Hn(this.space.id);
|
|
3455
3476
|
},
|
|
3456
3477
|
onchange: function(t) {
|
|
3457
|
-
if (t.type ===
|
|
3478
|
+
if (t.type === B.STATE_CHANGE)
|
|
3458
3479
|
this.checkWarning_();
|
|
3459
|
-
else if (t.type ===
|
|
3480
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
3460
3481
|
const e = t;
|
|
3461
3482
|
e.blockId === this.id && (e.element === "field" && (e.name === "SPACE" ? this.onSpaceChange_(e.newValue) : e.name === "FUNC" && this.onFuncChange_(e.newValue)), setTimeout(() => {
|
|
3462
3483
|
this.checkWarning_();
|
|
@@ -3464,19 +3485,19 @@ const xi = {
|
|
|
3464
3485
|
}
|
|
3465
3486
|
},
|
|
3466
3487
|
onSpaceChange_: function(t) {
|
|
3467
|
-
const e =
|
|
3488
|
+
const e = zt(t);
|
|
3468
3489
|
if (!e) {
|
|
3469
3490
|
console.assert(!1);
|
|
3470
3491
|
return;
|
|
3471
3492
|
}
|
|
3472
3493
|
let n = !1;
|
|
3473
|
-
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !
|
|
3494
|
+
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !Ct(this.space.id, this.func.id)) {
|
|
3474
3495
|
const i = Mt(this.space.id)?.[0];
|
|
3475
3496
|
i ? this.setFieldValue(i.id, "FUNC") : this.setFieldValue("", "FUNC");
|
|
3476
3497
|
}
|
|
3477
3498
|
},
|
|
3478
3499
|
onFuncChange_: function(t) {
|
|
3479
|
-
const e =
|
|
3500
|
+
const e = Ct(this.space.id, t);
|
|
3480
3501
|
if (!e) {
|
|
3481
3502
|
console.assert(!1);
|
|
3482
3503
|
return;
|
|
@@ -3503,7 +3524,7 @@ const xi = {
|
|
|
3503
3524
|
}
|
|
3504
3525
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3505
3526
|
const { name: e } = this.func.inputs[t], n = this.getInput("INPUT" + t);
|
|
3506
|
-
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(
|
|
3527
|
+
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(C.Align.RIGHT).appendField(e, "NAME" + t).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + t, "OUTPUT0") : this.moveInputBefore("INPUT" + t, "CALLBACK"));
|
|
3507
3528
|
}
|
|
3508
3529
|
},
|
|
3509
3530
|
updateCheck_: function() {
|
|
@@ -3530,13 +3551,13 @@ const xi = {
|
|
|
3530
3551
|
F(this, t);
|
|
3531
3552
|
},
|
|
3532
3553
|
checkWarning_: function() {
|
|
3533
|
-
const t =
|
|
3554
|
+
const t = zt(this.space.id);
|
|
3534
3555
|
if (!t) {
|
|
3535
3556
|
this.setWarningText(p("WARN_SPACE_NOT_FOUND"));
|
|
3536
3557
|
return;
|
|
3537
3558
|
}
|
|
3538
3559
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3539
|
-
const e =
|
|
3560
|
+
const e = Ct(this.space.id, this.func.id);
|
|
3540
3561
|
if (!e) {
|
|
3541
3562
|
this.setWarningText(p("WARN_FUNC_NOT_FOUND"));
|
|
3542
3563
|
return;
|
|
@@ -3653,7 +3674,7 @@ const Yi = {
|
|
|
3653
3674
|
id: "",
|
|
3654
3675
|
name: "",
|
|
3655
3676
|
type: "string"
|
|
3656
|
-
}, this.appendValueInput("VALUE").appendField("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_TITLE}").appendField(new
|
|
3677
|
+
}, this.appendValueInput("VALUE").appendField("%{BKY_COMPUTE_V1_SET_FUNC_OUTPUT_TITLE}").appendField(new O(() => 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_();
|
|
3657
3678
|
},
|
|
3658
3679
|
initData_: function() {
|
|
3659
3680
|
if (this.output.id)
|
|
@@ -3675,9 +3696,9 @@ const Yi = {
|
|
|
3675
3696
|
return Ui();
|
|
3676
3697
|
},
|
|
3677
3698
|
onchange: function(t) {
|
|
3678
|
-
if (t.type ===
|
|
3699
|
+
if (t.type === B.STATE_CHANGE)
|
|
3679
3700
|
this.checkWarning_();
|
|
3680
|
-
else if (t.type ===
|
|
3701
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
3681
3702
|
const e = t;
|
|
3682
3703
|
e.blockId === this.id && (e.element === "field" && e.name === "OUTPUT" && this.onOutputChange_(e.newValue), setTimeout(() => {
|
|
3683
3704
|
this.checkWarning_();
|
|
@@ -3685,7 +3706,7 @@ const Yi = {
|
|
|
3685
3706
|
}
|
|
3686
3707
|
},
|
|
3687
3708
|
onOutputChange_: function(t) {
|
|
3688
|
-
const e =
|
|
3709
|
+
const e = dn(t);
|
|
3689
3710
|
if (!e) {
|
|
3690
3711
|
console.assert(!1);
|
|
3691
3712
|
return;
|
|
@@ -3707,7 +3728,7 @@ const Yi = {
|
|
|
3707
3728
|
this.getInput("VALUE").setShadowDom(t);
|
|
3708
3729
|
},
|
|
3709
3730
|
checkWarning_: function() {
|
|
3710
|
-
const t =
|
|
3731
|
+
const t = dn(this.output.id);
|
|
3711
3732
|
if (!t) {
|
|
3712
3733
|
this.setWarningText(p("WARN_FUNC_HAS_CHANGED"));
|
|
3713
3734
|
return;
|
|
@@ -3801,7 +3822,7 @@ function pt(t) {
|
|
|
3801
3822
|
const { spaces: e } = f.data;
|
|
3802
3823
|
return e.find((n) => n.id === t);
|
|
3803
3824
|
}
|
|
3804
|
-
function
|
|
3825
|
+
function he() {
|
|
3805
3826
|
const t = [];
|
|
3806
3827
|
return q().forEach(({ id: n, name: o }) => {
|
|
3807
3828
|
t.push([o, n]);
|
|
@@ -3816,20 +3837,20 @@ function j(t, e) {
|
|
|
3816
3837
|
if (o)
|
|
3817
3838
|
return o.tables.find((i) => i.id === e);
|
|
3818
3839
|
}
|
|
3819
|
-
function
|
|
3840
|
+
function de(t) {
|
|
3820
3841
|
const e = [];
|
|
3821
3842
|
return K(t).forEach(({ id: o, name: i }) => {
|
|
3822
3843
|
e.push([i, o]);
|
|
3823
3844
|
}), k(e);
|
|
3824
3845
|
}
|
|
3825
|
-
function
|
|
3846
|
+
function Zt(t, e) {
|
|
3826
3847
|
const { spaces: n } = f.data, o = n.find((a) => a.id === t);
|
|
3827
3848
|
if (!o)
|
|
3828
3849
|
return [];
|
|
3829
3850
|
const i = o.tables.find((a) => a.id === e);
|
|
3830
3851
|
return i ? i.columns : [];
|
|
3831
3852
|
}
|
|
3832
|
-
function
|
|
3853
|
+
function Be(t, e, n) {
|
|
3833
3854
|
const { spaces: o } = f.data, i = o.find((r) => r.id === t);
|
|
3834
3855
|
if (!i)
|
|
3835
3856
|
return;
|
|
@@ -3839,7 +3860,7 @@ function Se(t, e, n) {
|
|
|
3839
3860
|
}
|
|
3840
3861
|
function wi(t, e) {
|
|
3841
3862
|
const n = [];
|
|
3842
|
-
return
|
|
3863
|
+
return Zt(t, e).forEach(({ id: i, name: a }) => {
|
|
3843
3864
|
n.push([a, i]);
|
|
3844
3865
|
}), k(n);
|
|
3845
3866
|
}
|
|
@@ -3914,7 +3935,7 @@ const Hi = {
|
|
|
3914
3935
|
}, 0);
|
|
3915
3936
|
},
|
|
3916
3937
|
updateShape_: function() {
|
|
3917
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("UpdateColumn").setAlign(
|
|
3938
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("UpdateColumn").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "SUCCESS"));
|
|
3918
3939
|
},
|
|
3919
3940
|
ensureBlocks_: function() {
|
|
3920
3941
|
this.isInsertionMarker() || (Ki(this), F(this, [
|
|
@@ -3953,8 +3974,8 @@ const Gi = {
|
|
|
3953
3974
|
name: "",
|
|
3954
3975
|
type: "",
|
|
3955
3976
|
extend: ""
|
|
3956
|
-
}, this.appendValueInput("VALUE").appendField(new
|
|
3957
|
-
new
|
|
3977
|
+
}, this.appendValueInput("VALUE").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => this.genTableOpts_()), "TABLE").appendField(new O(() => this.genColumnOpts_()), "COLUMN").appendField(
|
|
3978
|
+
new O([
|
|
3958
3979
|
["=", "EQ"],
|
|
3959
3980
|
["≠", "NEQ"],
|
|
3960
3981
|
["<", "LT"],
|
|
@@ -3978,7 +3999,7 @@ const Gi = {
|
|
|
3978
3999
|
if (!e)
|
|
3979
4000
|
return;
|
|
3980
4001
|
this.table.id = e.id, this.table.name = e.name;
|
|
3981
|
-
const n =
|
|
4002
|
+
const n = Zt(this.space.id, this.table.id)?.[0];
|
|
3982
4003
|
n && (this.column.id = n.id, this.column.name = n.name, this.column.type = n.type, this.column.extend = n.extend);
|
|
3983
4004
|
},
|
|
3984
4005
|
saveExtraState: function() {
|
|
@@ -3994,18 +4015,18 @@ const Gi = {
|
|
|
3994
4015
|
}, 0);
|
|
3995
4016
|
},
|
|
3996
4017
|
genSpaceOpts_: function() {
|
|
3997
|
-
return
|
|
4018
|
+
return he();
|
|
3998
4019
|
},
|
|
3999
4020
|
genTableOpts_: function() {
|
|
4000
|
-
return
|
|
4021
|
+
return de(this.space.id);
|
|
4001
4022
|
},
|
|
4002
4023
|
genColumnOpts_: function() {
|
|
4003
4024
|
return wi(this.space.id, this.table.id);
|
|
4004
4025
|
},
|
|
4005
4026
|
onchange: function(t) {
|
|
4006
|
-
if (t.type ===
|
|
4027
|
+
if (t.type === B.STATE_CHANGE)
|
|
4007
4028
|
this.checkWarning_();
|
|
4008
|
-
else if (t.type ===
|
|
4029
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
4009
4030
|
const e = t;
|
|
4010
4031
|
e.blockId === this.id && e.element === "field" && (e.name === "SPACE" ? this.onSpaceChange_(e.newValue) : e.name === "TABLE" ? this.onTableChange_(e.newValue) : e.name === "COLUMN" && this.onColumnChange_(e.newValue)), setTimeout(() => {
|
|
4011
4032
|
this.checkWarning_();
|
|
@@ -4031,13 +4052,13 @@ const Gi = {
|
|
|
4031
4052
|
return;
|
|
4032
4053
|
}
|
|
4033
4054
|
const n = e.id !== this.table.id;
|
|
4034
|
-
if (this.table.id = e.id, this.table.name = e.name, n || !
|
|
4035
|
-
const o =
|
|
4055
|
+
if (this.table.id = e.id, this.table.name = e.name, n || !Be(this.space.id, this.table.id, this.column.id)) {
|
|
4056
|
+
const o = Zt(this.space.id, this.table.id)?.[0]?.id ?? "", i = this.getField("COLUMN");
|
|
4036
4057
|
i.getOptions(!1), i.setValue(o, !1), this.onColumnChange_(o);
|
|
4037
4058
|
}
|
|
4038
4059
|
},
|
|
4039
4060
|
onColumnChange_: function(t) {
|
|
4040
|
-
const e =
|
|
4061
|
+
const e = Be(this.space.id, this.table.id, t);
|
|
4041
4062
|
e ? (this.column.id = e.id, this.column.name = e.name, this.column.type = e.type, this.column.extend = e.extend) : (this.column.id = "", this.column.name = "", this.column.type = "", this.column.extend = ""), this.updateShape_(), this.updateBlocks_(!0), this.updateCheck_();
|
|
4042
4063
|
},
|
|
4043
4064
|
updateShape_: function() {
|
|
@@ -4056,11 +4077,11 @@ const Gi = {
|
|
|
4056
4077
|
n && n.dispose();
|
|
4057
4078
|
else if (n)
|
|
4058
4079
|
return;
|
|
4059
|
-
const o =
|
|
4080
|
+
const o = Ue(this.workspace, this.column.type);
|
|
4060
4081
|
o && (e.setCheck(null), e.connect(o.outputConnection));
|
|
4061
4082
|
},
|
|
4062
4083
|
updateCheck_: function() {
|
|
4063
|
-
const t =
|
|
4084
|
+
const t = Dn(this.column.type);
|
|
4064
4085
|
this.getInput("VALUE").connection.setCheck(t);
|
|
4065
4086
|
},
|
|
4066
4087
|
checkWarning_: function() {
|
|
@@ -4076,7 +4097,7 @@ const Gi = {
|
|
|
4076
4097
|
return;
|
|
4077
4098
|
}
|
|
4078
4099
|
e.name !== this.table.name && (this.table.name = e.name);
|
|
4079
|
-
const n =
|
|
4100
|
+
const n = Be(
|
|
4080
4101
|
this.space.id,
|
|
4081
4102
|
this.table.id,
|
|
4082
4103
|
this.column.id
|
|
@@ -4119,7 +4140,7 @@ d.cond_logic_item_v1 = ji;
|
|
|
4119
4140
|
const Xi = {
|
|
4120
4141
|
init: function() {
|
|
4121
4142
|
this.itemCount_ = 1, this.appendValueInput("VALUE").setCheck("Condition").appendField(
|
|
4122
|
-
new
|
|
4143
|
+
new O([
|
|
4123
4144
|
["%{BKY_DATA_COND_LOGIC_TYPE_AND}", "AND"],
|
|
4124
4145
|
["%{BKY_DATA_COND_LOGIC_TYPE_OR}", "OR"]
|
|
4125
4146
|
]),
|
|
@@ -4223,7 +4244,7 @@ function qi(t) {
|
|
|
4223
4244
|
const e = t.getInput("CONDITION").connection;
|
|
4224
4245
|
if (e.targetBlock())
|
|
4225
4246
|
return;
|
|
4226
|
-
const n = q()?.[0], o = K(n?.id ?? "")?.[0], i =
|
|
4247
|
+
const n = q()?.[0], o = K(n?.id ?? "")?.[0], i = Zt(n?.id, o?.id)?.[0], a = {
|
|
4227
4248
|
type: "cond_atomic_v1",
|
|
4228
4249
|
extraState: {
|
|
4229
4250
|
space: {
|
|
@@ -4281,7 +4302,7 @@ const zi = {
|
|
|
4281
4302
|
}, 0);
|
|
4282
4303
|
},
|
|
4283
4304
|
updateShape_: function() {
|
|
4284
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "HANDLE")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(
|
|
4305
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "HANDLE")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "SUCCESS")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("SelectTable").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
4285
4306
|
},
|
|
4286
4307
|
ensureBlocks_: function() {
|
|
4287
4308
|
this.isInsertionMarker() || (Ji(this), qi(this), F(this, [
|
|
@@ -4459,7 +4480,7 @@ const os = {
|
|
|
4459
4480
|
}, 0);
|
|
4460
4481
|
},
|
|
4461
4482
|
updateShape_: function() {
|
|
4462
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("EXTRA_DATA") || (this.appendValueInput("EXTRA_DATA"), this.moveInputBefore("EXTRA_DATA", "HANDLE")), this.getInput("MAIN_DATA") || (this.appendValueInput("MAIN_DATA"), this.moveInputBefore("MAIN_DATA", "EXTRA_DATA")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "MAIN_DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("EXTRA") || (this.appendValueInput("EXTRA").setCheck(["QueryExtra", "Array"]).setAlign(
|
|
4483
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("EXTRA_DATA") || (this.appendValueInput("EXTRA_DATA"), this.moveInputBefore("EXTRA_DATA", "HANDLE")), this.getInput("MAIN_DATA") || (this.appendValueInput("MAIN_DATA"), this.moveInputBefore("MAIN_DATA", "EXTRA_DATA")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "MAIN_DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("EXTRA") || (this.appendValueInput("EXTRA").setCheck(["QueryExtra", "Array"]).setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_EXTRA}"), this.moveInputBefore("EXTRA", "SUCCESS")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "EXTRA")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck(["SelectColumn", "Array"]).setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
4463
4484
|
},
|
|
4464
4485
|
ensureBlocks_: function() {
|
|
4465
4486
|
this.isInsertionMarker() || (Zi(this), ts(this), es(this), F(this, [
|
|
@@ -4564,7 +4585,7 @@ const as = {
|
|
|
4564
4585
|
id: "",
|
|
4565
4586
|
name: "",
|
|
4566
4587
|
columns: []
|
|
4567
|
-
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_COLUMN_TITLE}").appendField(new
|
|
4588
|
+
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_COLUMN_TITLE}").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => this.genTableOpts_()), "TABLE"), this.setMutator(
|
|
4568
4589
|
new ht.MutatorIcon(
|
|
4569
4590
|
["select_column_item_v1"],
|
|
4570
4591
|
this
|
|
@@ -4600,10 +4621,10 @@ const as = {
|
|
|
4600
4621
|
}, 0);
|
|
4601
4622
|
},
|
|
4602
4623
|
genSpaceOpts_: function() {
|
|
4603
|
-
return
|
|
4624
|
+
return he();
|
|
4604
4625
|
},
|
|
4605
4626
|
genTableOpts_: function() {
|
|
4606
|
-
return
|
|
4627
|
+
return de(this.space.id);
|
|
4607
4628
|
},
|
|
4608
4629
|
genColumnOpts_: function() {
|
|
4609
4630
|
const t = [];
|
|
@@ -4612,9 +4633,9 @@ const as = {
|
|
|
4612
4633
|
}), k(t);
|
|
4613
4634
|
},
|
|
4614
4635
|
onchange: function(t) {
|
|
4615
|
-
if (t.type ===
|
|
4636
|
+
if (t.type === B.STATE_CHANGE)
|
|
4616
4637
|
this.checkWarning_();
|
|
4617
|
-
else if (t.type ===
|
|
4638
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
4618
4639
|
const e = t;
|
|
4619
4640
|
if (e.blockId === this.id) {
|
|
4620
4641
|
if (e.element === "field") {
|
|
@@ -4715,8 +4736,8 @@ const as = {
|
|
|
4715
4736
|
initShape_: function() {
|
|
4716
4737
|
if (!this.isInFlyout && !this.getInput("ADD0"))
|
|
4717
4738
|
for (let t = 0; t < this.table.columns.length; t++) {
|
|
4718
|
-
const e = this.table.columns[t], n = new
|
|
4719
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
4739
|
+
const e = this.table.columns[t], n = new O(() => this.genColumnOpts_()), o = new lt("");
|
|
4740
|
+
this.appendDummyInput("ADD" + t).setAlign(C.Align.RIGHT).appendField(n, "COLUMN" + t).appendField("%{BKY_DATA_AS}").appendField(o, "ALIAS" + t), n.setValue(e.id, !1), o.setValue(e.name, !1);
|
|
4720
4741
|
}
|
|
4721
4742
|
},
|
|
4722
4743
|
updateShape_: function() {
|
|
@@ -4725,8 +4746,8 @@ const as = {
|
|
|
4725
4746
|
for (let t = 0; t < this.itemCount_; t++) {
|
|
4726
4747
|
if (this.getInput("ADD" + t))
|
|
4727
4748
|
continue;
|
|
4728
|
-
const e = new
|
|
4729
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
4749
|
+
const e = new O(() => this.genColumnOpts_()), n = new lt("");
|
|
4750
|
+
this.appendDummyInput("ADD" + t).setAlign(C.Align.RIGHT).appendField(e, "COLUMN" + t).appendField("%{BKY_DATA_AS}").appendField(n, "ALIAS" + t);
|
|
4730
4751
|
const o = this.table.columns[0];
|
|
4731
4752
|
e.setValue(o.id ?? "", !1), n.setValue(o.name ?? "", !1);
|
|
4732
4753
|
}
|
|
@@ -4770,7 +4791,7 @@ const cs = {
|
|
|
4770
4791
|
}, this.table = {
|
|
4771
4792
|
id: "",
|
|
4772
4793
|
name: ""
|
|
4773
|
-
}, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_TABLE_TITLE}").appendField(new
|
|
4794
|
+
}, this.appendDummyInput().appendField("%{BKY_DATA_V1_SELECT_TABLE_TITLE}").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => 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_();
|
|
4774
4795
|
},
|
|
4775
4796
|
initData_: function() {
|
|
4776
4797
|
if (this.space.id)
|
|
@@ -4798,15 +4819,15 @@ const cs = {
|
|
|
4798
4819
|
this.space.id = t.space?.id ?? "", this.space.name = t.space?.name ?? "", this.table.id = t.table?.id ?? "", this.table.name = t.table?.name ?? "", this.checkWarning_();
|
|
4799
4820
|
},
|
|
4800
4821
|
genSpaceOpts_: function() {
|
|
4801
|
-
return
|
|
4822
|
+
return he();
|
|
4802
4823
|
},
|
|
4803
4824
|
genTableOpts_: function() {
|
|
4804
|
-
return
|
|
4825
|
+
return de(this.space.id);
|
|
4805
4826
|
},
|
|
4806
4827
|
onchange: function(t) {
|
|
4807
|
-
if (t.type ===
|
|
4828
|
+
if (t.type === B.STATE_CHANGE)
|
|
4808
4829
|
this.checkWarning_();
|
|
4809
|
-
else if (t.type ===
|
|
4830
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
4810
4831
|
const e = t;
|
|
4811
4832
|
e.blockId === this.id && (e.element === "field" && (e.name === "SPACE" ? this.onSpaceChange_(e.newValue) : e.name === "TABLE" && this.onTableChange_(e.newValue)), setTimeout(() => {
|
|
4812
4833
|
this.checkWarning_();
|
|
@@ -4940,7 +4961,7 @@ const _s = {
|
|
|
4940
4961
|
id: "",
|
|
4941
4962
|
name: "",
|
|
4942
4963
|
columns: []
|
|
4943
|
-
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_UPDATE_COLUMN_TITLE}").appendField(new
|
|
4964
|
+
}, this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_DATA_V1_UPDATE_COLUMN_TITLE}").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => this.genTableOpts_()), "TABLE"), this.setMutator(
|
|
4944
4965
|
new ht.MutatorIcon(
|
|
4945
4966
|
["update_column_item_v1"],
|
|
4946
4967
|
this
|
|
@@ -4976,10 +4997,10 @@ const _s = {
|
|
|
4976
4997
|
}, 0);
|
|
4977
4998
|
},
|
|
4978
4999
|
genSpaceOpts_: function() {
|
|
4979
|
-
return
|
|
5000
|
+
return he();
|
|
4980
5001
|
},
|
|
4981
5002
|
genTableOpts_: function() {
|
|
4982
|
-
return
|
|
5003
|
+
return de(this.space.id);
|
|
4983
5004
|
},
|
|
4984
5005
|
genColumnOpts_: function() {
|
|
4985
5006
|
const t = [];
|
|
@@ -4988,9 +5009,9 @@ const _s = {
|
|
|
4988
5009
|
}), k(t);
|
|
4989
5010
|
},
|
|
4990
5011
|
onchange: function(t) {
|
|
4991
|
-
if (t.type ===
|
|
5012
|
+
if (t.type === B.STATE_CHANGE)
|
|
4992
5013
|
this.checkWarning_();
|
|
4993
|
-
else if (t.type ===
|
|
5014
|
+
else if (t.type === I.BLOCK_CHANGE) {
|
|
4994
5015
|
const e = t;
|
|
4995
5016
|
if (e.blockId === this.id) {
|
|
4996
5017
|
if (e.element === "field") {
|
|
@@ -5044,7 +5065,7 @@ const _s = {
|
|
|
5044
5065
|
}
|
|
5045
5066
|
const o = this.getInput("ADD" + t).connection, i = o.targetBlock();
|
|
5046
5067
|
i && i.dispose();
|
|
5047
|
-
const a =
|
|
5068
|
+
const a = Ue(this.workspace, n.type);
|
|
5048
5069
|
a && (o.setCheck(null), o.connect(a.outputConnection)), this.updateCheck_();
|
|
5049
5070
|
},
|
|
5050
5071
|
decompose: function(t) {
|
|
@@ -5101,8 +5122,8 @@ const _s = {
|
|
|
5101
5122
|
initShape_: function() {
|
|
5102
5123
|
if (!this.isInFlyout && !this.getInput("ADD0"))
|
|
5103
5124
|
for (let t = 0; t < this.table.columns.length; t++) {
|
|
5104
|
-
const e = this.table.columns[t], n = new
|
|
5105
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5125
|
+
const e = this.table.columns[t], n = new O(() => this.genColumnOpts_());
|
|
5126
|
+
this.appendValueInput("ADD" + t).setAlign(C.Align.RIGHT).appendField(n, "COLUMN" + t), n.setValue(e.id, !1);
|
|
5106
5127
|
}
|
|
5107
5128
|
},
|
|
5108
5129
|
updateShape_: function() {
|
|
@@ -5113,8 +5134,8 @@ const _s = {
|
|
|
5113
5134
|
for (let t = 0; t < this.itemCount_; t++) {
|
|
5114
5135
|
if (this.getInput("ADD" + t))
|
|
5115
5136
|
continue;
|
|
5116
|
-
const e = new
|
|
5117
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5137
|
+
const e = new O(() => this.genColumnOpts_());
|
|
5138
|
+
this.appendValueInput("ADD" + t).setAlign(C.Align.RIGHT).appendField(e, "COLUMN" + t);
|
|
5118
5139
|
}
|
|
5119
5140
|
},
|
|
5120
5141
|
updateBlocks_: function(t) {
|
|
@@ -5129,7 +5150,7 @@ const _s = {
|
|
|
5129
5150
|
if (!r)
|
|
5130
5151
|
continue;
|
|
5131
5152
|
n.setCheck(null);
|
|
5132
|
-
const u =
|
|
5153
|
+
const u = Ue(this.workspace, r.type);
|
|
5133
5154
|
u && o.connect(u.outputConnection);
|
|
5134
5155
|
}
|
|
5135
5156
|
},
|
|
@@ -5138,7 +5159,7 @@ const _s = {
|
|
|
5138
5159
|
const e = this.getFieldValue("COLUMN" + t), n = this.table.columns.find((i) => i.id === e);
|
|
5139
5160
|
if (!n)
|
|
5140
5161
|
continue;
|
|
5141
|
-
const o =
|
|
5162
|
+
const o = Dn(n.type);
|
|
5142
5163
|
this.getInput("ADD" + t).setCheck(o);
|
|
5143
5164
|
}
|
|
5144
5165
|
},
|
|
@@ -5253,7 +5274,7 @@ const fs = {
|
|
|
5253
5274
|
}, 0);
|
|
5254
5275
|
},
|
|
5255
5276
|
updateShape_: function() {
|
|
5256
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(
|
|
5277
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_DATA_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "SUCCESS")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("UpdateColumn").setAlign(C.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
5257
5278
|
},
|
|
5258
5279
|
ensureBlocks: function() {
|
|
5259
5280
|
this.isInsertionMarker() || (ps(this), hs(this), F(this, [
|
|
@@ -5280,9 +5301,9 @@ ${e}}
|
|
|
5280
5301
|
${i}}
|
|
5281
5302
|
`;
|
|
5282
5303
|
};
|
|
5283
|
-
const ms =
|
|
5304
|
+
const ms = v.xml, Ts = {
|
|
5284
5305
|
init: function() {
|
|
5285
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(
|
|
5306
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(C.Align.CENTRE).appendField(
|
|
5286
5307
|
new z(Ot, 20, 20, void 0, () => {
|
|
5287
5308
|
this.isInFlyout || this.addEntry_();
|
|
5288
5309
|
})
|
|
@@ -5305,7 +5326,7 @@ const ms = C.xml, Ts = {
|
|
|
5305
5326
|
new z(Ot, 20, 20, void 0, () => {
|
|
5306
5327
|
this.isInFlyout || this.addEntry_(n);
|
|
5307
5328
|
})
|
|
5308
|
-
), n.appendField(new
|
|
5329
|
+
), n.appendField(new cn(String(t))), n.appendField(
|
|
5309
5330
|
new z(Wt, 20, 20, void 0, () => {
|
|
5310
5331
|
this.isInFlyout || this.removeEntry_(n);
|
|
5311
5332
|
})
|
|
@@ -5324,7 +5345,7 @@ const ms = C.xml, Ts = {
|
|
|
5324
5345
|
new z(Ot, 20, 20, void 0, () => {
|
|
5325
5346
|
this.isInFlyout || this.addEntry_(n);
|
|
5326
5347
|
})
|
|
5327
|
-
), n.appendField(new
|
|
5348
|
+
), n.appendField(new cn(String(e))), n.appendField(
|
|
5328
5349
|
new z(Wt, 20, 20, void 0, () => {
|
|
5329
5350
|
this.isInFlyout || this.removeEntry_(n);
|
|
5330
5351
|
})
|
|
@@ -5345,7 +5366,7 @@ d.json_array_v1 = Ts;
|
|
|
5345
5366
|
const Es = {
|
|
5346
5367
|
init: function() {
|
|
5347
5368
|
this.appendDummyInput().appendField(
|
|
5348
|
-
new
|
|
5369
|
+
new In([
|
|
5349
5370
|
["false", "false"],
|
|
5350
5371
|
["true", "true"]
|
|
5351
5372
|
]),
|
|
@@ -5354,18 +5375,18 @@ const Es = {
|
|
|
5354
5375
|
}
|
|
5355
5376
|
};
|
|
5356
5377
|
d.json_boolean_v1 = Es;
|
|
5357
|
-
const
|
|
5378
|
+
const fn = v.xml, gs = {
|
|
5358
5379
|
init: function() {
|
|
5359
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(
|
|
5380
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(C.Align.CENTRE).appendField(
|
|
5360
5381
|
new z(Ot, 20, 20, void 0, () => {
|
|
5361
5382
|
this.isInFlyout || this.addEntry_();
|
|
5362
5383
|
})
|
|
5363
5384
|
), this.appendDummyInput("CLOSE_BRACHET").appendField(" } "), this.setInputsInline(!1), this.setOutput(!0, "JsonMap"), this.setColour(120), this.setTooltip(""), this.setHelpUrl("");
|
|
5364
5385
|
},
|
|
5365
5386
|
mutationToDom: function() {
|
|
5366
|
-
const t =
|
|
5387
|
+
const t = fn.createElement("mutation");
|
|
5367
5388
|
for (let e = 0; e < this.length; e++) {
|
|
5368
|
-
const n =
|
|
5389
|
+
const n = fn.createElement("item");
|
|
5369
5390
|
n.setAttribute("key", this.getFieldValue("KEY" + e)), t.appendChild(n);
|
|
5370
5391
|
}
|
|
5371
5392
|
return t;
|
|
@@ -5423,13 +5444,13 @@ const dn = C.xml, gs = {
|
|
|
5423
5444
|
d.json_map_v1 = gs;
|
|
5424
5445
|
const As = {
|
|
5425
5446
|
init: function() {
|
|
5426
|
-
this.appendDummyInput().appendField(new
|
|
5447
|
+
this.appendDummyInput().appendField(new De(0), "VALUE"), this.setOutput(!0, "JsonNumber"), this.setColour(230);
|
|
5427
5448
|
}
|
|
5428
5449
|
};
|
|
5429
5450
|
d.json_number_v1 = As;
|
|
5430
5451
|
const Is = {
|
|
5431
5452
|
init: function() {
|
|
5432
|
-
this.appendDummyInput().setAlign(
|
|
5453
|
+
this.appendDummyInput().setAlign(C.Align.CENTRE).appendField("JSON"), this.appendValueInput("JSON").setCheck(["JsonMap", "JsonArray"]), this.setDeletable(!1), this.setColour(250), this.setTooltip(""), this.setHelpUrl("");
|
|
5433
5454
|
}
|
|
5434
5455
|
};
|
|
5435
5456
|
d.json_root_v1 = Is;
|
|
@@ -5439,12 +5460,12 @@ const Os = {
|
|
|
5439
5460
|
}
|
|
5440
5461
|
};
|
|
5441
5462
|
d.json_string_v1 = Os;
|
|
5442
|
-
const
|
|
5463
|
+
const Cs = v.xml, vs = {
|
|
5443
5464
|
init: function() {
|
|
5444
5465
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
5445
5466
|
}
|
|
5446
5467
|
};
|
|
5447
|
-
d.list_create_container_v1 =
|
|
5468
|
+
d.list_create_container_v1 = vs;
|
|
5448
5469
|
const ys = {
|
|
5449
5470
|
init: function() {
|
|
5450
5471
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
@@ -5461,7 +5482,7 @@ const ks = {
|
|
|
5461
5482
|
), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}"), this.updateShape_();
|
|
5462
5483
|
},
|
|
5463
5484
|
mutationToDom: function() {
|
|
5464
|
-
const t =
|
|
5485
|
+
const t = Cs.createElement("mutation");
|
|
5465
5486
|
return t.setAttribute("items", String(this.itemCount_)), t;
|
|
5466
5487
|
},
|
|
5467
5488
|
domToMutation: function(t) {
|
|
@@ -5528,7 +5549,7 @@ const ks = {
|
|
|
5528
5549
|
"Boolean",
|
|
5529
5550
|
"Array",
|
|
5530
5551
|
"Object"
|
|
5531
|
-
]), t === 0 && this.getInput("ADD" + t).setAlign(
|
|
5552
|
+
]), t === 0 && this.getInput("ADD" + t).setAlign(C.Align.RIGHT).appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
5532
5553
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
5533
5554
|
this.removeInput("ADD" + t);
|
|
5534
5555
|
}
|
|
@@ -5796,11 +5817,11 @@ const Ls = {
|
|
|
5796
5817
|
e.outputConnection,
|
|
5797
5818
|
n.outputConnection
|
|
5798
5819
|
)) {
|
|
5799
|
-
|
|
5820
|
+
I.setGroup(t.group);
|
|
5800
5821
|
const o = this.prevBlocks_[0];
|
|
5801
5822
|
o !== e && (e.unplug(), o && !o.isDisposed() && !o.isShadow() && this.getInput("A").connection.connect(o.outputConnection));
|
|
5802
5823
|
const i = this.prevBlocks_[1];
|
|
5803
|
-
i !== n && (n.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(),
|
|
5824
|
+
i !== n && (n.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), I.setGroup(!1);
|
|
5804
5825
|
}
|
|
5805
5826
|
this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
|
|
5806
5827
|
}
|
|
@@ -5864,7 +5885,7 @@ const Ss = {
|
|
|
5864
5885
|
mutationToDom: function() {
|
|
5865
5886
|
if (this.elseIfCount_ <= 0 && !this.hasElse_)
|
|
5866
5887
|
return null;
|
|
5867
|
-
const t =
|
|
5888
|
+
const t = v.xml.createElement("mutation");
|
|
5868
5889
|
return this.elseIfCount_ > 0 && t.setAttribute("elseIf", String(this.elseIfCount_)), this.hasElse_ && t.setAttribute("else", "TRUE"), t;
|
|
5869
5890
|
},
|
|
5870
5891
|
domToMutation: function(t) {
|
|
@@ -6141,7 +6162,7 @@ const Bs = {
|
|
|
6141
6162
|
a && !a.workspace.connectionChecker.doTypeChecks(
|
|
6142
6163
|
a.outputConnection,
|
|
6143
6164
|
o
|
|
6144
|
-
) && (
|
|
6165
|
+
) && (I.setGroup(t.group), o === this.prevParentConnection_ ? (this.unplug(), o.getSourceBlock().bumpNeighbours()) : (a.unplug(), a.bumpNeighbours()), I.setGroup(!1));
|
|
6145
6166
|
}
|
|
6146
6167
|
this.prevParentConnection_ = o;
|
|
6147
6168
|
}
|
|
@@ -6231,14 +6252,14 @@ const Ps = /* @__PURE__ */ new Set([
|
|
|
6231
6252
|
},
|
|
6232
6253
|
onchange: function(t) {
|
|
6233
6254
|
const e = this.workspace;
|
|
6234
|
-
if (!e.isDragging || e.isDragging() || t.type !==
|
|
6255
|
+
if (!e.isDragging || e.isDragging() || t.type !== I.BLOCK_MOVE && t.type !== I.BLOCK_CREATE)
|
|
6235
6256
|
return;
|
|
6236
6257
|
const n = this.getSurroundLoop();
|
|
6237
6258
|
if (this.setWarningText(n ? null : p("LOOP_FLOW_CONTROL_WARNING")), !this.isInFlyout)
|
|
6238
6259
|
try {
|
|
6239
|
-
|
|
6260
|
+
I.setRecordUndo(!1), this.setDisabledReason(!n, "FLOW_CONTROL_NOT_IN_LOOP");
|
|
6240
6261
|
} finally {
|
|
6241
|
-
|
|
6262
|
+
I.setRecordUndo(!0);
|
|
6242
6263
|
}
|
|
6243
6264
|
}
|
|
6244
6265
|
};
|
|
@@ -6351,7 +6372,7 @@ s.forBlock.for_v1 = function(t) {
|
|
|
6351
6372
|
s.statementToCode(t, "DO"),
|
|
6352
6373
|
t
|
|
6353
6374
|
);
|
|
6354
|
-
if (
|
|
6375
|
+
if (v.string.isNumber(o) && v.string.isNumber(i) && v.string.isNumber(a)) {
|
|
6355
6376
|
const u = Math.abs(Number(a));
|
|
6356
6377
|
return Number(o) <= Number(i) ? `for (${n} = ${o}; ${n} <= ${i}; ${n} += ${u}) {
|
|
6357
6378
|
${r}}
|
|
@@ -6360,13 +6381,13 @@ ${r}}
|
|
|
6360
6381
|
`;
|
|
6361
6382
|
} else {
|
|
6362
6383
|
let u = "", l = o;
|
|
6363
|
-
!o.match(/^\w+$/) && !
|
|
6384
|
+
!o.match(/^\w+$/) && !v.string.isNumber(o) && (l = s.nameDB_.getDistinctName(
|
|
6364
6385
|
`${n}_from`,
|
|
6365
6386
|
et.NameType.VARIABLE
|
|
6366
6387
|
), u += `var ${l} = ${o};
|
|
6367
6388
|
`);
|
|
6368
6389
|
let _ = i;
|
|
6369
|
-
!i.match(/^\w+$/) && !
|
|
6390
|
+
!i.match(/^\w+$/) && !v.string.isNumber(i) && (_ = s.nameDB_.getDistinctName(
|
|
6370
6391
|
`${n}_to`,
|
|
6371
6392
|
et.NameType.VARIABLE
|
|
6372
6393
|
), u += `var ${_} = ${i};
|
|
@@ -6375,7 +6396,7 @@ ${r}}
|
|
|
6375
6396
|
`${n}_by`,
|
|
6376
6397
|
et.NameType.VARIABLE
|
|
6377
6398
|
);
|
|
6378
|
-
return u += `var ${T} = `,
|
|
6399
|
+
return u += `var ${T} = `, v.string.isNumber(a) ? u += `${Math.abs(Number(a))};
|
|
6379
6400
|
` : u += `Math.abs(${a});
|
|
6380
6401
|
`, u += `if (${l} > ${_}) {
|
|
6381
6402
|
${e}${T} = -${T};
|
|
@@ -6482,7 +6503,7 @@ s.forBlock.repeat_v1 = function(t) {
|
|
|
6482
6503
|
et.NameType.VARIABLE
|
|
6483
6504
|
);
|
|
6484
6505
|
let a = e;
|
|
6485
|
-
return !e.match(/^\w+$/) && !
|
|
6506
|
+
return !e.match(/^\w+$/) && !v.string.isNumber(e) && (a = s.nameDB_.getDistinctName(
|
|
6486
6507
|
"repeat_end",
|
|
6487
6508
|
et.NameType.VARIABLE
|
|
6488
6509
|
), o += `var ${a} = ${e};
|
|
@@ -7183,7 +7204,7 @@ s.forBlock.math_trig_v1 = function(t) {
|
|
|
7183
7204
|
}
|
|
7184
7205
|
return [o, c.DIVISION];
|
|
7185
7206
|
};
|
|
7186
|
-
const Ms =
|
|
7207
|
+
const Ms = v.xml, Us = {
|
|
7187
7208
|
init: function() {
|
|
7188
7209
|
this.appendDummyInput().appendField(
|
|
7189
7210
|
"%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
|
|
@@ -7266,7 +7287,7 @@ const xs = {
|
|
|
7266
7287
|
},
|
|
7267
7288
|
updateShape_: function() {
|
|
7268
7289
|
for (let t = 0; t < this.itemCount_; t++)
|
|
7269
|
-
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(
|
|
7290
|
+
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(C.Align.RIGHT).appendField(new lt("key"), "KEY" + t);
|
|
7270
7291
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
7271
7292
|
this.removeInput("ADD" + t);
|
|
7272
7293
|
}
|
|
@@ -7513,15 +7534,15 @@ h([
|
|
|
7513
7534
|
s.forBlock.object_to_json_v1 = function(t) {
|
|
7514
7535
|
return [`__jsonStringifyV1__(${s.valueToCode(t, "OBJECT", c.NONE) || "null"})`, c.FUNCTION_CALL];
|
|
7515
7536
|
};
|
|
7516
|
-
const
|
|
7537
|
+
const mn = v.xml, Fs = {
|
|
7517
7538
|
init: function() {
|
|
7518
|
-
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new
|
|
7539
|
+
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new vo(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
7519
7540
|
}
|
|
7520
7541
|
};
|
|
7521
7542
|
d.procedure_def_container_v1 = Fs;
|
|
7522
7543
|
const Ys = {
|
|
7523
7544
|
init: function() {
|
|
7524
|
-
const t = new lt(
|
|
7545
|
+
const t = new lt(Me.DEFAULT_ARG);
|
|
7525
7546
|
t.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(t, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
7526
7547
|
},
|
|
7527
7548
|
validator_: function(t) {
|
|
@@ -7546,9 +7567,9 @@ const ws = {
|
|
|
7546
7567
|
init: function() {
|
|
7547
7568
|
this.withReturn = !1, this.args = [];
|
|
7548
7569
|
const t = new lt(
|
|
7549
|
-
|
|
7570
|
+
Me.findLegalName("", this)
|
|
7550
7571
|
);
|
|
7551
|
-
t.setValidator(
|
|
7572
|
+
t.setValidator(Me.rename), t.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(t, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
|
|
7552
7573
|
new ht.MutatorIcon(
|
|
7553
7574
|
["procedure_def_item_v1"],
|
|
7554
7575
|
this
|
|
@@ -7556,9 +7577,9 @@ const ws = {
|
|
|
7556
7577
|
), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_DEF_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_DEF_HELPURL}");
|
|
7557
7578
|
},
|
|
7558
7579
|
mutationToDom: function() {
|
|
7559
|
-
const t =
|
|
7580
|
+
const t = mn.createElement("mutation");
|
|
7560
7581
|
return t.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((e) => {
|
|
7561
|
-
const n =
|
|
7582
|
+
const n = mn.createElement("arg");
|
|
7562
7583
|
n.setAttribute("name", e.name), n.setAttribute("id", e.id), t.appendChild(n);
|
|
7563
7584
|
}), t;
|
|
7564
7585
|
},
|
|
@@ -7634,20 +7655,20 @@ const ws = {
|
|
|
7634
7655
|
o.setKeyName(`__param@${e.id}__`, e.name, !1);
|
|
7635
7656
|
else
|
|
7636
7657
|
try {
|
|
7637
|
-
|
|
7658
|
+
I.disable(), o = We(
|
|
7638
7659
|
this.workspace,
|
|
7639
7660
|
`__param@${e.id}__`,
|
|
7640
7661
|
e.name,
|
|
7641
7662
|
!1
|
|
7642
7663
|
), o.outputConnection.connect(n);
|
|
7643
7664
|
} finally {
|
|
7644
|
-
|
|
7665
|
+
I.enable();
|
|
7645
7666
|
}
|
|
7646
7667
|
}
|
|
7647
7668
|
}
|
|
7648
7669
|
};
|
|
7649
7670
|
d.procedure_def_v1 = ws;
|
|
7650
|
-
const Ks =
|
|
7671
|
+
const Ks = v.xml, $s = {
|
|
7651
7672
|
init: function() {
|
|
7652
7673
|
this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
|
|
7653
7674
|
},
|
|
@@ -7671,9 +7692,9 @@ const Ks = C.xml, $s = {
|
|
|
7671
7692
|
}, 0);
|
|
7672
7693
|
},
|
|
7673
7694
|
onchange: function(t) {
|
|
7674
|
-
if (t.type ===
|
|
7695
|
+
if (t.type === B.STATE_CHANGE)
|
|
7675
7696
|
this.checkWarning_();
|
|
7676
|
-
else if (t.type ===
|
|
7697
|
+
else if (t.type === I.BLOCK_DRAG) {
|
|
7677
7698
|
const e = t;
|
|
7678
7699
|
if (e.isStart || !e.blocks?.find((n) => n.id === this.id))
|
|
7679
7700
|
return;
|
|
@@ -7723,7 +7744,7 @@ const Hs = {
|
|
|
7723
7744
|
}, 0);
|
|
7724
7745
|
},
|
|
7725
7746
|
updateShape_: function() {
|
|
7726
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_ASSET_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_ASSET_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("ASSET") || (this.appendValueInput("ASSET").setCheck("Resource").setAlign(
|
|
7747
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_ASSET_DO}"), this.getInput("DATA") || (this.appendValueInput("DATA"), this.moveInputBefore("DATA", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "DATA")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_ASSET_RETURN}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("ASSET") || (this.appendValueInput("ASSET").setCheck("Resource").setAlign(C.Align.RIGHT).appendField("%{BKY_ASSET_ASSET}"), this.moveInputBefore("ASSET", "SUCCESS"));
|
|
7727
7748
|
},
|
|
7728
7749
|
ensureBlocks_: function() {
|
|
7729
7750
|
this.isInsertionMarker() || F(this, [
|
|
@@ -7805,8 +7826,8 @@ const Xs = {
|
|
|
7805
7826
|
}, this.resource = {
|
|
7806
7827
|
id: "",
|
|
7807
7828
|
name: ""
|
|
7808
|
-
}, this.appendDummyInput().appendField("%{BKY_RESOURCE_V1_SELECT_RESOURCE_TITLE").appendField(new
|
|
7809
|
-
new
|
|
7829
|
+
}, this.appendDummyInput().appendField("%{BKY_RESOURCE_V1_SELECT_RESOURCE_TITLE").appendField(new O(() => this.genSpaceOpts_()), "SPACE").appendField(new O(() => this.genDirOpts_()), "DIR").appendField(
|
|
7830
|
+
new O(() => this.genResourceOpts_()),
|
|
7810
7831
|
"RESOURCE"
|
|
7811
7832
|
), 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_();
|
|
7812
7833
|
},
|
|
@@ -7871,7 +7892,7 @@ const Js = {
|
|
|
7871
7892
|
}, 0);
|
|
7872
7893
|
},
|
|
7873
7894
|
updateShape_: function() {
|
|
7874
|
-
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_RESOURCE_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "RESULT")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_RESOURCE_RESULT}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("DATA") || (this.appendValueInput("DATA").setAlign(
|
|
7895
|
+
this.getInput("HANDLE") || this.appendStatementInput("HANDLE").appendField("%{BKY_RESOURCE_DO}"), this.getInput("RESULT") || (this.appendValueInput("RESULT"), this.moveInputBefore("RESULT", "HANDLE")), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "RESULT")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS").appendField("%{BKY_RESOURCE_RESULT}"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("DATA") || (this.appendValueInput("DATA").setAlign(C.Align.RIGHT).appendField("%{BKY_RESOURCE_DATA}"), this.moveInputBefore("DATA", "SUCCESS")), this.getInput("DIR") || (this.appendValueInput("DIR").setCheck("SelectDir").setAlign(C.Align.RIGHT).appendField("%{BKY_RESOURCE_DIR}"), this.moveInputBefore("DIR", "DATA")), this.getInput("NAME") || (this.appendValueInput("NAME").setCheck("String").setAlign(C.Align.RIGHT).appendField("%{BKY_RESOURCE_NAME}"), this.moveInputBefore("NAME", "DIR"));
|
|
7875
7896
|
},
|
|
7876
7897
|
updateShadow_: function() {
|
|
7877
7898
|
if (this.isInsertionMarker())
|
|
@@ -8126,7 +8147,7 @@ h([
|
|
|
8126
8147
|
s.forBlock.text_is_empty_v1 = function(t) {
|
|
8127
8148
|
return [`!${s.valueToCode(t, "VALUE", c.MEMBER) || "''"}.length`, c.LOGICAL_NOT];
|
|
8128
8149
|
};
|
|
8129
|
-
const Qs =
|
|
8150
|
+
const Qs = v.xml, zs = {
|
|
8130
8151
|
itemCount_: 0,
|
|
8131
8152
|
mutationToDom: function() {
|
|
8132
8153
|
const t = Qs.createElement("mutation");
|
|
@@ -8193,7 +8214,7 @@ const Qs = C.xml, zs = {
|
|
|
8193
8214
|
for (let t = 0; t < this.itemCount_; t++)
|
|
8194
8215
|
if (!this.getInput("ADD" + t)) {
|
|
8195
8216
|
const e = this.appendValueInput("ADD" + t).setAlign(
|
|
8196
|
-
|
|
8217
|
+
C.Align.RIGHT
|
|
8197
8218
|
);
|
|
8198
8219
|
t === 0 && e.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
8199
8220
|
}
|
|
@@ -8449,7 +8470,7 @@ const ta = {
|
|
|
8449
8470
|
this.updateShape_(), this.updateShadow_();
|
|
8450
8471
|
},
|
|
8451
8472
|
updateShape_: function() {
|
|
8452
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
8473
|
+
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(C.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(C.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(C.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(C.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
|
|
8453
8474
|
},
|
|
8454
8475
|
updateShadow_: function() {
|
|
8455
8476
|
if (this.isInsertionMarker())
|
|
@@ -8591,7 +8612,7 @@ s.forBlock.variable_set_v1 = function(t) {
|
|
|
8591
8612
|
return `${e} = ${n};
|
|
8592
8613
|
`;
|
|
8593
8614
|
};
|
|
8594
|
-
const x =
|
|
8615
|
+
const x = v.xml;
|
|
8595
8616
|
function V(t) {
|
|
8596
8617
|
const e = x.createElement("label");
|
|
8597
8618
|
return e.setAttribute("text", t), e;
|
|
@@ -8609,7 +8630,7 @@ function Jn(t) {
|
|
|
8609
8630
|
e.setAttribute(n, o);
|
|
8610
8631
|
return e;
|
|
8611
8632
|
}
|
|
8612
|
-
function
|
|
8633
|
+
function vt(t, e) {
|
|
8613
8634
|
e === void 0 && (e = "");
|
|
8614
8635
|
const n = x.createElement("value");
|
|
8615
8636
|
n.setAttribute("name", t);
|
|
@@ -8620,7 +8641,7 @@ function Ct(t, e) {
|
|
|
8620
8641
|
const a = x.createTextNode(e);
|
|
8621
8642
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
8622
8643
|
}
|
|
8623
|
-
function
|
|
8644
|
+
function Tn(t, e) {
|
|
8624
8645
|
e === void 0 && (e = 0);
|
|
8625
8646
|
const n = x.createElement("value");
|
|
8626
8647
|
n.setAttribute("name", t);
|
|
@@ -8648,26 +8669,26 @@ function sa() {
|
|
|
8648
8669
|
function aa() {
|
|
8649
8670
|
return f.app.activeObject.type === "comp" && f.app.activeComp.meta.states.length > 0;
|
|
8650
8671
|
}
|
|
8651
|
-
function
|
|
8672
|
+
function En() {
|
|
8652
8673
|
return f.app.activeObject.type === "comp" && f.app.activeComp.meta.methods.length > 0;
|
|
8653
8674
|
}
|
|
8654
8675
|
function ca() {
|
|
8655
8676
|
const t = [];
|
|
8656
8677
|
return t.push(V(p("LABEL_EVENT"))), G("onEvent") && t.push(A("on_app_event_v1")), sa() && t.push(A("trigger_app_event_v1")), t.push(
|
|
8657
8678
|
A("app_bind_v1", [Jn([{ key: "items", value: "2" }])])
|
|
8658
|
-
), t.push(A("watch_effect_v1")), (G("getProp") || G("setProp")) && t.push(V(p("LABEL_PROPERTY"))), G("getProp") && t.push(A("get_app_prop_v1")), G("setProp") && t.push(A("set_app_prop_v1")), aa() && (t.push(V(p("LABEL_STATE"))), t.push(A("get_app_state_v1")), t.push(A("set_app_state_v1"))), (G("callMethod") ||
|
|
8679
|
+
), t.push(A("watch_effect_v1")), (G("getProp") || G("setProp")) && t.push(V(p("LABEL_PROPERTY"))), G("getProp") && t.push(A("get_app_prop_v1")), G("setProp") && t.push(A("set_app_prop_v1")), aa() && (t.push(V(p("LABEL_STATE"))), t.push(A("get_app_state_v1")), t.push(A("set_app_state_v1"))), (G("callMethod") || En()) && t.push(V(p("LABEL_METHOD"))), G("callMethod") && t.push(A("call_app_method_v1")), En() && (t.push(A("impl_app_method_v1")), t.push(A("set_app_method_output_v1")), t.push(A("procedure_return_v1"))), t;
|
|
8659
8680
|
}
|
|
8660
8681
|
const qn = { name: "APP_COMP_CATEGORY", callback: ca };
|
|
8661
8682
|
function ra() {
|
|
8662
8683
|
const t = [];
|
|
8663
8684
|
return t.push(V(p("LABEL_FUNC"))), t.push(V(p("LABEL_FLOW"))), t;
|
|
8664
8685
|
}
|
|
8665
|
-
const
|
|
8686
|
+
const te = { name: "APP_COMPUTE_CATEGORY", callback: ra };
|
|
8666
8687
|
function ua() {
|
|
8667
8688
|
const t = [];
|
|
8668
|
-
return t.push(A("app_debug_trace_v1", [
|
|
8689
|
+
return t.push(A("app_debug_trace_v1", [vt("OBJECT")])), t.push(A("popup_message_v1", [vt("TEXT")])), t.push(A("open_confirm_dlg_v1")), t.push(A("open_prompt_dlg_v1")), t;
|
|
8669
8690
|
}
|
|
8670
|
-
const
|
|
8691
|
+
const ee = { name: "APP_MESSAGE_CATEGORY", callback: ua };
|
|
8671
8692
|
function la() {
|
|
8672
8693
|
for (const t of f.app.appList)
|
|
8673
8694
|
if (t.pages.length > 0)
|
|
@@ -8678,7 +8699,7 @@ function _a() {
|
|
|
8678
8699
|
const t = [];
|
|
8679
8700
|
return t.push(A("app_env_is_v1")), la() && t.push(A("navigate_to_v1")), t;
|
|
8680
8701
|
}
|
|
8681
|
-
const
|
|
8702
|
+
const ne = { name: "APP_MISC_CATEGORY", callback: _a };
|
|
8682
8703
|
function pa() {
|
|
8683
8704
|
return f.app.activeObject.type === "page" && f.app.activePage.meta.states.length > 0;
|
|
8684
8705
|
}
|
|
@@ -8696,7 +8717,7 @@ function fa() {
|
|
|
8696
8717
|
const t = [];
|
|
8697
8718
|
return t.push(V(p("LABEL_RESOURCE"))), t.push(A("upload_resource_v1")), t;
|
|
8698
8719
|
}
|
|
8699
|
-
const
|
|
8720
|
+
const oe = { name: "APP_RESOURCE_CATEGORY", callback: fa }, St = v.xml;
|
|
8700
8721
|
function ma() {
|
|
8701
8722
|
const t = [];
|
|
8702
8723
|
{
|
|
@@ -8723,7 +8744,7 @@ function ma() {
|
|
|
8723
8744
|
const at = {
|
|
8724
8745
|
name: "PROCEDURE_CATEGORY",
|
|
8725
8746
|
callback: ma
|
|
8726
|
-
}, Kt =
|
|
8747
|
+
}, Kt = v.xml;
|
|
8727
8748
|
function Ta() {
|
|
8728
8749
|
const t = Ut(), e = [];
|
|
8729
8750
|
{
|
|
@@ -8768,15 +8789,15 @@ function Ea() {
|
|
|
8768
8789
|
const t = [];
|
|
8769
8790
|
if (q().length > 0)
|
|
8770
8791
|
t.push(V(p("LABEL_OPERATION"))), t.push(A("add_data_v1")), t.push(A("delete_data_v1")), t.push(A("update_data_v1")), t.push(A("query_data_v1")), t.push(A("transaction_v1")), t.push(
|
|
8771
|
-
A("interrupt_transaction_v1", [
|
|
8772
|
-
), t.push(V(p("LABEL_CONDITION"))), t.push(A("cond_logic_v1")), t.push(A("cond_atomic_v1", [
|
|
8792
|
+
A("interrupt_transaction_v1", [vt("VALUE")])
|
|
8793
|
+
), t.push(V(p("LABEL_CONDITION"))), t.push(A("cond_logic_v1")), t.push(A("cond_atomic_v1", [vt("VALUE")])), t.push(V(p("LABEL_QUERY_EXTRA"))), t.push(
|
|
8773
8794
|
A("query_extra_limit_v1", [
|
|
8774
|
-
|
|
8775
|
-
|
|
8795
|
+
Tn("OFFSET", 0),
|
|
8796
|
+
Tn("LIMIT", 1)
|
|
8776
8797
|
])
|
|
8777
8798
|
), t.push(
|
|
8778
8799
|
A("query_extra_sortby_v1", [
|
|
8779
|
-
|
|
8800
|
+
vt("COLUMN"),
|
|
8780
8801
|
ia("DESC")
|
|
8781
8802
|
])
|
|
8782
8803
|
);
|
|
@@ -8786,7 +8807,7 @@ function Ea() {
|
|
|
8786
8807
|
}
|
|
8787
8808
|
return t;
|
|
8788
8809
|
}
|
|
8789
|
-
const
|
|
8810
|
+
const ie = { name: "COMPUTE_DATA_CATEGORY", callback: Ea };
|
|
8790
8811
|
function ga() {
|
|
8791
8812
|
return Yt("flow").length > 0;
|
|
8792
8813
|
}
|
|
@@ -8794,7 +8815,7 @@ function Aa() {
|
|
|
8794
8815
|
const t = [];
|
|
8795
8816
|
return f.compute.activeObject.type === "flow" && t.push(A("on_flow_state_event_v1")), ga() && console.assert(!0), t;
|
|
8796
8817
|
}
|
|
8797
|
-
const
|
|
8818
|
+
const se = { name: "COMPUTE_FLOW_CATEGORY", callback: Aa };
|
|
8798
8819
|
function Ia() {
|
|
8799
8820
|
return Yt("func").length > 0;
|
|
8800
8821
|
}
|
|
@@ -8802,29 +8823,29 @@ function Oa() {
|
|
|
8802
8823
|
const t = [];
|
|
8803
8824
|
return f.compute.activeObject.type === "func" && (t.push(A("func_entry_v1")), f.compute.activeFunc.outputs.length > 0 && t.push(A("set_func_output_v1")), t.push(A("procedure_return_v1"))), Ia() && t.push(A("call_func_internal_v1")), t;
|
|
8804
8825
|
}
|
|
8805
|
-
const
|
|
8806
|
-
function
|
|
8826
|
+
const ae = { name: "COMPUTE_FUNC_CATEGORY", callback: Oa };
|
|
8827
|
+
function Ca() {
|
|
8807
8828
|
const t = [];
|
|
8808
8829
|
return t.push(
|
|
8809
|
-
A("compute_debug_trace_v1", [
|
|
8830
|
+
A("compute_debug_trace_v1", [vt("OBJECT")])
|
|
8810
8831
|
), t;
|
|
8811
8832
|
}
|
|
8812
|
-
const
|
|
8813
|
-
|
|
8833
|
+
const ce = { name: "COMPUTE_MISC_CATEGORY", callback: Ca };
|
|
8834
|
+
yn.setConfirm(async (t, e) => {
|
|
8814
8835
|
const n = await Yo({
|
|
8815
8836
|
title: "",
|
|
8816
8837
|
text: t
|
|
8817
8838
|
});
|
|
8818
8839
|
e(!!n);
|
|
8819
8840
|
});
|
|
8820
|
-
|
|
8841
|
+
yn.setPrompt(async (t, e, n) => {
|
|
8821
8842
|
const o = await wo({
|
|
8822
8843
|
title: "",
|
|
8823
8844
|
value: e
|
|
8824
8845
|
});
|
|
8825
8846
|
o !== void 0 && n(String(o));
|
|
8826
8847
|
});
|
|
8827
|
-
function
|
|
8848
|
+
function Je(t) {
|
|
8828
8849
|
const e = Ut();
|
|
8829
8850
|
if (!e)
|
|
8830
8851
|
return;
|
|
@@ -8842,13 +8863,13 @@ function zn() {
|
|
|
8842
8863
|
if (!t)
|
|
8843
8864
|
return;
|
|
8844
8865
|
const e = t.getTopBlocks(!0)?.[0];
|
|
8845
|
-
e &&
|
|
8866
|
+
e && Je(e.id);
|
|
8846
8867
|
}
|
|
8847
8868
|
function Zn(t) {
|
|
8848
8869
|
const e = t.getParent();
|
|
8849
8870
|
return e && Zn(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
|
|
8850
8871
|
}
|
|
8851
|
-
class
|
|
8872
|
+
class va {
|
|
8852
8873
|
init() {
|
|
8853
8874
|
const e = yo.registry.getItem("blockDisable");
|
|
8854
8875
|
e && (e.preconditionFn = function(n) {
|
|
@@ -8861,9 +8882,9 @@ ko.registerFieldColour();
|
|
|
8861
8882
|
No.registry.unregister(Lo.names.ESCAPE);
|
|
8862
8883
|
const ya = new So.CrossTabCopyPaste();
|
|
8863
8884
|
ya.init({ contextMenu: !0, shortcut: !0 });
|
|
8864
|
-
const ka = new
|
|
8885
|
+
const ka = new va();
|
|
8865
8886
|
ka.init();
|
|
8866
|
-
|
|
8887
|
+
ue.Classic.blockStyles = {
|
|
8867
8888
|
color_blocks: {
|
|
8868
8889
|
colourPrimary: "#a5745b",
|
|
8869
8890
|
colourSecondary: "#ede3de",
|
|
@@ -8949,7 +8970,7 @@ re.Classic.blockStyles = {
|
|
|
8949
8970
|
hat: ""
|
|
8950
8971
|
}
|
|
8951
8972
|
};
|
|
8952
|
-
|
|
8973
|
+
ue.Classic.categoryStyles = {
|
|
8953
8974
|
color_category: {
|
|
8954
8975
|
colour: "#a5745b"
|
|
8955
8976
|
},
|
|
@@ -9014,9 +9035,9 @@ re.Classic.categoryStyles = {
|
|
|
9014
9035
|
colour: "#a55b80"
|
|
9015
9036
|
}
|
|
9016
9037
|
};
|
|
9017
|
-
const Na =
|
|
9038
|
+
const Na = kn.defineTheme("light", {
|
|
9018
9039
|
name: "light",
|
|
9019
|
-
base:
|
|
9040
|
+
base: ue.Classic,
|
|
9020
9041
|
componentStyles: {
|
|
9021
9042
|
workspaceBackgroundColour: "#ffffff",
|
|
9022
9043
|
toolboxBackgroundColour: "#eeeeee",
|
|
@@ -9030,9 +9051,9 @@ const Na = yn.defineTheme("light", {
|
|
|
9030
9051
|
scrollbarOpacity: 0.4,
|
|
9031
9052
|
cursorColour: ""
|
|
9032
9053
|
}
|
|
9033
|
-
}), La =
|
|
9054
|
+
}), La = kn.defineTheme("dark", {
|
|
9034
9055
|
name: "dark",
|
|
9035
|
-
base:
|
|
9056
|
+
base: ue.Classic,
|
|
9036
9057
|
componentStyles: {
|
|
9037
9058
|
workspaceBackgroundColour: "#1e1e1e",
|
|
9038
9059
|
toolboxBackgroundColour: "#272727",
|
|
@@ -9058,7 +9079,7 @@ function Sa(t) {
|
|
|
9058
9079
|
break;
|
|
9059
9080
|
}
|
|
9060
9081
|
}
|
|
9061
|
-
const
|
|
9082
|
+
const fe = {
|
|
9062
9083
|
kind: "category",
|
|
9063
9084
|
name: "%{BKY_CATEGORY_COLOR}",
|
|
9064
9085
|
categorystyle: "color_category",
|
|
@@ -9132,7 +9153,7 @@ const de = {
|
|
|
9132
9153
|
}
|
|
9133
9154
|
}
|
|
9134
9155
|
]
|
|
9135
|
-
},
|
|
9156
|
+
}, me = {
|
|
9136
9157
|
kind: "category",
|
|
9137
9158
|
name: "%{BKY_CATEGORY_LIST}",
|
|
9138
9159
|
categorystyle: "list_category",
|
|
@@ -9247,7 +9268,7 @@ const de = {
|
|
|
9247
9268
|
type: "list_reverse_v1"
|
|
9248
9269
|
}
|
|
9249
9270
|
]
|
|
9250
|
-
},
|
|
9271
|
+
}, Te = {
|
|
9251
9272
|
kind: "category",
|
|
9252
9273
|
name: "%{BKY_CATEGORY_LOGIC}",
|
|
9253
9274
|
categorystyle: "logic_category",
|
|
@@ -9289,7 +9310,7 @@ const de = {
|
|
|
9289
9310
|
type: "logic_ternary_v1"
|
|
9290
9311
|
}
|
|
9291
9312
|
]
|
|
9292
|
-
},
|
|
9313
|
+
}, Ee = {
|
|
9293
9314
|
kind: "category",
|
|
9294
9315
|
name: "%{BKY_CATEGORY_LOOP}",
|
|
9295
9316
|
categorystyle: "loop_category",
|
|
@@ -9351,7 +9372,7 @@ const de = {
|
|
|
9351
9372
|
type: "flow_control_v1"
|
|
9352
9373
|
}
|
|
9353
9374
|
]
|
|
9354
|
-
},
|
|
9375
|
+
}, ge = {
|
|
9355
9376
|
kind: "category",
|
|
9356
9377
|
name: "%{BKY_CATEGORY_MATH}",
|
|
9357
9378
|
categorystyle: "math_category",
|
|
@@ -9506,7 +9527,7 @@ const de = {
|
|
|
9506
9527
|
type: "math_on_list_v1"
|
|
9507
9528
|
}
|
|
9508
9529
|
]
|
|
9509
|
-
},
|
|
9530
|
+
}, Ae = {
|
|
9510
9531
|
kind: "category",
|
|
9511
9532
|
name: "%{BKY_CATEGORY_OBJECT}",
|
|
9512
9533
|
categorystyle: "object_category",
|
|
@@ -9574,7 +9595,7 @@ const de = {
|
|
|
9574
9595
|
}
|
|
9575
9596
|
}
|
|
9576
9597
|
]
|
|
9577
|
-
},
|
|
9598
|
+
}, Ie = {
|
|
9578
9599
|
kind: "category",
|
|
9579
9600
|
name: "%{BKY_CATEGORY_TEXT}",
|
|
9580
9601
|
categorystyle: "text_category",
|
|
@@ -9774,21 +9795,21 @@ const de = {
|
|
|
9774
9795
|
kind: "category",
|
|
9775
9796
|
name: "%{BKY_CATEGORY_MESSAGE}",
|
|
9776
9797
|
categorystyle: "misc_category",
|
|
9777
|
-
custom:
|
|
9798
|
+
custom: ee.name
|
|
9778
9799
|
},
|
|
9779
9800
|
{
|
|
9780
9801
|
kind: "category",
|
|
9781
9802
|
name: "%{BKY_CATEGORY_MISC}",
|
|
9782
9803
|
categorystyle: "misc_category",
|
|
9783
|
-
custom:
|
|
9804
|
+
custom: ne.name
|
|
9784
9805
|
},
|
|
9806
|
+
Ee,
|
|
9785
9807
|
Te,
|
|
9808
|
+
ge,
|
|
9809
|
+
Ie,
|
|
9786
9810
|
me,
|
|
9787
|
-
Ee,
|
|
9788
9811
|
Ae,
|
|
9789
9812
|
fe,
|
|
9790
|
-
ge,
|
|
9791
|
-
de,
|
|
9792
9813
|
to,
|
|
9793
9814
|
{
|
|
9794
9815
|
kind: "category",
|
|
@@ -9806,13 +9827,13 @@ const de = {
|
|
|
9806
9827
|
kind: "category",
|
|
9807
9828
|
name: "%{BKY_CATEGORY_RESOURCE}",
|
|
9808
9829
|
categorystyle: "resource_category",
|
|
9809
|
-
custom:
|
|
9830
|
+
custom: oe.name
|
|
9810
9831
|
},
|
|
9811
9832
|
{
|
|
9812
9833
|
kind: "category",
|
|
9813
9834
|
name: "%{BKY_CATEGORY_COMPUTE}",
|
|
9814
9835
|
categorystyle: "compute_category",
|
|
9815
|
-
custom:
|
|
9836
|
+
custom: te.name
|
|
9816
9837
|
}
|
|
9817
9838
|
]
|
|
9818
9839
|
}, ba = {
|
|
@@ -9822,33 +9843,33 @@ const de = {
|
|
|
9822
9843
|
kind: "category",
|
|
9823
9844
|
name: "%{BKY_CATEGORY_FUNC}",
|
|
9824
9845
|
categorystyle: "func_category",
|
|
9825
|
-
custom:
|
|
9846
|
+
custom: ae.name
|
|
9826
9847
|
},
|
|
9827
9848
|
{
|
|
9828
9849
|
kind: "category",
|
|
9829
9850
|
name: "%{BKY_CATEGORY_FLOW}",
|
|
9830
9851
|
categorystyle: "flow_category",
|
|
9831
|
-
custom:
|
|
9852
|
+
custom: se.name
|
|
9832
9853
|
},
|
|
9833
9854
|
{
|
|
9834
9855
|
kind: "category",
|
|
9835
9856
|
name: "%{BKY_CATEGORY_DATA}",
|
|
9836
9857
|
categorystyle: "data_category",
|
|
9837
|
-
custom:
|
|
9858
|
+
custom: ie.name
|
|
9838
9859
|
},
|
|
9839
9860
|
{
|
|
9840
9861
|
kind: "category",
|
|
9841
9862
|
name: "%{BKY_CATEGORY_MISC}",
|
|
9842
9863
|
categorystyle: "misc_category",
|
|
9843
|
-
custom:
|
|
9864
|
+
custom: ce.name
|
|
9844
9865
|
},
|
|
9866
|
+
Ee,
|
|
9845
9867
|
Te,
|
|
9868
|
+
ge,
|
|
9869
|
+
Ie,
|
|
9846
9870
|
me,
|
|
9847
|
-
Ee,
|
|
9848
9871
|
Ae,
|
|
9849
9872
|
fe,
|
|
9850
|
-
ge,
|
|
9851
|
-
de,
|
|
9852
9873
|
{
|
|
9853
9874
|
kind: "category",
|
|
9854
9875
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
@@ -9869,33 +9890,33 @@ const de = {
|
|
|
9869
9890
|
kind: "category",
|
|
9870
9891
|
name: "%{BKY_CATEGORY_FUNC}",
|
|
9871
9892
|
categorystyle: "func_category",
|
|
9872
|
-
custom:
|
|
9893
|
+
custom: ae.name
|
|
9873
9894
|
},
|
|
9874
9895
|
{
|
|
9875
9896
|
kind: "category",
|
|
9876
9897
|
name: "%{BKY_CATEGORY_FLOW}",
|
|
9877
9898
|
categorystyle: "flow_category",
|
|
9878
|
-
custom:
|
|
9899
|
+
custom: se.name
|
|
9879
9900
|
},
|
|
9880
9901
|
{
|
|
9881
9902
|
kind: "category",
|
|
9882
9903
|
name: "%{BKY_CATEGORY_DATA}",
|
|
9883
9904
|
categorystyle: "data_category",
|
|
9884
|
-
custom:
|
|
9905
|
+
custom: ie.name
|
|
9885
9906
|
},
|
|
9886
9907
|
{
|
|
9887
9908
|
kind: "category",
|
|
9888
9909
|
name: "%{BKY_CATEGORY_MISC}",
|
|
9889
9910
|
categorystyle: "misc_category",
|
|
9890
|
-
custom:
|
|
9911
|
+
custom: ce.name
|
|
9891
9912
|
},
|
|
9913
|
+
Ee,
|
|
9892
9914
|
Te,
|
|
9915
|
+
ge,
|
|
9916
|
+
Ie,
|
|
9893
9917
|
me,
|
|
9894
|
-
Ee,
|
|
9895
9918
|
Ae,
|
|
9896
9919
|
fe,
|
|
9897
|
-
ge,
|
|
9898
|
-
de,
|
|
9899
9920
|
{
|
|
9900
9921
|
kind: "category",
|
|
9901
9922
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
@@ -9953,21 +9974,21 @@ const de = {
|
|
|
9953
9974
|
kind: "category",
|
|
9954
9975
|
name: "%{BKY_CATEGORY_MESSAGE}",
|
|
9955
9976
|
categorystyle: "misc_category",
|
|
9956
|
-
custom:
|
|
9977
|
+
custom: ee.name
|
|
9957
9978
|
},
|
|
9958
9979
|
{
|
|
9959
9980
|
kind: "category",
|
|
9960
9981
|
name: "%{BKY_CATEGORY_MISC}",
|
|
9961
9982
|
categorystyle: "misc_category",
|
|
9962
|
-
custom:
|
|
9983
|
+
custom: ne.name
|
|
9963
9984
|
},
|
|
9985
|
+
Ee,
|
|
9964
9986
|
Te,
|
|
9987
|
+
ge,
|
|
9988
|
+
Ie,
|
|
9965
9989
|
me,
|
|
9966
|
-
Ee,
|
|
9967
9990
|
Ae,
|
|
9968
9991
|
fe,
|
|
9969
|
-
ge,
|
|
9970
|
-
de,
|
|
9971
9992
|
to,
|
|
9972
9993
|
{
|
|
9973
9994
|
kind: "category",
|
|
@@ -9985,13 +10006,13 @@ const de = {
|
|
|
9985
10006
|
kind: "category",
|
|
9986
10007
|
name: "%{BKY_CATEGORY_RESOURCE}",
|
|
9987
10008
|
categorystyle: "resource_category",
|
|
9988
|
-
custom:
|
|
10009
|
+
custom: oe.name
|
|
9989
10010
|
},
|
|
9990
10011
|
{
|
|
9991
10012
|
kind: "category",
|
|
9992
10013
|
name: "%{BKY_CATEGORY_COMPUTE}",
|
|
9993
10014
|
categorystyle: "compute_category",
|
|
9994
|
-
custom:
|
|
10015
|
+
custom: te.name
|
|
9995
10016
|
}
|
|
9996
10017
|
]
|
|
9997
10018
|
}, Ke = ["get_app_prop_v1", "get_app_state_v1"];
|
|
@@ -10129,7 +10150,7 @@ const eo = Symbol();
|
|
|
10129
10150
|
function Ya(t) {
|
|
10130
10151
|
lo(eo, t);
|
|
10131
10152
|
}
|
|
10132
|
-
function
|
|
10153
|
+
function qe() {
|
|
10133
10154
|
return _o(eo);
|
|
10134
10155
|
}
|
|
10135
10156
|
const wa = /* @__PURE__ */ st({
|
|
@@ -10138,13 +10159,13 @@ const wa = /* @__PURE__ */ st({
|
|
|
10138
10159
|
lock: { type: Boolean }
|
|
10139
10160
|
},
|
|
10140
10161
|
setup(t, { expose: e }) {
|
|
10141
|
-
const { t: n } = xt(), o = t, i =
|
|
10162
|
+
const { t: n } = xt(), o = t, i = qe(), a = () => {
|
|
10142
10163
|
if (!i.workspace) {
|
|
10143
10164
|
console.assert(!1);
|
|
10144
10165
|
return;
|
|
10145
10166
|
}
|
|
10146
10167
|
if (o.lock) {
|
|
10147
|
-
|
|
10168
|
+
Ln(n("x-block-lib.msg.cannotOperateInLockedState"));
|
|
10148
10169
|
return;
|
|
10149
10170
|
}
|
|
10150
10171
|
i.workspace.cleanUp();
|
|
@@ -10153,7 +10174,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10153
10174
|
};
|
|
10154
10175
|
return e({ cleanWorkspace: a }), (u, l) => {
|
|
10155
10176
|
const _ = D("v-btn"), T = D("v-tooltip");
|
|
10156
|
-
return
|
|
10177
|
+
return b(), Z(T, {
|
|
10157
10178
|
text: R(n)("x-block-lib.tip.hotkeyCtrlQ")
|
|
10158
10179
|
}, {
|
|
10159
10180
|
activator: tt(({ props: g }) => [
|
|
@@ -10179,7 +10200,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10179
10200
|
const { t: e } = xt(), n = Rt(t, "modelValue");
|
|
10180
10201
|
return (o, i) => {
|
|
10181
10202
|
const a = D("v-btn"), r = D("v-tooltip");
|
|
10182
|
-
return
|
|
10203
|
+
return b(), Z(r, {
|
|
10183
10204
|
text: R(e)("x-block-lib.tip.hotkeyCtrlW")
|
|
10184
10205
|
}, {
|
|
10185
10206
|
activator: tt(({ props: u }) => [
|
|
@@ -10221,14 +10242,14 @@ const wa = /* @__PURE__ */ st({
|
|
|
10221
10242
|
}));
|
|
10222
10243
|
return (T, g) => {
|
|
10223
10244
|
const m = D("v-spacer"), y = D("v-icon"), E = po("ripple");
|
|
10224
|
-
return ho((
|
|
10245
|
+
return ho((b(), Q("div", {
|
|
10225
10246
|
class: "d-flex align-center cursor-pointer",
|
|
10226
10247
|
style: H(l.value),
|
|
10227
10248
|
onClick: g[1] || (g[1] = (P) => r("x-click", a.id)),
|
|
10228
10249
|
onMouseout: g[2] || (g[2] = (P) => u.value = !1),
|
|
10229
10250
|
onMouseover: g[3] || (g[3] = (P) => u.value = !0)
|
|
10230
10251
|
}, [
|
|
10231
|
-
W("span", $a,
|
|
10252
|
+
W("span", $a, re(a.title), 1),
|
|
10232
10253
|
L(m),
|
|
10233
10254
|
L(y, {
|
|
10234
10255
|
class: "x-handle cursor-move mr-3",
|
|
@@ -10249,7 +10270,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10249
10270
|
class: "text-caption text-grey"
|
|
10250
10271
|
}, Wa = /* @__PURE__ */ st({
|
|
10251
10272
|
__name: "index",
|
|
10252
|
-
props: /* @__PURE__ */
|
|
10273
|
+
props: /* @__PURE__ */ Pe({
|
|
10253
10274
|
lock: { type: Boolean }
|
|
10254
10275
|
}, {
|
|
10255
10276
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -10257,7 +10278,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10257
10278
|
}),
|
|
10258
10279
|
emits: ["update:modelValue"],
|
|
10259
10280
|
setup(t, { expose: e }) {
|
|
10260
|
-
const { t: n } = xt(), o = Rt(t, "modelValue"), i =
|
|
10281
|
+
const { t: n } = xt(), o = Rt(t, "modelValue"), i = qe(), a = It([]);
|
|
10261
10282
|
e({ update: () => {
|
|
10262
10283
|
if (!i.workspace) {
|
|
10263
10284
|
console.assert(!1);
|
|
@@ -10269,7 +10290,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10269
10290
|
let U = "<n/a>";
|
|
10270
10291
|
if (E.type.startsWith("on_app_event_v")) {
|
|
10271
10292
|
const X = E, dt = J[X.node.key];
|
|
10272
|
-
dt && (U = n(dt.name), X.node.alias && (U += " / " + X.node.alias), U += " - " +
|
|
10293
|
+
dt && (U = n(dt.name), X.node.alias && (U += " / " + X.node.alias), U += " - " + le(X.event.names, X.event.from));
|
|
10273
10294
|
} else E.type.startsWith("watch_effect_v") ? U = n("x-block-lib.watchEffect") : E.type.startsWith("app_bind_v") ? U = n("x-block-lib.bind") : E.type.startsWith("func_entry_v") ? U = n("x-block-lib.funcEntry") : E.type.startsWith("procedure_def_v") ? U = n("x-block-lib.procedure") + " - " + E.getFieldValue("NAME") : U = n("x-block-lib.temporaryBlock");
|
|
10274
10295
|
m.push({
|
|
10275
10296
|
id: E.id,
|
|
@@ -10281,7 +10302,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10281
10302
|
let u = [];
|
|
10282
10303
|
const l = () => {
|
|
10283
10304
|
if (t.lock) {
|
|
10284
|
-
|
|
10305
|
+
Ln(n("x-block-lib.msg.cannotOperateInLockedState"));
|
|
10285
10306
|
return;
|
|
10286
10307
|
}
|
|
10287
10308
|
const m = [];
|
|
@@ -10313,16 +10334,16 @@ const wa = /* @__PURE__ */ st({
|
|
|
10313
10334
|
P
|
|
10314
10335
|
).getRelativeToSurfaceXY().y + 10);
|
|
10315
10336
|
const X = E.getRelativeToSurfaceXY();
|
|
10316
|
-
E.moveTo(new
|
|
10337
|
+
E.moveTo(new v.Coordinate(X.x, U)), i.workspace.cleanUp(), zn();
|
|
10317
10338
|
}, g = async (m) => {
|
|
10318
10339
|
if (!i.workspace) {
|
|
10319
10340
|
console.assert(!1);
|
|
10320
10341
|
return;
|
|
10321
10342
|
}
|
|
10322
10343
|
const y = i.workspace.getBlockById(m);
|
|
10323
|
-
|
|
10344
|
+
Nn.setSelected(y), Je(m), o.value = !1;
|
|
10324
10345
|
};
|
|
10325
|
-
return (m, y) => a.value.length > 0 ? (
|
|
10346
|
+
return (m, y) => a.value.length > 0 ? (b(), Z(R(Bo), {
|
|
10326
10347
|
key: 0,
|
|
10327
10348
|
modelValue: a.value,
|
|
10328
10349
|
"onUpdate:modelValue": y[0] || (y[0] = (E) => a.value = E),
|
|
@@ -10334,7 +10355,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10334
10355
|
onStart: l
|
|
10335
10356
|
}, {
|
|
10336
10357
|
default: tt(() => [
|
|
10337
|
-
(
|
|
10358
|
+
(b(!0), Q(gn, null, fo(a.value, (E) => (b(), Z(Ha, {
|
|
10338
10359
|
id: E.id,
|
|
10339
10360
|
key: E.id,
|
|
10340
10361
|
select: E.select,
|
|
@@ -10343,7 +10364,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10343
10364
|
}, null, 8, ["id", "select", "title"]))), 128))
|
|
10344
10365
|
]),
|
|
10345
10366
|
_: 1
|
|
10346
|
-
}, 8, ["modelValue"])) : (
|
|
10367
|
+
}, 8, ["modelValue"])) : (b(), Q("span", Ga, re(R(n)("x-block-lib.noOption")), 1));
|
|
10347
10368
|
}
|
|
10348
10369
|
}), ja = (t, e) => {
|
|
10349
10370
|
const n = t.__vccOpts || t;
|
|
@@ -10358,7 +10379,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10358
10379
|
},
|
|
10359
10380
|
emits: ["update:modelValue"],
|
|
10360
10381
|
setup(t, { expose: e }) {
|
|
10361
|
-
const n = Rt(t, "modelValue"), o =
|
|
10382
|
+
const n = Rt(t, "modelValue"), o = qe();
|
|
10362
10383
|
e({ update: () => {
|
|
10363
10384
|
if (!o.workspace) {
|
|
10364
10385
|
console.assert(!1);
|
|
@@ -10372,9 +10393,9 @@ const wa = /* @__PURE__ */ st({
|
|
|
10372
10393
|
return;
|
|
10373
10394
|
}
|
|
10374
10395
|
const l = u.getBlockById(r);
|
|
10375
|
-
|
|
10396
|
+
Nn.setSelected(l), Je(r), n.value = !1;
|
|
10376
10397
|
};
|
|
10377
|
-
return (r, u) => (
|
|
10398
|
+
return (r, u) => (b(), Q("div", {
|
|
10378
10399
|
onClick: u[0] || (u[0] = (l) => a(""))
|
|
10379
10400
|
}, "blockTree"));
|
|
10380
10401
|
}
|
|
@@ -10385,7 +10406,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10385
10406
|
lock: { type: Boolean }
|
|
10386
10407
|
},
|
|
10387
10408
|
setup(t, { expose: e }) {
|
|
10388
|
-
const { t: n } = xt(), o = Ho(), { sysBarAvail: i } =
|
|
10409
|
+
const { t: n } = xt(), o = Ho(), { sysBarAvail: i } = Sn(), { backgroundColor1: a } = Vt(), r = Y(() => {
|
|
10389
10410
|
let y = "100%";
|
|
10390
10411
|
return o.mdAndUp.value && (y = "400px"), {
|
|
10391
10412
|
background: a.value,
|
|
@@ -10400,7 +10421,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10400
10421
|
};
|
|
10401
10422
|
}), l = Y(() => ({
|
|
10402
10423
|
height: "60px"
|
|
10403
|
-
})), { open: _ } = He(`blocklyNavigatorDlg${
|
|
10424
|
+
})), { open: _ } = He(`blocklyNavigatorDlg${Re()}`);
|
|
10404
10425
|
mo(() => {
|
|
10405
10426
|
_.value = !1;
|
|
10406
10427
|
});
|
|
@@ -10408,8 +10429,8 @@ const wa = /* @__PURE__ */ st({
|
|
|
10408
10429
|
return e({ open: _, update: () => {
|
|
10409
10430
|
t.type === "list" ? T.value?.update() : t.type === "tree" && g.value?.update();
|
|
10410
10431
|
} }), (y, E) => {
|
|
10411
|
-
const P = D("v-sheet"), U = D("v-btn"), X = D("v-spacer"), dt = D("v-dialog"),
|
|
10412
|
-
return
|
|
10432
|
+
const P = D("v-sheet"), U = D("v-btn"), X = D("v-spacer"), dt = D("v-dialog"), Oe = D("v-tooltip");
|
|
10433
|
+
return b(), Q(gn, null, [
|
|
10413
10434
|
L(dt, {
|
|
10414
10435
|
modelValue: R(_),
|
|
10415
10436
|
"onUpdate:modelValue": E[5] || (E[5] = ($) => $t(_) ? _.value = $ : null),
|
|
@@ -10418,7 +10439,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10418
10439
|
"no-click-animation": "",
|
|
10419
10440
|
persistent: "",
|
|
10420
10441
|
transition: "scroll-x-reverse-transition",
|
|
10421
|
-
onKeydown: E[6] || (E[6] =
|
|
10442
|
+
onKeydown: E[6] || (E[6] = An(Bt(($) => _.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
10422
10443
|
}, {
|
|
10423
10444
|
default: tt(() => [
|
|
10424
10445
|
W("div", {
|
|
@@ -10430,7 +10451,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10430
10451
|
class: "elevation-2",
|
|
10431
10452
|
style: H(r.value)
|
|
10432
10453
|
}, [
|
|
10433
|
-
R(i) ? (
|
|
10454
|
+
R(i) ? (b(), Z(P, {
|
|
10434
10455
|
key: 0,
|
|
10435
10456
|
color: "transparent",
|
|
10436
10457
|
height: 24
|
|
@@ -10447,7 +10468,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10447
10468
|
variant: "text",
|
|
10448
10469
|
onClick: E[0] || (E[0] = ($) => _.value = !1)
|
|
10449
10470
|
}),
|
|
10450
|
-
W("span", qa,
|
|
10471
|
+
W("span", qa, re(R(n)("x-block-lib.navigator")), 1),
|
|
10451
10472
|
L(X)
|
|
10452
10473
|
]),
|
|
10453
10474
|
_: 1
|
|
@@ -10456,14 +10477,14 @@ const wa = /* @__PURE__ */ st({
|
|
|
10456
10477
|
class: "overflow-y-auto",
|
|
10457
10478
|
style: H(u.value)
|
|
10458
10479
|
}, [
|
|
10459
|
-
t.type === "list" ? (
|
|
10480
|
+
t.type === "list" ? (b(), Z(Xa, {
|
|
10460
10481
|
key: 0,
|
|
10461
10482
|
ref_key: "blockList",
|
|
10462
10483
|
ref: T,
|
|
10463
10484
|
modelValue: R(_),
|
|
10464
10485
|
"onUpdate:modelValue": E[1] || (E[1] = ($) => $t(_) ? _.value = $ : null),
|
|
10465
10486
|
lock: t.lock
|
|
10466
|
-
}, null, 8, ["modelValue", "lock"])) : t.type === "tree" ? (
|
|
10487
|
+
}, null, 8, ["modelValue", "lock"])) : t.type === "tree" ? (b(), Z(Ja, {
|
|
10467
10488
|
key: 1,
|
|
10468
10489
|
ref_key: "blockTree",
|
|
10469
10490
|
ref: g,
|
|
@@ -10479,7 +10500,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10479
10500
|
]),
|
|
10480
10501
|
_: 1
|
|
10481
10502
|
}, 8, ["modelValue"]),
|
|
10482
|
-
L(
|
|
10503
|
+
L(Oe, {
|
|
10483
10504
|
text: R(n)("x-block-lib.tip.hotkeyCtrlE")
|
|
10484
10505
|
}, {
|
|
10485
10506
|
activator: tt(({ props: $ }) => [
|
|
@@ -10487,7 +10508,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10487
10508
|
density: "comfortable",
|
|
10488
10509
|
icon: "mdi-navigation-variant",
|
|
10489
10510
|
variant: "outlined",
|
|
10490
|
-
onClick: E[7] || (E[7] = (
|
|
10511
|
+
onClick: E[7] || (E[7] = (Qe) => _.value = !0)
|
|
10491
10512
|
}), null, 16)
|
|
10492
10513
|
]),
|
|
10493
10514
|
_: 1
|
|
@@ -10495,7 +10516,7 @@ const wa = /* @__PURE__ */ st({
|
|
|
10495
10516
|
], 64);
|
|
10496
10517
|
};
|
|
10497
10518
|
}
|
|
10498
|
-
}),
|
|
10519
|
+
}), be = {
|
|
10499
10520
|
grid: {
|
|
10500
10521
|
length: 2,
|
|
10501
10522
|
snap: !0,
|
|
@@ -10522,8 +10543,8 @@ const wa = /* @__PURE__ */ st({
|
|
|
10522
10543
|
}
|
|
10523
10544
|
};
|
|
10524
10545
|
function za(t, e, n, o) {
|
|
10525
|
-
|
|
10526
|
-
const i = Po(t,
|
|
10546
|
+
be.theme = o ? "dark" : "light", be.toolbox = Za(e, n);
|
|
10547
|
+
const i = Po(t, be);
|
|
10527
10548
|
return i.addChangeListener(Ro.shadowBlockConversionChangeListener), tc(i, e, n), ec(i), i;
|
|
10528
10549
|
}
|
|
10529
10550
|
function Za(t, e) {
|
|
@@ -10534,7 +10555,7 @@ function tc(t, e, n) {
|
|
|
10534
10555
|
function o({ name: i, callback: a }) {
|
|
10535
10556
|
t.registerToolboxCategoryCallback(i, () => a(e));
|
|
10536
10557
|
}
|
|
10537
|
-
e === "page" ? n === "v1" && (o(Qn), o(
|
|
10558
|
+
e === "page" ? n === "v1" && (o(Qn), o(ee), o(ne), o(ct), o(at), o(oe), o(te)) : e === "comp" ? n === "v1" && (o(qn), o(ee), o(ne), o(ct), o(at), o(oe), o(te)) : e === "func" ? n === "v1" && (o(ae), o(se), o(ie), o(ce), o(ct), o(at)) : e === "flow" && n === "v1" && (o(ae), o(se), o(ie), o(ce), o(ct), o(at));
|
|
10538
10559
|
}
|
|
10539
10560
|
function ec(t) {
|
|
10540
10561
|
const { router: e } = nt;
|
|
@@ -10592,8 +10613,8 @@ function nc(t, e) {
|
|
|
10592
10613
|
o(i[l], u.getInput("ENTRY" + l).connection);
|
|
10593
10614
|
} else r === "json_string_v1" || r === "json_number_v1" ? u.setFieldValue(i, "VALUE") : r === "json_boolean_v1" && u.setFieldValue(i ? "true" : "false", "VALUE");
|
|
10594
10615
|
};
|
|
10595
|
-
o(t, n.getInput("JSON").connection),
|
|
10596
|
-
new (
|
|
10616
|
+
o(t, n.getInput("JSON").connection), I.fire(
|
|
10617
|
+
new (I.get(I.FINISHED_LOADING))(e)
|
|
10597
10618
|
);
|
|
10598
10619
|
}
|
|
10599
10620
|
function oc(t) {
|
|
@@ -10630,7 +10651,7 @@ function oc(t) {
|
|
|
10630
10651
|
}
|
|
10631
10652
|
const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
10632
10653
|
__name: "index",
|
|
10633
|
-
props: /* @__PURE__ */
|
|
10654
|
+
props: /* @__PURE__ */ Pe({
|
|
10634
10655
|
type: {},
|
|
10635
10656
|
version: {},
|
|
10636
10657
|
locale: {},
|
|
@@ -10641,9 +10662,9 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10641
10662
|
scale: { required: !0 },
|
|
10642
10663
|
scaleModifiers: {}
|
|
10643
10664
|
}),
|
|
10644
|
-
emits: /* @__PURE__ */
|
|
10665
|
+
emits: /* @__PURE__ */ Pe(["ready"], ["update:lock", "update:scale"]),
|
|
10645
10666
|
setup(t, { expose: e, emit: n }) {
|
|
10646
|
-
const { backgroundColor2: o } = Vt(), i = Rt(t, "lock"), a = Rt(t, "scale"), r = n, u = `blocklyEditor${
|
|
10667
|
+
const { backgroundColor2: o } = Vt(), i = Rt(t, "lock"), a = Rt(t, "scale"), r = n, u = `blocklyEditor${Re()}`, l = It(), _ = bt("parentContainer"), T = bt("clean"), g = bt("navigator"), m = {};
|
|
10647
10668
|
Ya(m);
|
|
10648
10669
|
const y = It(!0), E = It(!1), P = Y(() => t.type === "json" ? "tree" : "list"), U = Y(() => ({
|
|
10649
10670
|
width: "100%",
|
|
@@ -10662,7 +10683,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10662
10683
|
width: "56px",
|
|
10663
10684
|
height: "calc(100% - 49px)",
|
|
10664
10685
|
zIndex: 999
|
|
10665
|
-
})),
|
|
10686
|
+
})), Oe = Y(() => ({
|
|
10666
10687
|
position: "absolute",
|
|
10667
10688
|
top: "0px",
|
|
10668
10689
|
right: "0px",
|
|
@@ -10675,7 +10696,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10675
10696
|
width: "100%",
|
|
10676
10697
|
height: "calc(100% - 48px)",
|
|
10677
10698
|
pointerEvents: "none"
|
|
10678
|
-
})),
|
|
10699
|
+
})), Qe = Y(() => ({
|
|
10679
10700
|
position: "absolute",
|
|
10680
10701
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
10681
10702
|
top: "1px",
|
|
@@ -10688,37 +10709,37 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10688
10709
|
top: 0,
|
|
10689
10710
|
left: 0,
|
|
10690
10711
|
zIndex: 3e3
|
|
10691
|
-
})), { open: Nt } = He(`blocklyEditorFlyout${
|
|
10692
|
-
|
|
10712
|
+
})), { open: Nt } = He(`blocklyEditorFlyout${Re()}`);
|
|
10713
|
+
on(async () => {
|
|
10693
10714
|
if (!l.value || !_.value) {
|
|
10694
10715
|
console.assert(!1);
|
|
10695
10716
|
return;
|
|
10696
10717
|
}
|
|
10697
|
-
Do(_.value), await
|
|
10718
|
+
Do(_.value), await rn(t.locale), m.workspace = za(l.value, t.type, t.version, t.dark), m.workspace.addChangeListener(I.disableOrphans), m.workspace.addChangeListener(oo);
|
|
10698
10719
|
const N = document.querySelector(`#${u} .blocklyFlyout`);
|
|
10699
|
-
new MutationObserver((
|
|
10700
|
-
|
|
10720
|
+
new MutationObserver((Ce) => {
|
|
10721
|
+
Ce.forEach((wt) => {
|
|
10701
10722
|
wt.type === "attributes" && wt.attributeName === "style" && (Nt.value = m.workspace.getFlyout().isVisible());
|
|
10702
10723
|
});
|
|
10703
|
-
}).observe(N, { attributes: !0 }), Nt.value = m.workspace.getFlyout().isVisible(),
|
|
10704
|
-
}),
|
|
10724
|
+
}).observe(N, { attributes: !0 }), Nt.value = m.workspace.getFlyout().isVisible(), ze(), Ze(), await To(), r("ready");
|
|
10725
|
+
}), sn(() => {
|
|
10705
10726
|
Nt.value = !1;
|
|
10706
10727
|
}), Mo(l, () => {
|
|
10707
10728
|
m.workspace && Uo(m.workspace);
|
|
10708
10729
|
});
|
|
10709
10730
|
async function oo(N) {
|
|
10710
|
-
if (N.type ===
|
|
10731
|
+
if (N.type === I.FINISHED_LOADING) {
|
|
10711
10732
|
zn(), setTimeout(() => {
|
|
10712
10733
|
g.value?.update();
|
|
10713
10734
|
}, 0), y.value = !1;
|
|
10714
10735
|
return;
|
|
10715
10736
|
}
|
|
10716
10737
|
if (!y.value) {
|
|
10717
|
-
if (N.type ===
|
|
10738
|
+
if (N.type === I.VIEWPORT_CHANGE) {
|
|
10718
10739
|
a.value = m.workspace.getScale();
|
|
10719
10740
|
return;
|
|
10720
10741
|
}
|
|
10721
|
-
N.type ===
|
|
10742
|
+
N.type === I.BLOCK_DRAG && (N.isStart ? E.value = !0 : E.value = !1), setTimeout(() => {
|
|
10722
10743
|
g.value?.update();
|
|
10723
10744
|
}, 0);
|
|
10724
10745
|
}
|
|
@@ -10730,27 +10751,27 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10730
10751
|
console.assert(!1);
|
|
10731
10752
|
else
|
|
10732
10753
|
return s.workspaceToCode(m.workspace);
|
|
10733
|
-
}, co = () => Fa(m.workspace),
|
|
10754
|
+
}, co = () => Fa(m.workspace), ze = () => {
|
|
10734
10755
|
m.workspace.setIsReadOnly(i.value), m.workspace.isReadOnly() && (Nt.value = !1);
|
|
10735
|
-
},
|
|
10756
|
+
}, Ze = () => {
|
|
10736
10757
|
m.workspace.setScale(a.value);
|
|
10737
10758
|
}, ro = () => {
|
|
10738
|
-
m.workspace.fireChangeListener(new
|
|
10739
|
-
}, Ze = () => {
|
|
10740
|
-
T.value?.cleanWorkspace();
|
|
10759
|
+
m.workspace.fireChangeListener(new bn());
|
|
10741
10760
|
}, tn = () => {
|
|
10742
|
-
|
|
10761
|
+
T.value?.cleanWorkspace();
|
|
10743
10762
|
}, en = () => {
|
|
10763
|
+
i.value = !i.value;
|
|
10764
|
+
}, nn = () => {
|
|
10744
10765
|
g.value && (g.value.open = !0);
|
|
10745
10766
|
};
|
|
10746
|
-
return
|
|
10747
|
-
gt.on("cleanWorkspace",
|
|
10748
|
-
}),
|
|
10749
|
-
gt.off("cleanWorkspace",
|
|
10767
|
+
return on(() => {
|
|
10768
|
+
gt.on("cleanWorkspace", tn), gt.on("toggleBlocklyLock", en), gt.on("openBlocklyNavigator", nn);
|
|
10769
|
+
}), sn(() => {
|
|
10770
|
+
gt.off("cleanWorkspace", tn), gt.off("toggleBlocklyLock", en), gt.off("openBlocklyNavigator", nn);
|
|
10750
10771
|
}), Lt(
|
|
10751
10772
|
() => t.locale,
|
|
10752
10773
|
(N) => {
|
|
10753
|
-
|
|
10774
|
+
rn(N);
|
|
10754
10775
|
}
|
|
10755
10776
|
), Lt(
|
|
10756
10777
|
() => t.dark,
|
|
@@ -10760,9 +10781,9 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10760
10781
|
), Lt(Nt, (N) => {
|
|
10761
10782
|
N || m.workspace?.hideChaff();
|
|
10762
10783
|
}), Lt(i, () => {
|
|
10763
|
-
Qe();
|
|
10764
|
-
}), Lt(a, () => {
|
|
10765
10784
|
ze();
|
|
10785
|
+
}), Lt(a, () => {
|
|
10786
|
+
Ze();
|
|
10766
10787
|
}), e({
|
|
10767
10788
|
loading: y,
|
|
10768
10789
|
load: io,
|
|
@@ -10771,8 +10792,8 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10771
10792
|
generateReactivity: co,
|
|
10772
10793
|
fireStateChange: ro
|
|
10773
10794
|
}), (N, ft) => {
|
|
10774
|
-
const
|
|
10775
|
-
return
|
|
10795
|
+
const Ce = D("v-icon"), wt = D("x-loading");
|
|
10796
|
+
return b(), Q("div", ic, [
|
|
10776
10797
|
W("div", {
|
|
10777
10798
|
id: u,
|
|
10778
10799
|
ref_key: "blocklyDiv",
|
|
@@ -10784,20 +10805,20 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10784
10805
|
}, [
|
|
10785
10806
|
Eo(N.$slots, "bottom")
|
|
10786
10807
|
], 4),
|
|
10787
|
-
E.value ? (
|
|
10808
|
+
E.value ? (b(), Q("div", {
|
|
10788
10809
|
key: 0,
|
|
10789
10810
|
class: "d-flex flex-column justify-center align-center",
|
|
10790
10811
|
style: H(dt.value)
|
|
10791
10812
|
}, [
|
|
10792
|
-
L(
|
|
10813
|
+
L(Ce, {
|
|
10793
10814
|
icon: "mdi-delete",
|
|
10794
10815
|
size: "x-large"
|
|
10795
10816
|
})
|
|
10796
10817
|
], 4)) : mt("", !0),
|
|
10797
|
-
y.value ? mt("", !0) : (
|
|
10818
|
+
y.value ? mt("", !0) : (b(), Q("div", {
|
|
10798
10819
|
key: 1,
|
|
10799
10820
|
class: "d-flex align-end ga-3 pt-3 pr-3",
|
|
10800
|
-
style: H(
|
|
10821
|
+
style: H(Oe.value)
|
|
10801
10822
|
}, [
|
|
10802
10823
|
L(wa, {
|
|
10803
10824
|
ref_key: "clean",
|
|
@@ -10815,11 +10836,11 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10815
10836
|
type: P.value
|
|
10816
10837
|
}, null, 8, ["lock", "type"])
|
|
10817
10838
|
], 4)),
|
|
10818
|
-
i.value ? (
|
|
10839
|
+
i.value ? (b(), Q("div", {
|
|
10819
10840
|
key: 2,
|
|
10820
|
-
style: H(
|
|
10841
|
+
style: H(Qe.value)
|
|
10821
10842
|
}, null, 4)) : mt("", !0),
|
|
10822
|
-
i.value ? (
|
|
10843
|
+
i.value ? (b(), Q("div", {
|
|
10823
10844
|
key: 3,
|
|
10824
10845
|
style: H($.value)
|
|
10825
10846
|
}, null, 4)) : mt("", !0),
|
|
@@ -10846,7 +10867,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10846
10867
|
const n = Fo.component, { backgroundColor2: o } = Vt();
|
|
10847
10868
|
return (i, a) => {
|
|
10848
10869
|
const r = D("v-sheet");
|
|
10849
|
-
return
|
|
10870
|
+
return b(), Z(r, {
|
|
10850
10871
|
color: R(o),
|
|
10851
10872
|
height: "100%",
|
|
10852
10873
|
width: "100%"
|
|
@@ -10864,7 +10885,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10864
10885
|
}), cc = { class: "text-subtitle-1" }, rc = { class: "w-100 h-100 overflow-auto" }, uc = /* @__PURE__ */ st({
|
|
10865
10886
|
__name: "index",
|
|
10866
10887
|
setup(t) {
|
|
10867
|
-
const { t: e } = xt(), { sysBarAvail: n } =
|
|
10888
|
+
const { t: e } = xt(), { sysBarAvail: n } = Sn(), { backgroundColor0: o, backgroundColor2: i } = Vt(), a = It(""), r = Y(() => {
|
|
10868
10889
|
let _ = 48;
|
|
10869
10890
|
return n.value && (_ += 24), {
|
|
10870
10891
|
position: "relative",
|
|
@@ -10875,14 +10896,14 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10875
10896
|
}, { open: l } = He("sourceDlg", u);
|
|
10876
10897
|
return (_, T) => {
|
|
10877
10898
|
const g = D("v-sheet"), m = D("v-btn"), y = D("v-spacer"), E = D("v-dialog");
|
|
10878
|
-
return
|
|
10899
|
+
return b(), Z(E, {
|
|
10879
10900
|
modelValue: R(l),
|
|
10880
10901
|
"onUpdate:modelValue": T[1] || (T[1] = (P) => $t(l) ? l.value = P : null),
|
|
10881
10902
|
fullscreen: "",
|
|
10882
10903
|
"no-click-animation": "",
|
|
10883
10904
|
persistent: "",
|
|
10884
10905
|
transition: "dialog-bottom-transition",
|
|
10885
|
-
onKeydown: T[2] || (T[2] =
|
|
10906
|
+
onKeydown: T[2] || (T[2] = An(Bt((P) => l.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
10886
10907
|
}, {
|
|
10887
10908
|
default: tt(() => [
|
|
10888
10909
|
L(g, {
|
|
@@ -10891,7 +10912,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10891
10912
|
width: "100%"
|
|
10892
10913
|
}, {
|
|
10893
10914
|
default: tt(() => [
|
|
10894
|
-
R(n) ? (
|
|
10915
|
+
R(n) ? (b(), Z(g, {
|
|
10895
10916
|
key: 0,
|
|
10896
10917
|
color: R(i),
|
|
10897
10918
|
height: 24
|
|
@@ -10908,7 +10929,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10908
10929
|
variant: "text",
|
|
10909
10930
|
onClick: T[0] || (T[0] = (P) => l.value = !1)
|
|
10910
10931
|
}),
|
|
10911
|
-
W("span", cc,
|
|
10932
|
+
W("span", cc, re(R(e)("x-block-lib.dlg.source.title")), 1),
|
|
10912
10933
|
L(y)
|
|
10913
10934
|
]),
|
|
10914
10935
|
_: 1
|
|
@@ -10932,7 +10953,7 @@ const ic = { class: "position-relative w-100 h-100" }, sc = /* @__PURE__ */ st({
|
|
|
10932
10953
|
t.component("XBlockly", sc), t.component("XSourceDlg", uc);
|
|
10933
10954
|
};
|
|
10934
10955
|
async function Ec(t) {
|
|
10935
|
-
return (await
|
|
10956
|
+
return (await Pn(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.h3b844ct.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.mk5971y3.js") }), `./locales/${t}/index.ts`, 4)).default;
|
|
10936
10957
|
}
|
|
10937
10958
|
const gc = { install: lc };
|
|
10938
10959
|
export {
|