x-block-lib 0.4.4 → 0.4.6
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/components/blockly/index.vue.d.ts +3 -3
- package/dist/core/toolbox/app/v1/index.d.ts +1 -2
- package/dist/core/toolbox/flow/v1/index.d.ts +30 -0
- package/dist/core/toolbox/func/v1/index.d.ts +30 -0
- package/dist/core/toolbox/index.d.ts +3 -2
- package/dist/index.js +536 -486
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { d as
|
|
7
|
-
import { storeToRefs as
|
|
8
|
-
import { openConfirmDlg as
|
|
9
|
-
var
|
|
10
|
-
|
|
2
|
+
var $e = Object.defineProperty;
|
|
3
|
+
var je = (e, o, t) => o in e ? $e(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
4
|
+
var L = (e, o, t) => je(e, typeof o != "symbol" ? o + "" : o, t);
|
|
5
|
+
import { defineComponent as q, resolveComponent as v, openBlock as I, createBlock as U, unref as F, useModel as re, computed as X, ref as W, onMounted as Ne, onUnmounted as Xe, withCtx as P, createVNode as M, mergeProps as We, createElementVNode as ce, normalizeStyle as J, createElementBlock as K, Fragment as Je, renderList as ze, createTextVNode as Qe, toDisplayString as qe, mergeModels as ye, onBeforeUnmount as Ze, watch as D, resolveDirective as et, withDirectives as tt, createCommentVNode as ne } from "vue";
|
|
6
|
+
import { d as _, j as s, O as l, u, X as ot, B as O, E, M as h, i as Z, a as N, b as f, C as Be, F as Te, c as nt, P as _e, N as de, V as z, e as it, f as Re, s as st, g as V, S as m, h as ie, k as S, l as H, m as se, n as x, o as B, p as Ce, G as le, q as lt, r as at, t as ae, U as w, D as G, v as R, w as rt, T as ee, x as Se, y as ct, z as _t } from "./blockly-jgwpd4oo.js";
|
|
7
|
+
import { storeToRefs as ut } from "pinia";
|
|
8
|
+
import { openConfirmDlg as pt, openPromptDlg as Tt, eventBus as ue, useGlobalStore as dt, useViewStack as ft } from "x-essential-lib";
|
|
9
|
+
var Et = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", ht = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", mt = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", Ot = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", It = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
|
|
10
|
+
_([
|
|
11
11
|
{
|
|
12
12
|
type: "color_blend_v1",
|
|
13
13
|
message0: "%{BKY_COLOR_V1_BLEND_TITLE}",
|
|
@@ -61,7 +61,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
|
|
|
61
61
|
`
|
|
62
62
|
)}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
_([
|
|
65
65
|
{
|
|
66
66
|
type: "color_picker_v1",
|
|
67
67
|
message0: "%1",
|
|
@@ -81,7 +81,7 @@ c([
|
|
|
81
81
|
s.forBlock.color_picker_v1 = function(e) {
|
|
82
82
|
return [s.quote_(e.getFieldValue("COLOR")), l.ATOMIC];
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
_([
|
|
85
85
|
{
|
|
86
86
|
type: "color_random_v1",
|
|
87
87
|
message0: "%{BKY_COLOR_V1_RANDOM_TITLE}",
|
|
@@ -102,7 +102,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
|
102
102
|
`
|
|
103
103
|
)}()`, l.FUNCTION_CALL];
|
|
104
104
|
};
|
|
105
|
-
|
|
105
|
+
_([
|
|
106
106
|
{
|
|
107
107
|
type: "color_rgb_v1",
|
|
108
108
|
message0: "%{BKY_COLOR_V1_RGB_TITLE}",
|
|
@@ -149,7 +149,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
149
149
|
`
|
|
150
150
|
)}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
|
|
151
151
|
};
|
|
152
|
-
const
|
|
152
|
+
const gt = function() {
|
|
153
153
|
if (!window.blocklyState) {
|
|
154
154
|
const e = {
|
|
155
155
|
runtime: {
|
|
@@ -179,7 +179,7 @@ const Tt = function() {
|
|
|
179
179
|
}
|
|
180
180
|
return window.blocklyState;
|
|
181
181
|
}();
|
|
182
|
-
function
|
|
182
|
+
function $(e) {
|
|
183
183
|
let o = "";
|
|
184
184
|
if (e.type === "string") {
|
|
185
185
|
let t = "";
|
|
@@ -194,11 +194,11 @@ function w(e) {
|
|
|
194
194
|
console.assert(!1, "invalid param type", e.type);
|
|
195
195
|
return u.xml.textToDom(o);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a =
|
|
197
|
+
function Me(e, o, t) {
|
|
198
|
+
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ot.domToWorkspace(i, e);
|
|
199
199
|
return e.getBlockById(a[0]);
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const Lt = u.xml, yt = [
|
|
202
202
|
{
|
|
203
203
|
type: "call_func_v1",
|
|
204
204
|
prefixInputs: ["OUTPUT"]
|
|
@@ -228,17 +228,17 @@ const dt = u.xml, ft = [
|
|
|
228
228
|
prefixInputs: ["ARG"]
|
|
229
229
|
}
|
|
230
230
|
];
|
|
231
|
-
function
|
|
231
|
+
function Ct(e, o) {
|
|
232
232
|
var n, i;
|
|
233
|
-
const t =
|
|
233
|
+
const t = yt.find((a) => a.type === e);
|
|
234
234
|
return t ? !!((n = t.prefixInputs) != null && n.some((a) => o.startsWith(a)) || (i = t.inputs) != null && i.some((a) => a === o)) : !1;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const At = {
|
|
237
237
|
init: function() {
|
|
238
238
|
this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
|
|
239
239
|
},
|
|
240
240
|
mutationToDom: function() {
|
|
241
|
-
const e =
|
|
241
|
+
const e = Lt.createElement("mutation");
|
|
242
242
|
return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
|
|
243
243
|
},
|
|
244
244
|
domToMutation: function(e) {
|
|
@@ -267,12 +267,12 @@ const ht = {
|
|
|
267
267
|
tryDuplicate_: function(e) {
|
|
268
268
|
var t;
|
|
269
269
|
const o = this.workspace.getBlockById(e.oldParentId);
|
|
270
|
-
if (o &&
|
|
270
|
+
if (o && Ct(o.type, e.oldInputName))
|
|
271
271
|
try {
|
|
272
272
|
E.disable();
|
|
273
273
|
const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
|
|
274
274
|
if (n) {
|
|
275
|
-
const i =
|
|
275
|
+
const i = Me(this.workspace, this.key, this.name);
|
|
276
276
|
n.connect(i.outputConnection);
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
@@ -283,33 +283,33 @@ const ht = {
|
|
|
283
283
|
this.name ? this.setFieldValue(h[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
|
-
|
|
286
|
+
O.parameter_v1 = At;
|
|
287
287
|
s.forBlock.parameter_v1 = function(e) {
|
|
288
288
|
return [e.key, l.ATOMIC];
|
|
289
289
|
};
|
|
290
|
-
const
|
|
290
|
+
const vt = u.xml, bt = {
|
|
291
291
|
init: function() {
|
|
292
292
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
|
-
|
|
296
|
-
const
|
|
295
|
+
O.list_create_container_v1 = bt;
|
|
296
|
+
const kt = {
|
|
297
297
|
init: function() {
|
|
298
298
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
|
-
|
|
302
|
-
const
|
|
301
|
+
O.list_create_item_v1 = kt;
|
|
302
|
+
const Nt = {
|
|
303
303
|
init: function() {
|
|
304
304
|
this.itemCount_ = 0, this.setMutator(
|
|
305
|
-
new
|
|
305
|
+
new Z.MutatorIcon(
|
|
306
306
|
["list_create_item_v1"],
|
|
307
307
|
this
|
|
308
308
|
)
|
|
309
309
|
), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
|
|
310
310
|
},
|
|
311
311
|
mutationToDom: function() {
|
|
312
|
-
const e =
|
|
312
|
+
const e = vt.createElement("mutation");
|
|
313
313
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
314
314
|
},
|
|
315
315
|
domToMutation: function(e) {
|
|
@@ -377,20 +377,20 @@ const gt = {
|
|
|
377
377
|
for (let e = 0; e < this.itemCount_; e++)
|
|
378
378
|
if (!this.getInput("ADD" + e)) {
|
|
379
379
|
const o = this.appendValueInput("ADD" + e);
|
|
380
|
-
e === 0 && (o.setAlign(
|
|
380
|
+
e === 0 && (o.setAlign(N.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
381
381
|
}
|
|
382
382
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
383
383
|
this.removeInput("ADD" + e);
|
|
384
384
|
}
|
|
385
385
|
};
|
|
386
|
-
|
|
386
|
+
O.list_create_v1 = Nt;
|
|
387
387
|
s.forBlock.list_create_v1 = function(e) {
|
|
388
388
|
const o = e, t = new Array(o.itemCount_);
|
|
389
389
|
for (let i = 0; i < o.itemCount_; i++)
|
|
390
390
|
t[i] = s.valueToCode(o, "ADD" + i, l.NONE) || "null";
|
|
391
391
|
return ["[" + t.join(", ") + "]", l.ATOMIC];
|
|
392
392
|
};
|
|
393
|
-
|
|
393
|
+
_([
|
|
394
394
|
{
|
|
395
395
|
type: "list_delete_v1",
|
|
396
396
|
message0: "%{BKY_LIST_V1_DELETE_TITLE}",
|
|
@@ -418,7 +418,7 @@ s.forBlock.list_delete_v1 = function(e) {
|
|
|
418
418
|
const o = s.valueToCode(e, "VALUE", l.MEMBER) || "[]", t = s.getAdjusted(e, "AT");
|
|
419
419
|
return `${o}.splice(${t}, 1)`;
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
_([
|
|
422
422
|
{
|
|
423
423
|
type: "list_get_v1",
|
|
424
424
|
message0: "%{BKY_LIST_V1_GET_TITLE}",
|
|
@@ -445,7 +445,7 @@ s.forBlock.list_get_v1 = function(e) {
|
|
|
445
445
|
const o = s.valueToCode(e, "VALUE", l.MEMBER) || "[]", t = s.getAdjusted(e, "AT");
|
|
446
446
|
return [`${o}[${t}]`, l.MEMBER];
|
|
447
447
|
};
|
|
448
|
-
|
|
448
|
+
_([
|
|
449
449
|
{
|
|
450
450
|
type: "list_get_sublist_v1",
|
|
451
451
|
message0: "%{BKY_LIST_V1_GET_SUBLIST_TITLE}",
|
|
@@ -477,7 +477,7 @@ s.forBlock.list_get_sublist_v1 = function(e) {
|
|
|
477
477
|
const o = s.valueToCode(e, "LIST", l.MEMBER) || "[]", t = s.getAdjusted(e, "START"), n = s.getAdjusted(e, "END", 1);
|
|
478
478
|
return [`${o}.slice(${t}, ${n})`, l.FUNCTION_CALL];
|
|
479
479
|
};
|
|
480
|
-
|
|
480
|
+
_([
|
|
481
481
|
{
|
|
482
482
|
type: "list_is_empty_v1",
|
|
483
483
|
message0: "%{BKY_LIST_V1_IS_EMPTY_TITLE}",
|
|
@@ -497,7 +497,7 @@ c([
|
|
|
497
497
|
s.forBlock.list_is_empty_v1 = function(e) {
|
|
498
498
|
return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "[]"}.length`, l.LOGICAL_NOT];
|
|
499
499
|
};
|
|
500
|
-
|
|
500
|
+
_([
|
|
501
501
|
{
|
|
502
502
|
type: "list_join_v1",
|
|
503
503
|
message0: "%{BKY_LIST_V1_JOIN_TITLE}",
|
|
@@ -524,7 +524,7 @@ s.forBlock.list_join_v1 = function(e) {
|
|
|
524
524
|
const o = s.valueToCode(e, "LIST", l.MEMBER) || "[]", t = s.valueToCode(e, "DELIM", l.NONE) || "''";
|
|
525
525
|
return [`${o}.join(${t})`, l.FUNCTION_CALL];
|
|
526
526
|
};
|
|
527
|
-
|
|
527
|
+
_([
|
|
528
528
|
{
|
|
529
529
|
type: "list_length_v1",
|
|
530
530
|
message0: "%{BKY_LIST_V1_LENGTH_TITLE}",
|
|
@@ -544,7 +544,7 @@ c([
|
|
|
544
544
|
s.forBlock.list_length_v1 = function(e) {
|
|
545
545
|
return [`${s.valueToCode(e, "VALUE", l.MEMBER) || "[]"}.length`, l.MEMBER];
|
|
546
546
|
};
|
|
547
|
-
|
|
547
|
+
_([
|
|
548
548
|
{
|
|
549
549
|
type: "list_reverse_v1",
|
|
550
550
|
message0: "%{BKY_LIST_V1_REVERSE_TITLE}",
|
|
@@ -565,7 +565,7 @@ c([
|
|
|
565
565
|
s.forBlock.list_reverse_v1 = function(e) {
|
|
566
566
|
return [`${s.valueToCode(e, "LIST", l.NONE) || "[]"}.slice().reverse()`, l.FUNCTION_CALL];
|
|
567
567
|
};
|
|
568
|
-
|
|
568
|
+
_([
|
|
569
569
|
{
|
|
570
570
|
type: "list_set_v1",
|
|
571
571
|
message0: "%{BKY_LIST_V1_SET_TITLE}",
|
|
@@ -599,7 +599,7 @@ s.forBlock.list_set_v1 = function(e) {
|
|
|
599
599
|
return `${o}[${t}] = ${n};
|
|
600
600
|
`;
|
|
601
601
|
};
|
|
602
|
-
const
|
|
602
|
+
const Bt = {
|
|
603
603
|
// logic_compare
|
|
604
604
|
EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
|
|
605
605
|
NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
|
|
@@ -611,11 +611,11 @@ const Lt = {
|
|
|
611
611
|
AND: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_AND}",
|
|
612
612
|
OR: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_OR}"
|
|
613
613
|
};
|
|
614
|
-
|
|
614
|
+
f.register(
|
|
615
615
|
"logic_op_tooltip_v1",
|
|
616
|
-
|
|
616
|
+
f.buildTooltipForDropdown("OP", Bt)
|
|
617
617
|
);
|
|
618
|
-
|
|
618
|
+
_([
|
|
619
619
|
{
|
|
620
620
|
type: "logic_boolean_v1",
|
|
621
621
|
message0: "%1",
|
|
@@ -638,7 +638,7 @@ c([
|
|
|
638
638
|
s.forBlock.logic_boolean_v1 = function(e) {
|
|
639
639
|
return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", l.ATOMIC];
|
|
640
640
|
};
|
|
641
|
-
const
|
|
641
|
+
const Rt = {
|
|
642
642
|
onchange: function(e) {
|
|
643
643
|
this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
|
|
644
644
|
const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
|
|
@@ -655,13 +655,13 @@ const yt = {
|
|
|
655
655
|
this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
f.register(
|
|
659
659
|
"logic_compare_v1",
|
|
660
660
|
function() {
|
|
661
|
-
this.mixin(
|
|
661
|
+
this.mixin(Rt);
|
|
662
662
|
}
|
|
663
663
|
);
|
|
664
|
-
|
|
664
|
+
_([
|
|
665
665
|
{
|
|
666
666
|
type: "logic_compare_v1",
|
|
667
667
|
message0: "%1 %2 %3",
|
|
@@ -708,7 +708,7 @@ s.forBlock.logic_compare_v1 = function(e) {
|
|
|
708
708
|
const i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
|
|
709
709
|
return [`${i} ${t} ${a}`, n];
|
|
710
710
|
};
|
|
711
|
-
const
|
|
711
|
+
const St = {
|
|
712
712
|
elseIfCount_: 0,
|
|
713
713
|
hasElse_: !1,
|
|
714
714
|
mutationToDom: function() {
|
|
@@ -834,13 +834,13 @@ const Ct = {
|
|
|
834
834
|
t == null || t.reconnect(this, "ELSE");
|
|
835
835
|
}
|
|
836
836
|
};
|
|
837
|
-
|
|
837
|
+
f.registerMutator(
|
|
838
838
|
"logic_if_v1_mutator",
|
|
839
|
-
|
|
839
|
+
St,
|
|
840
840
|
void 0,
|
|
841
841
|
["logic_if_else_if_v1", "logic_if_else_v1"]
|
|
842
842
|
);
|
|
843
|
-
|
|
843
|
+
_([
|
|
844
844
|
{
|
|
845
845
|
type: "logic_if_v1",
|
|
846
846
|
message0: "%{BKY_LOGIC_IF} %1",
|
|
@@ -920,7 +920,7 @@ s.forBlock.logic_if_v1 = function(e) {
|
|
|
920
920
|
return t + `
|
|
921
921
|
`;
|
|
922
922
|
};
|
|
923
|
-
|
|
923
|
+
_([
|
|
924
924
|
{
|
|
925
925
|
type: "logic_negate_v1",
|
|
926
926
|
message0: "%{BKY_LOGIC_V1_NEGATE_TITLE}",
|
|
@@ -940,7 +940,7 @@ c([
|
|
|
940
940
|
s.forBlock.logic_negate_v1 = function(e) {
|
|
941
941
|
return [`!${s.valueToCode(e, "BOOL", l.LOGICAL_NOT) || "true"}`, l.LOGICAL_NOT];
|
|
942
942
|
};
|
|
943
|
-
|
|
943
|
+
_([
|
|
944
944
|
{
|
|
945
945
|
type: "logic_operation_v1",
|
|
946
946
|
message0: "%1 %2 %3",
|
|
@@ -982,7 +982,7 @@ s.forBlock.logic_operation_v1 = function(e) {
|
|
|
982
982
|
}
|
|
983
983
|
return [`${n} ${o} ${i}`, t];
|
|
984
984
|
};
|
|
985
|
-
const
|
|
985
|
+
const Mt = {
|
|
986
986
|
prevParentConnection_: null,
|
|
987
987
|
onchange: function(e) {
|
|
988
988
|
const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
|
|
@@ -997,8 +997,8 @@ const At = {
|
|
|
997
997
|
this.prevParentConnection_ = n;
|
|
998
998
|
}
|
|
999
999
|
};
|
|
1000
|
-
|
|
1001
|
-
|
|
1000
|
+
f.registerMixin("logic_ternary_v1", Mt);
|
|
1001
|
+
_([
|
|
1002
1002
|
{
|
|
1003
1003
|
type: "logic_ternary_v1",
|
|
1004
1004
|
message0: "%{BKY_LOGIC_TERNARY_CONDITION} %1",
|
|
@@ -1034,7 +1034,7 @@ s.forBlock.logic_ternary_v1 = function(e) {
|
|
|
1034
1034
|
const o = s.valueToCode(e, "IF", l.CONDITIONAL) || "false", t = s.valueToCode(e, "THEN", l.CONDITIONAL) || "null", n = s.valueToCode(e, "ELSE", l.CONDITIONAL) || "null";
|
|
1035
1035
|
return [o + " ? " + t + " : " + n, l.CONDITIONAL];
|
|
1036
1036
|
};
|
|
1037
|
-
const
|
|
1037
|
+
const Ut = {
|
|
1038
1038
|
customContextMenu: function(e) {
|
|
1039
1039
|
if (this.isInFlyout)
|
|
1040
1040
|
return;
|
|
@@ -1049,32 +1049,32 @@ const vt = {
|
|
|
1049
1049
|
e.push({
|
|
1050
1050
|
enabled: !0,
|
|
1051
1051
|
text: h.VARIABLES_SET_CREATE_GET.replace("%1", n),
|
|
1052
|
-
callback:
|
|
1052
|
+
callback: Be.callbackFactory(this, i)
|
|
1053
1053
|
});
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
};
|
|
1057
|
-
|
|
1057
|
+
f.registerMixin(
|
|
1058
1058
|
"contextMenu_newGetVariableBlock_v1",
|
|
1059
|
-
|
|
1059
|
+
Ut
|
|
1060
1060
|
);
|
|
1061
|
-
|
|
1061
|
+
f.register(
|
|
1062
1062
|
"flow_control_tooltip_v1",
|
|
1063
|
-
|
|
1063
|
+
f.buildTooltipForDropdown("MODE", {
|
|
1064
1064
|
BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
|
|
1065
1065
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
1066
1066
|
})
|
|
1067
1067
|
);
|
|
1068
|
-
const
|
|
1068
|
+
const Vt = /* @__PURE__ */ new Set([
|
|
1069
1069
|
"repeat_v1",
|
|
1070
1070
|
"for_each_v1",
|
|
1071
1071
|
"for_v1",
|
|
1072
1072
|
"while_until_v1"
|
|
1073
|
-
]),
|
|
1073
|
+
]), Pt = {
|
|
1074
1074
|
getSurroundLoop: function() {
|
|
1075
1075
|
let e = this;
|
|
1076
1076
|
do {
|
|
1077
|
-
if (
|
|
1077
|
+
if (Vt.has(e.type))
|
|
1078
1078
|
return !0;
|
|
1079
1079
|
e = e == null ? void 0 : e.getSurroundParent();
|
|
1080
1080
|
} while (e);
|
|
@@ -1095,11 +1095,11 @@ const bt = /* @__PURE__ */ new Set([
|
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
};
|
|
1098
|
-
|
|
1098
|
+
f.registerMixin(
|
|
1099
1099
|
"flow_control_in_loop_check_v1",
|
|
1100
|
-
|
|
1100
|
+
Pt
|
|
1101
1101
|
);
|
|
1102
|
-
|
|
1102
|
+
_([
|
|
1103
1103
|
{
|
|
1104
1104
|
type: "flow_control_v1",
|
|
1105
1105
|
message0: "%1",
|
|
@@ -1120,14 +1120,14 @@ c([
|
|
|
1120
1120
|
extensions: ["flow_control_tooltip_v1", "flow_control_in_loop_check_v1"]
|
|
1121
1121
|
}
|
|
1122
1122
|
]);
|
|
1123
|
-
|
|
1123
|
+
f.register(
|
|
1124
1124
|
"for_tooltip_v1",
|
|
1125
|
-
|
|
1125
|
+
f.buildTooltipWithFieldText(
|
|
1126
1126
|
"%{BKY_LOOP_V1_FOR_TOOLTIP}",
|
|
1127
1127
|
"VAR"
|
|
1128
1128
|
)
|
|
1129
1129
|
);
|
|
1130
|
-
|
|
1130
|
+
_([
|
|
1131
1131
|
{
|
|
1132
1132
|
type: "for_v1",
|
|
1133
1133
|
message0: "%{BKY_LOOP_V1_FOR_TITLE}",
|
|
@@ -1171,14 +1171,14 @@ c([
|
|
|
1171
1171
|
extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
|
|
1172
1172
|
}
|
|
1173
1173
|
]);
|
|
1174
|
-
|
|
1174
|
+
f.register(
|
|
1175
1175
|
"for_each_tooltip_v1",
|
|
1176
|
-
|
|
1176
|
+
f.buildTooltipWithFieldText(
|
|
1177
1177
|
"%{BKY_LOOP_V1_FOR_EACH_TOOLTIP}",
|
|
1178
1178
|
"VAR"
|
|
1179
1179
|
)
|
|
1180
1180
|
);
|
|
1181
|
-
|
|
1181
|
+
_([
|
|
1182
1182
|
{
|
|
1183
1183
|
type: "for_each_v1",
|
|
1184
1184
|
message0: "%{BKY_LOOP_V1_FOR_EACH_TITLE}",
|
|
@@ -1208,14 +1208,14 @@ c([
|
|
|
1208
1208
|
extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
|
|
1209
1209
|
}
|
|
1210
1210
|
]);
|
|
1211
|
-
|
|
1211
|
+
f.register(
|
|
1212
1212
|
"loop_while_until_tooltip_v1",
|
|
1213
|
-
|
|
1213
|
+
f.buildTooltipForDropdown("MODE", {
|
|
1214
1214
|
WHILE: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE}",
|
|
1215
1215
|
UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
|
|
1216
1216
|
})
|
|
1217
1217
|
);
|
|
1218
|
-
|
|
1218
|
+
_([
|
|
1219
1219
|
{
|
|
1220
1220
|
type: "loop_while_until_v1",
|
|
1221
1221
|
message0: "%1 %2",
|
|
@@ -1262,7 +1262,7 @@ ${n}
|
|
|
1262
1262
|
}
|
|
1263
1263
|
`;
|
|
1264
1264
|
};
|
|
1265
|
-
const
|
|
1265
|
+
const Dt = {
|
|
1266
1266
|
// math_arithmetic
|
|
1267
1267
|
ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
|
|
1268
1268
|
SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
|
|
@@ -1294,11 +1294,11 @@ const kt = {
|
|
|
1294
1294
|
STD_DEV: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_STD_DEV}",
|
|
1295
1295
|
RANDOM: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_RANDOM}"
|
|
1296
1296
|
};
|
|
1297
|
-
|
|
1297
|
+
f.register(
|
|
1298
1298
|
"math_op_tooltip_v1",
|
|
1299
|
-
|
|
1299
|
+
f.buildTooltipForDropdown("OP", Dt)
|
|
1300
1300
|
);
|
|
1301
|
-
|
|
1301
|
+
_([
|
|
1302
1302
|
{
|
|
1303
1303
|
type: "math_arithmetic_v1",
|
|
1304
1304
|
message0: "%1 %2 %3",
|
|
@@ -1342,7 +1342,7 @@ s.forBlock.math_arithmetic_v1 = function(e) {
|
|
|
1342
1342
|
}, [t, n] = o[e.getFieldValue("OP")], i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
|
|
1343
1343
|
return t ? [i + t + a, n] : [`Math.pow(${i}, ${a})`, l.FUNCTION_CALL];
|
|
1344
1344
|
};
|
|
1345
|
-
|
|
1345
|
+
_([
|
|
1346
1346
|
{
|
|
1347
1347
|
type: "math_constant_v1",
|
|
1348
1348
|
message0: "%1",
|
|
@@ -1376,7 +1376,7 @@ s.forBlock.math_constant_v1 = function(e) {
|
|
|
1376
1376
|
INFINITY: ["Infinity", l.ATOMIC]
|
|
1377
1377
|
}[e.getFieldValue("CONSTANT")];
|
|
1378
1378
|
};
|
|
1379
|
-
|
|
1379
|
+
_([
|
|
1380
1380
|
{
|
|
1381
1381
|
type: "math_constrain_v1",
|
|
1382
1382
|
message0: "%{BKY_MATH_V1_CONSTRAIN_TITLE}",
|
|
@@ -1408,7 +1408,7 @@ s.forBlock.math_constrain_v1 = function(e) {
|
|
|
1408
1408
|
const o = s.valueToCode(e, "VALUE", l.NONE) || "0", t = s.valueToCode(e, "LOW", l.NONE) || "0", n = s.valueToCode(e, "HIGH", l.NONE) || "Infinity";
|
|
1409
1409
|
return [`Math.min(Math.max(${o}, ${t}), ${n})`, l.FUNCTION_CALL];
|
|
1410
1410
|
};
|
|
1411
|
-
|
|
1411
|
+
_([
|
|
1412
1412
|
{
|
|
1413
1413
|
type: "math_modulo_v1",
|
|
1414
1414
|
message0: "%{BKY_MATH_V1_MODULO_TITLE}",
|
|
@@ -1435,7 +1435,7 @@ s.forBlock.math_modulo_v1 = function(e) {
|
|
|
1435
1435
|
const o = s.valueToCode(e, "DIVIDEND", l.MODULUS) || "0", t = s.valueToCode(e, "DIVISOR", l.MODULUS) || "0";
|
|
1436
1436
|
return [o + " % " + t, l.MODULUS];
|
|
1437
1437
|
};
|
|
1438
|
-
|
|
1438
|
+
_([
|
|
1439
1439
|
{
|
|
1440
1440
|
type: "math_number_v1",
|
|
1441
1441
|
message0: "%1",
|
|
@@ -1457,7 +1457,7 @@ s.forBlock.math_number_v1 = function(e) {
|
|
|
1457
1457
|
const o = Number(e.getFieldValue("NUM")), t = o >= 0 ? l.ATOMIC : l.UNARY_NEGATION;
|
|
1458
1458
|
return [String(o), t];
|
|
1459
1459
|
};
|
|
1460
|
-
|
|
1460
|
+
_([
|
|
1461
1461
|
{
|
|
1462
1462
|
type: "math_number_property_v1",
|
|
1463
1463
|
message0: "%{BKY_MATH_V1_NUMBER_PROPERTY_TITLE}",
|
|
@@ -1497,9 +1497,9 @@ s.forBlock.math_number_property_v1 = function(e) {
|
|
|
1497
1497
|
DIVISIBLE_BY: [null, l.MODULUS, l.EQUALITY],
|
|
1498
1498
|
PRIME: [null, l.NONE, l.FUNCTION_CALL]
|
|
1499
1499
|
}, t = e.getFieldValue("PROPERTY"), [n, i, a] = o[e.getFieldValue("PROPERTY")], r = s.valueToCode(e, "NUMBER_TO_CHECK", i) || "0";
|
|
1500
|
-
let
|
|
1500
|
+
let c;
|
|
1501
1501
|
if (t === "PRIME")
|
|
1502
|
-
|
|
1502
|
+
c = s.provideFunction_(
|
|
1503
1503
|
"mathIsPrime",
|
|
1504
1504
|
`
|
|
1505
1505
|
function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
@@ -1524,12 +1524,12 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
|
1524
1524
|
) + "(" + r + ")";
|
|
1525
1525
|
else if (t === "DIVISIBLE_BY") {
|
|
1526
1526
|
const p = s.valueToCode(e, "DIVISOR", l.MODULUS) || "0";
|
|
1527
|
-
|
|
1527
|
+
c = r + " % " + p + " === 0";
|
|
1528
1528
|
} else
|
|
1529
|
-
|
|
1530
|
-
return [
|
|
1529
|
+
c = r + n;
|
|
1530
|
+
return [c, a];
|
|
1531
1531
|
};
|
|
1532
|
-
|
|
1532
|
+
_([
|
|
1533
1533
|
{
|
|
1534
1534
|
type: "math_on_list_v1",
|
|
1535
1535
|
message0: "%{BKY_MATH_V1_ON_LIST_TITLE}",
|
|
@@ -1679,7 +1679,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
return [n, l.FUNCTION_CALL];
|
|
1681
1681
|
};
|
|
1682
|
-
|
|
1682
|
+
_([
|
|
1683
1683
|
{
|
|
1684
1684
|
type: "math_random_float_v1",
|
|
1685
1685
|
message0: "%{BKY_MATH_V1_RANDOM_FLOAT_TITLE}",
|
|
@@ -1692,7 +1692,7 @@ c([
|
|
|
1692
1692
|
s.forBlock.math_random_float_v1 = function() {
|
|
1693
1693
|
return ["Math.random()", l.FUNCTION_CALL];
|
|
1694
1694
|
};
|
|
1695
|
-
|
|
1695
|
+
_([
|
|
1696
1696
|
{
|
|
1697
1697
|
type: "math_random_int_v1",
|
|
1698
1698
|
message0: "%{BKY_MATH_V1_RANDOM_INT_TITLE}",
|
|
@@ -1732,7 +1732,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
|
|
1732
1732
|
`
|
|
1733
1733
|
) + "(" + o + ", " + t + ")", l.FUNCTION_CALL];
|
|
1734
1734
|
};
|
|
1735
|
-
|
|
1735
|
+
_([
|
|
1736
1736
|
{
|
|
1737
1737
|
type: "math_round_v1",
|
|
1738
1738
|
message0: "%1 %2",
|
|
@@ -1774,7 +1774,7 @@ s.forBlock.math_round_v1 = function(e) {
|
|
|
1774
1774
|
}
|
|
1775
1775
|
return [n, l.FUNCTION_CALL];
|
|
1776
1776
|
};
|
|
1777
|
-
|
|
1777
|
+
_([
|
|
1778
1778
|
{
|
|
1779
1779
|
type: "math_single_v1",
|
|
1780
1780
|
message0: "%1 %2",
|
|
@@ -1837,7 +1837,7 @@ s.forBlock.math_single_v1 = function(e) {
|
|
|
1837
1837
|
}
|
|
1838
1838
|
return [t, l.DIVISION];
|
|
1839
1839
|
};
|
|
1840
|
-
|
|
1840
|
+
_([
|
|
1841
1841
|
{
|
|
1842
1842
|
type: "math_trig_v1",
|
|
1843
1843
|
message0: "%1 %2",
|
|
@@ -1899,31 +1899,31 @@ s.forBlock.math_trig_v1 = function(e) {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
return [n, l.DIVISION];
|
|
1901
1901
|
};
|
|
1902
|
-
const
|
|
1902
|
+
const xt = u.xml, Yt = {
|
|
1903
1903
|
init: function() {
|
|
1904
1904
|
this.appendDummyInput().appendField(
|
|
1905
1905
|
"%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
|
|
1906
1906
|
), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1907
1907
|
}
|
|
1908
1908
|
};
|
|
1909
|
-
|
|
1910
|
-
const
|
|
1909
|
+
O.object_create_container_v1 = Yt;
|
|
1910
|
+
const Kt = {
|
|
1911
1911
|
init: function() {
|
|
1912
1912
|
this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1913
1913
|
}
|
|
1914
1914
|
};
|
|
1915
|
-
|
|
1916
|
-
const
|
|
1915
|
+
O.object_create_item_v1 = Kt;
|
|
1916
|
+
const Ft = {
|
|
1917
1917
|
init: function() {
|
|
1918
1918
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
1919
|
-
new
|
|
1919
|
+
new Z.MutatorIcon(
|
|
1920
1920
|
["object_create_item_v1"],
|
|
1921
1921
|
this
|
|
1922
1922
|
)
|
|
1923
1923
|
), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
|
|
1924
1924
|
},
|
|
1925
1925
|
mutationToDom: function() {
|
|
1926
|
-
const e =
|
|
1926
|
+
const e = xt.createElement("mutation");
|
|
1927
1927
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
1928
1928
|
},
|
|
1929
1929
|
domToMutation: function(e) {
|
|
@@ -1988,12 +1988,12 @@ const Mt = {
|
|
|
1988
1988
|
},
|
|
1989
1989
|
updateShape_: function() {
|
|
1990
1990
|
for (let e = 0; e < this.itemCount_; e++)
|
|
1991
|
-
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(
|
|
1991
|
+
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(N.Align.RIGHT).appendField(new Te("key"), "KEY" + e);
|
|
1992
1992
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
1993
1993
|
this.removeInput("ADD" + e);
|
|
1994
1994
|
}
|
|
1995
1995
|
};
|
|
1996
|
-
|
|
1996
|
+
O.object_create_v1 = Ft;
|
|
1997
1997
|
s.forBlock.object_create_v1 = function(e) {
|
|
1998
1998
|
const o = e;
|
|
1999
1999
|
let t = "{";
|
|
@@ -2003,7 +2003,7 @@ s.forBlock.object_create_v1 = function(e) {
|
|
|
2003
2003
|
}
|
|
2004
2004
|
return t += "}", [t, l.ATOMIC];
|
|
2005
2005
|
};
|
|
2006
|
-
|
|
2006
|
+
_([
|
|
2007
2007
|
{
|
|
2008
2008
|
type: "object_delete_v1",
|
|
2009
2009
|
message0: "%{BKY_OBJECT_V1_DELETE_TITLE}",
|
|
@@ -2070,7 +2070,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
2070
2070
|
return `${o}(${t}, ${n});
|
|
2071
2071
|
`;
|
|
2072
2072
|
};
|
|
2073
|
-
|
|
2073
|
+
_([
|
|
2074
2074
|
{
|
|
2075
2075
|
type: "object_from_json_v1",
|
|
2076
2076
|
message0: "%{BKY_OBJECT_V1_FROM_JSON_TITLE}",
|
|
@@ -2091,7 +2091,7 @@ c([
|
|
|
2091
2091
|
s.forBlock.object_from_json_v1 = function(e) {
|
|
2092
2092
|
return [`__parseJsonV1__(${s.valueToCode(e, "JSON", l.NONE) || "''"})`, l.FUNCTION_CALL];
|
|
2093
2093
|
};
|
|
2094
|
-
|
|
2094
|
+
_([
|
|
2095
2095
|
{
|
|
2096
2096
|
type: "object_get_v1",
|
|
2097
2097
|
message0: "%{BKY_OBJECT_V1_GET_TITLE}",
|
|
@@ -2156,7 +2156,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
2156
2156
|
), t = s.valueToCode(e, "OBJECT", l.ATOMIC) || "null", n = s.valueToCode(e, "KEY", l.ATOMIC) || "''";
|
|
2157
2157
|
return [`${o}(${t}, ${n})`, l.FUNCTION_CALL];
|
|
2158
2158
|
};
|
|
2159
|
-
|
|
2159
|
+
_([
|
|
2160
2160
|
{
|
|
2161
2161
|
type: "object_set_v1",
|
|
2162
2162
|
message0: "%{BKY_OBJECT_V1_SET_TITLE}",
|
|
@@ -2230,7 +2230,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(obj, key, val) {
|
|
|
2230
2230
|
return `${o}(${t}, ${n}, ${i});
|
|
2231
2231
|
`;
|
|
2232
2232
|
};
|
|
2233
|
-
|
|
2233
|
+
_([
|
|
2234
2234
|
{
|
|
2235
2235
|
type: "object_to_json_v1",
|
|
2236
2236
|
message0: "%{BKY_OBJECT_V1_TO_JSON_TITLE}",
|
|
@@ -2251,15 +2251,15 @@ c([
|
|
|
2251
2251
|
s.forBlock.object_to_json_v1 = function(e) {
|
|
2252
2252
|
return [`__jsonStringifyV1__(${s.valueToCode(e, "OBJECT", l.NONE) || "null"})`, l.FUNCTION_CALL];
|
|
2253
2253
|
};
|
|
2254
|
-
const
|
|
2254
|
+
const Ae = u.xml, Ht = {
|
|
2255
2255
|
init: function() {
|
|
2256
|
-
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new
|
|
2256
|
+
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new nt(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
2257
2257
|
}
|
|
2258
2258
|
};
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2259
|
+
O.procedure_def_container_v1 = Ht;
|
|
2260
|
+
const wt = {
|
|
2261
2261
|
init: function() {
|
|
2262
|
-
const e = new
|
|
2262
|
+
const e = new Te(_e.DEFAULT_ARG);
|
|
2263
2263
|
e.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(e, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
2264
2264
|
},
|
|
2265
2265
|
validator_: function(e) {
|
|
@@ -2279,24 +2279,24 @@ const Vt = {
|
|
|
2279
2279
|
return e;
|
|
2280
2280
|
}
|
|
2281
2281
|
};
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2282
|
+
O.procedure_def_item_v1 = wt;
|
|
2283
|
+
const Gt = {
|
|
2284
2284
|
init: function() {
|
|
2285
2285
|
this.withReturn = !1, this.args = [];
|
|
2286
|
-
const e = new
|
|
2287
|
-
|
|
2286
|
+
const e = new Te(
|
|
2287
|
+
_e.findLegalName("", this)
|
|
2288
2288
|
);
|
|
2289
|
-
e.setValidator(
|
|
2290
|
-
new
|
|
2289
|
+
e.setValidator(_e.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
|
|
2290
|
+
new Z.MutatorIcon(
|
|
2291
2291
|
["procedure_def_item_v1"],
|
|
2292
2292
|
this
|
|
2293
2293
|
)
|
|
2294
2294
|
), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_DEF_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_DEF_HELPURL}");
|
|
2295
2295
|
},
|
|
2296
2296
|
mutationToDom: function() {
|
|
2297
|
-
const e =
|
|
2297
|
+
const e = Ae.createElement("mutation");
|
|
2298
2298
|
return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((o) => {
|
|
2299
|
-
const t =
|
|
2299
|
+
const t = Ae.createElement("arg");
|
|
2300
2300
|
t.setAttribute("name", o.name), t.setAttribute("id", o.id), e.appendChild(t);
|
|
2301
2301
|
}), e;
|
|
2302
2302
|
},
|
|
@@ -2373,20 +2373,20 @@ const Pt = {
|
|
|
2373
2373
|
n.setKeyName(o.name, "");
|
|
2374
2374
|
else
|
|
2375
2375
|
try {
|
|
2376
|
-
E.disable(), n =
|
|
2376
|
+
E.disable(), n = Me(this.workspace, o.name, ""), n.outputConnection.connect(t);
|
|
2377
2377
|
} finally {
|
|
2378
2378
|
E.enable();
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
2381
2381
|
}
|
|
2382
2382
|
};
|
|
2383
|
-
|
|
2384
|
-
const
|
|
2383
|
+
O.procedure_def_v1 = Gt;
|
|
2384
|
+
const $t = u.xml, jt = {
|
|
2385
2385
|
init: function() {
|
|
2386
2386
|
this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
|
|
2387
2387
|
},
|
|
2388
2388
|
mutationToDom: function() {
|
|
2389
|
-
const e =
|
|
2389
|
+
const e = $t.createElement("mutation");
|
|
2390
2390
|
return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
|
|
2391
2391
|
},
|
|
2392
2392
|
domToMutation: function(e) {
|
|
@@ -2437,14 +2437,14 @@ const Dt = u.xml, xt = {
|
|
|
2437
2437
|
e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
|
|
2438
2438
|
}
|
|
2439
2439
|
};
|
|
2440
|
-
|
|
2440
|
+
O.procedure_return_v1 = jt;
|
|
2441
2441
|
s.forBlock.procedure_return_v1 = function(e) {
|
|
2442
2442
|
const o = e;
|
|
2443
2443
|
return o.withReturn ? `return ${s.valueToCode(o, "VALUE", l.NONE) || "null"};
|
|
2444
2444
|
` : `return;
|
|
2445
2445
|
`;
|
|
2446
2446
|
};
|
|
2447
|
-
|
|
2447
|
+
_([
|
|
2448
2448
|
{
|
|
2449
2449
|
type: "text_v1",
|
|
2450
2450
|
message0: "%{BKY_TEXT_V1_TEXT_TITLE}",
|
|
@@ -2465,18 +2465,18 @@ c([
|
|
|
2465
2465
|
s.forBlock.text_v1 = function(e) {
|
|
2466
2466
|
return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
|
|
2467
2467
|
};
|
|
2468
|
-
const
|
|
2469
|
-
function
|
|
2470
|
-
return
|
|
2468
|
+
const Xt = /^\s*'([^']|\\')*'\s*$/;
|
|
2469
|
+
function Q(e) {
|
|
2470
|
+
return Xt.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
|
|
2471
2471
|
}
|
|
2472
|
-
|
|
2472
|
+
f.register(
|
|
2473
2473
|
"text_append_tooltip_v1",
|
|
2474
|
-
|
|
2474
|
+
f.buildTooltipWithFieldText(
|
|
2475
2475
|
"%{BKY_TEXT_V1_APPEND_TOOLTIP}",
|
|
2476
2476
|
"VAR"
|
|
2477
2477
|
)
|
|
2478
2478
|
);
|
|
2479
|
-
|
|
2479
|
+
_([
|
|
2480
2480
|
{
|
|
2481
2481
|
type: "text_append_v1",
|
|
2482
2482
|
message0: "%{BKY_TEXT_V1_APPEND_TITLE}",
|
|
@@ -2501,12 +2501,12 @@ s.forBlock.text_append_v1 = function(e) {
|
|
|
2501
2501
|
var n;
|
|
2502
2502
|
const o = (n = s.nameDB_) == null ? void 0 : n.getName(
|
|
2503
2503
|
e.getFieldValue("VAR"),
|
|
2504
|
-
|
|
2504
|
+
de.NameType.VARIABLE
|
|
2505
2505
|
), t = s.valueToCode(e, "TEXT", l.NONE) || "''";
|
|
2506
|
-
return `${o} += ${
|
|
2506
|
+
return `${o} += ${Q(t)};
|
|
2507
2507
|
`;
|
|
2508
2508
|
};
|
|
2509
|
-
|
|
2509
|
+
_([
|
|
2510
2510
|
{
|
|
2511
2511
|
type: "text_change_case_v1",
|
|
2512
2512
|
message0: "%{BKY_TEXT_V1_CHANGE_CASE_TITLE}",
|
|
@@ -2552,7 +2552,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
|
|
2552
2552
|
`
|
|
2553
2553
|
) + "(" + n + ")", [i, l.FUNCTION_CALL];
|
|
2554
2554
|
};
|
|
2555
|
-
|
|
2555
|
+
_([
|
|
2556
2556
|
{
|
|
2557
2557
|
type: "text_char_at_v1",
|
|
2558
2558
|
message0: "%{BKY_TEXT_V1_CHAR_AT_TITLE}",
|
|
@@ -2579,7 +2579,7 @@ s.forBlock.text_char_at_v1 = function(e) {
|
|
|
2579
2579
|
const o = s.valueToCode(e, "VALUE", l.MEMBER) || "[]", t = s.getAdjusted(e, "AT");
|
|
2580
2580
|
return [`${o}.charAt(${t})`, l.FUNCTION_CALL];
|
|
2581
2581
|
};
|
|
2582
|
-
|
|
2582
|
+
_([
|
|
2583
2583
|
{
|
|
2584
2584
|
type: "text_count_v1",
|
|
2585
2585
|
message0: "%{BKY_TEXT_V1_COUNT_TITLE}",
|
|
@@ -2617,7 +2617,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
|
|
2617
2617
|
`
|
|
2618
2618
|
)}(${o}, ${t})`, l.FUNCTION_CALL];
|
|
2619
2619
|
};
|
|
2620
|
-
|
|
2620
|
+
_([
|
|
2621
2621
|
{
|
|
2622
2622
|
type: "text_index_of_v1",
|
|
2623
2623
|
message0: "%{BKY_TEXT_V1_INDEX_OF_TITLE}",
|
|
@@ -2652,7 +2652,7 @@ s.forBlock.text_index_of_v1 = function(e) {
|
|
|
2652
2652
|
const o = e.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", t = s.valueToCode(e, "TEXT", l.MEMBER) || "''", n = s.valueToCode(e, "SUBSTR", l.NONE) || "''";
|
|
2653
2653
|
return [`${t}.${o}(${n})`, l.FUNCTION_CALL];
|
|
2654
2654
|
};
|
|
2655
|
-
|
|
2655
|
+
_([
|
|
2656
2656
|
{
|
|
2657
2657
|
type: "text_is_empty_v1",
|
|
2658
2658
|
message0: "%{BKY_TEXT_V1_IS_EMPTY_TITLE}",
|
|
@@ -2672,10 +2672,10 @@ c([
|
|
|
2672
2672
|
s.forBlock.text_is_empty_v1 = function(e) {
|
|
2673
2673
|
return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.LOGICAL_NOT];
|
|
2674
2674
|
};
|
|
2675
|
-
const
|
|
2675
|
+
const Wt = u.xml, Jt = {
|
|
2676
2676
|
itemCount_: 0,
|
|
2677
2677
|
mutationToDom: function() {
|
|
2678
|
-
const e =
|
|
2678
|
+
const e = Wt.createElement("mutation");
|
|
2679
2679
|
return e.setAttribute("items", `${this.itemCount_}`), e;
|
|
2680
2680
|
},
|
|
2681
2681
|
domToMutation: function(e) {
|
|
@@ -2740,22 +2740,22 @@ const Kt = u.xml, Ft = {
|
|
|
2740
2740
|
for (let e = 0; e < this.itemCount_; e++)
|
|
2741
2741
|
if (!this.getInput("ADD" + e)) {
|
|
2742
2742
|
const o = this.appendValueInput("ADD" + e).setAlign(
|
|
2743
|
-
|
|
2743
|
+
N.Align.RIGHT
|
|
2744
2744
|
);
|
|
2745
2745
|
e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
2746
2746
|
}
|
|
2747
2747
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
2748
2748
|
this.removeInput("ADD" + e);
|
|
2749
2749
|
}
|
|
2750
|
-
},
|
|
2751
|
-
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new
|
|
2750
|
+
}, zt = function() {
|
|
2751
|
+
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Z.MutatorIcon(["text_join_item_v1"], this));
|
|
2752
2752
|
};
|
|
2753
|
-
|
|
2753
|
+
f.registerMutator(
|
|
2754
2754
|
"text_join_mutator_v1",
|
|
2755
|
-
|
|
2756
|
-
|
|
2755
|
+
Jt,
|
|
2756
|
+
zt
|
|
2757
2757
|
);
|
|
2758
|
-
|
|
2758
|
+
_([
|
|
2759
2759
|
{
|
|
2760
2760
|
type: "text_join_v1",
|
|
2761
2761
|
message0: "",
|
|
@@ -2796,11 +2796,11 @@ s.forBlock.text_join_v1 = function(e) {
|
|
|
2796
2796
|
return ["''", l.ATOMIC];
|
|
2797
2797
|
case 1: {
|
|
2798
2798
|
const t = s.valueToCode(o, "ADD0", l.NONE) || "''";
|
|
2799
|
-
return
|
|
2799
|
+
return Q(t);
|
|
2800
2800
|
}
|
|
2801
2801
|
case 2: {
|
|
2802
2802
|
const t = s.valueToCode(o, "ADD0", l.NONE) || "''", n = s.valueToCode(o, "ADD1", l.NONE) || "''";
|
|
2803
|
-
return [
|
|
2803
|
+
return [Q(t)[0] + " + " + Q(n)[0], l.ADDITION];
|
|
2804
2804
|
}
|
|
2805
2805
|
default: {
|
|
2806
2806
|
const t = new Array(o.itemCount_);
|
|
@@ -2810,7 +2810,7 @@ s.forBlock.text_join_v1 = function(e) {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
};
|
|
2813
|
-
|
|
2813
|
+
_([
|
|
2814
2814
|
{
|
|
2815
2815
|
type: "text_length_v1",
|
|
2816
2816
|
message0: "%{BKY_TEXT_V1_LENGTH_TITLE}",
|
|
@@ -2830,7 +2830,7 @@ c([
|
|
|
2830
2830
|
s.forBlock.text_length_v1 = function(e) {
|
|
2831
2831
|
return [`${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.MEMBER];
|
|
2832
2832
|
};
|
|
2833
|
-
|
|
2833
|
+
_([
|
|
2834
2834
|
{
|
|
2835
2835
|
type: "text_replace_v1",
|
|
2836
2836
|
message0: "%{BKY_TEXT_V1_REPLACE_TITLE}",
|
|
@@ -2871,7 +2871,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
|
2871
2871
|
`
|
|
2872
2872
|
)}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
|
|
2873
2873
|
};
|
|
2874
|
-
|
|
2874
|
+
_([
|
|
2875
2875
|
{
|
|
2876
2876
|
type: "text_reverse_v1",
|
|
2877
2877
|
message0: "%{BKY_TEXT_V1_REVERSE_TITLE}",
|
|
@@ -2892,7 +2892,7 @@ c([
|
|
|
2892
2892
|
s.forBlock.text_reverse_v1 = function(e) {
|
|
2893
2893
|
return [(s.valueToCode(e, "TEXT", l.MEMBER) || "''") + ".split('').reverse().join('')", l.FUNCTION_CALL];
|
|
2894
2894
|
};
|
|
2895
|
-
|
|
2895
|
+
_([
|
|
2896
2896
|
{
|
|
2897
2897
|
type: "text_split_v1",
|
|
2898
2898
|
message0: "%{BKY_TEXT_V1_SPLIT_TITLE}",
|
|
@@ -2919,7 +2919,7 @@ s.forBlock.text_split_v1 = function(e) {
|
|
|
2919
2919
|
const o = s.valueToCode(e, "TEXT", l.MEMBER) || "''", t = s.valueToCode(e, "DELIM", l.NONE) || "''";
|
|
2920
2920
|
return [`${o}.split(${t})`, l.FUNCTION_CALL];
|
|
2921
2921
|
};
|
|
2922
|
-
|
|
2922
|
+
_([
|
|
2923
2923
|
{
|
|
2924
2924
|
type: "text_substring_v1",
|
|
2925
2925
|
message0: "%{BKY_TEXT_V1_SUBSTRING_TITLE}",
|
|
@@ -2951,7 +2951,7 @@ s.forBlock.text_substring_v1 = function(e) {
|
|
|
2951
2951
|
const o = s.valueToCode(e, "TEXT", l.MEMBER) || "''", t = s.getAdjusted(e, "START"), n = s.getAdjusted(e, "END", 1);
|
|
2952
2952
|
return [`${o}.slice(${t}, ${n})`, l.FUNCTION_CALL];
|
|
2953
2953
|
};
|
|
2954
|
-
|
|
2954
|
+
_([
|
|
2955
2955
|
{
|
|
2956
2956
|
type: "text_trim_v1",
|
|
2957
2957
|
message0: "%{BKY_TEXT_V1_TRIM_TITLE}",
|
|
@@ -2985,7 +2985,7 @@ s.forBlock.text_trim_v1 = function(e) {
|
|
|
2985
2985
|
}[e.getFieldValue("MODE")];
|
|
2986
2986
|
return [`__trimV1__(${o}, ${n})`, l.ATOMIC];
|
|
2987
2987
|
};
|
|
2988
|
-
const
|
|
2988
|
+
const Qt = {
|
|
2989
2989
|
init: function() {
|
|
2990
2990
|
this.appendDummyInput().appendField("%{BKY_TIME_V1_CREATE_TIMER_TITLE}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("time_blocks"), this.setTooltip("%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}"), this.setHelpUrl("%{BKY_TIME_V1_CREATE_TIMER_HELPURL}");
|
|
2991
2991
|
},
|
|
@@ -2996,22 +2996,22 @@ const wt = {
|
|
|
2996
2996
|
this.updateShape_(), this.updateShadow_();
|
|
2997
2997
|
},
|
|
2998
2998
|
updateShape_: function() {
|
|
2999
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
2999
|
+
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(N.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
|
|
3000
3000
|
},
|
|
3001
3001
|
updateShadow_: function() {
|
|
3002
|
-
var e, o, t, n, i, a, r,
|
|
3002
|
+
var e, o, t, n, i, a, r, c;
|
|
3003
3003
|
this.isInsertionMarker() || ((o = (e = this.getInput("INTERVAL")) == null ? void 0 : e.connection) == null || o.setShadowDom(
|
|
3004
|
-
|
|
3004
|
+
$({ type: "number", default: 1e3 })
|
|
3005
3005
|
), (n = (t = this.getInput("LOOP")) == null ? void 0 : t.connection) == null || n.setShadowDom(
|
|
3006
|
-
|
|
3006
|
+
$({ type: "boolean", default: !1 })
|
|
3007
3007
|
), (a = (i = this.getInput("COUNT")) == null ? void 0 : i.connection) == null || a.setShadowDom(
|
|
3008
|
-
|
|
3009
|
-
), (
|
|
3010
|
-
|
|
3008
|
+
$({ type: "number", default: 1 })
|
|
3009
|
+
), (c = (r = this.getInput("IMMEDIATE")) == null ? void 0 : r.connection) == null || c.setShadowDom(
|
|
3010
|
+
$({ type: "boolean", default: !1 })
|
|
3011
3011
|
));
|
|
3012
3012
|
}
|
|
3013
3013
|
};
|
|
3014
|
-
|
|
3014
|
+
O.create_timer_v1 = Qt;
|
|
3015
3015
|
s.forBlock.create_timer_v1 = function(e) {
|
|
3016
3016
|
const o = s.valueToCode(e, "INTERVAL", l.ATOMIC) || "1000", t = s.valueToCode(e, "LOOP", l.ATOMIC) || "false", n = s.valueToCode(e, "COUNT", l.ATOMIC) || "1", i = s.valueToCode(e, "IMMEDIATE", l.ATOMIC) || "false", a = s.statementToCode(e, "CALLBACK");
|
|
3017
3017
|
return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
|
|
@@ -3019,7 +3019,7 @@ s.forBlock.create_timer_v1 = function(e) {
|
|
|
3019
3019
|
});
|
|
3020
3020
|
`;
|
|
3021
3021
|
};
|
|
3022
|
-
|
|
3022
|
+
_([
|
|
3023
3023
|
{
|
|
3024
3024
|
type: "delay_v1",
|
|
3025
3025
|
message0: "%{BKY_TIME_V1_DELAY_TITLE}",
|
|
@@ -3041,18 +3041,18 @@ s.forBlock.delay_v1 = function(e) {
|
|
|
3041
3041
|
return `__delayV1__(${s.valueToCode(e, "MS", l.ATOMIC) || "0"});
|
|
3042
3042
|
`;
|
|
3043
3043
|
};
|
|
3044
|
-
const
|
|
3044
|
+
const qt = {
|
|
3045
3045
|
customContextMenu: function(e) {
|
|
3046
3046
|
if (this.isInFlyout) {
|
|
3047
3047
|
if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
|
|
3048
3048
|
const o = {
|
|
3049
3049
|
text: h.RENAME_VARIABLE,
|
|
3050
3050
|
enabled: !0,
|
|
3051
|
-
callback:
|
|
3051
|
+
callback: Zt(this)
|
|
3052
3052
|
}, t = this.getField("VAR").getText(), n = {
|
|
3053
3053
|
text: h.DELETE_VARIABLE.replace("%1", t),
|
|
3054
3054
|
enabled: !0,
|
|
3055
|
-
callback:
|
|
3055
|
+
callback: eo(this)
|
|
3056
3056
|
};
|
|
3057
3057
|
e.unshift(o), e.unshift(n);
|
|
3058
3058
|
}
|
|
@@ -3066,26 +3066,26 @@ const Gt = {
|
|
|
3066
3066
|
e.push({
|
|
3067
3067
|
enabled: this.workspace.remainingCapacity() > 0,
|
|
3068
3068
|
text: t.replace("%1", n.getText()),
|
|
3069
|
-
callback:
|
|
3069
|
+
callback: Be.callbackFactory(this, i)
|
|
3070
3070
|
});
|
|
3071
3071
|
}
|
|
3072
3072
|
}
|
|
3073
|
-
},
|
|
3073
|
+
}, Zt = function(e) {
|
|
3074
3074
|
return function() {
|
|
3075
3075
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3076
|
-
|
|
3076
|
+
z.renameVariable(o, n);
|
|
3077
3077
|
};
|
|
3078
|
-
},
|
|
3078
|
+
}, eo = function(e) {
|
|
3079
3079
|
return function() {
|
|
3080
3080
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3081
3081
|
o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
|
|
3082
3082
|
};
|
|
3083
3083
|
};
|
|
3084
|
-
|
|
3084
|
+
f.registerMixin(
|
|
3085
3085
|
"context_menu_variable_v1",
|
|
3086
|
-
|
|
3086
|
+
qt
|
|
3087
3087
|
);
|
|
3088
|
-
|
|
3088
|
+
_([
|
|
3089
3089
|
{
|
|
3090
3090
|
type: "variable_get_v1",
|
|
3091
3091
|
message0: "%1",
|
|
@@ -3105,10 +3105,10 @@ c([
|
|
|
3105
3105
|
s.forBlock.variable_get_v1 = function(e) {
|
|
3106
3106
|
return [s.nameDB_.getName(
|
|
3107
3107
|
e.getFieldValue("VAR"),
|
|
3108
|
-
|
|
3108
|
+
de.NameType.VARIABLE
|
|
3109
3109
|
), l.ATOMIC];
|
|
3110
3110
|
};
|
|
3111
|
-
|
|
3111
|
+
_([
|
|
3112
3112
|
{
|
|
3113
3113
|
type: "variable_set_v1",
|
|
3114
3114
|
message0: "%{BKY_VARIABLE_V1_SET_TITLE}",
|
|
@@ -3134,41 +3134,41 @@ c([
|
|
|
3134
3134
|
s.forBlock.variable_set_v1 = function(e) {
|
|
3135
3135
|
const o = s.nameDB_.getName(
|
|
3136
3136
|
e.getFieldValue("VAR"),
|
|
3137
|
-
|
|
3137
|
+
de.NameType.VARIABLE
|
|
3138
3138
|
), t = s.valueToCode(e, "VALUE", l.ASSIGNMENT) || "0";
|
|
3139
3139
|
return `${o} = ${t};
|
|
3140
3140
|
`;
|
|
3141
3141
|
};
|
|
3142
|
-
const
|
|
3143
|
-
function
|
|
3142
|
+
const ve = u.xml;
|
|
3143
|
+
function to() {
|
|
3144
3144
|
const e = [];
|
|
3145
3145
|
{
|
|
3146
|
-
const o =
|
|
3146
|
+
const o = ve.createElement("label");
|
|
3147
3147
|
o.setAttribute("text", h.LABEL_ASSET_LAYER), e.push(o);
|
|
3148
3148
|
}
|
|
3149
3149
|
{
|
|
3150
|
-
const o =
|
|
3150
|
+
const o = ve.createElement("block");
|
|
3151
3151
|
o.setAttribute("type", "upload_asset_v1"), e.push(o);
|
|
3152
3152
|
}
|
|
3153
3153
|
return e;
|
|
3154
3154
|
}
|
|
3155
|
-
const
|
|
3155
|
+
const oo = {
|
|
3156
3156
|
name: "INTERFACE_CATEGORY",
|
|
3157
|
-
callback:
|
|
3158
|
-
},
|
|
3159
|
-
function
|
|
3157
|
+
callback: to
|
|
3158
|
+
}, Y = u.xml;
|
|
3159
|
+
function no() {
|
|
3160
3160
|
const e = [];
|
|
3161
3161
|
{
|
|
3162
|
-
const o =
|
|
3162
|
+
const o = Y.createElement("label");
|
|
3163
3163
|
o.setAttribute("text", "%{BKY_LABEL_PROCEDURE}"), e.push(o);
|
|
3164
3164
|
}
|
|
3165
3165
|
{
|
|
3166
|
-
const o =
|
|
3166
|
+
const o = Y.createElement("block");
|
|
3167
3167
|
o.setAttribute("type", "procedure_def_v1");
|
|
3168
3168
|
{
|
|
3169
|
-
const t =
|
|
3169
|
+
const t = Y.createElement("field");
|
|
3170
3170
|
t.setAttribute("name", "NAME");
|
|
3171
|
-
const n =
|
|
3171
|
+
const n = Y.createTextNode(
|
|
3172
3172
|
h.PROCEDURE_DEFAULT_NAME
|
|
3173
3173
|
);
|
|
3174
3174
|
t.appendChild(n), o.appendChild(t);
|
|
@@ -3176,44 +3176,44 @@ function Jt() {
|
|
|
3176
3176
|
e.push(o);
|
|
3177
3177
|
}
|
|
3178
3178
|
{
|
|
3179
|
-
const o =
|
|
3179
|
+
const o = Y.createElement("block");
|
|
3180
3180
|
o.setAttribute("type", "procedure_return_v1"), e.push(o);
|
|
3181
3181
|
}
|
|
3182
3182
|
return e;
|
|
3183
3183
|
}
|
|
3184
|
-
const
|
|
3184
|
+
const C = {
|
|
3185
3185
|
name: "PROCEDURE_CATEGORY",
|
|
3186
|
-
callback:
|
|
3186
|
+
callback: no
|
|
3187
3187
|
};
|
|
3188
|
-
function
|
|
3189
|
-
const { args: e } =
|
|
3188
|
+
function io() {
|
|
3189
|
+
const { args: e } = gt.app.view, o = [];
|
|
3190
3190
|
return e == null || e.forEach(({ id: t, name: n, type: i }) => {
|
|
3191
3191
|
o.push({ id: t, name: n, type: i });
|
|
3192
3192
|
}), o;
|
|
3193
3193
|
}
|
|
3194
|
-
const
|
|
3195
|
-
function
|
|
3194
|
+
const be = u.xml;
|
|
3195
|
+
function so() {
|
|
3196
3196
|
const e = [];
|
|
3197
|
-
if (
|
|
3197
|
+
if (io().length > 0) {
|
|
3198
3198
|
{
|
|
3199
|
-
const o =
|
|
3199
|
+
const o = be.createElement("label");
|
|
3200
3200
|
o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
|
|
3201
3201
|
}
|
|
3202
3202
|
{
|
|
3203
|
-
const o =
|
|
3203
|
+
const o = be.createElement("block");
|
|
3204
3204
|
o.setAttribute("type", "get_arg_v1"), e.push(o);
|
|
3205
3205
|
}
|
|
3206
3206
|
}
|
|
3207
3207
|
return e;
|
|
3208
3208
|
}
|
|
3209
|
-
const
|
|
3209
|
+
const pe = {
|
|
3210
3210
|
name: "UI_CATEGORY",
|
|
3211
|
-
callback:
|
|
3212
|
-
},
|
|
3213
|
-
function
|
|
3211
|
+
callback: so
|
|
3212
|
+
}, j = u.xml;
|
|
3213
|
+
function lo(e) {
|
|
3214
3214
|
const o = [];
|
|
3215
3215
|
{
|
|
3216
|
-
const n =
|
|
3216
|
+
const n = j.createElement("label");
|
|
3217
3217
|
n.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), o.push(n);
|
|
3218
3218
|
}
|
|
3219
3219
|
{
|
|
@@ -3221,7 +3221,7 @@ function qt(e) {
|
|
|
3221
3221
|
n.setAttribute("text", "%{BKY_NEW_VARIABLE}"), n.setAttribute("callbackKey", "CREATE_VARIABLE"), e.registerButtonCallback(
|
|
3222
3222
|
"CREATE_VARIABLE",
|
|
3223
3223
|
function(i) {
|
|
3224
|
-
|
|
3224
|
+
z.createVariableButtonHandler(
|
|
3225
3225
|
i.getTargetWorkspace()
|
|
3226
3226
|
);
|
|
3227
3227
|
}
|
|
@@ -3230,41 +3230,41 @@ function qt(e) {
|
|
|
3230
3230
|
const t = e.getVariablesOfType("");
|
|
3231
3231
|
if (t.length <= 0)
|
|
3232
3232
|
return o;
|
|
3233
|
-
t.sort(
|
|
3233
|
+
t.sort(it.compareByName);
|
|
3234
3234
|
{
|
|
3235
|
-
const n =
|
|
3235
|
+
const n = j.createElement("label");
|
|
3236
3236
|
n.setAttribute("text", h.LABEL_CREATED), o.push(n);
|
|
3237
3237
|
}
|
|
3238
3238
|
return t.forEach((n) => {
|
|
3239
3239
|
{
|
|
3240
|
-
const i =
|
|
3241
|
-
i.setAttribute("type", "variable_get_v1"), i.appendChild(
|
|
3240
|
+
const i = j.createElement("block");
|
|
3241
|
+
i.setAttribute("type", "variable_get_v1"), i.appendChild(z.generateVariableFieldDom(n)), o.push(i);
|
|
3242
3242
|
}
|
|
3243
3243
|
{
|
|
3244
|
-
const i =
|
|
3245
|
-
i.setAttribute("type", "variable_set_v1"), i.appendChild(
|
|
3244
|
+
const i = j.createElement("block");
|
|
3245
|
+
i.setAttribute("type", "variable_set_v1"), i.appendChild(z.generateVariableFieldDom(n)), o.push(i);
|
|
3246
3246
|
}
|
|
3247
3247
|
}), o;
|
|
3248
3248
|
}
|
|
3249
|
-
const
|
|
3249
|
+
const A = {
|
|
3250
3250
|
name: "VARIABLE_CATEGORY",
|
|
3251
|
-
callback:
|
|
3251
|
+
callback: lo
|
|
3252
3252
|
};
|
|
3253
|
-
|
|
3254
|
-
const t = await
|
|
3253
|
+
Re.setConfirm(async (e, o) => {
|
|
3254
|
+
const t = await pt({
|
|
3255
3255
|
title: "",
|
|
3256
3256
|
text: e
|
|
3257
3257
|
});
|
|
3258
3258
|
o(!!t);
|
|
3259
3259
|
});
|
|
3260
|
-
|
|
3261
|
-
const n = await
|
|
3260
|
+
Re.setPrompt(async (e, o, t) => {
|
|
3261
|
+
const n = await Tt({
|
|
3262
3262
|
title: "",
|
|
3263
3263
|
value: o
|
|
3264
3264
|
});
|
|
3265
3265
|
t(String(n));
|
|
3266
3266
|
});
|
|
3267
|
-
const
|
|
3267
|
+
const ao = (e, o, t) => {
|
|
3268
3268
|
const n = e[o];
|
|
3269
3269
|
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, a) => {
|
|
3270
3270
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -3277,12 +3277,12 @@ const Zt = (e, o, t) => {
|
|
|
3277
3277
|
);
|
|
3278
3278
|
});
|
|
3279
3279
|
};
|
|
3280
|
-
async function
|
|
3281
|
-
const o = await
|
|
3282
|
-
|
|
3280
|
+
async function ke(e) {
|
|
3281
|
+
const o = await ao(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./zhHans-kgty7l19.js") }), `./msg/${e}.ts`, 3);
|
|
3282
|
+
st(o.default);
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3285
|
-
const o =
|
|
3284
|
+
function Ue(e) {
|
|
3285
|
+
const o = V();
|
|
3286
3286
|
if (!o)
|
|
3287
3287
|
return;
|
|
3288
3288
|
const t = o.getBlockById(e);
|
|
@@ -3294,25 +3294,25 @@ function ve(e) {
|
|
|
3294
3294
|
const i = n.getRelativeToSurfaceXY(), a = i.x * o.scale, r = i.y * o.scale;
|
|
3295
3295
|
o.scroll(-a, -r);
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3297
|
+
function ro() {
|
|
3298
3298
|
var t;
|
|
3299
|
-
const e =
|
|
3299
|
+
const e = V();
|
|
3300
3300
|
if (!e)
|
|
3301
3301
|
return;
|
|
3302
3302
|
const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
|
|
3303
|
-
o &&
|
|
3303
|
+
o && Ue(o.id);
|
|
3304
3304
|
}
|
|
3305
|
-
class
|
|
3305
|
+
class co {
|
|
3306
3306
|
init({ contextMenu: o = !0, shortcut: t = !0 } = {
|
|
3307
3307
|
contextMenu: !0,
|
|
3308
3308
|
shortcut: !0
|
|
3309
3309
|
}) {
|
|
3310
3310
|
o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (m.registry.unregister(
|
|
3311
|
-
|
|
3311
|
+
ie.names.COPY
|
|
3312
3312
|
), m.registry.unregister(
|
|
3313
|
-
|
|
3313
|
+
ie.names.CUT
|
|
3314
3314
|
), m.registry.unregister(
|
|
3315
|
-
|
|
3315
|
+
ie.names.PASTE
|
|
3316
3316
|
), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
|
|
3317
3317
|
}
|
|
3318
3318
|
blockCopyToStorageContextMenu() {
|
|
@@ -3321,8 +3321,8 @@ class to {
|
|
|
3321
3321
|
return h.CROSS_TAB_COPY ? h.CROSS_TAB_COPY : "Copy";
|
|
3322
3322
|
},
|
|
3323
3323
|
preconditionFn: function() {
|
|
3324
|
-
const t =
|
|
3325
|
-
return !t || !
|
|
3324
|
+
const t = S();
|
|
3325
|
+
return !t || !H(t) || !t.isDeletable() || !se(t) || !t.isMovable() || !x(t) ? "disabled" : "enabled";
|
|
3326
3326
|
},
|
|
3327
3327
|
callback: function(t) {
|
|
3328
3328
|
var n;
|
|
@@ -3331,11 +3331,11 @@ class to {
|
|
|
3331
3331
|
JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
|
|
3332
3332
|
);
|
|
3333
3333
|
},
|
|
3334
|
-
scopeType:
|
|
3334
|
+
scopeType: B.ScopeType.BLOCK,
|
|
3335
3335
|
id: "blockCopyToStorage",
|
|
3336
3336
|
weight: 0
|
|
3337
3337
|
};
|
|
3338
|
-
|
|
3338
|
+
B.registry.register(o);
|
|
3339
3339
|
}
|
|
3340
3340
|
blockPasteFromStorageContextMenu() {
|
|
3341
3341
|
const o = {
|
|
@@ -3355,13 +3355,13 @@ class to {
|
|
|
3355
3355
|
if (!n)
|
|
3356
3356
|
return;
|
|
3357
3357
|
const i = JSON.parse(n);
|
|
3358
|
-
i && t.workspace &&
|
|
3358
|
+
i && t.workspace && Ce.paste(i, t.workspace);
|
|
3359
3359
|
},
|
|
3360
|
-
scopeType:
|
|
3360
|
+
scopeType: B.ScopeType.WORKSPACE,
|
|
3361
3361
|
id: "blockPasteFromStorage",
|
|
3362
3362
|
weight: 0
|
|
3363
3363
|
};
|
|
3364
|
-
|
|
3364
|
+
B.registry.register(o);
|
|
3365
3365
|
}
|
|
3366
3366
|
blockCopyToStorageShortcut() {
|
|
3367
3367
|
const o = m.registry.createSerializedKey(
|
|
@@ -3376,17 +3376,17 @@ class to {
|
|
|
3376
3376
|
), i = {
|
|
3377
3377
|
name: "copy",
|
|
3378
3378
|
preconditionFn: function(a) {
|
|
3379
|
-
if (a.options.readOnly ||
|
|
3379
|
+
if (a.options.readOnly || le.inProgress())
|
|
3380
3380
|
return !1;
|
|
3381
|
-
const r =
|
|
3382
|
-
return !(!r || !
|
|
3381
|
+
const r = S();
|
|
3382
|
+
return !(!r || !H(r) || !r.isDeletable() || !se(r) || !r.isMovable() || !x(r));
|
|
3383
3383
|
},
|
|
3384
3384
|
callback: function(a, r) {
|
|
3385
3385
|
r.preventDefault();
|
|
3386
|
-
const
|
|
3387
|
-
if (!
|
|
3386
|
+
const c = S();
|
|
3387
|
+
if (!c || !x(c))
|
|
3388
3388
|
return !1;
|
|
3389
|
-
const p =
|
|
3389
|
+
const p = c.toCopyData();
|
|
3390
3390
|
return p ? (a.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(p)), !0) : !1;
|
|
3391
3391
|
},
|
|
3392
3392
|
keyCodes: [o, t, n]
|
|
@@ -3406,18 +3406,18 @@ class to {
|
|
|
3406
3406
|
), i = {
|
|
3407
3407
|
name: "cut",
|
|
3408
3408
|
preconditionFn: function(a) {
|
|
3409
|
-
if (a.options.readOnly ||
|
|
3409
|
+
if (a.options.readOnly || le.inProgress())
|
|
3410
3410
|
return !1;
|
|
3411
|
-
const r =
|
|
3412
|
-
return !(!r || !
|
|
3411
|
+
const r = S();
|
|
3412
|
+
return !(!r || !H(r) || !r.isDeletable() || !se(r) || !r.isMovable() || !x(r) || r.workspace.isFlyout);
|
|
3413
3413
|
},
|
|
3414
3414
|
callback: function(a, r) {
|
|
3415
3415
|
r.preventDefault();
|
|
3416
|
-
const
|
|
3417
|
-
if (!
|
|
3416
|
+
const c = S();
|
|
3417
|
+
if (!c || !H(c) || !c.isDeletable() || !x(c))
|
|
3418
3418
|
return !1;
|
|
3419
|
-
const p =
|
|
3420
|
-
return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)),
|
|
3419
|
+
const p = c.toCopyData();
|
|
3420
|
+
return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof lt ? c.checkAndDelete() : c.dispose(), !0) : !1;
|
|
3421
3421
|
},
|
|
3422
3422
|
keyCodes: [o, t, n]
|
|
3423
3423
|
};
|
|
@@ -3436,30 +3436,30 @@ class to {
|
|
|
3436
3436
|
), i = {
|
|
3437
3437
|
name: "paste",
|
|
3438
3438
|
preconditionFn: function(a) {
|
|
3439
|
-
if (a.options.readOnly ||
|
|
3439
|
+
if (a.options.readOnly || le.inProgress())
|
|
3440
3440
|
return !1;
|
|
3441
3441
|
const r = localStorage.getItem("blocklyStash");
|
|
3442
3442
|
if (!r)
|
|
3443
3443
|
return !1;
|
|
3444
|
-
const
|
|
3445
|
-
return !(!
|
|
3444
|
+
const c = JSON.parse(r);
|
|
3445
|
+
return !(!c || !a.isCapacityAvailable(c.typeCounts));
|
|
3446
3446
|
},
|
|
3447
3447
|
callback: function(a, r) {
|
|
3448
3448
|
r.preventDefault();
|
|
3449
|
-
const
|
|
3450
|
-
if (!
|
|
3449
|
+
const c = localStorage.getItem("blocklyStash");
|
|
3450
|
+
if (!c)
|
|
3451
3451
|
return !1;
|
|
3452
|
-
const p = JSON.parse(
|
|
3453
|
-
return p ? (
|
|
3452
|
+
const p = JSON.parse(c);
|
|
3453
|
+
return p ? (Ce.paste(p, a), !0) : !1;
|
|
3454
3454
|
},
|
|
3455
3455
|
keyCodes: [o, t, n]
|
|
3456
3456
|
};
|
|
3457
3457
|
m.registry.register(i);
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
|
-
class
|
|
3460
|
+
class _o {
|
|
3461
3461
|
init() {
|
|
3462
|
-
const o =
|
|
3462
|
+
const o = B.registry.getItem("cleanWorkspace");
|
|
3463
3463
|
o && (o.callback = function(t) {
|
|
3464
3464
|
const n = t.workspace;
|
|
3465
3465
|
if (!n)
|
|
@@ -3467,60 +3467,60 @@ class oo {
|
|
|
3467
3467
|
n.setResizesEnabled(!1), E.setGroup(!0);
|
|
3468
3468
|
const i = n.getTopBlocks(!0);
|
|
3469
3469
|
let a = 0;
|
|
3470
|
-
for (let r = 0,
|
|
3471
|
-
if (!
|
|
3470
|
+
for (let r = 0, c; c = i[r]; r++) {
|
|
3471
|
+
if (!c.isMovable())
|
|
3472
3472
|
continue;
|
|
3473
|
-
const p =
|
|
3474
|
-
|
|
3473
|
+
const p = c.getRelativeToSurfaceXY();
|
|
3474
|
+
c.moveBy(-p.x, a - p.y, ["cleanup"]), c.snapToGrid(), a = c.getRelativeToSurfaceXY().y + c.getHeightWidth().height + 100;
|
|
3475
3475
|
}
|
|
3476
3476
|
E.setGroup(!1), n.setResizesEnabled(!0);
|
|
3477
3477
|
});
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
|
-
function
|
|
3480
|
+
function Ve(e) {
|
|
3481
3481
|
const o = e.getParent();
|
|
3482
|
-
return o &&
|
|
3482
|
+
return o && Ve(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
|
|
3483
3483
|
}
|
|
3484
|
-
class
|
|
3484
|
+
class uo {
|
|
3485
3485
|
init() {
|
|
3486
|
-
const o =
|
|
3486
|
+
const o = B.registry.getItem("blockDisable");
|
|
3487
3487
|
o && (o.preconditionFn = function(t) {
|
|
3488
3488
|
const n = t.block;
|
|
3489
|
-
return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() ||
|
|
3489
|
+
return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Ve(n) ? "disabled" : "enabled" : "hidden";
|
|
3490
3490
|
});
|
|
3491
3491
|
}
|
|
3492
3492
|
}
|
|
3493
|
-
class
|
|
3493
|
+
class Pe extends ae {
|
|
3494
3494
|
constructor(t, n, i) {
|
|
3495
|
-
super(
|
|
3495
|
+
super(ae.SKIP_SETUP);
|
|
3496
3496
|
/** The field's colour picker element. */
|
|
3497
|
-
|
|
3497
|
+
L(this, "picker", null);
|
|
3498
3498
|
/** Index of the currently highlighted element. */
|
|
3499
|
-
|
|
3499
|
+
L(this, "highlightedIndex", null);
|
|
3500
3500
|
/**
|
|
3501
3501
|
* Array holding info needed to unbind events.
|
|
3502
3502
|
* Used for disposing.
|
|
3503
3503
|
* Ex: [[node, name, func], [node, name, func]].
|
|
3504
3504
|
*/
|
|
3505
|
-
|
|
3505
|
+
L(this, "boundEvents", []);
|
|
3506
3506
|
/**
|
|
3507
3507
|
* Serializable fields are saved by the serializer, non-serializable fields
|
|
3508
3508
|
* are not. Editable fields should also be serializable.
|
|
3509
3509
|
*/
|
|
3510
|
-
|
|
3510
|
+
L(this, "SERIALIZABLE", !0);
|
|
3511
3511
|
/** Mouse cursor style when over the hotspot that initiates the editor. */
|
|
3512
|
-
|
|
3512
|
+
L(this, "CURSOR", "default");
|
|
3513
3513
|
/**
|
|
3514
3514
|
* Used to tell if the field needs to be rendered the next time the block is
|
|
3515
3515
|
* rendered. Colour fields are statically sized, and only need to be
|
|
3516
3516
|
* rendered at initialization.
|
|
3517
3517
|
*/
|
|
3518
|
-
|
|
3518
|
+
L(this, "isDirty_", !1);
|
|
3519
3519
|
/**
|
|
3520
3520
|
* An array of colour strings for the palette.
|
|
3521
3521
|
* Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
|
|
3522
3522
|
*/
|
|
3523
|
-
|
|
3523
|
+
L(this, "colours", [
|
|
3524
3524
|
// red
|
|
3525
3525
|
"#F44336",
|
|
3526
3526
|
// base
|
|
@@ -4082,12 +4082,12 @@ class Ne extends ie {
|
|
|
4082
4082
|
* An array of tooltip strings for the palette. If not the same length as
|
|
4083
4083
|
* COLOURS, the colour's hex code will be used for any missing titles.
|
|
4084
4084
|
*/
|
|
4085
|
-
|
|
4085
|
+
L(this, "titles", ["%{BKY_COLOR_RED}"]);
|
|
4086
4086
|
/**
|
|
4087
4087
|
* Number of columns in the palette.
|
|
4088
4088
|
*/
|
|
4089
|
-
|
|
4090
|
-
t !==
|
|
4089
|
+
L(this, "columns", 14);
|
|
4090
|
+
t !== ae.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
|
|
4091
4091
|
}
|
|
4092
4092
|
configure_(t) {
|
|
4093
4093
|
super.configure_(t), t.colourOptions && (this.colours = t.colourOptions), t.colourTitles && (this.titles = t.colourTitles), t.columns && (this.columns = t.columns);
|
|
@@ -4101,13 +4101,13 @@ class Ne extends ie {
|
|
|
4101
4101
|
), this.createBorderRect_(), this.getBorderRect().style.fillOpacity = "1", this.getBorderRect().setAttribute("stroke", "#fff"), this.isFullBlockField() && (this.clickTarget_ = this.sourceBlock_.getSvgRoot());
|
|
4102
4102
|
}
|
|
4103
4103
|
isFullBlockField() {
|
|
4104
|
-
if (!this.getSourceBlock()) throw new
|
|
4104
|
+
if (!this.getSourceBlock()) throw new w();
|
|
4105
4105
|
const n = this.getConstants();
|
|
4106
4106
|
return this.blockIsSimpleReporter() && !!(n != null && n.FIELD_COLOUR_FULL_BLOCK);
|
|
4107
4107
|
}
|
|
4108
4108
|
blockIsSimpleReporter() {
|
|
4109
4109
|
const t = this.getSourceBlock();
|
|
4110
|
-
if (!t) throw new
|
|
4110
|
+
if (!t) throw new w();
|
|
4111
4111
|
if (!t.outputConnection) return !1;
|
|
4112
4112
|
for (const n of t.inputList)
|
|
4113
4113
|
if (n.connection || n.fieldRow.length > 1) return !1;
|
|
@@ -4115,7 +4115,7 @@ class Ne extends ie {
|
|
|
4115
4115
|
}
|
|
4116
4116
|
applyColour() {
|
|
4117
4117
|
const t = this.getSourceBlock();
|
|
4118
|
-
if (!t) throw new
|
|
4118
|
+
if (!t) throw new w();
|
|
4119
4119
|
if (!this.fieldGroup_) return;
|
|
4120
4120
|
const n = this.borderRect_;
|
|
4121
4121
|
if (!n)
|
|
@@ -4129,7 +4129,7 @@ class Ne extends ie {
|
|
|
4129
4129
|
render_() {
|
|
4130
4130
|
super.render_();
|
|
4131
4131
|
const t = this.getSourceBlock();
|
|
4132
|
-
if (!t) throw new
|
|
4132
|
+
if (!t) throw new w();
|
|
4133
4133
|
t.applyColour();
|
|
4134
4134
|
}
|
|
4135
4135
|
updateSize_(t) {
|
|
@@ -4154,14 +4154,14 @@ class Ne extends ie {
|
|
|
4154
4154
|
showEditor_() {
|
|
4155
4155
|
if (this.dropdownCreate(), !this.picker)
|
|
4156
4156
|
throw Error("Picker not found");
|
|
4157
|
-
|
|
4157
|
+
G.getContentDiv().appendChild(this.picker), G.showPositionedByField(
|
|
4158
4158
|
this,
|
|
4159
4159
|
this.dropdownDispose.bind(this)
|
|
4160
4160
|
), this.picker.focus({ preventScroll: !0 });
|
|
4161
4161
|
}
|
|
4162
4162
|
onClick(t) {
|
|
4163
4163
|
const n = t.target, i = n && n.getAttribute("data-colour");
|
|
4164
|
-
i !== null && (this.setValue(i),
|
|
4164
|
+
i !== null && (this.setValue(i), G.hideIfOwner(this));
|
|
4165
4165
|
}
|
|
4166
4166
|
onKeyDown(t) {
|
|
4167
4167
|
let n = !0, i;
|
|
@@ -4183,7 +4183,7 @@ class Ne extends ie {
|
|
|
4183
4183
|
const a = i.getAttribute("data-colour");
|
|
4184
4184
|
a !== null && this.setValue(a);
|
|
4185
4185
|
}
|
|
4186
|
-
|
|
4186
|
+
G.hideWithoutAnimation();
|
|
4187
4187
|
break;
|
|
4188
4188
|
default:
|
|
4189
4189
|
n = !1;
|
|
@@ -4194,10 +4194,10 @@ class Ne extends ie {
|
|
|
4194
4194
|
if (!this.highlightedIndex)
|
|
4195
4195
|
return;
|
|
4196
4196
|
const i = this.colours, a = this.columns;
|
|
4197
|
-
let r = this.highlightedIndex % a,
|
|
4198
|
-
r += t,
|
|
4199
|
-
const p = this.picker.childNodes[
|
|
4200
|
-
this.setHighlightedCell(p,
|
|
4197
|
+
let r = this.highlightedIndex % a, c = Math.floor(this.highlightedIndex / a);
|
|
4198
|
+
r += t, c += n, t < 0 ? r < 0 && c > 0 ? (r = a - 1, c--) : r < 0 && (r = 0) : t > 0 ? r > a - 1 && c < Math.floor(i.length / a) - 1 ? (r = 0, c++) : r > a - 1 && r-- : n < 0 ? c < 0 && (c = 0) : n > 0 && c > Math.floor(i.length / a) - 1 && (c = Math.floor(i.length / a) - 1);
|
|
4199
|
+
const p = this.picker.childNodes[c].childNodes[r], y = c * a + r;
|
|
4200
|
+
this.setHighlightedCell(p, y);
|
|
4201
4201
|
}
|
|
4202
4202
|
onMouseMove(t) {
|
|
4203
4203
|
const n = t.target, i = n && Number(n.getAttribute("data-index"));
|
|
@@ -4242,21 +4242,21 @@ class Ne extends ie {
|
|
|
4242
4242
|
t
|
|
4243
4243
|
);
|
|
4244
4244
|
let r = null;
|
|
4245
|
-
for (let
|
|
4246
|
-
|
|
4245
|
+
for (let c = 0; c < n.length; c++) {
|
|
4246
|
+
c % t === 0 && (r = document.createElement("tr"), u.aria.setRole(r, u.aria.Role.ROW), a.appendChild(r));
|
|
4247
4247
|
const p = document.createElement("td");
|
|
4248
|
-
r.appendChild(p), p.setAttribute("data-colour", n[
|
|
4248
|
+
r.appendChild(p), p.setAttribute("data-colour", n[c]), p.title = this.titles[c] || n[c], p.id = u.idGenerator.getNextUniqueId(), p.setAttribute("data-index", `${c}`), u.aria.setRole(p, u.aria.Role.GRIDCELL), u.aria.setState(
|
|
4249
4249
|
p,
|
|
4250
4250
|
u.aria.State.LABEL,
|
|
4251
|
-
n[
|
|
4251
|
+
n[c]
|
|
4252
4252
|
), u.aria.setState(
|
|
4253
4253
|
p,
|
|
4254
4254
|
u.aria.State.SELECTED,
|
|
4255
|
-
n[
|
|
4256
|
-
), p.style.backgroundColor = n[
|
|
4255
|
+
n[c] === i
|
|
4256
|
+
), p.style.backgroundColor = n[c], n[c] === i && (p.className = "blocklyColourSelected", this.highlightedIndex = c);
|
|
4257
4257
|
}
|
|
4258
4258
|
this.boundEvents.push(
|
|
4259
|
-
|
|
4259
|
+
R.conditionalBind(
|
|
4260
4260
|
a,
|
|
4261
4261
|
"pointerdown",
|
|
4262
4262
|
this,
|
|
@@ -4264,7 +4264,7 @@ class Ne extends ie {
|
|
|
4264
4264
|
!0
|
|
4265
4265
|
)
|
|
4266
4266
|
), this.boundEvents.push(
|
|
4267
|
-
|
|
4267
|
+
R.conditionalBind(
|
|
4268
4268
|
a,
|
|
4269
4269
|
"pointermove",
|
|
4270
4270
|
this,
|
|
@@ -4272,7 +4272,7 @@ class Ne extends ie {
|
|
|
4272
4272
|
!0
|
|
4273
4273
|
)
|
|
4274
4274
|
), this.boundEvents.push(
|
|
4275
|
-
|
|
4275
|
+
R.conditionalBind(
|
|
4276
4276
|
a,
|
|
4277
4277
|
"pointerenter",
|
|
4278
4278
|
this,
|
|
@@ -4280,7 +4280,7 @@ class Ne extends ie {
|
|
|
4280
4280
|
!0
|
|
4281
4281
|
)
|
|
4282
4282
|
), this.boundEvents.push(
|
|
4283
|
-
|
|
4283
|
+
R.conditionalBind(
|
|
4284
4284
|
a,
|
|
4285
4285
|
"pointerleave",
|
|
4286
4286
|
this,
|
|
@@ -4288,7 +4288,7 @@ class Ne extends ie {
|
|
|
4288
4288
|
!0
|
|
4289
4289
|
)
|
|
4290
4290
|
), this.boundEvents.push(
|
|
4291
|
-
|
|
4291
|
+
R.conditionalBind(
|
|
4292
4292
|
a,
|
|
4293
4293
|
"keydown",
|
|
4294
4294
|
this,
|
|
@@ -4300,15 +4300,15 @@ class Ne extends ie {
|
|
|
4300
4300
|
/** Disposes of events and DOM-references belonging to the colour editor. */
|
|
4301
4301
|
dropdownDispose() {
|
|
4302
4302
|
for (const t of this.boundEvents)
|
|
4303
|
-
|
|
4303
|
+
R.unbind(t);
|
|
4304
4304
|
this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
|
|
4305
4305
|
}
|
|
4306
4306
|
static fromJson(t) {
|
|
4307
4307
|
return new this(t.colour, void 0, t);
|
|
4308
4308
|
}
|
|
4309
4309
|
}
|
|
4310
|
-
|
|
4311
|
-
|
|
4310
|
+
Pe.prototype.DEFAULT_VALUE = "#ffffff";
|
|
4311
|
+
at.register(`
|
|
4312
4312
|
.blocklyColourTable {
|
|
4313
4313
|
border-collapse: collapse;
|
|
4314
4314
|
display: block;
|
|
@@ -4335,17 +4335,17 @@ Ze.register(`
|
|
|
4335
4335
|
position: relative;
|
|
4336
4336
|
}
|
|
4337
4337
|
`);
|
|
4338
|
-
function
|
|
4339
|
-
|
|
4338
|
+
function po() {
|
|
4339
|
+
rt.register("field_colour", Pe);
|
|
4340
4340
|
}
|
|
4341
|
-
const
|
|
4342
|
-
|
|
4343
|
-
const
|
|
4344
|
-
|
|
4345
|
-
const
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4341
|
+
const To = new co();
|
|
4342
|
+
To.init({ contextMenu: !0, shortcut: !0 });
|
|
4343
|
+
const fo = new _o();
|
|
4344
|
+
fo.init();
|
|
4345
|
+
const Eo = new uo();
|
|
4346
|
+
Eo.init();
|
|
4347
|
+
po();
|
|
4348
|
+
ee.Classic.blockStyles = {
|
|
4349
4349
|
color_blocks: {
|
|
4350
4350
|
colourPrimary: "#a5745b",
|
|
4351
4351
|
colourSecondary: "#ede3de",
|
|
@@ -4419,7 +4419,7 @@ q.Classic.blockStyles = {
|
|
|
4419
4419
|
hat: ""
|
|
4420
4420
|
}
|
|
4421
4421
|
};
|
|
4422
|
-
|
|
4422
|
+
ee.Classic.categoryStyles = {
|
|
4423
4423
|
calc_category: {
|
|
4424
4424
|
colour: "#757575"
|
|
4425
4425
|
},
|
|
@@ -4469,9 +4469,9 @@ q.Classic.categoryStyles = {
|
|
|
4469
4469
|
colour: "#a55b80"
|
|
4470
4470
|
}
|
|
4471
4471
|
};
|
|
4472
|
-
const
|
|
4472
|
+
const ho = Se.defineTheme("light", {
|
|
4473
4473
|
name: "light",
|
|
4474
|
-
base:
|
|
4474
|
+
base: ee.Classic,
|
|
4475
4475
|
componentStyles: {
|
|
4476
4476
|
workspaceBackgroundColour: "#ffffff",
|
|
4477
4477
|
toolboxBackgroundColour: "#eeeeee",
|
|
@@ -4485,9 +4485,9 @@ const ro = Ce.defineTheme("light", {
|
|
|
4485
4485
|
scrollbarOpacity: 0.4,
|
|
4486
4486
|
cursorColour: ""
|
|
4487
4487
|
}
|
|
4488
|
-
}),
|
|
4488
|
+
}), mo = Se.defineTheme("dark", {
|
|
4489
4489
|
name: "dark",
|
|
4490
|
-
base:
|
|
4490
|
+
base: ee.Classic,
|
|
4491
4491
|
componentStyles: {
|
|
4492
4492
|
workspaceBackgroundColour: "#1e1e1e",
|
|
4493
4493
|
toolboxBackgroundColour: "#272727",
|
|
@@ -4502,18 +4502,18 @@ const ro = Ce.defineTheme("light", {
|
|
|
4502
4502
|
cursorColour: ""
|
|
4503
4503
|
}
|
|
4504
4504
|
});
|
|
4505
|
-
function
|
|
4506
|
-
const o =
|
|
4505
|
+
function Oo(e) {
|
|
4506
|
+
const o = V();
|
|
4507
4507
|
switch (console.log(o), e) {
|
|
4508
4508
|
case "light":
|
|
4509
|
-
o.setTheme(
|
|
4509
|
+
o.setTheme(ho);
|
|
4510
4510
|
break;
|
|
4511
4511
|
case "dark":
|
|
4512
|
-
o.setTheme(
|
|
4512
|
+
o.setTheme(mo);
|
|
4513
4513
|
break;
|
|
4514
4514
|
}
|
|
4515
4515
|
}
|
|
4516
|
-
const
|
|
4516
|
+
const fe = {
|
|
4517
4517
|
kind: "category",
|
|
4518
4518
|
name: "%{BKY_CATEGORY_COLOR}",
|
|
4519
4519
|
categorystyle: "color_category",
|
|
@@ -4587,7 +4587,7 @@ const uo = {
|
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
4589
|
]
|
|
4590
|
-
},
|
|
4590
|
+
}, Ee = {
|
|
4591
4591
|
kind: "category",
|
|
4592
4592
|
name: "%{BKY_CATEGORY_LIST}",
|
|
4593
4593
|
categorystyle: "list_category",
|
|
@@ -4702,7 +4702,7 @@ const uo = {
|
|
|
4702
4702
|
type: "list_reverse_v1"
|
|
4703
4703
|
}
|
|
4704
4704
|
]
|
|
4705
|
-
},
|
|
4705
|
+
}, he = {
|
|
4706
4706
|
kind: "category",
|
|
4707
4707
|
name: "%{BKY_CATEGORY_LOGIC}",
|
|
4708
4708
|
categorystyle: "logic_category",
|
|
@@ -4744,7 +4744,7 @@ const uo = {
|
|
|
4744
4744
|
type: "logic_ternary_v1"
|
|
4745
4745
|
}
|
|
4746
4746
|
]
|
|
4747
|
-
},
|
|
4747
|
+
}, me = {
|
|
4748
4748
|
kind: "category",
|
|
4749
4749
|
name: "%{BKY_CATEGORY_LOOP}",
|
|
4750
4750
|
categorystyle: "loop_category",
|
|
@@ -4766,7 +4766,7 @@ const uo = {
|
|
|
4766
4766
|
type: "for_each_v1"
|
|
4767
4767
|
}
|
|
4768
4768
|
]
|
|
4769
|
-
},
|
|
4769
|
+
}, Oe = {
|
|
4770
4770
|
kind: "category",
|
|
4771
4771
|
name: "%{BKY_CATEGORY_MATH}",
|
|
4772
4772
|
categorystyle: "math_category",
|
|
@@ -4921,7 +4921,7 @@ const uo = {
|
|
|
4921
4921
|
type: "math_on_list_v1"
|
|
4922
4922
|
}
|
|
4923
4923
|
]
|
|
4924
|
-
},
|
|
4924
|
+
}, Ie = {
|
|
4925
4925
|
kind: "category",
|
|
4926
4926
|
name: "%{BKY_CATEGORY_OBJECT}",
|
|
4927
4927
|
categorystyle: "object_category",
|
|
@@ -4989,7 +4989,7 @@ const uo = {
|
|
|
4989
4989
|
}
|
|
4990
4990
|
}
|
|
4991
4991
|
]
|
|
4992
|
-
},
|
|
4992
|
+
}, ge = {
|
|
4993
4993
|
kind: "category",
|
|
4994
4994
|
name: "%{BKY_CATEGORY_TEXT}",
|
|
4995
4995
|
categorystyle: "text_category",
|
|
@@ -5152,7 +5152,7 @@ const uo = {
|
|
|
5152
5152
|
type: "text_reverse_v1"
|
|
5153
5153
|
}
|
|
5154
5154
|
]
|
|
5155
|
-
},
|
|
5155
|
+
}, Io = {
|
|
5156
5156
|
kind: "category",
|
|
5157
5157
|
name: "%{BKY_CATEGORY_TIME}",
|
|
5158
5158
|
categorystyle: "time_category",
|
|
@@ -5176,64 +5176,110 @@ const uo = {
|
|
|
5176
5176
|
}
|
|
5177
5177
|
}
|
|
5178
5178
|
]
|
|
5179
|
-
},
|
|
5179
|
+
}, go = {
|
|
5180
5180
|
kind: "categoryToolbox",
|
|
5181
5181
|
contents: [
|
|
5182
5182
|
{
|
|
5183
5183
|
kind: "category",
|
|
5184
5184
|
name: "%{BKY_CATEGORY_UI}",
|
|
5185
5185
|
categorystyle: "ui_category",
|
|
5186
|
-
custom:
|
|
5186
|
+
custom: pe.name
|
|
5187
5187
|
},
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5188
|
+
me,
|
|
5189
|
+
he,
|
|
5190
|
+
Oe,
|
|
5191
|
+
ge,
|
|
5192
|
+
Ee,
|
|
5193
|
+
Ie,
|
|
5194
|
+
fe,
|
|
5195
|
+
Io,
|
|
5196
5196
|
{
|
|
5197
5197
|
kind: "category",
|
|
5198
5198
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
5199
5199
|
categorystyle: "variable_category",
|
|
5200
|
-
custom:
|
|
5200
|
+
custom: A.name
|
|
5201
5201
|
},
|
|
5202
5202
|
{
|
|
5203
5203
|
kind: "category",
|
|
5204
5204
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
5205
5205
|
categorystyle: "procedure_category",
|
|
5206
|
-
custom:
|
|
5206
|
+
custom: C.name
|
|
5207
5207
|
},
|
|
5208
5208
|
{
|
|
5209
5209
|
kind: "category",
|
|
5210
5210
|
name: "%{BKY_CATEGORY_INTERFACE}",
|
|
5211
5211
|
categorystyle: "interface_category",
|
|
5212
|
-
custom:
|
|
5212
|
+
custom: oo.name
|
|
5213
|
+
}
|
|
5214
|
+
]
|
|
5215
|
+
}, Lo = {
|
|
5216
|
+
kind: "categoryToolbox",
|
|
5217
|
+
contents: [
|
|
5218
|
+
me,
|
|
5219
|
+
he,
|
|
5220
|
+
Oe,
|
|
5221
|
+
ge,
|
|
5222
|
+
Ee,
|
|
5223
|
+
Ie,
|
|
5224
|
+
fe,
|
|
5225
|
+
{
|
|
5226
|
+
kind: "category",
|
|
5227
|
+
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
5228
|
+
categorystyle: "variable_category",
|
|
5229
|
+
custom: A.name
|
|
5230
|
+
},
|
|
5231
|
+
{
|
|
5232
|
+
kind: "category",
|
|
5233
|
+
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
5234
|
+
categorystyle: "procedure_category",
|
|
5235
|
+
custom: C.name
|
|
5236
|
+
}
|
|
5237
|
+
]
|
|
5238
|
+
}, yo = {
|
|
5239
|
+
kind: "categoryToolbox",
|
|
5240
|
+
contents: [
|
|
5241
|
+
me,
|
|
5242
|
+
he,
|
|
5243
|
+
Oe,
|
|
5244
|
+
ge,
|
|
5245
|
+
Ee,
|
|
5246
|
+
Ie,
|
|
5247
|
+
fe,
|
|
5248
|
+
{
|
|
5249
|
+
kind: "category",
|
|
5250
|
+
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
5251
|
+
categorystyle: "variable_category",
|
|
5252
|
+
custom: A.name
|
|
5253
|
+
},
|
|
5254
|
+
{
|
|
5255
|
+
kind: "category",
|
|
5256
|
+
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
5257
|
+
categorystyle: "procedure_category",
|
|
5258
|
+
custom: C.name
|
|
5213
5259
|
}
|
|
5214
5260
|
]
|
|
5215
|
-
},
|
|
5261
|
+
}, Co = /* @__PURE__ */ q({
|
|
5216
5262
|
__name: "cleanup",
|
|
5217
5263
|
setup(e) {
|
|
5218
5264
|
const o = () => {
|
|
5219
|
-
const t =
|
|
5265
|
+
const t = V();
|
|
5220
5266
|
if (!t)
|
|
5221
5267
|
return;
|
|
5222
|
-
const n =
|
|
5268
|
+
const n = B.registry.getItem("cleanWorkspace");
|
|
5223
5269
|
n && n.callback({ workspace: t }, new PointerEvent("dummy"));
|
|
5224
5270
|
};
|
|
5225
5271
|
return (t, n) => {
|
|
5226
|
-
const i =
|
|
5227
|
-
return
|
|
5272
|
+
const i = v("v-btn");
|
|
5273
|
+
return I(), U(i, {
|
|
5228
5274
|
class: "mr-3",
|
|
5229
5275
|
variant: "outlined",
|
|
5230
5276
|
density: "comfortable",
|
|
5231
|
-
icon:
|
|
5277
|
+
icon: F(Et),
|
|
5232
5278
|
onClick: o
|
|
5233
5279
|
}, null, 8, ["icon"]);
|
|
5234
5280
|
};
|
|
5235
5281
|
}
|
|
5236
|
-
}),
|
|
5282
|
+
}), Ao = /* @__PURE__ */ q({
|
|
5237
5283
|
__name: "lock",
|
|
5238
5284
|
props: {
|
|
5239
5285
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -5241,93 +5287,93 @@ const uo = {
|
|
|
5241
5287
|
},
|
|
5242
5288
|
emits: ["update:modelValue"],
|
|
5243
5289
|
setup(e) {
|
|
5244
|
-
const o =
|
|
5290
|
+
const o = re(e, "modelValue");
|
|
5245
5291
|
return (t, n) => {
|
|
5246
|
-
const i =
|
|
5247
|
-
return
|
|
5292
|
+
const i = v("v-btn");
|
|
5293
|
+
return I(), U(i, {
|
|
5248
5294
|
class: "mr-3",
|
|
5249
5295
|
variant: "outlined",
|
|
5250
5296
|
density: "comfortable",
|
|
5251
|
-
icon: o.value ?
|
|
5297
|
+
icon: o.value ? F(mt) : F(Ot),
|
|
5252
5298
|
onClick: n[0] || (n[0] = (a) => o.value = !o.value)
|
|
5253
5299
|
}, null, 8, ["icon"]);
|
|
5254
5300
|
};
|
|
5255
5301
|
}
|
|
5256
|
-
}),
|
|
5302
|
+
}), vo = {
|
|
5257
5303
|
key: 1,
|
|
5258
5304
|
class: "text-caption text-grey"
|
|
5259
|
-
},
|
|
5305
|
+
}, bo = /* @__PURE__ */ q({
|
|
5260
5306
|
__name: "navigator",
|
|
5261
5307
|
setup(e) {
|
|
5262
|
-
const o =
|
|
5308
|
+
const o = X(() => ({
|
|
5263
5309
|
maxHeight: "calc(100vh - 200px)"
|
|
5264
|
-
})), t =
|
|
5265
|
-
var
|
|
5266
|
-
const a =
|
|
5310
|
+
})), t = W([]), n = () => {
|
|
5311
|
+
var y;
|
|
5312
|
+
const a = V();
|
|
5267
5313
|
if (!a) {
|
|
5268
5314
|
t.value = [];
|
|
5269
5315
|
return;
|
|
5270
5316
|
}
|
|
5271
|
-
const r = [],
|
|
5272
|
-
|
|
5273
|
-
const
|
|
5274
|
-
if (
|
|
5317
|
+
const r = [], c = a.getTopBlocks(!0), p = ((y = S()) == null ? void 0 : y.id) ?? "";
|
|
5318
|
+
c.forEach((k) => {
|
|
5319
|
+
const g = k;
|
|
5320
|
+
if (g.type.startsWith("on_node_event_v"))
|
|
5275
5321
|
console.log("1");
|
|
5276
|
-
else if (
|
|
5322
|
+
else if (g.type.startsWith("procedure_def_v"))
|
|
5277
5323
|
console.log("2");
|
|
5278
5324
|
else {
|
|
5279
|
-
const
|
|
5325
|
+
const T = g.getRelativeToSurfaceXY();
|
|
5280
5326
|
r.push({
|
|
5281
|
-
id:
|
|
5327
|
+
id: g.id,
|
|
5282
5328
|
name: h.fffff,
|
|
5283
|
-
x:
|
|
5284
|
-
y:
|
|
5285
|
-
active:
|
|
5329
|
+
x: T.x,
|
|
5330
|
+
y: T.y,
|
|
5331
|
+
active: g.id === p
|
|
5286
5332
|
});
|
|
5287
5333
|
}
|
|
5288
5334
|
}), t.value = r;
|
|
5289
5335
|
}, i = (a) => {
|
|
5290
|
-
const r =
|
|
5336
|
+
const r = V();
|
|
5291
5337
|
if (!r)
|
|
5292
5338
|
return;
|
|
5293
|
-
const
|
|
5294
|
-
|
|
5339
|
+
const c = r.getBlockById(a.id);
|
|
5340
|
+
c && (Ue(a.id), c.select());
|
|
5295
5341
|
};
|
|
5296
|
-
return
|
|
5297
|
-
|
|
5298
|
-
}),
|
|
5299
|
-
|
|
5342
|
+
return Ne(() => {
|
|
5343
|
+
ue.on("codeUpdate", n);
|
|
5344
|
+
}), Xe(() => {
|
|
5345
|
+
ue.off("codeUpdate", n);
|
|
5300
5346
|
}), (a, r) => {
|
|
5301
|
-
const
|
|
5302
|
-
return
|
|
5347
|
+
const c = v("v-btn"), p = v("v-list-item-title"), y = v("v-list-item"), k = v("v-list"), g = v("v-menu");
|
|
5348
|
+
return I(), U(g, {
|
|
5303
5349
|
"close-on-content-click": !1,
|
|
5304
5350
|
transition: "slide-y-transition",
|
|
5305
5351
|
"offset-y": ""
|
|
5306
5352
|
}, {
|
|
5307
|
-
activator:
|
|
5308
|
-
|
|
5353
|
+
activator: P(({ props: T }) => [
|
|
5354
|
+
M(c, We(T, {
|
|
5309
5355
|
variant: "outlined",
|
|
5310
5356
|
density: "comfortable",
|
|
5311
|
-
icon:
|
|
5357
|
+
icon: F(It)
|
|
5312
5358
|
}), null, 16, ["icon"])
|
|
5313
5359
|
]),
|
|
5314
|
-
default:
|
|
5315
|
-
|
|
5360
|
+
default: P(() => [
|
|
5361
|
+
ce("div", {
|
|
5316
5362
|
class: "overflow-auto",
|
|
5317
|
-
style:
|
|
5363
|
+
style: J(o.value)
|
|
5318
5364
|
}, [
|
|
5319
|
-
t.value.length > 0 ? (
|
|
5320
|
-
default:
|
|
5321
|
-
(
|
|
5322
|
-
key:
|
|
5365
|
+
t.value.length > 0 ? (I(), U(k, { key: 0 }, {
|
|
5366
|
+
default: P(() => [
|
|
5367
|
+
(I(!0), K(Je, null, ze(t.value, (T) => (I(), U(y, {
|
|
5368
|
+
key: T.id,
|
|
5323
5369
|
class: "d-flex justify-start",
|
|
5324
|
-
active:
|
|
5370
|
+
active: T.active,
|
|
5325
5371
|
onClick: i
|
|
5326
5372
|
}, {
|
|
5327
|
-
default:
|
|
5328
|
-
|
|
5329
|
-
default:
|
|
5330
|
-
|
|
5373
|
+
default: P(() => [
|
|
5374
|
+
M(p, null, {
|
|
5375
|
+
default: P(() => [
|
|
5376
|
+
Qe(qe(T.name), 1)
|
|
5331
5377
|
]),
|
|
5332
5378
|
_: 2
|
|
5333
5379
|
}, 1024)
|
|
@@ -5336,27 +5382,28 @@ const uo = {
|
|
|
5336
5382
|
}, 1032, ["active"]))), 128))
|
|
5337
5383
|
]),
|
|
5338
5384
|
_: 1
|
|
5339
|
-
})) : (
|
|
5385
|
+
})) : (I(), K("span", vo, "xxxxxxxxxx"))
|
|
5340
5386
|
], 4)
|
|
5341
5387
|
]),
|
|
5342
5388
|
_: 1
|
|
5343
5389
|
});
|
|
5344
5390
|
};
|
|
5345
5391
|
}
|
|
5346
|
-
}),
|
|
5392
|
+
}), ko = { class: "position-relative w-100 h-100" }, No = /* @__PURE__ */ q({
|
|
5347
5393
|
__name: "index",
|
|
5348
|
-
props: /* @__PURE__ */
|
|
5394
|
+
props: /* @__PURE__ */ ye({
|
|
5349
5395
|
type: {},
|
|
5350
5396
|
version: {},
|
|
5351
|
-
active: { type: Boolean }
|
|
5352
|
-
scale: {}
|
|
5397
|
+
active: { type: Boolean }
|
|
5353
5398
|
}, {
|
|
5354
5399
|
lock: { type: Boolean, required: !0 },
|
|
5355
|
-
lockModifiers: {}
|
|
5400
|
+
lockModifiers: {},
|
|
5401
|
+
scale: { required: !0 },
|
|
5402
|
+
scaleModifiers: {}
|
|
5356
5403
|
}),
|
|
5357
|
-
emits: /* @__PURE__ */
|
|
5404
|
+
emits: /* @__PURE__ */ ye(["ready", "change"], ["update:lock", "update:scale"]),
|
|
5358
5405
|
setup(e, { emit: o }) {
|
|
5359
|
-
const t =
|
|
5406
|
+
const t = dt(), { locale: n, dark: i } = ut(t), { open: a } = ft("blocklyEditorFlyout"), r = re(e, "lock"), c = re(e, "scale"), p = e, y = o, k = W(), g = {
|
|
5360
5407
|
grid: {
|
|
5361
5408
|
length: 2,
|
|
5362
5409
|
snap: !0,
|
|
@@ -5379,8 +5426,8 @@ const uo = {
|
|
|
5379
5426
|
wheel: !0
|
|
5380
5427
|
}
|
|
5381
5428
|
};
|
|
5382
|
-
let
|
|
5383
|
-
const
|
|
5429
|
+
let T;
|
|
5430
|
+
const te = W(!1), oe = W(!1), De = X(() => ({
|
|
5384
5431
|
position: "absolute",
|
|
5385
5432
|
background: i.value ? "#0000007f" : "#ffffff7f",
|
|
5386
5433
|
top: "1px",
|
|
@@ -5389,7 +5436,7 @@ const uo = {
|
|
|
5389
5436
|
height: "calc(100% - 1px)",
|
|
5390
5437
|
pointerEvents: "none",
|
|
5391
5438
|
zIndex: 999
|
|
5392
|
-
})),
|
|
5439
|
+
})), xe = X(() => ({
|
|
5393
5440
|
position: "absolute",
|
|
5394
5441
|
background: i.value ? "#0000007f" : "#ffffff7f",
|
|
5395
5442
|
top: "0px",
|
|
@@ -5397,109 +5444,112 @@ const uo = {
|
|
|
5397
5444
|
width: "100%",
|
|
5398
5445
|
height: "100%",
|
|
5399
5446
|
pointerEvents: "none"
|
|
5400
|
-
})),
|
|
5447
|
+
})), Ye = X(() => ({
|
|
5401
5448
|
position: "absolute",
|
|
5402
5449
|
top: "0px",
|
|
5403
5450
|
right: "0px",
|
|
5404
5451
|
zIndex: 20
|
|
5405
5452
|
}));
|
|
5406
|
-
|
|
5407
|
-
if (!
|
|
5453
|
+
Ne(async () => {
|
|
5454
|
+
if (!k.value)
|
|
5408
5455
|
return;
|
|
5409
|
-
await
|
|
5410
|
-
let
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5456
|
+
await ke(n.value);
|
|
5457
|
+
let d;
|
|
5458
|
+
p.type === "app" ? p.version === "v1" && (d = go) : p.type === "func" ? p.version === "v1" && (d = yo) : p.type === "flow" && p.version === "v1" && (d = Lo), g.toolbox = d, T = ct(k.value, g), p.type === "app" ? p.version === "v1" && (T.registerToolboxCategoryCallback(
|
|
5459
|
+
pe.name,
|
|
5460
|
+
pe.callback
|
|
5461
|
+
), T.registerToolboxCategoryCallback(
|
|
5462
|
+
C.name,
|
|
5463
|
+
C.callback
|
|
5464
|
+
), T.registerToolboxCategoryCallback(
|
|
5465
|
+
A.name,
|
|
5466
|
+
A.callback
|
|
5467
|
+
)) : p.type === "func" ? p.version === "v1" && (T.registerToolboxCategoryCallback(
|
|
5468
|
+
C.name,
|
|
5469
|
+
C.callback
|
|
5470
|
+
), T.registerToolboxCategoryCallback(
|
|
5471
|
+
A.name,
|
|
5472
|
+
A.callback
|
|
5473
|
+
)) : p.type === "flow" && p.version === "v1" && (T.registerToolboxCategoryCallback(
|
|
5474
|
+
C.name,
|
|
5475
|
+
C.callback
|
|
5476
|
+
), T.registerToolboxCategoryCallback(
|
|
5477
|
+
A.name,
|
|
5478
|
+
A.callback
|
|
5479
|
+
)), T.addChangeListener(E.disableOrphans), T.addChangeListener(Ke), y("ready", T);
|
|
5480
|
+
}), Ze(() => {
|
|
5428
5481
|
a.value = !1;
|
|
5429
5482
|
});
|
|
5430
|
-
function
|
|
5431
|
-
|
|
5483
|
+
function Le() {
|
|
5484
|
+
T && _t(T);
|
|
5432
5485
|
}
|
|
5433
|
-
function
|
|
5434
|
-
if (
|
|
5435
|
-
|
|
5486
|
+
function Ke(d) {
|
|
5487
|
+
if (d.type === E.FINISHED_LOADING) {
|
|
5488
|
+
ro(), ue.emit("codeUpdate"), te.value = !1;
|
|
5436
5489
|
return;
|
|
5437
5490
|
}
|
|
5438
|
-
|
|
5491
|
+
te.value || (d.type === E.BLOCK_DRAG && (d.isStart ? oe.value = !0 : oe.value = !1), y("change", d));
|
|
5439
5492
|
}
|
|
5440
|
-
return
|
|
5441
|
-
|
|
5442
|
-
}),
|
|
5443
|
-
|
|
5444
|
-
}),
|
|
5445
|
-
var
|
|
5446
|
-
|
|
5447
|
-
}),
|
|
5448
|
-
() =>
|
|
5449
|
-
(
|
|
5450
|
-
|
|
5451
|
-
}
|
|
5452
|
-
), V(
|
|
5453
|
-
() => r.scale,
|
|
5454
|
-
(T) => {
|
|
5455
|
-
f.setScale(T);
|
|
5493
|
+
return D(n, (d) => {
|
|
5494
|
+
ke(d);
|
|
5495
|
+
}), D(i, (d) => {
|
|
5496
|
+
Oo(d ? "dark" : "light");
|
|
5497
|
+
}), D(a, (d) => {
|
|
5498
|
+
var b;
|
|
5499
|
+
d || (b = T.getToolbox()) == null || b.clearSelection();
|
|
5500
|
+
}), D(
|
|
5501
|
+
() => p.active,
|
|
5502
|
+
(d) => {
|
|
5503
|
+
d && setTimeout(() => Le(), 1);
|
|
5456
5504
|
}
|
|
5457
|
-
), (
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5505
|
+
), D(c, (d) => {
|
|
5506
|
+
T.setScale(d);
|
|
5507
|
+
}), (d, b) => {
|
|
5508
|
+
const Fe = v("v-icon"), He = v("x-loading"), we = et("resize");
|
|
5509
|
+
return I(), K("div", ko, [
|
|
5510
|
+
tt(ce("div", {
|
|
5461
5511
|
id: "blocklyEditor",
|
|
5462
5512
|
ref_key: "blocklyDiv",
|
|
5463
|
-
ref:
|
|
5513
|
+
ref: k,
|
|
5464
5514
|
class: "w-100 h-100"
|
|
5465
5515
|
}, null, 512), [
|
|
5466
|
-
[
|
|
5516
|
+
[we, Le]
|
|
5467
5517
|
]),
|
|
5468
|
-
|
|
5518
|
+
oe.value ? (I(), K("div", {
|
|
5469
5519
|
key: 0,
|
|
5470
5520
|
class: "d-flex flex-column align-center justify-center",
|
|
5471
|
-
style:
|
|
5521
|
+
style: J(De.value)
|
|
5472
5522
|
}, [
|
|
5473
|
-
|
|
5474
|
-
icon:
|
|
5523
|
+
M(Fe, {
|
|
5524
|
+
icon: F(ht),
|
|
5475
5525
|
size: "x-large"
|
|
5476
5526
|
}, null, 8, ["icon"])
|
|
5477
|
-
], 4)) :
|
|
5478
|
-
|
|
5527
|
+
], 4)) : ne("", !0),
|
|
5528
|
+
r.value ? (I(), K("div", {
|
|
5479
5529
|
key: 1,
|
|
5480
|
-
style:
|
|
5481
|
-
}, null, 4)) :
|
|
5482
|
-
|
|
5530
|
+
style: J(xe.value)
|
|
5531
|
+
}, null, 4)) : ne("", !0),
|
|
5532
|
+
ce("div", {
|
|
5483
5533
|
class: "d-flex align-end pt-3 pr-3",
|
|
5484
|
-
style:
|
|
5534
|
+
style: J(Ye.value)
|
|
5485
5535
|
}, [
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
modelValue:
|
|
5489
|
-
"onUpdate:modelValue":
|
|
5536
|
+
M(Co),
|
|
5537
|
+
M(Ao, {
|
|
5538
|
+
modelValue: r.value,
|
|
5539
|
+
"onUpdate:modelValue": b[0] || (b[0] = (Ge) => r.value = Ge)
|
|
5490
5540
|
}, null, 8, ["modelValue"]),
|
|
5491
|
-
|
|
5541
|
+
M(bo)
|
|
5492
5542
|
], 4),
|
|
5493
|
-
|
|
5543
|
+
te.value ? (I(), U(He, {
|
|
5494
5544
|
key: 2,
|
|
5495
5545
|
"z-index": 99
|
|
5496
|
-
})) :
|
|
5546
|
+
})) : ne("", !0)
|
|
5497
5547
|
]);
|
|
5498
5548
|
};
|
|
5499
5549
|
}
|
|
5500
|
-
}),
|
|
5501
|
-
e.component("XBlockly",
|
|
5502
|
-
},
|
|
5550
|
+
}), Bo = (e) => {
|
|
5551
|
+
e.component("XBlockly", No);
|
|
5552
|
+
}, Po = { install: Bo };
|
|
5503
5553
|
export {
|
|
5504
|
-
|
|
5554
|
+
Po as default
|
|
5505
5555
|
};
|