x-block-lib 0.8.35 → 0.8.36
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,10 @@ 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
|
-
${c}${
|
|
1976
|
+
${c}${r}}
|
|
1942
1977
|
`;
|
|
1943
1978
|
} else
|
|
1944
1979
|
return `__callMethodV1__(${n(o.method.id)}, ${i}, ${a});
|
|
@@ -2009,7 +2044,7 @@ const Fi = {
|
|
|
2009
2044
|
const { key: o, name: i } = this.method.inputs[n];
|
|
2010
2045
|
e.push(["INPUT" + n, `__input$${o}__`, i, t]);
|
|
2011
2046
|
}
|
|
2012
|
-
|
|
2047
|
+
F(this, e);
|
|
2013
2048
|
},
|
|
2014
2049
|
checkWarning_: function() {
|
|
2015
2050
|
const t = Dt(this.method.id);
|
|
@@ -2128,13 +2163,13 @@ const wi = {
|
|
|
2128
2163
|
t.connection.setShadowDom(null);
|
|
2129
2164
|
const e = t.connection.targetBlock();
|
|
2130
2165
|
e && !e.isShadow() && e.dispose();
|
|
2131
|
-
const n =
|
|
2166
|
+
const n = gt(this.output.type);
|
|
2132
2167
|
t.setCheck(n);
|
|
2133
2168
|
},
|
|
2134
2169
|
updateShadows_: function() {
|
|
2135
2170
|
if (this.isInsertionMarker())
|
|
2136
2171
|
return;
|
|
2137
|
-
const t =
|
|
2172
|
+
const t = At(this.output.type);
|
|
2138
2173
|
this.getInput("VALUE").connection.setShadowDom(t);
|
|
2139
2174
|
},
|
|
2140
2175
|
checkWarning_: function() {
|
|
@@ -2148,7 +2183,10 @@ const wi = {
|
|
|
2148
2183
|
return;
|
|
2149
2184
|
}
|
|
2150
2185
|
t.names !== this.method.names && (this.method.names = t.names);
|
|
2151
|
-
const e = Ke(
|
|
2186
|
+
const e = Ke(
|
|
2187
|
+
this.method.id,
|
|
2188
|
+
this.output.key
|
|
2189
|
+
);
|
|
2152
2190
|
if (!e) {
|
|
2153
2191
|
this.setWarningText(f("WARN_OUTPUT_NOT_FOUND"));
|
|
2154
2192
|
return;
|
|
@@ -2163,7 +2201,7 @@ const wi = {
|
|
|
2163
2201
|
E.set_app_method_output_v1 = wi;
|
|
2164
2202
|
s.forBlock.set_app_method_output_v1 = function(t) {
|
|
2165
2203
|
const e = s.quote_, n = t;
|
|
2166
|
-
let o = s.valueToCode(n, "VALUE",
|
|
2204
|
+
let o = s.valueToCode(n, "VALUE", u.ATOMIC);
|
|
2167
2205
|
if (o === void 0)
|
|
2168
2206
|
switch (n.output.type) {
|
|
2169
2207
|
case "string":
|
|
@@ -2208,7 +2246,7 @@ T([
|
|
|
2208
2246
|
}
|
|
2209
2247
|
]);
|
|
2210
2248
|
s.forBlock.app_env_is_v1 = function(t) {
|
|
2211
|
-
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`,
|
|
2249
|
+
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`, u.ATOMIC];
|
|
2212
2250
|
};
|
|
2213
2251
|
const Ki = {
|
|
2214
2252
|
init: function() {
|
|
@@ -2248,7 +2286,7 @@ const Ki = {
|
|
|
2248
2286
|
}, 0);
|
|
2249
2287
|
},
|
|
2250
2288
|
genAppOpts_: function() {
|
|
2251
|
-
return
|
|
2289
|
+
return vi();
|
|
2252
2290
|
},
|
|
2253
2291
|
genPageOpts_: function() {
|
|
2254
2292
|
return Ci(this.app.id);
|
|
@@ -2264,7 +2302,7 @@ const Ki = {
|
|
|
2264
2302
|
}
|
|
2265
2303
|
},
|
|
2266
2304
|
onAppChange_: function(t) {
|
|
2267
|
-
const e =
|
|
2305
|
+
const e = vn(t);
|
|
2268
2306
|
if (!e) {
|
|
2269
2307
|
console.assert(!1);
|
|
2270
2308
|
return;
|
|
@@ -2282,7 +2320,7 @@ const Ki = {
|
|
|
2282
2320
|
e ? (this.page.id = e.id, this.page.name = e.name) : (this.page.id = "", this.page.name = "");
|
|
2283
2321
|
},
|
|
2284
2322
|
checkWarning_: function() {
|
|
2285
|
-
const t =
|
|
2323
|
+
const t = vn(this.app.id);
|
|
2286
2324
|
if (!t) {
|
|
2287
2325
|
this.setWarningText(f("WARN_APP_NOT_FOUND"));
|
|
2288
2326
|
return;
|
|
@@ -2365,7 +2403,7 @@ const $i = {
|
|
|
2365
2403
|
E.select_comp_v1 = $i;
|
|
2366
2404
|
s.forBlock.select_comp_v1 = function(t) {
|
|
2367
2405
|
const e = s.quote_, o = t.comp.id ?? "";
|
|
2368
|
-
return [e(o),
|
|
2406
|
+
return [e(o), u.ATOMIC];
|
|
2369
2407
|
};
|
|
2370
2408
|
const Hi = {
|
|
2371
2409
|
init: function() {
|
|
@@ -2385,13 +2423,13 @@ const Hi = {
|
|
|
2385
2423
|
initData_: function() {
|
|
2386
2424
|
if (this.node.id)
|
|
2387
2425
|
return;
|
|
2388
|
-
const t =
|
|
2426
|
+
const t = qt("getProperty")?.[0];
|
|
2389
2427
|
if (!t)
|
|
2390
2428
|
return;
|
|
2391
2429
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
2392
2430
|
const e = this.getField("NODE");
|
|
2393
2431
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
2394
|
-
const n =
|
|
2432
|
+
const n = Gt(this.node.id, "read")?.[0];
|
|
2395
2433
|
if (!n)
|
|
2396
2434
|
return;
|
|
2397
2435
|
this.property.id = n.id, this.property.kind = n.kind, this.property.names = n.names;
|
|
@@ -2426,7 +2464,7 @@ const Hi = {
|
|
|
2426
2464
|
}
|
|
2427
2465
|
},
|
|
2428
2466
|
onNodeChange_: function(t) {
|
|
2429
|
-
const e =
|
|
2467
|
+
const e = mt(t);
|
|
2430
2468
|
if (!e) {
|
|
2431
2469
|
console.assert(!1);
|
|
2432
2470
|
return;
|
|
@@ -2435,7 +2473,7 @@ const Hi = {
|
|
|
2435
2473
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
2436
2474
|
const o = this.getField("PROPERTY");
|
|
2437
2475
|
if (o.getOptions(!1), n || !vt(this.property.id)) {
|
|
2438
|
-
const i =
|
|
2476
|
+
const i = Gt(this.node.id, "read")?.[0];
|
|
2439
2477
|
o.setValue(i?.id ?? "");
|
|
2440
2478
|
}
|
|
2441
2479
|
this.onPropChange_(o.getValue());
|
|
@@ -2445,7 +2483,7 @@ const Hi = {
|
|
|
2445
2483
|
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
2484
|
},
|
|
2447
2485
|
checkWarning_: function() {
|
|
2448
|
-
const t =
|
|
2486
|
+
const t = mt(this.node.id);
|
|
2449
2487
|
if (!t) {
|
|
2450
2488
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
2451
2489
|
return;
|
|
@@ -2470,7 +2508,7 @@ const Hi = {
|
|
|
2470
2508
|
E.get_app_property_v1 = Hi;
|
|
2471
2509
|
s.forBlock.get_app_property_v1 = function(t) {
|
|
2472
2510
|
const e = s.quote_;
|
|
2473
|
-
return [`__getPropertyV1__(${e(t.property.id)}, ${e("")})`,
|
|
2511
|
+
return [`__getPropertyV1__(${e(t.property.id)}, ${e("")})`, u.ATOMIC];
|
|
2474
2512
|
};
|
|
2475
2513
|
const Gi = {
|
|
2476
2514
|
init: function() {
|
|
@@ -2490,13 +2528,13 @@ const Gi = {
|
|
|
2490
2528
|
initData_: function() {
|
|
2491
2529
|
if (this.node.id)
|
|
2492
2530
|
return;
|
|
2493
|
-
const t =
|
|
2531
|
+
const t = qt("setProperty")?.[0];
|
|
2494
2532
|
if (!t)
|
|
2495
2533
|
return;
|
|
2496
2534
|
this.node.id = t.id, this.node.key = t.key, this.node.alias = t.alias;
|
|
2497
2535
|
const e = this.getField("NODE");
|
|
2498
2536
|
e.getOptions(!1), e.setValue(this.node.id);
|
|
2499
|
-
const n =
|
|
2537
|
+
const n = Gt(this.node.id, "write")?.[0];
|
|
2500
2538
|
if (!n)
|
|
2501
2539
|
return;
|
|
2502
2540
|
this.property.id = n.id, this.property.kind = n.kind, this.property.names = n.names;
|
|
@@ -2531,7 +2569,7 @@ const Gi = {
|
|
|
2531
2569
|
}
|
|
2532
2570
|
},
|
|
2533
2571
|
onNodeChange_: function(t) {
|
|
2534
|
-
const e =
|
|
2572
|
+
const e = mt(t);
|
|
2535
2573
|
if (!e) {
|
|
2536
2574
|
console.assert(!1);
|
|
2537
2575
|
return;
|
|
@@ -2540,7 +2578,7 @@ const Gi = {
|
|
|
2540
2578
|
this.node.id = e.id, this.node.key = e.key, this.node.alias = e.alias;
|
|
2541
2579
|
const o = this.getField("PROPERTY");
|
|
2542
2580
|
if (o.getOptions(!1), n || !vt(this.property.id)) {
|
|
2543
|
-
const i =
|
|
2581
|
+
const i = Gt(this.node.id, "write")?.[0];
|
|
2544
2582
|
o.setValue(i?.id ?? "");
|
|
2545
2583
|
}
|
|
2546
2584
|
this.onPropChange_(o.getValue());
|
|
@@ -2561,12 +2599,12 @@ const Gi = {
|
|
|
2561
2599
|
const n = ci(t.meta.raw), o = hi(t.meta.raw);
|
|
2562
2600
|
this.getInput("VALUE").setCheck(n).setShadowDom(o);
|
|
2563
2601
|
} else {
|
|
2564
|
-
const n =
|
|
2602
|
+
const n = gt(t.meta.raw.type), o = At(t.meta.raw.type);
|
|
2565
2603
|
this.getInput("VALUE").setCheck(n).setShadowDom(o);
|
|
2566
2604
|
}
|
|
2567
2605
|
},
|
|
2568
2606
|
checkWarning_: function() {
|
|
2569
|
-
const t =
|
|
2607
|
+
const t = mt(this.node.id);
|
|
2570
2608
|
if (!t) {
|
|
2571
2609
|
this.setWarningText(f("WARN_NODE_NOT_FOUND"));
|
|
2572
2610
|
return;
|
|
@@ -2590,7 +2628,7 @@ const Gi = {
|
|
|
2590
2628
|
};
|
|
2591
2629
|
E.set_app_property_v1 = Gi;
|
|
2592
2630
|
s.forBlock.set_app_property_v1 = function(t) {
|
|
2593
|
-
const e = s.quote_, n = t, o = "", i = s.valueToCode(n, "VALUE",
|
|
2631
|
+
const e = s.quote_, n = t, o = "", i = s.valueToCode(n, "VALUE", u.NONE);
|
|
2594
2632
|
return `__setPropertyV1__(${e(n.property.id)}, ${e(o)}, ${i});
|
|
2595
2633
|
`;
|
|
2596
2634
|
};
|
|
@@ -2656,7 +2694,7 @@ const Wi = {
|
|
|
2656
2694
|
E.get_app_state_v1 = Wi;
|
|
2657
2695
|
s.forBlock.get_app_state_v1 = function(t) {
|
|
2658
2696
|
const e = s.quote_;
|
|
2659
|
-
return [`__getStateV1__(${e(t.state.id)})`,
|
|
2697
|
+
return [`__getStateV1__(${e(t.state.id)})`, u.ATOMIC];
|
|
2660
2698
|
};
|
|
2661
2699
|
const ji = {
|
|
2662
2700
|
init: function() {
|
|
@@ -2706,7 +2744,7 @@ const ji = {
|
|
|
2706
2744
|
this.getInput("VALUE").setShadowDom(null);
|
|
2707
2745
|
const t = this.getInput("VALUE").connection.targetBlock();
|
|
2708
2746
|
t && t.dispose();
|
|
2709
|
-
const e =
|
|
2747
|
+
const e = gt(this.state.type), n = At(this.state.type);
|
|
2710
2748
|
this.getInput("VALUE").setCheck(e).setShadowDom(n);
|
|
2711
2749
|
},
|
|
2712
2750
|
checkWarning_: function() {
|
|
@@ -2724,7 +2762,7 @@ const ji = {
|
|
|
2724
2762
|
};
|
|
2725
2763
|
E.set_app_state_v1 = ji;
|
|
2726
2764
|
s.forBlock.set_app_state_v1 = function(t) {
|
|
2727
|
-
const e = s.quote_, n = t, o = s.valueToCode(n, "VALUE",
|
|
2765
|
+
const e = s.quote_, n = t, o = s.valueToCode(n, "VALUE", u.NONE);
|
|
2728
2766
|
return `__setStateV1__(${e(n.state.id)}, ${o});
|
|
2729
2767
|
`;
|
|
2730
2768
|
};
|
|
@@ -2759,7 +2797,7 @@ T([
|
|
|
2759
2797
|
}
|
|
2760
2798
|
]);
|
|
2761
2799
|
s.forBlock.color_blend_v1 = function(t) {
|
|
2762
|
-
const e = s.valueToCode(t, "COLOR1",
|
|
2800
|
+
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
2801
|
return [`${s.provideFunction_(
|
|
2764
2802
|
"colorBlend",
|
|
2765
2803
|
`
|
|
@@ -2780,7 +2818,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
|
|
|
2780
2818
|
return '#' + r + g + b;
|
|
2781
2819
|
}
|
|
2782
2820
|
`
|
|
2783
|
-
)}(${e}, ${n}, ${o})`,
|
|
2821
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
2784
2822
|
};
|
|
2785
2823
|
T([
|
|
2786
2824
|
{
|
|
@@ -3361,7 +3399,7 @@ T([
|
|
|
3361
3399
|
}
|
|
3362
3400
|
]);
|
|
3363
3401
|
s.forBlock.color_picker_v1 = function(t) {
|
|
3364
|
-
return [s.quote_(t.getFieldValue("COLOR")),
|
|
3402
|
+
return [s.quote_(t.getFieldValue("COLOR")), u.ATOMIC];
|
|
3365
3403
|
};
|
|
3366
3404
|
T([
|
|
3367
3405
|
{
|
|
@@ -3382,7 +3420,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
|
3382
3420
|
return '#' + ('00000' + num.toString(16)).substr(-6);
|
|
3383
3421
|
}
|
|
3384
3422
|
`
|
|
3385
|
-
)}()`,
|
|
3423
|
+
)}()`, u.FUNCTION_CALL];
|
|
3386
3424
|
};
|
|
3387
3425
|
T([
|
|
3388
3426
|
{
|
|
@@ -3415,7 +3453,7 @@ T([
|
|
|
3415
3453
|
}
|
|
3416
3454
|
]);
|
|
3417
3455
|
s.forBlock.color_rgb_v1 = function(t) {
|
|
3418
|
-
const e = s.valueToCode(t, "RED",
|
|
3456
|
+
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
3457
|
return [`${s.provideFunction_(
|
|
3420
3458
|
"colorRgb",
|
|
3421
3459
|
`
|
|
@@ -3429,7 +3467,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
3429
3467
|
return '#' + r + g + b;
|
|
3430
3468
|
}
|
|
3431
3469
|
`
|
|
3432
|
-
)}(${e}, ${n}, ${o})`,
|
|
3470
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
3433
3471
|
};
|
|
3434
3472
|
const Xi = C.xml, Ji = [
|
|
3435
3473
|
{
|
|
@@ -3550,7 +3588,7 @@ const Qi = {
|
|
|
3550
3588
|
},
|
|
3551
3589
|
updateShape_: function() {
|
|
3552
3590
|
if (this.locale) {
|
|
3553
|
-
const { i18n: t } =
|
|
3591
|
+
const { i18n: t } = kt;
|
|
3554
3592
|
this.setFieldValue(t.global.t(this.name), "LABEL");
|
|
3555
3593
|
} else
|
|
3556
3594
|
this.setFieldValue(this.name, "LABEL");
|
|
@@ -3558,7 +3596,7 @@ const Qi = {
|
|
|
3558
3596
|
};
|
|
3559
3597
|
E.parameter_v1 = Qi;
|
|
3560
3598
|
s.forBlock.parameter_v1 = function(t) {
|
|
3561
|
-
return [t.key,
|
|
3599
|
+
return [t.key, u.ATOMIC];
|
|
3562
3600
|
};
|
|
3563
3601
|
const zi = {
|
|
3564
3602
|
init: function() {
|
|
@@ -3569,18 +3607,18 @@ s.forBlock.on_flow_state_event_v1 = function() {
|
|
|
3569
3607
|
return `__onFlowStateEventV1__();
|
|
3570
3608
|
`;
|
|
3571
3609
|
};
|
|
3572
|
-
function
|
|
3610
|
+
function Wt(t) {
|
|
3573
3611
|
const e = g.compute.spaces.find((n) => n.id === t);
|
|
3574
3612
|
return e ? e.funcs : [];
|
|
3575
3613
|
}
|
|
3576
|
-
function
|
|
3614
|
+
function Pt(t, e) {
|
|
3577
3615
|
const n = g.compute.spaces.find((o) => o.id === t);
|
|
3578
3616
|
if (n)
|
|
3579
3617
|
return n.funcs.find((o) => o.id === e);
|
|
3580
3618
|
}
|
|
3581
3619
|
function no(t) {
|
|
3582
3620
|
const e = [];
|
|
3583
|
-
return
|
|
3621
|
+
return Wt(t).forEach(({ id: o, name: i }) => {
|
|
3584
3622
|
e.push([i, o]);
|
|
3585
3623
|
}), k(e);
|
|
3586
3624
|
}
|
|
@@ -3597,7 +3635,7 @@ function Zi() {
|
|
|
3597
3635
|
t.push([o, n]);
|
|
3598
3636
|
}), k(t);
|
|
3599
3637
|
}
|
|
3600
|
-
function
|
|
3638
|
+
function Qt(t) {
|
|
3601
3639
|
const e = [];
|
|
3602
3640
|
return g.compute.spaces.forEach((n) => {
|
|
3603
3641
|
t === "func" && n.funcs.length > 0 && e.push(n), t === "flow" && n.flows.length > 0 && e.push(n);
|
|
@@ -3608,7 +3646,7 @@ function le(t) {
|
|
|
3608
3646
|
}
|
|
3609
3647
|
function oo(t) {
|
|
3610
3648
|
const e = [];
|
|
3611
|
-
return
|
|
3649
|
+
return Qt(t).forEach(({ id: o, name: i }) => {
|
|
3612
3650
|
e.push([i, o]);
|
|
3613
3651
|
}), k(e);
|
|
3614
3652
|
}
|
|
@@ -3630,13 +3668,13 @@ const ts = {
|
|
|
3630
3668
|
initData_: function() {
|
|
3631
3669
|
if (this.space.id)
|
|
3632
3670
|
return;
|
|
3633
|
-
const t =
|
|
3671
|
+
const t = Qt("func")?.[0];
|
|
3634
3672
|
if (!t)
|
|
3635
3673
|
return;
|
|
3636
3674
|
this.space.id = t.id, this.space.name = t.name;
|
|
3637
3675
|
const e = this.getField("SPACE");
|
|
3638
3676
|
e.getOptions(!1), e.setValue(this.space.id);
|
|
3639
|
-
const n =
|
|
3677
|
+
const n = Wt(this.space.id)?.[0];
|
|
3640
3678
|
if (!n)
|
|
3641
3679
|
return;
|
|
3642
3680
|
this.func.id = n.id, this.func.name = n.name, this.func.inputs = n.inputs, this.func.outputs = n.outputs;
|
|
@@ -3677,13 +3715,13 @@ const ts = {
|
|
|
3677
3715
|
return;
|
|
3678
3716
|
}
|
|
3679
3717
|
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 =
|
|
3718
|
+
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)) {
|
|
3719
|
+
const i = Wt(this.space.id)?.[0];
|
|
3682
3720
|
this.setFieldValue(i?.id ?? "", "FUNC");
|
|
3683
3721
|
}
|
|
3684
3722
|
},
|
|
3685
3723
|
onFuncChange_: function(t) {
|
|
3686
|
-
const e =
|
|
3724
|
+
const e = Pt(this.space.id, t);
|
|
3687
3725
|
if (!e) {
|
|
3688
3726
|
console.assert(!1);
|
|
3689
3727
|
return;
|
|
@@ -3710,19 +3748,19 @@ const ts = {
|
|
|
3710
3748
|
}
|
|
3711
3749
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3712
3750
|
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(
|
|
3751
|
+
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
3752
|
}
|
|
3715
3753
|
},
|
|
3716
3754
|
updateCheck_: function() {
|
|
3717
3755
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3718
|
-
const { type: e } = this.func.inputs[t], n =
|
|
3756
|
+
const { type: e } = this.func.inputs[t], n = gt(e);
|
|
3719
3757
|
this.getInput("INPUT" + t).connection.setCheck(n);
|
|
3720
3758
|
}
|
|
3721
3759
|
},
|
|
3722
3760
|
updateShadow_: function() {
|
|
3723
3761
|
if (!this.isInsertionMarker())
|
|
3724
3762
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3725
|
-
const e = this.func.inputs[t], n =
|
|
3763
|
+
const e = this.func.inputs[t], n = At(e.type);
|
|
3726
3764
|
this.getInput("INPUT" + t).setShadowDom(n);
|
|
3727
3765
|
}
|
|
3728
3766
|
},
|
|
@@ -3734,7 +3772,7 @@ const ts = {
|
|
|
3734
3772
|
const { id: n, name: o } = this.func.outputs[e];
|
|
3735
3773
|
t.push(["OUTPUT" + e, `__output$${n}__`, o, !1]);
|
|
3736
3774
|
}
|
|
3737
|
-
|
|
3775
|
+
F(this, t);
|
|
3738
3776
|
},
|
|
3739
3777
|
checkWarning_: function() {
|
|
3740
3778
|
const t = le(this.space.id);
|
|
@@ -3743,7 +3781,7 @@ const ts = {
|
|
|
3743
3781
|
return;
|
|
3744
3782
|
}
|
|
3745
3783
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3746
|
-
const e =
|
|
3784
|
+
const e = Pt(this.space.id, this.func.id);
|
|
3747
3785
|
if (!e) {
|
|
3748
3786
|
this.setWarningText(f("WARN_FUNC_NOT_FOUND"));
|
|
3749
3787
|
return;
|
|
@@ -3768,12 +3806,12 @@ s.forBlock.call_func_v1 = function(t) {
|
|
|
3768
3806
|
const m = s.valueToCode(
|
|
3769
3807
|
o,
|
|
3770
3808
|
"INPUT" + p,
|
|
3771
|
-
|
|
3809
|
+
u.ATOMIC
|
|
3772
3810
|
);
|
|
3773
3811
|
c += `${e}${e}${n(h)}: ${m},
|
|
3774
3812
|
`;
|
|
3775
3813
|
}), c += `${e}};`;
|
|
3776
|
-
const
|
|
3814
|
+
const r = n(o.space.name + "/" + o.func.name);
|
|
3777
3815
|
let l = "";
|
|
3778
3816
|
o.func.outputs.forEach(({ id: h }) => {
|
|
3779
3817
|
l += `${e}var __output${h}__ = __result__[${n(h)}];
|
|
@@ -3782,7 +3820,7 @@ s.forBlock.call_func_v1 = function(t) {
|
|
|
3782
3820
|
const _ = s.statementToCode(o, "CALLBACK");
|
|
3783
3821
|
return `{
|
|
3784
3822
|
${c}
|
|
3785
|
-
${e}var __result__ = __callFuncV1__(${i},${a},__inputs__,__getEnvV1__(),${
|
|
3823
|
+
${e}var __result__ = __callFuncV1__(${i},${a},__inputs__,__getEnvV1__(),${r});
|
|
3786
3824
|
${l}${_}}
|
|
3787
3825
|
`;
|
|
3788
3826
|
};
|
|
@@ -3804,13 +3842,13 @@ const es = {
|
|
|
3804
3842
|
initData_: function() {
|
|
3805
3843
|
if (this.space.id)
|
|
3806
3844
|
return;
|
|
3807
|
-
const t =
|
|
3845
|
+
const t = Qt("func")?.[0];
|
|
3808
3846
|
if (!t)
|
|
3809
3847
|
return;
|
|
3810
3848
|
this.space.id = t.id, this.space.name = t.name;
|
|
3811
3849
|
const e = this.getField("SPACE");
|
|
3812
3850
|
e.getOptions(!1), e.setValue(this.space.id);
|
|
3813
|
-
const n =
|
|
3851
|
+
const n = Wt(this.space.id)?.[0];
|
|
3814
3852
|
if (!n)
|
|
3815
3853
|
return;
|
|
3816
3854
|
this.func.id = n.id, this.func.name = n.name, this.func.inputs = n.inputs, this.func.outputs = n.outputs;
|
|
@@ -3851,13 +3889,13 @@ const es = {
|
|
|
3851
3889
|
return;
|
|
3852
3890
|
}
|
|
3853
3891
|
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 =
|
|
3892
|
+
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)) {
|
|
3893
|
+
const i = Wt(this.space.id)?.[0];
|
|
3856
3894
|
i ? this.setFieldValue(i.id, "FUNC") : this.setFieldValue("", "FUNC");
|
|
3857
3895
|
}
|
|
3858
3896
|
},
|
|
3859
3897
|
onFuncChange_: function(t) {
|
|
3860
|
-
const e =
|
|
3898
|
+
const e = Pt(this.space.id, t);
|
|
3861
3899
|
if (!e) {
|
|
3862
3900
|
console.assert(!1);
|
|
3863
3901
|
return;
|
|
@@ -3884,19 +3922,19 @@ const es = {
|
|
|
3884
3922
|
}
|
|
3885
3923
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3886
3924
|
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(
|
|
3925
|
+
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
3926
|
}
|
|
3889
3927
|
},
|
|
3890
3928
|
updateCheck_: function() {
|
|
3891
3929
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3892
|
-
const { type: e } = this.func.inputs[t], n =
|
|
3930
|
+
const { type: e } = this.func.inputs[t], n = gt(e);
|
|
3893
3931
|
this.getInput("INPUT" + t).connection.setCheck(n);
|
|
3894
3932
|
}
|
|
3895
3933
|
},
|
|
3896
3934
|
updateShadow_: function() {
|
|
3897
3935
|
if (!this.isInsertionMarker())
|
|
3898
3936
|
for (let t = 0; t < this.func.inputs.length; t++) {
|
|
3899
|
-
const e = this.func.inputs[t], n =
|
|
3937
|
+
const e = this.func.inputs[t], n = At(e.type);
|
|
3900
3938
|
this.getInput("INPUT" + t).setShadowDom(n);
|
|
3901
3939
|
}
|
|
3902
3940
|
},
|
|
@@ -3908,7 +3946,7 @@ const es = {
|
|
|
3908
3946
|
const { id: n, name: o } = this.func.outputs[e];
|
|
3909
3947
|
t.push(["OUTPUT" + e, `__output$${n}__`, o, !1]);
|
|
3910
3948
|
}
|
|
3911
|
-
|
|
3949
|
+
F(this, t);
|
|
3912
3950
|
},
|
|
3913
3951
|
checkWarning_: function() {
|
|
3914
3952
|
const t = le(this.space.id);
|
|
@@ -3917,7 +3955,7 @@ const es = {
|
|
|
3917
3955
|
return;
|
|
3918
3956
|
}
|
|
3919
3957
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
3920
|
-
const e =
|
|
3958
|
+
const e = Pt(this.space.id, this.func.id);
|
|
3921
3959
|
if (!e) {
|
|
3922
3960
|
this.setWarningText(f("WARN_FUNC_NOT_FOUND"));
|
|
3923
3961
|
return;
|
|
@@ -3942,12 +3980,12 @@ s.forBlock.call_func_internal_v1 = function(t) {
|
|
|
3942
3980
|
const m = s.valueToCode(
|
|
3943
3981
|
o,
|
|
3944
3982
|
"INPUT" + p,
|
|
3945
|
-
|
|
3983
|
+
u.ATOMIC
|
|
3946
3984
|
);
|
|
3947
3985
|
c += `${e}${e}${n(h)}: ${m},
|
|
3948
3986
|
`;
|
|
3949
3987
|
}), c += `${e}};`;
|
|
3950
|
-
const
|
|
3988
|
+
const r = o.space.name + "/" + o.func.name;
|
|
3951
3989
|
let l = "";
|
|
3952
3990
|
o.func.outputs.forEach(({ id: h }) => {
|
|
3953
3991
|
l += `${e}var __output$${h}__ = __result__.outputs[${n(h)}];
|
|
@@ -3958,7 +3996,7 @@ s.forBlock.call_func_internal_v1 = function(t) {
|
|
|
3958
3996
|
${c}
|
|
3959
3997
|
${e}var __result__ = __callFuncInternalV1__(${i}, ${a}, __inputs__);
|
|
3960
3998
|
${e}if (!__result__.success) {
|
|
3961
|
-
${e}${e}throw 'call func<${
|
|
3999
|
+
${e}${e}throw 'call func<${r}> failed, reason: ' + __result__.message;
|
|
3962
4000
|
${e}}
|
|
3963
4001
|
${l}${_}}
|
|
3964
4002
|
`;
|
|
@@ -4007,7 +4045,7 @@ const ns = {
|
|
|
4007
4045
|
const { id: n, name: o } = this.func.inputs[e];
|
|
4008
4046
|
t.push(["INPUT" + e, `__input$${n}__`, o, !1]);
|
|
4009
4047
|
}
|
|
4010
|
-
|
|
4048
|
+
F(this, t);
|
|
4011
4049
|
},
|
|
4012
4050
|
checkWarning_: function() {
|
|
4013
4051
|
const { id: t, inputs: e } = tn();
|
|
@@ -4081,13 +4119,13 @@ const os = {
|
|
|
4081
4119
|
t.connection.setShadowDom(null);
|
|
4082
4120
|
const e = t.connection.targetBlock();
|
|
4083
4121
|
e && !e.isShadow() && e.dispose();
|
|
4084
|
-
const n =
|
|
4122
|
+
const n = gt(this.output.type);
|
|
4085
4123
|
t.setCheck(n);
|
|
4086
4124
|
},
|
|
4087
4125
|
updateShadows_: function() {
|
|
4088
4126
|
if (this.isInsertionMarker())
|
|
4089
4127
|
return;
|
|
4090
|
-
const t =
|
|
4128
|
+
const t = At(this.output.type);
|
|
4091
4129
|
this.getInput("VALUE").setShadowDom(t);
|
|
4092
4130
|
},
|
|
4093
4131
|
checkWarning_: function() {
|
|
@@ -4106,7 +4144,7 @@ const os = {
|
|
|
4106
4144
|
E.set_func_output_v1 = os;
|
|
4107
4145
|
s.forBlock.set_func_output_v1 = function(t) {
|
|
4108
4146
|
const e = s.quote_, n = t, { id: o, type: i } = n.output;
|
|
4109
|
-
let a = s.valueToCode(n, "VALUE",
|
|
4147
|
+
let a = s.valueToCode(n, "VALUE", u.ATOMIC);
|
|
4110
4148
|
if (a === void 0)
|
|
4111
4149
|
switch (i) {
|
|
4112
4150
|
case "string":
|
|
@@ -4149,7 +4187,7 @@ T([
|
|
|
4149
4187
|
}
|
|
4150
4188
|
]);
|
|
4151
4189
|
s.forBlock.compute_debug_trace_v1 = function(t) {
|
|
4152
|
-
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT",
|
|
4190
|
+
return `__debugTraceV1__(${s.valueToCode(t, "OBJECT", u.ATOMIC)});
|
|
4153
4191
|
`;
|
|
4154
4192
|
};
|
|
4155
4193
|
T([
|
|
@@ -4173,7 +4211,7 @@ T([
|
|
|
4173
4211
|
}
|
|
4174
4212
|
]);
|
|
4175
4213
|
s.forBlock.compute_env_is_v1 = function(t) {
|
|
4176
|
-
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`,
|
|
4214
|
+
return [`__getEnvV1__() === ${s.quote_(t.getFieldValue("ENV"))}`, u.ATOMIC];
|
|
4177
4215
|
};
|
|
4178
4216
|
function nt() {
|
|
4179
4217
|
const t = [];
|
|
@@ -4181,7 +4219,7 @@ function nt() {
|
|
|
4181
4219
|
e.tables.length > 0 && t.push(e);
|
|
4182
4220
|
}), t;
|
|
4183
4221
|
}
|
|
4184
|
-
function
|
|
4222
|
+
function Tt(t) {
|
|
4185
4223
|
const { spaces: e } = g.data;
|
|
4186
4224
|
return e.find((n) => n.id === t);
|
|
4187
4225
|
}
|
|
@@ -4195,7 +4233,7 @@ function H(t) {
|
|
|
4195
4233
|
const { spaces: e } = g.data, n = e.find((o) => o.id === t);
|
|
4196
4234
|
return n ? n.tables : [];
|
|
4197
4235
|
}
|
|
4198
|
-
function
|
|
4236
|
+
function z(t, e) {
|
|
4199
4237
|
const { spaces: n } = g.data, o = n.find((i) => i.id === t);
|
|
4200
4238
|
if (o)
|
|
4201
4239
|
return o.tables.find((i) => i.id === e);
|
|
@@ -4234,22 +4272,22 @@ function ss(t) {
|
|
|
4234
4272
|
let n, o;
|
|
4235
4273
|
const i = nt()?.[0];
|
|
4236
4274
|
if (i) {
|
|
4237
|
-
const
|
|
4238
|
-
if (
|
|
4275
|
+
const r = H(i.id)?.[0];
|
|
4276
|
+
if (r) {
|
|
4239
4277
|
n = {
|
|
4240
4278
|
space: {
|
|
4241
4279
|
id: i.id,
|
|
4242
4280
|
name: i.name
|
|
4243
4281
|
},
|
|
4244
4282
|
table: {
|
|
4245
|
-
id:
|
|
4246
|
-
name:
|
|
4247
|
-
columns:
|
|
4283
|
+
id: r.id,
|
|
4284
|
+
name: r.name,
|
|
4285
|
+
columns: r.columns
|
|
4248
4286
|
},
|
|
4249
|
-
itemCount:
|
|
4287
|
+
itemCount: r.columns.length
|
|
4250
4288
|
}, o = {};
|
|
4251
|
-
for (let l = 0; l <
|
|
4252
|
-
const _ =
|
|
4289
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
4290
|
+
const _ = r.columns[l];
|
|
4253
4291
|
o["COLUMN" + l] = _.id;
|
|
4254
4292
|
}
|
|
4255
4293
|
}
|
|
@@ -4298,10 +4336,10 @@ const cs = {
|
|
|
4298
4336
|
}, 0);
|
|
4299
4337
|
},
|
|
4300
4338
|
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(
|
|
4339
|
+
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
4340
|
},
|
|
4303
4341
|
ensureBlocks_: function() {
|
|
4304
|
-
this.isInsertionMarker() || (ss(this),
|
|
4342
|
+
this.isInsertionMarker() || (ss(this), F(this, [
|
|
4305
4343
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4306
4344
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
4307
4345
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -4310,7 +4348,7 @@ const cs = {
|
|
|
4310
4348
|
};
|
|
4311
4349
|
E.add_data_v1 = cs;
|
|
4312
4350
|
s.forBlock.add_data_v1 = function(t) {
|
|
4313
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4351
|
+
const e = s.INDENT, n = s.valueToCode(t, "TABLE", u.ATOMIC) || "null", o = s.statementToCode(t, "HANDLE");
|
|
4314
4352
|
return `{
|
|
4315
4353
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4316
4354
|
${e}var __table__ = ${n};
|
|
@@ -4406,19 +4444,19 @@ const rs = {
|
|
|
4406
4444
|
}
|
|
4407
4445
|
},
|
|
4408
4446
|
onSpaceChange_: function(t) {
|
|
4409
|
-
const e =
|
|
4447
|
+
const e = Tt(t);
|
|
4410
4448
|
if (!e) {
|
|
4411
4449
|
console.assert(!1);
|
|
4412
4450
|
return;
|
|
4413
4451
|
}
|
|
4414
4452
|
const n = e.id !== this.space.id;
|
|
4415
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
4453
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
4416
4454
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
4417
4455
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
4418
4456
|
}
|
|
4419
4457
|
},
|
|
4420
4458
|
onTableChange_: function(t) {
|
|
4421
|
-
const e =
|
|
4459
|
+
const e = z(this.space.id, t);
|
|
4422
4460
|
if (!e) {
|
|
4423
4461
|
console.assert(!1);
|
|
4424
4462
|
return;
|
|
@@ -4457,13 +4495,13 @@ const rs = {
|
|
|
4457
4495
|
this.getInput("VALUE").connection.setCheck(t);
|
|
4458
4496
|
},
|
|
4459
4497
|
checkWarning_: function() {
|
|
4460
|
-
const t =
|
|
4498
|
+
const t = Tt(this.space.id);
|
|
4461
4499
|
if (!t) {
|
|
4462
4500
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
4463
4501
|
return;
|
|
4464
4502
|
}
|
|
4465
4503
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
4466
|
-
const e =
|
|
4504
|
+
const e = z(this.space.id, this.table.id);
|
|
4467
4505
|
if (!e) {
|
|
4468
4506
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
4469
4507
|
return;
|
|
@@ -4487,7 +4525,7 @@ const rs = {
|
|
|
4487
4525
|
};
|
|
4488
4526
|
E.cond_atomic_v1 = rs;
|
|
4489
4527
|
s.forBlock.cond_atomic_v1 = function(t) {
|
|
4490
|
-
const e = s.quote_, n = t, o = n.column.name, i = s.valueToCode(n, "VALUE",
|
|
4528
|
+
const e = s.quote_, n = t, o = n.column.name, i = s.valueToCode(n, "VALUE", u.ATOMIC) || null, c = {
|
|
4491
4529
|
EQ: "=",
|
|
4492
4530
|
NEQ: "!=",
|
|
4493
4531
|
LT: "<",
|
|
@@ -4495,7 +4533,7 @@ s.forBlock.cond_atomic_v1 = function(t) {
|
|
|
4495
4533
|
GT: ">",
|
|
4496
4534
|
GTE: ">="
|
|
4497
4535
|
}[n.getFieldValue("OP")];
|
|
4498
|
-
return [`{type:'ATOMIC',key:${e(o)},value:${i},operator:${e(c)}}`,
|
|
4536
|
+
return [`{type:'ATOMIC',key:${e(o)},value:${i},operator:${e(c)}}`, u.ATOMIC];
|
|
4499
4537
|
};
|
|
4500
4538
|
const us = {
|
|
4501
4539
|
init: function() {
|
|
@@ -4518,7 +4556,7 @@ const _s = {
|
|
|
4518
4556
|
]),
|
|
4519
4557
|
"TYPE"
|
|
4520
4558
|
), this.setMutator(
|
|
4521
|
-
new
|
|
4559
|
+
new Et.MutatorIcon(
|
|
4522
4560
|
["cond_logic_item_v1"],
|
|
4523
4561
|
this
|
|
4524
4562
|
)
|
|
@@ -4585,13 +4623,13 @@ const _s = {
|
|
|
4585
4623
|
};
|
|
4586
4624
|
E.cond_logic_v1 = _s;
|
|
4587
4625
|
s.forBlock.cond_logic_v1 = function(t) {
|
|
4588
|
-
const e = s.quote_, n = t, o = n.getFieldValue("TYPE"), i = [], a = s.valueToCode(n, "VALUE",
|
|
4626
|
+
const e = s.quote_, n = t, o = n.getFieldValue("TYPE"), i = [], a = s.valueToCode(n, "VALUE", u.ATOMIC) || null;
|
|
4589
4627
|
i.push(a);
|
|
4590
|
-
for (let
|
|
4591
|
-
const l = s.valueToCode(n, "ADD" +
|
|
4628
|
+
for (let r = 0; r < n.itemCount_; r++) {
|
|
4629
|
+
const l = s.valueToCode(n, "ADD" + r, u.ATOMIC) || null;
|
|
4592
4630
|
i.push(l);
|
|
4593
4631
|
}
|
|
4594
|
-
return [`{type:${e(o)},entries:[${i}]}`,
|
|
4632
|
+
return [`{type:${e(o)},entries:[${i}]}`, u.ATOMIC];
|
|
4595
4633
|
};
|
|
4596
4634
|
function ps(t) {
|
|
4597
4635
|
const e = t.getInput("TABLE").connection;
|
|
@@ -4674,10 +4712,10 @@ const fs = {
|
|
|
4674
4712
|
}, 0);
|
|
4675
4713
|
},
|
|
4676
4714
|
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(
|
|
4715
|
+
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
4716
|
},
|
|
4679
4717
|
ensureBlocks_: function() {
|
|
4680
|
-
this.isInsertionMarker() || (ps(this), ds(this),
|
|
4718
|
+
this.isInsertionMarker() || (ps(this), ds(this), F(this, [
|
|
4681
4719
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4682
4720
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0]
|
|
4683
4721
|
]), hs(this));
|
|
@@ -4685,7 +4723,7 @@ const fs = {
|
|
|
4685
4723
|
};
|
|
4686
4724
|
E.delete_data_v1 = fs;
|
|
4687
4725
|
s.forBlock.delete_data_v1 = function(t) {
|
|
4688
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4726
|
+
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
4727
|
return `{
|
|
4690
4728
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4691
4729
|
${e}var __table__ = ${n};
|
|
@@ -4718,7 +4756,7 @@ T([
|
|
|
4718
4756
|
}
|
|
4719
4757
|
]);
|
|
4720
4758
|
s.forBlock.interrupt_transaction_v1 = function(t) {
|
|
4721
|
-
return `throw ${s.valueToCode(t, "VALUE",
|
|
4759
|
+
return `throw ${s.valueToCode(t, "VALUE", u.NONE) || "''"};
|
|
4722
4760
|
`;
|
|
4723
4761
|
};
|
|
4724
4762
|
function ms(t) {
|
|
@@ -4728,22 +4766,22 @@ function ms(t) {
|
|
|
4728
4766
|
let n, o;
|
|
4729
4767
|
const i = nt()?.[0];
|
|
4730
4768
|
if (i) {
|
|
4731
|
-
const
|
|
4732
|
-
if (
|
|
4769
|
+
const r = H(i.id)?.[0];
|
|
4770
|
+
if (r) {
|
|
4733
4771
|
n = {
|
|
4734
4772
|
space: {
|
|
4735
4773
|
id: i.id,
|
|
4736
4774
|
name: i.name
|
|
4737
4775
|
},
|
|
4738
4776
|
table: {
|
|
4739
|
-
id:
|
|
4740
|
-
name:
|
|
4741
|
-
columns:
|
|
4777
|
+
id: r.id,
|
|
4778
|
+
name: r.name,
|
|
4779
|
+
columns: r.columns
|
|
4742
4780
|
},
|
|
4743
|
-
itemCount:
|
|
4781
|
+
itemCount: r.columns.length
|
|
4744
4782
|
}, o = {};
|
|
4745
|
-
for (let l = 0; l <
|
|
4746
|
-
const _ =
|
|
4783
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
4784
|
+
const _ = r.columns[l];
|
|
4747
4785
|
o["COLUMN" + l] = _.id, o["ALIAS" + l] = _.name;
|
|
4748
4786
|
}
|
|
4749
4787
|
}
|
|
@@ -4852,10 +4890,10 @@ const As = {
|
|
|
4852
4890
|
}, 0);
|
|
4853
4891
|
},
|
|
4854
4892
|
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(
|
|
4893
|
+
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
4894
|
},
|
|
4857
4895
|
ensureBlocks_: function() {
|
|
4858
|
-
this.isInsertionMarker() || (ms(this), Ts(this), Es(this),
|
|
4896
|
+
this.isInsertionMarker() || (ms(this), Ts(this), Es(this), F(this, [
|
|
4859
4897
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
4860
4898
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
4861
4899
|
["MAIN_DATA", "__mainData__", "x-runtime-lib.mainData", !0],
|
|
@@ -4865,7 +4903,7 @@ const As = {
|
|
|
4865
4903
|
};
|
|
4866
4904
|
E.query_data_v1 = As;
|
|
4867
4905
|
s.forBlock.query_data_v1 = function(t) {
|
|
4868
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
4906
|
+
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
4907
|
return `{
|
|
4870
4908
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
4871
4909
|
${e}var __table__ = ${n};
|
|
@@ -4906,8 +4944,8 @@ T([
|
|
|
4906
4944
|
}
|
|
4907
4945
|
]);
|
|
4908
4946
|
s.forBlock.query_extra_limit_v1 = function(t) {
|
|
4909
|
-
const e = s.valueToCode(t, "OFFSET",
|
|
4910
|
-
return [`{type:'limit',value:${e},value2:${n}}`,
|
|
4947
|
+
const e = s.valueToCode(t, "OFFSET", u.ATOMIC) || 0, n = s.valueToCode(t, "LIMIT", u.ATOMIC) || 0;
|
|
4948
|
+
return [`{type:'limit',value:${e},value2:${n}}`, u.ATOMIC];
|
|
4911
4949
|
};
|
|
4912
4950
|
T([
|
|
4913
4951
|
{
|
|
@@ -4933,8 +4971,8 @@ T([
|
|
|
4933
4971
|
}
|
|
4934
4972
|
]);
|
|
4935
4973
|
s.forBlock.query_extra_sortby_v1 = function(t) {
|
|
4936
|
-
const e = s.valueToCode(t, "COLUMN",
|
|
4937
|
-
return [`{type:'sortby',value:${e},value2:${n}}`,
|
|
4974
|
+
const e = s.valueToCode(t, "COLUMN", u.ATOMIC) || "''", n = s.valueToCode(t, "DESC", u.ATOMIC) || !1;
|
|
4975
|
+
return [`{type:'sortby',value:${e},value2:${n}}`, u.ATOMIC];
|
|
4938
4976
|
};
|
|
4939
4977
|
const Is = {
|
|
4940
4978
|
init: function() {
|
|
@@ -4948,7 +4986,7 @@ const Os = {
|
|
|
4948
4986
|
}
|
|
4949
4987
|
};
|
|
4950
4988
|
E.select_column_item_v1 = Os;
|
|
4951
|
-
const
|
|
4989
|
+
const ys = {
|
|
4952
4990
|
init: function() {
|
|
4953
4991
|
this.space = {
|
|
4954
4992
|
id: "",
|
|
@@ -4964,7 +5002,7 @@ const vs = {
|
|
|
4964
5002
|
new O(() => this.genTableOpts_()),
|
|
4965
5003
|
"TABLE"
|
|
4966
5004
|
), this.setMutator(
|
|
4967
|
-
new
|
|
5005
|
+
new Et.MutatorIcon(
|
|
4968
5006
|
["select_column_item_v1"],
|
|
4969
5007
|
this
|
|
4970
5008
|
)
|
|
@@ -5033,19 +5071,19 @@ const vs = {
|
|
|
5033
5071
|
}
|
|
5034
5072
|
},
|
|
5035
5073
|
onSpaceChange_: function(t) {
|
|
5036
|
-
const e =
|
|
5074
|
+
const e = Tt(t);
|
|
5037
5075
|
if (!e) {
|
|
5038
5076
|
console.assert(!1);
|
|
5039
5077
|
return;
|
|
5040
5078
|
}
|
|
5041
5079
|
const n = e.id !== this.space.id;
|
|
5042
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
5080
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
5043
5081
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
5044
5082
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
5045
5083
|
}
|
|
5046
5084
|
},
|
|
5047
5085
|
onTableChange_: function(t) {
|
|
5048
|
-
const e =
|
|
5086
|
+
const e = z(this.space.id, t);
|
|
5049
5087
|
if (!e) {
|
|
5050
5088
|
console.assert(!1);
|
|
5051
5089
|
return;
|
|
@@ -5120,8 +5158,8 @@ const vs = {
|
|
|
5120
5158
|
for (let t = 0; t < this.table.columns.length; t++) {
|
|
5121
5159
|
const e = this.table.columns[t], n = new O(
|
|
5122
5160
|
() => this.genColumnOpts_()
|
|
5123
|
-
), o = new
|
|
5124
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
5161
|
+
), o = new ft("");
|
|
5162
|
+
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
5163
|
}
|
|
5126
5164
|
},
|
|
5127
5165
|
updateShape_: function() {
|
|
@@ -5132,20 +5170,20 @@ const vs = {
|
|
|
5132
5170
|
continue;
|
|
5133
5171
|
const e = new O(
|
|
5134
5172
|
() => this.genColumnOpts_()
|
|
5135
|
-
), n = new
|
|
5136
|
-
this.appendDummyInput("ADD" + t).setAlign(
|
|
5173
|
+
), n = new ft("");
|
|
5174
|
+
this.appendDummyInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(e, "COLUMN" + t).appendField("%{BKY_DATA_AS}").appendField(n, "ALIAS" + t);
|
|
5137
5175
|
const o = this.table.columns[0];
|
|
5138
5176
|
e.setValue(o.id ?? "", !1), n.setValue(o.name ?? "", !1);
|
|
5139
5177
|
}
|
|
5140
5178
|
},
|
|
5141
5179
|
checkWarning_: function() {
|
|
5142
|
-
const t =
|
|
5180
|
+
const t = Tt(this.space.id);
|
|
5143
5181
|
if (!t) {
|
|
5144
5182
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5145
5183
|
return;
|
|
5146
5184
|
}
|
|
5147
5185
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5148
|
-
const e =
|
|
5186
|
+
const e = z(this.space.id, this.table.id);
|
|
5149
5187
|
if (!e) {
|
|
5150
5188
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5151
5189
|
return;
|
|
@@ -5157,7 +5195,7 @@ const vs = {
|
|
|
5157
5195
|
this.setWarningText(null);
|
|
5158
5196
|
}
|
|
5159
5197
|
};
|
|
5160
|
-
E.select_column_v1 =
|
|
5198
|
+
E.select_column_v1 = ys;
|
|
5161
5199
|
s.forBlock.select_column_v1 = function(t) {
|
|
5162
5200
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id, a = [];
|
|
5163
5201
|
for (let l = 0; l < n.itemCount_; l++) {
|
|
@@ -5167,9 +5205,9 @@ s.forBlock.select_column_v1 = function(t) {
|
|
|
5167
5205
|
let c = "[";
|
|
5168
5206
|
return a.forEach(({ name: l, alias: _ }, d) => {
|
|
5169
5207
|
d !== 0 && (c += ","), c += `{name:${e(l)},alias:${e(_)}}`;
|
|
5170
|
-
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`,
|
|
5208
|
+
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`, u.ATOMIC];
|
|
5171
5209
|
};
|
|
5172
|
-
const
|
|
5210
|
+
const vs = {
|
|
5173
5211
|
init: function() {
|
|
5174
5212
|
this.space = {
|
|
5175
5213
|
id: "",
|
|
@@ -5227,19 +5265,19 @@ const ys = {
|
|
|
5227
5265
|
}
|
|
5228
5266
|
},
|
|
5229
5267
|
onSpaceChange_: function(t) {
|
|
5230
|
-
const e =
|
|
5268
|
+
const e = Tt(t);
|
|
5231
5269
|
if (!e) {
|
|
5232
5270
|
console.assert(!1);
|
|
5233
5271
|
return;
|
|
5234
5272
|
}
|
|
5235
5273
|
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 || !
|
|
5274
|
+
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
5275
|
const i = H(this.space.id)?.[0];
|
|
5238
5276
|
i ? this.setFieldValue(i.id, "TABLE") : this.setFieldValue("", "TABLE");
|
|
5239
5277
|
}
|
|
5240
5278
|
},
|
|
5241
5279
|
onTableChange_: function(t) {
|
|
5242
|
-
const e =
|
|
5280
|
+
const e = z(this.space.id, t);
|
|
5243
5281
|
if (!e) {
|
|
5244
5282
|
console.assert(!1);
|
|
5245
5283
|
return;
|
|
@@ -5247,13 +5285,13 @@ const ys = {
|
|
|
5247
5285
|
this.table.id = e.id, this.table.name = e.name;
|
|
5248
5286
|
},
|
|
5249
5287
|
checkWarning_: function() {
|
|
5250
|
-
const t =
|
|
5288
|
+
const t = Tt(this.space.id);
|
|
5251
5289
|
if (!t) {
|
|
5252
5290
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5253
5291
|
return;
|
|
5254
5292
|
}
|
|
5255
5293
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5256
|
-
const e =
|
|
5294
|
+
const e = z(this.space.id, this.table.id);
|
|
5257
5295
|
if (!e) {
|
|
5258
5296
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5259
5297
|
return;
|
|
@@ -5261,10 +5299,10 @@ const ys = {
|
|
|
5261
5299
|
e.name !== this.table.name && (this.table.name = e.name), this.setWarningText(null);
|
|
5262
5300
|
}
|
|
5263
5301
|
};
|
|
5264
|
-
E.select_table_v1 =
|
|
5302
|
+
E.select_table_v1 = vs;
|
|
5265
5303
|
s.forBlock.select_table_v1 = function(t) {
|
|
5266
5304
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id;
|
|
5267
|
-
return [`{spaceId:${e(o)},tableId:${e(i)}}`,
|
|
5305
|
+
return [`{spaceId:${e(o)},tableId:${e(i)}}`, u.ATOMIC];
|
|
5268
5306
|
};
|
|
5269
5307
|
const Cs = {
|
|
5270
5308
|
init: function() {
|
|
@@ -5282,7 +5320,7 @@ const Cs = {
|
|
|
5282
5320
|
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
5321
|
},
|
|
5284
5322
|
ensureBlocks_: function() {
|
|
5285
|
-
this.isInsertionMarker() ||
|
|
5323
|
+
this.isInsertionMarker() || F(this, [
|
|
5286
5324
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
5287
5325
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0]
|
|
5288
5326
|
]);
|
|
@@ -5360,7 +5398,7 @@ const Ls = {
|
|
|
5360
5398
|
new O(() => this.genTableOpts_()),
|
|
5361
5399
|
"TABLE"
|
|
5362
5400
|
), this.setMutator(
|
|
5363
|
-
new
|
|
5401
|
+
new Et.MutatorIcon(
|
|
5364
5402
|
["update_column_item_v1"],
|
|
5365
5403
|
this
|
|
5366
5404
|
)
|
|
@@ -5429,19 +5467,19 @@ const Ls = {
|
|
|
5429
5467
|
}
|
|
5430
5468
|
},
|
|
5431
5469
|
onSpaceChange_: function(t) {
|
|
5432
|
-
const e =
|
|
5470
|
+
const e = Tt(t);
|
|
5433
5471
|
if (!e) {
|
|
5434
5472
|
console.assert(!1);
|
|
5435
5473
|
return;
|
|
5436
5474
|
}
|
|
5437
5475
|
const n = e.id !== this.space.id;
|
|
5438
|
-
if (this.space.id = e.id, this.space.name = e.name, n || !
|
|
5476
|
+
if (this.space.id = e.id, this.space.name = e.name, n || !z(this.space.id, this.table.id)) {
|
|
5439
5477
|
const o = H(this.space.id)?.[0]?.id ?? "", i = this.getField("TABLE");
|
|
5440
5478
|
i.getOptions(!1), i.setValue(o, !1), this.onTableChange_(o);
|
|
5441
5479
|
}
|
|
5442
5480
|
},
|
|
5443
5481
|
onTableChange_: function(t) {
|
|
5444
|
-
const e =
|
|
5482
|
+
const e = z(this.space.id, t);
|
|
5445
5483
|
if (!e) {
|
|
5446
5484
|
console.assert(!1);
|
|
5447
5485
|
return;
|
|
@@ -5527,7 +5565,7 @@ const Ls = {
|
|
|
5527
5565
|
const e = this.table.columns[t], n = new O(
|
|
5528
5566
|
() => this.genColumnOpts_()
|
|
5529
5567
|
);
|
|
5530
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5568
|
+
this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(n, "COLUMN" + t), n.setValue(e.id, !1);
|
|
5531
5569
|
}
|
|
5532
5570
|
},
|
|
5533
5571
|
updateShape_: function() {
|
|
@@ -5541,7 +5579,7 @@ const Ls = {
|
|
|
5541
5579
|
const e = new O(
|
|
5542
5580
|
() => this.genColumnOpts_()
|
|
5543
5581
|
);
|
|
5544
|
-
this.appendValueInput("ADD" + t).setAlign(
|
|
5582
|
+
this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(e, "COLUMN" + t);
|
|
5545
5583
|
}
|
|
5546
5584
|
},
|
|
5547
5585
|
updateBlocks_: function(t) {
|
|
@@ -5556,8 +5594,8 @@ const Ls = {
|
|
|
5556
5594
|
if (!c)
|
|
5557
5595
|
continue;
|
|
5558
5596
|
n.setCheck(null);
|
|
5559
|
-
const
|
|
5560
|
-
|
|
5597
|
+
const r = Je(this.workspace, c.type);
|
|
5598
|
+
r && o.connect(r.outputConnection);
|
|
5561
5599
|
}
|
|
5562
5600
|
},
|
|
5563
5601
|
updateCheck_: function() {
|
|
@@ -5570,13 +5608,13 @@ const Ls = {
|
|
|
5570
5608
|
}
|
|
5571
5609
|
},
|
|
5572
5610
|
checkWarning_: function() {
|
|
5573
|
-
const t =
|
|
5611
|
+
const t = Tt(this.space.id);
|
|
5574
5612
|
if (!t) {
|
|
5575
5613
|
this.setWarningText(f("WARN_SPACE_NOT_FOUND"));
|
|
5576
5614
|
return;
|
|
5577
5615
|
}
|
|
5578
5616
|
t.name !== this.space.name && (this.space.name = t.name);
|
|
5579
|
-
const e =
|
|
5617
|
+
const e = z(this.space.id, this.table.id);
|
|
5580
5618
|
if (!e) {
|
|
5581
5619
|
this.setWarningText(f("WARN_TABLE_NOT_FOUND"));
|
|
5582
5620
|
return;
|
|
@@ -5592,13 +5630,13 @@ E.update_column_v1 = Ls;
|
|
|
5592
5630
|
s.forBlock.update_column_v1 = function(t) {
|
|
5593
5631
|
const e = s.quote_, n = t, o = n.space.id, i = n.table.id, a = [];
|
|
5594
5632
|
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,
|
|
5633
|
+
const _ = n.getFieldValue("COLUMN" + l), d = n.table.columns.find((p) => p.id === _).name, h = s.valueToCode(n, "ADD" + l, u.ATOMIC) || "null";
|
|
5596
5634
|
a.push({ name: d, value: h });
|
|
5597
5635
|
}
|
|
5598
5636
|
let c = "[";
|
|
5599
5637
|
return a.forEach(({ name: l, value: _ }, d) => {
|
|
5600
5638
|
d !== 0 && (c += ","), c += `{name:${e(l)},value:${_}}`;
|
|
5601
|
-
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`,
|
|
5639
|
+
}), c += "]", [`{spaceId:${e(o)},tableId:${e(i)},columns:${c}}`, u.ATOMIC];
|
|
5602
5640
|
};
|
|
5603
5641
|
function Ss(t) {
|
|
5604
5642
|
const e = t.getInput("TABLE").connection;
|
|
@@ -5607,22 +5645,22 @@ function Ss(t) {
|
|
|
5607
5645
|
let n, o;
|
|
5608
5646
|
const i = nt()?.[0];
|
|
5609
5647
|
if (i) {
|
|
5610
|
-
const
|
|
5611
|
-
if (
|
|
5648
|
+
const r = H(i.id)?.[0];
|
|
5649
|
+
if (r) {
|
|
5612
5650
|
n = {
|
|
5613
5651
|
space: {
|
|
5614
5652
|
id: i.id,
|
|
5615
5653
|
name: i.name
|
|
5616
5654
|
},
|
|
5617
5655
|
table: {
|
|
5618
|
-
id:
|
|
5619
|
-
name:
|
|
5620
|
-
columns:
|
|
5656
|
+
id: r.id,
|
|
5657
|
+
name: r.name,
|
|
5658
|
+
columns: r.columns
|
|
5621
5659
|
},
|
|
5622
|
-
itemCount:
|
|
5660
|
+
itemCount: r.columns.length
|
|
5623
5661
|
}, o = {};
|
|
5624
|
-
for (let l = 0; l <
|
|
5625
|
-
const _ =
|
|
5662
|
+
for (let l = 0; l < r.columns.length; l++) {
|
|
5663
|
+
const _ = r.columns[l];
|
|
5626
5664
|
o["COLUMN" + l] = _.id;
|
|
5627
5665
|
}
|
|
5628
5666
|
}
|
|
@@ -5680,10 +5718,10 @@ const Ps = {
|
|
|
5680
5718
|
}, 0);
|
|
5681
5719
|
},
|
|
5682
5720
|
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(
|
|
5721
|
+
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
5722
|
},
|
|
5685
5723
|
ensureBlocks: function() {
|
|
5686
|
-
this.isInsertionMarker() || (Ss(this), Bs(this),
|
|
5724
|
+
this.isInsertionMarker() || (Ss(this), Bs(this), F(this, [
|
|
5687
5725
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
5688
5726
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
5689
5727
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -5692,7 +5730,7 @@ const Ps = {
|
|
|
5692
5730
|
};
|
|
5693
5731
|
E.update_data_v1 = Ps;
|
|
5694
5732
|
s.forBlock.update_data_v1 = function(t) {
|
|
5695
|
-
const e = s.INDENT, n = s.valueToCode(t, "TABLE",
|
|
5733
|
+
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
5734
|
return `{
|
|
5697
5735
|
${e}var __tx__ = typeof(__tx__) !== 'undefined' ? __tx__ : null;
|
|
5698
5736
|
${e}var __table__ = ${n};
|
|
@@ -5709,8 +5747,8 @@ ${i}}
|
|
|
5709
5747
|
};
|
|
5710
5748
|
const Rs = C.xml, Ds = {
|
|
5711
5749
|
init: function() {
|
|
5712
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(
|
|
5713
|
-
new ot(
|
|
5750
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" [ "), this.appendDummyInput("ADD").setAlign(v.Align.CENTRE).appendField(
|
|
5751
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5714
5752
|
this.isInFlyout || this.addEntry_();
|
|
5715
5753
|
})
|
|
5716
5754
|
), this.appendDummyInput("CLOSE_BRACKET").appendField(" ] "), this.setInputsInline(!1), this.setOutput(!0, "JsonArray"), this.setColour(350), this.setTooltip(""), this.setHelpUrl("");
|
|
@@ -5720,7 +5758,7 @@ const Rs = C.xml, Ds = {
|
|
|
5720
5758
|
return t.setAttribute("items", String(this.length)), t;
|
|
5721
5759
|
},
|
|
5722
5760
|
domToMutation: function(t) {
|
|
5723
|
-
this.length =
|
|
5761
|
+
this.length = Ft(t.getAttribute("items") ?? "", 0), this.initShape_();
|
|
5724
5762
|
},
|
|
5725
5763
|
initData: function(t) {
|
|
5726
5764
|
this.length = t, this.initShape_();
|
|
@@ -5729,7 +5767,7 @@ const Rs = C.xml, Ds = {
|
|
|
5729
5767
|
for (let t = 0; t < this.length; t++) {
|
|
5730
5768
|
const e = "ENTRY" + t, n = this.appendValueInput(e);
|
|
5731
5769
|
n.appendField(
|
|
5732
|
-
new ot(
|
|
5770
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5733
5771
|
this.isInFlyout || this.addEntry_(n);
|
|
5734
5772
|
})
|
|
5735
5773
|
), n.appendField(new En(String(t))), n.appendField(
|
|
@@ -5741,14 +5779,14 @@ const Rs = C.xml, Ds = {
|
|
|
5741
5779
|
},
|
|
5742
5780
|
addEntry_: function(t) {
|
|
5743
5781
|
let e = this.length;
|
|
5744
|
-
t && (e =
|
|
5782
|
+
t && (e = Ft(t.name.substring(5)));
|
|
5745
5783
|
for (let o = this.length - 1; o >= e; o--) {
|
|
5746
5784
|
const i = this.getInput("ENTRY" + o);
|
|
5747
5785
|
i.name = "ENTRY" + (o + 1), i.fieldRow[1].setValue(o + 1);
|
|
5748
5786
|
}
|
|
5749
5787
|
const n = this.appendValueInput("ENTRY" + e);
|
|
5750
5788
|
n.appendField(
|
|
5751
|
-
new ot(
|
|
5789
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5752
5790
|
this.isInFlyout || this.addEntry_(n);
|
|
5753
5791
|
})
|
|
5754
5792
|
), n.appendField(new En(String(e))), n.appendField(
|
|
@@ -5760,7 +5798,7 @@ const Rs = C.xml, Ds = {
|
|
|
5760
5798
|
removeEntry_: function(t) {
|
|
5761
5799
|
const e = t.name, n = this.getInputTargetBlock(e);
|
|
5762
5800
|
n && n.dispose(), this.removeInput(e);
|
|
5763
|
-
const o =
|
|
5801
|
+
const o = Ft(e.substring(5));
|
|
5764
5802
|
for (let i = o + 1; i < this.length; i++) {
|
|
5765
5803
|
const a = this.getInput("ENTRY" + i);
|
|
5766
5804
|
a.name = "ENTRY" + (i - 1), a.fieldRow[1].setValue(i - 1);
|
|
@@ -5783,8 +5821,8 @@ const Ms = {
|
|
|
5783
5821
|
E.json_boolean_v1 = Ms;
|
|
5784
5822
|
const Ln = C.xml, Us = {
|
|
5785
5823
|
init: function() {
|
|
5786
|
-
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(
|
|
5787
|
-
new ot(
|
|
5824
|
+
this.length = 0, this.appendDummyInput("OPEN_BRACKET").appendField(" { "), this.appendDummyInput("ADD").setAlign(v.Align.CENTRE).appendField(
|
|
5825
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5788
5826
|
this.isInFlyout || this.addEntry_();
|
|
5789
5827
|
})
|
|
5790
5828
|
), this.appendDummyInput("CLOSE_BRACHET").appendField(" } "), this.setInputsInline(!1), this.setOutput(!0, "JsonMap"), this.setColour(120), this.setTooltip(""), this.setHelpUrl("");
|
|
@@ -5812,10 +5850,10 @@ const Ln = C.xml, Us = {
|
|
|
5812
5850
|
for (let e = 0; e < t.length; e++) {
|
|
5813
5851
|
const n = t[e], o = "ENTRY" + e, i = this.appendValueInput(o);
|
|
5814
5852
|
i.appendField(
|
|
5815
|
-
new ot(
|
|
5853
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5816
5854
|
this.isInFlyout || this.addEntry_(i);
|
|
5817
5855
|
})
|
|
5818
|
-
), i.appendField(new
|
|
5856
|
+
), i.appendField(new ft(n), "KEY" + e), i.appendField(
|
|
5819
5857
|
new ot(se, 20, 20, void 0, () => {
|
|
5820
5858
|
this.isInFlyout || this.removeEntry_(i);
|
|
5821
5859
|
})
|
|
@@ -5824,15 +5862,15 @@ const Ln = C.xml, Us = {
|
|
|
5824
5862
|
},
|
|
5825
5863
|
addEntry_: function(t) {
|
|
5826
5864
|
let e = this.length;
|
|
5827
|
-
t && (e =
|
|
5865
|
+
t && (e = Ft(t.name.substring(5)));
|
|
5828
5866
|
for (let o = this.length - 1; o >= e; o--)
|
|
5829
5867
|
this.getField("KEY" + o).name = "KEY" + (o + 1), this.getInput("ENTRY" + o).name = "ENTRY" + (o + 1);
|
|
5830
5868
|
const n = this.appendValueInput("ENTRY" + e);
|
|
5831
5869
|
n.appendField(
|
|
5832
|
-
new ot(
|
|
5870
|
+
new ot(bt, 20, 20, void 0, () => {
|
|
5833
5871
|
this.isInFlyout || this.addEntry_(n);
|
|
5834
5872
|
})
|
|
5835
|
-
), n.appendField(new
|
|
5873
|
+
), n.appendField(new ft("key"), "KEY" + e), n.appendField(
|
|
5836
5874
|
new ot(se, 20, 20, void 0, () => {
|
|
5837
5875
|
this.isInFlyout || this.removeEntry_(n);
|
|
5838
5876
|
})
|
|
@@ -5841,7 +5879,7 @@ const Ln = C.xml, Us = {
|
|
|
5841
5879
|
removeEntry_: function(t) {
|
|
5842
5880
|
const e = t.name, n = this.getInputTargetBlock(e);
|
|
5843
5881
|
n && n.dispose(), this.removeInput(e);
|
|
5844
|
-
const o =
|
|
5882
|
+
const o = Ft(e.substring(5));
|
|
5845
5883
|
for (let i = o + 1; i < this.length; i++)
|
|
5846
5884
|
this.getField("KEY" + i).name = "KEY" + (i - 1), this.getInput("ENTRY" + i).name = "ENTRY" + (i - 1);
|
|
5847
5885
|
this.length--;
|
|
@@ -5856,13 +5894,13 @@ const Vs = {
|
|
|
5856
5894
|
E.json_number_v1 = Vs;
|
|
5857
5895
|
const xs = {
|
|
5858
5896
|
init: function() {
|
|
5859
|
-
this.appendDummyInput().setAlign(
|
|
5897
|
+
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
5898
|
}
|
|
5861
5899
|
};
|
|
5862
5900
|
E.json_root_v1 = xs;
|
|
5863
5901
|
const Ys = {
|
|
5864
5902
|
init: function() {
|
|
5865
|
-
this.appendDummyInput().appendField('"').appendField(new
|
|
5903
|
+
this.appendDummyInput().appendField('"').appendField(new ft(""), "VALUE").appendField('"'), this.setOutput(!0, "JsonString"), this.setColour(160);
|
|
5866
5904
|
}
|
|
5867
5905
|
};
|
|
5868
5906
|
E.json_string_v1 = Ys;
|
|
@@ -5881,7 +5919,7 @@ E.list_create_item_v1 = Ks;
|
|
|
5881
5919
|
const $s = {
|
|
5882
5920
|
init: function() {
|
|
5883
5921
|
this.itemCount_ = 0, this.setMutator(
|
|
5884
|
-
new
|
|
5922
|
+
new Et.MutatorIcon(
|
|
5885
5923
|
["list_create_item_v1"],
|
|
5886
5924
|
this
|
|
5887
5925
|
)
|
|
@@ -5955,7 +5993,7 @@ const $s = {
|
|
|
5955
5993
|
"Boolean",
|
|
5956
5994
|
"Array",
|
|
5957
5995
|
"Object"
|
|
5958
|
-
]), t === 0 && this.getInput("ADD" + t).setAlign(
|
|
5996
|
+
]), t === 0 && this.getInput("ADD" + t).setAlign(v.Align.RIGHT).appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
5959
5997
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
5960
5998
|
this.removeInput("ADD" + t);
|
|
5961
5999
|
}
|
|
@@ -5964,8 +6002,8 @@ E.list_create_v1 = $s;
|
|
|
5964
6002
|
s.forBlock.list_create_v1 = function(t) {
|
|
5965
6003
|
const e = t, n = new Array(e.itemCount_);
|
|
5966
6004
|
for (let i = 0; i < e.itemCount_; i++)
|
|
5967
|
-
n[i] = s.valueToCode(e, "ADD" + i,
|
|
5968
|
-
return ["[" + n.join(", ") + "]",
|
|
6005
|
+
n[i] = s.valueToCode(e, "ADD" + i, u.NONE) || "null";
|
|
6006
|
+
return ["[" + n.join(", ") + "]", u.ATOMIC];
|
|
5969
6007
|
};
|
|
5970
6008
|
T([
|
|
5971
6009
|
{
|
|
@@ -5992,7 +6030,7 @@ T([
|
|
|
5992
6030
|
}
|
|
5993
6031
|
]);
|
|
5994
6032
|
s.forBlock.list_delete_v1 = function(t) {
|
|
5995
|
-
const e = s.valueToCode(t, "VALUE",
|
|
6033
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
5996
6034
|
return `${e}.splice(${n}, 1)`;
|
|
5997
6035
|
};
|
|
5998
6036
|
T([
|
|
@@ -6019,8 +6057,8 @@ T([
|
|
|
6019
6057
|
}
|
|
6020
6058
|
]);
|
|
6021
6059
|
s.forBlock.list_get_v1 = function(t) {
|
|
6022
|
-
const e = s.valueToCode(t, "VALUE",
|
|
6023
|
-
return [`${e}[${n}]`,
|
|
6060
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
6061
|
+
return [`${e}[${n}]`, u.MEMBER];
|
|
6024
6062
|
};
|
|
6025
6063
|
T([
|
|
6026
6064
|
{
|
|
@@ -6051,8 +6089,8 @@ T([
|
|
|
6051
6089
|
}
|
|
6052
6090
|
]);
|
|
6053
6091
|
s.forBlock.list_get_sublist_v1 = function(t) {
|
|
6054
|
-
const e = s.valueToCode(t, "LIST",
|
|
6055
|
-
return [`${e}.slice(${n}, ${o})`,
|
|
6092
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.getAdjusted(t, "START"), o = s.getAdjusted(t, "END", 1);
|
|
6093
|
+
return [`${e}.slice(${n}, ${o})`, u.FUNCTION_CALL];
|
|
6056
6094
|
};
|
|
6057
6095
|
T([
|
|
6058
6096
|
{
|
|
@@ -6072,7 +6110,7 @@ T([
|
|
|
6072
6110
|
}
|
|
6073
6111
|
]);
|
|
6074
6112
|
s.forBlock.list_is_empty_v1 = function(t) {
|
|
6075
|
-
return [`!${s.valueToCode(t, "VALUE",
|
|
6113
|
+
return [`!${s.valueToCode(t, "VALUE", u.MEMBER) || "[]"}.length`, u.LOGICAL_NOT];
|
|
6076
6114
|
};
|
|
6077
6115
|
T([
|
|
6078
6116
|
{
|
|
@@ -6098,8 +6136,8 @@ T([
|
|
|
6098
6136
|
}
|
|
6099
6137
|
]);
|
|
6100
6138
|
s.forBlock.list_join_v1 = function(t) {
|
|
6101
|
-
const e = s.valueToCode(t, "LIST",
|
|
6102
|
-
return [`${e}.join(${n})`,
|
|
6139
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.valueToCode(t, "DELIM", u.NONE) || "''";
|
|
6140
|
+
return [`${e}.join(${n})`, u.FUNCTION_CALL];
|
|
6103
6141
|
};
|
|
6104
6142
|
T([
|
|
6105
6143
|
{
|
|
@@ -6119,7 +6157,7 @@ T([
|
|
|
6119
6157
|
}
|
|
6120
6158
|
]);
|
|
6121
6159
|
s.forBlock.list_length_v1 = function(t) {
|
|
6122
|
-
return [`${s.valueToCode(t, "VALUE",
|
|
6160
|
+
return [`${s.valueToCode(t, "VALUE", u.MEMBER) || "[]"}.length`, u.MEMBER];
|
|
6123
6161
|
};
|
|
6124
6162
|
T([
|
|
6125
6163
|
{
|
|
@@ -6140,7 +6178,7 @@ T([
|
|
|
6140
6178
|
}
|
|
6141
6179
|
]);
|
|
6142
6180
|
s.forBlock.list_reverse_v1 = function(t) {
|
|
6143
|
-
return [`${s.valueToCode(t, "LIST",
|
|
6181
|
+
return [`${s.valueToCode(t, "LIST", u.NONE) || "[]"}.slice().reverse()`, u.FUNCTION_CALL];
|
|
6144
6182
|
};
|
|
6145
6183
|
T([
|
|
6146
6184
|
{
|
|
@@ -6172,7 +6210,7 @@ T([
|
|
|
6172
6210
|
}
|
|
6173
6211
|
]);
|
|
6174
6212
|
s.forBlock.list_set_v1 = function(t) {
|
|
6175
|
-
const e = s.valueToCode(t, "LIST",
|
|
6213
|
+
const e = s.valueToCode(t, "LIST", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT"), o = s.valueToCode(t, "VALUE", u.ASSIGNMENT) || "null";
|
|
6176
6214
|
return `${e}[${n}] = ${o};
|
|
6177
6215
|
`;
|
|
6178
6216
|
};
|
|
@@ -6213,7 +6251,7 @@ T([
|
|
|
6213
6251
|
}
|
|
6214
6252
|
]);
|
|
6215
6253
|
s.forBlock.logic_boolean_v1 = function(t) {
|
|
6216
|
-
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false",
|
|
6254
|
+
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false", u.ATOMIC];
|
|
6217
6255
|
};
|
|
6218
6256
|
const Gs = {
|
|
6219
6257
|
onchange: function(t) {
|
|
@@ -6280,8 +6318,8 @@ s.forBlock.logic_compare_v1 = function(t) {
|
|
|
6280
6318
|
GT: ">",
|
|
6281
6319
|
GTE: ">="
|
|
6282
6320
|
}[t.getFieldValue("OP")];
|
|
6283
|
-
let o =
|
|
6284
|
-
(n === "==" || n === "!=") && (o =
|
|
6321
|
+
let o = u.RELATIONAL;
|
|
6322
|
+
(n === "==" || n === "!=") && (o = u.EQUALITY);
|
|
6285
6323
|
const i = s.valueToCode(t, "A", o) || "0", a = s.valueToCode(t, "B", o) || "0";
|
|
6286
6324
|
return [`${i} ${n} ${a}`, o];
|
|
6287
6325
|
};
|
|
@@ -6471,7 +6509,7 @@ s.forBlock.logic_if_v1 = function(t) {
|
|
|
6471
6509
|
t
|
|
6472
6510
|
));
|
|
6473
6511
|
do {
|
|
6474
|
-
const o = s.valueToCode(t, "IF" + e,
|
|
6512
|
+
const o = s.valueToCode(t, "IF" + e, u.NONE) || "false";
|
|
6475
6513
|
let i = s.statementToCode(t, "DO" + e);
|
|
6476
6514
|
s.STATEMENT_SUFFIX && (i = s.prefixLines(
|
|
6477
6515
|
s.injectId(
|
|
@@ -6514,7 +6552,7 @@ T([
|
|
|
6514
6552
|
}
|
|
6515
6553
|
]);
|
|
6516
6554
|
s.forBlock.logic_negate_v1 = function(t) {
|
|
6517
|
-
return [`!${s.valueToCode(t, "BOOL",
|
|
6555
|
+
return [`!${s.valueToCode(t, "BOOL", u.LOGICAL_NOT) || "true"}`, u.LOGICAL_NOT];
|
|
6518
6556
|
};
|
|
6519
6557
|
T([
|
|
6520
6558
|
{
|
|
@@ -6548,7 +6586,7 @@ T([
|
|
|
6548
6586
|
}
|
|
6549
6587
|
]);
|
|
6550
6588
|
s.forBlock.logic_operation_v1 = function(t) {
|
|
6551
|
-
const e = t.getFieldValue("OP") === "AND" ? "&&" : "||", n = e === "&&" ?
|
|
6589
|
+
const e = t.getFieldValue("OP") === "AND" ? "&&" : "||", n = e === "&&" ? u.LOGICAL_AND : u.LOGICAL_OR;
|
|
6552
6590
|
let o = s.valueToCode(t, "A", n), i = s.valueToCode(t, "B", n);
|
|
6553
6591
|
if (!o && !i)
|
|
6554
6592
|
o = "false", i = "false";
|
|
@@ -6607,8 +6645,8 @@ T([
|
|
|
6607
6645
|
}
|
|
6608
6646
|
]);
|
|
6609
6647
|
s.forBlock.logic_ternary_v1 = function(t) {
|
|
6610
|
-
const e = s.valueToCode(t, "IF",
|
|
6611
|
-
return [e + " ? " + n + " : " + o,
|
|
6648
|
+
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";
|
|
6649
|
+
return [e + " ? " + n + " : " + o, u.CONDITIONAL];
|
|
6612
6650
|
};
|
|
6613
6651
|
const Xs = {
|
|
6614
6652
|
customContextMenu: function(t) {
|
|
@@ -6774,42 +6812,42 @@ T([
|
|
|
6774
6812
|
s.forBlock.for_v1 = function(t) {
|
|
6775
6813
|
const e = s.INDENT, n = s.getVariableName(
|
|
6776
6814
|
t.getFieldValue("VAR")
|
|
6777
|
-
), o = s.valueToCode(t, "FROM",
|
|
6815
|
+
), 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
6816
|
s.statementToCode(t, "DO"),
|
|
6779
6817
|
t
|
|
6780
6818
|
);
|
|
6781
6819
|
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} += ${
|
|
6820
|
+
const r = Math.abs(Number(a));
|
|
6821
|
+
return Number(o) <= Number(i) ? `for (${n} = ${o}; ${n} <= ${i}; ${n} += ${r}) {
|
|
6784
6822
|
${c}}
|
|
6785
|
-
` : `for (${n} = ${o}; ${n} >= ${i}; ${n} -= ${
|
|
6823
|
+
` : `for (${n} = ${o}; ${n} >= ${i}; ${n} -= ${r}) {
|
|
6786
6824
|
${c}}
|
|
6787
6825
|
`;
|
|
6788
6826
|
} else {
|
|
6789
|
-
let
|
|
6827
|
+
let r = "", l = o;
|
|
6790
6828
|
!o.match(/^\w+$/) && !C.string.isNumber(o) && (l = s.nameDB_.getDistinctName(
|
|
6791
6829
|
`${n}_from`,
|
|
6792
6830
|
it.NameType.VARIABLE
|
|
6793
|
-
),
|
|
6831
|
+
), r += `var ${l} = ${o};
|
|
6794
6832
|
`);
|
|
6795
6833
|
let _ = i;
|
|
6796
6834
|
!i.match(/^\w+$/) && !C.string.isNumber(i) && (_ = s.nameDB_.getDistinctName(
|
|
6797
6835
|
`${n}_to`,
|
|
6798
6836
|
it.NameType.VARIABLE
|
|
6799
|
-
),
|
|
6837
|
+
), r += `var ${_} = ${i};
|
|
6800
6838
|
`);
|
|
6801
6839
|
const d = s.nameDB_.getDistinctName(
|
|
6802
6840
|
`${n}_by`,
|
|
6803
6841
|
it.NameType.VARIABLE
|
|
6804
6842
|
);
|
|
6805
|
-
return
|
|
6806
|
-
` :
|
|
6807
|
-
`,
|
|
6843
|
+
return r += `var ${d} = `, C.string.isNumber(a) ? r += `${Math.abs(Number(a))};
|
|
6844
|
+
` : r += `Math.abs(${a});
|
|
6845
|
+
`, r += `if (${l} > ${_}) {
|
|
6808
6846
|
${e}${d} = -${d};
|
|
6809
6847
|
}
|
|
6810
|
-
`,
|
|
6848
|
+
`, r += `for (${n} = ${l}; ${d} >= 0 ? ${n} <= ${_} : ${n} >= ${_}; ${n} += ${d}) {
|
|
6811
6849
|
${c}}
|
|
6812
|
-
`,
|
|
6850
|
+
`, r;
|
|
6813
6851
|
}
|
|
6814
6852
|
};
|
|
6815
6853
|
B.register(
|
|
@@ -6852,7 +6890,7 @@ T([
|
|
|
6852
6890
|
s.forBlock.for_each_v1 = function(t) {
|
|
6853
6891
|
const e = s.INDENT, n = s.getVariableName(
|
|
6854
6892
|
t.getFieldValue("VAR")
|
|
6855
|
-
), o = s.valueToCode(t, "LIST",
|
|
6893
|
+
), o = s.valueToCode(t, "LIST", u.ASSIGNMENT) || "[]", i = s.addLoopTrap(
|
|
6856
6894
|
s.statementToCode(t, "DO"),
|
|
6857
6895
|
t
|
|
6858
6896
|
);
|
|
@@ -6862,12 +6900,12 @@ s.forBlock.for_each_v1 = function(t) {
|
|
|
6862
6900
|
it.NameType.VARIABLE
|
|
6863
6901
|
), a += `var ${c} = ${o};
|
|
6864
6902
|
`);
|
|
6865
|
-
const
|
|
6903
|
+
const r = s.nameDB_.getDistinctName(
|
|
6866
6904
|
`${n}_index`,
|
|
6867
6905
|
it.NameType.VARIABLE
|
|
6868
6906
|
);
|
|
6869
|
-
return a += `for (var ${
|
|
6870
|
-
${e}${n} = ${c}[${
|
|
6907
|
+
return a += `for (var ${r} in ${c}) {
|
|
6908
|
+
${e}${n} = ${c}[${r}];
|
|
6871
6909
|
${i}}
|
|
6872
6910
|
`, a;
|
|
6873
6911
|
};
|
|
@@ -6898,7 +6936,7 @@ T([
|
|
|
6898
6936
|
]);
|
|
6899
6937
|
s.forBlock.repeat_v1 = function(t) {
|
|
6900
6938
|
let e = "";
|
|
6901
|
-
t.getField("TIMES") ? e = String(Number(t.getFieldValue("TIMES"))) : e = s.valueToCode(t, "TIMES",
|
|
6939
|
+
t.getField("TIMES") ? e = String(Number(t.getFieldValue("TIMES"))) : e = s.valueToCode(t, "TIMES", u.ASSIGNMENT) || "0";
|
|
6902
6940
|
const n = s.addLoopTrap(
|
|
6903
6941
|
s.statementToCode(t, "DO"),
|
|
6904
6942
|
t
|
|
@@ -6962,7 +7000,7 @@ s.forBlock.while_until_v1 = function(t) {
|
|
|
6962
7000
|
let n = s.valueToCode(
|
|
6963
7001
|
t,
|
|
6964
7002
|
"CONDITION",
|
|
6965
|
-
e === "UNTIL" ?
|
|
7003
|
+
e === "UNTIL" ? u.LOGICAL_NOT : u.NONE
|
|
6966
7004
|
) || "false";
|
|
6967
7005
|
e === "UNTIL" && (n = "!" + n);
|
|
6968
7006
|
const o = s.addLoopTrap(
|
|
@@ -7045,13 +7083,13 @@ T([
|
|
|
7045
7083
|
]);
|
|
7046
7084
|
s.forBlock.math_arithmetic_v1 = function(t) {
|
|
7047
7085
|
const e = {
|
|
7048
|
-
ADD: [" + ",
|
|
7049
|
-
SUBTRACT: [" - ",
|
|
7050
|
-
MULTIPLY: [" * ",
|
|
7051
|
-
DIVIDE: [" / ",
|
|
7052
|
-
POWER: [null,
|
|
7086
|
+
ADD: [" + ", u.ADDITION],
|
|
7087
|
+
SUBTRACT: [" - ", u.SUBTRACTION],
|
|
7088
|
+
MULTIPLY: [" * ", u.MULTIPLICATION],
|
|
7089
|
+
DIVIDE: [" / ", u.DIVISION],
|
|
7090
|
+
POWER: [null, u.NONE]
|
|
7053
7091
|
}, [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})`,
|
|
7092
|
+
return n ? [i + n + a, o] : [`Math.pow(${i}, ${a})`, u.FUNCTION_CALL];
|
|
7055
7093
|
};
|
|
7056
7094
|
T([
|
|
7057
7095
|
{
|
|
@@ -7079,12 +7117,12 @@ T([
|
|
|
7079
7117
|
]);
|
|
7080
7118
|
s.forBlock.math_constant_v1 = function(t) {
|
|
7081
7119
|
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",
|
|
7120
|
+
PI: ["Math.PI", u.MEMBER],
|
|
7121
|
+
E: ["Math.E", u.MEMBER],
|
|
7122
|
+
GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2", u.DIVISION],
|
|
7123
|
+
SQRT2: ["Math.SQRT2", u.MEMBER],
|
|
7124
|
+
SQRT1_2: ["Math.SQRT1_2", u.MEMBER],
|
|
7125
|
+
INFINITY: ["Infinity", u.ATOMIC]
|
|
7088
7126
|
}[t.getFieldValue("CONSTANT")];
|
|
7089
7127
|
};
|
|
7090
7128
|
T([
|
|
@@ -7116,8 +7154,8 @@ T([
|
|
|
7116
7154
|
}
|
|
7117
7155
|
]);
|
|
7118
7156
|
s.forBlock.math_constrain_v1 = function(t) {
|
|
7119
|
-
const e = s.valueToCode(t, "VALUE",
|
|
7120
|
-
return [`Math.min(Math.max(${e}, ${n}), ${o})`,
|
|
7157
|
+
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";
|
|
7158
|
+
return [`Math.min(Math.max(${e}, ${n}), ${o})`, u.FUNCTION_CALL];
|
|
7121
7159
|
};
|
|
7122
7160
|
T([
|
|
7123
7161
|
{
|
|
@@ -7143,8 +7181,8 @@ T([
|
|
|
7143
7181
|
}
|
|
7144
7182
|
]);
|
|
7145
7183
|
s.forBlock.math_modulo_v1 = function(t) {
|
|
7146
|
-
const e = s.valueToCode(t, "DIVIDEND",
|
|
7147
|
-
return [e + " % " + n,
|
|
7184
|
+
const e = s.valueToCode(t, "DIVIDEND", u.MODULUS) || "0", n = s.valueToCode(t, "DIVISOR", u.MODULUS) || "0";
|
|
7185
|
+
return [e + " % " + n, u.MODULUS];
|
|
7148
7186
|
};
|
|
7149
7187
|
T([
|
|
7150
7188
|
{
|
|
@@ -7165,7 +7203,7 @@ T([
|
|
|
7165
7203
|
}
|
|
7166
7204
|
]);
|
|
7167
7205
|
s.forBlock.math_number_v1 = function(t) {
|
|
7168
|
-
const e = Number(t.getFieldValue("NUM")), n = e >= 0 ?
|
|
7206
|
+
const e = Number(t.getFieldValue("NUM")), n = e >= 0 ? u.ATOMIC : u.UNARY_NEGATION;
|
|
7169
7207
|
return [String(e), n];
|
|
7170
7208
|
};
|
|
7171
7209
|
T([
|
|
@@ -7200,17 +7238,17 @@ T([
|
|
|
7200
7238
|
]);
|
|
7201
7239
|
s.forBlock.math_number_property_v1 = function(t) {
|
|
7202
7240
|
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,
|
|
7241
|
+
EVEN: [" % 2 === 0", u.MODULUS, u.EQUALITY],
|
|
7242
|
+
ODD: [" % 2 === 1", u.MODULUS, u.EQUALITY],
|
|
7243
|
+
WHOLE: [" % 1 === 0", u.MODULUS, u.EQUALITY],
|
|
7244
|
+
POSITIVE: [" > 0", u.RELATIONAL, u.RELATIONAL],
|
|
7245
|
+
NEGATIVE: [" < 0", u.RELATIONAL, u.RELATIONAL],
|
|
7246
|
+
DIVISIBLE_BY: [null, u.MODULUS, u.EQUALITY],
|
|
7247
|
+
PRIME: [null, u.NONE, u.FUNCTION_CALL]
|
|
7210
7248
|
}, n = t.getFieldValue("PROPERTY"), [o, i, a] = e[t.getFieldValue("PROPERTY")], c = s.valueToCode(t, "NUMBER_TO_CHECK", i) || "0";
|
|
7211
|
-
let
|
|
7249
|
+
let r;
|
|
7212
7250
|
if (n === "PRIME")
|
|
7213
|
-
|
|
7251
|
+
r = s.provideFunction_(
|
|
7214
7252
|
"mathIsPrime",
|
|
7215
7253
|
`
|
|
7216
7254
|
function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
@@ -7234,11 +7272,11 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
|
7234
7272
|
`
|
|
7235
7273
|
) + "(" + c + ")";
|
|
7236
7274
|
else if (n === "DIVISIBLE_BY") {
|
|
7237
|
-
const l = s.valueToCode(t, "DIVISOR",
|
|
7238
|
-
|
|
7275
|
+
const l = s.valueToCode(t, "DIVISOR", u.MODULUS) || "0";
|
|
7276
|
+
r = c + " % " + l + " === 0";
|
|
7239
7277
|
} else
|
|
7240
|
-
|
|
7241
|
-
return [
|
|
7278
|
+
r = c + o;
|
|
7279
|
+
return [r, a];
|
|
7242
7280
|
};
|
|
7243
7281
|
T([
|
|
7244
7282
|
{
|
|
@@ -7276,13 +7314,13 @@ s.forBlock.math_on_list_v1 = function(t) {
|
|
|
7276
7314
|
let n, o;
|
|
7277
7315
|
switch (e) {
|
|
7278
7316
|
case "SUM":
|
|
7279
|
-
n = s.valueToCode(t, "LIST",
|
|
7317
|
+
n = s.valueToCode(t, "LIST", u.MEMBER) || "[]", o = n + ".reduce(function(x, y) {return x + y;}, 0)";
|
|
7280
7318
|
break;
|
|
7281
7319
|
case "MIN":
|
|
7282
|
-
n = s.valueToCode(t, "LIST",
|
|
7320
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = "Math.min.apply(null, " + n + ")";
|
|
7283
7321
|
break;
|
|
7284
7322
|
case "MAX":
|
|
7285
|
-
n = s.valueToCode(t, "LIST",
|
|
7323
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = "Math.max.apply(null, " + n + ")";
|
|
7286
7324
|
break;
|
|
7287
7325
|
case "AVERAGE": {
|
|
7288
7326
|
const i = s.provideFunction_(
|
|
@@ -7293,7 +7331,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
7293
7331
|
}
|
|
7294
7332
|
`
|
|
7295
7333
|
);
|
|
7296
|
-
n = s.valueToCode(t, "LIST",
|
|
7334
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7297
7335
|
break;
|
|
7298
7336
|
}
|
|
7299
7337
|
case "MEDIAN": {
|
|
@@ -7312,7 +7350,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
7312
7350
|
}
|
|
7313
7351
|
`
|
|
7314
7352
|
);
|
|
7315
|
-
n = s.valueToCode(t, "LIST",
|
|
7353
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7316
7354
|
break;
|
|
7317
7355
|
}
|
|
7318
7356
|
case "MODE": {
|
|
@@ -7349,7 +7387,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(values) {
|
|
|
7349
7387
|
}
|
|
7350
7388
|
`
|
|
7351
7389
|
);
|
|
7352
|
-
n = s.valueToCode(t, "LIST",
|
|
7390
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7353
7391
|
break;
|
|
7354
7392
|
}
|
|
7355
7393
|
case "STD_DEV": {
|
|
@@ -7369,7 +7407,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
|
|
|
7369
7407
|
}
|
|
7370
7408
|
`
|
|
7371
7409
|
);
|
|
7372
|
-
n = s.valueToCode(t, "LIST",
|
|
7410
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7373
7411
|
break;
|
|
7374
7412
|
}
|
|
7375
7413
|
case "RANDOM": {
|
|
@@ -7382,13 +7420,13 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
|
|
7382
7420
|
}
|
|
7383
7421
|
`
|
|
7384
7422
|
);
|
|
7385
|
-
n = s.valueToCode(t, "LIST",
|
|
7423
|
+
n = s.valueToCode(t, "LIST", u.NONE) || "[]", o = i + "(" + n + ")";
|
|
7386
7424
|
break;
|
|
7387
7425
|
}
|
|
7388
7426
|
default:
|
|
7389
7427
|
throw Error("Unknown operator: " + e);
|
|
7390
7428
|
}
|
|
7391
|
-
return [o,
|
|
7429
|
+
return [o, u.FUNCTION_CALL];
|
|
7392
7430
|
};
|
|
7393
7431
|
T([
|
|
7394
7432
|
{
|
|
@@ -7401,7 +7439,7 @@ T([
|
|
|
7401
7439
|
}
|
|
7402
7440
|
]);
|
|
7403
7441
|
s.forBlock.math_random_float_v1 = function() {
|
|
7404
|
-
return ["Math.random()",
|
|
7442
|
+
return ["Math.random()", u.FUNCTION_CALL];
|
|
7405
7443
|
};
|
|
7406
7444
|
T([
|
|
7407
7445
|
{
|
|
@@ -7427,7 +7465,7 @@ T([
|
|
|
7427
7465
|
}
|
|
7428
7466
|
]);
|
|
7429
7467
|
s.forBlock.math_random_int_v1 = function(t) {
|
|
7430
|
-
const e = s.valueToCode(t, "FROM",
|
|
7468
|
+
const e = s.valueToCode(t, "FROM", u.NONE) || "0", n = s.valueToCode(t, "TO", u.NONE) || "0";
|
|
7431
7469
|
return [s.provideFunction_(
|
|
7432
7470
|
"mathRandomInt",
|
|
7433
7471
|
`
|
|
@@ -7441,7 +7479,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
|
|
7441
7479
|
return Math.floor(Math.random() * (b - a + 1) + a);
|
|
7442
7480
|
}
|
|
7443
7481
|
`
|
|
7444
|
-
) + "(" + e + ", " + n + ")",
|
|
7482
|
+
) + "(" + e + ", " + n + ")", u.FUNCTION_CALL];
|
|
7445
7483
|
};
|
|
7446
7484
|
T([
|
|
7447
7485
|
{
|
|
@@ -7470,7 +7508,7 @@ T([
|
|
|
7470
7508
|
}
|
|
7471
7509
|
]);
|
|
7472
7510
|
s.forBlock.math_round_v1 = function(t) {
|
|
7473
|
-
const e = t.getFieldValue("OP"), n = s.valueToCode(t, "NUM",
|
|
7511
|
+
const e = t.getFieldValue("OP"), n = s.valueToCode(t, "NUM", u.NONE) || "0";
|
|
7474
7512
|
let o = "";
|
|
7475
7513
|
switch (e) {
|
|
7476
7514
|
case "ROUND":
|
|
@@ -7483,7 +7521,7 @@ s.forBlock.math_round_v1 = function(t) {
|
|
|
7483
7521
|
o = `Math.floor(${n})`;
|
|
7484
7522
|
break;
|
|
7485
7523
|
}
|
|
7486
|
-
return [o,
|
|
7524
|
+
return [o, u.FUNCTION_CALL];
|
|
7487
7525
|
};
|
|
7488
7526
|
T([
|
|
7489
7527
|
{
|
|
@@ -7519,8 +7557,8 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7519
7557
|
const e = t.getFieldValue("OP");
|
|
7520
7558
|
let n, o;
|
|
7521
7559
|
if (e === "NEG")
|
|
7522
|
-
return o = s.valueToCode(t, "NUM",
|
|
7523
|
-
switch (o = s.valueToCode(t, "NUM",
|
|
7560
|
+
return o = s.valueToCode(t, "NUM", u.UNARY_NEGATION) || "0", o[0] === "-" && (o = " " + o), n = "-" + o, [n, u.UNARY_NEGATION];
|
|
7561
|
+
switch (o = s.valueToCode(t, "NUM", u.NONE) || "0", e) {
|
|
7524
7562
|
case "ROOT":
|
|
7525
7563
|
n = `Math.sqrt(${o})`;
|
|
7526
7564
|
break;
|
|
@@ -7538,7 +7576,7 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7538
7576
|
break;
|
|
7539
7577
|
}
|
|
7540
7578
|
if (n)
|
|
7541
|
-
return [n,
|
|
7579
|
+
return [n, u.FUNCTION_CALL];
|
|
7542
7580
|
switch (e) {
|
|
7543
7581
|
case "LOG10":
|
|
7544
7582
|
n = `Math.log(${o}) / Math.log(10)`;
|
|
@@ -7546,7 +7584,7 @@ s.forBlock.math_single_v1 = function(t) {
|
|
|
7546
7584
|
default:
|
|
7547
7585
|
throw Error("Unknown math operator: " + e);
|
|
7548
7586
|
}
|
|
7549
|
-
return [n,
|
|
7587
|
+
return [n, u.DIVISION];
|
|
7550
7588
|
};
|
|
7551
7589
|
T([
|
|
7552
7590
|
{
|
|
@@ -7580,7 +7618,7 @@ T([
|
|
|
7580
7618
|
s.forBlock.math_trig_v1 = function(t) {
|
|
7581
7619
|
let e;
|
|
7582
7620
|
const n = t.getFieldValue("OP");
|
|
7583
|
-
n === "SIN" || n === "COS" || n === "TAN" ? e = s.valueToCode(t, "NUM",
|
|
7621
|
+
n === "SIN" || n === "COS" || n === "TAN" ? e = s.valueToCode(t, "NUM", u.DIVISION) || "0" : e = s.valueToCode(t, "NUM", u.NONE) || "0";
|
|
7584
7622
|
let o;
|
|
7585
7623
|
switch (n) {
|
|
7586
7624
|
case "SIN":
|
|
@@ -7594,7 +7632,7 @@ s.forBlock.math_trig_v1 = function(t) {
|
|
|
7594
7632
|
break;
|
|
7595
7633
|
}
|
|
7596
7634
|
if (o)
|
|
7597
|
-
return [o,
|
|
7635
|
+
return [o, u.FUNCTION_CALL];
|
|
7598
7636
|
switch (n) {
|
|
7599
7637
|
case "ASIN":
|
|
7600
7638
|
o = `Math.asin(${e}) / Math.PI * 180`;
|
|
@@ -7608,7 +7646,7 @@ s.forBlock.math_trig_v1 = function(t) {
|
|
|
7608
7646
|
default:
|
|
7609
7647
|
throw Error("Unknown math operator: " + n);
|
|
7610
7648
|
}
|
|
7611
|
-
return [o,
|
|
7649
|
+
return [o, u.DIVISION];
|
|
7612
7650
|
};
|
|
7613
7651
|
const zs = C.xml, Zs = {
|
|
7614
7652
|
init: function() {
|
|
@@ -7627,7 +7665,7 @@ E.object_create_item_v1 = ta;
|
|
|
7627
7665
|
const ea = {
|
|
7628
7666
|
init: function() {
|
|
7629
7667
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
7630
|
-
new
|
|
7668
|
+
new Et.MutatorIcon(
|
|
7631
7669
|
["object_create_item_v1"],
|
|
7632
7670
|
this
|
|
7633
7671
|
)
|
|
@@ -7693,7 +7731,7 @@ const ea = {
|
|
|
7693
7731
|
},
|
|
7694
7732
|
updateShape_: function() {
|
|
7695
7733
|
for (let t = 0; t < this.itemCount_; t++)
|
|
7696
|
-
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(
|
|
7734
|
+
this.getInput("ADD" + t) || this.appendValueInput("ADD" + t).setAlign(v.Align.RIGHT).appendField(new ft("key"), "KEY" + t);
|
|
7697
7735
|
for (let t = this.itemCount_; this.getInput("ADD" + t); t++)
|
|
7698
7736
|
this.removeInput("ADD" + t);
|
|
7699
7737
|
}
|
|
@@ -7703,10 +7741,10 @@ s.forBlock.object_create_v1 = function(t) {
|
|
|
7703
7741
|
const e = t;
|
|
7704
7742
|
let n = "{";
|
|
7705
7743
|
for (let o = 0; o < e.itemCount_; o++) {
|
|
7706
|
-
const i = e.getFieldValue("KEY" + o), a = s.valueToCode(e, "ADD" + o,
|
|
7744
|
+
const i = e.getFieldValue("KEY" + o), a = s.valueToCode(e, "ADD" + o, u.ATOMIC) || null;
|
|
7707
7745
|
n += s.quote_(i) + ": " + a, o < e.itemCount_ - 1 && (n += ", ");
|
|
7708
7746
|
}
|
|
7709
|
-
return n += "}", [n,
|
|
7747
|
+
return n += "}", [n, u.ATOMIC];
|
|
7710
7748
|
};
|
|
7711
7749
|
T([
|
|
7712
7750
|
{
|
|
@@ -7771,7 +7809,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
7771
7809
|
}
|
|
7772
7810
|
}
|
|
7773
7811
|
`
|
|
7774
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7812
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''";
|
|
7775
7813
|
return `${e}(${n}, ${o});
|
|
7776
7814
|
`;
|
|
7777
7815
|
};
|
|
@@ -7794,7 +7832,7 @@ T([
|
|
|
7794
7832
|
}
|
|
7795
7833
|
]);
|
|
7796
7834
|
s.forBlock.object_from_json_v1 = function(t) {
|
|
7797
|
-
return [`__parseJsonV1__(${s.valueToCode(t, "JSON",
|
|
7835
|
+
return [`__parseJsonV1__(${s.valueToCode(t, "JSON", u.NONE) || "''"})`, u.FUNCTION_CALL];
|
|
7798
7836
|
};
|
|
7799
7837
|
T([
|
|
7800
7838
|
{
|
|
@@ -7850,8 +7888,8 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
7850
7888
|
}
|
|
7851
7889
|
}
|
|
7852
7890
|
`
|
|
7853
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7854
|
-
return [`${e}(${n}, ${o})`,
|
|
7891
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''";
|
|
7892
|
+
return [`${e}(${n}, ${o})`, u.FUNCTION_CALL];
|
|
7855
7893
|
};
|
|
7856
7894
|
T([
|
|
7857
7895
|
{
|
|
@@ -7915,7 +7953,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key, val) {
|
|
|
7915
7953
|
}
|
|
7916
7954
|
}
|
|
7917
7955
|
`
|
|
7918
|
-
), n = s.valueToCode(t, "OBJECT",
|
|
7956
|
+
), n = s.valueToCode(t, "OBJECT", u.ATOMIC) || "null", o = s.valueToCode(t, "KEY", u.ATOMIC) || "''", i = s.valueToCode(t, "TO", u.ATOMIC) || "null";
|
|
7919
7957
|
return `${e}(${n}, ${o}, ${i});
|
|
7920
7958
|
`;
|
|
7921
7959
|
};
|
|
@@ -7938,7 +7976,7 @@ T([
|
|
|
7938
7976
|
}
|
|
7939
7977
|
]);
|
|
7940
7978
|
s.forBlock.object_to_json_v1 = function(t) {
|
|
7941
|
-
return [`__jsonStringifyV1__(${s.valueToCode(t, "OBJECT",
|
|
7979
|
+
return [`__jsonStringifyV1__(${s.valueToCode(t, "OBJECT", u.NONE) || "null"})`, u.FUNCTION_CALL];
|
|
7942
7980
|
};
|
|
7943
7981
|
const Sn = C.xml, na = {
|
|
7944
7982
|
init: function() {
|
|
@@ -7948,7 +7986,7 @@ const Sn = C.xml, na = {
|
|
|
7948
7986
|
E.procedure_def_container_v1 = na;
|
|
7949
7987
|
const oa = {
|
|
7950
7988
|
init: function() {
|
|
7951
|
-
const t = new
|
|
7989
|
+
const t = new ft(We.DEFAULT_ARG);
|
|
7952
7990
|
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
7991
|
},
|
|
7954
7992
|
validator_: function(t) {
|
|
@@ -7972,11 +8010,11 @@ E.procedure_def_item_v1 = oa;
|
|
|
7972
8010
|
const ia = {
|
|
7973
8011
|
init: function() {
|
|
7974
8012
|
this.withReturn = !1, this.args = [];
|
|
7975
|
-
const t = new
|
|
8013
|
+
const t = new ft(
|
|
7976
8014
|
We.findLegalName("", this)
|
|
7977
8015
|
);
|
|
7978
8016
|
t.setValidator(We.rename), t.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(t, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
|
|
7979
|
-
new
|
|
8017
|
+
new Et.MutatorIcon(
|
|
7980
8018
|
["procedure_def_item_v1"],
|
|
7981
8019
|
this
|
|
7982
8020
|
)
|
|
@@ -8133,7 +8171,7 @@ const sa = C.xml, aa = {
|
|
|
8133
8171
|
E.procedure_return_v1 = aa;
|
|
8134
8172
|
s.forBlock.procedure_return_v1 = function(t) {
|
|
8135
8173
|
const e = t;
|
|
8136
|
-
return e.withReturn ? `return ${s.valueToCode(e, "VALUE",
|
|
8174
|
+
return e.withReturn ? `return ${s.valueToCode(e, "VALUE", u.NONE) || "null"};
|
|
8137
8175
|
` : `return;
|
|
8138
8176
|
`;
|
|
8139
8177
|
};
|
|
@@ -8150,10 +8188,10 @@ const ca = {
|
|
|
8150
8188
|
}, 0);
|
|
8151
8189
|
},
|
|
8152
8190
|
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(
|
|
8191
|
+
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
8192
|
},
|
|
8155
8193
|
ensureBlocks_: function() {
|
|
8156
|
-
this.isInsertionMarker() ||
|
|
8194
|
+
this.isInsertionMarker() || F(this, [
|
|
8157
8195
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
8158
8196
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
8159
8197
|
["DATA", "__data__", "x-runtime-lib.data", !0]
|
|
@@ -8162,7 +8200,7 @@ const ca = {
|
|
|
8162
8200
|
};
|
|
8163
8201
|
E.download_resource_v1 = ca;
|
|
8164
8202
|
s.forBlock.download_resource_v1 = function(t) {
|
|
8165
|
-
const e = s.valueToCode(t, "ASSET",
|
|
8203
|
+
const e = s.valueToCode(t, "ASSET", u.ATOMIC) || null, n = s.statementToCode(t, "HANDLE");
|
|
8166
8204
|
return `{
|
|
8167
8205
|
var res = __downloadResourceV1__(${e});
|
|
8168
8206
|
var __success__ = res.success;
|
|
@@ -8182,8 +8220,8 @@ function io(t) {
|
|
|
8182
8220
|
n.push({
|
|
8183
8221
|
id: i.id,
|
|
8184
8222
|
name: c
|
|
8185
|
-
}), i.children.forEach((
|
|
8186
|
-
o(
|
|
8223
|
+
}), i.children.forEach((r) => {
|
|
8224
|
+
o(r, c);
|
|
8187
8225
|
});
|
|
8188
8226
|
}
|
|
8189
8227
|
return o(e.dirTree, ""), n;
|
|
@@ -8301,16 +8339,16 @@ const pa = {
|
|
|
8301
8339
|
}, 0);
|
|
8302
8340
|
},
|
|
8303
8341
|
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(
|
|
8342
|
+
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
8343
|
},
|
|
8306
8344
|
updateShadow_: function() {
|
|
8307
8345
|
if (this.isInsertionMarker())
|
|
8308
8346
|
return;
|
|
8309
|
-
const t =
|
|
8347
|
+
const t = dt("");
|
|
8310
8348
|
this.getInput("NAME")?.setShadowDom(t);
|
|
8311
8349
|
},
|
|
8312
8350
|
ensureBlocks_: function() {
|
|
8313
|
-
this.isInsertionMarker() ||
|
|
8351
|
+
this.isInsertionMarker() || F(this, [
|
|
8314
8352
|
["SUCCESS", "__success__", "x-runtime-lib.success", !0],
|
|
8315
8353
|
["MESSAGE", "__message__", "x-runtime-lib.message", !0],
|
|
8316
8354
|
["RESULT", "__result__", "x-runtime-lib.result", !0]
|
|
@@ -8319,7 +8357,7 @@ const pa = {
|
|
|
8319
8357
|
};
|
|
8320
8358
|
E.upload_resource_v1 = pa;
|
|
8321
8359
|
s.forBlock.upload_resource_v1 = function(t) {
|
|
8322
|
-
const e = s.valueToCode(t, "NAME",
|
|
8360
|
+
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
8361
|
return `{
|
|
8324
8362
|
var res = __uploadResourceV1__(${e}, ${n}, ${o});
|
|
8325
8363
|
var __success__ = res.success;
|
|
@@ -8348,11 +8386,11 @@ T([
|
|
|
8348
8386
|
}
|
|
8349
8387
|
]);
|
|
8350
8388
|
s.forBlock.text_v1 = function(t) {
|
|
8351
|
-
return [s.quote_(t.getFieldValue("TEXT")),
|
|
8389
|
+
return [s.quote_(t.getFieldValue("TEXT")), u.ATOMIC];
|
|
8352
8390
|
};
|
|
8353
8391
|
const da = /^\s*'([^']|\\')*'\s*$/;
|
|
8354
8392
|
function oe(t) {
|
|
8355
|
-
return da.test(t) ? [t,
|
|
8393
|
+
return da.test(t) ? [t, u.ATOMIC] : [`String(${t})`, u.FUNCTION_CALL];
|
|
8356
8394
|
}
|
|
8357
8395
|
B.register(
|
|
8358
8396
|
"text_append_tooltip_v1",
|
|
@@ -8386,7 +8424,7 @@ s.forBlock.text_append_v1 = function(t) {
|
|
|
8386
8424
|
const e = s.nameDB_?.getName(
|
|
8387
8425
|
t.getFieldValue("VAR"),
|
|
8388
8426
|
it.NameType.VARIABLE
|
|
8389
|
-
), n = s.valueToCode(t, "TEXT",
|
|
8427
|
+
), n = s.valueToCode(t, "TEXT", u.NONE) || "''";
|
|
8390
8428
|
return `${e} += ${oe(n)};
|
|
8391
8429
|
`;
|
|
8392
8430
|
};
|
|
@@ -8424,7 +8462,7 @@ s.forBlock.text_change_case_v1 = function(t) {
|
|
|
8424
8462
|
}[t.getFieldValue("CASE")], o = s.valueToCode(
|
|
8425
8463
|
t,
|
|
8426
8464
|
"TEXT",
|
|
8427
|
-
n ?
|
|
8465
|
+
n ? u.MEMBER : u.NONE
|
|
8428
8466
|
) || "''";
|
|
8429
8467
|
let i = "";
|
|
8430
8468
|
return n ? i = o + n : i = s.provideFunction_(
|
|
@@ -8434,7 +8472,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
|
|
8434
8472
|
return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase();
|
|
8435
8473
|
}
|
|
8436
8474
|
`
|
|
8437
|
-
) + "(" + o + ")", [i,
|
|
8475
|
+
) + "(" + o + ")", [i, u.FUNCTION_CALL];
|
|
8438
8476
|
};
|
|
8439
8477
|
T([
|
|
8440
8478
|
{
|
|
@@ -8460,8 +8498,8 @@ T([
|
|
|
8460
8498
|
}
|
|
8461
8499
|
]);
|
|
8462
8500
|
s.forBlock.text_char_at_v1 = function(t) {
|
|
8463
|
-
const e = s.valueToCode(t, "VALUE",
|
|
8464
|
-
return [`${e}.charAt(${n})`,
|
|
8501
|
+
const e = s.valueToCode(t, "VALUE", u.MEMBER) || "[]", n = s.getAdjusted(t, "AT");
|
|
8502
|
+
return [`${e}.charAt(${n})`, u.FUNCTION_CALL];
|
|
8465
8503
|
};
|
|
8466
8504
|
T([
|
|
8467
8505
|
{
|
|
@@ -8487,7 +8525,7 @@ T([
|
|
|
8487
8525
|
}
|
|
8488
8526
|
]);
|
|
8489
8527
|
s.forBlock.text_count_v1 = function(t) {
|
|
8490
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8528
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", n = s.valueToCode(t, "SUBSTR", u.NONE) || "''";
|
|
8491
8529
|
return [`${s.provideFunction_(
|
|
8492
8530
|
"textCount",
|
|
8493
8531
|
`
|
|
@@ -8499,7 +8537,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
|
|
8499
8537
|
}
|
|
8500
8538
|
}
|
|
8501
8539
|
`
|
|
8502
|
-
)}(${e}, ${n})`,
|
|
8540
|
+
)}(${e}, ${n})`, u.FUNCTION_CALL];
|
|
8503
8541
|
};
|
|
8504
8542
|
T([
|
|
8505
8543
|
{
|
|
@@ -8533,8 +8571,8 @@ T([
|
|
|
8533
8571
|
}
|
|
8534
8572
|
]);
|
|
8535
8573
|
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})`,
|
|
8574
|
+
const e = t.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", n = s.valueToCode(t, "TEXT", u.MEMBER) || "''", o = s.valueToCode(t, "SUBSTR", u.NONE) || "''";
|
|
8575
|
+
return [`${n}.${e}(${o})`, u.FUNCTION_CALL];
|
|
8538
8576
|
};
|
|
8539
8577
|
T([
|
|
8540
8578
|
{
|
|
@@ -8554,7 +8592,7 @@ T([
|
|
|
8554
8592
|
}
|
|
8555
8593
|
]);
|
|
8556
8594
|
s.forBlock.text_is_empty_v1 = function(t) {
|
|
8557
|
-
return [`!${s.valueToCode(t, "VALUE",
|
|
8595
|
+
return [`!${s.valueToCode(t, "VALUE", u.MEMBER) || "''"}.length`, u.LOGICAL_NOT];
|
|
8558
8596
|
};
|
|
8559
8597
|
const ha = C.xml, fa = {
|
|
8560
8598
|
itemCount_: 0,
|
|
@@ -8623,7 +8661,7 @@ const ha = C.xml, fa = {
|
|
|
8623
8661
|
for (let t = 0; t < this.itemCount_; t++)
|
|
8624
8662
|
if (!this.getInput("ADD" + t)) {
|
|
8625
8663
|
const e = this.appendValueInput("ADD" + t).setAlign(
|
|
8626
|
-
|
|
8664
|
+
v.Align.RIGHT
|
|
8627
8665
|
);
|
|
8628
8666
|
t === 0 && e.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
8629
8667
|
}
|
|
@@ -8631,7 +8669,7 @@ const ha = C.xml, fa = {
|
|
|
8631
8669
|
this.removeInput("ADD" + t);
|
|
8632
8670
|
}
|
|
8633
8671
|
}, ma = function() {
|
|
8634
|
-
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new
|
|
8672
|
+
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Et.MutatorIcon(["text_join_item_v1"], this));
|
|
8635
8673
|
};
|
|
8636
8674
|
B.registerMutator(
|
|
8637
8675
|
"text_join_mutator_v1",
|
|
@@ -8676,20 +8714,20 @@ s.forBlock.text_join_v1 = function(t) {
|
|
|
8676
8714
|
const e = t;
|
|
8677
8715
|
switch (e.itemCount_) {
|
|
8678
8716
|
case 0:
|
|
8679
|
-
return ["''",
|
|
8717
|
+
return ["''", u.ATOMIC];
|
|
8680
8718
|
case 1: {
|
|
8681
|
-
const n = s.valueToCode(e, "ADD0",
|
|
8719
|
+
const n = s.valueToCode(e, "ADD0", u.NONE) || "''";
|
|
8682
8720
|
return oe(n);
|
|
8683
8721
|
}
|
|
8684
8722
|
case 2: {
|
|
8685
|
-
const n = s.valueToCode(e, "ADD0",
|
|
8686
|
-
return [oe(n)[0] + " + " + oe(o)[0],
|
|
8723
|
+
const n = s.valueToCode(e, "ADD0", u.NONE) || "''", o = s.valueToCode(e, "ADD1", u.NONE) || "''";
|
|
8724
|
+
return [oe(n)[0] + " + " + oe(o)[0], u.ADDITION];
|
|
8687
8725
|
}
|
|
8688
8726
|
default: {
|
|
8689
8727
|
const n = new Array(e.itemCount_);
|
|
8690
8728
|
for (let i = 0; i < e.itemCount_; i++)
|
|
8691
|
-
n[i] = s.valueToCode(e, "ADD" + i,
|
|
8692
|
-
return ["[" + n.join(",") + "].join('')",
|
|
8729
|
+
n[i] = s.valueToCode(e, "ADD" + i, u.NONE) || "''";
|
|
8730
|
+
return ["[" + n.join(",") + "].join('')", u.FUNCTION_CALL];
|
|
8693
8731
|
}
|
|
8694
8732
|
}
|
|
8695
8733
|
};
|
|
@@ -8711,7 +8749,7 @@ T([
|
|
|
8711
8749
|
}
|
|
8712
8750
|
]);
|
|
8713
8751
|
s.forBlock.text_length_v1 = function(t) {
|
|
8714
|
-
return [`${s.valueToCode(t, "VALUE",
|
|
8752
|
+
return [`${s.valueToCode(t, "VALUE", u.MEMBER) || "''"}.length`, u.MEMBER];
|
|
8715
8753
|
};
|
|
8716
8754
|
T([
|
|
8717
8755
|
{
|
|
@@ -8742,7 +8780,7 @@ T([
|
|
|
8742
8780
|
}
|
|
8743
8781
|
]);
|
|
8744
8782
|
s.forBlock.text_replace_v1 = function(t) {
|
|
8745
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8783
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", n = s.valueToCode(t, "FROM", u.NONE) || "''", o = s.valueToCode(t, "TO", u.NONE) || "''";
|
|
8746
8784
|
return [`${s.provideFunction_(
|
|
8747
8785
|
"textReplace",
|
|
8748
8786
|
`
|
|
@@ -8752,7 +8790,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
|
8752
8790
|
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
|
8753
8791
|
}
|
|
8754
8792
|
`
|
|
8755
|
-
)}(${e}, ${n}, ${o})`,
|
|
8793
|
+
)}(${e}, ${n}, ${o})`, u.FUNCTION_CALL];
|
|
8756
8794
|
};
|
|
8757
8795
|
T([
|
|
8758
8796
|
{
|
|
@@ -8773,7 +8811,7 @@ T([
|
|
|
8773
8811
|
}
|
|
8774
8812
|
]);
|
|
8775
8813
|
s.forBlock.text_reverse_v1 = function(t) {
|
|
8776
|
-
return [(s.valueToCode(t, "TEXT",
|
|
8814
|
+
return [(s.valueToCode(t, "TEXT", u.MEMBER) || "''") + ".split('').reverse().join('')", u.FUNCTION_CALL];
|
|
8777
8815
|
};
|
|
8778
8816
|
T([
|
|
8779
8817
|
{
|
|
@@ -8799,8 +8837,8 @@ T([
|
|
|
8799
8837
|
}
|
|
8800
8838
|
]);
|
|
8801
8839
|
s.forBlock.text_split_v1 = function(t) {
|
|
8802
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8803
|
-
return [`${e}.split(${n})`,
|
|
8840
|
+
const e = s.valueToCode(t, "TEXT", u.MEMBER) || "''", n = s.valueToCode(t, "DELIM", u.NONE) || "''";
|
|
8841
|
+
return [`${e}.split(${n})`, u.FUNCTION_CALL];
|
|
8804
8842
|
};
|
|
8805
8843
|
T([
|
|
8806
8844
|
{
|
|
@@ -8831,8 +8869,8 @@ T([
|
|
|
8831
8869
|
}
|
|
8832
8870
|
]);
|
|
8833
8871
|
s.forBlock.text_substring_v1 = function(t) {
|
|
8834
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8835
|
-
return [`${e}.slice(${n}, ${o})`,
|
|
8872
|
+
const e = s.valueToCode(t, "TEXT", u.MEMBER) || "''", n = s.getAdjusted(t, "START"), o = s.getAdjusted(t, "END", 1);
|
|
8873
|
+
return [`${e}.slice(${n}, ${o})`, u.FUNCTION_CALL];
|
|
8836
8874
|
};
|
|
8837
8875
|
T([
|
|
8838
8876
|
{
|
|
@@ -8861,12 +8899,12 @@ T([
|
|
|
8861
8899
|
}
|
|
8862
8900
|
]);
|
|
8863
8901
|
s.forBlock.text_trim_v1 = function(t) {
|
|
8864
|
-
const e = s.valueToCode(t, "TEXT",
|
|
8902
|
+
const e = s.valueToCode(t, "TEXT", u.NONE) || "''", o = {
|
|
8865
8903
|
BOTH: 0,
|
|
8866
8904
|
LEFT: 1,
|
|
8867
8905
|
RIGHT: 2
|
|
8868
8906
|
}[t.getFieldValue("MODE")];
|
|
8869
|
-
return [`__trimV1__(${e}, ${o})`,
|
|
8907
|
+
return [`__trimV1__(${e}, ${o})`, u.ATOMIC];
|
|
8870
8908
|
};
|
|
8871
8909
|
const Ta = {
|
|
8872
8910
|
init: function() {
|
|
@@ -8879,7 +8917,7 @@ const Ta = {
|
|
|
8879
8917
|
this.updateShape_(), this.updateShadow_();
|
|
8880
8918
|
},
|
|
8881
8919
|
updateShape_: function() {
|
|
8882
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
8920
|
+
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
8921
|
},
|
|
8884
8922
|
updateShadow_: function() {
|
|
8885
8923
|
if (this.isInsertionMarker())
|
|
@@ -8896,7 +8934,7 @@ const Ta = {
|
|
|
8896
8934
|
};
|
|
8897
8935
|
E.create_timer_v1 = Ta;
|
|
8898
8936
|
s.forBlock.create_timer_v1 = function(t) {
|
|
8899
|
-
const e = s.valueToCode(t, "INTERVAL",
|
|
8937
|
+
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
8938
|
return `__createTimerV1__(${e}, ${n}, ${o}, ${i}, function() {
|
|
8901
8939
|
${a}});
|
|
8902
8940
|
`;
|
|
@@ -8920,7 +8958,7 @@ T([
|
|
|
8920
8958
|
}
|
|
8921
8959
|
]);
|
|
8922
8960
|
s.forBlock.delay_v1 = function(t) {
|
|
8923
|
-
return `__delayV1__(${s.valueToCode(t, "DURATION",
|
|
8961
|
+
return `__delayV1__(${s.valueToCode(t, "DURATION", u.ATOMIC) || "0"});
|
|
8924
8962
|
`;
|
|
8925
8963
|
};
|
|
8926
8964
|
const Ea = {
|
|
@@ -8955,12 +8993,12 @@ const Ea = {
|
|
|
8955
8993
|
}, ga = function(t) {
|
|
8956
8994
|
return function() {
|
|
8957
8995
|
const e = t.workspace, o = t.getField("VAR").getVariable();
|
|
8958
|
-
|
|
8996
|
+
St.renameVariable(e, o);
|
|
8959
8997
|
};
|
|
8960
8998
|
}, Aa = function(t) {
|
|
8961
8999
|
return function() {
|
|
8962
9000
|
const n = t.getField("VAR").getVariable();
|
|
8963
|
-
n &&
|
|
9001
|
+
n && St.deleteVariable(n.getWorkspace(), n, t);
|
|
8964
9002
|
};
|
|
8965
9003
|
};
|
|
8966
9004
|
B.registerMixin(
|
|
@@ -8988,7 +9026,7 @@ s.forBlock.variable_get_v1 = function(t) {
|
|
|
8988
9026
|
return [s.nameDB_.getName(
|
|
8989
9027
|
t.getFieldValue("VAR"),
|
|
8990
9028
|
it.NameType.VARIABLE
|
|
8991
|
-
),
|
|
9029
|
+
), u.ATOMIC];
|
|
8992
9030
|
};
|
|
8993
9031
|
T([
|
|
8994
9032
|
{
|
|
@@ -9017,7 +9055,7 @@ s.forBlock.variable_set_v1 = function(t) {
|
|
|
9017
9055
|
const e = s.nameDB_.getName(
|
|
9018
9056
|
t.getFieldValue("VAR"),
|
|
9019
9057
|
it.NameType.VARIABLE
|
|
9020
|
-
), n = s.valueToCode(t, "VALUE",
|
|
9058
|
+
), n = s.valueToCode(t, "VALUE", u.ASSIGNMENT) || "0";
|
|
9021
9059
|
return `${e} = ${n};
|
|
9022
9060
|
`;
|
|
9023
9061
|
};
|
|
@@ -9035,19 +9073,19 @@ Mn.setPrompt(async (t, e, n) => {
|
|
|
9035
9073
|
});
|
|
9036
9074
|
o !== void 0 && n(String(o));
|
|
9037
9075
|
});
|
|
9038
|
-
const
|
|
9039
|
-
|
|
9076
|
+
const zt = O.prototype;
|
|
9077
|
+
zt.doClassValidation_ = function(t) {
|
|
9040
9078
|
return t;
|
|
9041
9079
|
};
|
|
9042
|
-
const Ia =
|
|
9043
|
-
|
|
9080
|
+
const Ia = zt.doValueUpdate_;
|
|
9081
|
+
zt.doValueUpdate_ = function(t) {
|
|
9044
9082
|
Ia.call(this, t), this.selectedOption && this.selectedOption[1] !== t && (this.selectedOption = null);
|
|
9045
9083
|
};
|
|
9046
|
-
const Oa =
|
|
9047
|
-
|
|
9084
|
+
const Oa = zt.getText_;
|
|
9085
|
+
zt.getText_ = function() {
|
|
9048
9086
|
if (this.selectedOption)
|
|
9049
9087
|
return Oa.call(this);
|
|
9050
|
-
const { i18n: t } =
|
|
9088
|
+
const { i18n: t } = kt, e = this.getSourceBlock();
|
|
9051
9089
|
if (this.name === "APP")
|
|
9052
9090
|
return e.app.name;
|
|
9053
9091
|
if (this.name === "PAGE")
|
|
@@ -9068,7 +9106,7 @@ Qt.getText_ = function() {
|
|
|
9068
9106
|
return console.log(e.event), Ie(n, o);
|
|
9069
9107
|
} else if (this.name === "METHOD") {
|
|
9070
9108
|
const { kind: n, names: o } = e.method;
|
|
9071
|
-
return
|
|
9109
|
+
return ye(n, o);
|
|
9072
9110
|
} else {
|
|
9073
9111
|
if (this.name === "SPACE")
|
|
9074
9112
|
return e.space.name;
|
|
@@ -9092,22 +9130,22 @@ So.prototype.cleanUp = function() {
|
|
|
9092
9130
|
this.setResizesEnabled(!1);
|
|
9093
9131
|
const t = I.getGroup();
|
|
9094
9132
|
t || I.setGroup(!0);
|
|
9095
|
-
const e = this.getTopBlocks(!0), n = e.filter((
|
|
9096
|
-
(
|
|
9097
|
-
), a = function(
|
|
9133
|
+
const e = this.getTopBlocks(!0), n = e.filter((r) => r.isMovable()), i = e.filter((r) => !r.isMovable()).map(
|
|
9134
|
+
(r) => r.getBoundingRectangle()
|
|
9135
|
+
), a = function(r) {
|
|
9098
9136
|
for (const l of i)
|
|
9099
|
-
if (
|
|
9137
|
+
if (r.intersects(l))
|
|
9100
9138
|
return l;
|
|
9101
9139
|
return null;
|
|
9102
9140
|
};
|
|
9103
9141
|
let c = 0;
|
|
9104
|
-
for (const
|
|
9105
|
-
let l =
|
|
9106
|
-
|
|
9142
|
+
for (const r of n) {
|
|
9143
|
+
let l = r.getBoundingRectangle();
|
|
9144
|
+
r.moveBy(-l.left, c - l.top, ["cleanup"]), r.snapToGrid(), l = r.getBoundingRectangle();
|
|
9107
9145
|
let _ = a(l);
|
|
9108
9146
|
for (; _ != null; )
|
|
9109
|
-
c = _.top + _.getHeight() + Bn,
|
|
9110
|
-
c =
|
|
9147
|
+
c = _.top + _.getHeight() + Bn, r.moveBy(0, c - l.top, ["cleanup"]), r.snapToGrid(), l = r.getBoundingRectangle(), _ = a(l);
|
|
9148
|
+
c = r.getRelativeToSurfaceXY().y + r.getHeightWidth().height + Bn;
|
|
9111
9149
|
}
|
|
9112
9150
|
I.setGroup(t), this.setResizesEnabled(!0);
|
|
9113
9151
|
};
|
|
@@ -9115,7 +9153,7 @@ function co(t) {
|
|
|
9115
9153
|
const e = t.getParent();
|
|
9116
9154
|
return e && co(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
|
|
9117
9155
|
}
|
|
9118
|
-
class
|
|
9156
|
+
class ya {
|
|
9119
9157
|
init() {
|
|
9120
9158
|
const e = Bo.registry.getItem("blockDisable");
|
|
9121
9159
|
e && (e.preconditionFn = function(n) {
|
|
@@ -9126,12 +9164,12 @@ class va {
|
|
|
9126
9164
|
}
|
|
9127
9165
|
bo.registerFieldColour();
|
|
9128
9166
|
Po.registry.unregister(Ro.names.ESCAPE);
|
|
9129
|
-
const
|
|
9130
|
-
|
|
9131
|
-
const Ca = new
|
|
9167
|
+
const va = new Do.CrossTabCopyPaste();
|
|
9168
|
+
va.init({ contextMenu: !0, shortcut: !0 });
|
|
9169
|
+
const Ca = new ya();
|
|
9132
9170
|
Ca.init();
|
|
9133
9171
|
function un(t) {
|
|
9134
|
-
const e =
|
|
9172
|
+
const e = jt();
|
|
9135
9173
|
if (!e)
|
|
9136
9174
|
return;
|
|
9137
9175
|
const n = e.getBlockById(t);
|
|
@@ -9144,7 +9182,7 @@ function un(t) {
|
|
|
9144
9182
|
e.scroll(-a, -c);
|
|
9145
9183
|
}
|
|
9146
9184
|
function ro() {
|
|
9147
|
-
const t =
|
|
9185
|
+
const t = jt();
|
|
9148
9186
|
if (!t)
|
|
9149
9187
|
return;
|
|
9150
9188
|
const e = t.getTopBlocks(!0)?.[0];
|
|
@@ -9335,7 +9373,7 @@ const ka = Un.defineTheme("light", {
|
|
|
9335
9373
|
}
|
|
9336
9374
|
});
|
|
9337
9375
|
function La(t) {
|
|
9338
|
-
const e =
|
|
9376
|
+
const e = jt();
|
|
9339
9377
|
switch (t) {
|
|
9340
9378
|
case "light":
|
|
9341
9379
|
e.setTheme(ka);
|
|
@@ -9346,7 +9384,7 @@ function La(t) {
|
|
|
9346
9384
|
}
|
|
9347
9385
|
}
|
|
9348
9386
|
const en = ["get_app_property_v1", "get_app_state_v1"];
|
|
9349
|
-
function
|
|
9387
|
+
function lt(t, e) {
|
|
9350
9388
|
return t.find((o) => o === e) !== void 0 ? !1 : (t.push(e), !0);
|
|
9351
9389
|
}
|
|
9352
9390
|
function Sa(t) {
|
|
@@ -9362,15 +9400,15 @@ function Ba(t) {
|
|
|
9362
9400
|
for (const n of t)
|
|
9363
9401
|
if (n.type === "get_app_property_v1") {
|
|
9364
9402
|
const o = n;
|
|
9365
|
-
|
|
9403
|
+
lt(
|
|
9366
9404
|
e,
|
|
9367
|
-
|
|
9405
|
+
yt({
|
|
9368
9406
|
type: "elementProperty",
|
|
9369
9407
|
nodeId: o.node.id,
|
|
9370
9408
|
propertyKeys: o.property.key
|
|
9371
9409
|
})
|
|
9372
9410
|
);
|
|
9373
|
-
} else n.type === "get_app_state_v1" ?
|
|
9411
|
+
} else n.type === "get_app_state_v1" ? lt(e, yt({ type: "state", stateId: n.state.id })) : console.assert(!1);
|
|
9374
9412
|
return e;
|
|
9375
9413
|
}
|
|
9376
9414
|
function ba(t) {
|
|
@@ -9400,48 +9438,48 @@ function Pa(t) {
|
|
|
9400
9438
|
} : (i.property.kind === "elementSlotProperty" || i.property.kind === "customSlotProperty") && (a = {
|
|
9401
9439
|
type: "adaptSlotProperty",
|
|
9402
9440
|
propertyId: i.property.key
|
|
9403
|
-
}), !a || !
|
|
9441
|
+
}), !a || !lt(n, yt(a)))
|
|
9404
9442
|
continue;
|
|
9405
9443
|
e.push(a);
|
|
9406
9444
|
} else if (o.type === "get_app_state_v1") {
|
|
9407
9445
|
const a = { type: "state", stateId: o.state.id };
|
|
9408
|
-
if (!
|
|
9446
|
+
if (!lt(n, yt(a)))
|
|
9409
9447
|
continue;
|
|
9410
9448
|
e.push(a);
|
|
9411
9449
|
} else if (o.type === "object_get_v1") {
|
|
9412
9450
|
const i = o.getInputTargetBlock("OBJECT"), a = s.valueToCode(
|
|
9413
9451
|
o,
|
|
9414
9452
|
"KEY",
|
|
9415
|
-
|
|
9453
|
+
u.ATOMIC
|
|
9416
9454
|
);
|
|
9417
9455
|
if (i.type === "get_app_property_v1") {
|
|
9418
9456
|
const c = i;
|
|
9419
|
-
let
|
|
9420
|
-
if (c.property.kind === "elementProperty" ?
|
|
9457
|
+
let r;
|
|
9458
|
+
if (c.property.kind === "elementProperty" ? r = {
|
|
9421
9459
|
type: "elementProperty",
|
|
9422
9460
|
nodeId: c.node.id,
|
|
9423
9461
|
propertyKeys: c.property.key,
|
|
9424
9462
|
subKeys: a
|
|
9425
|
-
} : c.property.kind === "customProperty" ?
|
|
9463
|
+
} : c.property.kind === "customProperty" ? r = {
|
|
9426
9464
|
type: "customProperty",
|
|
9427
9465
|
propertyId: c.property.key,
|
|
9428
9466
|
subKeys: a
|
|
9429
|
-
} : (c.property.kind === "elementSlotProperty" || c.property.kind === "customSlotProperty") && (
|
|
9467
|
+
} : (c.property.kind === "elementSlotProperty" || c.property.kind === "customSlotProperty") && (r = {
|
|
9430
9468
|
type: "adaptSlotProperty",
|
|
9431
9469
|
propertyId: c.property.key,
|
|
9432
9470
|
subKeys: a
|
|
9433
|
-
}), !
|
|
9471
|
+
}), !r || !lt(n, yt(r)))
|
|
9434
9472
|
continue;
|
|
9435
|
-
e.push(
|
|
9473
|
+
e.push(r);
|
|
9436
9474
|
} else if (i.type === "get_app_state_v1") {
|
|
9437
|
-
const
|
|
9475
|
+
const r = {
|
|
9438
9476
|
type: "state",
|
|
9439
9477
|
stateId: i.state.id,
|
|
9440
9478
|
subKeys: a
|
|
9441
9479
|
};
|
|
9442
|
-
if (!
|
|
9480
|
+
if (!lt(n, yt(r)))
|
|
9443
9481
|
continue;
|
|
9444
|
-
e.push(
|
|
9482
|
+
e.push(r);
|
|
9445
9483
|
} else
|
|
9446
9484
|
console.assert(!1);
|
|
9447
9485
|
} else
|
|
@@ -9462,13 +9500,13 @@ function Ra(t) {
|
|
|
9462
9500
|
if (o.type === "watch_effect_v1") {
|
|
9463
9501
|
const i = Sa(o), a = Ba(i);
|
|
9464
9502
|
for (const c of a)
|
|
9465
|
-
e.watchEffect[c] || (e.watchEffect[c] = []),
|
|
9503
|
+
e.watchEffect[c] || (e.watchEffect[c] = []), lt(e.watchEffect[c], o.id);
|
|
9466
9504
|
} else if (o.type === "app_bind_v1") {
|
|
9467
9505
|
const i = ba(o), a = Pa(i);
|
|
9468
9506
|
e.bind.sets[o.id] = a;
|
|
9469
9507
|
for (const c of a) {
|
|
9470
|
-
const
|
|
9471
|
-
e.bind.triggers[
|
|
9508
|
+
const r = yt(c);
|
|
9509
|
+
e.bind.triggers[r] || (e.bind.triggers[r] = []), lt(e.bind.triggers[r], o.id);
|
|
9472
9510
|
}
|
|
9473
9511
|
}
|
|
9474
9512
|
return e;
|
|
@@ -9480,13 +9518,13 @@ function Da(t) {
|
|
|
9480
9518
|
function ln() {
|
|
9481
9519
|
return Qo(uo);
|
|
9482
9520
|
}
|
|
9483
|
-
const Ma = /* @__PURE__ */
|
|
9521
|
+
const Ma = /* @__PURE__ */ rt({
|
|
9484
9522
|
__name: "index",
|
|
9485
9523
|
props: {
|
|
9486
9524
|
lock: { type: Boolean }
|
|
9487
9525
|
},
|
|
9488
9526
|
setup(t, { expose: e }) {
|
|
9489
|
-
const { t: n } =
|
|
9527
|
+
const { t: n } = Jt(), o = t, i = ln(), a = () => {
|
|
9490
9528
|
if (!i.workspace) {
|
|
9491
9529
|
console.assert(!1);
|
|
9492
9530
|
return;
|
|
@@ -9499,7 +9537,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9499
9537
|
}, c = () => {
|
|
9500
9538
|
a();
|
|
9501
9539
|
};
|
|
9502
|
-
return e({ cleanWorkspace: a }), (
|
|
9540
|
+
return e({ cleanWorkspace: a }), (r, l) => {
|
|
9503
9541
|
const _ = M("v-btn"), d = M("v-tooltip");
|
|
9504
9542
|
return S(), st(d, {
|
|
9505
9543
|
text: D(n)("x-block-lib.tip.hotkeyCtrlQ")
|
|
@@ -9516,7 +9554,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9516
9554
|
}, 8, ["text"]);
|
|
9517
9555
|
};
|
|
9518
9556
|
}
|
|
9519
|
-
}), Ua = /* @__PURE__ */
|
|
9557
|
+
}), Ua = /* @__PURE__ */ rt({
|
|
9520
9558
|
__name: "index",
|
|
9521
9559
|
props: {
|
|
9522
9560
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -9524,14 +9562,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9524
9562
|
},
|
|
9525
9563
|
emits: ["update:modelValue"],
|
|
9526
9564
|
setup(t) {
|
|
9527
|
-
const { t: e } =
|
|
9565
|
+
const { t: e } = Jt(), n = $t(t, "modelValue");
|
|
9528
9566
|
return (o, i) => {
|
|
9529
9567
|
const a = M("v-btn"), c = M("v-tooltip");
|
|
9530
9568
|
return S(), st(c, {
|
|
9531
9569
|
text: D(e)("x-block-lib.tip.hotkeyCtrlW")
|
|
9532
9570
|
}, {
|
|
9533
|
-
activator: at(({ props:
|
|
9534
|
-
L(a, sn(
|
|
9571
|
+
activator: at(({ props: r }) => [
|
|
9572
|
+
L(a, sn(r, {
|
|
9535
9573
|
density: "comfortable",
|
|
9536
9574
|
icon: n.value ? "mdi-lock" : "mdi-lock-open",
|
|
9537
9575
|
variant: "outlined",
|
|
@@ -9546,7 +9584,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9546
9584
|
key: 0,
|
|
9547
9585
|
class: "text-cation text-grey text-truncate ml-6",
|
|
9548
9586
|
style: { maxWidth: "340px" }
|
|
9549
|
-
}, Fa = /* @__PURE__ */
|
|
9587
|
+
}, Fa = /* @__PURE__ */ rt({
|
|
9550
9588
|
__name: "item",
|
|
9551
9589
|
props: {
|
|
9552
9590
|
id: {},
|
|
@@ -9556,14 +9594,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9556
9594
|
},
|
|
9557
9595
|
emits: ["x-click"],
|
|
9558
9596
|
setup(t, { emit: e }) {
|
|
9559
|
-
const { primaryColor: n, backgroundColor2: o, highlightColor: i } =
|
|
9597
|
+
const { primaryColor: n, backgroundColor2: o, highlightColor: i } = Xt(), a = t, c = e, r = Bt(!1), l = w(() => ({
|
|
9560
9598
|
position: "relative",
|
|
9561
|
-
background:
|
|
9599
|
+
background: r.value ? i.value : o.value,
|
|
9562
9600
|
width: "100%",
|
|
9563
9601
|
height: "48px",
|
|
9564
9602
|
marginBottom: "1px",
|
|
9565
9603
|
userSelect: "none"
|
|
9566
|
-
})), _ =
|
|
9604
|
+
})), _ = w(() => ({
|
|
9567
9605
|
display: a.select ? "block" : "none",
|
|
9568
9606
|
position: "absolute",
|
|
9569
9607
|
top: "0px",
|
|
@@ -9579,21 +9617,21 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9579
9617
|
class: "d-flex align-center cursor-pointer",
|
|
9580
9618
|
style: j(l.value),
|
|
9581
9619
|
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) =>
|
|
9620
|
+
onMouseout: h[2] || (h[2] = (R) => r.value = !1),
|
|
9621
|
+
onMouseover: h[3] || (h[3] = (R) => r.value = !0)
|
|
9584
9622
|
}, [
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
a.desc ? (S(), tt("span", Ya,
|
|
9623
|
+
K("div", Va, [
|
|
9624
|
+
K("span", xa, Ht(a.title), 1),
|
|
9625
|
+
a.desc ? (S(), tt("span", Ya, Ht(a.desc), 1)) : ut("", !0)
|
|
9588
9626
|
]),
|
|
9589
9627
|
L(p),
|
|
9590
9628
|
L(m, {
|
|
9591
9629
|
class: "x-handle cursor-move mr-3",
|
|
9592
9630
|
icon: "mdi-drag-horizontal-variant",
|
|
9593
|
-
onMousedown: h[0] || (h[0] =
|
|
9631
|
+
onMousedown: h[0] || (h[0] = wt(() => {
|
|
9594
9632
|
}, ["stop"]))
|
|
9595
9633
|
}),
|
|
9596
|
-
|
|
9634
|
+
K("div", {
|
|
9597
9635
|
style: j(_.value)
|
|
9598
9636
|
}, null, 4)
|
|
9599
9637
|
], 36)), [
|
|
@@ -9604,7 +9642,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9604
9642
|
}), wa = {
|
|
9605
9643
|
key: 1,
|
|
9606
9644
|
class: "text-caption text-grey"
|
|
9607
|
-
}, Ka = /* @__PURE__ */
|
|
9645
|
+
}, Ka = /* @__PURE__ */ rt({
|
|
9608
9646
|
__name: "index",
|
|
9609
9647
|
props: /* @__PURE__ */ je({
|
|
9610
9648
|
lock: { type: Boolean }
|
|
@@ -9614,7 +9652,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9614
9652
|
}),
|
|
9615
9653
|
emits: ["update:modelValue"],
|
|
9616
9654
|
setup(t, { expose: e }) {
|
|
9617
|
-
const { t: n } =
|
|
9655
|
+
const { t: n } = Jt(), o = $t(t, "modelValue"), i = ln(), a = Bt([]);
|
|
9618
9656
|
e({ update: () => {
|
|
9619
9657
|
if (!i.workspace) {
|
|
9620
9658
|
console.assert(!1);
|
|
@@ -9625,26 +9663,26 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9625
9663
|
const R = A.id === Uo()?.id;
|
|
9626
9664
|
let P = "";
|
|
9627
9665
|
if (A.type.startsWith("on_app_event_v")) {
|
|
9628
|
-
const G = A,
|
|
9629
|
-
|
|
9666
|
+
const G = A, Nt = et[G.node.key];
|
|
9667
|
+
Nt && (P = n(Nt.name), G.node.alias && (P += " / " + G.node.alias), P += " - " + Ie(G.event.kind, G.event.names));
|
|
9630
9668
|
} else if (A.type.startsWith("watch_effect_v"))
|
|
9631
9669
|
P = n("x-block-lib.watchEffect");
|
|
9632
9670
|
else if (A.type.startsWith("app_bind_v"))
|
|
9633
9671
|
P = n("x-block-lib.bind");
|
|
9634
9672
|
else if (A.type.startsWith("implement_app_method_v")) {
|
|
9635
9673
|
const G = A;
|
|
9636
|
-
P = n("x-block-lib.implementMethod"), P += " - " +
|
|
9674
|
+
P = n("x-block-lib.implementMethod"), P += " - " + ye(G.method.kind, G.method.names);
|
|
9637
9675
|
} 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
|
|
9676
|
+
const It = A.getCommentText() ?? "";
|
|
9639
9677
|
p.push({
|
|
9640
9678
|
id: A.id,
|
|
9641
9679
|
name: P,
|
|
9642
|
-
desc:
|
|
9680
|
+
desc: It,
|
|
9643
9681
|
select: R
|
|
9644
9682
|
});
|
|
9645
9683
|
}), a.value = p;
|
|
9646
9684
|
} });
|
|
9647
|
-
let
|
|
9685
|
+
let r = [];
|
|
9648
9686
|
const l = () => {
|
|
9649
9687
|
if (t.lock) {
|
|
9650
9688
|
xn(n("x-block-lib.msg.cannotOperateInLockedState"));
|
|
@@ -9653,7 +9691,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9653
9691
|
const p = [];
|
|
9654
9692
|
a.value.forEach(({ id: m }) => {
|
|
9655
9693
|
p.push(m);
|
|
9656
|
-
}),
|
|
9694
|
+
}), r = p;
|
|
9657
9695
|
}, _ = () => !t.lock, d = (p) => {
|
|
9658
9696
|
if (!i.workspace) {
|
|
9659
9697
|
console.assert(!1);
|
|
@@ -9665,7 +9703,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9665
9703
|
}
|
|
9666
9704
|
if (p.oldIndex === p.newIndex)
|
|
9667
9705
|
return;
|
|
9668
|
-
const m =
|
|
9706
|
+
const m = r[p.oldIndex], A = i.workspace.getBlockById(
|
|
9669
9707
|
m
|
|
9670
9708
|
);
|
|
9671
9709
|
if (!A) {
|
|
@@ -9673,13 +9711,13 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9673
9711
|
return;
|
|
9674
9712
|
}
|
|
9675
9713
|
let R = "";
|
|
9676
|
-
p.newIndex > p.oldIndex ? R =
|
|
9714
|
+
p.newIndex > p.oldIndex ? R = r[p.newIndex] : p.newIndex > 0 && (R = r[p.newIndex - 1]);
|
|
9677
9715
|
let P = -10;
|
|
9678
9716
|
R !== "" && (P = i.workspace.getBlockById(
|
|
9679
9717
|
R
|
|
9680
9718
|
).getRelativeToSurfaceXY().y + 10);
|
|
9681
|
-
const
|
|
9682
|
-
A.moveTo(new C.Coordinate(
|
|
9719
|
+
const It = A.getRelativeToSurfaceXY();
|
|
9720
|
+
A.moveTo(new C.Coordinate(It.x, P)), i.workspace.cleanUp(), ro();
|
|
9683
9721
|
}, h = async (p) => {
|
|
9684
9722
|
if (!i.workspace) {
|
|
9685
9723
|
console.assert(!1);
|
|
@@ -9710,14 +9748,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9710
9748
|
}, null, 8, ["id", "desc", "select", "title"]))), 128))
|
|
9711
9749
|
]),
|
|
9712
9750
|
_: 1
|
|
9713
|
-
}, 8, ["modelValue"])) : (S(), tt("span", wa,
|
|
9751
|
+
}, 8, ["modelValue"])) : (S(), tt("span", wa, Ht(D(n)("x-block-lib.noOption")), 1));
|
|
9714
9752
|
}
|
|
9715
9753
|
}), $a = (t, e) => {
|
|
9716
9754
|
const n = t.__vccOpts || t;
|
|
9717
9755
|
for (const [o, i] of e)
|
|
9718
9756
|
n[o] = i;
|
|
9719
9757
|
return n;
|
|
9720
|
-
}, Ha = /* @__PURE__ */ $a(Ka, [["__scopeId", "data-v-daa85471"]]), Ga = /* @__PURE__ */
|
|
9758
|
+
}, Ha = /* @__PURE__ */ $a(Ka, [["__scopeId", "data-v-daa85471"]]), Ga = /* @__PURE__ */ rt({
|
|
9721
9759
|
__name: "index",
|
|
9722
9760
|
props: {
|
|
9723
9761
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -9725,7 +9763,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9725
9763
|
},
|
|
9726
9764
|
emits: ["update:modelValue"],
|
|
9727
9765
|
setup(t, { expose: e }) {
|
|
9728
|
-
const n =
|
|
9766
|
+
const n = $t(t, "modelValue"), o = ln();
|
|
9729
9767
|
e({ update: () => {
|
|
9730
9768
|
if (!o.workspace) {
|
|
9731
9769
|
console.assert(!1);
|
|
@@ -9733,49 +9771,49 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9733
9771
|
}
|
|
9734
9772
|
} });
|
|
9735
9773
|
const a = (c) => {
|
|
9736
|
-
const
|
|
9737
|
-
if (!
|
|
9774
|
+
const r = jt();
|
|
9775
|
+
if (!r) {
|
|
9738
9776
|
console.assert(!1);
|
|
9739
9777
|
return;
|
|
9740
9778
|
}
|
|
9741
|
-
const l =
|
|
9779
|
+
const l = r.getBlockById(c);
|
|
9742
9780
|
Vn.setSelected(l), un(c), n.value = !1;
|
|
9743
9781
|
};
|
|
9744
|
-
return (c,
|
|
9745
|
-
onClick:
|
|
9782
|
+
return (c, r) => (S(), tt("div", {
|
|
9783
|
+
onClick: r[0] || (r[0] = (l) => a(""))
|
|
9746
9784
|
}, "blockTree"));
|
|
9747
9785
|
}
|
|
9748
|
-
}), Wa = { class: "text-subtitle-1" }, ja = /* @__PURE__ */
|
|
9786
|
+
}), Wa = { class: "text-subtitle-1" }, ja = /* @__PURE__ */ rt({
|
|
9749
9787
|
__name: "index",
|
|
9750
9788
|
props: {
|
|
9751
9789
|
type: {},
|
|
9752
9790
|
lock: { type: Boolean }
|
|
9753
9791
|
},
|
|
9754
9792
|
setup(t, { expose: e }) {
|
|
9755
|
-
const { t: n } =
|
|
9793
|
+
const { t: n } = Jt(), o = ii(), { sysBarAvail: i } = Yn(), { backgroundColor1: a } = Xt(), c = w(() => {
|
|
9756
9794
|
let m = "100%";
|
|
9757
9795
|
return o.mdAndUp.value && (m = "400px"), {
|
|
9758
9796
|
background: a.value,
|
|
9759
9797
|
width: m,
|
|
9760
9798
|
height: "100%"
|
|
9761
9799
|
};
|
|
9762
|
-
}),
|
|
9800
|
+
}), r = w(() => {
|
|
9763
9801
|
let m = 48;
|
|
9764
9802
|
return i.value && (m += 24), {
|
|
9765
9803
|
position: "relative",
|
|
9766
9804
|
height: `calc(100% - ${m}px)`
|
|
9767
9805
|
};
|
|
9768
|
-
}), l =
|
|
9806
|
+
}), l = w(() => ({
|
|
9769
9807
|
height: "60px"
|
|
9770
9808
|
})), { open: _ } = nn(`blocklyNavigatorDlg${Xe()}`);
|
|
9771
9809
|
ei(() => {
|
|
9772
9810
|
_.value = !1;
|
|
9773
9811
|
});
|
|
9774
|
-
const d =
|
|
9812
|
+
const d = Kt("blockList"), h = Kt("blockTree");
|
|
9775
9813
|
return e({ open: _, update: () => {
|
|
9776
9814
|
t.type === "list" ? d.value?.update() : t.type === "tree" && h.value?.update();
|
|
9777
9815
|
} }), (m, A) => {
|
|
9778
|
-
const R = M("v-sheet"), P = M("v-btn"),
|
|
9816
|
+
const R = M("v-sheet"), P = M("v-btn"), It = M("v-spacer"), G = M("v-dialog"), Nt = M("v-tooltip");
|
|
9779
9817
|
return S(), tt(Kn, null, [
|
|
9780
9818
|
L(G, {
|
|
9781
9819
|
modelValue: D(_),
|
|
@@ -9785,15 +9823,15 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9785
9823
|
"no-click-animation": "",
|
|
9786
9824
|
persistent: "",
|
|
9787
9825
|
transition: "scroll-x-reverse-transition",
|
|
9788
|
-
onKeydown: A[6] || (A[6] = $n(
|
|
9826
|
+
onKeydown: A[6] || (A[6] = $n(wt((W) => _.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
9789
9827
|
}, {
|
|
9790
9828
|
default: at(() => [
|
|
9791
|
-
|
|
9829
|
+
K("div", {
|
|
9792
9830
|
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
9793
|
-
onClick: A[3] || (A[3] =
|
|
9794
|
-
onContextmenu: A[4] || (A[4] =
|
|
9831
|
+
onClick: A[3] || (A[3] = wt((W) => _.value = !1, ["self"])),
|
|
9832
|
+
onContextmenu: A[4] || (A[4] = wt((W) => _.value = !1, ["self", "prevent"]))
|
|
9795
9833
|
}, [
|
|
9796
|
-
|
|
9834
|
+
K("div", {
|
|
9797
9835
|
class: "elevation-2",
|
|
9798
9836
|
style: j(c.value)
|
|
9799
9837
|
}, [
|
|
@@ -9801,7 +9839,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9801
9839
|
key: 0,
|
|
9802
9840
|
color: "transparent",
|
|
9803
9841
|
height: 24
|
|
9804
|
-
})) :
|
|
9842
|
+
})) : ut("", !0),
|
|
9805
9843
|
L(R, {
|
|
9806
9844
|
class: "d-flex align-center px-2",
|
|
9807
9845
|
color: "transparent",
|
|
@@ -9814,14 +9852,14 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9814
9852
|
variant: "text",
|
|
9815
9853
|
onClick: A[0] || (A[0] = (W) => _.value = !1)
|
|
9816
9854
|
}),
|
|
9817
|
-
|
|
9818
|
-
L(
|
|
9855
|
+
K("span", Wa, Ht(D(n)("x-block-lib.navigator")), 1),
|
|
9856
|
+
L(It)
|
|
9819
9857
|
]),
|
|
9820
9858
|
_: 1
|
|
9821
9859
|
}),
|
|
9822
|
-
|
|
9860
|
+
K("div", {
|
|
9823
9861
|
class: "overflow-y-auto",
|
|
9824
|
-
style: j(
|
|
9862
|
+
style: j(r.value)
|
|
9825
9863
|
}, [
|
|
9826
9864
|
t.type === "list" ? (S(), st(Ha, {
|
|
9827
9865
|
key: 0,
|
|
@@ -9836,8 +9874,8 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9836
9874
|
ref: h,
|
|
9837
9875
|
modelValue: D(_),
|
|
9838
9876
|
"onUpdate:modelValue": A[2] || (A[2] = (W) => ne(_) ? _.value = W : null)
|
|
9839
|
-
}, null, 8, ["modelValue"])) :
|
|
9840
|
-
|
|
9877
|
+
}, null, 8, ["modelValue"])) : ut("", !0),
|
|
9878
|
+
K("div", {
|
|
9841
9879
|
style: j(l.value)
|
|
9842
9880
|
}, null, 4)
|
|
9843
9881
|
], 4)
|
|
@@ -9846,7 +9884,7 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9846
9884
|
]),
|
|
9847
9885
|
_: 1
|
|
9848
9886
|
}, 8, ["modelValue"]),
|
|
9849
|
-
L(
|
|
9887
|
+
L(Nt, {
|
|
9850
9888
|
text: D(n)("x-block-lib.tip.hotkeyCtrlE")
|
|
9851
9889
|
}, {
|
|
9852
9890
|
activator: at(({ props: W }) => [
|
|
@@ -9862,55 +9900,55 @@ const Ma = /* @__PURE__ */ ct({
|
|
|
9862
9900
|
], 64);
|
|
9863
9901
|
};
|
|
9864
9902
|
}
|
|
9865
|
-
}),
|
|
9866
|
-
function
|
|
9867
|
-
const e =
|
|
9903
|
+
}), Y = C.xml;
|
|
9904
|
+
function x(t) {
|
|
9905
|
+
const e = Y.createElement("label");
|
|
9868
9906
|
return e.setAttribute("text", t), e;
|
|
9869
9907
|
}
|
|
9870
|
-
function
|
|
9871
|
-
const n =
|
|
9908
|
+
function y(t, e) {
|
|
9909
|
+
const n = Y.createElement("block");
|
|
9872
9910
|
if (n.setAttribute("type", t), e)
|
|
9873
9911
|
for (const o of e)
|
|
9874
9912
|
n.appendChild(o);
|
|
9875
9913
|
return n;
|
|
9876
9914
|
}
|
|
9877
9915
|
function lo(t) {
|
|
9878
|
-
const e =
|
|
9916
|
+
const e = Y.createElement("mutation");
|
|
9879
9917
|
for (const { key: n, value: o } of t)
|
|
9880
9918
|
e.setAttribute(n, o);
|
|
9881
9919
|
return e;
|
|
9882
9920
|
}
|
|
9883
|
-
function
|
|
9921
|
+
function Rt(t, e) {
|
|
9884
9922
|
e === void 0 && (e = "");
|
|
9885
|
-
const n =
|
|
9923
|
+
const n = Y.createElement("value");
|
|
9886
9924
|
n.setAttribute("name", t);
|
|
9887
|
-
const o =
|
|
9925
|
+
const o = Y.createElement("shadow");
|
|
9888
9926
|
o.setAttribute("type", "text_v1");
|
|
9889
|
-
const i =
|
|
9927
|
+
const i = Y.createElement("field");
|
|
9890
9928
|
i.setAttribute("name", "TEXT");
|
|
9891
|
-
const a =
|
|
9929
|
+
const a = Y.createTextNode(e);
|
|
9892
9930
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9893
9931
|
}
|
|
9894
9932
|
function bn(t, e) {
|
|
9895
9933
|
e === void 0 && (e = 0);
|
|
9896
|
-
const n =
|
|
9934
|
+
const n = Y.createElement("value");
|
|
9897
9935
|
n.setAttribute("name", t);
|
|
9898
|
-
const o =
|
|
9936
|
+
const o = Y.createElement("shadow");
|
|
9899
9937
|
o.setAttribute("type", "math_number_v1");
|
|
9900
|
-
const i =
|
|
9938
|
+
const i = Y.createElement("field");
|
|
9901
9939
|
i.setAttribute("name", "NUM");
|
|
9902
|
-
const a =
|
|
9940
|
+
const a = Y.createTextNode(String(e));
|
|
9903
9941
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9904
9942
|
}
|
|
9905
9943
|
function Xa(t, e) {
|
|
9906
9944
|
e === void 0 && (e = !1);
|
|
9907
|
-
const n =
|
|
9945
|
+
const n = Y.createElement("value");
|
|
9908
9946
|
n.setAttribute("name", t);
|
|
9909
|
-
const o =
|
|
9947
|
+
const o = Y.createElement("shadow");
|
|
9910
9948
|
o.setAttribute("type", "logic_boolean_v1");
|
|
9911
|
-
const i =
|
|
9949
|
+
const i = Y.createElement("field");
|
|
9912
9950
|
i.setAttribute("name", "BOOL");
|
|
9913
|
-
const a =
|
|
9951
|
+
const a = Y.createTextNode(e ? "TRUE" : "FALSE");
|
|
9914
9952
|
return i.appendChild(a), o.appendChild(i), n.appendChild(o), n;
|
|
9915
9953
|
}
|
|
9916
9954
|
function Ja() {
|
|
@@ -9936,19 +9974,19 @@ function Qa() {
|
|
|
9936
9974
|
}
|
|
9937
9975
|
function za() {
|
|
9938
9976
|
const t = [];
|
|
9939
|
-
return t.push(
|
|
9940
|
-
|
|
9941
|
-
), t.push(
|
|
9977
|
+
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(
|
|
9978
|
+
y("app_bind_v1", [lo([{ key: "items", value: "2" }])])
|
|
9979
|
+
), 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
9980
|
}
|
|
9943
9981
|
const _o = { name: "APP_COMP_CATEGORY", callback: za };
|
|
9944
9982
|
function Za() {
|
|
9945
9983
|
const t = [];
|
|
9946
|
-
return t.push(
|
|
9984
|
+
return t.push(x(f("LABEL_FUNC"))), t.push(x(f("LABEL_FLOW"))), t;
|
|
9947
9985
|
}
|
|
9948
9986
|
const pe = { name: "APP_COMPUTE_CATEGORY", callback: Za };
|
|
9949
9987
|
function tc() {
|
|
9950
9988
|
const t = [];
|
|
9951
|
-
return t.push(
|
|
9989
|
+
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
9990
|
}
|
|
9953
9991
|
const de = { name: "APP_MESSAGE_CATEGORY", callback: tc };
|
|
9954
9992
|
function ec() {
|
|
@@ -9959,7 +9997,7 @@ function ec() {
|
|
|
9959
9997
|
}
|
|
9960
9998
|
function nc() {
|
|
9961
9999
|
const t = [];
|
|
9962
|
-
return t.push(
|
|
10000
|
+
return t.push(y("app_env_is_v1")), ec() && t.push(y("navigate_to_v1")), t;
|
|
9963
10001
|
}
|
|
9964
10002
|
const he = { name: "APP_MISC_CATEGORY", callback: nc };
|
|
9965
10003
|
function oc() {
|
|
@@ -9972,14 +10010,14 @@ function ic() {
|
|
|
9972
10010
|
}
|
|
9973
10011
|
function sc() {
|
|
9974
10012
|
const t = [];
|
|
9975
|
-
return t.push(
|
|
9976
|
-
|
|
9977
|
-
), t.push(
|
|
10013
|
+
return t.push(x(f("LABEL_EVENT"))), X("onEvent") && t.push(y("on_app_event_v1")), t.push(
|
|
10014
|
+
y("app_bind_v1", [lo([{ key: "items", value: "2" }])])
|
|
10015
|
+
), 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
10016
|
}
|
|
9979
10017
|
const po = { name: "APP_PAGE_CATEGORY", callback: sc };
|
|
9980
10018
|
function ac() {
|
|
9981
10019
|
const t = [];
|
|
9982
|
-
return t.push(
|
|
10020
|
+
return t.push(x(f("LABEL_RESOURCE"))), t.push(y("upload_resource_v1")), t;
|
|
9983
10021
|
}
|
|
9984
10022
|
const fe = { name: "APP_RESOURCE_CATEGORY", callback: ac }, xt = C.xml;
|
|
9985
10023
|
function cc() {
|
|
@@ -10005,14 +10043,14 @@ function cc() {
|
|
|
10005
10043
|
}
|
|
10006
10044
|
return t;
|
|
10007
10045
|
}
|
|
10008
|
-
const
|
|
10046
|
+
const _t = {
|
|
10009
10047
|
name: "PROCEDURE_CATEGORY",
|
|
10010
10048
|
callback: cc
|
|
10011
|
-
},
|
|
10049
|
+
}, ee = C.xml;
|
|
10012
10050
|
function rc() {
|
|
10013
|
-
const t =
|
|
10051
|
+
const t = jt(), e = [];
|
|
10014
10052
|
{
|
|
10015
|
-
const o =
|
|
10053
|
+
const o = ee.createElement("label");
|
|
10016
10054
|
o.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), e.push(o);
|
|
10017
10055
|
}
|
|
10018
10056
|
{
|
|
@@ -10020,7 +10058,7 @@ function rc() {
|
|
|
10020
10058
|
o.setAttribute("text", "%{BKY_NEW_VARIABLE}"), o.setAttribute("callbackKey", "CREATE_VARIABLE"), t.registerButtonCallback(
|
|
10021
10059
|
"CREATE_VARIABLE",
|
|
10022
10060
|
function(i) {
|
|
10023
|
-
|
|
10061
|
+
St.createVariableButtonHandler(
|
|
10024
10062
|
i.getTargetWorkspace()
|
|
10025
10063
|
);
|
|
10026
10064
|
}
|
|
@@ -10029,39 +10067,39 @@ function rc() {
|
|
|
10029
10067
|
const n = t.getVariablesOfType("");
|
|
10030
10068
|
if (n.length <= 0)
|
|
10031
10069
|
return e;
|
|
10032
|
-
n.sort(
|
|
10070
|
+
n.sort(St.compareByName);
|
|
10033
10071
|
{
|
|
10034
|
-
const o =
|
|
10072
|
+
const o = ee.createElement("label");
|
|
10035
10073
|
o.setAttribute("text", f("LABEL_CREATED")), e.push(o);
|
|
10036
10074
|
}
|
|
10037
10075
|
return n.forEach((o) => {
|
|
10038
10076
|
{
|
|
10039
|
-
const i =
|
|
10040
|
-
i.setAttribute("type", "variable_get_v1"), i.appendChild(
|
|
10077
|
+
const i = ee.createElement("block");
|
|
10078
|
+
i.setAttribute("type", "variable_get_v1"), i.appendChild(St.generateVariableFieldDom(o)), e.push(i);
|
|
10041
10079
|
}
|
|
10042
10080
|
{
|
|
10043
|
-
const i =
|
|
10044
|
-
i.setAttribute("type", "variable_set_v1"), i.appendChild(
|
|
10081
|
+
const i = ee.createElement("block");
|
|
10082
|
+
i.setAttribute("type", "variable_set_v1"), i.appendChild(St.generateVariableFieldDom(o)), e.push(i);
|
|
10045
10083
|
}
|
|
10046
10084
|
}), e;
|
|
10047
10085
|
}
|
|
10048
|
-
const
|
|
10086
|
+
const pt = {
|
|
10049
10087
|
name: "VARIABLE_CATEGORY",
|
|
10050
10088
|
callback: rc
|
|
10051
10089
|
};
|
|
10052
10090
|
function uc() {
|
|
10053
10091
|
const t = [];
|
|
10054
10092
|
if (nt().length > 0)
|
|
10055
|
-
t.push(
|
|
10056
|
-
|
|
10057
|
-
), t.push(
|
|
10058
|
-
|
|
10093
|
+
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(
|
|
10094
|
+
y("interrupt_transaction_v1", [Rt("VALUE")])
|
|
10095
|
+
), 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(
|
|
10096
|
+
y("query_extra_limit_v1", [
|
|
10059
10097
|
bn("OFFSET", 0),
|
|
10060
10098
|
bn("LIMIT", 1)
|
|
10061
10099
|
])
|
|
10062
10100
|
), t.push(
|
|
10063
|
-
|
|
10064
|
-
|
|
10101
|
+
y("query_extra_sortby_v1", [
|
|
10102
|
+
Rt("COLUMN"),
|
|
10065
10103
|
Xa("DESC")
|
|
10066
10104
|
])
|
|
10067
10105
|
);
|
|
@@ -10073,25 +10111,25 @@ function uc() {
|
|
|
10073
10111
|
}
|
|
10074
10112
|
const me = { name: "COMPUTE_DATA_CATEGORY", callback: uc };
|
|
10075
10113
|
function lc() {
|
|
10076
|
-
return
|
|
10114
|
+
return Qt("flow").length > 0;
|
|
10077
10115
|
}
|
|
10078
10116
|
function _c() {
|
|
10079
10117
|
const t = [];
|
|
10080
|
-
return g.compute.activeObject.type === "flow" && t.push(
|
|
10118
|
+
return g.compute.activeObject.type === "flow" && t.push(y("on_flow_state_event_v1")), lc() && console.assert(!0), t;
|
|
10081
10119
|
}
|
|
10082
10120
|
const Te = { name: "COMPUTE_FLOW_CATEGORY", callback: _c };
|
|
10083
10121
|
function pc() {
|
|
10084
|
-
return
|
|
10122
|
+
return Qt("func").length > 0;
|
|
10085
10123
|
}
|
|
10086
10124
|
function dc() {
|
|
10087
10125
|
const t = [];
|
|
10088
|
-
return g.compute.activeObject.type === "func" && (t.push(
|
|
10126
|
+
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
10127
|
}
|
|
10090
10128
|
const Ee = { name: "COMPUTE_FUNC_CATEGORY", callback: dc };
|
|
10091
10129
|
function hc() {
|
|
10092
10130
|
const t = [];
|
|
10093
10131
|
return t.push(
|
|
10094
|
-
|
|
10132
|
+
y("compute_debug_trace_v1", [Rt("OBJECT")])
|
|
10095
10133
|
), t;
|
|
10096
10134
|
}
|
|
10097
10135
|
const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
@@ -10830,13 +10868,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10830
10868
|
kind: "category",
|
|
10831
10869
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10832
10870
|
categorystyle: "variable_category",
|
|
10833
|
-
custom:
|
|
10871
|
+
custom: pt.name
|
|
10834
10872
|
},
|
|
10835
10873
|
{
|
|
10836
10874
|
kind: "category",
|
|
10837
10875
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10838
10876
|
categorystyle: "procedure_category",
|
|
10839
|
-
custom:
|
|
10877
|
+
custom: _t.name
|
|
10840
10878
|
},
|
|
10841
10879
|
{
|
|
10842
10880
|
kind: "category",
|
|
@@ -10889,13 +10927,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10889
10927
|
kind: "category",
|
|
10890
10928
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10891
10929
|
categorystyle: "variable_category",
|
|
10892
|
-
custom:
|
|
10930
|
+
custom: pt.name
|
|
10893
10931
|
},
|
|
10894
10932
|
{
|
|
10895
10933
|
kind: "category",
|
|
10896
10934
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10897
10935
|
categorystyle: "procedure_category",
|
|
10898
|
-
custom:
|
|
10936
|
+
custom: _t.name
|
|
10899
10937
|
}
|
|
10900
10938
|
]
|
|
10901
10939
|
}, Tc = {
|
|
@@ -10936,13 +10974,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
10936
10974
|
kind: "category",
|
|
10937
10975
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
10938
10976
|
categorystyle: "variable_category",
|
|
10939
|
-
custom:
|
|
10977
|
+
custom: pt.name
|
|
10940
10978
|
},
|
|
10941
10979
|
{
|
|
10942
10980
|
kind: "category",
|
|
10943
10981
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
10944
10982
|
categorystyle: "procedure_category",
|
|
10945
|
-
custom:
|
|
10983
|
+
custom: _t.name
|
|
10946
10984
|
}
|
|
10947
10985
|
]
|
|
10948
10986
|
}, Ec = {
|
|
@@ -11009,13 +11047,13 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
11009
11047
|
kind: "category",
|
|
11010
11048
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
11011
11049
|
categorystyle: "variable_category",
|
|
11012
|
-
custom:
|
|
11050
|
+
custom: pt.name
|
|
11013
11051
|
},
|
|
11014
11052
|
{
|
|
11015
11053
|
kind: "category",
|
|
11016
11054
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
11017
11055
|
categorystyle: "procedure_category",
|
|
11018
|
-
custom:
|
|
11056
|
+
custom: _t.name
|
|
11019
11057
|
},
|
|
11020
11058
|
{
|
|
11021
11059
|
kind: "category",
|
|
@@ -11059,7 +11097,7 @@ const ge = { name: "COMPUTE_MISC_CATEGORY", callback: hc }, Se = {
|
|
|
11059
11097
|
function Ac(t, e, n, o) {
|
|
11060
11098
|
He.theme = o ? "dark" : "light", He.toolbox = Ic(e, n);
|
|
11061
11099
|
const i = Vo(t, He);
|
|
11062
|
-
return i.addChangeListener(xo.shadowBlockConversionChangeListener), Oc(i, e, n),
|
|
11100
|
+
return i.addChangeListener(xo.shadowBlockConversionChangeListener), Oc(i, e, n), yc(i), i;
|
|
11063
11101
|
}
|
|
11064
11102
|
function Ic(t, e) {
|
|
11065
11103
|
let n;
|
|
@@ -11069,10 +11107,10 @@ function Oc(t, e, n) {
|
|
|
11069
11107
|
function o({ name: i, callback: a }) {
|
|
11070
11108
|
t.registerToolboxCategoryCallback(i, () => a(e));
|
|
11071
11109
|
}
|
|
11072
|
-
e === "page" ? n === "v1" && (o(po), o(de), o(he), o(
|
|
11110
|
+
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
11111
|
}
|
|
11074
|
-
function
|
|
11075
|
-
const { router: e } =
|
|
11112
|
+
function yc(t) {
|
|
11113
|
+
const { router: e } = kt;
|
|
11076
11114
|
t.registerButtonCallback("NO_COMPUTE", () => {
|
|
11077
11115
|
const n = e.resolve({
|
|
11078
11116
|
path: "/compute/" + Date.now()
|
|
@@ -11089,7 +11127,7 @@ function vc(t) {
|
|
|
11089
11127
|
}, 100);
|
|
11090
11128
|
});
|
|
11091
11129
|
}
|
|
11092
|
-
function
|
|
11130
|
+
function vc(t, e) {
|
|
11093
11131
|
const n = e.newBlock("json_root_v1");
|
|
11094
11132
|
n.initSvg(), n.render();
|
|
11095
11133
|
const o = (i, a) => {
|
|
@@ -11111,21 +11149,21 @@ function yc(t, e) {
|
|
|
11111
11149
|
else
|
|
11112
11150
|
return;
|
|
11113
11151
|
}
|
|
11114
|
-
const
|
|
11115
|
-
if (
|
|
11152
|
+
const r = e.newBlock(c);
|
|
11153
|
+
if (r.initSvg(), r.render(), a.connect(r.outputConnection), c === "json_map_v1") {
|
|
11116
11154
|
const l = [];
|
|
11117
11155
|
for (const _ in i)
|
|
11118
11156
|
l.push(_);
|
|
11119
|
-
|
|
11157
|
+
r.initData(l);
|
|
11120
11158
|
for (let _ = 0; _ < l.length; _++) {
|
|
11121
|
-
const d = l[_], h =
|
|
11159
|
+
const d = l[_], h = r.getInput("ENTRY" + _);
|
|
11122
11160
|
o(i[d], h.connection);
|
|
11123
11161
|
}
|
|
11124
11162
|
} else if (c === "json_array_v1") {
|
|
11125
|
-
|
|
11163
|
+
r.initData(i.length);
|
|
11126
11164
|
for (let l = 0; l < i.length; l++)
|
|
11127
|
-
o(i[l],
|
|
11128
|
-
} else c === "json_string_v1" || c === "json_number_v1" ?
|
|
11165
|
+
o(i[l], r.getInput("ENTRY" + l).connection);
|
|
11166
|
+
} else c === "json_string_v1" || c === "json_number_v1" ? r.setFieldValue(i, "VALUE") : c === "json_boolean_v1" && r.setFieldValue(i ? "true" : "false", "VALUE");
|
|
11129
11167
|
};
|
|
11130
11168
|
o(t, n.getInput("JSON").connection), I.fire(
|
|
11131
11169
|
new (I.get(I.FINISHED_LOADING))(e)
|
|
@@ -11163,7 +11201,7 @@ function Cc(t) {
|
|
|
11163
11201
|
if (o.type === "json_root_v1")
|
|
11164
11202
|
return e(o);
|
|
11165
11203
|
}
|
|
11166
|
-
const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */
|
|
11204
|
+
const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ rt({
|
|
11167
11205
|
__name: "index",
|
|
11168
11206
|
props: /* @__PURE__ */ je({
|
|
11169
11207
|
type: {},
|
|
@@ -11178,18 +11216,18 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11178
11216
|
}),
|
|
11179
11217
|
emits: /* @__PURE__ */ je(["ready"], ["update:lock", "update:scale"]),
|
|
11180
11218
|
setup(t, { expose: e, emit: n }) {
|
|
11181
|
-
const { backgroundColor2: o } =
|
|
11219
|
+
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
11220
|
Da(p);
|
|
11183
|
-
const m =
|
|
11221
|
+
const m = Bt(!0), A = Bt(!1), R = w(() => t.type === "json" ? "tree" : "list"), P = w(() => ({
|
|
11184
11222
|
width: "100%",
|
|
11185
11223
|
height: "calc(100% - 48px)"
|
|
11186
|
-
})),
|
|
11224
|
+
})), It = w(() => ({
|
|
11187
11225
|
position: "absolute",
|
|
11188
11226
|
background: o.value,
|
|
11189
11227
|
bottom: "0px",
|
|
11190
11228
|
width: "100%",
|
|
11191
11229
|
height: "48px"
|
|
11192
|
-
})), G =
|
|
11230
|
+
})), G = w(() => ({
|
|
11193
11231
|
position: "absolute",
|
|
11194
11232
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11195
11233
|
top: "1px",
|
|
@@ -11197,12 +11235,12 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11197
11235
|
width: "56px",
|
|
11198
11236
|
height: "calc(100% - 49px)",
|
|
11199
11237
|
zIndex: 999
|
|
11200
|
-
})),
|
|
11238
|
+
})), Nt = w(() => ({
|
|
11201
11239
|
position: "absolute",
|
|
11202
11240
|
top: "0px",
|
|
11203
11241
|
right: "0px",
|
|
11204
11242
|
zIndex: 20
|
|
11205
|
-
})), W =
|
|
11243
|
+
})), W = w(() => ({
|
|
11206
11244
|
position: "absolute",
|
|
11207
11245
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11208
11246
|
top: "0px",
|
|
@@ -11210,7 +11248,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11210
11248
|
width: "100%",
|
|
11211
11249
|
height: "calc(100% - 48px)",
|
|
11212
11250
|
pointerEvents: "none"
|
|
11213
|
-
})), _n =
|
|
11251
|
+
})), _n = w(() => ({
|
|
11214
11252
|
position: "absolute",
|
|
11215
11253
|
background: t.dark ? "#0000007f" : "#ffffff7f",
|
|
11216
11254
|
top: "1px",
|
|
@@ -11218,7 +11256,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11218
11256
|
width: "56px",
|
|
11219
11257
|
height: "calc(100% - 49px)",
|
|
11220
11258
|
zIndex: 999
|
|
11221
|
-
})), fo =
|
|
11259
|
+
})), fo = w(() => ({
|
|
11222
11260
|
position: "fixed",
|
|
11223
11261
|
top: 0,
|
|
11224
11262
|
left: 0,
|
|
@@ -11230,10 +11268,10 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11230
11268
|
return;
|
|
11231
11269
|
}
|
|
11232
11270
|
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(`#${
|
|
11271
|
+
const N = document.querySelector(`#${r} .blocklyFlyout`);
|
|
11234
11272
|
new MutationObserver((Ue) => {
|
|
11235
|
-
Ue.forEach((
|
|
11236
|
-
|
|
11273
|
+
Ue.forEach((Zt) => {
|
|
11274
|
+
Zt.type === "attributes" && Zt.attributeName === "style" && (Ut.value = p.workspace.getFlyout().isVisible());
|
|
11237
11275
|
});
|
|
11238
11276
|
}).observe(N, { attributes: !0 }), Ut.value = p.workspace.getFlyout().isVisible(), pn(), dn(), await ni(), c("ready");
|
|
11239
11277
|
}), An(() => {
|
|
@@ -11259,7 +11297,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11259
11297
|
}
|
|
11260
11298
|
}
|
|
11261
11299
|
const To = (N) => {
|
|
11262
|
-
m.value = !0, t.type === "json" ?
|
|
11300
|
+
m.value = !0, t.type === "json" ? vc(N, p.workspace) : $.workspaces.load(N, p.workspace);
|
|
11263
11301
|
}, Eo = () => t.type === "json" ? Cc(p.workspace) : $.workspaces.save(p.workspace), go = () => {
|
|
11264
11302
|
if (t.type === "json")
|
|
11265
11303
|
console.assert(!1);
|
|
@@ -11279,9 +11317,9 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11279
11317
|
h.value && (h.value.open = !0);
|
|
11280
11318
|
};
|
|
11281
11319
|
return gn(() => {
|
|
11282
|
-
|
|
11320
|
+
Lt.on("cleanWorkspace", hn), Lt.on("toggleBlocklyLock", fn), Lt.on("openBlocklyNavigator", mn);
|
|
11283
11321
|
}), An(() => {
|
|
11284
|
-
|
|
11322
|
+
Lt.off("cleanWorkspace", hn), Lt.off("toggleBlocklyLock", fn), Lt.off("openBlocklyNavigator", mn);
|
|
11285
11323
|
}), Vt(
|
|
11286
11324
|
() => t.locale,
|
|
11287
11325
|
(N) => {
|
|
@@ -11305,17 +11343,17 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11305
11343
|
generateCode: go,
|
|
11306
11344
|
generateReactivity: Ao,
|
|
11307
11345
|
fireStateChange: Io
|
|
11308
|
-
}), (N,
|
|
11309
|
-
const Ue = M("v-icon"),
|
|
11346
|
+
}), (N, Ot) => {
|
|
11347
|
+
const Ue = M("v-icon"), Zt = M("x-loading");
|
|
11310
11348
|
return S(), tt("div", kc, [
|
|
11311
|
-
|
|
11312
|
-
id:
|
|
11349
|
+
K("div", {
|
|
11350
|
+
id: r,
|
|
11313
11351
|
ref_key: "blocklyDiv",
|
|
11314
11352
|
ref: l,
|
|
11315
11353
|
style: j(P.value)
|
|
11316
11354
|
}, null, 4),
|
|
11317
|
-
|
|
11318
|
-
style: j(
|
|
11355
|
+
K("div", {
|
|
11356
|
+
style: j(It.value)
|
|
11319
11357
|
}, [
|
|
11320
11358
|
oi(N.$slots, "bottom")
|
|
11321
11359
|
], 4),
|
|
@@ -11328,11 +11366,11 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11328
11366
|
icon: "mdi-delete",
|
|
11329
11367
|
size: "x-large"
|
|
11330
11368
|
})
|
|
11331
|
-
], 4)) :
|
|
11332
|
-
m.value ?
|
|
11369
|
+
], 4)) : ut("", !0),
|
|
11370
|
+
m.value ? ut("", !0) : (S(), tt("div", {
|
|
11333
11371
|
key: 1,
|
|
11334
11372
|
class: "d-flex align-end ga-3 pt-3 pr-3",
|
|
11335
|
-
style: j(
|
|
11373
|
+
style: j(Nt.value)
|
|
11336
11374
|
}, [
|
|
11337
11375
|
L(Ma, {
|
|
11338
11376
|
ref_key: "clean",
|
|
@@ -11341,7 +11379,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11341
11379
|
}, null, 8, ["lock"]),
|
|
11342
11380
|
L(Ua, {
|
|
11343
11381
|
modelValue: i.value,
|
|
11344
|
-
"onUpdate:modelValue":
|
|
11382
|
+
"onUpdate:modelValue": Ot[0] || (Ot[0] = (Oo) => i.value = Oo)
|
|
11345
11383
|
}, null, 8, ["modelValue"]),
|
|
11346
11384
|
L(ja, {
|
|
11347
11385
|
ref_key: "navigator",
|
|
@@ -11353,24 +11391,24 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11353
11391
|
i.value ? (S(), tt("div", {
|
|
11354
11392
|
key: 2,
|
|
11355
11393
|
style: j(_n.value)
|
|
11356
|
-
}, null, 4)) :
|
|
11394
|
+
}, null, 4)) : ut("", !0),
|
|
11357
11395
|
i.value ? (S(), tt("div", {
|
|
11358
11396
|
key: 3,
|
|
11359
11397
|
style: j(W.value)
|
|
11360
|
-
}, null, 4)) :
|
|
11361
|
-
|
|
11398
|
+
}, null, 4)) : ut("", !0),
|
|
11399
|
+
K("div", {
|
|
11362
11400
|
ref_key: "parentContainer",
|
|
11363
11401
|
ref: _,
|
|
11364
11402
|
style: j(fo.value)
|
|
11365
11403
|
}, null, 4),
|
|
11366
|
-
L(
|
|
11404
|
+
L(Zt, {
|
|
11367
11405
|
open: m.value,
|
|
11368
11406
|
"z-index": 99
|
|
11369
11407
|
}, null, 8, ["open"])
|
|
11370
11408
|
]);
|
|
11371
11409
|
};
|
|
11372
11410
|
}
|
|
11373
|
-
}), Lc = /* @__PURE__ */
|
|
11411
|
+
}), Lc = /* @__PURE__ */ rt({
|
|
11374
11412
|
__name: "index",
|
|
11375
11413
|
props: {
|
|
11376
11414
|
code: {}
|
|
@@ -11378,7 +11416,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11378
11416
|
setup(t) {
|
|
11379
11417
|
const e = t;
|
|
11380
11418
|
Ko.registerLanguage("javascript", $o);
|
|
11381
|
-
const n = Ho.component, { backgroundColor2: o } =
|
|
11419
|
+
const n = Ho.component, { backgroundColor2: o } = Xt();
|
|
11382
11420
|
return (i, a) => {
|
|
11383
11421
|
const c = M("v-sheet");
|
|
11384
11422
|
return S(), st(c, {
|
|
@@ -11396,18 +11434,18 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11396
11434
|
}, 8, ["color"]);
|
|
11397
11435
|
};
|
|
11398
11436
|
}
|
|
11399
|
-
}), Sc = { class: "text-subtitle-1" }, Bc = { class: "w-100 h-100 overflow-auto" }, bc = /* @__PURE__ */
|
|
11437
|
+
}), Sc = { class: "text-subtitle-1" }, Bc = { class: "w-100 h-100 overflow-auto" }, bc = /* @__PURE__ */ rt({
|
|
11400
11438
|
__name: "index",
|
|
11401
11439
|
setup(t) {
|
|
11402
|
-
const { t: e } =
|
|
11440
|
+
const { t: e } = Jt(), { sysBarAvail: n } = Yn(), { backgroundColor0: o, backgroundColor2: i } = Xt(), a = Bt(""), c = w(() => {
|
|
11403
11441
|
let _ = 48;
|
|
11404
11442
|
return n.value && (_ += 24), {
|
|
11405
11443
|
position: "relative",
|
|
11406
11444
|
height: `calc(100% - ${_}px)`
|
|
11407
11445
|
};
|
|
11408
|
-
}),
|
|
11446
|
+
}), r = (_) => {
|
|
11409
11447
|
a.value = _.code;
|
|
11410
|
-
}, { open: l } = nn("sourceDlg",
|
|
11448
|
+
}, { open: l } = nn("sourceDlg", r);
|
|
11411
11449
|
return (_, d) => {
|
|
11412
11450
|
const h = M("v-sheet"), p = M("v-btn"), m = M("v-spacer"), A = M("v-dialog");
|
|
11413
11451
|
return S(), st(A, {
|
|
@@ -11417,7 +11455,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11417
11455
|
"no-click-animation": "",
|
|
11418
11456
|
persistent: "",
|
|
11419
11457
|
transition: "dialog-bottom-transition",
|
|
11420
|
-
onKeydown: d[2] || (d[2] = $n(
|
|
11458
|
+
onKeydown: d[2] || (d[2] = $n(wt((R) => l.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
11421
11459
|
}, {
|
|
11422
11460
|
default: at(() => [
|
|
11423
11461
|
L(h, {
|
|
@@ -11430,7 +11468,7 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11430
11468
|
key: 0,
|
|
11431
11469
|
color: D(i),
|
|
11432
11470
|
height: 24
|
|
11433
|
-
}, null, 8, ["color"])) :
|
|
11471
|
+
}, null, 8, ["color"])) : ut("", !0),
|
|
11434
11472
|
L(h, {
|
|
11435
11473
|
class: "d-flex align-center px-2",
|
|
11436
11474
|
color: D(i),
|
|
@@ -11443,15 +11481,15 @@ const kc = { class: "position-relative w-100 h-100" }, Nc = /* @__PURE__ */ ct({
|
|
|
11443
11481
|
variant: "text",
|
|
11444
11482
|
onClick: d[0] || (d[0] = (R) => l.value = !1)
|
|
11445
11483
|
}),
|
|
11446
|
-
|
|
11484
|
+
K("span", Sc, Ht(D(e)("x-block-lib.dlg.source.title")), 1),
|
|
11447
11485
|
L(m)
|
|
11448
11486
|
]),
|
|
11449
11487
|
_: 1
|
|
11450
11488
|
}, 8, ["color"]),
|
|
11451
|
-
|
|
11489
|
+
K("div", {
|
|
11452
11490
|
style: j(c.value)
|
|
11453
11491
|
}, [
|
|
11454
|
-
|
|
11492
|
+
K("div", Bc, [
|
|
11455
11493
|
L(Lc, { code: a.value }, null, 8, ["code"])
|
|
11456
11494
|
])
|
|
11457
11495
|
], 4)
|