x-block-lib 0.4.13 → 0.4.14

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.
Files changed (2) hide show
  1. package/dist/index.js +206 -216
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,13 +2,13 @@
2
2
  var ot = Object.defineProperty;
3
3
  var nt = (e, o, t) => o in e ? ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
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";
5
+ import { defineComponent as X, resolveComponent as C, openBlock as I, createBlock as P, unref as A, useModel as _e, ref as ue, 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 se, mergeProps as _t, createElementVNode as M, normalizeStyle as F, createCommentVNode as ee, mergeModels as Ce, useTemplateRef as ut, onBeforeUnmount as pt, watch as W, resolveDirective as Tt, withDirectives as dt } from "vue";
6
+ import { d as _, j as s, O as l, u, X as ft, B as L, E, M as m, i as ne, a as U, b as f, C as Ue, F as fe, c as Et, P as Te, N as Ee, V as te, e as ht, f as Ve, s as mt, g as H, S as g, h as le, k as D, l as J, m as ae, n as G, o as V, p as ve, G as re, q as Ot, r as gt, t as ce, U as z, D as Q, v as x, w as It, T as ie, x as Pe, y as Lt, z as Ae, A as yt } from "./blockly-d7r2qvsx.js";
7
+ import { storeToRefs as Ct } from "pinia";
8
+ import { openConfirmDlg as vt, openPromptDlg as At, eventBus as be, useSystem as bt, useColor as kt, useViewStack as xe, useGlobalStore as Nt } from "x-essential-lib";
9
+ import { useDisplay as Bt } from "vuetify";
10
10
  import { useI18n as De } from "vue-i18n";
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";
11
+ var Rt = "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", St = "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", Mt = "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", Vt = "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", Pt = "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 Pt = function() {
154
+ const xt = 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 = dt.domToWorkspace(i, e);
200
+ const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ft.domToWorkspace(i, e);
201
201
  return e.getBlockById(a[0]);
202
202
  }
