x-block-lib 0.4.11 → 0.4.13
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 +1 -0
- package/dist/index.js +194 -194
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ type __VLS_PublicProps = {
|
|
|
9
9
|
'scale': number;
|
|
10
10
|
} & typeof __VLS_typeProps;
|
|
11
11
|
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
12
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
12
13
|
resize: () => void;
|
|
13
14
|
load: (state: object) => void;
|
|
14
15
|
save: () => {
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 v = (e, o, t) =>
|
|
5
|
-
import { defineComponent as X, resolveComponent as C, openBlock as L, createBlock as
|
|
6
|
-
import { d as _, j as s, O as l, u, X as
|
|
7
|
-
import { storeToRefs as
|
|
8
|
-
import { openConfirmDlg as
|
|
9
|
-
import { useDisplay as
|
|
2
|
+
var ot = Object.defineProperty;
|
|
3
|
+
var nt = (e, o, t) => o in e ? ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
4
|
+
var v = (e, o, t) => nt(e, typeof o != "symbol" ? o + "" : o, t);
|
|
5
|
+
import { defineComponent as X, resolveComponent as C, openBlock as L, createBlock as P, unref as A, useModel as ue, ref as ee, onMounted as Me, onUnmounted as it, withCtx as Y, createElementBlock as j, Fragment as st, renderList as lt, createVNode as B, createTextVNode as at, toDisplayString as pe, computed as K, isRef as rt, withKeys as ct, withModifiers as le, mergeProps as _t, createElementVNode as M, normalizeStyle as F, createCommentVNode as te, mergeModels as Ce, onBeforeUnmount as ut, watch as W, resolveDirective as pt, withDirectives as Tt } from "vue";
|
|
6
|
+
import { d as _, j as s, O as l, u, X as dt, B as y, E, M as m, i as ie, a as U, b as f, C as Ue, F as fe, c as ft, P as Te, N as Ee, V as oe, e as Et, f as Ve, s as ht, g as H, S as g, h as ae, k as D, l as J, m as re, n as G, o as V, p as ve, G as ce, q as mt, r as Ot, t as _e, U as z, D as Q, v as x, w as gt, T as se, x as Pe, y as It, z as Ae, A as Lt } from "./blockly-d7r2qvsx.js";
|
|
7
|
+
import { storeToRefs as yt } from "pinia";
|
|
8
|
+
import { openConfirmDlg as Ct, openPromptDlg as vt, eventBus as be, useSystem as At, useColor as bt, useViewStack as xe, useGlobalStore as kt } from "x-essential-lib";
|
|
9
|
+
import { useDisplay as Nt } from "vuetify";
|
|
10
10
|
import { useI18n as De } from "vue-i18n";
|
|
11
|
-
var
|
|
11
|
+
var Bt = "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", Rt = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", St = "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", Ut = "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", Vt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
|
|
12
12
|
_([
|
|
13
13
|
{
|
|
14
14
|
type: "color_blend_v1",
|
|
@@ -151,7 +151,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
151
151
|
`
|
|
152
152
|
)}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
|
|
153
153
|
};
|
|
154
|
-
const
|
|
154
|
+
const Pt = function() {
|
|
155
155
|
if (!window.blocklyState) {
|
|
156
156
|
const e = {
|
|
157
157
|
runtime: {
|
|
@@ -197,10 +197,10 @@ function q(e) {
|
|
|
197
197
|
return u.xml.textToDom(o);
|
|
198
198
|
}
|
|
199
199
|
function Ye(e, o, t) {
|
|
200
|
-
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a =
|
|
200
|
+
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = dt.domToWorkspace(i, e);
|
|
201
201
|
return e.getBlockById(a[0]);
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const xt = u.xml, Dt = [
|
|
204
204
|
{
|
|
205
205
|
type: "call_func_v1",
|
|
206
206
|
prefixInputs: ["OUTPUT"]
|
|
@@ -230,17 +230,17 @@ const Mt = u.xml, Ut = [
|
|
|
230
230
|
prefixInputs: ["ARG"]
|
|
231
231
|
}
|
|
232
232
|
];
|
|
233
|
-
function
|
|
233
|
+
function Yt(e, o) {
|
|
234
234
|
var n, i;
|
|
235
|
-
const t =
|
|
235
|
+
const t = Dt.find((a) => a.type === e);
|
|
236
236
|
return t ? !!((n = t.prefixInputs) != null && n.some((a) => o.startsWith(a)) || (i = t.inputs) != null && i.some((a) => a === o)) : !1;
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const Kt = {
|
|
239
239
|
init: function() {
|
|
240
240
|
this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
|
|
241
241
|
},
|
|
242
242
|
mutationToDom: function() {
|
|
243
|
-
const e =
|
|
243
|
+
const e = xt.createElement("mutation");
|
|
244
244
|
return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
|
|
245
245
|
},
|
|
246
246
|
domToMutation: function(e) {
|
|
@@ -269,7 +269,7 @@ const Pt = {
|
|
|
269
269
|
tryDuplicate_: function(e) {
|
|
270
270
|
var t;
|
|
271
271
|
const o = this.workspace.getBlockById(e.oldParentId);
|
|
272
|
-
if (o &&
|
|
272
|
+
if (o && Yt(o.type, e.oldInputName))
|
|
273
273
|
try {
|
|
274
274
|
E.disable();
|
|
275
275
|
const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
|
|
@@ -285,23 +285,23 @@ const Pt = {
|
|
|
285
285
|
this.name ? this.setFieldValue(m[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
|
|
286
286
|
}
|
|
287
287
|
};
|
|
288
|
-
y.parameter_v1 =
|
|
288
|
+
y.parameter_v1 = Kt;
|
|
289
289
|
s.forBlock.parameter_v1 = function(e) {
|
|
290
290
|
return [e.key, l.ATOMIC];
|
|
291
291
|
};
|
|
292
|
-
const
|
|
292
|
+
const Ft = u.xml, Ht = {
|
|
293
293
|
init: function() {
|
|
294
294
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
295
295
|
}
|
|
296
296
|
};
|
|
297
|
-
y.list_create_container_v1 =
|
|
298
|
-
const
|
|
297
|
+
y.list_create_container_v1 = Ht;
|
|
298
|
+
const wt = {
|
|
299
299
|
init: function() {
|
|
300
300
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
|
-
y.list_create_item_v1 =
|
|
304
|
-
const
|
|
303
|
+
y.list_create_item_v1 = wt;
|
|
304
|
+
const Gt = {
|
|
305
305
|
init: function() {
|
|
306
306
|
this.itemCount_ = 0, this.setMutator(
|
|
307
307
|
new ie.MutatorIcon(
|
|
@@ -311,7 +311,7 @@ const Kt = {
|
|
|
311
311
|
), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
|
|
312
312
|
},
|
|
313
313
|
mutationToDom: function() {
|
|
314
|
-
const e =
|
|
314
|
+
const e = Ft.createElement("mutation");
|
|
315
315
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
316
316
|
},
|
|
317
317
|
domToMutation: function(e) {
|
|
@@ -379,13 +379,13 @@ const Kt = {
|
|
|
379
379
|
for (let e = 0; e < this.itemCount_; e++)
|
|
380
380
|
if (!this.getInput("ADD" + e)) {
|
|
381
381
|
const o = this.appendValueInput("ADD" + e);
|
|
382
|
-
e === 0 && (o.setAlign(
|
|
382
|
+
e === 0 && (o.setAlign(U.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
383
383
|
}
|
|
384
384
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
385
385
|
this.removeInput("ADD" + e);
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
y.list_create_v1 =
|
|
388
|
+
y.list_create_v1 = Gt;
|
|
389
389
|
s.forBlock.list_create_v1 = function(e) {
|
|
390
390
|
const o = e, t = new Array(o.itemCount_);
|
|
391
391
|
for (let i = 0; i < o.itemCount_; i++)
|
|
@@ -601,7 +601,7 @@ s.forBlock.list_set_v1 = function(e) {
|
|
|
601
601
|
return `${o}[${t}] = ${n};
|
|
602
602
|
`;
|
|
603
603
|
};
|
|
604
|
-
const
|
|
604
|
+
const $t = {
|
|
605
605
|
// logic_compare
|
|
606
606
|
EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
|
|
607
607
|
NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
|
|
@@ -615,7 +615,7 @@ const Ft = {
|
|
|
615
615
|
};
|
|
616
616
|
f.register(
|
|
617
617
|
"logic_op_tooltip_v1",
|
|
618
|
-
f.buildTooltipForDropdown("OP",
|
|
618
|
+
f.buildTooltipForDropdown("OP", $t)
|
|
619
619
|
);
|
|
620
620
|
_([
|
|
621
621
|
{
|
|
@@ -640,7 +640,7 @@ _([
|
|
|
640
640
|
s.forBlock.logic_boolean_v1 = function(e) {
|
|
641
641
|
return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", l.ATOMIC];
|
|
642
642
|
};
|
|
643
|
-
const
|
|
643
|
+
const jt = {
|
|
644
644
|
onchange: function(e) {
|
|
645
645
|
this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
|
|
646
646
|
const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
|
|
@@ -660,7 +660,7 @@ const Ht = {
|
|
|
660
660
|
f.register(
|
|
661
661
|
"logic_compare_v1",
|
|
662
662
|
function() {
|
|
663
|
-
this.mixin(
|
|
663
|
+
this.mixin(jt);
|
|
664
664
|
}
|
|
665
665
|
);
|
|
666
666
|
_([
|
|
@@ -710,7 +710,7 @@ s.forBlock.logic_compare_v1 = function(e) {
|
|
|
710
710
|
const i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
|
|
711
711
|
return [`${i} ${t} ${a}`, n];
|
|
712
712
|
};
|
|
713
|
-
const
|
|
713
|
+
const Xt = {
|
|
714
714
|
elseIfCount_: 0,
|
|
715
715
|
hasElse_: !1,
|
|
716
716
|
mutationToDom: function() {
|
|
@@ -838,7 +838,7 @@ const wt = {
|
|
|
838
838
|
};
|
|
839
839
|
f.registerMutator(
|
|
840
840
|
"logic_if_v1_mutator",
|
|
841
|
-
|
|
841
|
+
Xt,
|
|
842
842
|
void 0,
|
|
843
843
|
["logic_if_else_if_v1", "logic_if_else_v1"]
|
|
844
844
|
);
|
|
@@ -984,7 +984,7 @@ s.forBlock.logic_operation_v1 = function(e) {
|
|
|
984
984
|
}
|
|
985
985
|
return [`${n} ${o} ${i}`, t];
|
|
986
986
|
};
|
|
987
|
-
const
|
|
987
|
+
const Wt = {
|
|
988
988
|
prevParentConnection_: null,
|
|
989
989
|
onchange: function(e) {
|
|
990
990
|
const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
|
|
@@ -999,7 +999,7 @@ const Gt = {
|
|
|
999
999
|
this.prevParentConnection_ = n;
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
|
-
f.registerMixin("logic_ternary_v1",
|
|
1002
|
+
f.registerMixin("logic_ternary_v1", Wt);
|
|
1003
1003
|
_([
|
|
1004
1004
|
{
|
|
1005
1005
|
type: "logic_ternary_v1",
|
|
@@ -1036,7 +1036,7 @@ s.forBlock.logic_ternary_v1 = function(e) {
|
|
|
1036
1036
|
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";
|
|
1037
1037
|
return [o + " ? " + t + " : " + n, l.CONDITIONAL];
|
|
1038
1038
|
};
|
|
1039
|
-
const
|
|
1039
|
+
const Jt = {
|
|
1040
1040
|
customContextMenu: function(e) {
|
|
1041
1041
|
if (this.isInFlyout)
|
|
1042
1042
|
return;
|
|
@@ -1058,7 +1058,7 @@ const $t = {
|
|
|
1058
1058
|
};
|
|
1059
1059
|
f.registerMixin(
|
|
1060
1060
|
"contextMenu_newGetVariableBlock_v1",
|
|
1061
|
-
|
|
1061
|
+
Jt
|
|
1062
1062
|
);
|
|
1063
1063
|
f.register(
|
|
1064
1064
|
"flow_control_tooltip_v1",
|
|
@@ -1067,16 +1067,16 @@ f.register(
|
|
|
1067
1067
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
1068
1068
|
})
|
|
1069
1069
|
);
|
|
1070
|
-
const
|
|
1070
|
+
const zt = /* @__PURE__ */ new Set([
|
|
1071
1071
|
"repeat_v1",
|
|
1072
1072
|
"for_each_v1",
|
|
1073
1073
|
"for_v1",
|
|
1074
1074
|
"while_until_v1"
|
|
1075
|
-
]),
|
|
1075
|
+
]), Qt = {
|
|
1076
1076
|
getSurroundLoop: function() {
|
|
1077
1077
|
let e = this;
|
|
1078
1078
|
do {
|
|
1079
|
-
if (
|
|
1079
|
+
if (zt.has(e.type))
|
|
1080
1080
|
return !0;
|
|
1081
1081
|
e = e == null ? void 0 : e.getSurroundParent();
|
|
1082
1082
|
} while (e);
|
|
@@ -1099,7 +1099,7 @@ const jt = /* @__PURE__ */ new Set([
|
|
|
1099
1099
|
};
|
|
1100
1100
|
f.registerMixin(
|
|
1101
1101
|
"flow_control_in_loop_check_v1",
|
|
1102
|
-
|
|
1102
|
+
Qt
|
|
1103
1103
|
);
|
|
1104
1104
|
_([
|
|
1105
1105
|
{
|
|
@@ -1264,7 +1264,7 @@ ${n}
|
|
|
1264
1264
|
}
|
|
1265
1265
|
`;
|
|
1266
1266
|
};
|
|
1267
|
-
const
|
|
1267
|
+
const qt = {
|
|
1268
1268
|
// math_arithmetic
|
|
1269
1269
|
ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
|
|
1270
1270
|
SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
|
|
@@ -1298,7 +1298,7 @@ const Wt = {
|
|
|
1298
1298
|
};
|
|
1299
1299
|
f.register(
|
|
1300
1300
|
"math_op_tooltip_v1",
|
|
1301
|
-
f.buildTooltipForDropdown("OP",
|
|
1301
|
+
f.buildTooltipForDropdown("OP", qt)
|
|
1302
1302
|
);
|
|
1303
1303
|
_([
|
|
1304
1304
|
{
|
|
@@ -1901,21 +1901,21 @@ s.forBlock.math_trig_v1 = function(e) {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
return [n, l.DIVISION];
|
|
1903
1903
|
};
|
|
1904
|
-
const
|
|
1904
|
+
const Zt = u.xml, eo = {
|
|
1905
1905
|
init: function() {
|
|
1906
1906
|
this.appendDummyInput().appendField(
|
|
1907
1907
|
"%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
|
|
1908
1908
|
), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1909
1909
|
}
|
|
1910
1910
|
};
|
|
1911
|
-
y.object_create_container_v1 =
|
|
1912
|
-
const
|
|
1911
|
+
y.object_create_container_v1 = eo;
|
|
1912
|
+
const to = {
|
|
1913
1913
|
init: function() {
|
|
1914
1914
|
this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1915
1915
|
}
|
|
1916
1916
|
};
|
|
1917
|
-
y.object_create_item_v1 =
|
|
1918
|
-
const
|
|
1917
|
+
y.object_create_item_v1 = to;
|
|
1918
|
+
const oo = {
|
|
1919
1919
|
init: function() {
|
|
1920
1920
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
1921
1921
|
new ie.MutatorIcon(
|
|
@@ -1925,7 +1925,7 @@ const qt = {
|
|
|
1925
1925
|
), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
|
|
1926
1926
|
},
|
|
1927
1927
|
mutationToDom: function() {
|
|
1928
|
-
const e =
|
|
1928
|
+
const e = Zt.createElement("mutation");
|
|
1929
1929
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
1930
1930
|
},
|
|
1931
1931
|
domToMutation: function(e) {
|
|
@@ -1990,12 +1990,12 @@ const qt = {
|
|
|
1990
1990
|
},
|
|
1991
1991
|
updateShape_: function() {
|
|
1992
1992
|
for (let e = 0; e < this.itemCount_; e++)
|
|
1993
|
-
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(
|
|
1993
|
+
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(U.Align.RIGHT).appendField(new fe("key"), "KEY" + e);
|
|
1994
1994
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
1995
1995
|
this.removeInput("ADD" + e);
|
|
1996
1996
|
}
|
|
1997
1997
|
};
|
|
1998
|
-
y.object_create_v1 =
|
|
1998
|
+
y.object_create_v1 = oo;
|
|
1999
1999
|
s.forBlock.object_create_v1 = function(e) {
|
|
2000
2000
|
const o = e;
|
|
2001
2001
|
let t = "{";
|
|
@@ -2253,13 +2253,13 @@ _([
|
|
|
2253
2253
|
s.forBlock.object_to_json_v1 = function(e) {
|
|
2254
2254
|
return [`__jsonStringifyV1__(${s.valueToCode(e, "OBJECT", l.NONE) || "null"})`, l.FUNCTION_CALL];
|
|
2255
2255
|
};
|
|
2256
|
-
const ke = u.xml,
|
|
2256
|
+
const ke = u.xml, no = {
|
|
2257
2257
|
init: function() {
|
|
2258
|
-
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new
|
|
2258
|
+
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new ft(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
2259
2259
|
}
|
|
2260
2260
|
};
|
|
2261
|
-
y.procedure_def_container_v1 =
|
|
2262
|
-
const
|
|
2261
|
+
y.procedure_def_container_v1 = no;
|
|
2262
|
+
const io = {
|
|
2263
2263
|
init: function() {
|
|
2264
2264
|
const e = new fe(Te.DEFAULT_ARG);
|
|
2265
2265
|
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;
|
|
@@ -2281,8 +2281,8 @@ const eo = {
|
|
|
2281
2281
|
return e;
|
|
2282
2282
|
}
|
|
2283
2283
|
};
|
|
2284
|
-
y.procedure_def_item_v1 =
|
|
2285
|
-
const
|
|
2284
|
+
y.procedure_def_item_v1 = io;
|
|
2285
|
+
const so = {
|
|
2286
2286
|
init: function() {
|
|
2287
2287
|
this.withReturn = !1, this.args = [];
|
|
2288
2288
|
const e = new fe(
|
|
@@ -2382,13 +2382,13 @@ const to = {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
}
|
|
2384
2384
|
};
|
|
2385
|
-
y.procedure_def_v1 =
|
|
2386
|
-
const
|
|
2385
|
+
y.procedure_def_v1 = so;
|
|
2386
|
+
const lo = u.xml, ao = {
|
|
2387
2387
|
init: function() {
|
|
2388
2388
|
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}");
|
|
2389
2389
|
},
|
|
2390
2390
|
mutationToDom: function() {
|
|
2391
|
-
const e =
|
|
2391
|
+
const e = lo.createElement("mutation");
|
|
2392
2392
|
return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
|
|
2393
2393
|
},
|
|
2394
2394
|
domToMutation: function(e) {
|
|
@@ -2439,7 +2439,7 @@ const oo = u.xml, no = {
|
|
|
2439
2439
|
e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
|
|
2440
2440
|
}
|
|
2441
2441
|
};
|
|
2442
|
-
y.procedure_return_v1 =
|
|
2442
|
+
y.procedure_return_v1 = ao;
|
|
2443
2443
|
s.forBlock.procedure_return_v1 = function(e) {
|
|
2444
2444
|
const o = e;
|
|
2445
2445
|
return o.withReturn ? `return ${s.valueToCode(o, "VALUE", l.NONE) || "null"};
|
|
@@ -2467,9 +2467,9 @@ _([
|
|
|
2467
2467
|
s.forBlock.text_v1 = function(e) {
|
|
2468
2468
|
return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
|
|
2469
2469
|
};
|
|
2470
|
-
const
|
|
2470
|
+
const ro = /^\s*'([^']|\\')*'\s*$/;
|
|
2471
2471
|
function ne(e) {
|
|
2472
|
-
return
|
|
2472
|
+
return ro.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
|
|
2473
2473
|
}
|
|
2474
2474
|
f.register(
|
|
2475
2475
|
"text_append_tooltip_v1",
|
|
@@ -2674,10 +2674,10 @@ _([
|
|
|
2674
2674
|
s.forBlock.text_is_empty_v1 = function(e) {
|
|
2675
2675
|
return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.LOGICAL_NOT];
|
|
2676
2676
|
};
|
|
2677
|
-
const
|
|
2677
|
+
const co = u.xml, _o = {
|
|
2678
2678
|
itemCount_: 0,
|
|
2679
2679
|
mutationToDom: function() {
|
|
2680
|
-
const e =
|
|
2680
|
+
const e = co.createElement("mutation");
|
|
2681
2681
|
return e.setAttribute("items", `${this.itemCount_}`), e;
|
|
2682
2682
|
},
|
|
2683
2683
|
domToMutation: function(e) {
|
|
@@ -2742,20 +2742,20 @@ const so = u.xml, lo = {
|
|
|
2742
2742
|
for (let e = 0; e < this.itemCount_; e++)
|
|
2743
2743
|
if (!this.getInput("ADD" + e)) {
|
|
2744
2744
|
const o = this.appendValueInput("ADD" + e).setAlign(
|
|
2745
|
-
|
|
2745
|
+
U.Align.RIGHT
|
|
2746
2746
|
);
|
|
2747
2747
|
e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
2748
2748
|
}
|
|
2749
2749
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
2750
2750
|
this.removeInput("ADD" + e);
|
|
2751
2751
|
}
|
|
2752
|
-
},
|
|
2752
|
+
}, uo = function() {
|
|
2753
2753
|
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ie.MutatorIcon(["text_join_item_v1"], this));
|
|
2754
2754
|
};
|
|
2755
2755
|
f.registerMutator(
|
|
2756
2756
|
"text_join_mutator_v1",
|
|
2757
|
-
|
|
2758
|
-
|
|
2757
|
+
_o,
|
|
2758
|
+
uo
|
|
2759
2759
|
);
|
|
2760
2760
|
_([
|
|
2761
2761
|
{
|
|
@@ -2987,7 +2987,7 @@ s.forBlock.text_trim_v1 = function(e) {
|
|
|
2987
2987
|
}[e.getFieldValue("MODE")];
|
|
2988
2988
|
return [`__trimV1__(${o}, ${n})`, l.ATOMIC];
|
|
2989
2989
|
};
|
|
2990
|
-
const
|
|
2990
|
+
const po = {
|
|
2991
2991
|
init: function() {
|
|
2992
2992
|
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}");
|
|
2993
2993
|
},
|
|
@@ -2998,7 +2998,7 @@ const ro = {
|
|
|
2998
2998
|
this.updateShape_(), this.updateShadow_();
|
|
2999
2999
|
},
|
|
3000
3000
|
updateShape_: function() {
|
|
3001
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
3001
|
+
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(U.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
|
|
3002
3002
|
},
|
|
3003
3003
|
updateShadow_: function() {
|
|
3004
3004
|
var e, o, t, n, i, a, r, c;
|
|
@@ -3013,7 +3013,7 @@ const ro = {
|
|
|
3013
3013
|
));
|
|
3014
3014
|
}
|
|
3015
3015
|
};
|
|
3016
|
-
y.create_timer_v1 =
|
|
3016
|
+
y.create_timer_v1 = po;
|
|
3017
3017
|
s.forBlock.create_timer_v1 = function(e) {
|
|
3018
3018
|
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");
|
|
3019
3019
|
return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
|
|
@@ -3043,18 +3043,18 @@ s.forBlock.delay_v1 = function(e) {
|
|
|
3043
3043
|
return `__delayV1__(${s.valueToCode(e, "MS", l.ATOMIC) || "0"});
|
|
3044
3044
|
`;
|
|
3045
3045
|
};
|
|
3046
|
-
const
|
|
3046
|
+
const To = {
|
|
3047
3047
|
customContextMenu: function(e) {
|
|
3048
3048
|
if (this.isInFlyout) {
|
|
3049
3049
|
if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
|
|
3050
3050
|
const o = {
|
|
3051
3051
|
text: m.RENAME_VARIABLE,
|
|
3052
3052
|
enabled: !0,
|
|
3053
|
-
callback:
|
|
3053
|
+
callback: fo(this)
|
|
3054
3054
|
}, t = this.getField("VAR").getText(), n = {
|
|
3055
3055
|
text: m.DELETE_VARIABLE.replace("%1", t),
|
|
3056
3056
|
enabled: !0,
|
|
3057
|
-
callback:
|
|
3057
|
+
callback: Eo(this)
|
|
3058
3058
|
};
|
|
3059
3059
|
e.unshift(o), e.unshift(n);
|
|
3060
3060
|
}
|
|
@@ -3072,12 +3072,12 @@ const co = {
|
|
|
3072
3072
|
});
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
3075
|
-
},
|
|
3075
|
+
}, fo = function(e) {
|
|
3076
3076
|
return function() {
|
|
3077
3077
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3078
3078
|
oe.renameVariable(o, n);
|
|
3079
3079
|
};
|
|
3080
|
-
},
|
|
3080
|
+
}, Eo = function(e) {
|
|
3081
3081
|
return function() {
|
|
3082
3082
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3083
3083
|
o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
|
|
@@ -3085,7 +3085,7 @@ const co = {
|
|
|
3085
3085
|
};
|
|
3086
3086
|
f.registerMixin(
|
|
3087
3087
|
"context_menu_variable_v1",
|
|
3088
|
-
|
|
3088
|
+
To
|
|
3089
3089
|
);
|
|
3090
3090
|
_([
|
|
3091
3091
|
{
|
|
@@ -3142,7 +3142,7 @@ s.forBlock.variable_set_v1 = function(e) {
|
|
|
3142
3142
|
`;
|
|
3143
3143
|
};
|
|
3144
3144
|
const Ne = u.xml;
|
|
3145
|
-
function
|
|
3145
|
+
function ho() {
|
|
3146
3146
|
const e = [];
|
|
3147
3147
|
{
|
|
3148
3148
|
const o = Ne.createElement("label");
|
|
@@ -3154,11 +3154,11 @@ function po() {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
return e;
|
|
3156
3156
|
}
|
|
3157
|
-
const
|
|
3157
|
+
const mo = {
|
|
3158
3158
|
name: "INTERFACE_CATEGORY",
|
|
3159
|
-
callback:
|
|
3159
|
+
callback: ho
|
|
3160
3160
|
}, $ = u.xml;
|
|
3161
|
-
function
|
|
3161
|
+
function Oo() {
|
|
3162
3162
|
const e = [];
|
|
3163
3163
|
{
|
|
3164
3164
|
const o = $.createElement("label");
|
|
@@ -3185,18 +3185,18 @@ function fo() {
|
|
|
3185
3185
|
}
|
|
3186
3186
|
const k = {
|
|
3187
3187
|
name: "PROCEDURE_CATEGORY",
|
|
3188
|
-
callback:
|
|
3188
|
+
callback: Oo
|
|
3189
3189
|
};
|
|
3190
|
-
function
|
|
3191
|
-
const { args: e } =
|
|
3190
|
+
function go() {
|
|
3191
|
+
const { args: e } = Pt.app.view, o = [];
|
|
3192
3192
|
return e == null || e.forEach(({ id: t, name: n, type: i }) => {
|
|
3193
3193
|
o.push({ id: t, name: n, type: i });
|
|
3194
3194
|
}), o;
|
|
3195
3195
|
}
|
|
3196
3196
|
const Be = u.xml;
|
|
3197
|
-
function
|
|
3197
|
+
function Io() {
|
|
3198
3198
|
const e = [];
|
|
3199
|
-
if (
|
|
3199
|
+
if (go().length > 0) {
|
|
3200
3200
|
{
|
|
3201
3201
|
const o = Be.createElement("label");
|
|
3202
3202
|
o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
|
|
@@ -3210,9 +3210,9 @@ function ho() {
|
|
|
3210
3210
|
}
|
|
3211
3211
|
const de = {
|
|
3212
3212
|
name: "UI_CATEGORY",
|
|
3213
|
-
callback:
|
|
3213
|
+
callback: Io
|
|
3214
3214
|
}, Z = u.xml;
|
|
3215
|
-
function
|
|
3215
|
+
function Lo(e) {
|
|
3216
3216
|
const o = [];
|
|
3217
3217
|
{
|
|
3218
3218
|
const n = Z.createElement("label");
|
|
@@ -3232,7 +3232,7 @@ function mo(e) {
|
|
|
3232
3232
|
const t = e.getVariablesOfType("");
|
|
3233
3233
|
if (t.length <= 0)
|
|
3234
3234
|
return o;
|
|
3235
|
-
t.sort(
|
|
3235
|
+
t.sort(Et.compareByName);
|
|
3236
3236
|
{
|
|
3237
3237
|
const n = Z.createElement("label");
|
|
3238
3238
|
n.setAttribute("text", m.LABEL_CREATED), o.push(n);
|
|
@@ -3250,17 +3250,17 @@ function mo(e) {
|
|
|
3250
3250
|
}
|
|
3251
3251
|
const N = {
|
|
3252
3252
|
name: "VARIABLE_CATEGORY",
|
|
3253
|
-
callback:
|
|
3253
|
+
callback: Lo
|
|
3254
3254
|
};
|
|
3255
3255
|
Ve.setConfirm(async (e, o) => {
|
|
3256
|
-
const t = await
|
|
3256
|
+
const t = await Ct({
|
|
3257
3257
|
title: "",
|
|
3258
3258
|
text: e
|
|
3259
3259
|
});
|
|
3260
3260
|
o(!!t);
|
|
3261
3261
|
});
|
|
3262
3262
|
Ve.setPrompt(async (e, o, t) => {
|
|
3263
|
-
const n = await
|
|
3263
|
+
const n = await vt({
|
|
3264
3264
|
title: "",
|
|
3265
3265
|
value: o
|
|
3266
3266
|
});
|
|
@@ -3281,7 +3281,7 @@ const Ke = (e, o, t) => {
|
|
|
3281
3281
|
};
|
|
3282
3282
|
async function Re(e) {
|
|
3283
3283
|
const o = await Ke(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
|
|
3284
|
-
|
|
3284
|
+
ht(o.default);
|
|
3285
3285
|
}
|
|
3286
3286
|
function Fe(e) {
|
|
3287
3287
|
const o = H();
|
|
@@ -3296,7 +3296,7 @@ function Fe(e) {
|
|
|
3296
3296
|
const i = n.getRelativeToSurfaceXY(), a = i.x * o.scale, r = i.y * o.scale;
|
|
3297
3297
|
o.scroll(-a, -r);
|
|
3298
3298
|
}
|
|
3299
|
-
function
|
|
3299
|
+
function yo() {
|
|
3300
3300
|
var t;
|
|
3301
3301
|
const e = H();
|
|
3302
3302
|
if (!e)
|
|
@@ -3304,7 +3304,7 @@ function Oo() {
|
|
|
3304
3304
|
const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
|
|
3305
3305
|
o && Fe(o.id);
|
|
3306
3306
|
}
|
|
3307
|
-
class
|
|
3307
|
+
class Co {
|
|
3308
3308
|
init({ contextMenu: o = !0, shortcut: t = !0 } = {
|
|
3309
3309
|
contextMenu: !0,
|
|
3310
3310
|
shortcut: !0
|
|
@@ -3333,11 +3333,11 @@ class go {
|
|
|
3333
3333
|
JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
|
|
3334
3334
|
);
|
|
3335
3335
|
},
|
|
3336
|
-
scopeType:
|
|
3336
|
+
scopeType: V.ScopeType.BLOCK,
|
|
3337
3337
|
id: "blockCopyToStorage",
|
|
3338
3338
|
weight: 0
|
|
3339
3339
|
};
|
|
3340
|
-
|
|
3340
|
+
V.registry.register(o);
|
|
3341
3341
|
}
|
|
3342
3342
|
blockPasteFromStorageContextMenu() {
|
|
3343
3343
|
const o = {
|
|
@@ -3359,11 +3359,11 @@ class go {
|
|
|
3359
3359
|
const i = JSON.parse(n);
|
|
3360
3360
|
i && t.workspace && ve.paste(i, t.workspace);
|
|
3361
3361
|
},
|
|
3362
|
-
scopeType:
|
|
3362
|
+
scopeType: V.ScopeType.WORKSPACE,
|
|
3363
3363
|
id: "blockPasteFromStorage",
|
|
3364
3364
|
weight: 0
|
|
3365
3365
|
};
|
|
3366
|
-
|
|
3366
|
+
V.registry.register(o);
|
|
3367
3367
|
}
|
|
3368
3368
|
blockCopyToStorageShortcut() {
|
|
3369
3369
|
const o = g.registry.createSerializedKey(
|
|
@@ -3419,7 +3419,7 @@ class go {
|
|
|
3419
3419
|
if (!c || !J(c) || !c.isDeletable() || !G(c))
|
|
3420
3420
|
return !1;
|
|
3421
3421
|
const p = c.toCopyData();
|
|
3422
|
-
return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof
|
|
3422
|
+
return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof mt ? c.checkAndDelete() : c.dispose(), !0) : !1;
|
|
3423
3423
|
},
|
|
3424
3424
|
keyCodes: [o, t, n]
|
|
3425
3425
|
};
|
|
@@ -3459,9 +3459,9 @@ class go {
|
|
|
3459
3459
|
g.registry.register(i);
|
|
3460
3460
|
}
|
|
3461
3461
|
}
|
|
3462
|
-
class
|
|
3462
|
+
class vo {
|
|
3463
3463
|
init() {
|
|
3464
|
-
const o =
|
|
3464
|
+
const o = V.registry.getItem("cleanWorkspace");
|
|
3465
3465
|
o && (o.callback = function(t) {
|
|
3466
3466
|
const n = t.workspace;
|
|
3467
3467
|
if (!n)
|
|
@@ -3483,9 +3483,9 @@ function He(e) {
|
|
|
3483
3483
|
const o = e.getParent();
|
|
3484
3484
|
return o && He(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
|
|
3485
3485
|
}
|
|
3486
|
-
class
|
|
3486
|
+
class Ao {
|
|
3487
3487
|
init() {
|
|
3488
|
-
const o =
|
|
3488
|
+
const o = V.registry.getItem("blockDisable");
|
|
3489
3489
|
o && (o.preconditionFn = function(t) {
|
|
3490
3490
|
const n = t.block;
|
|
3491
3491
|
return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || He(n) ? "disabled" : "enabled" : "hidden";
|
|
@@ -4310,7 +4310,7 @@ class we extends _e {
|
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
4312
4312
|
we.prototype.DEFAULT_VALUE = "#ffffff";
|
|
4313
|
-
|
|
4313
|
+
Ot.register(`
|
|
4314
4314
|
.blocklyColourTable {
|
|
4315
4315
|
border-collapse: collapse;
|
|
4316
4316
|
display: block;
|
|
@@ -4337,16 +4337,16 @@ ft.register(`
|
|
|
4337
4337
|
position: relative;
|
|
4338
4338
|
}
|
|
4339
4339
|
`);
|
|
4340
|
-
function
|
|
4341
|
-
|
|
4340
|
+
function bo() {
|
|
4341
|
+
gt.register("field_colour", we);
|
|
4342
4342
|
}
|
|
4343
|
-
const
|
|
4344
|
-
|
|
4345
|
-
const
|
|
4346
|
-
|
|
4347
|
-
const
|
|
4348
|
-
|
|
4349
|
-
|
|
4343
|
+
const ko = new Co();
|
|
4344
|
+
ko.init({ contextMenu: !0, shortcut: !0 });
|
|
4345
|
+
const No = new vo();
|
|
4346
|
+
No.init();
|
|
4347
|
+
const Bo = new Ao();
|
|
4348
|
+
Bo.init();
|
|
4349
|
+
bo();
|
|
4350
4350
|
se.Classic.blockStyles = {
|
|
4351
4351
|
color_blocks: {
|
|
4352
4352
|
colourPrimary: "#a5745b",
|
|
@@ -4471,7 +4471,7 @@ se.Classic.categoryStyles = {
|
|
|
4471
4471
|
colour: "#a55b80"
|
|
4472
4472
|
}
|
|
4473
4473
|
};
|
|
4474
|
-
const
|
|
4474
|
+
const Ro = Pe.defineTheme("light", {
|
|
4475
4475
|
name: "light",
|
|
4476
4476
|
base: se.Classic,
|
|
4477
4477
|
componentStyles: {
|
|
@@ -4487,7 +4487,7 @@ const bo = Pe.defineTheme("light", {
|
|
|
4487
4487
|
scrollbarOpacity: 0.4,
|
|
4488
4488
|
cursorColour: ""
|
|
4489
4489
|
}
|
|
4490
|
-
}),
|
|
4490
|
+
}), So = Pe.defineTheme("dark", {
|
|
4491
4491
|
name: "dark",
|
|
4492
4492
|
base: se.Classic,
|
|
4493
4493
|
componentStyles: {
|
|
@@ -4504,14 +4504,14 @@ const bo = Pe.defineTheme("light", {
|
|
|
4504
4504
|
cursorColour: ""
|
|
4505
4505
|
}
|
|
4506
4506
|
});
|
|
4507
|
-
function
|
|
4507
|
+
function Mo(e) {
|
|
4508
4508
|
const o = H();
|
|
4509
4509
|
switch (console.log(o), e) {
|
|
4510
4510
|
case "light":
|
|
4511
|
-
o.setTheme(
|
|
4511
|
+
o.setTheme(Ro);
|
|
4512
4512
|
break;
|
|
4513
4513
|
case "dark":
|
|
4514
|
-
o.setTheme(
|
|
4514
|
+
o.setTheme(So);
|
|
4515
4515
|
break;
|
|
4516
4516
|
}
|
|
4517
4517
|
}
|
|
@@ -5154,7 +5154,7 @@ const he = {
|
|
|
5154
5154
|
type: "text_reverse_v1"
|
|
5155
5155
|
}
|
|
5156
5156
|
]
|
|
5157
|
-
},
|
|
5157
|
+
}, Uo = {
|
|
5158
5158
|
kind: "category",
|
|
5159
5159
|
name: "%{BKY_CATEGORY_TIME}",
|
|
5160
5160
|
categorystyle: "time_category",
|
|
@@ -5178,7 +5178,7 @@ const he = {
|
|
|
5178
5178
|
}
|
|
5179
5179
|
}
|
|
5180
5180
|
]
|
|
5181
|
-
},
|
|
5181
|
+
}, Vo = {
|
|
5182
5182
|
kind: "categoryToolbox",
|
|
5183
5183
|
contents: [
|
|
5184
5184
|
{
|
|
@@ -5194,7 +5194,7 @@ const he = {
|
|
|
5194
5194
|
me,
|
|
5195
5195
|
Le,
|
|
5196
5196
|
he,
|
|
5197
|
-
|
|
5197
|
+
Uo,
|
|
5198
5198
|
{
|
|
5199
5199
|
kind: "category",
|
|
5200
5200
|
name: "%{BKY_CATEGORY_VARIABLE}",
|
|
@@ -5211,10 +5211,10 @@ const he = {
|
|
|
5211
5211
|
kind: "category",
|
|
5212
5212
|
name: "%{BKY_CATEGORY_INTERFACE}",
|
|
5213
5213
|
categorystyle: "interface_category",
|
|
5214
|
-
custom:
|
|
5214
|
+
custom: mo.name
|
|
5215
5215
|
}
|
|
5216
5216
|
]
|
|
5217
|
-
},
|
|
5217
|
+
}, Po = {
|
|
5218
5218
|
kind: "categoryToolbox",
|
|
5219
5219
|
contents: [
|
|
5220
5220
|
ge,
|
|
@@ -5237,7 +5237,7 @@ const he = {
|
|
|
5237
5237
|
custom: k.name
|
|
5238
5238
|
}
|
|
5239
5239
|
]
|
|
5240
|
-
},
|
|
5240
|
+
}, xo = {
|
|
5241
5241
|
kind: "categoryToolbox",
|
|
5242
5242
|
contents: [
|
|
5243
5243
|
ge,
|
|
@@ -5260,28 +5260,28 @@ const he = {
|
|
|
5260
5260
|
custom: k.name
|
|
5261
5261
|
}
|
|
5262
5262
|
]
|
|
5263
|
-
},
|
|
5263
|
+
}, Do = /* @__PURE__ */ X({
|
|
5264
5264
|
__name: "index",
|
|
5265
5265
|
setup(e) {
|
|
5266
5266
|
const o = () => {
|
|
5267
5267
|
const t = H();
|
|
5268
5268
|
if (!t)
|
|
5269
5269
|
return;
|
|
5270
|
-
const n =
|
|
5270
|
+
const n = V.registry.getItem("cleanWorkspace");
|
|
5271
5271
|
n && n.callback({ workspace: t }, new PointerEvent("dummy"));
|
|
5272
5272
|
};
|
|
5273
5273
|
return (t, n) => {
|
|
5274
5274
|
const i = C("v-btn");
|
|
5275
|
-
return L(),
|
|
5275
|
+
return L(), P(i, {
|
|
5276
5276
|
class: "mr-3",
|
|
5277
5277
|
variant: "outlined",
|
|
5278
5278
|
density: "comfortable",
|
|
5279
|
-
icon: A(
|
|
5279
|
+
icon: A(Bt),
|
|
5280
5280
|
onClick: o
|
|
5281
5281
|
}, null, 8, ["icon"]);
|
|
5282
5282
|
};
|
|
5283
5283
|
}
|
|
5284
|
-
}),
|
|
5284
|
+
}), Yo = /* @__PURE__ */ X({
|
|
5285
5285
|
__name: "index",
|
|
5286
5286
|
props: {
|
|
5287
5287
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -5292,19 +5292,19 @@ const he = {
|
|
|
5292
5292
|
const o = ue(e, "modelValue");
|
|
5293
5293
|
return (t, n) => {
|
|
5294
5294
|
const i = C("v-btn");
|
|
5295
|
-
return L(),
|
|
5295
|
+
return L(), P(i, {
|
|
5296
5296
|
class: "mr-3",
|
|
5297
5297
|
variant: "outlined",
|
|
5298
5298
|
density: "comfortable",
|
|
5299
|
-
icon: o.value ? A(
|
|
5299
|
+
icon: o.value ? A(Mt) : A(Ut),
|
|
5300
5300
|
onClick: n[0] || (n[0] = (a) => o.value = !o.value)
|
|
5301
5301
|
}, null, 8, ["icon"]);
|
|
5302
5302
|
};
|
|
5303
5303
|
}
|
|
5304
|
-
}),
|
|
5304
|
+
}), Ko = {
|
|
5305
5305
|
key: 1,
|
|
5306
5306
|
class: "text-caption text-grey"
|
|
5307
|
-
},
|
|
5307
|
+
}, Fo = /* @__PURE__ */ X({
|
|
5308
5308
|
__name: "index",
|
|
5309
5309
|
setup(e) {
|
|
5310
5310
|
const { t: o } = De(), t = ee([]), n = () => {
|
|
@@ -5335,7 +5335,7 @@ const he = {
|
|
|
5335
5335
|
};
|
|
5336
5336
|
Me(() => {
|
|
5337
5337
|
be.on("codeUpdate", n);
|
|
5338
|
-
}),
|
|
5338
|
+
}), it(() => {
|
|
5339
5339
|
be.off("codeUpdate", n);
|
|
5340
5340
|
});
|
|
5341
5341
|
const i = (a) => {
|
|
@@ -5347,9 +5347,9 @@ const he = {
|
|
|
5347
5347
|
};
|
|
5348
5348
|
return (a, r) => {
|
|
5349
5349
|
const c = C("v-list-item-title"), p = C("v-list-item"), O = C("v-list");
|
|
5350
|
-
return t.value.length > 0 ? (L(),
|
|
5350
|
+
return t.value.length > 0 ? (L(), P(O, { key: 0 }, {
|
|
5351
5351
|
default: Y(() => [
|
|
5352
|
-
(L(!0), j(
|
|
5352
|
+
(L(!0), j(st, null, lt(t.value, (T) => (L(), P(p, {
|
|
5353
5353
|
key: T.id,
|
|
5354
5354
|
class: "d-flex justify-start",
|
|
5355
5355
|
active: T.active,
|
|
@@ -5358,7 +5358,7 @@ const he = {
|
|
|
5358
5358
|
default: Y(() => [
|
|
5359
5359
|
B(c, null, {
|
|
5360
5360
|
default: Y(() => [
|
|
5361
|
-
|
|
5361
|
+
at(pe(T.name), 1)
|
|
5362
5362
|
]),
|
|
5363
5363
|
_: 2
|
|
5364
5364
|
}, 1024)
|
|
@@ -5367,13 +5367,13 @@ const he = {
|
|
|
5367
5367
|
}, 1032, ["active", "onClick"]))), 128))
|
|
5368
5368
|
]),
|
|
5369
5369
|
_: 1
|
|
5370
|
-
})) : (L(), j("span",
|
|
5370
|
+
})) : (L(), j("span", Ko, pe(A(o)("x-block-lib.noOption")), 1));
|
|
5371
5371
|
};
|
|
5372
5372
|
}
|
|
5373
|
-
}),
|
|
5373
|
+
}), Ho = { class: "text-subtitle-1 ml-3" }, wo = /* @__PURE__ */ X({
|
|
5374
5374
|
__name: "index",
|
|
5375
5375
|
setup(e) {
|
|
5376
|
-
const { t: o } = De(), t =
|
|
5376
|
+
const { t: o } = De(), t = Nt(), { sysBarAvail: n } = At(), { backgroundColor1: i } = bt(), a = K(() => {
|
|
5377
5377
|
let O = "100%";
|
|
5378
5378
|
return t.mdAndUp.value && (O = "400px"), {
|
|
5379
5379
|
background: i.value,
|
|
@@ -5391,34 +5391,34 @@ const he = {
|
|
|
5391
5391
|
height: "60px"
|
|
5392
5392
|
})), { open: p } = xe("selectNodeDlg");
|
|
5393
5393
|
return (O, T) => {
|
|
5394
|
-
const I = C("v-btn"), d = C("v-sheet"),
|
|
5395
|
-
return L(),
|
|
5394
|
+
const I = C("v-btn"), d = C("v-sheet"), S = C("v-icon"), w = C("v-dialog");
|
|
5395
|
+
return L(), P(w, {
|
|
5396
5396
|
modelValue: A(p),
|
|
5397
|
-
"onUpdate:modelValue": T[3] || (T[3] = (b) =>
|
|
5397
|
+
"onUpdate:modelValue": T[3] || (T[3] = (b) => rt(p) ? p.value = b : null),
|
|
5398
5398
|
transition: "scroll-x-reverse-transition",
|
|
5399
5399
|
persistent: "",
|
|
5400
5400
|
"no-click-animation": "",
|
|
5401
5401
|
fullscreen: "",
|
|
5402
|
-
onKeydown: T[4] || (T[4] =
|
|
5402
|
+
onKeydown: T[4] || (T[4] = ct(le((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
5403
5403
|
}, {
|
|
5404
5404
|
activator: Y(({ props: b }) => [
|
|
5405
|
-
B(I,
|
|
5405
|
+
B(I, _t(b, {
|
|
5406
5406
|
variant: "outlined",
|
|
5407
5407
|
density: "comfortable",
|
|
5408
|
-
icon: A(
|
|
5408
|
+
icon: A(Vt)
|
|
5409
5409
|
}), null, 16, ["icon"])
|
|
5410
5410
|
]),
|
|
5411
5411
|
default: Y(() => [
|
|
5412
|
-
|
|
5412
|
+
M("div", {
|
|
5413
5413
|
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
5414
5414
|
onClick: T[1] || (T[1] = le((b) => p.value = !1, ["self"])),
|
|
5415
5415
|
onContextmenu: T[2] || (T[2] = le((b) => p.value = !1, ["self", "prevent"]))
|
|
5416
5416
|
}, [
|
|
5417
|
-
|
|
5417
|
+
M("div", {
|
|
5418
5418
|
class: "elevation-2",
|
|
5419
5419
|
style: F(a.value)
|
|
5420
5420
|
}, [
|
|
5421
|
-
A(n) ? (L(),
|
|
5421
|
+
A(n) ? (L(), P(d, {
|
|
5422
5422
|
key: 0,
|
|
5423
5423
|
color: "transparent",
|
|
5424
5424
|
height: 24
|
|
@@ -5429,20 +5429,20 @@ const he = {
|
|
|
5429
5429
|
height: 48
|
|
5430
5430
|
}, {
|
|
5431
5431
|
default: Y(() => [
|
|
5432
|
-
B(
|
|
5433
|
-
icon: A(
|
|
5432
|
+
B(S, {
|
|
5433
|
+
icon: A(Rt),
|
|
5434
5434
|
onClick: T[0] || (T[0] = (b) => p.value = !1)
|
|
5435
5435
|
}, null, 8, ["icon"]),
|
|
5436
|
-
|
|
5436
|
+
M("span", Ho, pe(A(o)("x-block-lib.navigator")), 1)
|
|
5437
5437
|
]),
|
|
5438
5438
|
_: 1
|
|
5439
5439
|
}),
|
|
5440
|
-
|
|
5440
|
+
M("div", {
|
|
5441
5441
|
class: "overflow-y-auto",
|
|
5442
5442
|
style: F(r.value)
|
|
5443
5443
|
}, [
|
|
5444
|
-
B(
|
|
5445
|
-
|
|
5444
|
+
B(Fo),
|
|
5445
|
+
M("div", {
|
|
5446
5446
|
style: F(c.value)
|
|
5447
5447
|
}, null, 4)
|
|
5448
5448
|
], 4)
|
|
@@ -5476,10 +5476,10 @@ const he = {
|
|
|
5476
5476
|
wheel: !0
|
|
5477
5477
|
}
|
|
5478
5478
|
};
|
|
5479
|
-
function
|
|
5479
|
+
function Go(e, o, t) {
|
|
5480
5480
|
let n;
|
|
5481
|
-
o === "app" ? t === "v1" && (n =
|
|
5482
|
-
const i =
|
|
5481
|
+
o === "app" ? t === "v1" && (n = Vo) : o === "func" ? t === "v1" && (n = xo) : o === "flow" && t === "v1" && (n = Po), console.assert(!!n), Se.toolbox = n;
|
|
5482
|
+
const i = It(e, Se);
|
|
5483
5483
|
return o === "app" ? t === "v1" && (i.registerToolboxCategoryCallback(
|
|
5484
5484
|
de.name,
|
|
5485
5485
|
de.callback
|
|
@@ -5503,7 +5503,7 @@ function Ko(e, o, t) {
|
|
|
5503
5503
|
N.callback
|
|
5504
5504
|
)), i;
|
|
5505
5505
|
}
|
|
5506
|
-
const
|
|
5506
|
+
const $o = { class: "position-relative w-100 h-100" }, jo = /* @__PURE__ */ X({
|
|
5507
5507
|
__name: "index",
|
|
5508
5508
|
props: /* @__PURE__ */ Ce({
|
|
5509
5509
|
type: {},
|
|
@@ -5516,9 +5516,9 @@ const Fo = { class: "position-relative w-100 h-100" }, Ho = /* @__PURE__ */ X({
|
|
|
5516
5516
|
}),
|
|
5517
5517
|
emits: /* @__PURE__ */ Ce(["ready", "change"], ["update:lock", "update:scale"]),
|
|
5518
5518
|
setup(e, { expose: o, emit: t }) {
|
|
5519
|
-
const n =
|
|
5519
|
+
const n = kt(), { locale: i, dark: a } = yt(n), { open: r } = xe("blocklyEditorFlyout"), c = ue(e, "lock"), p = ue(e, "scale"), O = e, T = t, I = ee();
|
|
5520
5520
|
let d;
|
|
5521
|
-
const
|
|
5521
|
+
const S = ee(!1), w = ee(!1), b = K(() => ({
|
|
5522
5522
|
position: "absolute",
|
|
5523
5523
|
background: a.value ? "#0000007f" : "#ffffff7f",
|
|
5524
5524
|
top: "1px",
|
|
@@ -5540,29 +5540,29 @@ const Fo = { class: "position-relative w-100 h-100" }, Ho = /* @__PURE__ */ X({
|
|
|
5540
5540
|
top: "0px",
|
|
5541
5541
|
right: "0px",
|
|
5542
5542
|
zIndex: 20
|
|
5543
|
-
}))
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5543
|
+
})), je = () => {
|
|
5544
|
+
console.log("blockly resize"), d == null || d.resize();
|
|
5545
|
+
}, Xe = (h) => {
|
|
5546
|
+
console.log("blockly load"), S.value = !0, Ae.workspaces.load(h, d);
|
|
5547
|
+
}, We = () => (console.log("blockly save"), Ae.workspaces.save(d)), Je = () => (console.log("blockly generateCode"), s.workspaceToCode(d));
|
|
5548
|
+
Me(async () => {
|
|
5549
5549
|
if (!I.value) {
|
|
5550
5550
|
console.assert(!1);
|
|
5551
5551
|
return;
|
|
5552
5552
|
}
|
|
5553
|
-
await Re(i.value), d =
|
|
5554
|
-
}),
|
|
5553
|
+
await Re(i.value), d = Go(I.value, O.type, O.version), d.addChangeListener(E.disableOrphans), d.addChangeListener(Qe), d.setScale(p.value), T("ready");
|
|
5554
|
+
}), ut(() => {
|
|
5555
5555
|
r.value = !1;
|
|
5556
5556
|
});
|
|
5557
|
-
function
|
|
5558
|
-
d &&
|
|
5557
|
+
function ze() {
|
|
5558
|
+
d && Lt(d);
|
|
5559
5559
|
}
|
|
5560
|
-
function
|
|
5560
|
+
function Qe(h) {
|
|
5561
5561
|
if (h.type === E.FINISHED_LOADING) {
|
|
5562
|
-
|
|
5562
|
+
yo(), S.value = !1;
|
|
5563
5563
|
return;
|
|
5564
5564
|
}
|
|
5565
|
-
if (!
|
|
5565
|
+
if (!S.value) {
|
|
5566
5566
|
if (h.type === E.VIEWPORT_CHANGE) {
|
|
5567
5567
|
p.value = d.getScale();
|
|
5568
5568
|
return;
|
|
@@ -5573,30 +5573,30 @@ const Fo = { class: "position-relative w-100 h-100" }, Ho = /* @__PURE__ */ X({
|
|
|
5573
5573
|
return W(i, (h) => {
|
|
5574
5574
|
Re(h);
|
|
5575
5575
|
}), W(a, (h) => {
|
|
5576
|
-
|
|
5576
|
+
Mo(h ? "dark" : "light");
|
|
5577
5577
|
}), W(r, (h) => {
|
|
5578
5578
|
var R;
|
|
5579
5579
|
h || (R = d.getToolbox()) == null || R.clearSelection();
|
|
5580
5580
|
}), W(p, (h) => {
|
|
5581
5581
|
d.setScale(h);
|
|
5582
|
-
}), (h, R) => {
|
|
5583
|
-
const
|
|
5584
|
-
return L(), j("div",
|
|
5585
|
-
|
|
5582
|
+
}), o({ loading: S, resize: je, load: Xe, save: We, generateCode: Je }), (h, R) => {
|
|
5583
|
+
const qe = C("v-icon"), Ze = C("x-loading"), et = pt("resize");
|
|
5584
|
+
return L(), j("div", $o, [
|
|
5585
|
+
Tt(M("div", {
|
|
5586
5586
|
id: "blocklyEditor",
|
|
5587
5587
|
ref_key: "blocklyDiv",
|
|
5588
5588
|
ref: I,
|
|
5589
5589
|
class: "w-100 h-100"
|
|
5590
5590
|
}, null, 512), [
|
|
5591
|
-
[
|
|
5591
|
+
[et, ze]
|
|
5592
5592
|
]),
|
|
5593
5593
|
w.value ? (L(), j("div", {
|
|
5594
5594
|
key: 0,
|
|
5595
5595
|
class: "d-flex flex-column align-center justify-center",
|
|
5596
5596
|
style: F(b.value)
|
|
5597
5597
|
}, [
|
|
5598
|
-
B(
|
|
5599
|
-
icon: A(
|
|
5598
|
+
B(qe, {
|
|
5599
|
+
icon: A(St),
|
|
5600
5600
|
size: "x-large"
|
|
5601
5601
|
}, null, 8, ["icon"])
|
|
5602
5602
|
], 4)) : te("", !0),
|
|
@@ -5604,34 +5604,34 @@ const Fo = { class: "position-relative w-100 h-100" }, Ho = /* @__PURE__ */ X({
|
|
|
5604
5604
|
key: 1,
|
|
5605
5605
|
style: F(Ge.value)
|
|
5606
5606
|
}, null, 4)) : te("", !0),
|
|
5607
|
-
|
|
5607
|
+
M("div", {
|
|
5608
5608
|
class: "d-flex align-end pt-3 pr-3",
|
|
5609
5609
|
style: F($e.value)
|
|
5610
5610
|
}, [
|
|
5611
|
-
B(
|
|
5612
|
-
B(
|
|
5611
|
+
B(Do),
|
|
5612
|
+
B(Yo, {
|
|
5613
5613
|
modelValue: c.value,
|
|
5614
|
-
"onUpdate:modelValue": R[0] || (R[0] = (
|
|
5614
|
+
"onUpdate:modelValue": R[0] || (R[0] = (tt) => c.value = tt)
|
|
5615
5615
|
}, null, 8, ["modelValue"]),
|
|
5616
|
-
B(
|
|
5616
|
+
B(wo)
|
|
5617
5617
|
], 4),
|
|
5618
|
-
|
|
5618
|
+
S.value ? (L(), P(Ze, {
|
|
5619
5619
|
key: 2,
|
|
5620
5620
|
"z-index": 99
|
|
5621
5621
|
})) : te("", !0)
|
|
5622
5622
|
]);
|
|
5623
5623
|
};
|
|
5624
5624
|
}
|
|
5625
|
-
}),
|
|
5626
|
-
e.component("XBlockly",
|
|
5625
|
+
}), Xo = (e) => {
|
|
5626
|
+
e.component("XBlockly", jo);
|
|
5627
5627
|
};
|
|
5628
5628
|
async function tn(e) {
|
|
5629
5629
|
return (await Ke(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en-hf8d9jpk.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans-kicfou8k.js") }), `./locales/${e}/index.ts`, 4)).default;
|
|
5630
5630
|
}
|
|
5631
|
-
const on = { install:
|
|
5631
|
+
const on = { install: Xo };
|
|
5632
5632
|
export {
|
|
5633
|
-
|
|
5633
|
+
jo as XBlockly,
|
|
5634
5634
|
on as default,
|
|
5635
|
-
|
|
5635
|
+
Xo as install,
|
|
5636
5636
|
tn as loadLocaleMessageBlock
|
|
5637
5637
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.13",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"vue": "^3.5.12",
|
|
32
32
|
"vuetify": "^3.7.3",
|
|
33
33
|
"x-essential-lib": "^0.7.3",
|
|
34
|
-
"x-runtime-lib": "^0.4.
|
|
34
|
+
"x-runtime-lib": "^0.4.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@eslint/js": "^10.0.0",
|