x-block-lib 0.4.4 → 0.4.5
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 +2 -2
- package/dist/index.js +373 -372
- 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 z, resolveComponent as C, openBlock as
|
|
6
|
-
import { d as
|
|
7
|
-
import { storeToRefs as
|
|
8
|
-
import { openConfirmDlg as
|
|
9
|
-
var
|
|
10
|
-
|
|
2
|
+
var xe = Object.defineProperty;
|
|
3
|
+
var Ye = (e, o, t) => o in e ? xe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
4
|
+
var L = (e, o, t) => Ye(e, typeof o != "symbol" ? o + "" : o, t);
|
|
5
|
+
import { defineComponent as z, resolveComponent as C, openBlock as I, createBlock as S, unref as Y, useModel as le, computed as $, ref as j, onMounted as Le, onUnmounted as Ke, withCtx as U, createVNode as R, mergeProps as Fe, createElementVNode as ae, normalizeStyle as X, createElementBlock as x, Fragment as He, renderList as we, createTextVNode as Ge, toDisplayString as $e, mergeModels as Ee, onBeforeUnmount as je, watch as V, resolveDirective as Xe, withDirectives as We, createCommentVNode as te } from "vue";
|
|
6
|
+
import { d as _, j as s, O as l, u, X as Je, B as O, E, M as h, i as Q, a as b, b as d, C as ye, F as Te, c as ze, P as re, N as de, V as W, e as Qe, f as Ce, s as qe, g as M, S as m, h as oe, k as B, l as K, m as ne, n as P, o as N, p as he, G as ie, q as Ze, r as et, t as se, U as F, D as H, v as k, w as tt, T as q, x as Ae, y as ot, z as nt } from "./blockly-jgwpd4oo.js";
|
|
7
|
+
import { storeToRefs as it } from "pinia";
|
|
8
|
+
import { openConfirmDlg as st, openPromptDlg as lt, eventBus as ce, useGlobalStore as at, useViewStack as rt } from "x-essential-lib";
|
|
9
|
+
var ct = "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", _t = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", ut = "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", pt = "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", Tt = "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 dt = function() {
|
|
153
153
|
if (!window.blocklyState) {
|
|
154
154
|
const e = {
|
|
155
155
|
runtime: {
|
|
@@ -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 ve(e, o, t) {
|
|
198
|
+
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = Je.domToWorkspace(i, e);
|
|
199
199
|
return e.getBlockById(a[0]);
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const ft = u.xml, Et = [
|
|
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 ht(e, o) {
|
|
232
232
|
var n, i;
|
|
233
|
-
const t =
|
|
233
|
+
const t = Et.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 mt = {
|
|
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 = ft.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 && ht(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 = ve(this.workspace, this.key, this.name);
|
|
276
276
|
n.connect(i.outputConnection);
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
@@ -283,23 +283,23 @@ 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 = mt;
|
|
287
287
|
s.forBlock.parameter_v1 = function(e) {
|
|
288
288
|
return [e.key, l.ATOMIC];
|
|
289
289
|
};
|
|
290
|
-
const
|
|
290
|
+
const Ot = u.xml, It = {
|
|
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 = It;
|
|
296
|
+
const gt = {
|
|
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 = gt;
|
|
302
|
+
const Lt = {
|
|
303
303
|
init: function() {
|
|
304
304
|
this.itemCount_ = 0, this.setMutator(
|
|
305
305
|
new Q.MutatorIcon(
|
|
@@ -309,7 +309,7 @@ const gt = {
|
|
|
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 = Ot.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(b.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 = Lt;
|
|
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 yt = {
|
|
603
603
|
// logic_compare
|
|
604
604
|
EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
|
|
605
605
|
NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
|
|
@@ -613,9 +613,9 @@ const Lt = {
|
|
|
613
613
|
};
|
|
614
614
|
d.register(
|
|
615
615
|
"logic_op_tooltip_v1",
|
|
616
|
-
d.buildTooltipForDropdown("OP",
|
|
616
|
+
d.buildTooltipForDropdown("OP", yt)
|
|
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 Ct = {
|
|
642
642
|
onchange: function(e) {
|
|
643
643
|
this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
|
|
644
644
|
const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
|
|
@@ -658,10 +658,10 @@ const yt = {
|
|
|
658
658
|
d.register(
|
|
659
659
|
"logic_compare_v1",
|
|
660
660
|
function() {
|
|
661
|
-
this.mixin(
|
|
661
|
+
this.mixin(Ct);
|
|
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 At = {
|
|
712
712
|
elseIfCount_: 0,
|
|
713
713
|
hasElse_: !1,
|
|
714
714
|
mutationToDom: function() {
|
|
@@ -836,11 +836,11 @@ const Ct = {
|
|
|
836
836
|
};
|
|
837
837
|
d.registerMutator(
|
|
838
838
|
"logic_if_v1_mutator",
|
|
839
|
-
|
|
839
|
+
At,
|
|
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 vt = {
|
|
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
|
-
d.registerMixin("logic_ternary_v1",
|
|
1001
|
-
|
|
1000
|
+
d.registerMixin("logic_ternary_v1", vt);
|
|
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 bt = {
|
|
1038
1038
|
customContextMenu: function(e) {
|
|
1039
1039
|
if (this.isInFlyout)
|
|
1040
1040
|
return;
|
|
@@ -1049,14 +1049,14 @@ 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: ye.callbackFactory(this, i)
|
|
1053
1053
|
});
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
};
|
|
1057
1057
|
d.registerMixin(
|
|
1058
1058
|
"contextMenu_newGetVariableBlock_v1",
|
|
1059
|
-
|
|
1059
|
+
bt
|
|
1060
1060
|
);
|
|
1061
1061
|
d.register(
|
|
1062
1062
|
"flow_control_tooltip_v1",
|
|
@@ -1065,16 +1065,16 @@ d.register(
|
|
|
1065
1065
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
1066
1066
|
})
|
|
1067
1067
|
);
|
|
1068
|
-
const
|
|
1068
|
+
const Nt = /* @__PURE__ */ new Set([
|
|
1069
1069
|
"repeat_v1",
|
|
1070
1070
|
"for_each_v1",
|
|
1071
1071
|
"for_v1",
|
|
1072
1072
|
"while_until_v1"
|
|
1073
|
-
]),
|
|
1073
|
+
]), kt = {
|
|
1074
1074
|
getSurroundLoop: function() {
|
|
1075
1075
|
let e = this;
|
|
1076
1076
|
do {
|
|
1077
|
-
if (
|
|
1077
|
+
if (Nt.has(e.type))
|
|
1078
1078
|
return !0;
|
|
1079
1079
|
e = e == null ? void 0 : e.getSurroundParent();
|
|
1080
1080
|
} while (e);
|
|
@@ -1097,9 +1097,9 @@ const bt = /* @__PURE__ */ new Set([
|
|
|
1097
1097
|
};
|
|
1098
1098
|
d.registerMixin(
|
|
1099
1099
|
"flow_control_in_loop_check_v1",
|
|
1100
|
-
|
|
1100
|
+
kt
|
|
1101
1101
|
);
|
|
1102
|
-
|
|
1102
|
+
_([
|
|
1103
1103
|
{
|
|
1104
1104
|
type: "flow_control_v1",
|
|
1105
1105
|
message0: "%1",
|
|
@@ -1127,7 +1127,7 @@ d.register(
|
|
|
1127
1127
|
"VAR"
|
|
1128
1128
|
)
|
|
1129
1129
|
);
|
|
1130
|
-
|
|
1130
|
+
_([
|
|
1131
1131
|
{
|
|
1132
1132
|
type: "for_v1",
|
|
1133
1133
|
message0: "%{BKY_LOOP_V1_FOR_TITLE}",
|
|
@@ -1178,7 +1178,7 @@ d.register(
|
|
|
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}",
|
|
@@ -1215,7 +1215,7 @@ d.register(
|
|
|
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 Bt = {
|
|
1266
1266
|
// math_arithmetic
|
|
1267
1267
|
ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
|
|
1268
1268
|
SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
|
|
@@ -1296,9 +1296,9 @@ const kt = {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
d.register(
|
|
1298
1298
|
"math_op_tooltip_v1",
|
|
1299
|
-
d.buildTooltipForDropdown("OP",
|
|
1299
|
+
d.buildTooltipForDropdown("OP", Bt)
|
|
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,21 +1899,21 @@ s.forBlock.math_trig_v1 = function(e) {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
return [n, l.DIVISION];
|
|
1901
1901
|
};
|
|
1902
|
-
const
|
|
1902
|
+
const Rt = u.xml, St = {
|
|
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 = St;
|
|
1910
|
+
const Mt = {
|
|
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 = Mt;
|
|
1916
|
+
const Ut = {
|
|
1917
1917
|
init: function() {
|
|
1918
1918
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
1919
1919
|
new Q.MutatorIcon(
|
|
@@ -1923,7 +1923,7 @@ const Mt = {
|
|
|
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 = Rt.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(b.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 = Ut;
|
|
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 me = u.xml, Vt = {
|
|
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 ze(!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 = Vt;
|
|
2260
|
+
const Pt = {
|
|
2261
2261
|
init: function() {
|
|
2262
|
-
const e = new
|
|
2262
|
+
const e = new Te(re.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,14 +2279,14 @@ const Vt = {
|
|
|
2279
2279
|
return e;
|
|
2280
2280
|
}
|
|
2281
2281
|
};
|
|
2282
|
-
|
|
2283
|
-
const
|
|
2282
|
+
O.procedure_def_item_v1 = Pt;
|
|
2283
|
+
const Dt = {
|
|
2284
2284
|
init: function() {
|
|
2285
2285
|
this.withReturn = !1, this.args = [];
|
|
2286
|
-
const e = new
|
|
2287
|
-
|
|
2286
|
+
const e = new Te(
|
|
2287
|
+
re.findLegalName("", this)
|
|
2288
2288
|
);
|
|
2289
|
-
e.setValidator(
|
|
2289
|
+
e.setValidator(re.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
|
|
2290
2290
|
new Q.MutatorIcon(
|
|
2291
2291
|
["procedure_def_item_v1"],
|
|
2292
2292
|
this
|
|
@@ -2294,9 +2294,9 @@ const Pt = {
|
|
|
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 = me.createElement("mutation");
|
|
2298
2298
|
return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((o) => {
|
|
2299
|
-
const t =
|
|
2299
|
+
const t = me.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 = ve(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 = Dt;
|
|
2384
|
+
const xt = u.xml, Yt = {
|
|
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 = xt.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 = Yt;
|
|
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,9 +2465,9 @@ c([
|
|
|
2465
2465
|
s.forBlock.text_v1 = function(e) {
|
|
2466
2466
|
return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
|
|
2467
2467
|
};
|
|
2468
|
-
const
|
|
2468
|
+
const Kt = /^\s*'([^']|\\')*'\s*$/;
|
|
2469
2469
|
function J(e) {
|
|
2470
|
-
return
|
|
2470
|
+
return Kt.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
|
|
2471
2471
|
}
|
|
2472
2472
|
d.register(
|
|
2473
2473
|
"text_append_tooltip_v1",
|
|
@@ -2476,7 +2476,7 @@ d.register(
|
|
|
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
2506
|
return `${o} += ${J(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 Ft = u.xml, Ht = {
|
|
2676
2676
|
itemCount_: 0,
|
|
2677
2677
|
mutationToDom: function() {
|
|
2678
|
-
const e =
|
|
2678
|
+
const e = Ft.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
|
+
b.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
|
-
},
|
|
2750
|
+
}, wt = function() {
|
|
2751
2751
|
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new Q.MutatorIcon(["text_join_item_v1"], this));
|
|
2752
2752
|
};
|
|
2753
2753
|
d.registerMutator(
|
|
2754
2754
|
"text_join_mutator_v1",
|
|
2755
|
-
|
|
2756
|
-
|
|
2755
|
+
Ht,
|
|
2756
|
+
wt
|
|
2757
2757
|
);
|
|
2758
|
-
|
|
2758
|
+
_([
|
|
2759
2759
|
{
|
|
2760
2760
|
type: "text_join_v1",
|
|
2761
2761
|
message0: "",
|
|
@@ -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 Gt = {
|
|
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(b.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(b.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(b.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
|
w({ type: "number", default: 1e3 })
|
|
3005
3005
|
), (n = (t = this.getInput("LOOP")) == null ? void 0 : t.connection) == null || n.setShadowDom(
|
|
3006
3006
|
w({ type: "boolean", default: !1 })
|
|
3007
3007
|
), (a = (i = this.getInput("COUNT")) == null ? void 0 : i.connection) == null || a.setShadowDom(
|
|
3008
3008
|
w({ type: "number", default: 1 })
|
|
3009
|
-
), (
|
|
3009
|
+
), (c = (r = this.getInput("IMMEDIATE")) == null ? void 0 : r.connection) == null || c.setShadowDom(
|
|
3010
3010
|
w({ type: "boolean", default: !1 })
|
|
3011
3011
|
));
|
|
3012
3012
|
}
|
|
3013
3013
|
};
|
|
3014
|
-
|
|
3014
|
+
O.create_timer_v1 = Gt;
|
|
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 $t = {
|
|
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: jt(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: Xt(this)
|
|
3056
3056
|
};
|
|
3057
3057
|
e.unshift(o), e.unshift(n);
|
|
3058
3058
|
}
|
|
@@ -3066,16 +3066,16 @@ 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: ye.callbackFactory(this, i)
|
|
3070
3070
|
});
|
|
3071
3071
|
}
|
|
3072
3072
|
}
|
|
3073
|
-
},
|
|
3073
|
+
}, jt = function(e) {
|
|
3074
3074
|
return function() {
|
|
3075
3075
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3076
3076
|
W.renameVariable(o, n);
|
|
3077
3077
|
};
|
|
3078
|
-
},
|
|
3078
|
+
}, Xt = 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();
|
|
@@ -3083,9 +3083,9 @@ const Gt = {
|
|
|
3083
3083
|
};
|
|
3084
3084
|
d.registerMixin(
|
|
3085
3085
|
"context_menu_variable_v1",
|
|
3086
|
-
|
|
3086
|
+
$t
|
|
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,29 +3134,29 @@ 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 Oe = u.xml;
|
|
3143
|
+
function Wt() {
|
|
3144
3144
|
const e = [];
|
|
3145
3145
|
{
|
|
3146
|
-
const o =
|
|
3146
|
+
const o = Oe.createElement("label");
|
|
3147
3147
|
o.setAttribute("text", h.LABEL_ASSET_LAYER), e.push(o);
|
|
3148
3148
|
}
|
|
3149
3149
|
{
|
|
3150
|
-
const o =
|
|
3150
|
+
const o = Oe.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 Jt = {
|
|
3156
3156
|
name: "INTERFACE_CATEGORY",
|
|
3157
|
-
callback:
|
|
3157
|
+
callback: Wt
|
|
3158
3158
|
}, D = u.xml;
|
|
3159
|
-
function
|
|
3159
|
+
function zt() {
|
|
3160
3160
|
const e = [];
|
|
3161
3161
|
{
|
|
3162
3162
|
const o = D.createElement("label");
|
|
@@ -3181,36 +3181,36 @@ function Jt() {
|
|
|
3181
3181
|
}
|
|
3182
3182
|
return e;
|
|
3183
3183
|
}
|
|
3184
|
-
const
|
|
3184
|
+
const _e = {
|
|
3185
3185
|
name: "PROCEDURE_CATEGORY",
|
|
3186
|
-
callback:
|
|
3186
|
+
callback: zt
|
|
3187
3187
|
};
|
|
3188
|
-
function
|
|
3189
|
-
const { args: e } =
|
|
3188
|
+
function Qt() {
|
|
3189
|
+
const { args: e } = dt.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 Ie = u.xml;
|
|
3195
|
+
function qt() {
|
|
3196
3196
|
const e = [];
|
|
3197
|
-
if (
|
|
3197
|
+
if (Qt().length > 0) {
|
|
3198
3198
|
{
|
|
3199
|
-
const o =
|
|
3199
|
+
const o = Ie.createElement("label");
|
|
3200
3200
|
o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
|
|
3201
3201
|
}
|
|
3202
3202
|
{
|
|
3203
|
-
const o =
|
|
3203
|
+
const o = Ie.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 ue = {
|
|
3210
3210
|
name: "UI_CATEGORY",
|
|
3211
|
-
callback:
|
|
3211
|
+
callback: qt
|
|
3212
3212
|
}, G = u.xml;
|
|
3213
|
-
function
|
|
3213
|
+
function Zt(e) {
|
|
3214
3214
|
const o = [];
|
|
3215
3215
|
{
|
|
3216
3216
|
const n = G.createElement("label");
|
|
@@ -3230,7 +3230,7 @@ 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(Qe.compareByName);
|
|
3234
3234
|
{
|
|
3235
3235
|
const n = G.createElement("label");
|
|
3236
3236
|
n.setAttribute("text", h.LABEL_CREATED), o.push(n);
|
|
@@ -3246,25 +3246,25 @@ function qt(e) {
|
|
|
3246
3246
|
}
|
|
3247
3247
|
}), o;
|
|
3248
3248
|
}
|
|
3249
|
-
const
|
|
3249
|
+
const pe = {
|
|
3250
3250
|
name: "VARIABLE_CATEGORY",
|
|
3251
|
-
callback:
|
|
3251
|
+
callback: Zt
|
|
3252
3252
|
};
|
|
3253
|
-
|
|
3254
|
-
const t = await
|
|
3253
|
+
Ce.setConfirm(async (e, o) => {
|
|
3254
|
+
const t = await st({
|
|
3255
3255
|
title: "",
|
|
3256
3256
|
text: e
|
|
3257
3257
|
});
|
|
3258
3258
|
o(!!t);
|
|
3259
3259
|
});
|
|
3260
|
-
|
|
3261
|
-
const n = await
|
|
3260
|
+
Ce.setPrompt(async (e, o, t) => {
|
|
3261
|
+
const n = await lt({
|
|
3262
3262
|
title: "",
|
|
3263
3263
|
value: o
|
|
3264
3264
|
});
|
|
3265
3265
|
t(String(n));
|
|
3266
3266
|
});
|
|
3267
|
-
const
|
|
3267
|
+
const eo = (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,11 +3277,11 @@ const Zt = (e, o, t) => {
|
|
|
3277
3277
|
);
|
|
3278
3278
|
});
|
|
3279
3279
|
};
|
|
3280
|
-
async function
|
|
3281
|
-
const o = await
|
|
3282
|
-
|
|
3280
|
+
async function ge(e) {
|
|
3281
|
+
const o = await eo(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./zhHans-kgty7l19.js") }), `./msg/${e}.ts`, 3);
|
|
3282
|
+
qe(o.default);
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3284
|
+
function be(e) {
|
|
3285
3285
|
const o = M();
|
|
3286
3286
|
if (!o)
|
|
3287
3287
|
return;
|
|
@@ -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 to() {
|
|
3298
3298
|
var t;
|
|
3299
3299
|
const e = M();
|
|
3300
3300
|
if (!e)
|
|
3301
3301
|
return;
|
|
3302
3302
|
const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
|
|
3303
|
-
o &&
|
|
3303
|
+
o && be(o.id);
|
|
3304
3304
|
}
|
|
3305
|
-
class
|
|
3305
|
+
class oo {
|
|
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
|
+
oe.names.COPY
|
|
3312
3312
|
), m.registry.unregister(
|
|
3313
|
-
|
|
3313
|
+
oe.names.CUT
|
|
3314
3314
|
), m.registry.unregister(
|
|
3315
|
-
|
|
3315
|
+
oe.names.PASTE
|
|
3316
3316
|
), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
|
|
3317
3317
|
}
|
|
3318
3318
|
blockCopyToStorageContextMenu() {
|
|
@@ -3322,7 +3322,7 @@ class to {
|
|
|
3322
3322
|
},
|
|
3323
3323
|
preconditionFn: function() {
|
|
3324
3324
|
const t = B();
|
|
3325
|
-
return !t || !K(t) || !t.isDeletable() || !
|
|
3325
|
+
return !t || !K(t) || !t.isDeletable() || !ne(t) || !t.isMovable() || !P(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: N.ScopeType.BLOCK,
|
|
3335
3335
|
id: "blockCopyToStorage",
|
|
3336
3336
|
weight: 0
|
|
3337
3337
|
};
|
|
3338
|
-
|
|
3338
|
+
N.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 && he.paste(i, t.workspace);
|
|
3359
3359
|
},
|
|
3360
|
-
scopeType:
|
|
3360
|
+
scopeType: N.ScopeType.WORKSPACE,
|
|
3361
3361
|
id: "blockPasteFromStorage",
|
|
3362
3362
|
weight: 0
|
|
3363
3363
|
};
|
|
3364
|
-
|
|
3364
|
+
N.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 || ie.inProgress())
|
|
3380
3380
|
return !1;
|
|
3381
3381
|
const r = B();
|
|
3382
|
-
return !(!r || !K(r) || !r.isDeletable() || !
|
|
3382
|
+
return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r));
|
|
3383
3383
|
},
|
|
3384
3384
|
callback: function(a, r) {
|
|
3385
3385
|
r.preventDefault();
|
|
3386
|
-
const
|
|
3387
|
-
if (!
|
|
3386
|
+
const c = B();
|
|
3387
|
+
if (!c || !P(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 || ie.inProgress())
|
|
3410
3410
|
return !1;
|
|
3411
3411
|
const r = B();
|
|
3412
|
-
return !(!r || !K(r) || !r.isDeletable() || !
|
|
3412
|
+
return !(!r || !K(r) || !r.isDeletable() || !ne(r) || !r.isMovable() || !P(r) || r.workspace.isFlyout);
|
|
3413
3413
|
},
|
|
3414
3414
|
callback: function(a, r) {
|
|
3415
3415
|
r.preventDefault();
|
|
3416
|
-
const
|
|
3417
|
-
if (!
|
|
3416
|
+
const c = B();
|
|
3417
|
+
if (!c || !K(c) || !c.isDeletable() || !P(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 Ze ? 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 || ie.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 ? (he.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 no {
|
|
3461
3461
|
init() {
|
|
3462
|
-
const o =
|
|
3462
|
+
const o = N.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 Ne(e) {
|
|
3481
3481
|
const o = e.getParent();
|
|
3482
|
-
return o &&
|
|
3482
|
+
return o && Ne(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
|
|
3483
3483
|
}
|
|
3484
|
-
class
|
|
3484
|
+
class io {
|
|
3485
3485
|
init() {
|
|
3486
|
-
const o =
|
|
3486
|
+
const o = N.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() || Ne(n) ? "disabled" : "enabled" : "hidden";
|
|
3490
3490
|
});
|
|
3491
3491
|
}
|
|
3492
3492
|
}
|
|
3493
|
-
class
|
|
3493
|
+
class ke extends se {
|
|
3494
3494
|
constructor(t, n, i) {
|
|
3495
|
-
super(
|
|
3495
|
+
super(se.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 !== se.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);
|
|
@@ -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,18 +4242,18 @@ 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
|
k.conditionalBind(
|
|
@@ -4307,8 +4307,8 @@ class Ne extends ie {
|
|
|
4307
4307
|
return new this(t.colour, void 0, t);
|
|
4308
4308
|
}
|
|
4309
4309
|
}
|
|
4310
|
-
|
|
4311
|
-
|
|
4310
|
+
ke.prototype.DEFAULT_VALUE = "#ffffff";
|
|
4311
|
+
et.register(`
|
|
4312
4312
|
.blocklyColourTable {
|
|
4313
4313
|
border-collapse: collapse;
|
|
4314
4314
|
display: block;
|
|
@@ -4335,16 +4335,16 @@ Ze.register(`
|
|
|
4335
4335
|
position: relative;
|
|
4336
4336
|
}
|
|
4337
4337
|
`);
|
|
4338
|
-
function
|
|
4339
|
-
|
|
4338
|
+
function so() {
|
|
4339
|
+
tt.register("field_colour", ke);
|
|
4340
4340
|
}
|
|
4341
|
-
const so = new to();
|
|
4342
|
-
so.init({ contextMenu: !0, shortcut: !0 });
|
|
4343
4341
|
const lo = new oo();
|
|
4344
|
-
lo.init();
|
|
4342
|
+
lo.init({ contextMenu: !0, shortcut: !0 });
|
|
4345
4343
|
const ao = new no();
|
|
4346
4344
|
ao.init();
|
|
4347
|
-
io();
|
|
4345
|
+
const ro = new io();
|
|
4346
|
+
ro.init();
|
|
4347
|
+
so();
|
|
4348
4348
|
q.Classic.blockStyles = {
|
|
4349
4349
|
color_blocks: {
|
|
4350
4350
|
colourPrimary: "#a5745b",
|
|
@@ -4469,7 +4469,7 @@ q.Classic.categoryStyles = {
|
|
|
4469
4469
|
colour: "#a55b80"
|
|
4470
4470
|
}
|
|
4471
4471
|
};
|
|
4472
|
-
const
|
|
4472
|
+
const co = Ae.defineTheme("light", {
|
|
4473
4473
|
name: "light",
|
|
4474
4474
|
base: q.Classic,
|
|
4475
4475
|
componentStyles: {
|
|
@@ -4485,7 +4485,7 @@ const ro = Ce.defineTheme("light", {
|
|
|
4485
4485
|
scrollbarOpacity: 0.4,
|
|
4486
4486
|
cursorColour: ""
|
|
4487
4487
|
}
|
|
4488
|
-
}), _o =
|
|
4488
|
+
}), _o = Ae.defineTheme("dark", {
|
|
4489
4489
|
name: "dark",
|
|
4490
4490
|
base: q.Classic,
|
|
4491
4491
|
componentStyles: {
|
|
@@ -4502,18 +4502,18 @@ const ro = Ce.defineTheme("light", {
|
|
|
4502
4502
|
cursorColour: ""
|
|
4503
4503
|
}
|
|
4504
4504
|
});
|
|
4505
|
-
function
|
|
4505
|
+
function uo(e) {
|
|
4506
4506
|
const o = M();
|
|
4507
4507
|
switch (console.log(o), e) {
|
|
4508
4508
|
case "light":
|
|
4509
|
-
o.setTheme(
|
|
4509
|
+
o.setTheme(co);
|
|
4510
4510
|
break;
|
|
4511
4511
|
case "dark":
|
|
4512
4512
|
o.setTheme(_o);
|
|
4513
4513
|
break;
|
|
4514
4514
|
}
|
|
4515
4515
|
}
|
|
4516
|
-
const
|
|
4516
|
+
const po = {
|
|
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
|
+
}, To = {
|
|
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
|
+
}, fo = {
|
|
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
|
+
}, Eo = {
|
|
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
|
+
}, ho = {
|
|
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
|
+
}, mo = {
|
|
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
|
+
}, Oo = {
|
|
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,64 @@ 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: ue.name
|
|
5187
5187
|
},
|
|
5188
|
+
Eo,
|
|
5188
5189
|
fo,
|
|
5190
|
+
ho,
|
|
5191
|
+
Oo,
|
|
5189
5192
|
To,
|
|
5190
|
-
Eo,
|
|
5191
5193
|
mo,
|
|
5192
5194
|
po,
|
|
5193
|
-
|
|
5194
|
-
uo,
|
|
5195
|
-
Oo,
|
|
5195
|
+
Io,
|
|
5196
5196
|
{
|
|
5197
5197
|
kind: "category",
|
|
5198
5198
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
5199
5199
|
categorystyle: "variable_category",
|
|
5200
|
-
custom:
|
|
5200
|
+
custom: pe.name
|
|
5201
5201
|
},
|
|
5202
5202
|
{
|
|
5203
5203
|
kind: "category",
|
|
5204
5204
|
name: "%{BKY_CATEGORY_PROCEDURE}",
|
|
5205
5205
|
categorystyle: "procedure_category",
|
|
5206
|
-
custom:
|
|
5206
|
+
custom: _e.name
|
|
5207
5207
|
},
|
|
5208
5208
|
{
|
|
5209
5209
|
kind: "category",
|
|
5210
5210
|
name: "%{BKY_CATEGORY_INTERFACE}",
|
|
5211
5211
|
categorystyle: "interface_category",
|
|
5212
|
-
custom:
|
|
5212
|
+
custom: Jt.name
|
|
5213
5213
|
}
|
|
5214
5214
|
]
|
|
5215
|
-
},
|
|
5215
|
+
}, Lo = /* @__PURE__ */ z({
|
|
5216
5216
|
__name: "cleanup",
|
|
5217
5217
|
setup(e) {
|
|
5218
5218
|
const o = () => {
|
|
5219
5219
|
const t = M();
|
|
5220
5220
|
if (!t)
|
|
5221
5221
|
return;
|
|
5222
|
-
const n =
|
|
5222
|
+
const n = N.registry.getItem("cleanWorkspace");
|
|
5223
5223
|
n && n.callback({ workspace: t }, new PointerEvent("dummy"));
|
|
5224
5224
|
};
|
|
5225
5225
|
return (t, n) => {
|
|
5226
5226
|
const i = C("v-btn");
|
|
5227
|
-
return
|
|
5227
|
+
return I(), S(i, {
|
|
5228
5228
|
class: "mr-3",
|
|
5229
5229
|
variant: "outlined",
|
|
5230
5230
|
density: "comfortable",
|
|
5231
|
-
icon: Y(
|
|
5231
|
+
icon: Y(ct),
|
|
5232
5232
|
onClick: o
|
|
5233
5233
|
}, null, 8, ["icon"]);
|
|
5234
5234
|
};
|
|
5235
5235
|
}
|
|
5236
|
-
}),
|
|
5236
|
+
}), yo = /* @__PURE__ */ z({
|
|
5237
5237
|
__name: "lock",
|
|
5238
5238
|
props: {
|
|
5239
5239
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -5241,48 +5241,48 @@ const uo = {
|
|
|
5241
5241
|
},
|
|
5242
5242
|
emits: ["update:modelValue"],
|
|
5243
5243
|
setup(e) {
|
|
5244
|
-
const o =
|
|
5244
|
+
const o = le(e, "modelValue");
|
|
5245
5245
|
return (t, n) => {
|
|
5246
5246
|
const i = C("v-btn");
|
|
5247
|
-
return
|
|
5247
|
+
return I(), S(i, {
|
|
5248
5248
|
class: "mr-3",
|
|
5249
5249
|
variant: "outlined",
|
|
5250
5250
|
density: "comfortable",
|
|
5251
|
-
icon: o.value ? Y(
|
|
5251
|
+
icon: o.value ? Y(ut) : Y(pt),
|
|
5252
5252
|
onClick: n[0] || (n[0] = (a) => o.value = !o.value)
|
|
5253
5253
|
}, null, 8, ["icon"]);
|
|
5254
5254
|
};
|
|
5255
5255
|
}
|
|
5256
|
-
}),
|
|
5256
|
+
}), Co = {
|
|
5257
5257
|
key: 1,
|
|
5258
5258
|
class: "text-caption text-grey"
|
|
5259
|
-
},
|
|
5259
|
+
}, Ao = /* @__PURE__ */ z({
|
|
5260
5260
|
__name: "navigator",
|
|
5261
5261
|
setup(e) {
|
|
5262
5262
|
const o = $(() => ({
|
|
5263
5263
|
maxHeight: "calc(100vh - 200px)"
|
|
5264
5264
|
})), t = j([]), n = () => {
|
|
5265
|
-
var
|
|
5265
|
+
var y;
|
|
5266
5266
|
const a = M();
|
|
5267
5267
|
if (!a) {
|
|
5268
5268
|
t.value = [];
|
|
5269
5269
|
return;
|
|
5270
5270
|
}
|
|
5271
|
-
const r = [],
|
|
5272
|
-
|
|
5273
|
-
const
|
|
5274
|
-
if (
|
|
5271
|
+
const r = [], c = a.getTopBlocks(!0), p = ((y = B()) == null ? void 0 : y.id) ?? "";
|
|
5272
|
+
c.forEach((v) => {
|
|
5273
|
+
const g = v;
|
|
5274
|
+
if (g.type.startsWith("on_node_event_v"))
|
|
5275
5275
|
console.log("1");
|
|
5276
|
-
else if (
|
|
5276
|
+
else if (g.type.startsWith("procedure_def_v"))
|
|
5277
5277
|
console.log("2");
|
|
5278
5278
|
else {
|
|
5279
|
-
const
|
|
5279
|
+
const f = g.getRelativeToSurfaceXY();
|
|
5280
5280
|
r.push({
|
|
5281
|
-
id:
|
|
5281
|
+
id: g.id,
|
|
5282
5282
|
name: h.fffff,
|
|
5283
|
-
x:
|
|
5284
|
-
y:
|
|
5285
|
-
active:
|
|
5283
|
+
x: f.x,
|
|
5284
|
+
y: f.y,
|
|
5285
|
+
active: g.id === p
|
|
5286
5286
|
});
|
|
5287
5287
|
}
|
|
5288
5288
|
}), t.value = r;
|
|
@@ -5290,44 +5290,44 @@ const uo = {
|
|
|
5290
5290
|
const r = M();
|
|
5291
5291
|
if (!r)
|
|
5292
5292
|
return;
|
|
5293
|
-
const
|
|
5294
|
-
|
|
5293
|
+
const c = r.getBlockById(a.id);
|
|
5294
|
+
c && (be(a.id), c.select());
|
|
5295
5295
|
};
|
|
5296
|
-
return
|
|
5297
|
-
|
|
5298
|
-
}),
|
|
5299
|
-
|
|
5296
|
+
return Le(() => {
|
|
5297
|
+
ce.on("codeUpdate", n);
|
|
5298
|
+
}), Ke(() => {
|
|
5299
|
+
ce.off("codeUpdate", n);
|
|
5300
5300
|
}), (a, r) => {
|
|
5301
|
-
const
|
|
5302
|
-
return
|
|
5301
|
+
const c = C("v-btn"), p = C("v-list-item-title"), y = C("v-list-item"), v = C("v-list"), g = C("v-menu");
|
|
5302
|
+
return I(), S(g, {
|
|
5303
5303
|
"close-on-content-click": !1,
|
|
5304
5304
|
transition: "slide-y-transition",
|
|
5305
5305
|
"offset-y": ""
|
|
5306
5306
|
}, {
|
|
5307
|
-
activator: U(({ props:
|
|
5308
|
-
R(
|
|
5307
|
+
activator: U(({ props: f }) => [
|
|
5308
|
+
R(c, Fe(f, {
|
|
5309
5309
|
variant: "outlined",
|
|
5310
5310
|
density: "comfortable",
|
|
5311
|
-
icon: Y(
|
|
5311
|
+
icon: Y(Tt)
|
|
5312
5312
|
}), null, 16, ["icon"])
|
|
5313
5313
|
]),
|
|
5314
5314
|
default: U(() => [
|
|
5315
|
-
|
|
5315
|
+
ae("div", {
|
|
5316
5316
|
class: "overflow-auto",
|
|
5317
5317
|
style: X(o.value)
|
|
5318
5318
|
}, [
|
|
5319
|
-
t.value.length > 0 ? (
|
|
5319
|
+
t.value.length > 0 ? (I(), S(v, { key: 0 }, {
|
|
5320
5320
|
default: U(() => [
|
|
5321
|
-
(
|
|
5322
|
-
key:
|
|
5321
|
+
(I(!0), x(He, null, we(t.value, (f) => (I(), S(y, {
|
|
5322
|
+
key: f.id,
|
|
5323
5323
|
class: "d-flex justify-start",
|
|
5324
|
-
active:
|
|
5324
|
+
active: f.active,
|
|
5325
5325
|
onClick: i
|
|
5326
5326
|
}, {
|
|
5327
5327
|
default: U(() => [
|
|
5328
5328
|
R(p, null, {
|
|
5329
5329
|
default: U(() => [
|
|
5330
|
-
|
|
5330
|
+
Ge($e(f.name), 1)
|
|
5331
5331
|
]),
|
|
5332
5332
|
_: 2
|
|
5333
5333
|
}, 1024)
|
|
@@ -5336,27 +5336,28 @@ const uo = {
|
|
|
5336
5336
|
}, 1032, ["active"]))), 128))
|
|
5337
5337
|
]),
|
|
5338
5338
|
_: 1
|
|
5339
|
-
})) : (
|
|
5339
|
+
})) : (I(), x("span", Co, "xxxxxxxxxx"))
|
|
5340
5340
|
], 4)
|
|
5341
5341
|
]),
|
|
5342
5342
|
_: 1
|
|
5343
5343
|
});
|
|
5344
5344
|
};
|
|
5345
5345
|
}
|
|
5346
|
-
}),
|
|
5346
|
+
}), vo = { class: "position-relative w-100 h-100" }, bo = /* @__PURE__ */ z({
|
|
5347
5347
|
__name: "index",
|
|
5348
|
-
props: /* @__PURE__ */
|
|
5348
|
+
props: /* @__PURE__ */ Ee({
|
|
5349
5349
|
type: {},
|
|
5350
5350
|
version: {},
|
|
5351
|
-
active: { type: Boolean }
|
|
5352
|
-
scale: {}
|
|
5351
|
+
active: { type: Boolean }
|
|
5353
5352
|
}, {
|
|
5354
5353
|
lock: { type: Boolean, required: !0 },
|
|
5355
|
-
lockModifiers: {}
|
|
5354
|
+
lockModifiers: {},
|
|
5355
|
+
scale: { required: !0 },
|
|
5356
|
+
scaleModifiers: {}
|
|
5356
5357
|
}),
|
|
5357
|
-
emits: /* @__PURE__ */
|
|
5358
|
+
emits: /* @__PURE__ */ Ee(["ready", "change"], ["update:lock", "update:scale"]),
|
|
5358
5359
|
setup(e, { emit: o }) {
|
|
5359
|
-
const t =
|
|
5360
|
+
const t = at(), { locale: n, dark: i } = it(t), { open: a } = rt("blocklyEditorFlyout"), r = le(e, "lock"), c = le(e, "scale"), p = e, y = o, v = j(), g = {
|
|
5360
5361
|
grid: {
|
|
5361
5362
|
length: 2,
|
|
5362
5363
|
snap: !0,
|
|
@@ -5380,7 +5381,7 @@ const uo = {
|
|
|
5380
5381
|
}
|
|
5381
5382
|
};
|
|
5382
5383
|
let f;
|
|
5383
|
-
const
|
|
5384
|
+
const Z = j(!1), ee = j(!1), Be = $(() => ({
|
|
5384
5385
|
position: "absolute",
|
|
5385
5386
|
background: i.value ? "#0000007f" : "#ffffff7f",
|
|
5386
5387
|
top: "1px",
|
|
@@ -5389,7 +5390,7 @@ const uo = {
|
|
|
5389
5390
|
height: "calc(100% - 1px)",
|
|
5390
5391
|
pointerEvents: "none",
|
|
5391
5392
|
zIndex: 999
|
|
5392
|
-
})),
|
|
5393
|
+
})), Re = $(() => ({
|
|
5393
5394
|
position: "absolute",
|
|
5394
5395
|
background: i.value ? "#0000007f" : "#ffffff7f",
|
|
5395
5396
|
top: "0px",
|
|
@@ -5397,109 +5398,109 @@ const uo = {
|
|
|
5397
5398
|
width: "100%",
|
|
5398
5399
|
height: "100%",
|
|
5399
5400
|
pointerEvents: "none"
|
|
5400
|
-
})),
|
|
5401
|
+
})), Se = $(() => ({
|
|
5401
5402
|
position: "absolute",
|
|
5402
5403
|
top: "0px",
|
|
5403
5404
|
right: "0px",
|
|
5404
5405
|
zIndex: 20
|
|
5405
5406
|
}));
|
|
5406
|
-
|
|
5407
|
-
if (!
|
|
5407
|
+
Le(async () => {
|
|
5408
|
+
if (!v.value)
|
|
5408
5409
|
return;
|
|
5409
|
-
await
|
|
5410
|
+
await ge(n.value);
|
|
5410
5411
|
let T;
|
|
5411
|
-
if (
|
|
5412
|
-
switch (
|
|
5412
|
+
if (p.type === "app" && p.version === "v1" && (T = go), g.toolbox = T, f = ot(v.value, g), p.type === "app")
|
|
5413
|
+
switch (p.version) {
|
|
5413
5414
|
case "v1":
|
|
5414
5415
|
f.registerToolboxCategoryCallback(
|
|
5416
|
+
ue.name,
|
|
5417
|
+
ue.callback
|
|
5418
|
+
), f.registerToolboxCategoryCallback(
|
|
5415
5419
|
_e.name,
|
|
5416
5420
|
_e.callback
|
|
5417
5421
|
), f.registerToolboxCategoryCallback(
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
), f.registerToolboxCategoryCallback(
|
|
5421
|
-
ce.name,
|
|
5422
|
-
ce.callback
|
|
5422
|
+
pe.name,
|
|
5423
|
+
pe.callback
|
|
5423
5424
|
);
|
|
5424
5425
|
break;
|
|
5425
5426
|
}
|
|
5426
|
-
f.addChangeListener(E.disableOrphans), f.addChangeListener(
|
|
5427
|
-
}),
|
|
5427
|
+
f.addChangeListener(E.disableOrphans), f.addChangeListener(Me), y("ready", f);
|
|
5428
|
+
}), je(() => {
|
|
5428
5429
|
a.value = !1;
|
|
5429
5430
|
});
|
|
5430
|
-
function
|
|
5431
|
-
f &&
|
|
5431
|
+
function fe() {
|
|
5432
|
+
f && nt(f);
|
|
5432
5433
|
}
|
|
5433
|
-
function
|
|
5434
|
+
function Me(T) {
|
|
5434
5435
|
if (T.type === E.FINISHED_LOADING) {
|
|
5435
|
-
|
|
5436
|
+
to(), ce.emit("codeUpdate"), Z.value = !1;
|
|
5436
5437
|
return;
|
|
5437
5438
|
}
|
|
5438
|
-
|
|
5439
|
+
Z.value || (T.type === E.BLOCK_DRAG && (T.isStart ? ee.value = !0 : ee.value = !1), y("change", T));
|
|
5439
5440
|
}
|
|
5440
5441
|
return V(n, (T) => {
|
|
5441
|
-
|
|
5442
|
+
ge(T);
|
|
5442
5443
|
}), V(i, (T) => {
|
|
5443
|
-
|
|
5444
|
+
uo(T ? "dark" : "light");
|
|
5444
5445
|
}), V(a, (T) => {
|
|
5445
5446
|
var A;
|
|
5446
5447
|
T || (A = f.getToolbox()) == null || A.clearSelection();
|
|
5447
5448
|
}), V(
|
|
5448
|
-
() =>
|
|
5449
|
+
() => p.active,
|
|
5449
5450
|
(T) => {
|
|
5450
|
-
T && setTimeout(() =>
|
|
5451
|
+
T && setTimeout(() => fe(), 1);
|
|
5451
5452
|
}
|
|
5452
5453
|
), V(
|
|
5453
|
-
|
|
5454
|
+
c,
|
|
5454
5455
|
(T) => {
|
|
5455
5456
|
f.setScale(T);
|
|
5456
5457
|
}
|
|
5457
5458
|
), (T, A) => {
|
|
5458
|
-
const
|
|
5459
|
-
return
|
|
5460
|
-
|
|
5459
|
+
const Ue = C("v-icon"), Ve = C("x-loading"), Pe = Xe("resize");
|
|
5460
|
+
return I(), x("div", vo, [
|
|
5461
|
+
We(ae("div", {
|
|
5461
5462
|
id: "blocklyEditor",
|
|
5462
5463
|
ref_key: "blocklyDiv",
|
|
5463
|
-
ref:
|
|
5464
|
+
ref: v,
|
|
5464
5465
|
class: "w-100 h-100"
|
|
5465
5466
|
}, null, 512), [
|
|
5466
|
-
[
|
|
5467
|
+
[Pe, fe]
|
|
5467
5468
|
]),
|
|
5468
|
-
|
|
5469
|
+
ee.value ? (I(), x("div", {
|
|
5469
5470
|
key: 0,
|
|
5470
5471
|
class: "d-flex flex-column align-center justify-center",
|
|
5471
|
-
style: X(
|
|
5472
|
+
style: X(Be.value)
|
|
5472
5473
|
}, [
|
|
5473
|
-
R(
|
|
5474
|
+
R(Ue, {
|
|
5474
5475
|
icon: Y(_t),
|
|
5475
5476
|
size: "x-large"
|
|
5476
5477
|
}, null, 8, ["icon"])
|
|
5477
|
-
], 4)) :
|
|
5478
|
-
|
|
5478
|
+
], 4)) : te("", !0),
|
|
5479
|
+
r.value ? (I(), x("div", {
|
|
5479
5480
|
key: 1,
|
|
5480
|
-
style: X(Be.value)
|
|
5481
|
-
}, null, 4)) : ee("", !0),
|
|
5482
|
-
se("div", {
|
|
5483
|
-
class: "d-flex align-end pt-3 pr-3",
|
|
5484
5481
|
style: X(Re.value)
|
|
5482
|
+
}, null, 4)) : te("", !0),
|
|
5483
|
+
ae("div", {
|
|
5484
|
+
class: "d-flex align-end pt-3 pr-3",
|
|
5485
|
+
style: X(Se.value)
|
|
5485
5486
|
}, [
|
|
5486
|
-
R(
|
|
5487
|
-
R(
|
|
5488
|
-
modelValue:
|
|
5489
|
-
"onUpdate:modelValue": A[0] || (A[0] = (
|
|
5487
|
+
R(Lo),
|
|
5488
|
+
R(yo, {
|
|
5489
|
+
modelValue: r.value,
|
|
5490
|
+
"onUpdate:modelValue": A[0] || (A[0] = (De) => r.value = De)
|
|
5490
5491
|
}, null, 8, ["modelValue"]),
|
|
5491
|
-
R(
|
|
5492
|
+
R(Ao)
|
|
5492
5493
|
], 4),
|
|
5493
|
-
|
|
5494
|
+
Z.value ? (I(), S(Ve, {
|
|
5494
5495
|
key: 2,
|
|
5495
5496
|
"z-index": 99
|
|
5496
|
-
})) :
|
|
5497
|
+
})) : te("", !0)
|
|
5497
5498
|
]);
|
|
5498
5499
|
};
|
|
5499
5500
|
}
|
|
5500
|
-
}),
|
|
5501
|
-
e.component("XBlockly",
|
|
5502
|
-
},
|
|
5501
|
+
}), No = (e) => {
|
|
5502
|
+
e.component("XBlockly", bo);
|
|
5503
|
+
}, Uo = { install: No };
|
|
5503
5504
|
export {
|
|
5504
|
-
|
|
5505
|
+
Uo as default
|
|
5505
5506
|
};
|