203
- const xt = u.xml, Dt = [
203
+ const Dt = u.xml, Yt = [
204
204
  {
205
205
  type: "call_func_v1",
206
206
  prefixInputs: ["OUTPUT"]
@@ -230,17 +230,17 @@ const xt = u.xml, Dt = [
230
230
  prefixInputs: ["ARG"]
231
231
  }
232
232
  ];
233
- function Yt(e, o) {
233
+ function Kt(e, o) {
234
234
  var n, i;
235
- const t = Dt.find((a) => a.type === e);
235
+ const t = Yt.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 Kt = {
238
+ const Ft = {
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 = xt.createElement("mutation");
243
+ const e = Dt.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 Kt = {
269
269
  tryDuplicate_: function(e) {
270
270
  var t;
271
271
  const o = this.workspace.getBlockById(e.oldParentId);
272
- if (o && Yt(o.type, e.oldInputName))
272
+ if (o && Kt(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,33 +285,33 @@ const Kt = {
285
285
  this.name ? this.setFieldValue(m[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
286
286
  }
287
287
  };
288
- y.parameter_v1 = Kt;
288
+ L.parameter_v1 = Ft;
289
289
  s.forBlock.parameter_v1 = function(e) {
290
290
  return [e.key, l.ATOMIC];
291
291
  };
292
- const Ft = u.xml, Ht = {
292
+ const Ht = u.xml, wt = {
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 = Ht;
298
- const wt = {
297
+ L.list_create_container_v1 = wt;
298
+ const Gt = {
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 = wt;
304
- const Gt = {
303
+ L.list_create_item_v1 = Gt;
304
+ const $t = {
305
305
  init: function() {
306
306
  this.itemCount_ = 0, this.setMutator(
307
- new ie.MutatorIcon(
307
+ new ne.MutatorIcon(
308
308
  ["list_create_item_v1"],
309
309
  this
310
310
  )
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 = Ft.createElement("mutation");
314
+ const e = Ht.createElement("mutation");
315
315
  return e.setAttribute("items", String(this.itemCount_)), e;
316
316
  },
317
317
  domToMutation: function(e) {
@@ -385,7 +385,7 @@ const Gt = {
385
385
  this.removeInput("ADD" + e);
386
386
  }
387
387
  };
388
- y.list_create_v1 = Gt;
388
+ L.list_create_v1 = $t;
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 $t = {
604
+ const jt = {
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 $t = {
615
615
  };
616
616
  f.register(
617
617
  "logic_op_tooltip_v1",
618
- f.buildTooltipForDropdown("OP", $t)
618
+ f.buildTooltipForDropdown("OP", jt)
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 jt = {
643
+ const Xt = {
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 jt = {
660
660
  f.register(
661
661
  "logic_compare_v1",
662
662
  function() {
663
- this.mixin(jt);
663
+ this.mixin(Xt);
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 Xt = {
713
+ const Wt = {
714
714
  elseIfCount_: 0,
715
715
  hasElse_: !1,
716
716
  mutationToDom: function() {
@@ -838,7 +838,7 @@ const Xt = {
838
838
  };
839
839
  f.registerMutator(
840
840
  "logic_if_v1_mutator",
841
- Xt,
841
+ Wt,
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 Wt = {
987
+ const Jt = {
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 Wt = {
999
999
  this.prevParentConnection_ = n;
1000
1000
  }
1001
1001
  };
1002
- f.registerMixin("logic_ternary_v1", Wt);
1002
+ f.registerMixin("logic_ternary_v1", Jt);
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 Jt = {
1039
+ const zt = {
1040
1040
  customContextMenu: function(e) {
1041
1041
  if (this.isInFlyout)
1042
1042
  return;
@@ -1058,7 +1058,7 @@ const Jt = {
1058
1058
  };
1059
1059
  f.registerMixin(
1060
1060
  "contextMenu_newGetVariableBlock_v1",
1061
- Jt
1061
+ zt
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 zt = /* @__PURE__ */ new Set([
1070
+ const Qt = /* @__PURE__ */ new Set([
1071
1071
  "repeat_v1",
1072
1072
  "for_each_v1",
1073
1073
  "for_v1",
1074
1074
  "while_until_v1"
1075
- ]), Qt = {
1075
+ ]), qt = {
1076
1076
  getSurroundLoop: function() {
1077
1077
  let e = this;
1078
1078
  do {
1079
- if (zt.has(e.type))
1079
+ if (Qt.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 zt = /* @__PURE__ */ new Set([
1099
1099
  };
1100
1100
  f.registerMixin(
1101
1101
  "flow_control_in_loop_check_v1",
1102
- Qt
1102
+ qt
1103
1103
  );
1104
1104
  _([
1105
1105
  {
@@ -1264,7 +1264,7 @@ ${n}
1264
1264
  }
1265
1265
  `;
1266
1266
  };
1267
- const qt = {
1267
+ const Zt = {
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 qt = {
1298
1298
  };
1299
1299
  f.register(
1300
1300
  "math_op_tooltip_v1",
1301
- f.buildTooltipForDropdown("OP", qt)
1301
+ f.buildTooltipForDropdown("OP", Zt)
1302
1302
  );
1303
1303
  _([
1304
1304
  {
@@ -1901,31 +1901,31 @@ s.forBlock.math_trig_v1 = function(e) {
1901
1901
  }
1902
1902
  return [n, l.DIVISION];
1903
1903
  };
1904
- const Zt = u.xml, eo = {
1904
+ const eo = u.xml, to = {
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 = eo;
1912
- const to = {
1911
+ L.object_create_container_v1 = to;
1912
+ const oo = {
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 = to;
1918
- const oo = {
1917
+ L.object_create_item_v1 = oo;
1918
+ const no = {
1919
1919
  init: function() {
1920
1920
  this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
1921
- new ie.MutatorIcon(
1921
+ new ne.MutatorIcon(
1922
1922
  ["object_create_item_v1"],
1923
1923
  this
1924
1924
  )
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 = Zt.createElement("mutation");
1928
+ const e = eo.createElement("mutation");
1929
1929
  return e.setAttribute("items", String(this.itemCount_)), e;
1930
1930
  },
1931
1931
  domToMutation: function(e) {
@@ -1995,7 +1995,7 @@ const oo = {
1995
1995
  this.removeInput("ADD" + e);
1996
1996
  }
1997
1997
  };
1998
- y.object_create_v1 = oo;
1998
+ L.object_create_v1 = no;
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, no = {
2256
+ const ke = u.xml, io = {
2257
2257
  init: function() {
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;
2258
+ this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new Et(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2259
2259
  }
2260
2260
  };
2261
- y.procedure_def_container_v1 = no;
2262
- const io = {
2261
+ L.procedure_def_container_v1 = io;
2262
+ const so = {
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,15 +2281,15 @@ const io = {
2281
2281
  return e;
2282
2282
  }
2283
2283
  };
2284
- y.procedure_def_item_v1 = io;
2285
- const so = {
2284
+ L.procedure_def_item_v1 = so;
2285
+ const lo = {
2286
2286
  init: function() {
2287
2287
  this.withReturn = !1, this.args = [];
2288
2288
  const e = new fe(
2289
2289
  Te.findLegalName("", this)
2290
2290
  );
2291
2291
  e.setValidator(Te.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2292
- new ie.MutatorIcon(
2292
+ new ne.MutatorIcon(
2293
2293
  ["procedure_def_item_v1"],
2294
2294
  this
2295
2295
  )
@@ -2382,13 +2382,13 @@ const so = {
2382
2382
  }
2383
2383
  }
2384
2384
  };
2385
- y.procedure_def_v1 = so;
2386
- const lo = u.xml, ao = {
2385
+ L.procedure_def_v1 = lo;
2386
+ const ao = u.xml, ro = {
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 = lo.createElement("mutation");
2391
+ const e = ao.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 lo = u.xml, ao = {
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 = ao;
2442
+ L.procedure_return_v1 = ro;
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 ro = /^\s*'([^']|\\')*'\s*$/;
2471
- function ne(e) {
2472
- return ro.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2470
+ const co = /^\s*'([^']|\\')*'\s*$/;
2471
+ function oe(e) {
2472
+ return co.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2473
2473
  }
2474
2474
  f.register(
2475
2475
  "text_append_tooltip_v1",
@@ -2505,7 +2505,7 @@ s.forBlock.text_append_v1 = function(e) {
2505
2505
  e.getFieldValue("VAR"),
2506
2506
  Ee.NameType.VARIABLE
2507
2507
  ), t = s.valueToCode(e, "TEXT", l.NONE) || "''";
2508
- return `${o} += ${ne(t)};
2508
+ return `${o} += ${oe(t)};
2509
2509
  `;
2510
2510
  };
2511
2511
  _([
@@ -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 co = u.xml, _o = {
2677
+ const _o = u.xml, uo = {
2678
2678
  itemCount_: 0,
2679
2679
  mutationToDom: function() {
2680
- const e = co.createElement("mutation");
2680
+ const e = _o.createElement("mutation");
2681
2681
  return e.setAttribute("items", `${this.itemCount_}`), e;
2682
2682
  },
2683
2683
  domToMutation: function(e) {
@@ -2749,13 +2749,13 @@ const co = u.xml, _o = {
2749
2749
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
2750
2750
  this.removeInput("ADD" + e);
2751
2751
  }
2752
- }, uo = function() {
2753
- this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ie.MutatorIcon(["text_join_item_v1"], this));
2752
+ }, po = function() {
2753
+ this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ne.MutatorIcon(["text_join_item_v1"], this));
2754
2754
  };
2755
2755
  f.registerMutator(
2756
2756
  "text_join_mutator_v1",
2757
- _o,
2758
- uo
2757
+ uo,
2758
+ po
2759
2759
  );
2760
2760
  _([
2761
2761
  {
@@ -2798,11 +2798,11 @@ s.forBlock.text_join_v1 = function(e) {
2798
2798
  return ["''", l.ATOMIC];
2799
2799
  case 1: {
2800
2800
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''";
2801
- return ne(t);
2801
+ return oe(t);
2802
2802
  }
2803
2803
  case 2: {
2804
2804
  const t = s.valueToCode(o, "ADD0", l.NONE) || "''", n = s.valueToCode(o, "ADD1", l.NONE) || "''";
2805
- return [ne(t)[0] + " + " + ne(n)[0], l.ADDITION];
2805
+ return [oe(t)[0] + " + " + oe(n)[0], l.ADDITION];
2806
2806
  }
2807
2807
  default: {
2808
2808
  const t = new Array(o.itemCount_);
@@ -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 po = {
2990
+ const To = {
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
  },
@@ -3013,7 +3013,7 @@ const po = {
3013
3013
  ));
3014
3014
  }
3015
3015
  };
3016
- y.create_timer_v1 = po;
3016
+ L.create_timer_v1 = To;
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 To = {
3046
+ const fo = {
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: fo(this)
3053
+ callback: Eo(this)
3054
3054
  }, t = this.getField("VAR").getText(), n = {
3055
3055
  text: m.DELETE_VARIABLE.replace("%1", t),
3056
3056
  enabled: !0,
3057
- callback: Eo(this)
3057
+ callback: ho(this)
3058
3058
  };
3059
3059
  e.unshift(o), e.unshift(n);
3060
3060
  }
@@ -3072,12 +3072,12 @@ const To = {
3072
3072
  });
3073
3073
  }
3074
3074
  }
3075
- }, fo = function(e) {
3075
+ }, Eo = function(e) {
3076
3076
  return function() {
3077
3077
  const o = e.workspace, n = e.getField("VAR").getVariable();
3078
- oe.renameVariable(o, n);
3078
+ te.renameVariable(o, n);
3079
3079
  };
3080
- }, Eo = function(e) {
3080
+ }, ho = 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 To = {
3085
3085
  };
3086
3086
  f.registerMixin(
3087
3087
  "context_menu_variable_v1",
3088
- To
3088
+ fo
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 ho() {
3145
+ function mo() {
3146
3146
  const e = [];
3147
3147
  {
3148
3148
  const o = Ne.createElement("label");
@@ -3154,11 +3154,11 @@ function ho() {
3154
3154
  }
3155
3155
  return e;
3156
3156
  }
3157
- const mo = {
3157
+ const Oo = {
3158
3158
  name: "INTERFACE_CATEGORY",
3159
- callback: ho
3159
+ callback: mo
3160
3160
  }, $ = u.xml;
3161
- function Oo() {
3161
+ function go() {
3162
3162
  const e = [];
3163
3163
  {
3164
3164
  const o = $.createElement("label");
@@ -3185,18 +3185,18 @@ function Oo() {
3185
3185
  }
3186
3186
  const k = {
3187
3187
  name: "PROCEDURE_CATEGORY",
3188
- callback: Oo
3188
+ callback: go
3189
3189
  };
3190
- function go() {
3191
- const { args: e } = Pt.app.view, o = [];
3190
+ function Io() {
3191
+ const { args: e } = xt.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 Io() {
3197
+ function Lo() {
3198
3198
  const e = [];
3199
- if (go().length > 0) {
3199
+ if (Io().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 Io() {
3210
3210
  }
3211
3211
  const de = {
3212
3212
  name: "UI_CATEGORY",
3213
- callback: Io
3213
+ callback: Lo
3214
3214
  }, Z = u.xml;
3215
- function Lo(e) {
3215
+ function yo(e) {
3216
3216
  const o = [];
3217
3217
  {
3218
3218
  const n = Z.createElement("label");
@@ -3223,7 +3223,7 @@ function Lo(e) {
3223
3223
  n.setAttribute("text", "%{BKY_NEW_VARIABLE}"), n.setAttribute("callbackKey", "CREATE_VARIABLE"), e.registerButtonCallback(
3224
3224
  "CREATE_VARIABLE",
3225
3225
  function(i) {
3226
- oe.createVariableButtonHandler(
3226
+ te.createVariableButtonHandler(
3227
3227
  i.getTargetWorkspace()
3228
3228
  );
3229
3229
  }
@@ -3232,7 +3232,7 @@ function Lo(e) {
3232
3232
  const t = e.getVariablesOfType("");
3233
3233
  if (t.length <= 0)
3234
3234
  return o;
3235
- t.sort(Et.compareByName);
3235
+ t.sort(ht.compareByName);
3236
3236
  {
3237
3237
  const n = Z.createElement("label");
3238
3238
  n.setAttribute("text", m.LABEL_CREATED), o.push(n);
@@ -3240,27 +3240,27 @@ function Lo(e) {
3240
3240
  return t.forEach((n) => {
3241
3241
  {
3242
3242
  const i = Z.createElement("block");
3243
- i.setAttribute("type", "variable_get_v1"), i.appendChild(oe.generateVariableFieldDom(n)), o.push(i);
3243
+ i.setAttribute("type", "variable_get_v1"), i.appendChild(te.generateVariableFieldDom(n)), o.push(i);
3244
3244
  }
3245
3245
  {
3246
3246
  const i = Z.createElement("block");
3247
- i.setAttribute("type", "variable_set_v1"), i.appendChild(oe.generateVariableFieldDom(n)), o.push(i);
3247
+ i.setAttribute("type", "variable_set_v1"), i.appendChild(te.generateVariableFieldDom(n)), o.push(i);
3248
3248
  }
3249
3249
  }), o;
3250
3250
  }
3251
3251
  const N = {
3252
3252
  name: "VARIABLE_CATEGORY",
3253
- callback: Lo
3253
+ callback: yo
3254
3254
  };
3255
3255
  Ve.setConfirm(async (e, o) => {
3256
- const t = await Ct({
3256
+ const t = await vt({
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 vt({
3263
+ const n = await At({
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
- ht(o.default);
3284
+ mt(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 yo() {
3299
+ function Co() {
3300
3300
  var t;
3301
3301
  const e = H();
3302
3302
  if (!e)
@@ -3304,17 +3304,17 @@ function yo() {
3304
3304
  const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
3305
3305
  o && Fe(o.id);
3306
3306
  }
3307
- class Co {
3307
+ class vo {
3308
3308
  init({ contextMenu: o = !0, shortcut: t = !0 } = {
3309
3309
  contextMenu: !0,
3310
3310
  shortcut: !0
3311
3311
  }) {
3312
3312
  o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (g.registry.unregister(
3313
- ae.names.COPY
3313
+ le.names.COPY
3314
3314
  ), g.registry.unregister(
3315
- ae.names.CUT
3315
+ le.names.CUT
3316
3316
  ), g.registry.unregister(
3317
- ae.names.PASTE
3317
+ le.names.PASTE
3318
3318
  ), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
3319
3319
  }
3320
3320
  blockCopyToStorageContextMenu() {
@@ -3324,7 +3324,7 @@ class Co {
3324
3324
  },
3325
3325
  preconditionFn: function() {
3326
3326
  const t = D();
3327
- return !t || !J(t) || !t.isDeletable() || !re(t) || !t.isMovable() || !G(t) ? "disabled" : "enabled";
3327
+ return !t || !J(t) || !t.isDeletable() || !ae(t) || !t.isMovable() || !G(t) ? "disabled" : "enabled";
3328
3328
  },
3329
3329
  callback: function(t) {
3330
3330
  var n;
@@ -3378,10 +3378,10 @@ class Co {
3378
3378
  ), i = {
3379
3379
  name: "copy",
3380
3380
  preconditionFn: function(a) {
3381
- if (a.options.readOnly || ce.inProgress())
3381
+ if (a.options.readOnly || re.inProgress())
3382
3382
  return !1;
3383
3383
  const r = D();
3384
- return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !G(r));
3384
+ return !(!r || !J(r) || !r.isDeletable() || !ae(r) || !r.isMovable() || !G(r));
3385
3385
  },
3386
3386
  callback: function(a, r) {
3387
3387
  r.preventDefault();
@@ -3408,10 +3408,10 @@ class Co {
3408
3408
  ), i = {
3409
3409
  name: "cut",
3410
3410
  preconditionFn: function(a) {
3411
- if (a.options.readOnly || ce.inProgress())
3411
+ if (a.options.readOnly || re.inProgress())
3412
3412
  return !1;
3413
3413
  const r = D();
3414
- return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !G(r) || r.workspace.isFlyout);
3414
+ return !(!r || !J(r) || !r.isDeletable() || !ae(r) || !r.isMovable() || !G(r) || r.workspace.isFlyout);
3415
3415
  },
3416
3416
  callback: function(a, r) {
3417
3417
  r.preventDefault();
@@ -3419,7 +3419,7 @@ class Co {
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 mt ? c.checkAndDelete() : c.dispose(), !0) : !1;
3422
+ return p ? (localStorage.setItem("blocklyStash", JSON.stringify(p)), c instanceof Ot ? c.checkAndDelete() : c.dispose(), !0) : !1;
3423
3423
  },
3424
3424
  keyCodes: [o, t, n]
3425
3425
  };
@@ -3438,7 +3438,7 @@ class Co {
3438
3438
  ), i = {
3439
3439
  name: "paste",
3440
3440
  preconditionFn: function(a) {
3441
- if (a.options.readOnly || ce.inProgress())
3441
+ if (a.options.readOnly || re.inProgress())
3442
3442
  return !1;
3443
3443
  const r = localStorage.getItem("blocklyStash");
3444
3444
  if (!r)
@@ -3459,7 +3459,7 @@ class Co {
3459
3459
  g.registry.register(i);
3460
3460
  }
3461
3461
  }
3462
- class vo {
3462
+ class Ao {
3463
3463
  init() {
3464
3464
  const o = V.registry.getItem("cleanWorkspace");
3465
3465
  o && (o.callback = function(t) {
@@ -3483,7 +3483,7 @@ 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 Ao {
3486
+ class bo {
3487
3487
  init() {
3488
3488
  const o = V.registry.getItem("blockDisable");
3489
3489
  o && (o.preconditionFn = function(t) {
@@ -3492,9 +3492,9 @@ class Ao {
3492
3492
  });
3493
3493
  }
3494
3494
  }
3495
- class we extends _e {
3495
+ class we extends ce {
3496
3496
  constructor(t, n, i) {
3497
- super(_e.SKIP_SETUP);
3497
+ super(ce.SKIP_SETUP);
3498
3498
  /** The field's colour picker element. */
3499
3499
  v(this, "picker", null);
3500
3500
  /** Index of the currently highlighted element. */
@@ -4089,7 +4089,7 @@ class we extends _e {
4089
4089
  * Number of columns in the palette.
4090
4090
  */
4091
4091
  v(this, "columns", 14);
4092
- t !== _e.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4092
+ t !== ce.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4093
4093
  }
4094
4094
  configure_(t) {
4095
4095
  super.configure_(t), t.colourOptions && (this.colours = t.colourOptions), t.colourTitles && (this.titles = t.colourTitles), t.columns && (this.columns = t.columns);
@@ -4310,7 +4310,7 @@ class we extends _e {
4310
4310
  }
4311
4311
  }
4312
4312
  we.prototype.DEFAULT_VALUE = "#ffffff";
4313
- Ot.register(`
4313
+ gt.register(`
4314
4314
  .blocklyColourTable {
4315
4315
  border-collapse: collapse;
4316
4316
  display: block;
@@ -4337,17 +4337,17 @@ Ot.register(`
4337
4337
  position: relative;
4338
4338
  }
4339
4339
  `);
4340
- function bo() {
4341
- gt.register("field_colour", we);
4340
+ function ko() {
4341
+ It.register("field_colour", we);
4342
4342
  }
4343
- const ko = new Co();
4344
- ko.init({ contextMenu: !0, shortcut: !0 });
4345
4343
  const No = new vo();
4346
- No.init();
4344
+ No.init({ contextMenu: !0, shortcut: !0 });
4347
4345
  const Bo = new Ao();
4348
4346
  Bo.init();
4349
- bo();
4350
- se.Classic.blockStyles = {
4347
+ const Ro = new bo();
4348
+ Ro.init();
4349
+ ko();
4350
+ ie.Classic.blockStyles = {
4351
4351
  color_blocks: {
4352
4352
  colourPrimary: "#a5745b",
4353
4353
  colourSecondary: "#ede3de",
@@ -4421,7 +4421,7 @@ se.Classic.blockStyles = {
4421
4421
  hat: ""
4422
4422
  }
4423
4423
  };
4424
- se.Classic.categoryStyles = {
4424
+ ie.Classic.categoryStyles = {
4425
4425
  calc_category: {
4426
4426
  colour: "#757575"
4427
4427
  },
@@ -4471,9 +4471,9 @@ se.Classic.categoryStyles = {
4471
4471
  colour: "#a55b80"
4472
4472
  }
4473
4473
  };
4474
- const Ro = Pe.defineTheme("light", {
4474
+ const So = Pe.defineTheme("light", {
4475
4475
  name: "light",
4476
- base: se.Classic,
4476
+ base: ie.Classic,
4477
4477
  componentStyles: {
4478
4478
  workspaceBackgroundColour: "#ffffff",
4479
4479
  toolboxBackgroundColour: "#eeeeee",
@@ -4487,9 +4487,9 @@ const Ro = Pe.defineTheme("light", {
4487
4487
  scrollbarOpacity: 0.4,
4488
4488
  cursorColour: ""
4489
4489
  }
4490
- }), So = Pe.defineTheme("dark", {
4490
+ }), Mo = Pe.defineTheme("dark", {
4491
4491
  name: "dark",
4492
- base: se.Classic,
4492
+ base: ie.Classic,
4493
4493
  componentStyles: {
4494
4494
  workspaceBackgroundColour: "#1e1e1e",
4495
4495
  toolboxBackgroundColour: "#272727",
@@ -4504,14 +4504,14 @@ const Ro = Pe.defineTheme("light", {
4504
4504
  cursorColour: ""
4505
4505
  }
4506
4506
  });
4507
- function Mo(e) {
4507
+ function Uo(e) {
4508
4508
  const o = H();
4509
4509
  switch (console.log(o), e) {
4510
4510
  case "light":
4511
- o.setTheme(Ro);
4511
+ o.setTheme(So);
4512
4512
  break;
4513
4513
  case "dark":
4514
- o.setTheme(So);
4514
+ o.setTheme(Mo);
4515
4515
  break;
4516
4516
  }
4517
4517
  }
@@ -5154,7 +5154,7 @@ const he = {
5154
5154
  type: "text_reverse_v1"
5155
5155
  }
5156
5156
  ]
5157
- }, Uo = {
5157
+ }, Vo = {
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
- }, Vo = {
5181
+ }, Po = {
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
- Uo,
5197
+ Vo,
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: mo.name
5214
+ custom: Oo.name
5215
5215
  }
5216
5216
  ]
5217
- }, Po = {
5217
+ }, xo = {
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
- }, xo = {
5240
+ }, Do = {
5241
5241
  kind: "categoryToolbox",
5242
5242
  contents: [
5243
5243
  ge,
@@ -5260,7 +5260,7 @@ const he = {
5260
5260
  custom: k.name
5261
5261
  }
5262
5262
  ]
5263
- }, Do = /* @__PURE__ */ X({
5263
+ }, Yo = /* @__PURE__ */ X({
5264
5264
  __name: "index",
5265
5265
  setup(e) {
5266
5266
  const o = () => {
@@ -5272,16 +5272,16 @@ const he = {
5272
5272
  };
5273
5273
  return (t, n) => {
5274
5274
  const i = C("v-btn");
5275
- return L(), P(i, {
5275
+ return I(), P(i, {
5276
5276
  class: "mr-3",
5277
5277
  variant: "outlined",
5278
5278
  density: "comfortable",
5279
- icon: A(Bt),
5279
+ icon: A(Rt),
5280
5280
  onClick: o
5281
5281
  }, null, 8, ["icon"]);
5282
5282
  };
5283
5283
  }
5284
- }), Yo = /* @__PURE__ */ X({
5284
+ }), Ko = /* @__PURE__ */ X({
5285
5285
  __name: "index",
5286
5286
  props: {
5287
5287
  modelValue: { type: Boolean, required: !0 },
@@ -5289,25 +5289,25 @@ const he = {
5289
5289
  },
5290
5290
  emits: ["update:modelValue"],
5291
5291
  setup(e) {
5292
- const o = ue(e, "modelValue");
5292
+ const o = _e(e, "modelValue");
5293
5293
  return (t, n) => {
5294
5294
  const i = C("v-btn");
5295
- return L(), P(i, {
5295
+ return I(), P(i, {
5296
5296
  class: "mr-3",
5297
5297
  variant: "outlined",
5298
5298
  density: "comfortable",
5299
- icon: o.value ? A(Mt) : A(Ut),
5299
+ icon: o.value ? A(Ut) : A(Vt),
5300
5300
  onClick: n[0] || (n[0] = (a) => o.value = !o.value)
5301
5301
  }, null, 8, ["icon"]);
5302
5302
  };
5303
5303
  }
5304
- }), Ko = {
5304
+ }), Fo = {
5305
5305
  key: 1,
5306
5306
  class: "text-caption text-grey"
5307
- }, Fo = /* @__PURE__ */ X({
5307
+ }, Ho = /* @__PURE__ */ X({
5308
5308
  __name: "index",
5309
5309
  setup(e) {
5310
- const { t: o } = De(), t = ee([]), n = () => {
5310
+ const { t: o } = De(), t = ue([]), n = () => {
5311
5311
  var O;
5312
5312
  const a = H();
5313
5313
  if (!a) {
@@ -5316,19 +5316,19 @@ const he = {
5316
5316
  }
5317
5317
  const r = [], c = a.getTopBlocks(!0), p = ((O = D()) == null ? void 0 : O.id) ?? "";
5318
5318
  c.forEach((T) => {
5319
- const I = T;
5320
- if (I.type.startsWith("on_node_event_v"))
5319
+ const y = T;
5320
+ if (y.type.startsWith("on_node_event_v"))
5321
5321
  console.log("1");
5322
- else if (I.type.startsWith("procedure_def_v"))
5322
+ else if (y.type.startsWith("procedure_def_v"))
5323
5323
  console.log("2");
5324
5324
  else {
5325
- const d = I.getRelativeToSurfaceXY();
5325
+ const d = y.getRelativeToSurfaceXY();
5326
5326
  r.push({
5327
- id: I.id,
5327
+ id: y.id,
5328
5328
  name: m.fffff,
5329
5329
  x: d.x,
5330
5330
  y: d.y,
5331
- active: I.id === p
5331
+ active: y.id === p
5332
5332
  });
5333
5333
  }
5334
5334
  }), t.value = r;
@@ -5347,13 +5347,13 @@ 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(), P(O, { key: 0 }, {
5350
+ return t.value.length > 0 ? (I(), P(O, { key: 0 }, {
5351
5351
  default: Y(() => [
5352
- (L(!0), j(st, null, lt(t.value, (T) => (L(), P(p, {
5352
+ (I(!0), j(st, null, lt(t.value, (T) => (I(), P(p, {
5353
5353
  key: T.id,
5354
5354
  class: "d-flex justify-start",
5355
5355
  active: T.active,
5356
- onClick: (I) => i(T)
5356
+ onClick: (y) => i(T)
5357
5357
  }, {
5358
5358
  default: Y(() => [
5359
5359
  B(c, null, {
@@ -5367,13 +5367,13 @@ const he = {
5367
5367
  }, 1032, ["active", "onClick"]))), 128))
5368
5368
  ]),
5369
5369
  _: 1
5370
- })) : (L(), j("span", Ko, pe(A(o)("x-block-lib.noOption")), 1));
5370
+ })) : (I(), j("span", Fo, pe(A(o)("x-block-lib.noOption")), 1));
5371
5371
  };
5372
5372
  }
5373
- }), Ho = { class: "text-subtitle-1 ml-3" }, wo = /* @__PURE__ */ X({
5373
+ }), wo = { class: "text-subtitle-1 ml-3" }, Go = /* @__PURE__ */ X({
5374
5374
  __name: "index",
5375
5375
  setup(e) {
5376
- const { t: o } = De(), t = Nt(), { sysBarAvail: n } = At(), { backgroundColor1: i } = bt(), a = K(() => {
5376
+ const { t: o } = De(), t = Bt(), { sysBarAvail: n } = bt(), { backgroundColor1: i } = kt(), a = K(() => {
5377
5377
  let O = "100%";
5378
5378
  return t.mdAndUp.value && (O = "400px"), {
5379
5379
  background: i.value,
@@ -5389,40 +5389,40 @@ const he = {
5389
5389
  };
5390
5390
  }), c = K(() => ({
5391
5391
  height: "60px"
5392
- })), { open: p } = xe("selectNodeDlg");
5392
+ })), { open: p } = xe("blocklyNavigatorDlg");
5393
5393
  return (O, T) => {
5394
- const I = C("v-btn"), d = C("v-sheet"), S = C("v-icon"), w = C("v-dialog");
5395
- return L(), P(w, {
5394
+ const y = C("v-btn"), d = C("v-sheet"), S = C("v-icon"), w = C("v-dialog");
5395
+ return I(), P(w, {
5396
5396
  modelValue: A(p),
5397
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] = ct(le((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5402
+ onKeydown: T[4] || (T[4] = ct(se((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5403
5403
  }, {
5404
5404
  activator: Y(({ props: b }) => [
5405
- B(I, _t(b, {
5405
+ B(y, _t(b, {
5406
5406
  variant: "outlined",
5407
5407
  density: "comfortable",
5408
- icon: A(Vt)
5408
+ icon: A(Pt)
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
- onClick: T[1] || (T[1] = le((b) => p.value = !1, ["self"])),
5415
- onContextmenu: T[2] || (T[2] = le((b) => p.value = !1, ["self", "prevent"]))
5414
+ onClick: T[1] || (T[1] = se((b) => p.value = !1, ["self"])),
5415
+ onContextmenu: T[2] || (T[2] = se((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(), P(d, {
5421
+ A(n) ? (I(), P(d, {
5422
5422
  key: 0,
5423
5423
  color: "transparent",
5424
5424
  height: 24
5425
- })) : te("", !0),
5425
+ })) : ee("", !0),
5426
5426
  B(d, {
5427
5427
  class: "d-flex align-center px-3",
5428
5428
  color: "transparent",
@@ -5430,10 +5430,10 @@ const he = {
5430
5430
  }, {
5431
5431
  default: Y(() => [
5432
5432
  B(S, {
5433
- icon: A(Rt),
5433
+ icon: A(St),
5434
5434
  onClick: T[0] || (T[0] = (b) => p.value = !1)
5435
5435
  }, null, 8, ["icon"]),
5436
- M("span", Ho, pe(A(o)("x-block-lib.navigator")), 1)
5436
+ M("span", wo, pe(A(o)("x-block-lib.navigator")), 1)
5437
5437
  ]),
5438
5438
  _: 1
5439
5439
  }),
@@ -5441,7 +5441,7 @@ const he = {
5441
5441
  class: "overflow-y-auto",
5442
5442
  style: F(r.value)
5443
5443
  }, [
5444
- B(Fo),
5444
+ B(Ho),
5445
5445
  M("div", {
5446
5446
  style: F(c.value)
5447
5447
  }, null, 4)
@@ -5476,10 +5476,10 @@ const he = {
5476
5476
  wheel: !0
5477
5477
  }
5478
5478
  };
5479
- function Go(e, o, t) {
5479
+ function $o(e, o, t) {
5480
5480
  let n;
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);
5481
+ o === "app" ? t === "v1" && (n = Po) : o === "func" ? t === "v1" && (n = Do) : o === "flow" && t === "v1" && (n = xo), console.assert(!!n), Se.toolbox = n;
5482
+ const i = Lt(e, Se);
5483
5483
  return o === "app" ? t === "v1" && (i.registerToolboxCategoryCallback(
5484
5484
  de.name,
5485
5485
  de.callback
@@ -5503,7 +5503,7 @@ function Go(e, o, t) {
5503
5503
  N.callback
5504
5504
  )), i;
5505
5505
  }
5506
- const $o = { class: "position-relative w-100 h-100" }, jo = /* @__PURE__ */ X({
5506
+ const jo = { class: "position-relative w-100 h-100" }, Xo = /* @__PURE__ */ X({
5507
5507
  __name: "index",
5508
5508
  props: /* @__PURE__ */ Ce({
5509
5509
  type: {},
@@ -5516,9 +5516,9 @@ const $o = { class: "position-relative w-100 h-100" }, jo = /* @__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 = 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();
5519
+ const n = Nt(), { locale: i, dark: a } = Ct(n), { open: r } = xe("blocklyEditorFlyout"), c = _e(e, "lock"), p = _e(e, "scale"), O = e, T = t, y = ut("blocklyDiv");
5520
5520
  let d;
5521
- const S = ee(!1), w = ee(!1), b = K(() => ({
5521
+ const S = ue(!1), w = ue(!1), b = K(() => ({
5522
5522
  position: "absolute",
5523
5523
  background: a.value ? "#0000007f" : "#ffffff7f",
5524
5524
  top: "1px",
@@ -5546,92 +5546,82 @@ const $o = { class: "position-relative w-100 h-100" }, jo = /* @__PURE__ */ X({
5546
5546
  console.log("blockly load"), S.value = !0, Ae.workspaces.load(h, d);
5547
5547
  }, We = () => (console.log("blockly save"), Ae.workspaces.save(d)), Je = () => (console.log("blockly generateCode"), s.workspaceToCode(d));
5548
5548
  Me(async () => {
5549
- if (!I.value) {
5550
- console.assert(!1);
5551
- return;
5552
- }
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(() => {
5549
+ await Re(i.value), d = $o(y.value, O.type, O.version), d.addChangeListener(E.disableOrphans), d.addChangeListener(Qe), d.setScale(p.value), T("ready");
5550
+ }), pt(() => {
5555
5551
  r.value = !1;
5556
5552
  });
5557
5553
  function ze() {
5558
- d && Lt(d);
5554
+ d && yt(d);
5559
5555
  }
5560
5556
  function Qe(h) {
5561
5557
  if (h.type === E.FINISHED_LOADING) {
5562
- yo(), S.value = !1;
5558
+ Co(), S.value = !1;
5563
5559
  return;
5564
5560
  }
5565
- if (!S.value) {
5566
- if (h.type === E.VIEWPORT_CHANGE) {
5567
- p.value = d.getScale();
5568
- return;
5569
- }
5570
- h.type === E.BLOCK_DRAG && (h.isStart ? w.value = !0 : w.value = !1), T("change");
5571
- }
5561
+ S.value || (h.type === E.VIEWPORT_CHANGE && (p.value = d.getScale()), h.type === E.BLOCK_DRAG && (h.isStart ? w.value = !0 : w.value = !1), console.log(s.workspaceToCode(d)), T("change"));
5572
5562
  }
5573
5563
  return W(i, (h) => {
5574
5564
  Re(h);
5575
5565
  }), W(a, (h) => {
5576
- Mo(h ? "dark" : "light");
5566
+ Uo(h ? "dark" : "light");
5577
5567
  }), W(r, (h) => {
5578
5568
  var R;
5579
5569
  h || (R = d.getToolbox()) == null || R.clearSelection();
5580
5570
  }), W(p, (h) => {
5581
5571
  d.setScale(h);
5582
5572
  }), 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", {
5573
+ const qe = C("v-icon"), Ze = C("x-loading"), et = Tt("resize");
5574
+ return I(), j("div", jo, [
5575
+ dt(M("div", {
5586
5576
  id: "blocklyEditor",
5587
5577
  ref_key: "blocklyDiv",
5588
- ref: I,
5578
+ ref: y,
5589
5579
  class: "w-100 h-100"
5590
5580
  }, null, 512), [
5591
5581
  [et, ze]
5592
5582
  ]),
5593
- w.value ? (L(), j("div", {
5583
+ w.value ? (I(), j("div", {
5594
5584
  key: 0,
5595
5585
  class: "d-flex flex-column align-center justify-center",
5596
5586
  style: F(b.value)
5597
5587
  }, [
5598
5588
  B(qe, {
5599
- icon: A(St),
5589
+ icon: A(Mt),
5600
5590
  size: "x-large"
5601
5591
  }, null, 8, ["icon"])
5602
- ], 4)) : te("", !0),
5603
- c.value ? (L(), j("div", {
5592
+ ], 4)) : ee("", !0),
5593
+ c.value ? (I(), j("div", {
5604
5594
  key: 1,
5605
5595
  style: F(Ge.value)
5606
- }, null, 4)) : te("", !0),
5596
+ }, null, 4)) : ee("", !0),
5607
5597
  M("div", {
5608
5598
  class: "d-flex align-end pt-3 pr-3",
5609
5599
  style: F($e.value)
5610
5600
  }, [
5611
- B(Do),
5612
- B(Yo, {
5601
+ B(Yo),
5602
+ B(Ko, {
5613
5603
  modelValue: c.value,
5614
5604
  "onUpdate:modelValue": R[0] || (R[0] = (tt) => c.value = tt)
5615
5605
  }, null, 8, ["modelValue"]),
5616
- B(wo)
5606
+ B(Go)
5617
5607
  ], 4),
5618
- S.value ? (L(), P(Ze, {
5608
+ S.value ? (I(), P(Ze, {
5619
5609
  key: 2,
5620
5610
  "z-index": 99
5621
- })) : te("", !0)
5611
+ })) : ee("", !0)
5622
5612
  ]);
5623
5613
  };
5624
5614
  }
5625
- }), Xo = (e) => {
5626
- e.component("XBlockly", jo);
5615
+ }), Wo = (e) => {
5616
+ e.component("XBlockly", Xo);
5627
5617
  };
5628
- async function tn(e) {
5618
+ async function on(e) {
5629
5619
  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
5620
  }
5631
- const on = { install: Xo };
5621
+ const nn = { install: Wo };
5632
5622
  export {
5633
- jo as XBlockly,
5634
- on as default,
5635
- Xo as install,
5636
- tn as loadLocaleMessageBlock
5623
+ Xo as XBlockly,
5624
+ nn as default,
5625
+ Wo as install,
5626
+ on as loadLocaleMessageBlock
5637
5627
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.4.13",
4
+ "version": "0.4.14",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",