x-block-lib 0.8.35 → 0.8.37
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
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
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-daa85471]{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 { E as I, r as Tn, M as
|
|
10
|
+
import { E as I, r as Tn, M as yo, s as vo, a as Co, X as Rn, u as C, B as E, j as s, O as u, F as O, b as Ge, i as v, c as Et, d as ko, e as U, f as T, g as No, h as $, k as ft, p as Ft, l as ot, m as En, n as B, C as Dn, N as it, o as Lo, P as We, q as Ve, V as St, t as Mn, W as So, v as Bo, w as bo, S as Po, x as Ro, y as Do, z as jt, T as Ae, A as Un, D as Mo, G as Uo, H as Vn, I as Vo, J as xo, K as Yo, L as Fo, Q as wo, R as Ko, U as $o, Y as Ho } from "./vendor.txua272r.js";
|
|
11
11
|
import { globalState as g } from "x-state-lib";
|
|
12
|
-
import { globalObjects as
|
|
13
|
-
import { pkgs as ie, parsePixelStr as jo, parsePercentStr as Xo, getPropertyTag as Mt, unwrapEventId as on, elements as et, makeEventId as Z, toEventName as Ie, unwrapMethodId as Oe, makeMethodId as
|
|
14
|
-
import { provide as qo, inject as Qo, defineComponent as
|
|
15
|
-
import { useI18n as
|
|
12
|
+
import { globalObjects as kt, openConfirmDlg as Go, openPromptDlg as Wo, messageWarning as xn, useColor as Xt, useSystem as Yn, useViewStack as nn, eventBus as Lt } from "x-essential-lib";
|
|
13
|
+
import { pkgs as ie, parsePixelStr as jo, parsePercentStr as Xo, getPropertyTag as Mt, unwrapEventId as on, elements as et, makeEventId as Z, toEventName as Ie, unwrapMethodId as Oe, makeMethodId as Yt, toMethodName as ye, unwrapPropertyId as Jo, makePropertyId as te, toPropertyName as Fn, isLocaleOfMethodKind as wn, makeTriggerId as yt } from "x-runtime-lib";
|
|
14
|
+
import { provide as qo, inject as Qo, defineComponent as rt, resolveComponent as M, createBlock as st, openBlock as S, unref as D, withCtx as at, createVNode as L, mergeProps as sn, useModel as $t, ref as Bt, computed as w, resolveDirective as zo, withDirectives as Zo, createElementBlock as tt, normalizeStyle as j, createElementVNode as K, createCommentVNode as ut, toDisplayString as Ht, withModifiers as wt, mergeModels as je, Fragment as Kn, renderList as ti, useId as Xe, onUnmounted as ei, useTemplateRef as Kt, withKeys as $n, isRef as ne, onMounted as gn, nextTick as ni, onBeforeUnmount as An, watch as Vt, renderSlot as oi } from "vue";
|
|
15
|
+
import { useI18n as Jt } from "vue-i18n";
|
|
16
16
|
import { useDisplay as ii } from "vuetify";
|
|
17
17
|
var b = /* @__PURE__ */ ((t) => (t.STATE_CHANGE = "state_change", t))(b || {});
|
|
18
18
|
class Hn extends I.Abstract {
|
|
@@ -30,14 +30,14 @@ const Gn = (t, e, n) => {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
async function In(t) {
|
|
33
|
-
const e = await Gn(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en.
|
|
34
|
-
|
|
33
|
+
const e = await Gn(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en.jch03670.js"), "./msg/zhHans.ts": () => import("./msg-zhHans.e9yn43wz.js") }), `./msg/${t}.ts`, 3);
|
|
34
|
+
vo(e.default);
|
|
35
35
|
}
|
|
36
36
|
function f(t) {
|
|
37
|
-
return
|
|
37
|
+
return yo[t] ?? t;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
40
|
-
function
|
|
39
|
+
const bt = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==", se = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K";
|
|
40
|
+
function ve(t) {
|
|
41
41
|
const e = t.lastIndexOf("V");
|
|
42
42
|
if (e <= 0 || e >= t.length - 1)
|
|
43
43
|
return console.assert(!1, `invalid key=${t}`), "";
|
|
@@ -66,13 +66,13 @@ function Wn(t) {
|
|
|
66
66
|
function Ce(t, e) {
|
|
67
67
|
return !!(t.startsWith("basic.") || !e.ui || e.readonly);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function V(t) {
|
|
70
70
|
return t.startsWith("globality_v");
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function J(t) {
|
|
73
73
|
return t.startsWith("reference_v");
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function q(t) {
|
|
76
76
|
return t.startsWith("multiple_ref_v");
|
|
77
77
|
}
|
|
78
78
|
function xe(t) {
|
|
@@ -90,7 +90,7 @@ function Je(t, e) {
|
|
|
90
90
|
let n = null;
|
|
91
91
|
return e === "string" ? n = xe("") : e === "integer" || e === "decimal" ? n = On(0) : e === "boolean" ? n = ai() : e === "enum" || e === "dateTime" ? n = xe("") : console.assert(!1), n ? Rn.domToBlock(n, t) : null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function gt(t) {
|
|
94
94
|
return t === "string" ? "String" : t === "number" ? "Number" : t === "boolean" ? "Boolean" : t === "array" ? "Array" : t === "object" ? "Object" : (console.assert(!1), null);
|
|
95
95
|
}
|
|
96
96
|
function ci(t) {
|
|
@@ -107,13 +107,13 @@ function an(t, e, n, o) {
|
|
|
107
107
|
`, a = C.xml.textToDom(i);
|
|
108
108
|
return Rn.domToBlock(a, t);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function F(t, e) {
|
|
111
111
|
try {
|
|
112
112
|
I.disable(), e.forEach((n) => {
|
|
113
|
-
const [o, i, a, c] = n,
|
|
114
|
-
if (!
|
|
113
|
+
const [o, i, a, c] = n, r = t.getInput(o)?.connection;
|
|
114
|
+
if (!r)
|
|
115
115
|
return;
|
|
116
|
-
let l =
|
|
116
|
+
let l = r.targetBlock();
|
|
117
117
|
if (l) {
|
|
118
118
|
const _ = l;
|
|
119
119
|
if (_ && _.key === i && _.name === a && _.locale === c)
|
|
@@ -125,13 +125,13 @@ function Y(t, e) {
|
|
|
125
125
|
i,
|
|
126
126
|
a,
|
|
127
127
|
c
|
|
128
|
-
), l.outputConnection.connect(
|
|
128
|
+
), l.outputConnection.connect(r);
|
|
129
129
|
});
|
|
130
130
|
} finally {
|
|
131
131
|
I.enable();
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function dt(t) {
|
|
135
135
|
const e = `<shadow type="text_v1"><field name="TEXT">${t}</field></shadow>`;
|
|
136
136
|
return C.xml.textToDom(e);
|
|
137
137
|
}
|
|
@@ -150,11 +150,11 @@ function ui() {
|
|
|
150
150
|
return C.xml.textToDom('<shadow type="object_create_v1"></shadow>');
|
|
151
151
|
}
|
|
152
152
|
function li(t) {
|
|
153
|
-
const e = `<shadow type="${
|
|
153
|
+
const e = `<shadow type="${ve(t)}"></shadow>`;
|
|
154
154
|
return C.xml.textToDom(e);
|
|
155
155
|
}
|
|
156
156
|
function _i(t) {
|
|
157
|
-
const e = `<shadow type="${
|
|
157
|
+
const e = `<shadow type="${ve(t)}"></shadow>`;
|
|
158
158
|
return C.xml.textToDom(e);
|
|
159
159
|
}
|
|
160
160
|
function pi(t) {
|
|
@@ -164,13 +164,13 @@ function pi(t) {
|
|
|
164
164
|
function di() {
|
|
165
165
|
return C.xml.textToDom('<shadow type="select_comp_v1"></shadow>');
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function At(t) {
|
|
168
168
|
let e = null;
|
|
169
|
-
return t === "string" ? e =
|
|
169
|
+
return t === "string" ? e = dt("") : t === "number" ? e = ce(0) : t === "boolean" ? e = re(!1) : t === "array" ? e = ri() : t === "object" ? e = ui() : console.assert(!1), e;
|
|
170
170
|
}
|
|
171
171
|
function hi(t) {
|
|
172
172
|
let e = null;
|
|
173
|
-
return t.ui === "dummy" ? console.assert(!0) : t.ui === "strInput" ? e =
|
|
173
|
+
return t.ui === "dummy" ? console.assert(!0) : t.ui === "strInput" ? e = dt(t.default) : t.ui === "numInput" ? e = ce(t.default) : t.ui === "switch" ? e = re(t.default) : t.ui === "select" ? e = li(t.items) : t.ui === "multiTypes" ? e = _i(t.types) : t.ui === "compSelect" ? e = di() : t.ui === "colorPicker" ? e = pi(t.default ?? "#ff0000") : console.assert(!1), e;
|
|
174
174
|
}
|
|
175
175
|
function fi() {
|
|
176
176
|
const { activeObject: t, activePage: e } = g.app, n = [];
|
|
@@ -179,7 +179,7 @@ function fi() {
|
|
|
179
179
|
n.push({ key: o, name: i, type: a });
|
|
180
180
|
return n;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function yn(t) {
|
|
183
183
|
const { activeObject: e, activePage: n } = g.app;
|
|
184
184
|
if (e.type === "page") {
|
|
185
185
|
const o = n.meta.arguments.find((i) => i.id === t);
|
|
@@ -232,7 +232,7 @@ const Ti = {
|
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
234
|
onArgumentChange_: function(t) {
|
|
235
|
-
const e =
|
|
235
|
+
const e = yn(t);
|
|
236
236
|
if (!e) {
|
|
237
237
|
console.assert(!1);
|
|
238
238
|
return;
|
|
@@ -240,10 +240,10 @@ const Ti = {
|
|
|
240
240
|
this.argument.key = e.key, this.argument.name = e.name, this.argument.type = e.type, this.updateShape_();
|
|
241
241
|
},
|
|
242
242
|
updateShape_: function() {
|
|
243
|
-
this.setOutput(!0,
|
|
243
|
+
this.setOutput(!0, gt(this.argument.type));
|
|
244
244
|
},
|
|
245
245
|
checkWarning_: function() {
|
|
246
|
-
const t =
|
|
246
|
+
const t = yn(this.argument.key);
|
|
247
247
|
if (!t) {
|
|
248
248
|
this.setWarningText(f("WARN_ARGUMENT_NOT_FOUND"));
|
|
249
249
|
return;
|
|
@@ -258,10 +258,10 @@ const Ti = {
|
|
|
258
258
|
E.get_page_argument_v1 = Ti;
|
|
259
259
|
s.forBlock.get_page_argument_v1 = function(t) {
|
|
260
260
|
const e = t;
|
|
261
|
-
return [`__getPageArgumentV1__(${s.quote_(e.argument.key)})`,
|
|
261
|
+
return [`__getPageArgumentV1__(${s.quote_(e.argument.key)})`, u.FUNCTION_CALL];
|
|
262
262
|
};
|
|
263
263
|
const Ei = (t, e) => {
|
|
264
|
-
const n =
|
|
264
|
+
const n = ve(t), o = ae(t);
|
|
265
265
|
E[n] = {
|
|
266
266
|
init: function() {
|
|
267
267
|
this.appendDummyInput().appendField(
|
|
@@ -270,14 +270,14 @@ const Ei = (t, e) => {
|
|
|
270
270
|
), this.setOutput(!0, o), this.setStyle("property_blocks"), this.setTooltip(""), this.setHelpUrl("");
|
|
271
271
|
},
|
|
272
272
|
genOpts_: function() {
|
|
273
|
-
const { i18n: i } =
|
|
274
|
-
for (const { title: c, value:
|
|
275
|
-
a.push([i.global.t(c),
|
|
273
|
+
const { i18n: i } = kt, a = [];
|
|
274
|
+
for (const { title: c, value: r } of e)
|
|
275
|
+
a.push([i.global.t(c), r]);
|
|
276
276
|
return k(a);
|
|
277
277
|
}
|
|
278
278
|
}, s.forBlock[n] = function(i) {
|
|
279
279
|
const a = s.quote_, c = i.getFieldValue("ITEM");
|
|
280
|
-
return [a(c),
|
|
280
|
+
return [a(c), u.ATOMIC];
|
|
281
281
|
};
|
|
282
282
|
};
|
|
283
283
|
for (const t in ie) {
|
|
@@ -286,7 +286,7 @@ for (const t in ie) {
|
|
|
286
286
|
Ei(n, e.items[n]);
|
|
287
287
|
}
|
|
288
288
|
const gi = (t, e) => {
|
|
289
|
-
const n =
|
|
289
|
+
const n = ve(t), o = ae(t);
|
|
290
290
|
E[n] = {
|
|
291
291
|
init: function() {
|
|
292
292
|
this.value = e[0].default ?? "", this.appendDummyInput("DUMMY").appendField(
|
|
@@ -303,9 +303,9 @@ const gi = (t, e) => {
|
|
|
303
303
|
}, 0);
|
|
304
304
|
},
|
|
305
305
|
genOpts_: function() {
|
|
306
|
-
const { i18n: i } =
|
|
307
|
-
for (const { title: c, value:
|
|
308
|
-
a.push([i.global.t(c),
|
|
306
|
+
const { i18n: i } = kt, a = [];
|
|
307
|
+
for (const { title: c, value: r } of e)
|
|
308
|
+
a.push([i.global.t(c), r]);
|
|
309
309
|
return k(a);
|
|
310
310
|
},
|
|
311
311
|
onchange: function(i) {
|
|
@@ -336,10 +336,10 @@ const gi = (t, e) => {
|
|
|
336
336
|
if (!c)
|
|
337
337
|
return;
|
|
338
338
|
i.removeField("VALUE", !0), i.removeField("SUFFIX", !0);
|
|
339
|
-
let
|
|
339
|
+
let r, l;
|
|
340
340
|
if (c.ui === "pixelInput") {
|
|
341
341
|
const _ = jo(this.value) ?? 0;
|
|
342
|
-
|
|
342
|
+
r = new Ge(
|
|
343
343
|
_,
|
|
344
344
|
c.min,
|
|
345
345
|
c.max,
|
|
@@ -350,7 +350,7 @@ const gi = (t, e) => {
|
|
|
350
350
|
), l = "px";
|
|
351
351
|
} else if (c.ui === "percentInput") {
|
|
352
352
|
const _ = Xo(this.value) ?? 0;
|
|
353
|
-
|
|
353
|
+
r = new Ge(
|
|
354
354
|
_,
|
|
355
355
|
c.min,
|
|
356
356
|
c.max,
|
|
@@ -360,7 +360,7 @@ const gi = (t, e) => {
|
|
|
360
360
|
}
|
|
361
361
|
), l = "%";
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
r && i.appendField(r, "VALUE"), l && i.appendField(l, "SUFFIX");
|
|
364
364
|
},
|
|
365
365
|
checkWarning_: function() {
|
|
366
366
|
let i = this.value;
|
|
@@ -372,7 +372,7 @@ const gi = (t, e) => {
|
|
|
372
372
|
}
|
|
373
373
|
}, s.forBlock[n] = function(i) {
|
|
374
374
|
const a = s.quote_;
|
|
375
|
-
return [a(i.value),
|
|
375
|
+
return [a(i.value), u.ATOMIC];
|
|
376
376
|
};
|
|
377
377
|
};
|
|
378
378
|
for (const t in ie) {
|
|
@@ -394,10 +394,10 @@ const Oi = {
|
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
396
|
E.app_bind_item_v1 = Oi;
|
|
397
|
-
const
|
|
397
|
+
const yi = {
|
|
398
398
|
init: function() {
|
|
399
399
|
this.itemCount_ = 0, this.setMutator(
|
|
400
|
-
new
|
|
400
|
+
new Et.MutatorIcon(
|
|
401
401
|
["app_bind_item_v1"],
|
|
402
402
|
this
|
|
403
403
|
)
|
|
@@ -482,7 +482,7 @@ const vi = {
|
|
|
482
482
|
"Boolean",
|
|
483
483
|
"Array",
|
|
484
484
|
"Object"
|
|
485
|
-
]), t === 0 && this.getInput("ADD" + t).setAlign(
|
|
485
|
+
]), t === 0 && this.getInput("ADD" + t).setAlign(v.Align.RIGHT).appendField("%{BKY_APP_V1_APP_BIND_TITLE}"));
|
|
486
486
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
487
487
|
this.removeInput("ADD" + t);
|
|
488
488
|
},
|
|
@@ -512,17 +512,17 @@ const vi = {
|
|
|
512
512
|
this.setWarningText(null);
|
|
513
513
|
}
|
|
514
514
|
};
|
|
515
|
-
E.app_bind_v1 =
|
|
515
|
+
E.app_bind_v1 = yi;
|
|
516
516
|
s.forBlock.app_bind_v1 = function() {
|
|
517
517
|
return "";
|
|
518
518
|
};
|
|
519
519
|
function Xn() {
|
|
520
520
|
return g.app.appList;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function vn(t) {
|
|
523
523
|
return g.app.appList.find((e) => e.id === t);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function vi() {
|
|
526
526
|
const t = [];
|
|
527
527
|
return Xn().forEach(({ id: n, name: o }) => {
|
|
528
528
|
t.push([o, n]);
|
|
@@ -557,27 +557,27 @@ function Cn(t) {
|
|
|
557
557
|
return t === "" ? Jn : g.app.activeApp.comps.find((e) => e.id === t);
|
|
558
558
|
}
|
|
559
559
|
function ki() {
|
|
560
|
-
const { i18n: t } =
|
|
560
|
+
const { i18n: t } = kt, e = [];
|
|
561
561
|
return qn().forEach(({ id: o, name: i }) => {
|
|
562
562
|
let a = i;
|
|
563
563
|
o === "" && (a = t.global.t("x-runtime-lib.notSet")), e.push([a, o]);
|
|
564
564
|
}), k(e);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function ht(t) {
|
|
567
567
|
const e = [];
|
|
568
568
|
for (const { id: n, name: o, type: i } of t)
|
|
569
569
|
e.push({ key: n, name: o, type: i });
|
|
570
570
|
return e;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Q(t) {
|
|
573
573
|
return [
|
|
574
574
|
{ key: "newValue", name: "x-runtime-lib.newValue", type: t },
|
|
575
575
|
{ key: "oldValue", name: "x-runtime-lib.oldValue", type: t }
|
|
576
576
|
];
|
|
577
577
|
}
|
|
578
578
|
function Qe(t) {
|
|
579
|
-
const { properties: e } = g.runtime, { activeObject: n, activePage: o, activeComp: i, depends: a } = g.app, c = [],
|
|
580
|
-
if (!
|
|
579
|
+
const { properties: e } = g.runtime, { activeObject: n, activePage: o, activeComp: i, depends: a } = g.app, c = [], r = Mt(n.type, n.subtype);
|
|
580
|
+
if (!r)
|
|
581
581
|
return c;
|
|
582
582
|
const l = n.nodes.find((d) => d.id === t);
|
|
583
583
|
if (!l)
|
|
@@ -592,7 +592,7 @@ function Qe(t) {
|
|
|
592
592
|
names: [h],
|
|
593
593
|
params: p
|
|
594
594
|
});
|
|
595
|
-
if (
|
|
595
|
+
if (J(_.key) && l.reference && l.reference.comp) {
|
|
596
596
|
const d = a[l.reference.comp];
|
|
597
597
|
if (d)
|
|
598
598
|
for (const { id: h, name: p, params: m } of d.meta.events)
|
|
@@ -600,10 +600,10 @@ function Qe(t) {
|
|
|
600
600
|
id: Z("referenceEvent", t, h),
|
|
601
601
|
kind: "referenceEvent",
|
|
602
602
|
names: [p],
|
|
603
|
-
params:
|
|
603
|
+
params: ht(m)
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
|
-
if (
|
|
606
|
+
if (q(_.key) && l.reference && l.reference.comp) {
|
|
607
607
|
const d = a[l.reference.comp];
|
|
608
608
|
if (d)
|
|
609
609
|
for (const { id: h, name: p, params: m } of d.meta.events)
|
|
@@ -611,26 +611,26 @@ function Qe(t) {
|
|
|
611
611
|
id: Z("multipleRefEvent", t, h),
|
|
612
612
|
kind: "multipleRefEvent",
|
|
613
613
|
names: [p],
|
|
614
|
-
params:
|
|
614
|
+
params: ht(m)
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
-
if (
|
|
617
|
+
if (V(_.key) && n.type === "comp")
|
|
618
618
|
for (const { id: d, name: h, params: p } of i.meta.events)
|
|
619
619
|
c.push({
|
|
620
620
|
id: Z("customEvent", t, d),
|
|
621
621
|
kind: "customEvent",
|
|
622
622
|
names: [h],
|
|
623
|
-
params:
|
|
623
|
+
params: ht(p)
|
|
624
624
|
});
|
|
625
|
-
if (e[_.key] && e[_.key][
|
|
626
|
-
for (const { keys: d, names: h, raw: p } of e[_.key][
|
|
625
|
+
if (e[_.key] && e[_.key][r])
|
|
626
|
+
for (const { keys: d, names: h, raw: p } of e[_.key][r])
|
|
627
627
|
Ce(d, p) || c.push({
|
|
628
628
|
id: Z("elementPropertyChangeEvent", t, d),
|
|
629
629
|
kind: "elementPropertyChangeEvent",
|
|
630
630
|
names: h,
|
|
631
|
-
params:
|
|
631
|
+
params: Q(Wn(p))
|
|
632
632
|
});
|
|
633
|
-
if (
|
|
633
|
+
if (J(_.key) && l.reference && l.reference.comp) {
|
|
634
634
|
const d = a[l.reference.comp];
|
|
635
635
|
if (d)
|
|
636
636
|
for (const { id: h, name: p, type: m } of d.meta.properties)
|
|
@@ -638,10 +638,10 @@ function Qe(t) {
|
|
|
638
638
|
id: Z("referencePropertyChangeEvent", t, h),
|
|
639
639
|
kind: "referencePropertyChangeEvent",
|
|
640
640
|
names: [p],
|
|
641
|
-
params:
|
|
641
|
+
params: Q(m)
|
|
642
642
|
});
|
|
643
643
|
}
|
|
644
|
-
if (
|
|
644
|
+
if (q(_.key) && l.reference && l.reference.comp) {
|
|
645
645
|
const d = a[l.reference.comp];
|
|
646
646
|
if (d)
|
|
647
647
|
for (const { id: h, name: p, type: m } of d.meta.properties)
|
|
@@ -649,25 +649,25 @@ function Qe(t) {
|
|
|
649
649
|
id: Z("multipleRefPropertyChangeEvent", t, h),
|
|
650
650
|
kind: "multipleRefPropertyChangeEvent",
|
|
651
651
|
names: [p],
|
|
652
|
-
params:
|
|
652
|
+
params: Q(m)
|
|
653
653
|
});
|
|
654
654
|
}
|
|
655
|
-
if (
|
|
655
|
+
if (V(_.key) && n.type === "comp")
|
|
656
656
|
for (const { id: d, name: h, type: p } of i.meta.properties)
|
|
657
657
|
c.push({
|
|
658
658
|
id: Z("customPropertyChangeEvent", t, d),
|
|
659
659
|
kind: "customPropertyChangeEvent",
|
|
660
660
|
names: [h],
|
|
661
|
-
params:
|
|
661
|
+
params: Q(p)
|
|
662
662
|
});
|
|
663
|
-
if (
|
|
663
|
+
if (V(_.key)) {
|
|
664
664
|
if (n.type === "page")
|
|
665
665
|
for (const { id: d, name: h, type: p } of o.meta.states)
|
|
666
666
|
c.push({
|
|
667
667
|
id: Z("stateChangeEvent", "globality", d),
|
|
668
668
|
kind: "stateChangeEvent",
|
|
669
669
|
names: [h],
|
|
670
|
-
params:
|
|
670
|
+
params: Q(p)
|
|
671
671
|
});
|
|
672
672
|
else if (n.type === "comp")
|
|
673
673
|
for (const { id: d, name: h, type: p } of i.meta.states)
|
|
@@ -675,7 +675,7 @@ function Qe(t) {
|
|
|
675
675
|
id: Z("stateChangeEvent", "globality", d),
|
|
676
676
|
kind: "stateChangeEvent",
|
|
677
677
|
names: [h],
|
|
678
|
-
params:
|
|
678
|
+
params: Q(p)
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
return c;
|
|
@@ -686,7 +686,7 @@ function Fe(t) {
|
|
|
686
686
|
const { properties: e } = g.runtime, { activeObject: n, activePage: o, activeComp: i, depends: a } = g.app, c = Mt(n.type, n.subtype);
|
|
687
687
|
if (!c)
|
|
688
688
|
return;
|
|
689
|
-
const { kind:
|
|
689
|
+
const { kind: r, nodeId: l, eventKey: _ } = on(t), d = n.nodes.find((p) => p.id === l);
|
|
690
690
|
if (!d)
|
|
691
691
|
return;
|
|
692
692
|
const h = et[d.key];
|
|
@@ -694,55 +694,55 @@ function Fe(t) {
|
|
|
694
694
|
console.assert(!1, "invalid element", d.key);
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
|
-
if (
|
|
697
|
+
if (r === "elementEvent") {
|
|
698
698
|
const p = h.events.find((m) => m.key === _);
|
|
699
699
|
if (p)
|
|
700
700
|
return {
|
|
701
701
|
id: t,
|
|
702
|
-
kind:
|
|
702
|
+
kind: r,
|
|
703
703
|
names: [p.name],
|
|
704
704
|
params: p.params
|
|
705
705
|
};
|
|
706
|
-
} else if (
|
|
707
|
-
if (
|
|
706
|
+
} else if (r === "referenceEvent") {
|
|
707
|
+
if (J(h.key) && d.reference && d.reference.comp) {
|
|
708
708
|
const p = a[d.reference.comp];
|
|
709
709
|
if (p) {
|
|
710
710
|
const m = p.meta.events.find((A) => A.id === _);
|
|
711
711
|
if (m)
|
|
712
712
|
return {
|
|
713
713
|
id: t,
|
|
714
|
-
kind:
|
|
714
|
+
kind: r,
|
|
715
715
|
names: [m.name],
|
|
716
|
-
params:
|
|
716
|
+
params: ht(m.params)
|
|
717
717
|
};
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
} else if (
|
|
721
|
-
if (
|
|
720
|
+
} else if (r === "multipleRefEvent") {
|
|
721
|
+
if (q(h.key) && d.reference && d.reference.comp) {
|
|
722
722
|
const p = a[d.reference.comp];
|
|
723
723
|
if (p) {
|
|
724
724
|
const m = p.meta.events.find((A) => A.id === _);
|
|
725
725
|
if (m)
|
|
726
726
|
return {
|
|
727
727
|
id: t,
|
|
728
|
-
kind:
|
|
728
|
+
kind: r,
|
|
729
729
|
names: [m.name],
|
|
730
|
-
params:
|
|
730
|
+
params: ht(m.params)
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
} else if (
|
|
735
|
-
if (
|
|
734
|
+
} else if (r === "customEvent") {
|
|
735
|
+
if (V(h.key) && n.type === "comp") {
|
|
736
736
|
const p = i.meta.events.find((m) => m.id === _);
|
|
737
737
|
if (p)
|
|
738
738
|
return {
|
|
739
739
|
id: t,
|
|
740
|
-
kind:
|
|
740
|
+
kind: r,
|
|
741
741
|
names: [p.name],
|
|
742
|
-
params:
|
|
742
|
+
params: ht(p.params)
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
|
-
} else if (
|
|
745
|
+
} else if (r === "elementPropertyChangeEvent") {
|
|
746
746
|
if (e[h.key] && e[h.key][c]) {
|
|
747
747
|
const p = e[h.key][c].find(
|
|
748
748
|
(m) => m.keys === _
|
|
@@ -750,13 +750,13 @@ function Fe(t) {
|
|
|
750
750
|
if (p)
|
|
751
751
|
return {
|
|
752
752
|
id: t,
|
|
753
|
-
kind:
|
|
753
|
+
kind: r,
|
|
754
754
|
names: p.names,
|
|
755
|
-
params:
|
|
755
|
+
params: Q(Wn(p.raw))
|
|
756
756
|
};
|
|
757
757
|
}
|
|
758
|
-
} else if (
|
|
759
|
-
if (
|
|
758
|
+
} else if (r === "referencePropertyChangeEvent") {
|
|
759
|
+
if (J(h.key) && d.reference && d.reference.comp) {
|
|
760
760
|
const p = a[d.reference.comp];
|
|
761
761
|
if (p) {
|
|
762
762
|
const m = p.meta.properties.find(
|
|
@@ -765,14 +765,14 @@ function Fe(t) {
|
|
|
765
765
|
if (m)
|
|
766
766
|
return {
|
|
767
767
|
id: t,
|
|
768
|
-
kind:
|
|
768
|
+
kind: r,
|
|
769
769
|
names: [m.name],
|
|
770
|
-
params:
|
|
770
|
+
params: Q(m.type)
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
} else if (
|
|
775
|
-
if (
|
|
774
|
+
} else if (r === "multipleRefPropertyChangeEvent") {
|
|
775
|
+
if (q(h.key) && d.reference && d.reference.comp) {
|
|
776
776
|
const p = a[d.reference.comp];
|
|
777
777
|
if (p) {
|
|
778
778
|
const m = p.meta.properties.find(
|
|
@@ -781,26 +781,26 @@ function Fe(t) {
|
|
|
781
781
|
if (m)
|
|
782
782
|
return {
|
|
783
783
|
id: t,
|
|
784
|
-
kind:
|
|
784
|
+
kind: r,
|
|
785
785
|
names: [m.name],
|
|
786
|
-
params:
|
|
786
|
+
params: Q(m.type)
|
|
787
787
|
};
|
|
788
788
|
}
|
|
789
789
|
}
|
|
790
|
-
} else if (
|
|
791
|
-
if (
|
|
790
|
+
} else if (r === "customPropertyChangeEvent") {
|
|
791
|
+
if (V(h.key) && n.type === "comp") {
|
|
792
792
|
const p = i.meta.properties.find(
|
|
793
793
|
(m) => m.id === _
|
|
794
794
|
);
|
|
795
795
|
if (p)
|
|
796
796
|
return {
|
|
797
797
|
id: t,
|
|
798
|
-
kind:
|
|
798
|
+
kind: r,
|
|
799
799
|
names: [p.name],
|
|
800
|
-
params:
|
|
800
|
+
params: Q(p.type)
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
} else if (
|
|
803
|
+
} else if (r === "stateChangeEvent" && V(h.key)) {
|
|
804
804
|
if (n.type === "page") {
|
|
805
805
|
const p = o.meta.states.find(
|
|
806
806
|
(m) => m.id === _
|
|
@@ -808,9 +808,9 @@ function Fe(t) {
|
|
|
808
808
|
if (p)
|
|
809
809
|
return {
|
|
810
810
|
id: t,
|
|
811
|
-
kind:
|
|
811
|
+
kind: r,
|
|
812
812
|
names: [p.name],
|
|
813
|
-
params:
|
|
813
|
+
params: Q(p.type)
|
|
814
814
|
};
|
|
815
815
|
} else if (n.type === "comp") {
|
|
816
816
|
const p = i.meta.states.find(
|
|
@@ -819,9 +819,9 @@ function Fe(t) {
|
|
|
819
819
|
if (p)
|
|
820
820
|
return {
|
|
821
821
|
id: t,
|
|
822
|
-
kind:
|
|
822
|
+
kind: r,
|
|
823
823
|
names: [p.name],
|
|
824
|
-
params:
|
|
824
|
+
params: Q(p.type)
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
827
|
}
|
|
@@ -840,7 +840,7 @@ function Qn() {
|
|
|
840
840
|
id: Z("customEvent", "globality", o),
|
|
841
841
|
kind: "customEvent",
|
|
842
842
|
names: [i],
|
|
843
|
-
params:
|
|
843
|
+
params: ht(a)
|
|
844
844
|
});
|
|
845
845
|
return n;
|
|
846
846
|
}
|
|
@@ -850,14 +850,14 @@ function kn(t) {
|
|
|
850
850
|
const { activeObject: e, activeComp: n } = g.app, { kind: o, nodeId: i, eventKey: a } = on(t);
|
|
851
851
|
if (o === "customEvent" && i === "globality" && e.type === "comp") {
|
|
852
852
|
const c = n.meta.events.find(
|
|
853
|
-
(
|
|
853
|
+
(r) => r.id === a
|
|
854
854
|
);
|
|
855
855
|
if (c)
|
|
856
856
|
return {
|
|
857
857
|
id: t,
|
|
858
858
|
kind: o,
|
|
859
859
|
names: [c.name],
|
|
860
|
-
params:
|
|
860
|
+
params: ht(c.params)
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
863
|
}
|
|
@@ -867,118 +867,141 @@ function Li() {
|
|
|
867
867
|
t.push([Ie(o, i), n]);
|
|
868
868
|
return k(t);
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function ct(t) {
|
|
871
871
|
const e = [];
|
|
872
872
|
for (const { id: n, name: o, type: i } of t)
|
|
873
873
|
e.push({ key: n, name: o, type: i });
|
|
874
874
|
return e;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Ct(t) {
|
|
877
877
|
const e = [];
|
|
878
878
|
for (const { id: n, name: o, type: i } of t)
|
|
879
879
|
e.push({ key: n, name: o, type: i });
|
|
880
880
|
return e;
|
|
881
881
|
}
|
|
882
882
|
function ze(t) {
|
|
883
|
-
const { activeObject: e,
|
|
884
|
-
if (!i)
|
|
885
|
-
return o;
|
|
886
|
-
const a = et[i.key];
|
|
883
|
+
const { activeObject: e, activeComp: n, depends: o } = g.app, i = [], a = e.nodes.find((r) => r.id === t);
|
|
887
884
|
if (!a)
|
|
888
|
-
return
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
885
|
+
return i;
|
|
886
|
+
const c = et[a.key];
|
|
887
|
+
if (!c)
|
|
888
|
+
return console.assert(!1, "inavlid element", a.key), i;
|
|
889
|
+
for (const { key: r, name: l, inputs: _, outputs: d } of c.methods)
|
|
890
|
+
i.push({
|
|
891
|
+
id: Yt("elementMethod", t, r),
|
|
892
892
|
kind: "elementMethod",
|
|
893
|
-
names: [
|
|
894
|
-
inputs:
|
|
895
|
-
outputs:
|
|
893
|
+
names: [l],
|
|
894
|
+
inputs: _,
|
|
895
|
+
outputs: d
|
|
896
896
|
});
|
|
897
|
-
if (
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
900
|
-
for (const { id:
|
|
901
|
-
|
|
902
|
-
id:
|
|
897
|
+
if (J(c.key) && a.reference && a.reference.comp) {
|
|
898
|
+
const r = o[a.reference.comp];
|
|
899
|
+
if (r)
|
|
900
|
+
for (const { id: l, name: _, inputs: d, outputs: h } of r.meta.methods)
|
|
901
|
+
i.push({
|
|
902
|
+
id: Yt("referenceMethod", t, l),
|
|
903
903
|
kind: "referenceMethod",
|
|
904
|
-
names: [
|
|
905
|
-
inputs:
|
|
906
|
-
outputs:
|
|
904
|
+
names: [_],
|
|
905
|
+
inputs: ct(d),
|
|
906
|
+
outputs: Ct(h)
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
|
-
if (
|
|
910
|
-
const
|
|
911
|
-
if (
|
|
912
|
-
for (const { id:
|
|
913
|
-
|
|
914
|
-
id:
|
|
909
|
+
if (q(c.key) && a.reference && a.reference.comp) {
|
|
910
|
+
const r = o[a.reference.comp];
|
|
911
|
+
if (r)
|
|
912
|
+
for (const { id: l, name: _, inputs: d, outputs: h } of r.meta.methods)
|
|
913
|
+
i.push({
|
|
914
|
+
id: Yt("multipleRefMethod", t, l),
|
|
915
915
|
kind: "multipleRefMethod",
|
|
916
|
-
names: [
|
|
917
|
-
inputs:
|
|
918
|
-
outputs:
|
|
916
|
+
names: [_],
|
|
917
|
+
inputs: ct(d),
|
|
918
|
+
outputs: Ct(h)
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
|
-
|
|
921
|
+
if (V(c.key) && e.type === "comp")
|
|
922
|
+
for (const { id: r, name: l, inputs: _, outputs: d } of n.meta.methods)
|
|
923
|
+
i.push({
|
|
924
|
+
id: Yt("customMethod", t, r),
|
|
925
|
+
kind: "customMethod",
|
|
926
|
+
names: [l],
|
|
927
|
+
inputs: ct(_),
|
|
928
|
+
outputs: Ct(d)
|
|
929
|
+
});
|
|
930
|
+
return V(c.key) && e.type, i;
|
|
922
931
|
}
|
|
923
932
|
function we(t) {
|
|
924
933
|
if (!t)
|
|
925
934
|
return;
|
|
926
|
-
const { activeObject: e,
|
|
927
|
-
if (!
|
|
935
|
+
const { activeObject: e, activeComp: n, depends: o } = g.app, { kind: i, nodeId: a, methodKey: c } = Oe(t), r = e.nodes.find((_) => _.id === a);
|
|
936
|
+
if (!r)
|
|
928
937
|
return;
|
|
929
|
-
const
|
|
930
|
-
if (!
|
|
931
|
-
console.assert(!1, "invalid element",
|
|
938
|
+
const l = et[r.key];
|
|
939
|
+
if (!l) {
|
|
940
|
+
console.assert(!1, "invalid element", r.key);
|
|
932
941
|
return;
|
|
933
942
|
}
|
|
934
|
-
if (
|
|
935
|
-
const
|
|
936
|
-
if (
|
|
943
|
+
if (i === "elementMethod") {
|
|
944
|
+
const _ = l.methods.find((d) => d.key === c);
|
|
945
|
+
if (_)
|
|
937
946
|
return {
|
|
938
947
|
id: t,
|
|
939
|
-
kind:
|
|
940
|
-
names: [
|
|
941
|
-
inputs:
|
|
942
|
-
outputs:
|
|
948
|
+
kind: i,
|
|
949
|
+
names: [_.name],
|
|
950
|
+
inputs: _.inputs,
|
|
951
|
+
outputs: _.outputs
|
|
943
952
|
};
|
|
944
|
-
} else if (
|
|
945
|
-
if (
|
|
946
|
-
const
|
|
947
|
-
if (
|
|
948
|
-
const
|
|
949
|
-
(
|
|
953
|
+
} else if (i === "referenceMethod") {
|
|
954
|
+
if (J(l.key) && r.reference && r.reference.comp) {
|
|
955
|
+
const _ = o[r.reference.comp];
|
|
956
|
+
if (_) {
|
|
957
|
+
const d = _.meta.methods.find(
|
|
958
|
+
(h) => h.id === c
|
|
950
959
|
);
|
|
951
|
-
if (
|
|
960
|
+
if (d)
|
|
952
961
|
return {
|
|
953
962
|
id: t,
|
|
954
|
-
kind:
|
|
955
|
-
names: [
|
|
956
|
-
inputs:
|
|
957
|
-
outputs:
|
|
963
|
+
kind: i,
|
|
964
|
+
names: [d.name],
|
|
965
|
+
inputs: ct(d.inputs),
|
|
966
|
+
outputs: Ct(d.outputs)
|
|
958
967
|
};
|
|
959
968
|
}
|
|
960
969
|
}
|
|
961
|
-
} else if (
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
970
|
+
} else if (i === "multipleRefMethod") {
|
|
971
|
+
if (q(l.key) && r.reference && r.reference.comp) {
|
|
972
|
+
const _ = o[r.reference.comp];
|
|
973
|
+
if (_) {
|
|
974
|
+
const d = _.meta.methods.find(
|
|
975
|
+
(h) => h.id === c
|
|
976
|
+
);
|
|
977
|
+
if (d)
|
|
978
|
+
return {
|
|
979
|
+
id: t,
|
|
980
|
+
kind: i,
|
|
981
|
+
names: [d.name],
|
|
982
|
+
inputs: ct(d.inputs),
|
|
983
|
+
outputs: Ct(d.outputs)
|
|
984
|
+
};
|
|
985
|
+
}
|
|
975
986
|
}
|
|
987
|
+
} else if (i === "customMethod" && V(l.key) && e.type === "comp") {
|
|
988
|
+
const _ = n.meta.methods.find(
|
|
989
|
+
(d) => d.id === c
|
|
990
|
+
);
|
|
991
|
+
if (_)
|
|
992
|
+
return {
|
|
993
|
+
id: t,
|
|
994
|
+
kind: i,
|
|
995
|
+
names: [_.name],
|
|
996
|
+
inputs: ct(_.inputs),
|
|
997
|
+
outputs: ct(_.outputs)
|
|
998
|
+
};
|
|
976
999
|
}
|
|
977
1000
|
}
|
|
978
1001
|
function Si(t) {
|
|
979
1002
|
const e = [], n = ze(t);
|
|
980
1003
|
for (const { id: o, kind: i, names: a } of n)
|
|
981
|
-
e.push([
|
|
1004
|
+
e.push([ye(i, a), o]);
|
|
982
1005
|
return k(e);
|
|
983
1006
|
}
|
|
984
1007
|
function cn() {
|
|
@@ -986,11 +1009,11 @@ function cn() {
|
|
|
986
1009
|
if (t.type === "comp")
|
|
987
1010
|
for (const { id: o, name: i, inputs: a, outputs: c } of e.meta.methods)
|
|
988
1011
|
n.push({
|
|
989
|
-
id:
|
|
1012
|
+
id: Yt("customMethod", "globality", o),
|
|
990
1013
|
kind: "customMethod",
|
|
991
1014
|
names: [i],
|
|
992
|
-
inputs:
|
|
993
|
-
outputs:
|
|
1015
|
+
inputs: ct(a),
|
|
1016
|
+
outputs: Ct(c)
|
|
994
1017
|
});
|
|
995
1018
|
return n;
|
|
996
1019
|
}
|
|
@@ -1000,22 +1023,22 @@ function Dt(t) {
|
|
|
1000
1023
|
const { activeObject: e, activeComp: n } = g.app, { kind: o, nodeId: i, methodKey: a } = Oe(t);
|
|
1001
1024
|
if (o === "customMethod" && i === "globality" && e.type === "comp") {
|
|
1002
1025
|
const c = n.meta.methods.find(
|
|
1003
|
-
(
|
|
1026
|
+
(r) => r.id === a
|
|
1004
1027
|
);
|
|
1005
1028
|
if (c)
|
|
1006
1029
|
return {
|
|
1007
1030
|
id: t,
|
|
1008
1031
|
kind: o,
|
|
1009
1032
|
names: [c.name],
|
|
1010
|
-
inputs:
|
|
1011
|
-
outputs:
|
|
1033
|
+
inputs: ct(c.inputs),
|
|
1034
|
+
outputs: Ct(c.outputs)
|
|
1012
1035
|
};
|
|
1013
1036
|
}
|
|
1014
1037
|
}
|
|
1015
1038
|
function zn() {
|
|
1016
1039
|
const t = [], e = cn();
|
|
1017
1040
|
for (const { id: n, kind: o, names: i } of e)
|
|
1018
|
-
t.push([
|
|
1041
|
+
t.push([ye(o, i), n]);
|
|
1019
1042
|
return k(t);
|
|
1020
1043
|
}
|
|
1021
1044
|
function Ze(t) {
|
|
@@ -1034,27 +1057,39 @@ function Bi(t) {
|
|
|
1034
1057
|
return k(e);
|
|
1035
1058
|
}
|
|
1036
1059
|
function bi(t, e, n) {
|
|
1037
|
-
const { properties: o } = g.runtime, { activeObject: i, activePage: a, activeComp: c, depends:
|
|
1060
|
+
const { properties: o } = g.runtime, { activeObject: i, activePage: a, activeComp: c, depends: r } = g.app;
|
|
1038
1061
|
if (t.events.length > 0)
|
|
1039
1062
|
return !1;
|
|
1040
|
-
if (
|
|
1041
|
-
const l =
|
|
1063
|
+
if (J(t.key) && n) {
|
|
1064
|
+
const l = r[n];
|
|
1042
1065
|
if (l && l.meta.events.length > 0)
|
|
1043
1066
|
return !1;
|
|
1044
1067
|
}
|
|
1045
|
-
if (
|
|
1046
|
-
const l =
|
|
1068
|
+
if (q(t.key) && n) {
|
|
1069
|
+
const l = r[n];
|
|
1047
1070
|
if (l && l.meta.events.length > 0)
|
|
1048
1071
|
return !1;
|
|
1049
1072
|
}
|
|
1073
|
+
if (V(t.key) && i.type === "comp" && c.meta.events.length > 0)
|
|
1074
|
+
return !1;
|
|
1050
1075
|
if (o[t.key] && o[t.key][e]) {
|
|
1051
1076
|
for (const { keys: l, raw: _ } of o[t.key][e])
|
|
1052
1077
|
if (!Ce(l, _))
|
|
1053
1078
|
return !1;
|
|
1054
1079
|
}
|
|
1055
|
-
if (
|
|
1080
|
+
if (J(t.key) && n) {
|
|
1081
|
+
const l = r[n];
|
|
1082
|
+
if (l && l.meta.properties.length > 0)
|
|
1083
|
+
return !1;
|
|
1084
|
+
}
|
|
1085
|
+
if (q(t.key) && n) {
|
|
1086
|
+
const l = r[n];
|
|
1087
|
+
if (l && l.meta.properties.length > 0)
|
|
1088
|
+
return !1;
|
|
1089
|
+
}
|
|
1090
|
+
if (V(t.key) && i.type === "comp" && c.meta.properties.length > 0)
|
|
1056
1091
|
return !1;
|
|
1057
|
-
if (
|
|
1092
|
+
if (V(t.key)) {
|
|
1058
1093
|
if (i.type === "page") {
|
|
1059
1094
|
if (a.meta.states.length > 0)
|
|
1060
1095
|
return !1;
|
|
@@ -1064,55 +1099,55 @@ function bi(t, e, n) {
|
|
|
1064
1099
|
return !0;
|
|
1065
1100
|
}
|
|
1066
1101
|
function Pi(t, e) {
|
|
1067
|
-
const { activeObject: n,
|
|
1102
|
+
const { activeObject: n, activeComp: o, depends: i } = g.app;
|
|
1068
1103
|
if (t.methods.length > 0)
|
|
1069
1104
|
return !1;
|
|
1070
|
-
if (
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1105
|
+
if (J(t.key) && e) {
|
|
1106
|
+
const a = i[e];
|
|
1107
|
+
if (a && a.meta.methods.length > 0)
|
|
1073
1108
|
return !1;
|
|
1074
1109
|
}
|
|
1075
|
-
if (
|
|
1076
|
-
const
|
|
1077
|
-
if (
|
|
1110
|
+
if (q(t.key) && e) {
|
|
1111
|
+
const a = i[e];
|
|
1112
|
+
if (a && a.meta.methods.length > 0)
|
|
1078
1113
|
return !1;
|
|
1079
1114
|
}
|
|
1080
|
-
return
|
|
1115
|
+
return V(t.key) && n.type === "comp" && o.meta.methods.length > 0 ? !1 : (V(t.key) && n.type, !0);
|
|
1081
1116
|
}
|
|
1082
1117
|
function Ri(t, e, n) {
|
|
1083
1118
|
const { properties: o } = g.runtime, { activeObject: i, activeComp: a, depends: c } = g.app;
|
|
1084
1119
|
if (o[t.key] && o[t.key][e] && o[t.key][e].length > 0)
|
|
1085
1120
|
return !1;
|
|
1086
|
-
if (
|
|
1087
|
-
const
|
|
1088
|
-
if (
|
|
1121
|
+
if (J(t.key) && n) {
|
|
1122
|
+
const r = c[n];
|
|
1123
|
+
if (r && r.meta.properties.length > 0)
|
|
1089
1124
|
return !1;
|
|
1090
1125
|
}
|
|
1091
|
-
if (
|
|
1092
|
-
const
|
|
1093
|
-
if (
|
|
1126
|
+
if (q(t.key) && n) {
|
|
1127
|
+
const r = c[n];
|
|
1128
|
+
if (r && r.meta.properties.length > 0)
|
|
1094
1129
|
return !1;
|
|
1095
1130
|
}
|
|
1096
|
-
return !(
|
|
1131
|
+
return !(V(t.key) && i.type === "comp" && a.meta.properties.length > 0);
|
|
1097
1132
|
}
|
|
1098
1133
|
function Di(t, e, n) {
|
|
1099
1134
|
const { properties: o } = g.runtime, { activeObject: i, activeComp: a, depends: c } = g.app;
|
|
1100
1135
|
if (o[t.key] && o[t.key][e]) {
|
|
1101
|
-
for (const { keys:
|
|
1102
|
-
if (!Ce(
|
|
1136
|
+
for (const { keys: r, raw: l } of o[t.key][e])
|
|
1137
|
+
if (!Ce(r, l))
|
|
1103
1138
|
return !1;
|
|
1104
1139
|
}
|
|
1105
|
-
if (
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1140
|
+
if (J(t.key) && n) {
|
|
1141
|
+
const r = c[n];
|
|
1142
|
+
if (r && r.meta.properties.length > 0)
|
|
1108
1143
|
return !1;
|
|
1109
1144
|
}
|
|
1110
|
-
if (
|
|
1111
|
-
const
|
|
1112
|
-
if (
|
|
1145
|
+
if (q(t.key) && n) {
|
|
1146
|
+
const r = c[n];
|
|
1147
|
+
if (r && r.meta.properties.length > 0)
|
|
1113
1148
|
return !1;
|
|
1114
1149
|
}
|
|
1115
|
-
return !(
|
|
1150
|
+
return !(V(t.key) && i.type === "comp" && a.meta.properties.length > 0);
|
|
1116
1151
|
}
|
|
1117
1152
|
function Zn(t, e, n, o) {
|
|
1118
1153
|
return t ? t === "onEvent" ? bi(e, n, o) : t === "callMethod" ? Pi(e, o) : t === "getProperty" ? Ri(e, n, o) : t === "setProperty" ? Di(e, n, o) : !1 : !1;
|
|
@@ -1132,7 +1167,7 @@ function X(t) {
|
|
|
1132
1167
|
}
|
|
1133
1168
|
return !1;
|
|
1134
1169
|
}
|
|
1135
|
-
function
|
|
1170
|
+
function qt(t) {
|
|
1136
1171
|
const { activeObject: e } = g.app, n = [], o = Mt(e.type, e.subtype);
|
|
1137
1172
|
if (!o)
|
|
1138
1173
|
return n;
|
|
@@ -1151,7 +1186,7 @@ function Jt(t) {
|
|
|
1151
1186
|
}
|
|
1152
1187
|
return n;
|
|
1153
1188
|
}
|
|
1154
|
-
function
|
|
1189
|
+
function mt(t) {
|
|
1155
1190
|
const { activeObject: e } = g.app, n = e.nodes.find((i) => i.id === t);
|
|
1156
1191
|
if (!n)
|
|
1157
1192
|
return;
|
|
@@ -1168,16 +1203,16 @@ function ft(t) {
|
|
|
1168
1203
|
};
|
|
1169
1204
|
}
|
|
1170
1205
|
function ke(t) {
|
|
1171
|
-
const { i18n: e } =
|
|
1206
|
+
const { i18n: e } = kt, n = [], o = qt(t);
|
|
1172
1207
|
for (const { id: i, name: a, alias: c } of o) {
|
|
1173
|
-
let
|
|
1174
|
-
c && (
|
|
1208
|
+
let r = e.global.t(a);
|
|
1209
|
+
c && (r += " / " + c), n.push([r, i]);
|
|
1175
1210
|
}
|
|
1176
1211
|
return k(n);
|
|
1177
1212
|
}
|
|
1178
|
-
function
|
|
1179
|
-
const { properties: n } = g.runtime, { activeObject: o, activeComp: i, depends: a } = g.app, c = [],
|
|
1180
|
-
if (!
|
|
1213
|
+
function Gt(t, e) {
|
|
1214
|
+
const { properties: n } = g.runtime, { activeObject: o, activeComp: i, depends: a } = g.app, c = [], r = Mt(o.type, o.subtype);
|
|
1215
|
+
if (!r)
|
|
1181
1216
|
return c;
|
|
1182
1217
|
const l = o.nodes.find((d) => d.id === t);
|
|
1183
1218
|
if (!l)
|
|
@@ -1185,10 +1220,10 @@ function Ht(t, e) {
|
|
|
1185
1220
|
const _ = et[l.key];
|
|
1186
1221
|
if (!_)
|
|
1187
1222
|
return console.assert(!1, "invalid element", l.key), c;
|
|
1188
|
-
if (n[_.key] && n[_.key][
|
|
1189
|
-
for (const { keys: d, names: h, raw: p } of n[_.key][
|
|
1223
|
+
if (n[_.key] && n[_.key][r])
|
|
1224
|
+
for (const { keys: d, names: h, raw: p } of n[_.key][r])
|
|
1190
1225
|
e === "write" && Ce(d, p) || c.push({
|
|
1191
|
-
id:
|
|
1226
|
+
id: te("elementProperty", t, d),
|
|
1192
1227
|
kind: "elementProperty",
|
|
1193
1228
|
names: h,
|
|
1194
1229
|
meta: {
|
|
@@ -1196,12 +1231,12 @@ function Ht(t, e) {
|
|
|
1196
1231
|
raw: p
|
|
1197
1232
|
}
|
|
1198
1233
|
});
|
|
1199
|
-
if (
|
|
1234
|
+
if (J(_.key) && l.reference && l.reference.comp) {
|
|
1200
1235
|
const d = a[l.reference.comp];
|
|
1201
1236
|
if (d)
|
|
1202
1237
|
for (const { id: h, name: p, type: m } of d.meta.properties)
|
|
1203
1238
|
c.push({
|
|
1204
|
-
id:
|
|
1239
|
+
id: te("referenceProperty", t, h),
|
|
1205
1240
|
kind: "referenceProperty",
|
|
1206
1241
|
names: [p],
|
|
1207
1242
|
meta: {
|
|
@@ -1209,12 +1244,12 @@ function Ht(t, e) {
|
|
|
1209
1244
|
}
|
|
1210
1245
|
});
|
|
1211
1246
|
}
|
|
1212
|
-
if (
|
|
1247
|
+
if (q(_.key) && l.reference && l.reference.comp) {
|
|
1213
1248
|
const d = a[l.reference.comp];
|
|
1214
1249
|
if (d)
|
|
1215
1250
|
for (const { id: h, name: p, type: m } of d.meta.properties)
|
|
1216
1251
|
c.push({
|
|
1217
|
-
id:
|
|
1252
|
+
id: te("multipleRefProperty", t, h),
|
|
1218
1253
|
kind: "multipleRefProperty",
|
|
1219
1254
|
names: [p],
|
|
1220
1255
|
meta: {
|
|
@@ -1222,10 +1257,10 @@ function Ht(t, e) {
|
|
|
1222
1257
|
}
|
|
1223
1258
|
});
|
|
1224
1259
|
}
|
|
1225
|
-
if (
|
|
1260
|
+
if (V(_.key) && o.type === "comp")
|
|
1226
1261
|
for (const { id: d, name: h, type: p } of i.meta.properties)
|
|
1227
1262
|
c.push({
|
|
1228
|
-
id:
|
|
1263
|
+
id: te("customProperty", t, d),
|
|
1229
1264
|
kind: "customProperty",
|
|
1230
1265
|
names: [h],
|
|
1231
1266
|
meta: {
|
|
@@ -1240,7 +1275,7 @@ function vt(t) {
|
|
|
1240
1275
|
const { properties: e } = g.runtime, { activeObject: n, activeComp: o, depends: i } = g.app, a = Mt(n.type, n.subtype);
|
|
1241
1276
|
if (!a)
|
|
1242
1277
|
return;
|
|
1243
|
-
const { kind: c, nodeId:
|
|
1278
|
+
const { kind: c, nodeId: r, propertyKey: l } = Jo(t), _ = n.nodes.find((h) => h.id === r);
|
|
1244
1279
|
if (!_)
|
|
1245
1280
|
return;
|
|
1246
1281
|
const d = et[_.key];
|
|
@@ -1265,7 +1300,7 @@ function vt(t) {
|
|
|
1265
1300
|
};
|
|
1266
1301
|
}
|
|
1267
1302
|
} else if (c === "referenceProperty") {
|
|
1268
|
-
if (
|
|
1303
|
+
if (J(d.key) && _.reference && _.reference.comp) {
|
|
1269
1304
|
const h = i[_.reference.comp];
|
|
1270
1305
|
if (h) {
|
|
1271
1306
|
const p = h.meta.properties.find(
|
|
@@ -1283,7 +1318,7 @@ function vt(t) {
|
|
|
1283
1318
|
}
|
|
1284
1319
|
}
|
|
1285
1320
|
} else if (c === "multipleRefProperty") {
|
|
1286
|
-
if (
|
|
1321
|
+
if (q(d.key) && _.reference && _.reference.comp) {
|
|
1287
1322
|
const h = i[_.reference.comp];
|
|
1288
1323
|
if (h) {
|
|
1289
1324
|
const p = h.meta.properties.find(
|
|
@@ -1300,7 +1335,7 @@ function vt(t) {
|
|
|
1300
1335
|
};
|
|
1301
1336
|
}
|
|
1302
1337
|
}
|
|
1303
|
-
} else if (c === "customProperty" &&
|
|
1338
|
+
} else if (c === "customProperty" && V(d.key) && n.type === "comp") {
|
|
1304
1339
|
const h = o.meta.properties.find(
|
|
1305
1340
|
(p) => p.id === l
|
|
1306
1341
|
);
|
|
@@ -1316,7 +1351,7 @@ function vt(t) {
|
|
|
1316
1351
|
}
|
|
1317
1352
|
}
|
|
1318
1353
|
function to(t, e) {
|
|
1319
|
-
const n = [], o =
|
|
1354
|
+
const n = [], o = Gt(t, e);
|
|
1320
1355
|
for (const { id: i, kind: a, names: c } of o)
|
|
1321
1356
|
n.push([Fn(a, c), i]);
|
|
1322
1357
|
return k(n);
|
|
@@ -1357,7 +1392,7 @@ const Mi = {
|
|
|
1357
1392
|
initData_: function() {
|
|
1358
1393
|
if (this.node.id)
|
|
1359
1394
|
return;
|
|
1360
|
-
const t =
|
|
1395
|
+
const t = qt("onEvent")?.[0];
|
|
1361
1396
|
if (!t)
|
|
1362
1397
|
return;
|
|
1363
1398
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
@@ -1398,7 +1433,7 @@ const Mi = {
|
|
|
1398
1433
|
}
|
|
1399
1434
|
},
|
|
1400
1435
|
onNodeChange_: function(t) {
|
|
1401
|
-
const e =
|
|
1436
|
+
const e = mt(t);
|
|
1402
1437
|
if (!e) {
|
|
1403
1438
|
console.assert(!1);
|
|
1404
1439
|
return;
|
|
@@ -1441,10 +1476,10 @@ const Mi = {
|
|
|
1441
1476
|
let e = !0;
|
|
1442
1477
|
(this.event.kind === "referenceEvent" || this.event.kind === "customEvent") && (e = !1), this.event.params.forEach(({ key: n, name: o }, i) => {
|
|
1443
1478
|
t.push(["PARAM" + i, `__param$${n}__`, o, e]);
|
|
1444
|
-
}), t.length > 0 &&
|
|
1479
|
+
}), t.length > 0 && F(this, t);
|
|
1445
1480
|
},
|
|
1446
1481
|
checkWarning_: function() {
|
|
1447
|
-
const t =
|
|
1482
|
+
const t = mt(this.node.id);
|
|
1448
1483
|
if (!t) {
|
|
1449
1484
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
1450
1485
|
return;
|
|
@@ -1474,8 +1509,8 @@ E.on_app_event_v1 = Mi;
|
|
|
1474
1509
|
s.forBlock.on_app_event_v1 = function(t) {
|
|
1475
1510
|
const e = s.quote_, n = t, o = n.event.id;
|
|
1476
1511
|
let i = "";
|
|
1477
|
-
n.event.params.forEach((
|
|
1478
|
-
l !== 0 && (i += ", "), i += `__param$${
|
|
1512
|
+
n.event.params.forEach((r, l) => {
|
|
1513
|
+
l !== 0 && (i += ", "), i += `__param$${r.key}__`;
|
|
1479
1514
|
});
|
|
1480
1515
|
const a = s.statementToCode(n, "HANDLE");
|
|
1481
1516
|
return `__onEventV1__(${e(o)}, function(${i}) {
|
|
@@ -1543,14 +1578,14 @@ const Ui = {
|
|
|
1543
1578
|
e.connection.setShadowDom(null);
|
|
1544
1579
|
const n = e.connection.targetBlock();
|
|
1545
1580
|
n && !n.isShadow() && n.dispose();
|
|
1546
|
-
const { type: o } = this.event.params[t], i =
|
|
1581
|
+
const { type: o } = this.event.params[t], i = gt(o);
|
|
1547
1582
|
e.setCheck(i);
|
|
1548
1583
|
}
|
|
1549
1584
|
},
|
|
1550
1585
|
updateShadows_: function() {
|
|
1551
1586
|
if (!this.isInsertionMarker())
|
|
1552
1587
|
for (let t = 0; t < this.event.params.length; t++) {
|
|
1553
|
-
const e = this.event.params[t], n =
|
|
1588
|
+
const e = this.event.params[t], n = At(e.type);
|
|
1554
1589
|
this.getInput("PARAM" + t)?.connection?.setShadowDom(n);
|
|
1555
1590
|
}
|
|
1556
1591
|
},
|
|
@@ -1579,7 +1614,7 @@ s.forBlock.trigger_app_event_v1 = function(t) {
|
|
|
1579
1614
|
const c = s.valueToCode(
|
|
1580
1615
|
n,
|
|
1581
1616
|
"PARAM" + a,
|
|
1582
|
-
|
|
1617
|
+
u.NONE
|
|
1583
1618
|
);
|
|
1584
1619
|
o && (o += ", "), o += c;
|
|
1585
1620
|
}
|
|
@@ -1628,7 +1663,7 @@ T([
|
|
|
1628
1663
|
}
|
|
1629
1664
|
]);
|
|
1630
1665
|
s.forBlock.app_debug_trace_v1 = function(t) {
|
|
1631
|
-
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT",
|
|
1666
|
+
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT", u.NONE)});
|
|
1632
1667
|
`;
|
|
1633
1668
|
};
|
|
1634
1669
|
const Vi = {
|
|
@@ -1644,25 +1679,25 @@ const Vi = {
|
|
|
1644
1679
|
}, 0);
|
|
1645
1680
|
},
|
|
1646
1681
|
updateShape_: function() {
|
|
1647
|
-
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(
|
|
1682
|
+
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(v.Align.RIGHT).appendField("%{BKY_APP_TEXT}"), this.moveInputBefore("TEXT", "RESULT")), this.getInput("TITLE") || (this.appendValueInput("TITLE").setCheck("String").setAlign(v.Align.RIGHT).appendField("%{BKY_APP_TITLE}"), this.moveInputBefore("TITLE", "TEXT"));
|
|
1648
1683
|
},
|
|
1649
1684
|
updateShadow_: function() {
|
|
1650
1685
|
if (this.isInsertionMarker())
|
|
1651
1686
|
return;
|
|
1652
|
-
const t =
|
|
1687
|
+
const t = dt("title");
|
|
1653
1688
|
this.getInput("TITLE").connection.setShadowDom(t);
|
|
1654
|
-
const e =
|
|
1689
|
+
const e = dt("text");
|
|
1655
1690
|
this.getInput("TEXT").connection.setShadowDom(e);
|
|
1656
1691
|
},
|
|
1657
1692
|
ensureBlocks_: function() {
|
|
1658
|
-
this.isInsertionMarker() ||
|
|
1693
|
+
this.isInsertionMarker() || F(this, [
|
|
1659
1694
|
["RESULT", "__result__", "x-runtime-lib.result", !0]
|
|
1660
1695
|
]);
|
|
1661
1696
|
}
|
|
1662
1697
|
};
|
|
1663
1698
|
E.open_confirm_dlg_v1 = Vi;
|
|
1664
1699
|
s.forBlock.open_confirm_dlg_v1 = function(t) {
|
|
1665
|
-
const e = s.valueToCode(t, "TITLE",
|
|
1700
|
+
const e = s.valueToCode(t, "TITLE", u.ATOMIC), n = s.valueToCode(t, "TEXT", u.ATOMIC), o = s.statementToCode(t, "HANDLE");
|
|
1666
1701
|
return `{
|
|
1667
1702
|
var __result__ = __openConfirmDlgV1__(${e}, ${n});
|
|
1668
1703
|
${o}}
|
|
@@ -1681,27 +1716,27 @@ const xi = {
|
|
|
1681
1716
|
}, 0);
|
|
1682
1717
|
},
|
|
1683
1718
|
updateShape_: function() {
|
|
1684
|
-
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(
|
|
1719
|
+
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(v.Align.RIGHT).appendField("%{BKY_APP_VALUE}"), this.moveInputBefore("VALUE", "RESULT")), this.getInput("LABEL") || (this.appendValueInput("LABEL").setCheck("String").setAlign(v.Align.RIGHT).appendField("%{BKY_APP_LABEL}"), this.moveInputBefore("LABEL", "VALUE")), this.getInput("TITLE") || (this.appendValueInput("TITLE").setCheck("String").setAlign(v.Align.RIGHT).appendField("%{BKY_APP_TITLE}"), this.moveInputBefore("TITLE", "LABEL"));
|
|
1685
1720
|
},
|
|
1686
1721
|
updateShadow_: function() {
|
|
1687
1722
|
if (this.isInsertionMarker())
|
|
1688
1723
|
return;
|
|
1689
|
-
const t =
|
|
1724
|
+
const t = dt("title");
|
|
1690
1725
|
this.getInput("TITLE").connection.setShadowDom(t);
|
|
1691
|
-
const e =
|
|
1726
|
+
const e = dt("label");
|
|
1692
1727
|
this.getInput("LABEL").connection.setShadowDom(e);
|
|
1693
|
-
const n =
|
|
1728
|
+
const n = dt("");
|
|
1694
1729
|
this.getInput("VALUE").connection.setShadowDom(n);
|
|
1695
1730
|
},
|
|
1696
1731
|
ensureBlocks_: function() {
|
|
1697
|
-
this.isInsertionMarker() ||
|
|
1732
|
+
this.isInsertionMarker() || F(this, [
|
|
1698
1733
|
["RESULT", "__result__", "x-runtime-lib.result", !0]
|
|
1699
1734
|
]);
|
|
1700
1735
|
}
|
|
1701
1736
|
};
|
|
1702
1737
|
E.open_prompt_dlg_v1 = xi;
|
|
1703
1738
|
s.forBlock.open_prompt_dlg_v1 = function(t) {
|
|
1704
|
-
const e = s.valueToCode(t, "TITLE",
|
|
1739
|
+
const e = s.valueToCode(t, "TITLE", u.ATOMIC), n = s.valueToCode(t, "LABEL", u.ATOMIC), o = s.valueToCode(t, "VALUE", u.ATOMIC), i = s.statementToCode(t, "HANDLE");
|
|
1705
1740
|
return `{
|
|
1706
1741
|
var __result__ = __openPromptDlgV1__(${e}, ${n}, ${o});
|
|
1707
1742
|
${i}}
|
|
@@ -1735,7 +1770,7 @@ T([
|
|
|
1735
1770
|
}
|
|
1736
1771
|
]);
|
|
1737
1772
|
s.forBlock.popup_message_v1 = function(t) {
|
|
1738
|
-
const e = s.quote_(t.getFieldValue("TYPE")), n = s.valueToCode(t, "TEXT",
|
|
1773
|
+
const e = s.quote_(t.getFieldValue("TYPE")), n = s.valueToCode(t, "TEXT", u.ATOMIC);
|
|
1739
1774
|
return `__messageV1__(${e}, ${n});
|
|
1740
1775
|
`;
|
|
1741
1776
|
};
|
|
@@ -1759,7 +1794,7 @@ const Yi = {
|
|
|
1759
1794
|
initData_: function() {
|
|
1760
1795
|
if (this.node.id)
|
|
1761
1796
|
return;
|
|
1762
|
-
const t =
|
|
1797
|
+
const t = qt("callMethod")?.[0];
|
|
1763
1798
|
if (!t)
|
|
1764
1799
|
return;
|
|
1765
1800
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
@@ -1800,7 +1835,7 @@ const Yi = {
|
|
|
1800
1835
|
}
|
|
1801
1836
|
},
|
|
1802
1837
|
onNodeChange_: function(t) {
|
|
1803
|
-
const e =
|
|
1838
|
+
const e = mt(t);
|
|
1804
1839
|
if (!e) {
|
|
1805
1840
|
console.assert(!1);
|
|
1806
1841
|
return;
|
|
@@ -1836,10 +1871,10 @@ const Yi = {
|
|
|
1836
1871
|
this.removeInput("INPUT" + t);
|
|
1837
1872
|
for (let t = 0; t < this.method.inputs.length; t++) {
|
|
1838
1873
|
const e = this.method.inputs[t];
|
|
1839
|
-
this.getInput("INPUT" + t) || (this.appendValueInput("INPUT" + t).setAlign(
|
|
1874
|
+
this.getInput("INPUT" + t) || (this.appendValueInput("INPUT" + t).setAlign(v.Align.RIGHT).appendField(f(e.name)), this.method.outputs.length > 0 && this.moveInputBefore("INPUT" + t, "OUTPUT0"));
|
|
1840
1875
|
}
|
|
1841
1876
|
if (this.method.kind === "multipleRefMethod")
|
|
1842
|
-
this.getInput("REF_KEY") || this.appendValueInput("REF_KEY").setAlign(
|
|
1877
|
+
this.getInput("REF_KEY") || this.appendValueInput("REF_KEY").setAlign(v.Align.RIGHT).appendField(f("BKY_APP_REF_KEY")), this.method.inputs.length > 0 ? this.moveInputBefore("REF_KEY", "INPUT0") : this.method.outputs.length > 0 && this.moveInputBefore("REF_KEY", "OUTPUT0");
|
|
1843
1878
|
else if (this.getInput("REF_KEY")) {
|
|
1844
1879
|
const t = this.getInput("REF_KEY").connection.targetBlock();
|
|
1845
1880
|
t && t.dispose(), this.removeInput("REF_KEY");
|
|
@@ -1851,7 +1886,7 @@ const Yi = {
|
|
|
1851
1886
|
const e = this.method.inputs[t];
|
|
1852
1887
|
if (!e.type)
|
|
1853
1888
|
continue;
|
|
1854
|
-
const n =
|
|
1889
|
+
const n = At(e.type);
|
|
1855
1890
|
this.getInput("INPUT" + t).setShadowDom(n);
|
|
1856
1891
|
}
|
|
1857
1892
|
},
|
|
@@ -1863,10 +1898,10 @@ const Yi = {
|
|
|
1863
1898
|
const { key: i, name: a } = this.method.outputs[o];
|
|
1864
1899
|
n.push(["OUTPUT" + o, `__output$${i}__`, a, e]);
|
|
1865
1900
|
}
|
|
1866
|
-
n.length > 0 &&
|
|
1901
|
+
n.length > 0 && F(this, n);
|
|
1867
1902
|
},
|
|
1868
1903
|
checkWarning_: function() {
|
|
1869
|
-
const t =
|
|
1904
|
+
const t = mt(this.node.id);
|
|
1870
1905
|
if (!t) {
|
|
1871
1906
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
1872
1907
|
return;
|
|
@@ -1900,16 +1935,16 @@ E.call_app_method_v1 = Yi;
|
|
|
1900
1935
|
s.forBlock.call_app_method_v1 = function(t) {
|
|
1901
1936
|
const e = s.INDENT, n = s.quote_, o = t;
|
|
1902
1937
|
let i;
|
|
1903
|
-
o.method.kind === "multipleRefMethod" && (i = s.valueToCode(o, "REF_KEY",
|
|
1938
|
+
o.method.kind === "multipleRefMethod" && (i = s.valueToCode(o, "REF_KEY", u.NONE) || "''");
|
|
1904
1939
|
let a = "{";
|
|
1905
|
-
if (o.method.inputs.forEach(({ key: c, type:
|
|
1940
|
+
if (o.method.inputs.forEach(({ key: c, type: r }, l) => {
|
|
1906
1941
|
let _ = s.valueToCode(
|
|
1907
1942
|
o,
|
|
1908
1943
|
"INPUT" + l,
|
|
1909
|
-
|
|
1944
|
+
u.ATOMIC
|
|
1910
1945
|
);
|
|
1911
1946
|
if (_ === void 0)
|
|
1912
|
-
switch (
|
|
1947
|
+
switch (r) {
|
|
1913
1948
|
case "string":
|
|
1914
1949
|
_ = "''";
|
|
1915
1950
|
break;
|
|
@@ -1935,10 +1970,11 @@ s.forBlock.call_app_method_v1 = function(t) {
|
|
|
1935
1970
|
c += `${e}__output$${_}__ = __outputs__[${n(_)}];
|
|
1936
1971
|
`;
|
|
1937
1972
|
});
|
|
1938
|
-
const
|
|
1973
|
+
const r = s.statementToCode(o, "HANDLE");
|
|
1939
1974
|
return `{
|
|
1940
1975
|
var __outputs__ = __callMethodV1__(${n(o.method.id)}, ${i}, ${a});
|
|
1941
|
-
|
|
1976
|
+
__messageV1__('error', __outputs__);
|
|
1977
|
+
${c}${r}}
|
|
1942
1978
|
`;
|
|
1943
1979
|
} else
|
|
1944
1980
|
return `__callMethodV1__(${n(o.method.id)}, ${i}, ${a});
|
|
@@ -2009,7 +2045,7 @@ const Fi = {
|
|
|
2009
2045
|
const { key: o, name: i } = this.method.inputs[n];
|
|
2010
2046
|
e.push(["INPUT" + n, `__input$${o}__`, i, t]);
|
|
2011
2047
|
}
|
|
2012
|
-
|
|
2048
|
+
F(this, e);
|
|
2013
2049
|
},
|
|
2014
2050
|
checkWarning_: function() {
|
|
2015
2051
|
const t = Dt(this.method.id);
|
|
@@ -2128,13 +2164,13 @@ const wi = {
|
|
|
2128
2164
|
t.connection.setShadowDom(null);
|
|
2129
2165
|
const e = t.connection.targetBlock();
|
|
2130
2166
|
e && !e.isShadow() && e.dispose();
|
|
2131
|
-
const n =
|
|
2167
|
+
const n = gt(this.output.type);
|
|
2132
2168
|
t.setCheck(n);
|
|
2133
2169
|
},
|
|
2134
2170
|
updateShadows_: function() {
|
|
2135
2171
|
if (this.isInsertionMarker())
|
|
2136
2172
|
return;
|
|
2137
|
-
const t =
|
|
2173
|
+
const t = At(this.output.type);
|
|
2138
2174
|
this.getInput("VALUE").connection.setShadowDom(t);
|
|
2139
2175
|
},
|
|
2140
2176
|
checkWarning_: function() {
|
|
@@ -2148,7 +2184,10 @@ const wi = {
|
|
|
2148
2184
|
return;
|
|
2149
2185
|
}
|
|
2150
2186
|
t.names !== this.method.names && (this.method.names = t.names);
|
|
2151
|
-
const e = Ke(
|
|
2187
|
+
const e = Ke(
|
|
2188
|
+
this.method.id,
|
|
2189
|
+
this.output.key
|
|
2190
|
+
);
|
|
2152
2191
|
if (!e) {
|
|
2153
2192
|
this.setWarningText(f("WARN_OUTPUT_NOT_FOUND"));
|
|
2154
2193
|
return;
|
|
@@ -2163,7 +2202,7 @@ const wi = {
|
|
|
2163
2202
|
E.set_app_method_output_v1 = wi;
|
|
2164
2203
|
s.forBlock.set_app_method_output_v1 = function(t) {
|
|
2165
2204
|
const e = s.quote_, n = t;
|
|
2166
|
-
let o = s.valueToCode(n, "VALUE",
|
|
2205
|
+
let o = s.valueToCode(n, "VALUE", u.ATOMIC);
|
|
2167
2206
|
if (o === void 0)
|
|
2168
2207
|
switch (n.output.type) {
|
|
2169
2208
|
case "string":
|
|
@@ -2208,7 +2247,7 @@ T([
|
|
|
2208
2247
|
}
|
|
2209
2248
|
]);
|
|
2210
2249
|
s.forBlock.app_env_is_v1 = function(t) {
|
|
2211
|
-
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`,
|
|
2250
|
+
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`, u.ATOMIC];
|
|
2212
2251
|
};
|
|
2213
2252
|
const Ki = {
|
|
2214
2253
|
init: function() {
|
|
@@ -2248,7 +2287,7 @@ const Ki = {
|
|
|
2248
2287
|
}, 0);
|
|
2249
2288
|
},
|
|
2250
2289
|
genAppOpts_: function() {
|
|
2251
|
-
return
|
|
2290
|
+
return vi();
|
|
2252
2291
|
},
|
|
2253
2292
|
genPageOpts_: function() {
|
|
2254
2293
|
return Ci(this.app.id);
|
|
@@ -2264,7 +2303,7 @@ const Ki = {
|
|
|
2264
2303
|
}
|
|
2265
2304
|
},
|
|
2266
2305
|
onAppChange_: function(t) {
|
|
2267
|
-
const e =
|
|
2306
|
+
const e = vn(t);
|
|
2268
2307
|
if (!e) {
|
|
2269
2308
|
console.assert(!1);
|
|
2270
2309
|
return;
|
|
@@ -2282,7 +2321,7 @@ const Ki = {
|
|
|
2282
2321
|
e ? (this.page.id = e.id, this.page.name = e.name) : (this.page.id = "", this.page.name = "");
|
|
2283
2322
|
},
|
|
2284
2323
|
checkWarning_: function() {
|
|
2285
|
-
const t =
|
|
2324
|
+
const t = vn(this.app.id);
|
|
2286
2325
|
if (!t) {
|
|
2287
2326
|
this.setWarningText(f("WARN_APP_NOT_FOUND"));
|
|
2288
2327
|
return;
|
|
@@ -2365,7 +2404,7 @@ const $i = {
|
|
|
2365
2404
|
E.select_comp_v1 = $i;
|
|
2366
2405
|
s.forBlock.select_comp_v1 = function(t) {
|
|
2367
2406
|
const e = s.quote_, o = t.comp.id ?? "";
|
|
2368
|
-
return [e(o),
|
|
2407
|
+
return [e(o), u.ATOMIC];
|
|
2369
2408
|
};
|
|
2370
2409
|
const Hi = {
|
|
2371
2410
|
init: function() {
|
|
@@ -2385,13 +2424,13 @@ const Hi = {
|
|
|
2385
2424
|
initData_: function() {
|
|
2386
2425
|
if (this.node.id)
|
|
2387
2426
|
return;
|
|
2388
|
-
const t =
|
|
2427
|
+
const t = qt("getProperty")?.[0];
|
|
2389
2428
|
if (!t)
|
|
2390
2429
|
return;
|
|
2391
2430
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
2392
2431
|
const e = this.getField("NODE");
|
|
2393
2432
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
2394
|
-
const n =
|
|
2433
|
+
const n = Gt(this.node.id, "read")?.[0];
|
|
2395
2434
|
if (!n)
|
|
2396
2435
|
return;
|
|
2397
2436
|
this.property.id = n.id, this.property.kind = n.kind, this.property.names = n.names;
|
|
@@ -2426,7 +2465,7 @@ const Hi = {
|
|
|
2426
2465
|
}
|
|
2427
2466
|
},
|
|
2428
2467
|
onNodeChange_: function(t) {
|
|
2429
|
-
const e =
|
|
2468
|
+
const e = mt(t);
|
|
2430
2469
|
if (!e) {
|
|
2431
2470
|
console.assert(!1);
|
|
2432
2471
|
return;
|
|
@@ -2435,7 +2474,7 @@ const Hi = {
|
|
|
2435
2474
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
2436
2475
|
const o = this.getField("PROPERTY");
|
|
2437
2476
|
if (o.getOptions(!1), n || !vt(this.property.id)) {
|
|
2438
|
-
const i =
|
|
2477
|
+
const i = Gt(this.node.id, "read")?.[0];
|
|
2439
2478
|
o.setValue(i?.id ?? "");
|
|
2440
2479
|
}
|
|
2441
2480
|
this.onPropChange_(o.getValue());
|
|
@@ -2445,7 +2484,7 @@ const Hi = {
|
|
|
2445
2484
|
e ? (this.property.id = e.id, this.property.kind = e.kind, this.property.names = e.names) : (this.property.id = "", this.property.kind = "", this.property.names = []);
|
|
2446
2485
|
},
|
|
2447
2486
|
checkWarning_: function() {
|
|
2448
|
-
const t =
|
|
2487
|
+
const t = mt(this.node.id);
|
|
2449
2488
|
if (!t) {
|
|
2450
2489
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
2451
2490
|
return;
|
|
@@ -2470,7 +2509,7 @@ const Hi = {
|
|
|
2470
2509
|
E.get_app_property_v1 = Hi;
|
|
2471
2510
|
s.forBlock.get_app_property_v1 = function(t) {
|
|
2472
2511
|
const e = s.quote_;
|
|
2473
|
-
return [`__getPropertyV1__(${e(t.property.id)}, ${e("")})`,
|
|
2512
|
+
return [`__getPropertyV1__(${e(t.property.id)}, ${e("")})`, u.ATOMIC];
|
|
2474
2513
|
};
|
|
2475
2514
|
const Gi = {
|
|
2476
2515
|
init: function() {
|
|
@@ -2490,13 +2529,13 @@ const Gi = {
|
|
|
2490
2529
|
initData_: function() {
|
|
2491
2530
|
if (this.node.id)
|
|
2492
2531
|
return;
|
|
2493
|
-
const t =
|
|
2532
|
+
const t = qt("setProperty")?.[0];
|
|
2494
2533
|
if (!t)
|
|
2495
2534
|
return;
|
|
2496
2535
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
2497
2536
|
const e = this.getField("NODE");
|
|
2498
2537
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
2499
|
-
const n =
|
|
2538
|
+
const n = Gt(this.node.id, "write")?.[0];
|
|
2500
2539
|
if (!n)
|
|
2501
2540
|
return;
|
|
2502
2541
|
this.property.id = n.id, this.property.kind = n.kind, this.property.names = n.names;
|
|
@@ -2531,7 +2570,7 @@ const Gi = {
|
|
|
2531
2570
|
}
|
|
2532
2571
|
},
|
|
2533
2572
|
onNodeChange_: function(t) {
|
|
2534
|
-
const e =
|
|
2573
|
+
const e = mt(t);
|
|
2535
2574
|
if (!e) {
|
|
2536
2575
|
console.assert(!1);
|
|
2537
2576
|
return;
|
|
@@ -2540,7 +2579,7 @@ const Gi = {
|
|
|
2540
2579
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
2541
2580
|
const o = this.getField("PROPERTY");
|
|
2542
2581
|
if (o.getOptions(!1), n || !vt(this.property.id)) {
|
|
2543
|
-
const i =
|
|
2582
|
+
const i = Gt(this.node.id, "write")?.[0];
|
|
2544
2583
|
o.setValue(i?.id ?? "");
|
|
2545
2584
|
}
|
|
2546
2585
|
this.onPropChange_(o.getValue());
|
|
@@ -2561,12 +2600,12 @@ const Gi = {
|
|
|
2561
2600
|
const n = ci(t.meta.raw), o = hi(t.meta.raw);
|
|
2562
2601
|
this.getInput("VALUE").setCheck(n).setShadowDom(o);
|
|
2563
2602
|
} else {
|
|
2564
|
-
const n =
|
|
2603
|
+
const n = gt(t.meta.raw.type), o = At(t.meta.raw.type);
|
|
2565
2604
|
this.getInput("VALUE").setCheck(n).setShadowDom(o);
|
|
2566
2605
|
}
|
|
2567
2606
|
},
|
|
2568
2607
|
checkWarning_: function() {
|
|
2569
|
-
const t =
|
|
2608
|
+
const t = mt(this.node.id);
|
|
2570
2609
|
if (!t) {
|
|
2571
2610
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
2572
2611
|
return;
|
|
@@ -2590,7 +2629,7 @@ const Gi = {
|
|
|
2590
2629
|
};
|
|
2591
2630
|
E.set_app_property_v1 = Gi;
|
|
2592
2631
|
s.forBlock.set_app_property_v1 = function(t) {
|
|
2593
|
-
const e = s.quote_, n = t, o = "", i = s.valueToCode(n, "VALUE",
|
|
2632
|
+
const e = s.quote_, n = t, o = "", i = s.valueToCode(n, "VALUE", u.NONE);
|
|
2594
2633
|
return `__setPropertyV1__(${e(n.property.id)}, ${e(o)}, ${i});
|
|
2595
2634
|
`;
|
|
2596
2635
|
};
|
|
@@ -2656,7 +2695,7 @@ const Wi = {
|
|
|
2656
2695
|
E.get_app_state_v1 = Wi;
|
|
2657
2696
|
s.forBlock.get_app_state_v1 = function(t) {
|
|
2658
2697
|
const e = s.quote_;
|
|
2659
|
-
return [`__getStateV1__(${e(t.state.id)})`,
|
|
2698
|
+
return [`__getStateV1__(${e(t.state.id)})`, u.ATOMIC];
|
|
2660
2699
|
};
|
|
2661
2700
|
const ji = {
|
|
2662
2701
|
init: function() {
|
|
@@ -2706,7 +2745,7 @@ const ji = {
|
|
|
2706
2745
|
this.getInput("VALUE").setShadowDom(null);
|
|
2707
2746
|
const t = this.getInput("VALUE").connection.targetBlock();
|
|
2708
2747
|
t && t.dispose();
|
|
2709
|
-
const e =
|
|
2748
|
+
const e = gt(this.state.type), n = At(this.state.type);
|
|
2710
2749
|
this.getInput("VALUE").setCheck(e).setShadowDom(n);
|
|
2711
2750
|
},
|
|
2712
2751
|
checkWarning_: function() {
|
|
@@ -2724,7 +2763,7 @@ const ji = {
|
|
|
2724
2763
|
};
|
|
2725
2764
|
E.set_app_state_v1 = ji;
|
|
2726
2765
|
s.forBlock.set_app_state_v1 = function(t) {
|
|
2727
|
-
const e = s.quote_, n = t, o = s.valueToCode(n, "VALUE",
|
|
2766
|
+
const e = s.quote_, n = t, o = s.valueToCode(n, "VALUE", u.NONE);
|
|
2728
2767
|
return `__setStateV1__(${e(n.state.id)}, ${o});
|
|
2729
2768
|
`;
|
|
2730
2769
|
};
|
|
@@ -2759,7 +2798,7 @@ T([
|
|
|
2759
2798
|
}
|
|
2760
2799
|
]);
|
|
2761
2800
|
s.forBlock.color_blend_v1 = function(t) {
|
|
2762
|
-
const e = s.valueToCode(t, "COLOR1",
|
|
2801
|
+
const e = s.valueToCode(t, "COLOR1", u.NONE) || "'#ffffff'", n = s.valueToCode(t, "COLOR2", u.NONE) || "'#000000'", o = s.valueToCode(t, "RATIO", u.NONE) || 0.5;
|
|
2763
2802
|
return [`${s.provideFunction_(
|
|
2764
2803
|
"colorBlend",
|
|
2765
2804
|
`
|
|
@@ -2780,7 +2819,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
|
|
|
2780
2819
|
return '#' + r + g + b;
|
|
2781
2820
|
}
|
|
2782
2821
|
`
|
|
2783
|
-
)}(${e}, ${n}, ${o})`,
|
|
2822
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
2784
2823
|
};
|
|
2785
2824
|
T([
|
|
2786
2825
|
{
|
|
@@ -3361,7 +3400,7 @@ T([
|
|
|
3361
3400
|
}
|
|
3362
3401
|
]);
|
|
3363
3402
|
s.forBlock.color_picker_v1 = function(t) {
|
|
3364
|
-
return [s.quote_(t.getFieldValue("COLOR")),
|
|
3403
|
+
return [s.quote_(t.getFieldValue("COLOR")), u.ATOMIC];
|
|
3365
3404
|
};
|
|
3366
3405
|
T([
|
|
3367
3406
|
{
|
|
@@ -3382,7 +3421,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
|
3382
3421
|
return '#' + ('00000' + num.toString(16)).substr(-6);
|
|
3383
3422
|
}
|
|
3384
3423
|
`
|
|
3385
|
-
)}()`,
|
|
3424
|
+
)}()`, u.FUNCTION_CALL];
|
|
3386
3425
|
};
|
|
3387
3426
|
T([
|
|
3388
3427
|
{
|
|
@@ -3415,7 +3454,7 @@ T([
|
|
|
3415
3454
|
}
|
|
3416
3455
|
]);
|
|
3417
3456
|
s.forBlock.color_rgb_v1 = function(t) {
|
|
3418
|
-
const e = s.valueToCode(t, "RED",
|
|
3457
|
+
const e = s.valueToCode(t, "RED", u.NONE) || 0, n = s.valueToCode(t, "GREEN", u.NONE) || 0, o = s.valueToCode(t, "BLUE", u.NONE) || 0;
|
|
3419
3458
|
return [`${s.provideFunction_(
|
|
3420
3459
|
"colorRgb",
|
|
3421
3460
|
`
|
|
@@ -3429,7 +3468,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
3429
3468
|
return '#' + r + g + b;
|
|
3430
3469
|
}
|
|
3431
3470
|
`
|
|
3432
|
-
)}(${e}, ${n}, ${o})`,
|
|
3471
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
3433
3472
|
};
|
|
3434
3473
|
const Xi = C.xml, Ji = [
|
|
3435
3474
|
{
|
|
@@ -3550,7 +3589,7 @@ const Qi = {
|
|
|
3550
3589
|
},
|
|
3551
3590
|
updateShape_: function() {
|
|
3552
3591
|
if (this.locale) {
|
|
3553
|
-
const { i18n: t } =
|
|
3592
|
+
const { i18n: t } = kt;
|
|
3554
3593
|
this.setFieldValue(t.global.t(this.name), "LABEL");
|
|
3555
3594
|
} else
|
|
3556
3595
|
this.setFieldValue(this.name, "LABEL");
|
|
@@ -3558,7 +3597,7 @@ const Qi = {
|
|
|
3558
3597
|
};
|
|
3559
3598
|
E.parameter_v1 = Qi;
|
|
3560
3599
|
s.forBlock.parameter_v1 = function(t) {
|
|
3561
|
-
return [t.key,
|
|
3600
|
+
return [t.key, u.ATOMIC];
|
|
3562
3601
|
};
|
|
3563
3602
|
const zi = {
|
|
3564
3603
|
init: function() {
|
|
@@ -3569,18 +3608,18 @@ s.forBlock.on_flow_state_event_v1 = function() {
|
|
|
3569
3608
|
return `__onFlowStateEventV1__();
|
|
3570
3609
|
`;
|
|
3571
3610
|
};
|
|
3572
|
-
function
|
|
3611
|
+
function Wt(t) {
|
|
3573
3612
|
const e = g.compute.spaces.find((n) => n.id === t);
|
|
3574
3613
|
return e ? e.funcs : [];
|
|
3575
3614
|
}
|
|
3576
|
-
function
|
|
3615
|
+
function Pt(t, e) {
|
|
3577
3616
|
const n = g.compute.spaces.find((o) => o.id === t);
|
|
3578
3617
|
if (n)
|
|
3579
3618
|
return n.funcs.find((o) => o.id === e);
|
|
3580
3619
|
}
|
|
3581
3620
|
function no(t) {
|
|
3582
3621
|
const e = [];
|
|
3583
|
-
return
|
|
3622
|
+
return Wt(t).forEach(({ id: o, name: i }) => {
|
|
3584
3623
|
e.push([i, o]);
|
|
3585
3624
|
}), k(e);
|
|
3586
3625
|
}
|
|
@@ -3597,7 +3636,7 @@ function Zi() {
|
|
|
3597
3636
|
t.push([o, n]);
|
|
3598
3637
|
}), k(t);
|
|
3599
3638
|
}
|
|
3600
|
-
function
|
|
3639
|
+
function Qt(t) {
|
|
3601
3640
|
const e = [];
|
|
3602
3641
|
return g.compute.spaces.forEach((n) => {
|
|
3603
3642
|
t === "func" && n.funcs.length > 0 && e.push(n), t === "flow" && n.flows.length > 0 && e.push(n);
|
|
@@ -3608,7 +3647,7 @@ function le(t) {
|
|
|
3608
3647
|
}
|
|
3609
3648
|
function oo(t) {
|
|
3610
3649
|
const e = [];
|
|
3611
|
-
return
|
|
3650
|
+
return Qt(t).forEach(({ id: o, name: i }) => {
|
|
3612
3651
|
e.push([i, o]);
|
|
3613
3652
|
}), k(e);
|
|
3614
3653
|
}
|
|
@@ -3630,13 +3669,13 @@ const ts = {
|
|
|
3630
3669
|
initData_: function() {
|
|
3631
3670
|
if (this.space.id)
|
|
3632
3671
|
return;
|
|
3633
|
-
const t =
|
|
3672
|
+
const t = Qt("func")?.[0];
|
|
3634
3673
|
if (!t)
|
|
3635
3674
|
return;
|
|
3636
3675
|
this.space.id = t.id, this.space.name = t.name;
|
|
3637
3676
|
const e = this.getField("SPACE");
|
|
3638
3677
|
e.getOptions(!1), e.setValue(this.space.id);
|
|
3639
|
-
const n =
|
|
3678
|
+
const n = Wt(this.space.id)?.[0];
|
|
3640
3679
|
if (!n)
|
|
3641
3680
|
return;
|
|
3642
3681
|
this.func.id = n.id, this.func.name = n.name, this.func.inputs = n.inputs, this.func.outputs = n.outputs;
|
|
@@ -3677,13 +3716,13 @@ const ts = {
|
|
|
3677
3716
|
return;
|
|
3678
3717
|
}
|
|
3679
3718
|
let n = !1;
|
|
3680
|
-
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !
|
|
3681
|
-
const i =
|
|
3719
|
+
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !Pt(this.space.id, this.func.id)) {
|
|
3720
|
+
const i = Wt(this.space.id)?.[0];
|
|
3682
3721
|
this.setFieldValue(i?.id ?? "", "FUNC");
|
|
3683
3722
|
}
|
|
3684
3723
|
},
|
|
3685
3724
|
onFuncChange_: function(t) {
|
|
3686
|
-
const e =
|
|
3725
|
+
const e = Pt(this.space.id, t);
|
|
3687
3726
|
if (!e) {
|
|
3688
3727
|
console.assert(!1);
|
|
3689
3728
|
return;
|
|
@@ -3710,19 +3749,19 @@ const ts = {
|
|
|
3710
3749
|
}
|
|
3711
3750
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3712
3751
|
const { name: e } = this.func.inputs[t], n = this.getInput("INPUT" + t);
|
|
3713
|
-
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(
|
|
3752
|
+
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(v.Align.RIGHT).appendField(e, "NAME" + t).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + t, "OUTPUT0") : this.moveInputBefore("INPUT" + t, "CALLBACK"));
|
|
3714
3753
|
}
|
|
3715
3754
|
},
|
|
3716
3755
|
updateCheck_: function() {
|
|
3717
3756
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3718
|
-
const { type: e } = this.func.inputs[t], n =
|
|
3757
|
+
const { type: e } = this.func.inputs[t], n = gt(e);
|
|
3719
3758
|
this.getInput("INPUT" + t).connection.setCheck(n);
|
|
3720
3759
|
}
|
|
3721
3760
|
},
|
|
3722
3761
|
updateShadow_: function() {
|
|
3723
3762
|
if (!this.isInsertionMarker())
|
|
3724
3763
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3725
|
-
const e = this.func.inputs[t], n =
|
|
3764
|
+
const e = this.func.inputs[t], n = At(e.type);
|
|
3726
3765
|
this.getInput("INPUT" + t).setShadowDom(n);
|
|
3727
3766
|
}
|
|
3728
3767
|
},
|
|
@@ -3734,7 +3773,7 @@ const ts = {
|
|
|
3734
3773
|
const { id: n, name: o } = this.func.outputs[e];
|
|
3735
3774
|
t.push(["OUTPUT" + e, `__output$${n}__`, o, !1]);
|
|
3736
3775
|
}
|
|
3737
|
-
|
|
3776
|
+
F(this, t);
|
|
3738
3777
|
},
|
|
3739
3778
|
checkWarning_: function() {
|
|
3740
3779
|
const t = le(this.space.id);
|
|
@@ -3743,7 +3782,7 @@ const ts = {
|
|
|
3743
3782
|
return;
|
|
3744
3783
|
}
|
|
3745
3784
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3746
|
-
const e =
|
|
3785
|
+
const e = Pt(this.space.id, this.func.id);
|
|
3747
3786
|
if (!e) {
|
|
3748
3787
|
this.setWarningText(f("WARN_FUNC_NOT_FOUND"));
|
|
3749
3788
|
return;
|
|
@@ -3768,12 +3807,12 @@ s.forBlock.call_func_v1 = function(t) {
|
|
|
3768
3807
|
const m = s.valueToCode(
|
|
3769
3808
|
o,
|
|
3770
3809
|
"INPUT" + p,
|
|
3771
|
-
|
|
3810
|
+
u.ATOMIC
|
|
3772
3811
|
);
|
|
3773
3812
|
c += `${e}${e}${n(h)}: ${m},
|
|
3774
3813
|
`;
|
|
3775
3814
|
}), c += `${e}};`;
|
|
3776
|
-
const
|
|
3815
|
+
const r = n(o.space.name + "/" + o.func.name);
|
|
3777
3816
|
let l = "";
|
|
3778
3817
|
o.func.outputs.forEach(({ id: h }) => {
|
|
3779
3818
|
l += `${e}var __output${h}__ = __result__[${n(h)}];
|
|
@@ -3782,7 +3821,7 @@ s.forBlock.call_func_v1 = function(t) {
|
|
|
3782
3821
|
const _ = s.statementToCode(o, "CALLBACK");
|
|
3783
3822
|
return `{
|
|
3784
3823
|
${c}
|
|
3785
|
-
${e}var __result__ = __callFuncV1__(${i},${a},__inputs__,__getEnvV1__(),${
|
|
3824
|
+
${e}var __result__ = __callFuncV1__(${i},${a},__inputs__,__getEnvV1__(),${r});
|
|
3786
3825
|
${l}${_}}
|
|
3787
3826
|
`;
|
|
3788
3827
|
};
|
|
@@ -3804,13 +3843,13 @@ const es = {
|
|
|
3804
3843
|
initData_: function() {
|
|
3805
3844
|
if (this.space.id)
|
|
3806
3845
|
return;
|
|
3807
|
-
const t =
|
|
3846
|
+
const t = Qt("func")?.[0];
|
|
3808
3847
|
if (!t)
|
|
3809
3848
|
return;
|
|
3810
3849
|
this.space.id = t.id, this.space.name = t.name;
|
|
3811
3850
|
const e = this.getField("SPACE");
|
|
3812
3851
|
e.getOptions(!1), e.setValue(this.space.id);
|
|
3813
|
-
const n =
|
|
3852
|
+
const n = Wt(this.space.id)?.[0];
|
|
3814
3853
|
if (!n)
|
|
3815
3854
|
return;
|
|
3816
3855
|
this.func.id = n.id, this.func.name = n.name, this.func.inputs = n.inputs, this.func.outputs = n.outputs;
|
|
@@ -3851,13 +3890,13 @@ const es = {
|
|
|
3851
3890
|
return;
|
|
3852
3891
|
}
|
|
3853
3892
|
let n = !1;
|
|
3854
|
-
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !
|
|
3855
|
-
const i =
|
|
3893
|
+
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("FUNC").getOptions(!1), n || !Pt(this.space.id, this.func.id)) {
|
|
3894
|
+
const i = Wt(this.space.id)?.[0];
|
|
3856
3895
|
i ? this.setFieldValue(i.id, "FUNC") : this.setFieldValue("", "FUNC");
|
|
3857
3896
|
}
|
|
3858
3897
|
},
|
|
3859
3898
|
onFuncChange_: function(t) {
|
|
3860
|
-
const e =
|
|
3899
|
+
const e = Pt(this.space.id, t);
|
|
3861
3900
|
if (!e) {
|
|
3862
3901
|
console.assert(!1);
|
|
3863
3902
|
return;
|
|
@@ -3884,19 +3923,19 @@ const es = {
|
|
|
3884
3923
|
}
|
|
3885
3924
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3886
3925
|
const { name: e } = this.func.inputs[t], n = this.getInput("INPUT" + t);
|
|
3887
|
-
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(
|
|
3926
|
+
n ? (this.setFieldValue(e, "NAME" + t), n.setCheck(null)) : (this.appendValueInput("INPUT" + t).setAlign(v.Align.RIGHT).appendField(e, "NAME" + t).setCheck(null), this.getInput("OUTPUT0") ? this.moveInputBefore("INPUT" + t, "OUTPUT0") : this.moveInputBefore("INPUT" + t, "CALLBACK"));
|
|
3888
3927
|
}
|
|
3889
3928
|
},
|
|
3890
3929
|
updateCheck_: function() {
|
|
3891
3930
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3892
|
-
const { type: e } = this.func.inputs[t], n =
|
|
3931
|
+
const { type: e } = this.func.inputs[t], n = gt(e);
|
|
3893
3932
|
this.getInput("INPUT" + t).connection.setCheck(n);
|
|
3894
3933
|
}
|
|
3895
3934
|
},
|
|
3896
3935
|
updateShadow_: function() {
|
|
3897
3936
|
if (!this.isInsertionMarker())
|
|
3898
3937
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3899
|
-
const e = this.func.inputs[t], n =
|
|
3938
|
+
const e = this.func.inputs[t], n = At(e.type);
|
|
3900
3939
|
this.getInput("INPUT" + t).setShadowDom(n);
|
|
3901
3940
|
}
|
|
3902
3941
|
},
|
|
@@ -3908,7 +3947,7 @@ const es = {
|
|
|
3908
3947
|
const { id: n, name: o } = this.func.outputs[e];
|
|
3909
3948
|
t.push(["OUTPUT" + e, `__output$${n}__`, o, !1]);
|
|
3910
3949
|
}
|
|
3911
|
-
|
|
3950
|
+
F(this, t);
|
|
3912
3951
|
},
|
|
3913
3952
|
checkWarning_: function() {
|
|
3914
3953
|
const t = le(this.space.id);
|
|
@@ -3917,7 +3956,7 @@ const es = {
|
|
|
3917
3956
|
return;
|
|
3918
3957
|
}
|
|
3919
3958
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3920
|
-
const e =
|
|
3959
|
+
const e = Pt(this.space.id, this.func.id);
|
|
3921
3960
|
if (!e) {
|
|
3922
3961
|
this.setWarningText(f("WARN_FUNC_NOT_FOUND"));
|
|
3923
3962
|
return;
|
|
@@ -3942,12 +3981,12 @@ s.forBlock.call_func_internal_v1 = function(t) {
|
|
|
3942
3981
|
const m = s.valueToCode(
|
|
3943
3982
|
o,
|
|
3944
3983
|
"INPUT" + p,
|
|
3945
|
-
|
|
3984
|
+
u.ATOMIC
|
|
3946
3985
|
);
|
|
3947
3986
|
c += `${e}${e}${n(h)}: ${m},
|
|
3948
3987
|
`;
|
|
3949
3988
|
}), c += `${e}};`;
|
|
3950
|
-
const
|
|
3989
|
+
const r = o.space.name + "/" + o.func.name;
|
|
3951
3990
|
let l = "";
|
|
3952
3991
|
o.func.outputs.forEach(({ id: h }) => {
|
|
3953
3992
|
l += `${e}var __output$${h}__ = __result__.outputs[${n(h)}];
|
|
@@ -3958,7 +3997,7 @@ s.forBlock.call_func_internal_v1 = function(t) {
|
|
|
3958
3997
|
${c}
|
|
3959
3998
|
${e}var __result__ = __callFuncInternalV1__(${i}, ${a}, __inputs__);
|
|
3960
3999
|
${e}if (!__result__.success) {
|
|
3961
|
-
${e}${e}throw 'call func<${
|
|
4000
|
+
${e}${e}throw 'call func<${r}> failed, reason: ' + __result__.message;
|
|
3962
4001
|
${e}}
|
|
3963
4002
|
${l}${_}}
|
|
3964
4003
|
`;
|
|
@@ -4007,7 +4046,7 @@ const ns = {
|
|
|
4007
4046
|
const { id: n, name: o } = this.func.inputs[e];
|
|
4008
4047
|
t.push(["INPUT" + e, `__input$${n}__`, o, !1]);
|
|
4009
4048
|
}
|
|
4010
|
-
|
|
4049
|
+
F(this, t);
|
|
4011
4050
|
},
|
|
4012
4051
|
checkWarning_: function() {
|
|
4013
4052
|
const { id: t, inputs: e } = tn();
|
|
@@ -4081,13 +4120,13 @@ const os = {
|
|
|
4081
4120
|
t.connection.setShadowDom(null);
|
|
4082
4121
|
const e = t.connection.targetBlock();
|
|
4083
4122
|
e && !e.isShadow() && e.dispose();
|
|
4084
|
-
const n =
|
|
4123
|
+
const n = gt(this.output.type);
|
|
4085
4124
|
t.setCheck(n);
|
|
4086
4125
|
},
|
|
4087
4126
|
updateShadows_: function() {
|
|
4088
4127
|
if (this.isInsertionMarker())
|
|
4089
4128
|
return;
|
|
4090
|
-
const t =
|
|
4129
|
+
const t = At(this.output.type);
|
|
4091
4130
|
this.getInput("VALUE").setShadowDom(t);
|
|
4092
4131
|
},
|
|
4093
4132
|
checkWarning_: function() {
|
|
@@ -4106,7 +4145,7 @@ const os = {
|
|
|
4106
4145
|
E.set_func_output_v1 = os;
|
|
4107
4146
|
s.forBlock.set_func_output_v1 = function(t) {
|
|
4108
4147
|
const e = s.quote_, n = t, { id: o, type: i } = n.output;
|
|
4109
|
-
let a = s.valueToCode(n, "VALUE",
|
|
4148
|
+
let a = s.valueToCode(n, "VALUE", u.ATOMIC);
|
|
4110
4149
|
if (a === void 0)
|
|
4111
4150
|
switch (i) {
|
|
4112
4151
|
case "string":
|
|
@@ -4149,7 +4188,7 @@ T([
|
|
|
4149
4188
|
}
|
|
4150
4189
|
]);
|
|
4151
4190
|
s.forBlock.compute_debug_trace_v1 = function(t) {
|
|
4152
|
-
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT",
|
|
4191
|
+
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT", u.ATOMIC)});
|
|
4153
4192
|
`;
|
|
4154
4193
|
};
|
|
4155
4194
|
T([
|
|
@@ -4173,7 +4212,7 @@ T([
|
|
|
4173
4212
|
}
|
|
4174
4213
|
]);
|
|
4175
4214
|
s.forBlock.compute_env_is_v1 = function(t) {
|
|
4176
|
-
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`,
|
|
4215
|
+
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`, u.ATOMIC];
|
|
4177
4216
|
};
|
|
4178
4217
|
function nt() {
|
|
4179
4218
|
const t = [];
|
|
@@ -4181,7 +4220,7 @@ function nt() {
|
|
|
4181
4220
|
e.tables.length > 0 && t.push(e);
|
|
4182
4221
|
}), t;
|
|
4183
4222
|
}
|
|
4184
|
-
function
|
|
4223
|
+
function Tt(t) {
|
|
4185
4224
|
const { spaces: e } = g.data;
|
|
4186
4225
|
return e.find((n) => n.id === t);
|
|
4187
4226
|
}
|
|
@@ -4195,7 +4234,7 @@ function H(t) {
|
|
|
4195
4234
|
const { spaces: e } = g.data, n = e.find((o) => o.id === t);
|
|
4196
4235
|
return n ? n.tables : [];
|
|
4197
4236
|
}
|
|
4198
|
-
function
|
|
4237
|
+
function z(t, e) {
|
|
4199
4238
|
const { spaces: n } = g.data, o = n.find((i) => i.id === t);
|
|
4200
4239
|
if (o)
|
|
4201
4240
|
return o.tables.find((i) => i.id === e);
|
|
@@ -4234,22 +4273,22 @@ function ss(t) {
|
|
|
4234
4273
|
let n, o;
|
|
4235
4274
|
const i = nt()?.[0];
|
|
4236
4275
|
if (i) {
|
|
4237
|
-
const
|
|
4238
|
-
if (
|
|
4276
|
+
const r = H(i.id)?.[0];
|
|
4277
|
+
if (r) {
|
|
4239
4278
|
n = {
|
|
4240
4279
|
space: {
|
|
4241
4280
|
id: i.id,
|
|
4242
4281
|
name: i.name
|
|
4243
4282
|
},
|
|
4244
4283
|
table: {
|
|
4245
|
-
id:
|
|
4246
|
-
name:
|
|
4247
|
-
columns:
|
|
4284
|
+
id: r.id,
|
|
4285
|
+
name: r.name,
|
|
4286
|
+
columns: r.columns
|
|
4248
4287
|
},
|
|
4249
|
-
itemCount:
|
|
4288
|
+
itemCount: r.columns.length
|
|
4250
4289
|
}, o = {};
|
|
4251
|
-
for (let l = 0; l <
|
|
4252
|
-
const _ =
|
|
4290
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
4291
|
+
const _ = r.columns[l];
|
|
4253
4292
|
o["COLUMN" + l] = _.id;
|
|
4254
4293
|
}
|
|
4255
4294
|
}
|
|
@@ -4298,10 +4337,10 @@ const cs = {
|
|
|
4298
4337
|
}, 0);
|
|
4299
4338
|
},
|
|
4300
4339
|
updateShape_: function() {
|
|
4301
|
-
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(
|
|
4340
|
+
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(v.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "SUCCESS"));
|
|
4302
4341
|
},
|
|
4303
4342
|
ensureBlocks_: function() {
|
|
4304
|
-
this.isInsertionMarker() || (ss(this),
|
|
4343
|
+
this.isInsertionMarker() || (ss(this), F(this, [
|
|
4305
4344
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4306
4345
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
4307
4346
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -4310,7 +4349,7 @@ const cs = {
|
|
|
4310
4349
|
};
|
|
4311
4350
|
E.add_data_v1 = cs;
|
|
4312
4351
|
s.forBlock.add_data_v1 = function(t) {
|
|
4313
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4352
|
+
const e = s.INDENT, n = s.valueToCode(t, "TABLE", u.ATOMIC) || "null", o = s.statementToCode(t, "HANDLE");
|
|
4314
4353
|
return `{
|
|
4315
4354
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4316
4355
|
${e}var __table__ = ${n};
|
|
@@ -4406,19 +4445,19 @@ const rs = {
|
|
|
4406
4445
|
}
|
|
4407
4446
|
},
|
|
4408
4447
|
onSpaceChange_: function(t) {
|
|
4409
|
-
const e =
|
|
4448
|
+
const e = Tt(t);
|
|
4410
4449
|
if (!e) {
|
|
4411
4450
|
console.assert(!1);
|
|
4412
4451
|
return;
|
|
4413
4452
|
}
|
|
4414
4453
|
const n = e.id !== this.space.id;
|
|
4415
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
4454
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
4416
4455
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
4417
4456
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
4418
4457
|
}
|
|
4419
4458
|
},
|
|
4420
4459
|
onTableChange_: function(t) {
|
|
4421
|
-
const e =
|
|
4460
|
+
const e = z(this.space.id, t);
|
|
4422
4461
|
if (!e) {
|
|
4423
4462
|
console.assert(!1);
|
|
4424
4463
|
return;
|
|
@@ -4457,13 +4496,13 @@ const rs = {
|
|
|
4457
4496
|
this.getInput("VALUE").connection.setCheck(t);
|
|
4458
4497
|
},
|
|
4459
4498
|
checkWarning_: function() {
|
|
4460
|
-
const t =
|
|
4499
|
+
const t = Tt(this.space.id);
|
|
4461
4500
|
if (!t) {
|
|
4462
4501
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
4463
4502
|
return;
|
|
4464
4503
|
}
|
|
4465
4504
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
4466
|
-
const e =
|
|
4505
|
+
const e = z(this.space.id, this.table.id);
|
|
4467
4506
|
if (!e) {
|
|
4468
4507
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
4469
4508
|
return;
|
|
@@ -4487,7 +4526,7 @@ const rs = {
|
|
|
4487
4526
|
};
|
|
4488
4527
|
E.cond_atomic_v1 = rs;
|
|
4489
4528
|
s.forBlock.cond_atomic_v1 = function(t) {
|
|
4490
|
-
const e = s.quote_, n = t, o = n.column.name, i = s.valueToCode(n, "VALUE",
|
|
4529
|
+
const e = s.quote_, n = t, o = n.column.name, i = s.valueToCode(n, "VALUE", u.ATOMIC) || null, c = {
|
|
4491
4530
|
EQ: "=",
|
|
4492
4531
|
NEQ: "!=",
|
|
4493
4532
|
LT: "<",
|
|
@@ -4495,7 +4534,7 @@ s.forBlock.cond_atomic_v1 = function(t) {
|
|
|
4495
4534
|
GT: ">",
|
|
4496
4535
|
GTE: ">="
|
|
4497
4536
|
}[n.getFieldValue("OP")];
|
|
4498
|
-
return [`{type:'ATOMIC',key:${e(o)},value:${i},operator:${e(c)}}`,
|
|
4537
|
+
return [`{type:'ATOMIC',key:${e(o)},value:${i},operator:${e(c)}}`, u.ATOMIC];
|
|
4499
4538
|
};
|
|
4500
4539
|
const us = {
|
|
4501
4540
|
init: function() {
|
|
@@ -4518,7 +4557,7 @@ const _s = {
|
|
|
4518
4557
|
]),
|
|
4519
4558
|
"TYPE"
|
|
4520
4559
|
), this.setMutator(
|
|
4521
|
-
new
|
|
4560
|
+
new Et.MutatorIcon(
|
|
4522
4561
|
["cond_logic_item_v1"],
|
|
4523
4562
|
this
|
|
4524
4563
|
)
|
|
@@ -4585,13 +4624,13 @@ const _s = {
|
|
|
4585
4624
|
};
|
|
4586
4625
|
E.cond_logic_v1 = _s;
|
|
4587
4626
|
s.forBlock.cond_logic_v1 = function(t) {
|
|
4588
|
-
const e = s.quote_, n = t, o = n.getFieldValue("TYPE"), i = [], a = s.valueToCode(n, "VALUE",
|
|
4627
|
+
const e = s.quote_, n = t, o = n.getFieldValue("TYPE"), i = [], a = s.valueToCode(n, "VALUE", u.ATOMIC) || null;
|
|
4589
4628
|
i.push(a);
|
|
4590
|
-
for (let
|
|
4591
|
-
const l = s.valueToCode(n, "ADD" +
|
|
4629
|
+
for (let r = 0; r < n.itemCount_; r++) {
|
|
4630
|
+
const l = s.valueToCode(n, "ADD" + r, u.ATOMIC) || null;
|
|
4592
4631
|
i.push(l);
|
|
4593
4632
|
}
|
|
4594
|
-
return [`{type:${e(o)},entries:[${i}]}`,
|
|
4633
|
+
return [`{type:${e(o)},entries:[${i}]}`, u.ATOMIC];
|
|
4595
4634
|
};
|
|
4596
4635
|
function ps(t) {
|
|
4597
4636
|
const e = t.getInput("TABLE").connection;
|
|
@@ -4674,10 +4713,10 @@ const fs = {
|
|
|
4674
4713
|
}, 0);
|
|
4675
4714
|
},
|
|
4676
4715
|
updateShape_: function() {
|
|
4677
|
-
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(
|
|
4716
|
+
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(v.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "SUCCESS")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("SelectTable").setAlign(v.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
4678
4717
|
},
|
|
4679
4718
|
ensureBlocks_: function() {
|
|
4680
|
-
this.isInsertionMarker() || (ps(this), ds(this),
|
|
4719
|
+
this.isInsertionMarker() || (ps(this), ds(this), F(this, [
|
|
4681
4720
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4682
4721
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0]
|
|
4683
4722
|
]), hs(this));
|
|
@@ -4685,7 +4724,7 @@ const fs = {
|
|
|
4685
4724
|
};
|
|
4686
4725
|
E.delete_data_v1 = fs;
|
|
4687
4726
|
s.forBlock.delete_data_v1 = function(t) {
|
|
4688
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4727
|
+
const e = s.INDENT, n = s.valueToCode(t, "TABLE", u.ATOMIC) || "null", o = s.valueToCode(t, "CONDITION", u.ATOMIC) || "null", i = s.statementToCode(t, "HANDLE");
|
|
4689
4728
|
return `{
|
|
4690
4729
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4691
4730
|
${e}var __table__ = ${n};
|
|
@@ -4718,7 +4757,7 @@ T([
|
|
|
4718
4757
|
}
|
|
4719
4758
|
]);
|
|
4720
4759
|
s.forBlock.interrupt_transaction_v1 = function(t) {
|
|
4721
|
-
return `throw ${s.valueToCode(t, "VALUE",
|
|
4760
|
+
return `throw ${s.valueToCode(t, "VALUE", u.NONE) || "''"};
|
|
4722
4761
|
`;
|
|
4723
4762
|
};
|
|
4724
4763
|
function ms(t) {
|
|
@@ -4728,22 +4767,22 @@ function ms(t) {
|
|
|
4728
4767
|
let n, o;
|
|
4729
4768
|
const i = nt()?.[0];
|
|
4730
4769
|
if (i) {
|
|
4731
|
-
const
|
|
4732
|
-
if (
|
|
4770
|
+
const r = H(i.id)?.[0];
|
|
4771
|
+
if (r) {
|
|
4733
4772
|
n = {
|
|
4734
4773
|
space: {
|
|
4735
4774
|
id: i.id,
|
|
4736
4775
|
name: i.name
|
|
4737
4776
|
},
|
|
4738
4777
|
table: {
|
|
4739
|
-
id:
|
|
4740
|
-
name:
|
|
4741
|
-
columns:
|
|
4778
|
+
id: r.id,
|
|
4779
|
+
name: r.name,
|
|
4780
|
+
columns: r.columns
|
|
4742
4781
|
},
|
|
4743
|
-
itemCount:
|
|
4782
|
+
itemCount: r.columns.length
|
|
4744
4783
|
}, o = {};
|
|
4745
|
-
for (let l = 0; l <
|
|
4746
|
-
const _ =
|
|
4784
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
4785
|
+
const _ = r.columns[l];
|
|
4747
4786
|
o["COLUMN" + l] = _.id, o["ALIAS" + l] = _.name;
|
|
4748
4787
|
}
|
|
4749
4788
|
}
|
|
@@ -4852,10 +4891,10 @@ const As = {
|
|
|
4852
4891
|
}, 0);
|
|
4853
4892
|
},
|
|
4854
4893
|
updateShape_: function() {
|
|
4855
|
-
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(
|
|
4894
|
+
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(v.Align.RIGHT).appendField("%{BKY_DATA_EXTRA}"), this.moveInputBefore("EXTRA", "SUCCESS")), this.getInput("CONDITION") || (this.appendValueInput("CONDITION").setCheck("Condition").setAlign(v.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "EXTRA")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck(["SelectColumn", "Array"]).setAlign(v.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
4856
4895
|
},
|
|
4857
4896
|
ensureBlocks_: function() {
|
|
4858
|
-
this.isInsertionMarker() || (ms(this), Ts(this), Es(this),
|
|
4897
|
+
this.isInsertionMarker() || (ms(this), Ts(this), Es(this), F(this, [
|
|
4859
4898
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4860
4899
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
4861
4900
|
["MAIN_DATA", "__mainData__", "x-runtime-lib.mainData", !0],
|
|
@@ -4865,7 +4904,7 @@ const As = {
|
|
|
4865
4904
|
};
|
|
4866
4905
|
E.query_data_v1 = As;
|
|
4867
4906
|
s.forBlock.query_data_v1 = function(t) {
|
|
4868
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4907
|
+
const e = s.INDENT, n = s.valueToCode(t, "TABLE", u.ATOMIC) || "null", o = s.valueToCode(t, "CONDITION", u.ATOMIC) || "null", i = s.valueToCode(t, "EXTRA", u.ATOMIC) || "null", a = s.statementToCode(t, "HANDLE");
|
|
4869
4908
|
return `{
|
|
4870
4909
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4871
4910
|
${e}var __table__ = ${n};
|
|
@@ -4906,8 +4945,8 @@ T([
|
|
|
4906
4945
|
}
|
|
4907
4946
|
]);
|
|
4908
4947
|
s.forBlock.query_extra_limit_v1 = function(t) {
|
|
4909
|
-
const e = s.valueToCode(t, "OFFSET",
|
|
4910
|
-
return [`{type:'limit',value:${e},value2:${n}}`,
|
|
4948
|
+
const e = s.valueToCode(t, "OFFSET", u.ATOMIC) || 0, n = s.valueToCode(t, "LIMIT", u.ATOMIC) || 0;
|
|
4949
|
+
return [`{type:'limit',value:${e},value2:${n}}`, u.ATOMIC];
|
|
4911
4950
|
};
|
|
4912
4951
|
T([
|
|
4913
4952
|
{
|
|
@@ -4933,8 +4972,8 @@ T([
|
|
|
4933
4972
|
}
|
|
4934
4973
|
]);
|
|
4935
4974
|
s.forBlock.query_extra_sortby_v1 = function(t) {
|
|
4936
|
-
const e = s.valueToCode(t, "COLUMN",
|
|
4937
|
-
return [`{type:'sortby',value:${e},value2:${n}}`,
|
|
4975
|
+
const e = s.valueToCode(t, "COLUMN", u.ATOMIC) || "''", n = s.valueToCode(t, "DESC", u.ATOMIC) || !1;
|
|
4976
|
+
return [`{type:'sortby',value:${e},value2:${n}}`, u.ATOMIC];
|
|
4938
4977
|
};
|
|
4939
4978
|
const Is = {
|
|
4940
4979
|
init: function() {
|
|
@@ -4948,7 +4987,7 @@ const Os = {
|
|
|
4948
4987
|
}
|
|
4949
4988
|
};
|
|
4950
4989
|
E.select_column_item_v1 = Os;
|
|
4951
|
-
const
|
|
4990
|
+
const ys = {
|
|
4952
4991
|
init: function() {
|
|
4953
4992
|
this.space = {
|
|
4954
4993
|
id: "",
|
|
@@ -4964,7 +5003,7 @@ const vs = {
|
|
|
4964
5003
|
new O(() => this.genTableOpts_()),
|
|
4965
5004
|
"TABLE"
|
|
4966
5005
|
), this.setMutator(
|
|
4967
|
-
new
|
|
5006
|
+
new Et.MutatorIcon(
|
|
4968
5007
|
["select_column_item_v1"],
|
|
4969
5008
|
this
|
|
4970
5009
|
)
|
|
@@ -5033,19 +5072,19 @@ const vs = {
|
|
|
5033
5072
|
}
|
|
5034
5073
|
},
|
|
5035
5074
|
onSpaceChange_: function(t) {
|
|
5036
|
-
const e =
|
|
5075
|
+
const e = Tt(t);
|
|
5037
5076
|
if (!e) {
|
|
5038
5077
|
console.assert(!1);
|
|
5039
5078
|
return;
|
|
5040
5079
|
}
|
|
5041
5080
|
const n = e.id !== this.space.id;
|
|
5042
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
5081
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
5043
5082
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
5044
5083
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
5045
5084
|
}
|
|
5046
5085
|
},
|
|
5047
5086
|
onTableChange_: function(t) {
|
|
5048
|
-
const e =
|
|
5087
|
+
const e = z(this.space.id, t);
|
|
5049
5088
|
if (!e) {
|
|
5050
5089
|
console.assert(!1);
|
|
5051
5090
|
return;
|
|
@@ -5120,8 +5159,8 @@ const vs = {
|
|
|
5120
5159
|
for (let t = 0; t < this.table.columns.length; t++) {
|
|
5121
5160
|
const e = this.table.columns[t], n = new O(
|
|
5122
5161
|
() => this.genColumnOpts_()
|
|
5123
|
-
), o = new
|
|
5124
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
5162
|
+
), o = new ft("");
|
|
5163
|
+
this.appendDummyInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(n, "COLUMN" + t).appendField("%{BKY_DATA_AS}").appendField(o, "ALIAS" + t), n.setValue(e.id, !1), o.setValue(e.name, !1);
|
|
5125
5164
|
}
|
|
5126
5165
|
},
|
|
5127
5166
|
updateShape_: function() {
|
|
@@ -5132,20 +5171,20 @@ const vs = {
|
|
|
5132
5171
|
continue;
|
|
5133
5172
|
const e = new O(
|
|
5134
5173
|
() => this.genColumnOpts_()
|
|
5135
|
-
), n = new
|
|
5136
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
5174
|
+
), n = new ft("");
|
|
5175
|
+
this.appendDummyInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(e, "COLUMN" + t).appendField("%{BKY_DATA_AS}").appendField(n, "ALIAS" + t);
|
|
5137
5176
|
const o = this.table.columns[0];
|
|
5138
5177
|
e.setValue(o.id ?? "", !1), n.setValue(o.name ?? "", !1);
|
|
5139
5178
|
}
|
|
5140
5179
|
},
|
|
5141
5180
|
checkWarning_: function() {
|
|
5142
|
-
const t =
|
|
5181
|
+
const t = Tt(this.space.id);
|
|
5143
5182
|
if (!t) {
|
|
5144
5183
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5145
5184
|
return;
|
|
5146
5185
|
}
|
|
5147
5186
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5148
|
-
const e =
|
|
5187
|
+
const e = z(this.space.id, this.table.id);
|
|
5149
5188
|
if (!e) {
|
|
5150
5189
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5151
5190
|
return;
|
|
@@ -5157,7 +5196,7 @@ const vs = {
|
|
|
5157
5196
|
this.setWarningText(null);
|
|
5158
5197
|
}
|
|
5159
5198
|
};
|
|
5160
|
-
E.select_column_v1 =
|
|
5199
|
+
E.select_column_v1 = ys;
|
|
5161
5200
|
s.forBlock.select_column_v1 = function(t) {
|
|
5162
5201
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id, a = [];
|
|
5163
5202
|
for (let l = 0; l < n.itemCount_; l++) {
|
|
@@ -5167,9 +5206,9 @@ s.forBlock.select_column_v1 = function(t) {
|
|
|
5167
5206
|
let c = "[";
|
|
5168
5207
|
return a.forEach(({ name: l, alias: _ }, d) => {
|
|
5169
5208
|
d !== 0 && (c += ","), c += `{name:${e(l)},alias:${e(_)}}`;
|
|
5170
|
-
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`,
|
|
5209
|
+
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`, u.ATOMIC];
|
|
5171
5210
|
};
|
|
5172
|
-
const
|
|
5211
|
+
const vs = {
|
|
5173
5212
|
init: function() {
|
|
5174
5213
|
this.space = {
|
|
5175
5214
|
id: "",
|
|
@@ -5227,19 +5266,19 @@ const ys = {
|
|
|
5227
5266
|
}
|
|
5228
5267
|
},
|
|
5229
5268
|
onSpaceChange_: function(t) {
|
|
5230
|
-
const e =
|
|
5269
|
+
const e = Tt(t);
|
|
5231
5270
|
if (!e) {
|
|
5232
5271
|
console.assert(!1);
|
|
5233
5272
|
return;
|
|
5234
5273
|
}
|
|
5235
5274
|
let n = !1;
|
|
5236
|
-
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("TABLE").getOptions(!1), n || !
|
|
5275
|
+
if (e.id !== this.space.id && (n = !0), this.space.id = e.id, this.space.name = e.name, this.getField("TABLE").getOptions(!1), n || !z(this.space.id, this.table.id)) {
|
|
5237
5276
|
const i = H(this.space.id)?.[0];
|
|
5238
5277
|
i ? this.setFieldValue(i.id, "TABLE") : this.setFieldValue("", "TABLE");
|
|
5239
5278
|
}
|
|
5240
5279
|
},
|
|
5241
5280
|
onTableChange_: function(t) {
|
|
5242
|
-
const e =
|
|
5281
|
+
const e = z(this.space.id, t);
|
|
5243
5282
|
if (!e) {
|
|
5244
5283
|
console.assert(!1);
|
|
5245
5284
|
return;
|
|
@@ -5247,13 +5286,13 @@ const ys = {
|
|
|
5247
5286
|
this.table.id = e.id, this.table.name = e.name;
|
|
5248
5287
|
},
|
|
5249
5288
|
checkWarning_: function() {
|
|
5250
|
-
const t =
|
|
5289
|
+
const t = Tt(this.space.id);
|
|
5251
5290
|
if (!t) {
|
|
5252
5291
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5253
5292
|
return;
|
|
5254
5293
|
}
|
|
5255
5294
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5256
|
-
const e =
|
|
5295
|
+
const e = z(this.space.id, this.table.id);
|
|
5257
5296
|
if (!e) {
|
|
5258
5297
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5259
5298
|
return;
|
|
@@ -5261,10 +5300,10 @@ const ys = {
|
|
|
5261
5300
|
e.name !== this.table.name && (this.table.name = e.name), this.setWarningText(null);
|
|
5262
5301
|
}
|
|
5263
5302
|
};
|
|
5264
|
-
E.select_table_v1 =
|
|
5303
|
+
E.select_table_v1 = vs;
|
|
5265
5304
|
s.forBlock.select_table_v1 = function(t) {
|
|
5266
5305
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id;
|
|
5267
|
-
return [`{spaceId:${e(o)},tableId:${e(i)}}`,
|
|
5306
|
+
return [`{spaceId:${e(o)},tableId:${e(i)}}`, u.ATOMIC];
|
|
5268
5307
|
};
|
|
5269
5308
|
const Cs = {
|
|
5270
5309
|
init: function() {
|
|
@@ -5282,7 +5321,7 @@ const Cs = {
|
|
|
5282
5321
|
this.getInput("FINALLY") || this.appendStatementInput("FINALLY").appendField("%{BKY_DATA_FINALLY}"), this.getInput("MESSAGE") || (this.appendValueInput("MESSAGE"), this.moveInputBefore("MESSAGE", "FINALLY")), this.getInput("SUCCESS") || (this.appendValueInput("SUCCESS"), this.moveInputBefore("SUCCESS", "MESSAGE")), this.getInput("HANDLE") || (this.appendStatementInput("HANDLE").appendField("%{BKY_DATA_DO}"), this.moveInputBefore("HANDLE", "SUCCESS"));
|
|
5283
5322
|
},
|
|
5284
5323
|
ensureBlocks_: function() {
|
|
5285
|
-
this.isInsertionMarker() ||
|
|
5324
|
+
this.isInsertionMarker() || F(this, [
|
|
5286
5325
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
5287
5326
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0]
|
|
5288
5327
|
]);
|
|
@@ -5360,7 +5399,7 @@ const Ls = {
|
|
|
5360
5399
|
new O(() => this.genTableOpts_()),
|
|
5361
5400
|
"TABLE"
|
|
5362
5401
|
), this.setMutator(
|
|
5363
|
-
new
|
|
5402
|
+
new Et.MutatorIcon(
|
|
5364
5403
|
["update_column_item_v1"],
|
|
5365
5404
|
this
|
|
5366
5405
|
)
|
|
@@ -5429,19 +5468,19 @@ const Ls = {
|
|
|
5429
5468
|
}
|
|
5430
5469
|
},
|
|
5431
5470
|
onSpaceChange_: function(t) {
|
|
5432
|
-
const e =
|
|
5471
|
+
const e = Tt(t);
|
|
5433
5472
|
if (!e) {
|
|
5434
5473
|
console.assert(!1);
|
|
5435
5474
|
return;
|
|
5436
5475
|
}
|
|
5437
5476
|
const n = e.id !== this.space.id;
|
|
5438
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
5477
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
5439
5478
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
5440
5479
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
5441
5480
|
}
|
|
5442
5481
|
},
|
|
5443
5482
|
onTableChange_: function(t) {
|
|
5444
|
-
const e =
|
|
5483
|
+
const e = z(this.space.id, t);
|
|
5445
5484
|
if (!e) {
|
|
5446
5485
|
console.assert(!1);
|
|
5447
5486
|
return;
|
|
@@ -5527,7 +5566,7 @@ const Ls = {
|
|
|
5527
5566
|
const e = this.table.columns[t], n = new O(
|
|
5528
5567
|
() => this.genColumnOpts_()
|
|
5529
5568
|
);
|
|
5530
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5569
|
+
this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(n, "COLUMN" + t), n.setValue(e.id, !1);
|
|
5531
5570
|
}
|
|
5532
5571
|
},
|
|
5533
5572
|
updateShape_: function() {
|
|
@@ -5541,7 +5580,7 @@ const Ls = {
|
|
|
5541
5580
|
const e = new O(
|
|
5542
5581
|
() => this.genColumnOpts_()
|
|
5543
5582
|
);
|
|
5544
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5583
|
+
this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(e, "COLUMN" + t);
|
|
5545
5584
|
}
|
|
5546
5585
|
},
|
|
5547
5586
|
updateBlocks_: function(t) {
|
|
@@ -5556,8 +5595,8 @@ const Ls = {
|
|
|
5556
5595
|
if (!c)
|
|
5557
5596
|
continue;
|
|
5558
5597
|
n.setCheck(null);
|
|
5559
|
-
const
|
|
5560
|
-
|
|
5598
|
+
const r = Je(this.workspace, c.type);
|
|
5599
|
+
r && o.connect(r.outputConnection);
|
|
5561
5600
|
}
|
|
5562
5601
|
},
|
|
5563
5602
|
updateCheck_: function() {
|
|
@@ -5570,13 +5609,13 @@ const Ls = {
|
|
|
5570
5609
|
}
|
|
5571
5610
|
},
|
|
5572
5611
|
checkWarning_: function() {
|
|
5573
|
-
const t =
|
|
5612
|
+
const t = Tt(this.space.id);
|
|
5574
5613
|
if (!t) {
|
|
5575
5614
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5576
5615
|
return;
|
|
5577
5616
|
}
|
|
5578
5617
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5579
|
-
const e =
|
|
5618
|
+
const e = z(this.space.id, this.table.id);
|
|
5580
5619
|
if (!e) {
|
|
5581
5620
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5582
5621
|
return;
|
|
@@ -5592,13 +5631,13 @@ E.update_column_v1 = Ls;
|
|
|
5592
5631
|
s.forBlock.update_column_v1 = function(t) {
|
|
5593
5632
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id, a = [];
|
|
5594
5633
|
for (let l = 0; l < n.itemCount_; l++) {
|
|
5595
|
-
const _ = n.getFieldValue("COLUMN" + l), d = n.table.columns.find((p) => p.id === _).name, h = s.valueToCode(n, "ADD" + l,
|
|
5634
|
+
const _ = n.getFieldValue("COLUMN" + l), d = n.table.columns.find((p) => p.id === _).name, h = s.valueToCode(n, "ADD" + l, u.ATOMIC) || "null";
|
|
5596
5635
|
a.push({ name: d, value: h });
|
|
5597
5636
|
}
|
|
5598
5637
|
let c = "[";
|
|
5599
5638
|
return a.forEach(({ name: l, value: _ }, d) => {
|
|
5600
5639
|
d !== 0 && (c += ","), c += `{name:${e(l)},value:${_}}`;
|
|
5601
|
-
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`,
|
|
5640
|
+
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`, u.ATOMIC];
|
|
5602
5641
|
};
|
|
5603
5642
|
function Ss(t) {
|
|
5604
5643
|
const e = t.getInput("TABLE").connection;
|
|
@@ -5607,22 +5646,22 @@ function Ss(t) {
|
|
|
5607
5646
|
let n, o;
|
|
5608
5647
|
const i = nt()?.[0];
|
|
5609
5648
|
if (i) {
|
|
5610
|
-
const
|
|
5611
|
-
if (
|
|
5649
|
+
const r = H(i.id)?.[0];
|
|
5650
|
+
if (r) {
|
|
5612
5651
|
n = {
|
|
5613
5652
|
space: {
|
|
5614
5653
|
id: i.id,
|
|
5615
5654
|
name: i.name
|
|
5616
5655
|
},
|
|
5617
5656
|
table: {
|
|
5618
|
-
id:
|
|
5619
|
-
name:
|
|
5620
|
-
columns:
|
|
5657
|
+
id: r.id,
|
|
5658
|
+
name: r.name,
|
|
5659
|
+
columns: r.columns
|
|
5621
5660
|
},
|
|
5622
|
-
itemCount:
|
|
5661
|
+
itemCount: r.columns.length
|
|
5623
5662
|
}, o = {};
|
|
5624
|
-
for (let l = 0; l <
|
|
5625
|
-
const _ =
|
|
5663
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
5664
|
+
const _ = r.columns[l];
|
|
5626
5665
|
o["COLUMN" + l] = _.id;
|
|
5627
5666
|
}
|
|
5628
5667
|
}
|
|
@@ -5680,10 +5719,10 @@ const Ps = {
|
|
|
5680
5719
|
}, 0);
|
|
5681
5720
|
},
|
|
5682
5721
|
updateShape_: function() {
|
|
5683
|
-
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(
|
|
5722
|
+
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(v.Align.RIGHT).appendField("%{BKY_DATA_CONDITION}"), this.moveInputBefore("CONDITION", "SUCCESS")), this.getInput("TABLE") || (this.appendValueInput("TABLE").setCheck("UpdateColumn").setAlign(v.Align.RIGHT).appendField("%{BKY_DATA_TABLE}"), this.moveInputBefore("TABLE", "CONDITION"));
|
|
5684
5723
|
},
|
|
5685
5724
|
ensureBlocks: function() {
|
|
5686
|
-
this.isInsertionMarker() || (Ss(this), Bs(this),
|
|
5725
|
+
this.isInsertionMarker() || (Ss(this), Bs(this), F(this, [
|
|
5687
5726
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
5688
5727
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
5689
5728
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -5692,7 +5731,7 @@ const Ps = {
|
|
|
5692
5731
|
};
|
|
5693
5732
|
E.update_data_v1 = Ps;
|
|
5694
5733
|
s.forBlock.update_data_v1 = function(t) {
|
|
5695
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
5734
|
+
const e = s.INDENT, n = s.valueToCode(t, "TABLE", u.ATOMIC) || "null", o = s.valueToCode(t, "CONDITION", u.ATOMIC) || "null", i = s.statementToCode(t, "HANDLE");
|
|
5696
5735
|
return `{
|
|
5697
5736
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
5698
5737
|
${e}var __table__ = ${n};
|
|
@@ -5709,8 +5748,8 @@ ${i}}
|
|
|
5709
5748
|
};
|
|
5710
5749
|
const Rs = C.xml, Ds = {
|
|
5711
5750
|
init: function() {
|
|
5712
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(
|
|
5713
|
-
new ot(
|
|
5751
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(v.Align.CENTRE).appendField(
|
|
5752
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5714
5753
|
this.isInFlyout || this.addEntry_();
|
|
5715
5754
|
})
|
|
5716
5755
|
), this.appendDummyInput("CLOSE_BRACKET").appendField(" ] "), this.setInputsInline(!1), this.setOutput(!0, "JsonArray"), this.setColour(350), this.setTooltip(""), this.setHelpUrl("");
|
|
@@ -5720,7 +5759,7 @@ const Rs = C.xml, Ds = {
|
|
|
5720
5759
|
return t.setAttribute("items", String(this.length)), t;
|
|
5721
5760
|
},
|
|
5722
5761
|
domToMutation: function(t) {
|
|
5723
|
-
this.length =
|
|
5762
|
+
this.length = Ft(t.getAttribute("items") ?? "", 0), this.initShape_();
|
|
5724
5763
|
},
|
|
5725
5764
|
initData: function(t) {
|
|
5726
5765
|
this.length = t, this.initShape_();
|
|
@@ -5729,7 +5768,7 @@ const Rs = C.xml, Ds = {
|
|
|
5729
5768
|
for (let t = 0; t < this.length; t++) {
|
|
5730
5769
|
const e = "ENTRY" + t, n = this.appendValueInput(e);
|
|
5731
5770
|
n.appendField(
|
|
5732
|
-
new ot(
|
|
5771
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5733
5772
|
this.isInFlyout || this.addEntry_(n);
|
|
5734
5773
|
})
|
|
5735
5774
|
), n.appendField(new En(String(t))), n.appendField(
|
|
@@ -5741,14 +5780,14 @@ const Rs = C.xml, Ds = {
|
|
|
5741
5780
|
},
|
|
5742
5781
|
addEntry_: function(t) {
|
|
5743
5782
|
let e = this.length;
|
|
5744
|
-
t && (e =
|
|
5783
|
+
t && (e = Ft(t.name.substring(5)));
|
|
5745
5784
|
for (let o = this.length - 1; o >= e; o--) {
|
|
5746
5785
|
const i = this.getInput("ENTRY" + o);
|
|
5747
5786
|
i.name = "ENTRY" + (o + 1), i.fieldRow[1].setValue(o + 1);
|
|
5748
5787
|
}
|
|
5749
5788
|
const n = this.appendValueInput("ENTRY" + e);
|
|
5750
5789
|
n.appendField(
|
|
5751
|
-
new ot(
|
|
5790
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5752
5791
|
this.isInFlyout || this.addEntry_(n);
|
|
5753
5792
|
})
|
|
5754
5793
|
), n.appendField(new En(String(e))), n.appendField(
|
|
@@ -5760,7 +5799,7 @@ const Rs = C.xml, Ds = {
|
|
|
5760
5799
|
removeEntry_: function(t) {
|
|
5761
5800
|
const e = t.name, n = this.getInputTargetBlock(e);
|
|
5762
5801
|
n && n.dispose(), this.removeInput(e);
|
|
5763
|
-
const o =
|
|
5802
|
+
const o = Ft(e.substring(5));
|
|
5764
5803
|
for (let i = o + 1; i < this.length; i++) {
|
|
5765
5804
|
const a = this.getInput("ENTRY" + i);
|
|
5766
5805
|
a.name = "ENTRY" + (i - 1), a.fieldRow[1].setValue(i - 1);
|
|
@@ -5783,8 +5822,8 @@ const Ms = {
|
|
|
5783
5822
|
E.json_boolean_v1 = Ms;
|
|
5784
5823
|
const Ln = C.xml, Us = {
|
|
5785
5824
|
init: function() {
|
|
5786
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(
|
|
5787
|
-
new ot(
|
|
5825
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(v.Align.CENTRE).appendField(
|
|
5826
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5788
5827
|
this.isInFlyout || this.addEntry_();
|
|
5789
5828
|
})
|
|
5790
5829
|
), this.appendDummyInput("CLOSE_BRACHET").appendField(" } "), this.setInputsInline(!1), this.setOutput(!0, "JsonMap"), this.setColour(120), this.setTooltip(""), this.setHelpUrl("");
|
|
@@ -5812,10 +5851,10 @@ const Ln = C.xml, Us = {
|
|
|
5812
5851
|
for (let e = 0; e < t.length; e++) {
|
|
5813
5852
|
const n = t[e], o = "ENTRY" + e, i = this.appendValueInput(o);
|
|
5814
5853
|
i.appendField(
|
|
5815
|
-
new ot(
|
|
5854
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5816
5855
|
this.isInFlyout || this.addEntry_(i);
|
|
5817
5856
|
})
|
|
5818
|
-
), i.appendField(new
|
|
5857
|
+
), i.appendField(new ft(n), "KEY" + e), i.appendField(
|
|
5819
5858
|
new ot(se, 20, 20, void 0, () => {
|
|
5820
5859
|
this.isInFlyout || this.removeEntry_(i);
|
|
5821
5860
|
})
|
|
@@ -5824,15 +5863,15 @@ const Ln = C.xml, Us = {
|
|
|
5824
5863
|
},
|
|
5825
5864
|
addEntry_: function(t) {
|
|
5826
5865
|
let e = this.length;
|
|
5827
|
-
t && (e =
|
|
5866
|
+
t && (e = Ft(t.name.substring(5)));
|
|
5828
5867
|
for (let o = this.length - 1; o >= e; o--)
|
|
5829
5868
|
this.getField("KEY" + o).name = "KEY" + (o + 1), this.getInput("ENTRY" + o).name = "ENTRY" + (o + 1);
|
|
5830
5869
|
const n = this.appendValueInput("ENTRY" + e);
|
|
5831
5870
|
n.appendField(
|
|
5832
|
-
new ot(
|
|
5871
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5833
5872
|
this.isInFlyout || this.addEntry_(n);
|
|
5834
5873
|
})
|
|
5835
|
-
), n.appendField(new
|
|
5874
|
+
), n.appendField(new ft("key"), "KEY" + e), n.appendField(
|
|
5836
5875
|
new ot(se, 20, 20, void 0, () => {
|
|
5837
5876
|
this.isInFlyout || this.removeEntry_(n);
|
|
5838
5877
|
})
|
|
@@ -5841,7 +5880,7 @@ const Ln = C.xml, Us = {
|
|
|
5841
5880
|
removeEntry_: function(t) {
|
|
5842
5881
|
const e = t.name, n = this.getInputTargetBlock(e);
|
|
5843
5882
|
n && n.dispose(), this.removeInput(e);
|
|
5844
|
-
const o =
|
|
5883
|
+
const o = Ft(e.substring(5));
|
|
5845
5884
|
for (let i = o + 1; i < this.length; i++)
|
|
5846
5885
|
this.getField("KEY" + i).name = "KEY" + (i - 1), this.getInput("ENTRY" + i).name = "ENTRY" + (i - 1);
|
|
5847
5886
|
this.length--;
|
|
@@ -5856,13 +5895,13 @@ const Vs = {
|
|
|
5856
5895
|
E.json_number_v1 = Vs;
|
|
5857
5896
|
const xs = {
|
|
5858
5897
|
init: function() {
|
|
5859
|
-
this.appendDummyInput().setAlign(
|
|
5898
|
+
this.appendDummyInput().setAlign(v.Align.CENTRE).appendField("JSON"), this.appendValueInput("JSON").setCheck(["JsonMap", "JsonArray"]), this.setDeletable(!1), this.setColour(250), this.setTooltip(""), this.setHelpUrl("");
|
|
5860
5899
|
}
|
|
5861
5900
|
};
|
|
5862
5901
|
E.json_root_v1 = xs;
|
|
5863
5902
|
const Ys = {
|
|
5864
5903
|
init: function() {
|
|
5865
|
-
this.appendDummyInput().appendField('"').appendField(new
|
|
5904
|
+
this.appendDummyInput().appendField('"').appendField(new ft(""), "VALUE").appendField('"'), this.setOutput(!0, "JsonString"), this.setColour(160);
|
|
5866
5905
|
}
|
|
5867
5906
|
};
|
|
5868
5907
|
E.json_string_v1 = Ys;
|
|
@@ -5881,7 +5920,7 @@ E.list_create_item_v1 = Ks;
|
|
|
5881
5920
|
const $s = {
|
|
5882
5921
|
init: function() {
|
|
5883
5922
|
this.itemCount_ = 0, this.setMutator(
|
|
5884
|
-
new
|
|
5923
|
+
new Et.MutatorIcon(
|
|
5885
5924
|
["list_create_item_v1"],
|
|
5886
5925
|
this
|
|
5887
5926
|
)
|
|
@@ -5955,7 +5994,7 @@ const $s = {
|
|
|
5955
5994
|
"Boolean",
|
|
5956
5995
|
"Array",
|
|
5957
5996
|
"Object"
|
|
5958
|
-
]), t === 0 && this.getInput("ADD" + t).setAlign(
|
|
5997
|
+
]), t === 0 && this.getInput("ADD" + t).setAlign(v.Align.RIGHT).appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
5959
5998
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
5960
5999
|
this.removeInput("ADD" + t);
|
|
5961
6000
|
}
|
|
@@ -5964,8 +6003,8 @@ E.list_create_v1 = $s;
|
|
|
5964
6003
|
s.forBlock.list_create_v1 = function(t) {
|
|
5965
6004
|
const e = t, n = new Array(e.itemCount_);
|
|
5966
6005
|
for (let i = 0; i < e.itemCount_; i++)
|
|
5967
|
-
n[i] = s.valueToCode(e, "ADD" + i,
|
|
5968
|
-
return ["[" + n.join(", ") + "]",
|
|
6006
|
+
n[i] = s.valueToCode(e, "ADD" + i, u.NONE) || "null";
|
|
6007
|
+
return ["[" + n.join(", ") + "]", u.ATOMIC];
|
|
5969
6008
|
};
|
|
5970
6009
|
T([
|
|
5971
6010
|
{
|
|
@@ -5992,7 +6031,7 @@ T([
|
|
|
5992
6031
|
}
|
|
5993
6032
|
]);
|
|
5994
6033
|
s.forBlock.list_delete_v1 = function(t) {
|
|
5995
|
-
const e = s.valueToCode(t, "VALUE",
|
|
6034
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
5996
6035
|
return `${e}.splice(${n}, 1)`;
|
|
5997
6036
|
};
|
|
5998
6037
|
T([
|
|
@@ -6019,8 +6058,8 @@ T([
|
|
|
6019
6058
|
}
|
|
6020
6059
|
]);
|
|
6021
6060
|
s.forBlock.list_get_v1 = function(t) {
|
|
6022
|
-
const e = s.valueToCode(t, "VALUE",
|
|
6023
|
-
return [`${e}[${n}]`,
|
|
6061
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
6062
|
+
return [`${e}[${n}]`, u.MEMBER];
|
|
6024
6063
|
};
|
|
6025
6064
|
T([
|
|
6026
6065
|
{
|
|
@@ -6051,8 +6090,8 @@ T([
|
|
|
6051
6090
|
}
|
|
6052
6091
|
]);
|
|
6053
6092
|
s.forBlock.list_get_sublist_v1 = function(t) {
|
|
6054
|
-
const e = s.valueToCode(t, "LIST",
|
|
6055
|
-
return [`${e}.slice(${n}, ${o})`,
|
|
6093
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.getAdjusted(t, "START"), o = s.getAdjusted(t, "END", 1);
|
|
6094
|
+
return [`${e}.slice(${n}, ${o})`, u.FUNCTION_CALL];
|
|
6056
6095
|
};
|
|
6057
6096
|
T([
|
|
6058
6097
|
{
|
|
@@ -6072,7 +6111,7 @@ T([
|
|
|
6072
6111
|
}
|
|
6073
6112
|
]);
|
|
6074
6113
|
s.forBlock.list_is_empty_v1 = function(t) {
|
|
6075
|
-
return [`!${s.valueToCode(t, "VALUE",
|
|
6114
|
+
return [`!${s.valueToCode(t, "VALUE", u.MEMBER) || "[]"}.length`, u.LOGICAL_NOT];
|
|
6076
6115
|
};
|
|
6077
6116
|
T([
|
|
6078
6117
|
{
|
|
@@ -6098,8 +6137,8 @@ T([
|
|
|
6098
6137
|
}
|
|
6099
6138
|
]);
|
|
6100
6139
|
s.forBlock.list_join_v1 = function(t) {
|
|
6101
|
-
const e = s.valueToCode(t, "LIST",
|
|
6102
|
-
return [`${e}.join(${n})`,
|
|
6140
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.valueToCode(t, "DELIM", u.NONE) || "''";
|
|
6141
|
+
return [`${e}.join(${n})`, u.FUNCTION_CALL];
|
|
6103
6142
|
};
|
|
6104
6143
|
T([
|
|
6105
6144
|
{
|
|
@@ -6119,7 +6158,7 @@ T([
|
|
|
6119
6158
|
}
|
|
6120
6159
|
]);
|
|
6121
6160
|
s.forBlock.list_length_v1 = function(t) {
|
|
6122
|
-
return [`${s.valueToCode(t, "VALUE",
|
|
6161
|
+
return [`${s.valueToCode(t, "VALUE", u.MEMBER) || "[]"}.length`, u.MEMBER];
|
|
6123
6162
|
};
|
|
6124
6163
|
T([
|
|
6125
6164
|
{
|
|
@@ -6140,7 +6179,7 @@ T([
|
|
|
6140
6179
|
}
|
|
6141
6180
|
]);
|
|
6142
6181
|
s.forBlock.list_reverse_v1 = function(t) {
|
|
6143
|
-
return [`${s.valueToCode(t, "LIST",
|
|
6182
|
+
return [`${s.valueToCode(t, "LIST", u.NONE) || "[]"}.slice().reverse()`, u.FUNCTION_CALL];
|
|
6144
6183
|
};
|
|
6145
6184
|
T([
|
|
6146
6185
|
{
|
|
@@ -6172,7 +6211,7 @@ T([
|
|
|
6172
6211
|
}
|
|
6173
6212
|
]);
|
|
6174
6213
|
s.forBlock.list_set_v1 = function(t) {
|
|
6175
|
-
const e = s.valueToCode(t, "LIST",
|
|
6214
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT"), o = s.valueToCode(t, "VALUE", u.ASSIGNMENT) || "null";
|
|
6176
6215
|
return `${e}[${n}] = ${o};
|
|
6177
6216
|
`;
|
|
6178
6217
|
};
|
|
@@ -6213,7 +6252,7 @@ T([
|
|
|
6213
6252
|
}
|
|
6214
6253
|
]);
|
|
6215
6254
|
s.forBlock.logic_boolean_v1 = function(t) {
|
|
6216
|
-
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false",
|
|
6255
|
+
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false", u.ATOMIC];
|
|
6217
6256
|
};
|
|
6218
6257
|
const Gs = {
|
|
6219
6258
|
onchange: function(t) {
|
|
@@ -6280,8 +6319,8 @@ s.forBlock.logic_compare_v1 = function(t) {
|
|
|
6280
6319
|
GT: ">",
|
|
6281
6320
|
GTE: ">="
|
|
6282
6321
|
}[t.getFieldValue("OP")];
|
|
6283
|
-
let o =
|
|
6284
|
-
(n === "==" || n === "!=") && (o =
|
|
6322
|
+
let o = u.RELATIONAL;
|
|
6323
|
+
(n === "==" || n === "!=") && (o = u.EQUALITY);
|
|
6285
6324
|
const i = s.valueToCode(t, "A", o) || "0", a = s.valueToCode(t, "B", o) || "0";
|
|
6286
6325
|
return [`${i} ${n} ${a}`, o];
|
|
6287
6326
|
};
|
|
@@ -6471,7 +6510,7 @@ s.forBlock.logic_if_v1 = function(t) {
|
|
|
6471
6510
|
t
|
|
6472
6511
|
));
|
|
6473
6512
|
do {
|
|
6474
|
-
const o = s.valueToCode(t, "IF" + e,
|
|
6513
|
+
const o = s.valueToCode(t, "IF" + e, u.NONE) || "false";
|
|
6475
6514
|
let i = s.statementToCode(t, "DO" + e);
|
|
6476
6515
|
s.STATEMENT_SUFFIX && (i = s.prefixLines(
|
|
6477
6516
|
s.injectId(
|
|
@@ -6514,7 +6553,7 @@ T([
|
|
|
6514
6553
|
}
|
|
6515
6554
|
]);
|
|
6516
6555
|
s.forBlock.logic_negate_v1 = function(t) {
|
|
6517
|
-
return [`!${s.valueToCode(t, "BOOL",
|
|
6556
|
+
return [`!${s.valueToCode(t, "BOOL", u.LOGICAL_NOT) || "true"}`, u.LOGICAL_NOT];
|
|
6518
6557
|
};
|
|
6519
6558
|
T([
|
|
6520
6559
|
{
|
|
@@ -6548,7 +6587,7 @@ T([
|
|
|
6548
6587
|
}
|
|
6549
6588
|
]);
|
|
6550
6589
|
s.forBlock.logic_operation_v1 = function(t) {
|
|
6551
|
-
const e = t.getFieldValue("OP") === "AND" ? "&&" : "||", n = e === "&&" ?
|
|
6590
|
+
const e = t.getFieldValue("OP") === "AND" ? "&&" : "||", n = e === "&&" ? u.LOGICAL_AND : u.LOGICAL_OR;
|
|
6552
6591
|
let o = s.valueToCode(t, "A", n), i = s.valueToCode(t, "B", n);
|
|
6553
6592
|
if (!o && !i)
|
|
6554
6593
|
o = "false", i = "false";
|
|
@@ -6607,8 +6646,8 @@ T([
|
|
|
6607
6646
|
}
|
|
6608
6647
|
]);
|
|
6609
6648
|
s.forBlock.logic_ternary_v1 = function(t) {
|
|
6610
|
-
const e = s.valueToCode(t, "IF",
|
|
6611
|
-
return [e + " ? " + n + " : " + o,
|
|
6649
|
+
const e = s.valueToCode(t, "IF", u.CONDITIONAL) || "false", n = s.valueToCode(t, "THEN", u.CONDITIONAL) || "null", o = s.valueToCode(t, "ELSE", u.CONDITIONAL) || "null";
|
|
6650
|
+
return [e + " ? " + n + " : " + o, u.CONDITIONAL];
|
|
6612
6651
|
};
|
|
6613
6652
|
const Xs = {
|
|
6614
6653
|
customContextMenu: function(t) {
|
|
@@ -6774,42 +6813,42 @@ T([
|
|
|
6774
6813
|
s.forBlock.for_v1 = function(t) {
|
|
6775
6814
|
const e = s.INDENT, n = s.getVariableName(
|
|
6776
6815
|
t.getFieldValue("VAR")
|
|
6777
|
-
), o = s.valueToCode(t, "FROM",
|
|
6816
|
+
), o = s.valueToCode(t, "FROM", u.ASSIGNMENT) || "0", i = s.valueToCode(t, "TO", u.ASSIGNMENT) || "0", a = s.valueToCode(t, "BY", u.ASSIGNMENT) || "1", c = s.addLoopTrap(
|
|
6778
6817
|
s.statementToCode(t, "DO"),
|
|
6779
6818
|
t
|
|
6780
6819
|
);
|
|
6781
6820
|
if (C.string.isNumber(o) && C.string.isNumber(i) && C.string.isNumber(a)) {
|
|
6782
|
-
const
|
|
6783
|
-
return Number(o) <= Number(i) ? `for (${n} = ${o}; ${n} <= ${i}; ${n} += ${
|
|
6821
|
+
const r = Math.abs(Number(a));
|
|
6822
|
+
return Number(o) <= Number(i) ? `for (${n} = ${o}; ${n} <= ${i}; ${n} += ${r}) {
|
|
6784
6823
|
${c}}
|
|
6785
|
-
` : `for (${n} = ${o}; ${n} >= ${i}; ${n} -= ${
|
|
6824
|
+
` : `for (${n} = ${o}; ${n} >= ${i}; ${n} -= ${r}) {
|
|
6786
6825
|
${c}}
|
|
6787
6826
|
`;
|
|
6788
6827
|
} else {
|
|
6789
|
-
let
|
|
6828
|
+
let r = "", l = o;
|
|
6790
6829
|
!o.match(/^\w+$/) && !C.string.isNumber(o) && (l = s.nameDB_.getDistinctName(
|
|
6791
6830
|
`${n}_from`,
|
|
6792
6831
|
it.NameType.VARIABLE
|
|
6793
|
-
),
|
|
6832
|
+
), r += `var ${l} = ${o};
|
|
6794
6833
|
`);
|
|
6795
6834
|
let _ = i;
|
|
6796
6835
|
!i.match(/^\w+$/) && !C.string.isNumber(i) && (_ = s.nameDB_.getDistinctName(
|
|
6797
6836
|
`${n}_to`,
|
|
6798
6837
|
it.NameType.VARIABLE
|
|
6799
|
-
),
|
|
6838
|
+
), r += `var ${_} = ${i};
|
|
6800
6839
|
`);
|
|
6801
6840
|
const d = s.nameDB_.getDistinctName(
|
|
6802
6841
|
`${n}_by`,
|
|
6803
6842
|
it.NameType.VARIABLE
|
|
6804
6843
|
);
|
|
6805
|
-
return
|
|
6806
|
-
` :
|
|
6807
|
-
`,
|
|
6844
|
+
return r += `var ${d} = `, C.string.isNumber(a) ? r += `${Math.abs(Number(a))};
|
|
6845
|
+
` : r += `Math.abs(${a});
|
|
6846
|
+
`, r += `if (${l} > ${_}) {
|
|
6808
6847
|
${e}${d} = -${d};
|
|
6809
6848
|
}
|
|
6810
|
-
`,
|
|
6849
|
+
`, r += `for (${n} = ${l}; ${d} >= 0 ? ${n} <= ${_} : ${n} >= ${_}; ${n} += ${d}) {
|
|
6811
6850
|
${c}}
|
|
6812
|
-
`,
|
|
6851
|
+
`, r;
|
|
6813
6852
|
}
|
|
6814
6853
|
};
|
|
6815
6854
|
B.register(
|
|
@@ -6852,7 +6891,7 @@ T([
|
|
|
6852
6891
|
s.forBlock.for_each_v1 = function(t) {
|
|
6853
6892
|
const e = s.INDENT, n = s.getVariableName(
|
|
6854
6893
|
t.getFieldValue("VAR")
|
|
6855
|
-
), o = s.valueToCode(t, "LIST",
|
|
6894
|
+
), o = s.valueToCode(t, "LIST", u.ASSIGNMENT) || "[]", i = s.addLoopTrap(
|
|
6856
6895
|
s.statementToCode(t, "DO"),
|
|
6857
6896
|
t
|
|
6858
6897
|
);
|
|
@@ -6862,12 +6901,12 @@ s.forBlock.for_each_v1 = function(t) {
|
|
|
6862
6901
|
it.NameType.VARIABLE
|
|
6863
6902
|
), a += `var ${c} = ${o};
|
|
6864
6903
|
`);
|
|
6865
|
-
const
|
|
6904
|
+
const r = s.nameDB_.getDistinctName(
|
|
6866
6905
|
`${n}_index`,
|
|
6867
6906
|
it.NameType.VARIABLE
|
|
6868
6907
|
);
|
|
6869
|
-
return a += `for (var ${
|
|
6870
|
-
${e}${n} = ${c}[${
|
|
6908
|
+
return a += `for (var ${r} in ${c}) {
|
|
6909
|
+
${e}${n} = ${c}[${r}];
|
|
6871
6910
|
${i}}
|
|
6872
6911
|
`, a;
|
|
6873
6912
|
};
|
|
@@ -6898,7 +6937,7 @@ T([
|
|
|
6898
6937
|
]);
|
|
6899
6938
|
s.forBlock.repeat_v1 = function(t) {
|
|
6900
6939
|
let e = "";
|
|
6901
|
-
t.getField("TIMES") ? e = String(Number(t.getFieldValue("TIMES"))) : e = s.valueToCode(t, "TIMES",
|
|
6940
|
+
t.getField("TIMES") ? e = String(Number(t.getFieldValue("TIMES"))) : e = s.valueToCode(t, "TIMES", u.ASSIGNMENT) || "0";
|
|
6902
6941
|
const n = s.addLoopTrap(
|
|
6903
6942
|
s.statementToCode(t, "DO"),
|
|
6904
6943
|
t
|
|
@@ -6962,7 +7001,7 @@ s.forBlock.while_until_v1 = function(t) {
|
|
|
6962
7001
|
let n = s.valueToCode(
|
|
6963
7002
|
t,
|
|
6964
7003
|
"CONDITION",
|
|
6965
|
-
e === "UNTIL" ?
|
|
7004
|
+
e === "UNTIL" ? u.LOGICAL_NOT : u.NONE
|
|
6966
7005
|
) || "false";
|
|
6967
7006
|
e === "UNTIL" && (n = "!" + n);
|
|
6968
7007
|
const o = s.addLoopTrap(
|
|
@@ -7045,13 +7084,13 @@ T([
|
|
|
7045
7084
|
]);
|
|
7046
7085
|
s.forBlock.math_arithmetic_v1 = function(t) {
|
|
7047
7086
|
const e = {
|
|
7048
|
-
ADD: [" + ",
|
|
7049
|
-
SUBTRACT: [" - ",
|
|
7050
|
-
MULTIPLY: [" * ",
|
|
7051
|
-
DIVIDE: [" / ",
|
|
7052
|
-
POWER: [null,
|
|
7087
|
+
ADD: [" + ", u.ADDITION],
|
|
7088
|
+
SUBTRACT: [" - ", u.SUBTRACTION],
|
|
7089
|
+
MULTIPLY: [" * ", u.MULTIPLICATION],
|
|
7090
|
+
DIVIDE: [" / ", u.DIVISION],
|
|
7091
|
+
POWER: [null, u.NONE]
|
|
7053
7092
|
}, [n, o] = e[t.getFieldValue("OP")], i = s.valueToCode(t, "A", o) || "0", a = s.valueToCode(t, "B", o) || "0";
|
|
7054
|
-
return n ? [i + n + a, o] : [`Math.pow(${i}, ${a})`,
|
|
7093
|
+
return n ? [i + n + a, o] : [`Math.pow(${i}, ${a})`, u.FUNCTION_CALL];
|
|
7055
7094
|
};
|
|
7056
7095
|
T([
|
|
7057
7096
|
{
|
|
@@ -7079,12 +7118,12 @@ T([
|
|
|
7079
7118
|
]);
|
|
7080
7119
|
s.forBlock.math_constant_v1 = function(t) {
|
|
7081
7120
|
return {
|
|
7082
|
-
PI: ["Math.PI",
|
|
7083
|
-
E: ["Math.E",
|
|
7084
|
-
GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2",
|
|
7085
|
-
SQRT2: ["Math.SQRT2",
|
|
7086
|
-
SQRT1_2: ["Math.SQRT1_2",
|
|
7087
|
-
INFINITY: ["Infinity",
|
|
7121
|
+
PI: ["Math.PI", u.MEMBER],
|
|
7122
|
+
E: ["Math.E", u.MEMBER],
|
|
7123
|
+
GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2", u.DIVISION],
|
|
7124
|
+
SQRT2: ["Math.SQRT2", u.MEMBER],
|
|
7125
|
+
SQRT1_2: ["Math.SQRT1_2", u.MEMBER],
|
|
7126
|
+
INFINITY: ["Infinity", u.ATOMIC]
|
|
7088
7127
|
}[t.getFieldValue("CONSTANT")];
|
|
7089
7128
|
};
|
|
7090
7129
|
T([
|
|
@@ -7116,8 +7155,8 @@ T([
|
|
|
7116
7155
|
}
|
|
7117
7156
|
]);
|
|
7118
7157
|
s.forBlock.math_constrain_v1 = function(t) {
|
|
7119
|
-
const e = s.valueToCode(t, "VALUE",
|
|
7120
|
-
return [`Math.min(Math.max(${e}, ${n}), ${o})`,
|
|
7158
|
+
const e = s.valueToCode(t, "VALUE", u.NONE) || "0", n = s.valueToCode(t, "LOW", u.NONE) || "0", o = s.valueToCode(t, "HIGH", u.NONE) || "Infinity";
|
|
7159
|
+
return [`Math.min(Math.max(${e}, ${n}), ${o})`, u.FUNCTION_CALL];
|
|
7121
7160
|
};
|
|
7122
7161
|
T([
|
|
7123
7162
|
{
|
|
@@ -7143,8 +7182,8 @@ T([
|
|
|
7143
7182
|
}
|
|
7144
7183
|
]);
|
|
7145
7184
|
s.forBlock.math_modulo_v1 = function(t) {
|
|
7146
|
-
const e = s.valueToCode(t, "DIVIDEND",
|
|
7147
|
-
return [e + " % " + n,
|
|
7185
|
+
const e = s.valueToCode(t, "DIVIDEND", u.MODULUS) || "0", n = s.valueToCode(t, "DIVISOR", u.MODULUS) || "0";
|
|
7186
|
+
return [e + " % " + n, u.MODULUS];
|
|
7148
7187
|
};
|
|
7149
7188
|
T([
|
|
7150
7189
|
{
|
|
@@ -7165,7 +7204,7 @@ T([
|
|
|
7165
7204
|
}
|
|
7166
7205
|
]);
|
|
7167
7206
|
s.forBlock.math_number_v1 = function(t) {
|
|
7168
|
-
const e = Number(t.getFieldValue("NUM")), n = e >= 0 ?
|
|
7207
|
+
const e = Number(t.getFieldValue("NUM")), n = e >= 0 ? u.ATOMIC : u.UNARY_NEGATION;
|
|
7169
7208
|
return [String(e), n];
|
|
7170
7209
|
};
|
|
7171
7210
|
T([
|
|
@@ -7200,17 +7239,17 @@ T([
|
|
|
7200
7239
|
]);
|
|
7201
7240
|
s.forBlock.math_number_property_v1 = function(t) {
|
|
7202
7241
|
const e = {
|
|
7203
|
-
EVEN: [" % 2 === 0",
|
|
7204
|
-
ODD: [" % 2 === 1",
|
|
7205
|
-
WHOLE: [" % 1 === 0",
|
|
7206
|
-
POSITIVE: [" > 0",
|
|
7207
|
-
NEGATIVE: [" < 0",
|
|
7208
|
-
DIVISIBLE_BY: [null,
|
|
7209
|
-
PRIME: [null,
|
|
7242
|
+
EVEN: [" % 2 === 0", u.MODULUS, u.EQUALITY],
|
|
7243
|
+
ODD: [" % 2 === 1", u.MODULUS, u.EQUALITY],
|
|
7244
|
+
WHOLE: [" % 1 === 0", u.MODULUS, u.EQUALITY],
|
|
7245
|
+
POSITIVE: [" > 0", u.RELATIONAL, u.RELATIONAL],
|
|
7246
|
+
NEGATIVE: [" < 0", u.RELATIONAL, u.RELATIONAL],
|
|
7247
|
+
DIVISIBLE_BY: [null, u.MODULUS, u.EQUALITY],
|
|
7248
|
+
PRIME: [null, u.NONE, u.FUNCTION_CALL]
|
|
7210
7249
|
}, n = t.getFieldValue("PROPERTY"), [o, i, a] = e[t.getFieldValue("PROPERTY")], c = s.valueToCode(t, "NUMBER_TO_CHECK", i) || "0";
|
|
7211
|
-
let
|
|
7250
|
+
let r;
|
|
7212
7251
|
if (n === "PRIME")
|
|
7213
|
-
|
|
7252
|
+
r = s.provideFunction_(
|
|
7214
7253
|
"mathIsPrime",
|
|
7215
7254
|
`
|
|
7216
7255
|
function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
@@ -7234,11 +7273,11 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
|
7234
7273
|
`
|
|
7235
7274
|
) + "(" + c + ")";
|
|
7236
7275
|
else if (n === "DIVISIBLE_BY") {
|
|
7237
|
-
const l = s.valueToCode(t, "DIVISOR",
|
|
7238
|
-
|
|
7276
|
+
const l = s.valueToCode(t, "DIVISOR", u.MODULUS) || "0";
|
|
7277
|
+
r = c + " % " + l + " === 0";
|
|
7239
7278
|
} else
|
|
7240
|
-
|
|
7241
|
-
return [
|
|
7279
|
+
r = c + o;
|
|
7280
|
+
return [r, a];
|
|
7242
7281
|
};
|
|
7243
7282
|
T([
|
|
7244
7283
|
{
|
|
@@ -7276,13 +7315,13 @@ s.forBlock.math_on_list_v1 = function(t) {
|
|
|
7276
7315
|
let n, o;
|
|
7277
7316
|
switch (e) {
|
|
7278
7317
|
case "SUM":
|
|
7279
|
-
n = s.valueToCode(t, "LIST",
|
|
7318
|
+
n = s.valueToCode(t, "LIST", u.MEMBER) || "[]", o = n + ".reduce(function(x, y) {return x + y;}, 0)";
|
|
7280
7319
|
break;
|
|
7281
7320
|
case "MIN":
|
|
7282
|
-
n = s.valueToCode(t, "LIST",
|
|
7321
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = "Math.min.apply(null, " + n + ")";
|
|
7283
7322
|
break;
|
|
7284
7323
|
case "MAX":
|
|
7285
|
-
n = s.valueToCode(t, "LIST",
|
|
7324
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = "Math.max.apply(null, " + n + ")";
|
|
7286
7325
|
break;
|
|
7287
7326
|
case "AVERAGE": {
|
|
7288
7327
|
const i = s.provideFunction_(
|
|
@@ -7293,7 +7332,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
7293
7332
|
}
|
|
7294
7333
|
`
|
|
7295
7334
|
);
|
|
7296
|
-
n = s.valueToCode(t, "LIST",
|
|
7335
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7297
7336
|
break;
|
|
7298
7337
|
}
|
|
7299
7338
|
case "MEDIAN": {
|
|
@@ -7312,7 +7351,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
7312
7351
|
}
|
|
7313
7352
|
`
|
|
7314
7353
|
);
|
|
7315
|
-
n = s.valueToCode(t, "LIST",
|
|
7354
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7316
7355
|
break;
|
|
7317
7356
|
}
|
|
7318
7357
|
case "MODE": {
|
|
@@ -7349,7 +7388,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(values) {
|
|
|
7349
7388
|
}
|
|
7350
7389
|
`
|
|
7351
7390
|
);
|
|
7352
|
-
n = s.valueToCode(t, "LIST",
|
|
7391
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7353
7392
|
break;
|
|
7354
7393
|
}
|
|
7355
7394
|
case "STD_DEV": {
|
|
@@ -7369,7 +7408,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
|
|
|
7369
7408
|
}
|
|
7370
7409
|
`
|
|
7371
7410
|
);
|
|
7372
|
-
n = s.valueToCode(t, "LIST",
|
|
7411
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7373
7412
|
break;
|
|
7374
7413
|
}
|
|
7375
7414
|
case "RANDOM": {
|
|
@@ -7382,13 +7421,13 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
|
|
7382
7421
|
}
|
|
7383
7422
|
`
|
|
7384
7423
|
);
|
|
7385
|
-
n = s.valueToCode(t, "LIST",
|
|
7424
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7386
7425
|
break;
|
|
7387
7426
|
}
|
|
7388
7427
|
default:
|
|
7389
7428
|
throw Error("Unknown operator: " + e);
|
|
7390
7429
|
}
|
|
7391
|
-
return [o,
|
|
7430
|
+
return [o, u.FUNCTION_CALL];
|
|
7392
7431
|
};
|
|
7393
7432
|
T([
|
|
7394
7433
|
{
|
|
@@ -7401,7 +7440,7 @@ T([
|
|
|
7401
7440
|
}
|
|
7402
7441
|
]);
|
|
7403
7442
|
s.forBlock.math_random_float_v1 = function() {
|
|
7404
|
-
return ["Math.random()",
|
|
7443
|
+
return ["Math.random()", u.FUNCTION_CALL];
|
|
7405
7444
|
};
|
|
7406
7445
|
T([
|
|
7407
7446
|
{
|
|
@@ -7427,7 +7466,7 @@ T([
|
|
|
7427
7466
|
}
|
|
7428
7467
|
]);
|
|
7429
7468
|
s.forBlock.math_random_int_v1 = function(t) {
|
|
7430
|
-
const e = s.valueToCode(t, "FROM",
|
|
7469
|
+
const e = s.valueToCode(t, "FROM", u.NONE) || "0", n = s.valueToCode(t, "TO", u.NONE) || "0";
|
|
7431
7470
|
return [s.provideFunction_(
|
|
7432
7471
|
"mathRandomInt",
|
|
7433
7472
|
`
|
|
@@ -7441,7 +7480,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
|
|
7441
7480
|
return Math.floor(Math.random() * (b - a + 1) + a);
|
|
7442
7481
|
}
|
|
7443
7482
|
`
|
|
7444
|
-
) + "(" + e + ", " + n + ")",
|
|
7483
|
+
) + "(" + e + ", " + n + ")", u.FUNCTION_CALL];
|
|
7445
7484
|
};
|
|
7446
7485
|
T([
|
|
7447
7486
|
{
|
|
@@ -7470,7 +7509,7 @@ T([
|
|
|
7470
7509
|
}
|
|
7471
7510
|
]);
|
|
7472
7511
|
s.forBlock.math_round_v1 = function(t) {
|
|
7473
|
-
const e = t.getFieldValue("OP"), n = s.valueToCode(t, "NUM",
|
|
7512
|
+
const e = t.getFieldValue("OP"), n = s.valueToCode(t, "NUM", u.NONE) || "0";
|
|
7474
7513
|
let o = "";
|
|
7475
7514
|
switch (e) {
|
|
7476
7515
|
case "ROUND":
|
|
@@ -7483,7 +7522,7 @@ s.forBlock.math_round_v1 = function(t) {
|
|
|
7483
7522
|
o = `Math.floor(${n})`;
|
|
7484
7523
|
break;
|
|
7485
7524
|
}
|
|
7486
|
-
return [o,
|
|
7525
|
+
return [o, u.FUNCTION_CALL];
|
|
7487
7526
|
};
|
|
7488
7527
|
T([
|
|
7489
7528
|
{
|
|
@@ -7519,8 +7558,8 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7519
7558
|
const e = t.getFieldValue("OP");
|
|
7520
7559
|
let n, o;
|
|
7521
7560
|
if (e === "NEG")
|
|
7522
|
-
return o = s.valueToCode(t, "NUM",
|
|
7523
|
-
switch (o = s.valueToCode(t, "NUM",
|
|
7561
|
+
return o = s.valueToCode(t, "NUM", u.UNARY_NEGATION) || "0", o[0] === "-" && (o = " " + o), n = "-" + o, [n, u.UNARY_NEGATION];
|
|
7562
|
+
switch (o = s.valueToCode(t, "NUM", u.NONE) || "0", e) {
|
|
7524
7563
|
case "ROOT":
|
|
7525
7564
|
n = `Math.sqrt(${o})`;
|
|
7526
7565
|
break;
|
|
@@ -7538,7 +7577,7 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7538
7577
|
break;
|
|
7539
7578
|
}
|
|
7540
7579
|
if (n)
|
|
7541
|
-
return [n,
|
|
7580
|
+
return [n, u.FUNCTION_CALL];
|
|
7542
7581
|
switch (e) {
|
|
7543
7582
|
case "LOG10":
|
|
7544
7583
|
n = `Math.log(${o}) / Math.log(10)`;
|
|
@@ -7546,7 +7585,7 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7546
7585
|
default:
|
|
7547
7586
|
throw Error("Unknown math operator: " + e);
|
|
7548
7587
|
}
|
|
7549
|
-
return [n,
|
|
7588
|
+
return [n, u.DIVISION];
|
|
7550
7589
|
};
|
|
7551
7590
|
T([
|
|
7552
7591
|
{
|
|
@@ -7580,7 +7619,7 @@ T([
|
|
|
7580
7619
|
s.forBlock.math_trig_v1 = function(t) {
|
|
7581
7620
|
let e;
|
|
7582
7621
|
const n = t.getFieldValue("OP");
|
|
7583
|
-
n === "SIN" || n === "COS" || n === "TAN" ? e = s.valueToCode(t, "NUM",
|
|
7622
|
+
n === "SIN" || n === "COS" || n === "TAN" ? e = s.valueToCode(t, "NUM", u.DIVISION) || "0" : e = s.valueToCode(t, "NUM", u.NONE) || "0";
|
|
7584
7623
|
let o;
|
|
7585
7624
|
switch (n) {
|
|
7586
7625
|
case "SIN":
|
|
@@ -7594,7 +7633,7 @@ s.forBlock.math_trig_v1 = function(t) {
|
|
|
7594
7633
|
break;
|
|
7595
7634
|
}
|
|
7596
7635
|
if (o)
|
|
7597
|
-
return [o,
|
|
7636
|
+
return [o, u.FUNCTION_CALL];
|
|
7598
7637
|
switch (n) {
|
|
7599
7638
|
case "ASIN":
|
|
7600
7639
|
o = `Math.asin(${e}) / Math.PI * 180`;
|
|
@@ -7608,7 +7647,7 @@ s.forBlock.math_trig_v1 = function(t) {
|
|
|
7608
7647
|
default:
|
|
7609
7648
|
throw Error("Unknown math operator: " + n);
|
|
7610
7649
|
}
|
|
7611
|
-
return [o,
|
|
7650
|
+
return [o, u.DIVISION];
|
|
7612
7651
|
};
|
|
7613
7652
|
const zs = C.xml, Zs = {
|
|
7614
7653
|
init: function() {
|
|
@@ -7627,7 +7666,7 @@ E.object_create_item_v1 = ta;
|
|
|
7627
7666
|
const ea = {
|
|
7628
7667
|
init: function() {
|
|
7629
7668
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
7630
|
-
new
|
|
7669
|
+
new Et.MutatorIcon(
|
|
7631
7670
|
["object_create_item_v1"],
|
|
7632
7671
|
this
|
|
7633
7672
|
)
|
|
@@ -7693,7 +7732,7 @@ const ea = {
|
|
|
7693
7732
|
},
|
|
7694
7733
|
updateShape_: function() {
|
|
7695
7734
|
for (let t = 0; t < this.itemCount_; t++)
|
|
7696
|
-
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(
|
|
7735
|
+
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(new ft("key"), "KEY" + t);
|
|
7697
7736
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
7698
7737
|
this.removeInput("ADD" + t);
|
|
7699
7738
|
}
|
|
@@ -7703,10 +7742,10 @@ s.forBlock.object_create_v1 = function(t) {
|
|
|
7703
7742
|
const e = t;
|
|
7704
7743
|
let n = "{";
|
|
7705
7744
|
for (let o = 0; o < e.itemCount_; o++) {
|
|
7706
|
-
const i = e.getFieldValue("KEY" + o), a = s.valueToCode(e, "ADD" + o,
|
|
7745
|
+
const i = e.getFieldValue("KEY" + o), a = s.valueToCode(e, "ADD" + o, u.ATOMIC) || null;
|
|
7707
7746
|
n += s.quote_(i) + ": " + a, o < e.itemCount_ - 1 && (n += ", ");
|
|
7708
7747
|
}
|
|
7709
|
-
return n += "}", [n,
|
|
7748
|
+
return n += "}", [n, u.ATOMIC];
|
|
7710
7749
|
};
|
|
7711
7750
|
T([
|
|
7712
7751
|
{
|
|
@@ -7771,7 +7810,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
7771
7810
|
}
|
|
7772
7811
|
}
|
|
7773
7812
|
`
|
|
7774
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7813
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''";
|
|
7775
7814
|
return `${e}(${n}, ${o});
|
|
7776
7815
|
`;
|
|
7777
7816
|
};
|
|
@@ -7794,7 +7833,7 @@ T([
|
|
|
7794
7833
|
}
|
|
7795
7834
|
]);
|
|
7796
7835
|
s.forBlock.object_from_json_v1 = function(t) {
|
|
7797
|
-
return [`__parseJsonV1__(${s.valueToCode(t, "JSON",
|
|
7836
|
+
return [`__parseJsonV1__(${s.valueToCode(t, "JSON", u.NONE) || "''"})`, u.FUNCTION_CALL];
|
|
7798
7837
|
};
|
|
7799
7838
|
T([
|
|
7800
7839
|
{
|
|
@@ -7850,8 +7889,8 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
7850
7889
|
}
|
|
7851
7890
|
}
|
|
7852
7891
|
`
|
|
7853
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7854
|
-
return [`${e}(${n}, ${o})`,
|
|
7892
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''";
|
|
7893
|
+
return [`${e}(${n}, ${o})`, u.FUNCTION_CALL];
|
|
7855
7894
|
};
|
|
7856
7895
|
T([
|
|
7857
7896
|
{
|
|
@@ -7915,7 +7954,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key, val) {
|
|
|
7915
7954
|
}
|
|
7916
7955
|
}
|
|
7917
7956
|
`
|
|
7918
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7957
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''", i = s.valueToCode(t, "TO", u.ATOMIC) || "null";
|
|
7919
7958
|
return `${e}(${n}, ${o}, ${i});
|
|
7920
7959
|
`;
|
|
7921
7960
|
};
|
|
@@ -7938,7 +7977,7 @@ T([
|
|
|
7938
7977
|
}
|
|
7939
7978
|
]);
|
|
7940
7979
|
s.forBlock.object_to_json_v1 = function(t) {
|
|
7941
|
-
return [`__jsonStringifyV1__(${s.valueToCode(t, "OBJECT",
|
|
7980
|
+
return [`__jsonStringifyV1__(${s.valueToCode(t, "OBJECT", u.NONE) || "null"})`, u.FUNCTION_CALL];
|
|
7942
7981
|
};
|
|
7943
7982
|
const Sn = C.xml, na = {
|
|
7944
7983
|
init: function() {
|
|
@@ -7948,7 +7987,7 @@ const Sn = C.xml, na = {
|
|
|
7948
7987
|
E.procedure_def_container_v1 = na;
|
|
7949
7988
|
const oa = {
|
|
7950
7989
|
init: function() {
|
|
7951
|
-
const t = new
|
|
7990
|
+
const t = new ft(We.DEFAULT_ARG);
|
|
7952
7991
|
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;
|
|
7953
7992
|
},
|
|
7954
7993
|
validator_: function(t) {
|
|
@@ -7972,11 +8011,11 @@ E.procedure_def_item_v1 = oa;
|
|
|
7972
8011
|
const ia = {
|
|
7973
8012
|
init: function() {
|
|
7974
8013
|
this.withReturn = !1, this.args = [];
|
|
7975
|
-
const t = new
|
|
8014
|
+
const t = new ft(
|
|
7976
8015
|
We.findLegalName("", this)
|
|
7977
8016
|
);
|
|
7978
8017
|
t.setValidator(We.rename), t.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(t, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
|
|
7979
|
-
new
|
|
8018
|
+
new Et.MutatorIcon(
|
|
7980
8019
|
["procedure_def_item_v1"],
|
|
7981
8020
|
this
|
|
7982
8021
|
)
|
|
@@ -8133,7 +8172,7 @@ const sa = C.xml, aa = {
|
|
|
8133
8172
|
E.procedure_return_v1 = aa;
|
|
8134
8173
|
s.forBlock.procedure_return_v1 = function(t) {
|
|
8135
8174
|
const e = t;
|
|
8136
|
-
return e.withReturn ? `return ${s.valueToCode(e, "VALUE",
|
|
8175
|
+
return e.withReturn ? `return ${s.valueToCode(e, "VALUE", u.NONE) || "null"};
|
|
8137
8176
|
` : `return;
|
|
8138
8177
|
`;
|
|
8139
8178
|
};
|
|
@@ -8150,10 +8189,10 @@ const ca = {
|
|
|
8150
8189
|
}, 0);
|
|
8151
8190
|
},
|
|
8152
8191
|
updateShape_: function() {
|
|
8153
|
-
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(
|
|
8192
|
+
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(v.Align.RIGHT).appendField("%{BKY_ASSET_ASSET}"), this.moveInputBefore("ASSET", "SUCCESS"));
|
|
8154
8193
|
},
|
|
8155
8194
|
ensureBlocks_: function() {
|
|
8156
|
-
this.isInsertionMarker() ||
|
|
8195
|
+
this.isInsertionMarker() || F(this, [
|
|
8157
8196
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
8158
8197
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
8159
8198
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -8162,7 +8201,7 @@ const ca = {
|
|
|
8162
8201
|
};
|
|
8163
8202
|
E.download_resource_v1 = ca;
|
|
8164
8203
|
s.forBlock.download_resource_v1 = function(t) {
|
|
8165
|
-
const e = s.valueToCode(t, "ASSET",
|
|
8204
|
+
const e = s.valueToCode(t, "ASSET", u.ATOMIC) || null, n = s.statementToCode(t, "HANDLE");
|
|
8166
8205
|
return `{
|
|
8167
8206
|
var res = __downloadResourceV1__(${e});
|
|
8168
8207
|
var __success__ = res.success;
|
|
@@ -8182,8 +8221,8 @@ function io(t) {
|
|
|
8182
8221
|
n.push({
|
|
8183
8222
|
id: i.id,
|
|
8184
8223
|
name: c
|
|
8185
|
-
}), i.children.forEach((
|
|
8186
|
-
o(
|
|
8224
|
+
}), i.children.forEach((r) => {
|
|
8225
|
+
o(r, c);
|
|
8187
8226
|
});
|
|
8188
8227
|
}
|
|
8189
8228
|
return o(e.dirTree, ""), n;
|
|
@@ -8301,16 +8340,16 @@ const pa = {
|
|
|
8301
8340
|
}, 0);
|
|
8302
8341
|
},
|
|
8303
8342
|
updateShape_: function() {
|
|
8304
|
-
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(
|
|
8343
|
+
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(v.Align.RIGHT).appendField("%{BKY_RESOURCE_DATA}"), this.moveInputBefore("DATA", "SUCCESS")), this.getInput("DIR") || (this.appendValueInput("DIR").setCheck("SelectDir").setAlign(v.Align.RIGHT).appendField("%{BKY_RESOURCE_DIR}"), this.moveInputBefore("DIR", "DATA")), this.getInput("NAME") || (this.appendValueInput("NAME").setCheck("String").setAlign(v.Align.RIGHT).appendField("%{BKY_RESOURCE_NAME}"), this.moveInputBefore("NAME", "DIR"));
|
|
8305
8344
|
},
|
|
8306
8345
|
updateShadow_: function() {
|
|
8307
8346
|
if (this.isInsertionMarker())
|
|
8308
8347
|
return;
|
|
8309
|
-
const t =
|
|
8348
|
+
const t = dt("");
|
|
8310
8349
|
this.getInput("NAME")?.setShadowDom(t);
|
|
8311
8350
|
},
|
|
8312
8351
|
ensureBlocks_: function() {
|
|
8313
|
-
this.isInsertionMarker() ||
|
|
8352
|
+
this.isInsertionMarker() || F(this, [
|
|
8314
8353
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
8315
8354
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
8316
8355
|
["RESULT", "__result__", "x-runtime-lib.result", !0]
|
|
@@ -8319,7 +8358,7 @@ const pa = {
|
|
|
8319
8358
|
};
|
|
8320
8359
|
E.upload_resource_v1 = pa;
|
|
8321
8360
|
s.forBlock.upload_resource_v1 = function(t) {
|
|
8322
|
-
const e = s.valueToCode(t, "NAME",
|
|
8361
|
+
const e = s.valueToCode(t, "NAME", u.ATOMIC) || "''", n = s.valueToCode(t, "DIR", u.ATOMIC) || "null", o = s.valueToCode(t, "DATA", u.ATOMIC) || "null", i = s.statementToCode(t, "HANDLE");
|
|
8323
8362
|
return `{
|
|
8324
8363
|
var res = __uploadResourceV1__(${e}, ${n}, ${o});
|
|
8325
8364
|
var __success__ = res.success;
|
|
@@ -8348,11 +8387,11 @@ T([
|
|
|
8348
8387
|
}
|
|
8349
8388
|
]);
|
|
8350
8389
|
s.forBlock.text_v1 = function(t) {
|
|
8351
|
-
return [s.quote_(t.getFieldValue("TEXT")),
|
|
8390
|
+
return [s.quote_(t.getFieldValue("TEXT")), u.ATOMIC];
|
|
8352
8391
|
};
|
|
8353
8392
|
const da = /^\s*'([^']|\\')*'\s*$/;
|
|
8354
8393
|
function oe(t) {
|
|
8355
|
-
return da.test(t) ? [t,
|
|
8394
|
+
return da.test(t) ? [t, u.ATOMIC] : [`String(${t})`, u.FUNCTION_CALL];
|
|
8356
8395
|
}
|
|
8357
8396
|
B.register(
|
|
8358
8397
|
"text_append_tooltip_v1",
|
|
@@ -8386,7 +8425,7 @@ s.forBlock.text_append_v1 = function(t) {
|
|
|
8386
8425
|
const e = s.nameDB_?.getName(
|
|
8387
8426
|
t.getFieldValue("VAR"),
|
|
8388
8427
|
it.NameType.VARIABLE
|
|
8389
|
-
), n = s.valueToCode(t, "TEXT",
|
|
8428
|
+
), n = s.valueToCode(t, "TEXT", u.NONE) || "''";
|
|
8390
8429
|
return `${e} += ${oe(n)};
|
|
8391
8430
|
`;
|
|
8392
8431
|
};
|
|
@@ -8424,7 +8463,7 @@ s.forBlock.text_change_case_v1 = function(t) {
|
|
|
8424
8463
|
}[t.getFieldValue("CASE")], o = s.valueToCode(
|
|
8425
8464
|
t,
|
|
8426
8465
|
"TEXT",
|
|
8427
|
-
n ?
|
|
8466
|
+
n ? u.MEMBER : u.NONE
|
|
8428
8467
|
) || "''";
|
|
8429
8468
|
let i = "";
|
|
8430
8469
|
return n ? i = o + n : i = s.provideFunction_(
|
|
@@ -8434,7 +8473,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
|
|
8434
8473
|
return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase();
|
|
8435
8474
|
}
|
|
8436
8475
|
`
|
|
8437
|
-
) + "(" + o + ")", [i,
|
|
8476
|
+
) + "(" + o + ")", [i, u.FUNCTION_CALL];
|
|
8438
8477
|
};
|
|
8439
8478
|
T([
|
|
8440
8479
|
{
|
|
@@ -8460,8 +8499,8 @@ T([
|
|
|
8460
8499
|
}
|
|
8461
8500
|
]);
|
|
8462
8501
|
s.forBlock.text_char_at_v1 = function(t) {
|
|
8463
|
-
const e = s.valueToCode(t, "VALUE",
|
|
8464
|
-
return [`${e}.charAt(${n})`,
|
|
8502
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
8503
|
+
return [`${e}.charAt(${n})`, u.FUNCTION_CALL];
|
|
8465
8504
|
};
|
|
8466
8505
|
T([
|
|
8467
8506
|
{
|
|
@@ -8487,7 +8526,7 @@ T([
|
|
|
8487
8526
|
}
|
|
8488
8527
|
]);
|
|
8489
8528
|
s.forBlock.text_count_v1 = function(t) {
|
|
8490
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8529
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", n = s.valueToCode(t, "SUBSTR", u.NONE) || "''";
|
|
8491
8530
|
return [`${s.provideFunction_(
|
|
8492
8531
|
"textCount",
|
|
8493
8532
|
`
|
|
@@ -8499,7 +8538,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
|
|
8499
8538
|
}
|
|
8500
8539
|
}
|
|
8501
8540
|
`
|
|
8502
|
-
)}(${e}, ${n})`,
|
|
8541
|
+
)}(${e}, ${n})`, u.FUNCTION_CALL];
|
|
8503
8542
|
};
|
|
8504
8543
|
T([
|
|
8505
8544
|
{
|
|
@@ -8533,8 +8572,8 @@ T([
|
|
|
8533
8572
|
}
|
|
8534
8573
|
]);
|
|
8535
8574
|
s.forBlock.text_index_of_v1 = function(t) {
|
|
8536
|
-
const e = t.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", n = s.valueToCode(t, "TEXT",
|
|
8537
|
-
return [`${n}.${e}(${o})`,
|
|
8575
|
+
const e = t.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", n = s.valueToCode(t, "TEXT", u.MEMBER) || "''", o = s.valueToCode(t, "SUBSTR", u.NONE) || "''";
|
|
8576
|
+
return [`${n}.${e}(${o})`, u.FUNCTION_CALL];
|
|
8538
8577
|
};
|
|
8539
8578
|
T([
|
|
8540
8579
|
{
|
|
@@ -8554,7 +8593,7 @@ T([
|
|
|
8554
8593
|
}
|
|
8555
8594
|
]);
|
|
8556
8595
|
s.forBlock.text_is_empty_v1 = function(t) {
|
|
8557
|
-
return [`!${s.valueToCode(t, "VALUE",
|
|
8596
|
+
return [`!${s.valueToCode(t, "VALUE", u.MEMBER) || "''"}.length`, u.LOGICAL_NOT];
|
|
8558
8597
|
};
|
|
8559
8598
|
const ha = C.xml, fa = {
|
|
8560
8599
|
itemCount_: 0,
|
|
@@ -8623,7 +8662,7 @@ const ha = C.xml, fa = {
|
|
|
8623
8662
|
for (let t = 0; t < this.itemCount_; t++)
|
|
8624
8663
|
if (!this.getInput("ADD" + t)) {
|
|
8625
8664
|
const e = this.appendValueInput("ADD" + t).setAlign(
|
|
8626
|
-
|
|
8665
|
+
v.Align.RIGHT
|
|
8627
8666
|
);
|
|
8628
8667
|
t === 0 && e.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
8629
8668
|
}
|
|
@@ -8631,7 +8670,7 @@ const ha = C.xml, fa = {
|
|
|
8631
8670
|
this.removeInput("ADD" + t);
|
|
8632
8671
|
}
|
|
8633
8672
|
}, ma = function() {
|
|
8634
|
-
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new
|
|
8673
|
+
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Et.MutatorIcon(["text_join_item_v1"], this));
|
|
8635
8674
|
};
|
|
8636
8675
|
B.registerMutator(
|
|
8637
8676
|
"text_join_mutator_v1",
|
|
@@ -8676,20 +8715,20 @@ s.forBlock.text_join_v1 = function(t) {
|
|
|
8676
8715
|
const e = t;
|
|
8677
8716
|
switch (e.itemCount_) {
|
|
8678
8717
|
case 0:
|
|
8679
|
-
return ["''",
|
|
8718
|
+
return ["''", u.ATOMIC];
|
|
8680
8719
|
case 1: {
|
|
8681
|
-
const n = s.valueToCode(e, "ADD0",
|
|
8720
|
+
const n = s.valueToCode(e, "ADD0", u.NONE) || "''";
|
|
8682
8721
|
return oe(n);
|
|
8683
8722
|
}
|
|
8684
8723
|
case 2: {
|
|
8685
|
-
const n = s.valueToCode(e, "ADD0",
|
|
8686
|
-
return [oe(n)[0] + " + " + oe(o)[0],
|
|
8724
|
+
const n = s.valueToCode(e, "ADD0", u.NONE) || "''", o = s.valueToCode(e, "ADD1", u.NONE) || "''";
|
|
8725
|
+
return [oe(n)[0] + " + " + oe(o)[0], u.ADDITION];
|
|
8687
8726
|
}
|
|
8688
8727
|
default: {
|
|
8689
8728
|
const n = new Array(e.itemCount_);
|
|
8690
8729
|
for (let i = 0; i < e.itemCount_; i++)
|
|
8691
|
-
n[i] = s.valueToCode(e, "ADD" + i,
|
|
8692
|
-
return ["[" + n.join(",") + "].join('')",
|
|
8730
|
+
n[i] = s.valueToCode(e, "ADD" + i, u.NONE) || "''";
|
|
8731
|
+
return ["[" + n.join(",") + "].join('')", u.FUNCTION_CALL];
|
|
8693
8732
|
}
|
|
8694
8733
|
}
|
|
8695
8734
|
};
|
|
@@ -8711,7 +8750,7 @@ T([
|
|
|
8711
8750
|
}
|
|
8712
8751
|
]);
|
|
8713
8752
|
s.forBlock.text_length_v1 = function(t) {
|
|
8714
|
-
return [`${s.valueToCode(t, "VALUE",
|
|
8753
|
+
return [`${s.valueToCode(t, "VALUE", u.MEMBER) || "''"}.length`, u.MEMBER];
|
|
8715
8754
|
};
|
|
8716
8755
|
T([
|
|
8717
8756
|
{
|
|
@@ -8742,7 +8781,7 @@ T([
|
|
|
8742
8781
|
}
|
|
8743
8782
|
]);
|
|
8744
8783
|
s.forBlock.text_replace_v1 = function(t) {
|
|
8745
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8784
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", n = s.valueToCode(t, "FROM", u.NONE) || "''", o = s.valueToCode(t, "TO", u.NONE) || "''";
|
|
8746
8785
|
return [`${s.provideFunction_(
|
|
8747
8786
|
"textReplace",
|
|
8748
8787
|
`
|
|
@@ -8752,7 +8791,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
|
8752
8791
|
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
|
8753
8792
|
}
|
|
8754
8793
|
`
|
|
8755
|
-
)}(${e}, ${n}, ${o})`,
|
|
8794
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
8756
8795
|
};
|
|
8757
8796
|
T([
|
|
8758
8797
|
{
|
|
@@ -8773,7 +8812,7 @@ T([
|
|
|
8773
8812
|
}
|
|
8774
8813
|
]);
|
|
8775
8814
|
s.forBlock.text_reverse_v1 = function(t) {
|
|
8776
|
-
return [(s.valueToCode(t, "TEXT",
|
|
8815
|
+
return [(s.valueToCode(t, "TEXT", u.MEMBER) || "''") + ".split('').reverse().join('')", u.FUNCTION_CALL];
|
|
8777
8816
|
};
|
|
8778
8817
|
T([
|
|
8779
8818
|
{
|
|
@@ -8799,8 +8838,8 @@ T([
|
|
|
8799
8838
|
}
|
|
8800
8839
|
]);
|
|
8801
8840
|
s.forBlock.text_split_v1 = function(t) {
|
|
8802
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8803
|
-
return [`${e}.split(${n})`,
|
|
8841
|
+
const e = s.valueToCode(t, "TEXT", u.MEMBER) || "''", n = s.valueToCode(t, "DELIM", u.NONE) || "''";
|
|
8842
|
+
return [`${e}.split(${n})`, u.FUNCTION_CALL];
|
|
8804
8843
|
};
|
|
8805
8844
|
T([
|
|
8806
8845
|
{
|
|
@@ -8831,8 +8870,8 @@ T([
|
|
|
8831
8870
|
}
|
|
8832
8871
|
]);
|
|
8833
8872
|
s.forBlock.text_substring_v1 = function(t) {
|
|
8834
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8835
|
-
return [`${e}.slice(${n}, ${o})`,
|
|
8873
|
+
const e = s.valueToCode(t, "TEXT", u.MEMBER) || "''", n = s.getAdjusted(t, "START"), o = s.getAdjusted(t, "END", 1);
|
|
8874
|
+
return [`${e}.slice(${n}, ${o})`, u.FUNCTION_CALL];
|
|
8836
8875
|
};
|
|
8837
8876
|
T([
|
|
8838
8877
|
{
|
|
@@ -8861,12 +8900,12 @@ T([
|
|
|
8861
8900
|
}
|
|
8862
8901
|
]);
|
|
8863
8902
|
s.forBlock.text_trim_v1 = function(t) {
|
|
8864
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8903
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", o = {
|
|
8865
8904
|
BOTH: 0,
|
|
8866
8905
|
LEFT: 1,
|
|
8867
8906
|
RIGHT: 2
|
|
8868
8907
|
}[t.getFieldValue("MODE")];
|
|
8869
|
-
return [`__trimV1__(${e}, ${o})`,
|
|
8908
|
+
return [`__trimV1__(${e}, ${o})`, u.ATOMIC];
|
|
8870
8909
|
};
|
|
8871
8910
|
const Ta = {
|
|
8872
8911
|
init: function() {
|
|
@@ -8879,7 +8918,7 @@ const Ta = {
|
|
|
8879
8918
|
this.updateShape_(), this.updateShadow_();
|
|
8880
8919
|
},
|
|
8881
8920
|
updateShape_: function() {
|
|
8882
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
8921
|
+
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(v.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(v.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(v.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(v.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
|
|
8883
8922
|
},
|
|
8884
8923
|
updateShadow_: function() {
|
|
8885
8924
|
if (this.isInsertionMarker())
|
|
@@ -8896,7 +8935,7 @@ const Ta = {
|
|
|
8896
8935
|
};
|
|
8897
8936
|
E.create_timer_v1 = Ta;
|
|
8898
8937
|
s.forBlock.create_timer_v1 = function(t) {
|
|
8899
|
-
const e = s.valueToCode(t, "INTERVAL",
|
|
8938
|
+
const e = s.valueToCode(t, "INTERVAL", u.ATOMIC) || "1000", n = s.valueToCode(t, "LOOP", u.ATOMIC) || "false", o = s.valueToCode(t, "COUNT", u.ATOMIC) || "1", i = s.valueToCode(t, "IMMEDIATE", u.ATOMIC) || "false", a = s.statementToCode(t, "CALLBACK");
|
|
8900
8939
|
return `__createTimerV1__(${e}, ${n}, ${o}, ${i}, function() {
|
|
8901
8940
|
${a}});
|
|
8902
8941
|
`;
|
|
@@ -8920,7 +8959,7 @@ T([
|
|
|
8920
8959
|
}
|
|
8921
8960
|
]);
|
|
8922
8961
|
s.forBlock.delay_v1 = function(t) {
|
|
8923
|
-
return `__delayV1__(${s.valueToCode(t, "DURATION",
|
|
8962
|
+
return `__delayV1__(${s.valueToCode(t, "DURATION", u.ATOMIC) || "0"});
|
|
8924
8963
|
`;
|
|
8925
8964
|
};
|
|
8926
8965
|
const Ea = {
|
|
@@ -8955,12 +8994,12 @@ const Ea = {
|
|
|
8955
8994
|
}, ga = function(t) {
|
|
8956
8995
|
return function() {
|
|
8957
8996
|
const e = t.workspace, o = t.getField("VAR").getVariable();
|
|
8958
|
-
|
|
8997
|
+
St.renameVariable(e, o);
|
|
8959
8998
|
};
|
|
8960
8999
|
}, Aa = function(t) {
|
|
8961
9000
|
return function() {
|
|
8962
9001
|
const n = t.getField("VAR").getVariable();
|
|
8963
|
-
n &&
|
|
9002
|
+
n && St.deleteVariable(n.getWorkspace(), n, t);
|
|
8964
9003
|
};
|
|
8965
9004
|
};
|
|
8966
9005
|
B.registerMixin(
|
|
@@ -8988,7 +9027,7 @@ s.forBlock.variable_get_v1 = function(t) {
|
|
|
8988
9027
|
return [s.nameDB_.getName(
|
|
8989
9028
|
t.getFieldValue("VAR"),
|
|
8990
9029
|
it.NameType.VARIABLE
|
|
8991
|
-
),
|
|
9030
|
+
), u.ATOMIC];
|
|
8992
9031
|
};
|
|
8993
9032
|
T([
|
|
8994
9033
|
{
|
|
@@ -9017,7 +9056,7 @@ s.forBlock.variable_set_v1 = function(t) {
|
|
|
9017
9056
|
const e = s.nameDB_.getName(
|
|
9018
9057
|
t.getFieldValue("VAR"),
|
|
9019
9058
|
it.NameType.VARIABLE
|
|
9020
|
-
), n = s.valueToCode(t, "VALUE",
|
|
9059
|
+
), n = s.valueToCode(t, "VALUE", u.ASSIGNMENT) || "0";
|
|
9021
9060
|
return `${e} = ${n};
|
|
9022
9061
|
`;
|
|
9023
9062
|
};
|
|
@@ -9035,19 +9074,19 @@ Mn.setPrompt(async (t, e, n) => {
|
|
|
9035
9074
|
});
|
|
9036
9075
|
o !== void 0 && n(String(o));
|
|
9037
9076
|
});
|
|
9038
|
-
const
|
|
9039
|
-
|
|
9077
|
+
const zt = O.prototype;
|
|
9078
|
+
zt.doClassValidation_ = function(t) {
|
|
9040
9079
|
return t;
|
|
9041
9080
|
};
|
|
9042
|
-
const Ia =
|
|
9043
|
-
|
|
9081
|
+
const Ia = zt.doValueUpdate_;
|
|
9082
|
+
zt.doValueUpdate_ = function(t) {
|
|
9044
9083
|
Ia.call(this, t), this.selectedOption && this.selectedOption[1] !== t && (this.selectedOption = null);
|
|
9045
9084
|
};
|
|
9046
|
-
const Oa =
|
|
9047
|
-
|
|
9085
|
+
const Oa = zt.getText_;
|
|
9086
|
+
zt.getText_ = function() {
|
|
9048
9087
|
if (this.selectedOption)
|
|
9049
9088
|
return Oa.call(this);
|
|
9050
|
-
const { i18n: t } =
|
|
9089
|
+
const { i18n: t } = kt, e = this.getSourceBlock();
|
|
9051
9090
|
if (this.name === "APP")
|
|
9052
9091
|
return e.app.name;
|
|
9053
9092
|
if (this.name === "PAGE")
|
|
@@ -9068,7 +9107,7 @@ Qt.getText_ = function() {
|
|
|
9068
9107
|
return console.log(e.event), Ie(n, o);
|
|
9069
9108
|
} else if (this.name === "METHOD") {
|
|
9070
9109
|
const { kind: n, names: o } = e.method;
|
|
9071
|
-
return
|
|
9110
|
+
return ye(n, o);
|
|
9072
9111
|
} else {
|
|
9073
9112
|
if (this.name === "SPACE")
|
|
9074
9113
|
return e.space.name;
|
|
@@ -9092,22 +9131,22 @@ So.prototype.cleanUp = function() {
|
|
|
9092
9131
|
this.setResizesEnabled(!1);
|
|
9093
9132
|
const t = I.getGroup();
|
|
9094
9133
|
t || I.setGroup(!0);
|
|
9095
|
-
const e = this.getTopBlocks(!0), n = e.filter((
|
|
9096
|
-
(
|
|
9097
|
-
), a = function(
|
|
9134
|
+
const e = this.getTopBlocks(!0), n = e.filter((r) => r.isMovable()), i = e.filter((r) => !r.isMovable()).map(
|
|
9135
|
+
(r) => r.getBoundingRectangle()
|
|
9136
|
+
), a = function(r) {
|
|
9098
9137
|
for (const l of i)
|
|
9099
|
-
if (
|
|
9138
|
+
if (r.intersects(l))
|
|
9100
9139
|
return l;
|
|
9101
9140
|
return null;
|
|
9102
9141
|
};
|
|
9103
9142
|
let c = 0;
|
|
9104
|
-
for (const
|
|
9105
|
-
let l =
|
|
9106
|
-
|
|
9143
|
+
for (const r of n) {
|
|
9144
|
+
let l = r.getBoundingRectangle();
|
|
9145
|
+
r.moveBy(-l.left, c - l.top, ["cleanup"]), r.snapToGrid(), l = r.getBoundingRectangle();
|
|
9107
9146
|
let _ = a(l);
|
|
9108
9147
|
for (; _ != null; )
|
|
9109
|
-
c = _.top + _.getHeight() + Bn,
|
|
9110
|
-
c =
|
|
9148
|
+
c = _.top + _.getHeight() + Bn, r.moveBy(0, c - l.top, ["cleanup"]), r.snapToGrid(), l = r.getBoundingRectangle(), _ = a(l);
|
|
9149
|
+
c = r.getRelativeToSurfaceXY().y + r.getHeightWidth().height + Bn;
|
|
9111
9150
|
}
|
|
9112
9151
|
I.setGroup(t), this.setResizesEnabled(!0);
|
|
9113
9152
|
};
|
|
@@ -9115,7 +9154,7 @@ function co(t) {
|
|
|
9115
9154
|
const e = t.getParent();
|
|
9116
9155
|
return e && co(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
|
|
9117
9156
|
}
|
|
9118
|
-
class
|
|
9157
|
+
class ya {
|
|
9119
9158
|
init() {
|
|
9120
9159
|
const e = Bo.registry.getItem("blockDisable");
|
|
9121
9160
|
e && (e.preconditionFn = function(n) {
|
|
@@ -9126,12 +9165,12 @@ class va {
|
|
|
9126
9165
|
}
|
|
9127
9166
|
bo.registerFieldColour();
|
|
9128
9167
|
Po.registry.unregister(Ro.names.ESCAPE);
|
|
9129
|
-
const
|
|
9130
|
-
|
|
9131
|
-
const Ca = new
|
|
9168
|
+
const va = new Do.CrossTabCopyPaste();
|
|
9169
|
+
va.init({ contextMenu: !0, shortcut: !0 });
|
|
9170
|
+
const Ca = new ya();
|
|
9132
9171
|
Ca.init();
|
|
9133
9172
|
function un(t) {
|
|
9134
|
-
const e =
|
|
9173
|
+
const e = jt();
|
|
9135
9174
|
if (!e)
|
|
9136
9175
|
return;
|
|
9137
9176
|
const n = e.getBlockById(t);
|
|
@@ -9144,7 +9183,7 @@ function un(t) {
|
|
|
9144
9183
|
e.scroll(-a, -c);
|
|
9145
9184
|
}
|
|
9146
9185
|
function ro() {
|
|
9147
|
-
const t =
|
|
9186
|
+
const t = jt();
|
|
9148
9187
|
if (!t)
|
|
9149
9188
|
return;
|
|
9150
9189
|
const e = t.getTopBlocks(!0)?.[0];
|
|
@@ -9335,7 +9374,7 @@ const ka = Un.defineTheme("light", {
|
|
|
9335
9374
|
}
|
|
9336
9375
|
});
|
|
9337
9376
|
function La(t) {
|
|
9338
|
-
const e =
|
|
9377
|
+
const e = jt();
|
|
9339
9378
|
switch (t) {
|
|
9340
9379
|
case "light":
|
|
9341
9380
|
e.setTheme(ka);
|
|
@@ -9346,7 +9385,7 @@ function La(t) {
|
|
|
9346
9385
|
}
|
|
9347
9386
|
}
|
|
9348
9387
|
const en = ["get_app_property_v1", "get_app_state_v1"];
|
|
9349
|
-
function
|
|
9388
|
+
function lt(t, e) {
|
|
9350
9389
|
return t.find((o) => o === e) !== void 0 ? !1 : (t.push(e), !0);
|
|
9351
9390
|
}
|
|
9352
9391
|
function Sa(t) {
|
|
@@ -9362,15 +9401,15 @@ function Ba(t) {
|
|
|
9362
9401
|
for (const n of t)
|
|
9363
9402
|
if (n.type === "get_app_property_v1") {
|
|
9364
9403
|
const o = n;
|
|
9365
|
-
|
|
9404
|
+
lt(
|
|
9366
9405
|
e,
|
|
9367
|
-
|
|
9406
|
+
yt({
|
|
9368
9407
|
type: "elementProperty",
|
|
9369
9408
|
nodeId: o.node.id,
|
|
9370
9409
|
propertyKeys: o.property.key
|
|
9371
9410
|
})
|
|
9372
9411
|
);
|
|
9373
|
-
} else n.type === "get_app_state_v1" ?
|
|
9412
|
+
} else n.type === "get_app_state_v1" ? lt(e, yt({ type: "state", stateId: n.state.id })) : console.assert(!1);
|
|
9374
9413
|
return e;
|
|
9375
9414
|
}
|
|
9376
9415
|
function ba(t) {
|
|
@@ -9400,48 +9439,48 @@ function Pa(t) {
|
|
|
9400
9439
|
} : (i.property.kind === "elementSlotProperty" || i.property.kind === "customSlotProperty") && (a = {
|
|
9401
9440
|
type: "adaptSlotProperty",
|
|
9402
9441
|
propertyId: i.property.key
|
|
9403
|
-
}), !a || !
|
|
9442
|
+
}), !a || !lt(n, yt(a)))
|
|
9404
9443
|
continue;
|
|
9405
9444
|
e.push(a);
|
|
9406
9445
|
} else if (o.type === "get_app_state_v1") {
|
|
9407
9446
|
const a = { type: "state", stateId: o.state.id };
|
|
9408
|
-
if (!
|
|
9447
|
+
if (!lt(n, yt(a)))
|
|
9409
9448
|
continue;
|
|
9410
9449
|
e.push(a);
|
|
9411
9450
|
} else if (o.type === "object_get_v1") {
|
|
9412
9451
|
const i = o.getInputTargetBlock("OBJECT"), a = s.valueToCode(
|
|
9413
9452
|
o,
|
|
9414
9453
|
"KEY",
|
|
9415
|
-
|
|
9454
|
+
u.ATOMIC
|
|
9416
9455
|
);
|
|
9417
9456
|
if (i.type === "get_app_property_v1") {
|
|
9418
9457
|
const c = i;
|
|
9419
|
-
let
|
|
9420
|
-
if (c.property.kind === "elementProperty" ?
|
|
9458
|
+
let r;
|
|
9459
|
+
if (c.property.kind === "elementProperty" ? r = {
|
|
9421
9460
|
type: "elementProperty",
|
|
9422
9461
|
nodeId: c.node.id,
|
|
9423
9462
|
propertyKeys: c.property.key,
|
|
9424
9463
|
subKeys: a
|
|
9425
|
-
} : c.property.kind === "customProperty" ?
|
|
9464
|
+
} : c.property.kind === "customProperty" ? r = {
|
|
9426
9465
|
type: "customProperty",
|
|
9427
9466
|
propertyId: c.property.key,
|
|
9428
9467
|
subKeys: a
|
|
9429
|
-
} : (c.property.kind === "elementSlotProperty" || c.property.kind === "customSlotProperty") && (
|
|
9468
|
+
} : (c.property.kind === "elementSlotProperty" || c.property.kind === "customSlotProperty") && (r = {
|
|
9430
9469
|
type: "adaptSlotProperty",
|
|
9431
9470
|
propertyId: c.property.key,
|
|
9432
9471
|
subKeys: a
|
|
9433
|
-
}), !
|
|
9472
|
+
}), !r || !lt(n, yt(r)))
|
|
9434
9473
|
continue;
|
|
9435
|
-
e.push(
|
|
9474
|
+
e.push(r);
|
|
9436
9475
|
} else if (i.type === "get_app_state_v1") {
|
|
9437
|
-
const
|
|
9476
|
+
const r = {
|
|
9438
9477
|
type: "state",
|
|
9439
9478
|
stateId: i.state.id,
|
|
9440
9479
|
subKeys: a
|
|
9441
9480
|
};
|
|
9442
|
-
if (!
|
|
9481
|
+
if (!lt(n, yt(r)))
|
|
9443
9482
|
continue;
|
|
9444
|
-
e.push(
|
|
9483
|
+
e.push(r);
|
|
9445
9484
|
} else
|
|
9446
9485
|
console.assert(!1);
|
|
9447
9486
|
} else
|
|
@@ -9462,13 +9501,13 @@ function Ra(t) {
|
|
|
9462
9501
|
if (o.type === "watch_effect_v1") {
|
|
9463
9502
|
const i = Sa(o), a = Ba(i);
|
|
9464
9503
|
for (const c of a)
|
|
9465
|
-
e.watchEffect[c] || (e.watchEffect[c] = []),
|
|
9504
|
+
e.watchEffect[c] || (e.watchEffect[c] = []), lt(e.watchEffect[c], o.id);
|
|
9466
9505
|
} else if (o.type === "app_bind_v1") {
|
|
9467
9506
|
const i = ba(o), a = Pa(i);
|
|
9468
9507
|
e.bind.sets[o.id] = a;
|
|
9469
9508
|
for (const c of a) {
|
|
9470
|
-
const
|
|
9471
|
-
e.bind.triggers[
|
|
9509
|
+
const r = yt(c);
|
|
9510
|
+
e.bind.triggers[r] || (e.bind.triggers[r] = []), lt(e.bind.triggers[r], o.id);
|
|
9472
9511
|
}
|
|
9473
9512
|
}
|
|
9474
9513
|
return e;
|
|
@@ -9480,13 +9519,13 @@ function Da(t) {
|
|
|
9480
9519
|
function ln() {
|
|
9481
9520
|
return Qo(uo);
|
|
9482
9521
|
}
|
|
9483
|
-
const Ma = /* @__PURE__ */
|
|
9522
|
+
const Ma = /* @__PURE__ */ rt({
|
|
9484
9523
|
__name: "index",
|
|
9485
9524
|
props: {
|
|
9486
9525
|
lock: { type: Boolean }
|
|
9487
9526
|
},
|
|
9488
9527
|
setup(t, { expose: e }) {
|
|
9489
|
-
const { t: n } =
|
|
9528
|
+
const { t: n } = Jt(), o = t, i = ln(), a = () => {
|
|
9490
9529
|
if (!i.workspace) {
|
|
9491
9530
|
console.assert(!1);
|
|
9492
9531
|
return;
|
|
@@ -9499,7 +9538,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9499
9538
|
}, c = () => {
|
|
9500
9539
|
a();
|
|
9501
9540
|
};
|
|
9502
|
-
return e({ cleanWorkspace: a }), (
|
|
9541
|
+
return e({ cleanWorkspace: a }), (r, l) => {
|
|
9503
9542
|
const _ = M("v-btn"), d = M("v-tooltip");
|
|
9504
9543
|
return S(), st(d, {
|
|
9505
9544
|
text: D(n)("x-block-lib.tip.hotkeyCtrlQ")
|
|
@@ -9516,7 +9555,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9516
9555
|
}, 8, ["text"]);
|
|
9517
9556
|
};
|
|
9518
9557
|
}
|
|
9519
|
-
}), Ua = /* @__PURE__ */
|
|
9558
|
+
}), Ua = /* @__PURE__ */ rt({
|
|
9520
9559
|
__name: "index",
|
|
9521
9560
|
props: {
|
|
9522
9561
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -9524,14 +9563,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9524
9563
|
},
|
|
9525
9564
|
emits: ["update:modelValue"],
|
|
9526
9565
|
setup(t) {
|
|
9527
|
-
const { t: e } =
|
|
9566
|
+
const { t: e } = Jt(), n = $t(t, "modelValue");
|
|
9528
9567
|
return (o, i) => {
|
|
9529
9568
|
const a = M("v-btn"), c = M("v-tooltip");
|
|
9530
9569
|
return S(), st(c, {
|
|
9531
9570
|
text: D(e)("x-block-lib.tip.hotkeyCtrlW")
|
|
9532
9571
|
}, {
|
|
9533
|
-
activator: at(({ props:
|
|
9534
|
-
L(a, sn(
|
|
9572
|
+
activator: at(({ props: r }) => [
|
|
9573
|
+
L(a, sn(r, {
|
|
9535
9574
|
density: "comfortable",
|
|
9536
9575
|
icon: n.value ? "mdi-lock" : "mdi-lock-open",
|
|
9537
9576
|
variant: "outlined",
|
|
@@ -9546,7 +9585,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9546
9585
|
key: 0,
|
|
9547
9586
|
class: "text-cation text-grey text-truncate ml-6",
|
|
9548
9587
|
style: { maxWidth: "340px" }
|
|
9549
|
-
}, Fa = /* @__PURE__ */
|
|
9588
|
+
}, Fa = /* @__PURE__ */ rt({
|
|
9550
9589
|
__name: "item",
|
|
9551
9590
|
props: {
|
|
9552
9591
|
id: {},
|
|
@@ -9556,14 +9595,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9556
9595
|
},
|
|
9557
9596
|
emits: ["x-click"],
|
|
9558
9597
|
setup(t, { emit: e }) {
|
|
9559
|
-
const { primaryColor: n, backgroundColor2: o, highlightColor: i } =
|
|
9598
|
+
const { primaryColor: n, backgroundColor2: o, highlightColor: i } = Xt(), a = t, c = e, r = Bt(!1), l = w(() => ({
|
|
9560
9599
|
position: "relative",
|
|
9561
|
-
background:
|
|
9600
|
+
background: r.value ? i.value : o.value,
|
|
9562
9601
|
width: "100%",
|
|
9563
9602
|
height: "48px",
|
|
9564
9603
|
marginBottom: "1px",
|
|
9565
9604
|
userSelect: "none"
|
|
9566
|
-
})), _ =
|
|
9605
|
+
})), _ = w(() => ({
|
|
9567
9606
|
display: a.select ? "block" : "none",
|
|
9568
9607
|
position: "absolute",
|
|
9569
9608
|
top: "0px",
|
|
@@ -9579,21 +9618,21 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9579
9618
|
class: "d-flex align-center cursor-pointer",
|
|
9580
9619
|
style: j(l.value),
|
|
9581
9620
|
onClick: h[1] || (h[1] = (R) => c("x-click", a.id)),
|
|
9582
|
-
onMouseout: h[2] || (h[2] = (R) =>
|
|
9583
|
-
onMouseover: h[3] || (h[3] = (R) =>
|
|
9621
|
+
onMouseout: h[2] || (h[2] = (R) => r.value = !1),
|
|
9622
|
+
onMouseover: h[3] || (h[3] = (R) => r.value = !0)
|
|
9584
9623
|
}, [
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
a.desc ? (S(), tt("span", Ya,
|
|
9624
|
+
K("div", Va, [
|
|
9625
|
+
K("span", xa, Ht(a.title), 1),
|
|
9626
|
+
a.desc ? (S(), tt("span", Ya, Ht(a.desc), 1)) : ut("", !0)
|
|
9588
9627
|
]),
|
|
9589
9628
|
L(p),
|
|
9590
9629
|
L(m, {
|
|
9591
9630
|
class: "x-handle cursor-move mr-3",
|
|
9592
9631
|
icon: "mdi-drag-horizontal-variant",
|
|
9593
|
-
onMousedown: h[0] || (h[0] =
|
|
9632
|
+
onMousedown: h[0] || (h[0] = wt(() => {
|
|
9594
9633
|
}, ["stop"]))
|
|
9595
9634
|
}),
|
|
9596
|
-
|
|
9635
|
+
K("div", {
|
|
9597
9636
|
style: j(_.value)
|
|
9598
9637
|
}, null, 4)
|
|
9599
9638
|
], 36)), [
|
|
@@ -9604,7 +9643,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9604
9643
|
}), wa = {
|
|
9605
9644
|
key: 1,
|
|
9606
9645
|
class: "text-caption text-grey"
|
|
9607
|
-
}, Ka = /* @__PURE__ */
|
|
9646
|
+
}, Ka = /* @__PURE__ */ rt({
|
|
9608
9647
|
__name: "index",
|
|
9609
9648
|
props: /* @__PURE__ */ je({
|
|
9610
9649
|
lock: { type: Boolean }
|
|
@@ -9614,7 +9653,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9614
9653
|
}),
|
|
9615
9654
|
emits: ["update:modelValue"],
|
|
9616
9655
|
setup(t, { expose: e }) {
|
|
9617
|
-
const { t: n } =
|
|
9656
|
+
const { t: n } = Jt(), o = $t(t, "modelValue"), i = ln(), a = Bt([]);
|
|
9618
9657
|
e({ update: () => {
|
|
9619
9658
|
if (!i.workspace) {
|
|
9620
9659
|
console.assert(!1);
|
|
@@ -9625,26 +9664,26 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9625
9664
|
const R = A.id === Uo()?.id;
|
|
9626
9665
|
let P = "";
|
|
9627
9666
|
if (A.type.startsWith("on_app_event_v")) {
|
|
9628
|
-
const G = A,
|
|
9629
|
-
|
|
9667
|
+
const G = A, Nt = et[G.node.key];
|
|
9668
|
+
Nt && (P = n(Nt.name), G.node.alias && (P += " / " + G.node.alias), P += " - " + Ie(G.event.kind, G.event.names));
|
|
9630
9669
|
} else if (A.type.startsWith("watch_effect_v"))
|
|
9631
9670
|
P = n("x-block-lib.watchEffect");
|
|
9632
9671
|
else if (A.type.startsWith("app_bind_v"))
|
|
9633
9672
|
P = n("x-block-lib.bind");
|
|
9634
9673
|
else if (A.type.startsWith("implement_app_method_v")) {
|
|
9635
9674
|
const G = A;
|
|
9636
|
-
P = n("x-block-lib.implementMethod"), P += " - " +
|
|
9675
|
+
P = n("x-block-lib.implementMethod"), P += " - " + ye(G.method.kind, G.method.names);
|
|
9637
9676
|
} else A.type.startsWith("func_entry_v") ? P = n("x-block-lib.funcEntry") : A.type.startsWith("procedure_def_v") ? P = n("x-block-lib.procedure") + " - " + A.getFieldValue("NAME") : P = n("x-block-lib.temporaryBlock");
|
|
9638
|
-
const
|
|
9677
|
+
const It = A.getCommentText() ?? "";
|
|
9639
9678
|
p.push({
|
|
9640
9679
|
id: A.id,
|
|
9641
9680
|
name: P,
|
|
9642
|
-
desc:
|
|
9681
|
+
desc: It,
|
|
9643
9682
|
select: R
|
|
9644
9683
|
});
|
|
9645
9684
|
}), a.value = p;
|
|
9646
9685
|
} });
|
|
9647
|
-
let
|
|
9686
|
+
let r = [];
|
|
9648
9687
|
const l = () => {
|
|
9649
9688
|
if (t.lock) {
|
|
9650
9689
|
xn(n("x-block-lib.msg.cannotOperateInLockedState"));
|
|
@@ -9653,7 +9692,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9653
9692
|
const p = [];
|
|
9654
9693
|
a.value.forEach(({ id: m }) => {
|
|
9655
9694
|
p.push(m);
|
|
9656
|
-
}),
|
|
9695
|
+
}), r = p;
|
|
9657
9696
|
}, _ = () => !t.lock, d = (p) => {
|
|
9658
9697
|
if (!i.workspace) {
|
|
9659
9698
|
console.assert(!1);
|
|
@@ -9665,7 +9704,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9665
9704
|
}
|
|
9666
9705
|
if (p.oldIndex === p.newIndex)
|
|
9667
9706
|
return;
|
|
9668
|
-
const m =
|
|
9707
|
+
const m = r[p.oldIndex], A = i.workspace.getBlockById(
|
|
9669
9708
|
m
|
|
9670
9709
|
);
|
|
9671
9710
|
if (!A) {
|
|
@@ -9673,13 +9712,13 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9673
9712
|
return;
|
|
9674
9713
|
}
|
|
9675
9714
|
let R = "";
|
|
9676
|
-
p.newIndex > p.oldIndex ? R =
|
|
9715
|
+
p.newIndex > p.oldIndex ? R = r[p.newIndex] : p.newIndex > 0 && (R = r[p.newIndex - 1]);
|
|
9677
9716
|
let P = -10;
|
|
9678
9717
|
R !== "" && (P = i.workspace.getBlockById(
|
|
9679
9718
|
R
|
|
9680
9719
|
).getRelativeToSurfaceXY().y + 10);
|
|
9681
|
-
const
|
|
9682
|
-
A.moveTo(new C.Coordinate(
|
|
9720
|
+
const It = A.getRelativeToSurfaceXY();
|
|
9721
|
+
A.moveTo(new C.Coordinate(It.x, P)), i.workspace.cleanUp(), ro();
|
|
9683
9722
|
}, h = async (p) => {
|
|
9684
9723
|
if (!i.workspace) {
|
|
9685
9724
|
console.assert(!1);
|
|
@@ -9710,14 +9749,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9710
9749
|
}, null, 8, ["id", "desc", "select", "title"]))), 128))
|
|
9711
9750
|
]),
|
|
9712
9751
|
_: 1
|
|
9713
|
-
}, 8, ["modelValue"])) : (S(), tt("span", wa,
|
|
9752
|
+
}, 8, ["modelValue"])) : (S(), tt("span", wa, Ht(D(n)("x-block-lib.noOption")), 1));
|
|
9714
9753
|
}
|
|
9715
9754
|
}), $a = (t, e) => {
|
|
9716
9755
|
const n = t.__vccOpts || t;
|
|
9717
9756
|
for (const [o, i] of e)
|
|
9718
9757
|
n[o] = i;
|
|
9719
9758
|
return n;
|
|
9720
|
-
}, Ha = /* @__PURE__ */ $a(Ka, [["__scopeId", "data-v-daa85471"]]), Ga = /* @__PURE__ */
|
|
9759
|
+
}, Ha = /* @__PURE__ */ $a(Ka, [["__scopeId", "data-v-daa85471"]]), Ga = /* @__PURE__ */ rt({
|
|
9721
9760
|
__name: "index",
|
|
9722
9761
|
props: {
|
|
9723
9762
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -9725,7 +9764,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9725
9764
|
},
|
|
9726
9765
|
emits: ["update:modelValue"],
|
|
9727
9766
|
setup(t, { expose: e }) {
|
|
9728
|
-
const n =
|
|
9767
|
+
const n = $t(t, "modelValue"), o = ln();
|
|
9729
9768
|
e({ update: () => {
|
|
9730
9769
|
if (!o.workspace) {
|
|
9731
9770
|
console.assert(!1);
|
|
@@ -9733,49 +9772,49 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9733
9772
|
}
|
|
9734
9773
|
} });
|
|
9735
9774
|
const a = (c) => {
|
|
9736
|
-
const
|
|
9737
|
-
if (!
|
|
9775
|
+
const r = jt();
|
|
9776
|
+
if (!r) {
|
|
9738
9777
|
console.assert(!1);
|
|
9739
9778
|
return;
|
|
9740
9779
|
}
|
|
9741
|
-
const l =
|
|
9780
|
+
const l = r.getBlockById(c);
|
|
9742
9781
|
Vn.setSelected(l), un(c), n.value = !1;
|
|
9743
9782
|
};
|
|
9744
|
-
return (c,
|
|
9745
|
-
onClick:
|
|
9783
|
+
return (c, r) => (S(), tt("div", {
|
|
9784
|
+
onClick: r[0] || (r[0] = (l) => a(""))
|
|
9746
9785
|
}, "blockTree"));
|
|
9747
9786
|
}
|
|
9748
|
-
}), Wa = { class: "text-subtitle-1" }, ja = /* @__PURE__ */
|
|
9787
|
+
}), Wa = { class: "text-subtitle-1" }, ja = /* @__PURE__ */ rt({
|
|
9749
9788
|
__name: "index",
|
|
9750
9789
|
props: {
|
|
9751
9790
|
type: {},
|
|
9752
9791
|
lock: { type: Boolean }
|
|
9753
9792
|
},
|
|
9754
9793
|
setup(t, { expose: e }) {
|
|
9755
|
-
const { t: n } =
|
|
9794
|
+
const { t: n } = Jt(), o = ii(), { sysBarAvail: i } = Yn(), { backgroundColor1: a } = Xt(), c = w(() => {
|
|
9756
9795
|
let m = "100%";
|
|
9757
9796
|
return o.mdAndUp.value && (m = "400px"), {
|
|
9758
9797
|
background: a.value,
|
|
9759
9798
|
width: m,
|
|
9760
9799
|
height: "100%"
|
|
9761
9800
|
};
|
|
9762
|
-
}),
|
|
9801
|
+
}), r = w(() => {
|
|
9763
9802
|
let m = 48;
|
|
9764
9803
|
return i.value && (m += 24), {
|
|
9765
9804
|
position: "relative",
|
|
9766
9805
|
height: `calc(100% - ${m}px)`
|
|
9767
9806
|
};
|
|
9768
|
-
}), l =
|
|
9807
|
+
}), l = w(() => ({
|
|
9769
9808
|
height: "60px"
|
|
9770
9809
|
})), { open: _ } = nn(`blocklyNavigatorDlg${Xe()}`);
|
|
9771
9810
|
ei(() => {
|
|
9772
9811
|
_.value = !1;
|
|
9773
9812
|
});
|
|
9774
|
-
const d =
|
|
9813
|
+
const d = Kt("blockList"), h = Kt("blockTree");
|
|
9775
9814
|
return e({ open: _, update: () => {
|
|
9776
9815
|
t.type === "list" ? d.value?.update() : t.type === "tree" && h.value?.update();
|
|
9777
9816
|
} }), (m, A) => {
|
|
9778
|
-
const R = M("v-sheet"), P = M("v-btn"),
|
|
9817
|
+
const R = M("v-sheet"), P = M("v-btn"), It = M("v-spacer"), G = M("v-dialog"), Nt = M("v-tooltip");
|
|
9779
9818
|
return S(), tt(Kn, null, [
|
|
9780
9819
|
L(G, {
|
|
9781
9820
|
modelValue: D(_),
|
|
@@ -9785,15 +9824,15 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9785
9824
|
"no-click-animation": "",
|
|
9786
9825
|
persistent: "",
|
|
9787
9826
|
transition: "scroll-x-reverse-transition",
|
|
9788
|
-
onKeydown: A[6] || (A[6] = $n(
|
|
9827
|
+
onKeydown: A[6] || (A[6] = $n(wt((W) => _.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
9789
9828
|
}, {
|
|
9790
9829
|
default: at(() => [
|
|
9791
|
-
|
|
9830
|
+
K("div", {
|
|
9792
9831
|
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
9793
|
-
onClick: A[3] || (A[3] =
|
|
9794
|
-
onContextmenu: A[4] || (A[4] =
|
|
9832
|
+
onClick: A[3] || (A[3] = wt((W) => _.value = !1, ["self"])),
|
|
9833
|
+
onContextmenu: A[4] || (A[4] = wt((W) => _.value = !1, ["self", "prevent"]))
|
|
9795
9834
|
}, [
|
|
9796
|
-
|
|
9835
|
+
K("div", {
|
|
9797
9836
|
class: "elevation-2",
|
|
9798
9837
|
style: j(c.value)
|
|
9799
9838
|
}, [
|
|
@@ -9801,7 +9840,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9801
9840
|
key: 0,
|
|
9802
9841
|
color: "transparent",
|
|
9803
9842
|
height: 24
|
|
9804
|
-
})) :
|
|
9843
|
+
})) : ut("", !0),
|
|
9805
9844
|
L(R, {
|
|
9806
9845
|
class: "d-flex align-center px-2",
|
|
9807
9846
|
color: "transparent",
|
|
@@ -9814,14 +9853,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9814
9853
|
variant: "text",
|
|
9815
9854
|
onClick: A[0] || (A[0] = (W) => _.value = !1)
|
|
9816
9855
|
}),
|
|
9817
|
-
|
|
9818
|
-
L(
|
|
9856
|
+
K("span", Wa, Ht(D(n)("x-block-lib.navigator")), 1),
|
|
9857
|
+
L(It)
|
|
9819
9858
|
]),
|
|
9820
9859
|
_: 1
|
|
9821
9860
|
}),
|
|
9822
|
-
|
|
9861
|
+
K("div", {
|
|
9823
9862
|
class: "overflow-y-auto",
|
|
9824
|
-
style: j(
|
|
9863
|
+
style: j(r.value)
|
|
9825
9864
|
}, [
|
|
9826
9865
|
t.type === "list" ? (S(), st(Ha, {
|
|
9827
9866
|
key: 0,
|
|
@@ -9836,8 +9875,8 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9836
9875
|
ref: h,
|
|
9837
9876
|
modelValue: D(_),
|
|
9838
9877
|
"onUpdate:modelValue": A[2] || (A[2] = (W) => ne(_) ? _.value = W : null)
|
|
9839
|
-
}, null, 8, ["modelValue"])) :
|
|
9840
|
-
|
|
9878
|
+
}, null, 8, ["modelValue"])) : ut("", !0),
|
|
9879
|
+
K("div", {
|
|
9841
9880
|
style: j(l.value)
|
|
9842
9881
|
}, null, 4)
|
|
9843
9882
|
], 4)
|
|
@@ -9846,7 +9885,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9846
9885
|
]),
|
|
9847
9886
|
_: 1
|
|
9848
9887
|
}, 8, ["modelValue"]),
|
|
9849
|
-
L(
|
|
9888
|
+
L(Nt, {
|
|
9850
9889
|
text: D(n)("x-block-lib.tip.hotkeyCtrlE")
|
|
9851
9890
|
}, {
|
|
9852
9891
|
activator: at(({ props: W }) => [
|
|
@@ -9862,55 +9901,55 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9862
9901
|
], 64);
|
|
9863
9902
|
};
|
|
9864
9903
|
}
|
|
9865
|
-
}),
|
|
9866
|
-
function
|
|
9867
|
-
const e =
|
|
9904
|
+
}), Y = C.xml;
|
|
9905
|
+
function x(t) {
|
|
9906
|
+
const e = Y.createElement("label");
|
|
9868
9907
|
return e.setAttribute("text", t), e;
|
|
9869
9908
|
}
|
|
9870
|
-
function
|
|
9871
|
-
const n =
|
|
9909
|
+
function y(t, e) {
|
|
9910
|
+
const n = Y.createElement("block");
|
|
9872
9911
|
if (n.setAttribute("type", t), e)
|
|
9873
9912
|
for (const o of e)
|
|
9874
9913
|
n.appendChild(o);
|
|
9875
9914
|
return n;
|
|
9876
9915
|
}
|
|
9877
9916
|
function lo(t) {
|
|
9878
|
-
const e =
|
|
9917
|
+
const e = Y.createElement("mutation");
|
|
9879
9918
|
for (const { key: n, value: o } of t)
|
|
9880
9919
|
e.setAttribute(n, o);
|
|
9881
9920
|
return e;
|
|
9882
9921
|
}
|
|
9883
|
-
function
|
|
9922
|
+
function Rt(t, e) {
|
|
9884
9923
|
e === void 0 && (e = "");
|
|
9885
|
-
const n =
|
|
9924
|
+
const n = Y.createElement("value");
|
|
9886
9925
|
n.setAttribute("name", t);
|
|
9887
|
-
const o =
|
|
9926
|
+
const o = Y.createElement("shadow");
|
|
9888
9927
|
o.setAttribute("type", "text_v1");
|
|
9889
|
-
const i =
|
|
9928
|
+
const i = Y.createElement("field");
|
|
9890
9929
|
i.setAttribute("name", "TEXT");
|
|
9891
|
-
const a =
|
|
9930
|
+
const a = Y.createTextNode(e);
|
|
9892
9931
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9893
9932
|
}
|
|
9894
9933
|
function bn(t, e) {
|
|
9895
9934
|
e === void 0 && (e = 0);
|
|
9896
|
-
const n =
|
|
9935
|
+
const n = Y.createElement("value");
|
|
9897
9936
|
n.setAttribute("name", t);
|
|
9898
|
-
const o =
|
|
9937
|
+
const o = Y.createElement("shadow");
|
|
9899
9938
|
o.setAttribute("type", "math_number_v1");
|
|
9900
|
-
const i =
|
|
9939
|
+
const i = Y.createElement("field");
|
|
9901
9940
|
i.setAttribute("name", "NUM");
|
|
9902
|
-
const a =
|
|
9941
|
+
const a = Y.createTextNode(String(e));
|
|
9903
9942
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9904
9943
|
}
|
|
9905
9944
|
function Xa(t, e) {
|
|
9906
9945
|
e === void 0 && (e = !1);
|
|
9907
|
-
const n =
|
|
9946
|
+
const n = Y.createElement("value");
|
|
9908
9947
|
n.setAttribute("name", t);
|
|
9909
|
-
const o =
|
|
9948
|
+
const o = Y.createElement("shadow");
|
|
9910
9949
|
o.setAttribute("type", "logic_boolean_v1");
|
|
9911
|
-
const i =
|
|
9950
|
+
const i = Y.createElement("field");
|
|
9912
9951
|
i.setAttribute("name", "BOOL");
|
|
9913
|
-
const a =
|
|
9952
|
+
const a = Y.createTextNode(e ? "TRUE" : "FALSE");
|
|
9914
9953
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9915
9954
|
}
|
|
9916
9955
|
function Ja() {
|
|
@@ -9936,19 +9975,19 @@ function Qa() {
|
|
|
9936
9975
|
}
|
|
9937
9976
|
function za() {
|
|
9938
9977
|
const t = [];
|
|
9939
|
-
return t.push(
|
|
9940
|
-
|
|
9941
|
-
), t.push(
|
|
9978
|
+
return t.push(x(f("LABEL_EVENT"))), X("onEvent") && t.push(y("on_app_event_v1")), Ja() && t.push(y("trigger_app_event_v1")), t.push(
|
|
9979
|
+
y("app_bind_v1", [lo([{ key: "items", value: "2" }])])
|
|
9980
|
+
), t.push(y("watch_effect_v1")), (X("getProperty") || X("setProperty")) && t.push(x(f("LABEL_PROPERTY"))), X("getProperty") && t.push(y("get_app_property_v1")), X("setProperty") && t.push(y("set_app_property_v1")), qa() && (t.push(x(f("LABEL_STATE"))), t.push(y("get_app_state_v1")), t.push(y("set_app_state_v1"))), (X("callMethod") || Pn()) && t.push(x(f("LABEL_METHOD"))), X("callMethod") && t.push(y("call_app_method_v1")), Pn() && (t.push(y("implement_app_method_v1")), Qa() && t.push(y("set_app_method_output_v1")), t.push(y("procedure_return_v1"))), t;
|
|
9942
9981
|
}
|
|
9943
9982
|
const _o = { name: "APP_COMP_CATEGORY", callback: za };
|
|
9944
9983
|
function Za() {
|
|
9945
9984
|
const t = [];
|
|
9946
|
-
return t.push(
|
|
9985
|
+
return t.push(x(f("LABEL_FUNC"))), t.push(x(f("LABEL_FLOW"))), t;
|
|
9947
9986
|
}
|
|
9948
9987
|
const pe = { name: "APP_COMPUTE_CATEGORY", callback: Za };
|
|
9949
9988
|
function tc() {
|
|
9950
9989
|
const t = [];
|
|
9951
|
-
return t.push(
|
|
9990
|
+
return t.push(y("app_debug_trace_v1", [Rt("OBJECT")])), t.push(y("popup_message_v1", [Rt("TEXT")])), t.push(y("open_confirm_dlg_v1")), t.push(y("open_prompt_dlg_v1")), t;
|
|
9952
9991
|
}
|
|
9953
9992
|
const de = { name: "APP_MESSAGE_CATEGORY", callback: tc };
|
|
9954
9993
|
function ec() {
|
|
@@ -9959,7 +9998,7 @@ function ec() {
|
|
|
9959
9998
|
}
|
|
9960
9999
|
function nc() {
|
|
9961
10000
|
const t = [];
|
|
9962
|
-
return t.push(
|
|
10001
|
+
return t.push(y("app_env_is_v1")), ec() && t.push(y("navigate_to_v1")), t;
|
|
9963
10002
|
}
|
|
9964
10003
|
const he = { name: "APP_MISC_CATEGORY", callback: nc };
|
|
9965
10004
|
function oc() {
|
|
@@ -9972,14 +10011,14 @@ function ic() {
|
|
|
9972
10011
|
}
|
|
9973
10012
|
function sc() {
|
|
9974
10013
|
const t = [];
|
|
9975
|
-
return t.push(
|
|
9976
|
-
|
|
9977
|
-
), t.push(
|
|
10014
|
+
return t.push(x(f("LABEL_EVENT"))), X("onEvent") && t.push(y("on_app_event_v1")), t.push(
|
|
10015
|
+
y("app_bind_v1", [lo([{ key: "items", value: "2" }])])
|
|
10016
|
+
), t.push(y("watch_effect_v1")), (X("getProperty") || X("setProperty")) && t.push(x(f("LABEL_PROPERTY"))), X("getProperty") && t.push(y("get_app_property_v1")), X("setProperty") && t.push(y("set_app_property_v1")), oc() && (t.push(x(f("LABEL_STATE"))), t.push(y("get_app_state_v1")), t.push(y("set_app_state_v1"))), X("callMethod") && (t.push(x(f("LABEL_METHOD"))), t.push(y("call_app_method_v1"))), ic() && (t.push(x(f("LABEL_ARGUMENT"))), t.push(y("get_page_argument_v1"))), t;
|
|
9978
10017
|
}
|
|
9979
10018
|
const po = { name: "APP_PAGE_CATEGORY", callback: sc };
|
|
9980
10019
|
function ac() {
|
|
9981
10020
|
const t = [];
|
|
9982
|
-
return t.push(
|
|
10021
|
+
return t.push(x(f("LABEL_RESOURCE"))), t.push(y("upload_resource_v1")), t;
|
|
9983
10022
|
}
|
|
9984
10023
|
const fe = { name: "APP_RESOURCE_CATEGORY", callback: ac }, xt = C.xml;
|
|
9985
10024
|
function cc() {
|
|
@@ -10005,14 +10044,14 @@ function cc() {
|
|
|
10005
10044
|
}
|
|
10006
10045
|
return t;
|
|
10007
10046
|
}
|
|
10008
|
-
const
|
|
10047
|
+
const _t = {
|
|
10009
10048
|
name: "PROCEDURE_CATEGORY",
|
|
10010
10049
|
callback: cc
|
|
10011
|
-
},
|
|
10050
|
+
}, ee = C.xml;
|
|
10012
10051
|
function rc() {
|
|
10013
|
-
const t =
|
|
10052
|
+
const t = jt(), e = [];
|
|
10014
10053
|
{
|
|
10015
|
-
const o =
|
|
10054
|
+
const o = ee.createElement("label");
|
|
10016
10055
|
o.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), e.push(o);
|
|
10017
10056
|
}
|
|
10018
10057
|
{
|
|
@@ -10020,7 +10059,7 @@ function rc() {
|
|
|
10020
10059
|
o.setAttribute("text", "%{BKY_NEW_VARIABLE}"), o.setAttribute("callbackKey", "CREATE_VARIABLE"), t.registerButtonCallback(
|
|
10021
10060
|
"CREATE_VARIABLE",
|
|
10022
10061
|
function(i) {
|
|
10023
|
-
|
|
10062
|
+
St.createVariableButtonHandler(
|
|
10024
10063
|
i.getTargetWorkspace()
|
|
10025
10064
|
);
|
|
10026
10065
|
}
|
|
@@ -10029,39 +10068,39 @@ function rc() {
|
|
|
10029
10068
|
const n = t.getVariablesOfType("");
|
|
10030
10069
|
if (n.length <= 0)
|
|
10031
10070
|
return e;
|
|
10032
|
-
n.sort(
|
|
10071
|
+
n.sort(St.compareByName);
|
|
10033
10072
|
{
|
|
10034
|
-
const o =
|
|
10073
|
+
const o = ee.createElement("label");
|
|
10035
10074
|
o.setAttribute("text", f("LABEL_CREATED")), e.push(o);
|
|
10036
10075
|
}
|
|
10037
10076
|
return n.forEach((o) => {
|
|
10038
10077
|
{
|
|
10039
|
-
const i =
|
|
10040
|
-
i.setAttribute("type", "variable_get_v1"), i.appendChild(
|
|
10078
|
+
const i = ee.createElement("block");
|
|
10079
|
+
i.setAttribute("type", "variable_get_v1"), i.appendChild(St.generateVariableFieldDom(o)), e.push(i);
|
|
10041
10080
|
}
|
|
10042
10081
|
{
|
|
10043
|
-
const i =
|
|
10044
|
-
i.setAttribute("type", "variable_set_v1"), i.appendChild(
|
|
10082
|
+
const i = ee.createElement("block");
|
|
10083
|
+
i.setAttribute("type", "variable_set_v1"), i.appendChild(St.generateVariableFieldDom(o)), e.push(i);
|
|
10045
10084
|
}
|
|
10046
10085
|
}), e;
|
|
10047
10086
|
}
|
|
10048
|
-
const
|
|
10087
|
+
const pt = {
|
|
10049
10088
|
name: "VARIABLE_CATEGORY",
|
|
10050
10089
|
callback: rc
|
|
10051
10090
|
};
|
|
10052
10091
|
function uc() {
|
|
10053
10092
|
const t = [];
|
|
10054
10093
|
if (nt().length > 0)
|
|
10055
|
-
t.push(
|
|
10056
|
-
|
|
10057
|
-
), t.push(
|
|
10058
|
-
|
|
10094
|
+
t.push(x(f("LABEL_OPERATION"))), t.push(y("add_data_v1")), t.push(y("delete_data_v1")), t.push(y("update_data_v1")), t.push(y("query_data_v1")), t.push(y("transaction_v1")), t.push(
|
|
10095
|
+
y("interrupt_transaction_v1", [Rt("VALUE")])
|
|
10096
|
+
), t.push(x(f("LABEL_CONDITION"))), t.push(y("cond_logic_v1")), t.push(y("cond_atomic_v1", [Rt("VALUE")])), t.push(x(f("LABEL_QUERY_EXTRA"))), t.push(
|
|
10097
|
+
y("query_extra_limit_v1", [
|
|
10059
10098
|
bn("OFFSET", 0),
|
|
10060
10099
|
bn("LIMIT", 1)
|
|
10061
10100
|
])
|
|
10062
10101
|
), t.push(
|
|
10063
|
-
|
|
10064
|
-
|
|
10102
|
+
y("query_extra_sortby_v1", [
|
|
10103
|
+
Rt("COLUMN"),
|
|
10065
10104
|
Xa("DESC")
|
|
10066
10105
|
])
|
|
10067
10106
|
);
|
|
@@ -10073,25 +10112,25 @@ function uc() {
|
|
|
10073
10112
|
}
|
|
10074
10113
|
const me = { name: "COMPUTE_DATA_CATEGORY", callback: uc };
|
|
10075
10114
|
function lc() {
|
|
10076
|
-
return
|
|
10115
|
+
return Qt("flow").length > 0;
|
|
10077
10116
|
}
|
|
10078
10117
|
function _c() {
|
|
10079
10118
|
const t = [];
|
|
10080
|
-
return g.compute.activeObject.type === "flow" && t.push(
|
|
10119
|
+
return g.compute.activeObject.type === "flow" && t.push(y("on_flow_state_event_v1")), lc() && console.assert(!0), t;
|
|
10081
10120
|
}
|
|
10082
10121
|
const Te = { name: "COMPUTE_FLOW_CATEGORY", callback: _c };
|
|
10083
10122
|
function pc() {
|
|
10084
|
-
return
|
|
10123
|
+
return Qt("func").length > 0;
|
|
10085
10124
|
}
|
|
10086
10125
|
function dc() {
|
|
10087
10126
|
const t = [];
|
|
10088
|
-
return g.compute.activeObject.type === "func" && (t.push(
|
|
10127
|
+
return g.compute.activeObject.type === "func" && (t.push(y("func_entry_v1")), g.compute.activeFunc.outputs.length > 0 && t.push(y("set_func_output_v1")), t.push(y("procedure_return_v1"))), pc() && t.push(y("call_func_internal_v1")), t;
|
|
10089
10128
|
}
|
|
10090
10129
|
const Ee = { name: "COMPUTE_FUNC_CATEGORY", callback: dc };
|
|
10091
10130
|
function hc() {
|
|
10092
10131
|
const t = [];
|
|
10093
10132
|
return t.push(
|
|
10094
|
-
|
|
10133
|
+
y("compute_debug_trace_v1", [Rt("OBJECT")])
|
|
10095
10134
|
), t;
|
|
10096
10135
|
}
|
|
10097
10136
|
const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
@@ -10830,13 +10869,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10830
10869
|
kind: "category",
|
|
10831
10870
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10832
10871
|
categorystyle: "variable_category",
|
|
10833
|
-
custom:
|
|
10872
|
+
custom: pt.name
|
|
10834
10873
|
},
|
|
10835
10874
|
{
|
|
10836
10875
|
kind: "category",
|
|
10837
10876
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10838
10877
|
categorystyle: "procedure_category",
|
|
10839
|
-
custom:
|
|
10878
|
+
custom: _t.name
|
|
10840
10879
|
},
|
|
10841
10880
|
{
|
|
10842
10881
|
kind: "category",
|
|
@@ -10889,13 +10928,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10889
10928
|
kind: "category",
|
|
10890
10929
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10891
10930
|
categorystyle: "variable_category",
|
|
10892
|
-
custom:
|
|
10931
|
+
custom: pt.name
|
|
10893
10932
|
},
|
|
10894
10933
|
{
|
|
10895
10934
|
kind: "category",
|
|
10896
10935
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10897
10936
|
categorystyle: "procedure_category",
|
|
10898
|
-
custom:
|
|
10937
|
+
custom: _t.name
|
|
10899
10938
|
}
|
|
10900
10939
|
]
|
|
10901
10940
|
}, Tc = {
|
|
@@ -10936,13 +10975,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10936
10975
|
kind: "category",
|
|
10937
10976
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10938
10977
|
categorystyle: "variable_category",
|
|
10939
|
-
custom:
|
|
10978
|
+
custom: pt.name
|
|
10940
10979
|
},
|
|
10941
10980
|
{
|
|
10942
10981
|
kind: "category",
|
|
10943
10982
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10944
10983
|
categorystyle: "procedure_category",
|
|
10945
|
-
custom:
|
|
10984
|
+
custom: _t.name
|
|
10946
10985
|
}
|
|
10947
10986
|
]
|
|
10948
10987
|
}, Ec = {
|
|
@@ -11009,13 +11048,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
11009
11048
|
kind: "category",
|
|
11010
11049
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
11011
11050
|
categorystyle: "variable_category",
|
|
11012
|
-
custom:
|
|
11051
|
+
custom: pt.name
|
|
11013
11052
|
},
|
|
11014
11053
|
{
|
|
11015
11054
|
kind: "category",
|
|
11016
11055
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
11017
11056
|
categorystyle: "procedure_category",
|
|
11018
|
-
custom:
|
|
11057
|
+
custom: _t.name
|
|
11019
11058
|
},
|
|
11020
11059
|
{
|
|
11021
11060
|
kind: "category",
|
|
@@ -11059,7 +11098,7 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
11059
11098
|
function Ac(t, e, n, o) {
|
|
11060
11099
|
He.theme = o ? "dark" : "light", He.toolbox = Ic(e, n);
|
|
11061
11100
|
const i = Vo(t, He);
|
|
11062
|
-
return i.addChangeListener(xo.shadowBlockConversionChangeListener), Oc(i, e, n),
|
|
11101
|
+
return i.addChangeListener(xo.shadowBlockConversionChangeListener), Oc(i, e, n), yc(i), i;
|
|
11063
11102
|
}
|
|
11064
11103
|
function Ic(t, e) {
|
|
11065
11104
|
let n;
|
|
@@ -11069,10 +11108,10 @@ function Oc(t, e, n) {
|
|
|
11069
11108
|
function o({ name: i, callback: a }) {
|
|
11070
11109
|
t.registerToolboxCategoryCallback(i, () => a(e));
|
|
11071
11110
|
}
|
|
11072
|
-
e === "page" ? n === "v1" && (o(po), o(de), o(he), o(
|
|
11111
|
+
e === "page" ? n === "v1" && (o(po), o(de), o(he), o(pt), o(_t), o(fe), o(pe)) : e === "comp" ? n === "v1" && (o(_o), o(de), o(he), o(pt), o(_t), o(fe), o(pe)) : e === "func" ? n === "v1" && (o(Ee), o(Te), o(me), o(ge), o(pt), o(_t)) : e === "flow" && n === "v1" && (o(Ee), o(Te), o(me), o(ge), o(pt), o(_t));
|
|
11073
11112
|
}
|
|
11074
|
-
function
|
|
11075
|
-
const { router: e } =
|
|
11113
|
+
function yc(t) {
|
|
11114
|
+
const { router: e } = kt;
|
|
11076
11115
|
t.registerButtonCallback("NO_COMPUTE", () => {
|
|
11077
11116
|
const n = e.resolve({
|
|
11078
11117
|
path: "/compute/" + Date.now()
|
|
@@ -11089,7 +11128,7 @@ function vc(t) {
|
|
|
11089
11128
|
}, 100);
|
|
11090
11129
|
});
|
|
11091
11130
|
}
|
|
11092
|
-
function
|
|
11131
|
+
function vc(t, e) {
|
|
11093
11132
|
const n = e.newBlock("json_root_v1");
|
|
11094
11133
|
n.initSvg(), n.render();
|
|
11095
11134
|
const o = (i, a) => {
|
|
@@ -11111,21 +11150,21 @@ function yc(t, e) {
|
|
|
11111
11150
|
else
|
|
11112
11151
|
return;
|
|
11113
11152
|
}
|
|
11114
|
-
const
|
|
11115
|
-
if (
|
|
11153
|
+
const r = e.newBlock(c);
|
|
11154
|
+
if (r.initSvg(), r.render(), a.connect(r.outputConnection), c === "json_map_v1") {
|
|
11116
11155
|
const l = [];
|
|
11117
11156
|
for (const _ in i)
|
|
11118
11157
|
l.push(_);
|
|
11119
|
-
|
|
11158
|
+
r.initData(l);
|
|
11120
11159
|
for (let _ = 0; _ < l.length; _++) {
|
|
11121
|
-
const d = l[_], h =
|
|
11160
|
+
const d = l[_], h = r.getInput("ENTRY" + _);
|
|
11122
11161
|
o(i[d], h.connection);
|
|
11123
11162
|
}
|
|
11124
11163
|
} else if (c === "json_array_v1") {
|
|
11125
|
-
|
|
11164
|
+
r.initData(i.length);
|
|
11126
11165
|
for (let l = 0; l < i.length; l++)
|
|
11127
|
-
o(i[l],
|
|
11128
|
-
} else c === "json_string_v1" || c === "json_number_v1" ?
|
|
11166
|
+
o(i[l], r.getInput("ENTRY" + l).connection);
|
|
11167
|
+
} else c === "json_string_v1" || c === "json_number_v1" ? r.setFieldValue(i, "VALUE") : c === "json_boolean_v1" && r.setFieldValue(i ? "true" : "false", "VALUE");
|
|
11129
11168
|
};
|
|
11130
11169
|
o(t, n.getInput("JSON").connection), I.fire(
|
|
11131
11170
|
new (I.get(I.FINISHED_LOADING))(e)
|
|
@@ -11163,7 +11202,7 @@ function Cc(t) {
|
|
|
11163
11202
|
if (o.type === "json_root_v1")
|
|
11164
11203
|
return e(o);
|
|
11165
11204
|
}
|
|
11166
|
-
const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */
|
|
11205
|
+
const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ rt({
|
|
11167
11206
|
__name: "index",
|
|
11168
11207
|
props: /* @__PURE__ */ je({
|
|
11169
11208
|
type: {},
|
|
@@ -11178,18 +11217,18 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11178
11217
|
}),
|
|
11179
11218
|
emits: /* @__PURE__ */ je(["ready"], ["update:lock", "update:scale"]),
|
|
11180
11219
|
setup(t, { expose: e, emit: n }) {
|
|
11181
|
-
const { backgroundColor2: o } =
|
|
11220
|
+
const { backgroundColor2: o } = Xt(), i = $t(t, "lock"), a = $t(t, "scale"), c = n, r = `blocklyEditor${Xe()}`, l = Bt(), _ = Kt("parentContainer"), d = Kt("clean"), h = Kt("navigator"), p = {};
|
|
11182
11221
|
Da(p);
|
|
11183
|
-
const m =
|
|
11222
|
+
const m = Bt(!0), A = Bt(!1), R = w(() => t.type === "json" ? "tree" : "list"), P = w(() => ({
|
|
11184
11223
|
width: "100%",
|
|
11185
11224
|
height: "calc(100% - 48px)"
|
|
11186
|
-
})),
|
|
11225
|
+
})), It = w(() => ({
|
|
11187
11226
|
position: "absolute",
|
|
11188
11227
|
background: o.value,
|
|
11189
11228
|
bottom: "0px",
|
|
11190
11229
|
width: "100%",
|
|
11191
11230
|
height: "48px"
|
|
11192
|
-
})), G =
|
|
11231
|
+
})), G = w(() => ({
|
|
11193
11232
|
position: "absolute",
|
|
11194
11233
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11195
11234
|
top: "1px",
|
|
@@ -11197,12 +11236,12 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11197
11236
|
width: "56px",
|
|
11198
11237
|
height: "calc(100% - 49px)",
|
|
11199
11238
|
zIndex: 999
|
|
11200
|
-
})),
|
|
11239
|
+
})), Nt = w(() => ({
|
|
11201
11240
|
position: "absolute",
|
|
11202
11241
|
top: "0px",
|
|
11203
11242
|
right: "0px",
|
|
11204
11243
|
zIndex: 20
|
|
11205
|
-
})), W =
|
|
11244
|
+
})), W = w(() => ({
|
|
11206
11245
|
position: "absolute",
|
|
11207
11246
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11208
11247
|
top: "0px",
|
|
@@ -11210,7 +11249,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11210
11249
|
width: "100%",
|
|
11211
11250
|
height: "calc(100% - 48px)",
|
|
11212
11251
|
pointerEvents: "none"
|
|
11213
|
-
})), _n =
|
|
11252
|
+
})), _n = w(() => ({
|
|
11214
11253
|
position: "absolute",
|
|
11215
11254
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11216
11255
|
top: "1px",
|
|
@@ -11218,7 +11257,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11218
11257
|
width: "56px",
|
|
11219
11258
|
height: "calc(100% - 49px)",
|
|
11220
11259
|
zIndex: 999
|
|
11221
|
-
})), fo =
|
|
11260
|
+
})), fo = w(() => ({
|
|
11222
11261
|
position: "fixed",
|
|
11223
11262
|
top: 0,
|
|
11224
11263
|
left: 0,
|
|
@@ -11230,10 +11269,10 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11230
11269
|
return;
|
|
11231
11270
|
}
|
|
11232
11271
|
Yo(_.value), await In(t.locale), p.workspace = Ac(l.value, t.type, t.version, t.dark), p.workspace.addChangeListener(I.disableOrphans), p.workspace.addChangeListener(mo);
|
|
11233
|
-
const N = document.querySelector(`#${
|
|
11272
|
+
const N = document.querySelector(`#${r} .blocklyFlyout`);
|
|
11234
11273
|
new MutationObserver((Ue) => {
|
|
11235
|
-
Ue.forEach((
|
|
11236
|
-
|
|
11274
|
+
Ue.forEach((Zt) => {
|
|
11275
|
+
Zt.type === "attributes" && Zt.attributeName === "style" && (Ut.value = p.workspace.getFlyout().isVisible());
|
|
11237
11276
|
});
|
|
11238
11277
|
}).observe(N, { attributes: !0 }), Ut.value = p.workspace.getFlyout().isVisible(), pn(), dn(), await ni(), c("ready");
|
|
11239
11278
|
}), An(() => {
|
|
@@ -11259,7 +11298,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11259
11298
|
}
|
|
11260
11299
|
}
|
|
11261
11300
|
const To = (N) => {
|
|
11262
|
-
m.value = !0, t.type === "json" ?
|
|
11301
|
+
m.value = !0, t.type === "json" ? vc(N, p.workspace) : $.workspaces.load(N, p.workspace);
|
|
11263
11302
|
}, Eo = () => t.type === "json" ? Cc(p.workspace) : $.workspaces.save(p.workspace), go = () => {
|
|
11264
11303
|
if (t.type === "json")
|
|
11265
11304
|
console.assert(!1);
|
|
@@ -11279,9 +11318,9 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11279
11318
|
h.value && (h.value.open = !0);
|
|
11280
11319
|
};
|
|
11281
11320
|
return gn(() => {
|
|
11282
|
-
|
|
11321
|
+
Lt.on("cleanWorkspace", hn), Lt.on("toggleBlocklyLock", fn), Lt.on("openBlocklyNavigator", mn);
|
|
11283
11322
|
}), An(() => {
|
|
11284
|
-
|
|
11323
|
+
Lt.off("cleanWorkspace", hn), Lt.off("toggleBlocklyLock", fn), Lt.off("openBlocklyNavigator", mn);
|
|
11285
11324
|
}), Vt(
|
|
11286
11325
|
() => t.locale,
|
|
11287
11326
|
(N) => {
|
|
@@ -11305,17 +11344,17 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11305
11344
|
generateCode: go,
|
|
11306
11345
|
generateReactivity: Ao,
|
|
11307
11346
|
fireStateChange: Io
|
|
11308
|
-
}), (N,
|
|
11309
|
-
const Ue = M("v-icon"),
|
|
11347
|
+
}), (N, Ot) => {
|
|
11348
|
+
const Ue = M("v-icon"), Zt = M("x-loading");
|
|
11310
11349
|
return S(), tt("div", kc, [
|
|
11311
|
-
|
|
11312
|
-
id:
|
|
11350
|
+
K("div", {
|
|
11351
|
+
id: r,
|
|
11313
11352
|
ref_key: "blocklyDiv",
|
|
11314
11353
|
ref: l,
|
|
11315
11354
|
style: j(P.value)
|
|
11316
11355
|
}, null, 4),
|
|
11317
|
-
|
|
11318
|
-
style: j(
|
|
11356
|
+
K("div", {
|
|
11357
|
+
style: j(It.value)
|
|
11319
11358
|
}, [
|
|
11320
11359
|
oi(N.$slots, "bottom")
|
|
11321
11360
|
], 4),
|
|
@@ -11328,11 +11367,11 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11328
11367
|
icon: "mdi-delete",
|
|
11329
11368
|
size: "x-large"
|
|
11330
11369
|
})
|
|
11331
|
-
], 4)) :
|
|
11332
|
-
m.value ?
|
|
11370
|
+
], 4)) : ut("", !0),
|
|
11371
|
+
m.value ? ut("", !0) : (S(), tt("div", {
|
|
11333
11372
|
key: 1,
|
|
11334
11373
|
class: "d-flex align-end ga-3 pt-3 pr-3",
|
|
11335
|
-
style: j(
|
|
11374
|
+
style: j(Nt.value)
|
|
11336
11375
|
}, [
|
|
11337
11376
|
L(Ma, {
|
|
11338
11377
|
ref_key: "clean",
|
|
@@ -11341,7 +11380,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11341
11380
|
}, null, 8, ["lock"]),
|
|
11342
11381
|
L(Ua, {
|
|
11343
11382
|
modelValue: i.value,
|
|
11344
|
-
"onUpdate:modelValue":
|
|
11383
|
+
"onUpdate:modelValue": Ot[0] || (Ot[0] = (Oo) => i.value = Oo)
|
|
11345
11384
|
}, null, 8, ["modelValue"]),
|
|
11346
11385
|
L(ja, {
|
|
11347
11386
|
ref_key: "navigator",
|
|
@@ -11353,24 +11392,24 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11353
11392
|
i.value ? (S(), tt("div", {
|
|
11354
11393
|
key: 2,
|
|
11355
11394
|
style: j(_n.value)
|
|
11356
|
-
}, null, 4)) :
|
|
11395
|
+
}, null, 4)) : ut("", !0),
|
|
11357
11396
|
i.value ? (S(), tt("div", {
|
|
11358
11397
|
key: 3,
|
|
11359
11398
|
style: j(W.value)
|
|
11360
|
-
}, null, 4)) :
|
|
11361
|
-
|
|
11399
|
+
}, null, 4)) : ut("", !0),
|
|
11400
|
+
K("div", {
|
|
11362
11401
|
ref_key: "parentContainer",
|
|
11363
11402
|
ref: _,
|
|
11364
11403
|
style: j(fo.value)
|
|
11365
11404
|
}, null, 4),
|
|
11366
|
-
L(
|
|
11405
|
+
L(Zt, {
|
|
11367
11406
|
open: m.value,
|
|
11368
11407
|
"z-index": 99
|
|
11369
11408
|
}, null, 8, ["open"])
|
|
11370
11409
|
]);
|
|
11371
11410
|
};
|
|
11372
11411
|
}
|
|
11373
|
-
}), Lc = /* @__PURE__ */
|
|
11412
|
+
}), Lc = /* @__PURE__ */ rt({
|
|
11374
11413
|
__name: "index",
|
|
11375
11414
|
props: {
|
|
11376
11415
|
code: {}
|
|
@@ -11378,7 +11417,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11378
11417
|
setup(t) {
|
|
11379
11418
|
const e = t;
|
|
11380
11419
|
Ko.registerLanguage("javascript", $o);
|
|
11381
|
-
const n = Ho.component, { backgroundColor2: o } =
|
|
11420
|
+
const n = Ho.component, { backgroundColor2: o } = Xt();
|
|
11382
11421
|
return (i, a) => {
|
|
11383
11422
|
const c = M("v-sheet");
|
|
11384
11423
|
return S(), st(c, {
|
|
@@ -11396,18 +11435,18 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11396
11435
|
}, 8, ["color"]);
|
|
11397
11436
|
};
|
|
11398
11437
|
}
|
|
11399
|
-
}), Sc = { class: "text-subtitle-1" }, Bc = { class: "w-100 h-100 overflow-auto" }, bc = /* @__PURE__ */
|
|
11438
|
+
}), Sc = { class: "text-subtitle-1" }, Bc = { class: "w-100 h-100 overflow-auto" }, bc = /* @__PURE__ */ rt({
|
|
11400
11439
|
__name: "index",
|
|
11401
11440
|
setup(t) {
|
|
11402
|
-
const { t: e } =
|
|
11441
|
+
const { t: e } = Jt(), { sysBarAvail: n } = Yn(), { backgroundColor0: o, backgroundColor2: i } = Xt(), a = Bt(""), c = w(() => {
|
|
11403
11442
|
let _ = 48;
|
|
11404
11443
|
return n.value && (_ += 24), {
|
|
11405
11444
|
position: "relative",
|
|
11406
11445
|
height: `calc(100% - ${_}px)`
|
|
11407
11446
|
};
|
|
11408
|
-
}),
|
|
11447
|
+
}), r = (_) => {
|
|
11409
11448
|
a.value = _.code;
|
|
11410
|
-
}, { open: l } = nn("sourceDlg",
|
|
11449
|
+
}, { open: l } = nn("sourceDlg", r);
|
|
11411
11450
|
return (_, d) => {
|
|
11412
11451
|
const h = M("v-sheet"), p = M("v-btn"), m = M("v-spacer"), A = M("v-dialog");
|
|
11413
11452
|
return S(), st(A, {
|
|
@@ -11417,7 +11456,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11417
11456
|
"no-click-animation": "",
|
|
11418
11457
|
persistent: "",
|
|
11419
11458
|
transition: "dialog-bottom-transition",
|
|
11420
|
-
onKeydown: d[2] || (d[2] = $n(
|
|
11459
|
+
onKeydown: d[2] || (d[2] = $n(wt((R) => l.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
11421
11460
|
}, {
|
|
11422
11461
|
default: at(() => [
|
|
11423
11462
|
L(h, {
|
|
@@ -11430,7 +11469,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11430
11469
|
key: 0,
|
|
11431
11470
|
color: D(i),
|
|
11432
11471
|
height: 24
|
|
11433
|
-
}, null, 8, ["color"])) :
|
|
11472
|
+
}, null, 8, ["color"])) : ut("", !0),
|
|
11434
11473
|
L(h, {
|
|
11435
11474
|
class: "d-flex align-center px-2",
|
|
11436
11475
|
color: D(i),
|
|
@@ -11443,15 +11482,15 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11443
11482
|
variant: "text",
|
|
11444
11483
|
onClick: d[0] || (d[0] = (R) => l.value = !1)
|
|
11445
11484
|
}),
|
|
11446
|
-
|
|
11485
|
+
K("span", Sc, Ht(D(e)("x-block-lib.dlg.source.title")), 1),
|
|
11447
11486
|
L(m)
|
|
11448
11487
|
]),
|
|
11449
11488
|
_: 1
|
|
11450
11489
|
}, 8, ["color"]),
|
|
11451
|
-
|
|
11490
|
+
K("div", {
|
|
11452
11491
|
style: j(c.value)
|
|
11453
11492
|
}, [
|
|
11454
|
-
|
|
11493
|
+
K("div", Bc, [
|
|
11455
11494
|
L(Lc, { code: a.value }, null, 8, ["code"])
|
|
11456
11495
|
])
|
|
11457
11496
|
], 4)
|