x-block-lib 0.4.7 → 0.4.9

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.
@@ -1,5 +1,6 @@
1
+ import { Type } from './workspace';
1
2
  interface Props {
2
- type: 'app' | 'func' | 'flow';
3
+ type: Type;
3
4
  version: string;
4
5
  active: boolean;
5
6
  }
@@ -10,7 +11,7 @@ type __VLS_PublicProps = {
10
11
  } & typeof __VLS_typeProps;
11
12
  declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
12
13
  load: () => void;
13
- save: () => void;
14
+ resize: () => void;
14
15
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
16
  change: (...args: any[]) => void;
16
17
  ready: (...args: any[]) => void;
@@ -0,0 +1,3 @@
1
+ import * as Blockly from 'blockly/core';
2
+ export type Type = 'app' | 'func' | 'flow';
3
+ export declare function createWorkspace(container: HTMLDivElement, type: Type, version: string): Blockly.WorkspaceSvg;
@@ -1,2 +1,4 @@
1
1
  import { App } from 'vue';
2
- export declare const install: (app: App) => void;
2
+ import XBlockly from './blockly/index.vue';
3
+ declare const install: (app: App) => void;
4
+ export { XBlockly, install };
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ declare const _default: {
2
2
  install: (app: import("vue").App) => void;
3
3
  };
4
4
  export default _default;
5
+ export * from './components';
5
6
  export * from './i18n';
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  var Qe = Object.defineProperty;
3
3
  var qe = (e, o, t) => o in e ? Qe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
- var A = (e, o, t) => qe(e, typeof o != "symbol" ? o + "" : o, t);
5
- import { defineComponent as W, resolveComponent as v, openBlock as L, createBlock as P, unref as b, useModel as ue, ref as ee, onMounted as Se, onUnmounted as Ze, withCtx as K, createElementBlock as X, Fragment as et, renderList as tt, createVNode as B, createTextVNode as ot, toDisplayString as pe, computed as F, isRef as nt, withKeys as it, withModifiers as le, mergeProps as st, createElementVNode as M, normalizeStyle as H, createCommentVNode as te, mergeModels as Ae, onBeforeUnmount as lt, watch as G, resolveDirective as at, withDirectives as rt } from "vue";
6
- import { d as _, j as s, O as l, u, X as ct, B as y, E as h, M as O, i as ie, a as U, b as E, C as Me, F as Ee, c as _t, P as Te, N as he, V as oe, e as ut, f as Ue, s as pt, g as w, S as g, h as ae, k as Y, l as J, m as re, n as $, o as V, p as be, G as ce, q as Tt, r as dt, t as _e, U as z, D as Q, v as D, w as ft, T as se, x as Ve, y as Et, z as ht } from "./blockly-jgwpd4oo.js";
4
+ var v = (e, o, t) => qe(e, typeof o != "symbol" ? o + "" : o, t);
5
+ import { defineComponent as W, resolveComponent as C, openBlock as L, createBlock as V, unref as A, useModel as ue, ref as ee, onMounted as Me, onUnmounted as Ze, withCtx as Y, createElementBlock as X, Fragment as et, renderList as tt, createVNode as B, createTextVNode as ot, toDisplayString as pe, computed as K, isRef as nt, withKeys as it, withModifiers as le, mergeProps as st, createElementVNode as S, normalizeStyle as F, createCommentVNode as te, mergeModels as Ae, onBeforeUnmount as lt, watch as G, resolveDirective as at, withDirectives as rt } from "vue";
6
+ import { d as _, j as s, O as l, u, X as ct, B as y, E as f, M as m, i as ie, a as M, b as d, C as Ue, F as Ee, c as _t, P as Te, N as he, V as oe, e as ut, f as Ve, s as pt, g as H, S as g, h as ae, k as D, l as J, m as re, n as $, o as U, p as be, G as ce, q as Tt, r as dt, t as _e, U as z, D as Q, v as x, w as ft, T as se, x as Pe, y as Et, z as ht } from "./blockly-jgwpd4oo.js";
7
7
  import { storeToRefs as mt } from "pinia";
8
- import { openConfirmDlg as Ot, openPromptDlg as gt, eventBus as de, useSystem as It, useColor as Lt, useViewStack as Pe, useGlobalStore as yt } from "x-essential-lib";
8
+ import { openConfirmDlg as Ot, openPromptDlg as gt, eventBus as de, useSystem as It, useColor as Lt, useViewStack as xe, useGlobalStore as yt } from "x-essential-lib";
9
9
  import { useDisplay as Ct } from "vuetify";
10
- import { useI18n as xe } from "vue-i18n";
10
+ import { useI18n as De } from "vue-i18n";
11
11
  var vt = "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", At = "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", bt = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", kt = "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", Nt = "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", Bt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
12
12
  _([
13
13
  {
@@ -196,7 +196,7 @@ function q(e) {
196
196
  console.assert(!1, "invalid param type", e.type);
197
197
  return u.xml.textToDom(o);
198
198
  }
199
- function De(e, o, t) {
199
+ function Ye(e, o, t) {
200
200
  const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ct.domToWorkspace(i, e);
201
201
  return e.getBlockById(a[0]);
202
202
  }
@@ -259,7 +259,7 @@ const Vt = {
259
259
  this.key = e, this.name = o, this.updateShape_();
260
260
  },
261
261
  onchange: function(e) {
262
- if (e.type === h.BLOCK_MOVE) {
262
+ if (e.type === f.BLOCK_MOVE) {
263
263
  const o = e;
264
264
  if (o.blockId !== this.id)
265
265
  return;
@@ -271,18 +271,18 @@ const Vt = {
271
271
  const o = this.workspace.getBlockById(e.oldParentId);
272
272
  if (o && Ut(o.type, e.oldInputName))
273
273
  try {
274
- h.disable();
274
+ f.disable();
275
275
  const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
276
276
  if (n) {
277
- const i = De(this.workspace, this.key, this.name);
277
+ const i = Ye(this.workspace, this.key, this.name);
278
278
  n.connect(i.outputConnection);
279
279
  }
280
280
  } finally {
281
- h.enable();
281
+ f.enable();
282
282
  }
283
283
  },
284
284
  updateShape_: function() {
285
- this.name ? this.setFieldValue(O[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
285
+ this.name ? this.setFieldValue(m[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
286
286
  }
287
287
  };
288
288
  y.parameter_v1 = Vt;
@@ -379,7 +379,7 @@ const Yt = {
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(U.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
382
+ e === 0 && (o.setAlign(M.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);
@@ -613,9 +613,9 @@ const Kt = {
613
613
  AND: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_AND}",
614
614
  OR: "%{BKY_LOGIC_V1_OPERATION_TOOLTIP_OR}"
615
615
  };
616
- E.register(
616
+ d.register(
617
617
  "logic_op_tooltip_v1",
618
- E.buildTooltipForDropdown("OP", Kt)
618
+ d.buildTooltipForDropdown("OP", Kt)
619
619
  );
620
620
  _([
621
621
  {
@@ -648,16 +648,16 @@ const Ft = {
648
648
  o.outputConnection,
649
649
  t.outputConnection
650
650
  )) {
651
- h.setGroup(e.group);
651
+ f.setGroup(e.group);
652
652
  const n = this.prevBlocks_[0];
653
653
  n !== o && (o.unplug(), n && !n.isDisposed() && !n.isShadow() && this.getInput("A").connection.connect(n.outputConnection));
654
654
  const i = this.prevBlocks_[1];
655
- i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), h.setGroup(!1);
655
+ i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), f.setGroup(!1);
656
656
  }
657
657
  this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
658
658
  }
659
659
  };
660
- E.register(
660
+ d.register(
661
661
  "logic_compare_v1",
662
662
  function() {
663
663
  this.mixin(Ft);
@@ -826,8 +826,8 @@ const Ht = {
826
826
  for (let e = 1; this.getInput("IF" + e); e++)
827
827
  this.removeInput("IF" + e), this.removeInput("DO" + e);
828
828
  for (let e = 1; e <= this.elseIfCount_; e++)
829
- this.appendValueInput("IF" + e).setCheck("Boolean").appendField(O.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(O.LOGIC_DO);
830
- this.hasElse_ && this.appendStatementInput("ELSE").appendField(O.LOGIC_ELSE);
829
+ this.appendValueInput("IF" + e).setCheck("Boolean").appendField(m.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(m.LOGIC_DO);
830
+ this.hasElse_ && this.appendStatementInput("ELSE").appendField(m.LOGIC_ELSE);
831
831
  },
832
832
  reconnectChildBlocks_: function(e, o, t) {
833
833
  var n, i;
@@ -836,7 +836,7 @@ const Ht = {
836
836
  t == null || t.reconnect(this, "ELSE");
837
837
  }
838
838
  };
839
- E.registerMutator(
839
+ d.registerMutator(
840
840
  "logic_if_v1_mutator",
841
841
  Ht,
842
842
  void 0,
@@ -994,12 +994,12 @@ const wt = {
994
994
  a && !a.workspace.connectionChecker.doTypeChecks(
995
995
  a.outputConnection,
996
996
  n
997
- ) && (h.setGroup(e.group), n === this.prevParentConnection_ ? (this.unplug(), n.getSourceBlock().bumpNeighbours()) : (a.unplug(), a.bumpNeighbours()), h.setGroup(!1));
997
+ ) && (f.setGroup(e.group), n === this.prevParentConnection_ ? (this.unplug(), n.getSourceBlock().bumpNeighbours()) : (a.unplug(), a.bumpNeighbours()), f.setGroup(!1));
998
998
  }
999
999
  this.prevParentConnection_ = n;
1000
1000
  }
1001
1001
  };
1002
- E.registerMixin("logic_ternary_v1", wt);
1002
+ d.registerMixin("logic_ternary_v1", wt);
1003
1003
  _([
1004
1004
  {
1005
1005
  type: "logic_ternary_v1",
@@ -1050,19 +1050,19 @@ const Gt = {
1050
1050
  };
1051
1051
  e.push({
1052
1052
  enabled: !0,
1053
- text: O.VARIABLES_SET_CREATE_GET.replace("%1", n),
1054
- callback: Me.callbackFactory(this, i)
1053
+ text: m.VARIABLES_SET_CREATE_GET.replace("%1", n),
1054
+ callback: Ue.callbackFactory(this, i)
1055
1055
  });
1056
1056
  }
1057
1057
  }
1058
1058
  };
1059
- E.registerMixin(
1059
+ d.registerMixin(
1060
1060
  "contextMenu_newGetVariableBlock_v1",
1061
1061
  Gt
1062
1062
  );
1063
- E.register(
1063
+ d.register(
1064
1064
  "flow_control_tooltip_v1",
1065
- E.buildTooltipForDropdown("MODE", {
1065
+ d.buildTooltipForDropdown("MODE", {
1066
1066
  BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
1067
1067
  CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
1068
1068
  })
@@ -1084,20 +1084,20 @@ const $t = /* @__PURE__ */ new Set([
1084
1084
  },
1085
1085
  onchange: function(e) {
1086
1086
  const o = this.workspace;
1087
- if (!o.isDragging || o.isDragging() || e.type !== h.BLOCK_MOVE && e.type !== h.BLOCK_CREATE)
1087
+ if (!o.isDragging || o.isDragging() || e.type !== f.BLOCK_MOVE && e.type !== f.BLOCK_CREATE)
1088
1088
  return;
1089
1089
  const t = this.getSurroundLoop();
1090
1090
  if (console.log(e.type, t), this.setWarningText(
1091
- t ? null : O.LOOP_FLOW_CONTROL_WARNING
1091
+ t ? null : m.LOOP_FLOW_CONTROL_WARNING
1092
1092
  ), !this.isInFlyout)
1093
1093
  try {
1094
- h.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
1094
+ f.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
1095
1095
  } finally {
1096
- h.setRecordUndo(!0);
1096
+ f.setRecordUndo(!0);
1097
1097
  }
1098
1098
  }
1099
1099
  };
1100
- E.registerMixin(
1100
+ d.registerMixin(
1101
1101
  "flow_control_in_loop_check_v1",
1102
1102
  jt
1103
1103
  );
@@ -1122,9 +1122,9 @@ _([
1122
1122
  extensions: ["flow_control_tooltip_v1", "flow_control_in_loop_check_v1"]
1123
1123
  }
1124
1124
  ]);
1125
- E.register(
1125
+ d.register(
1126
1126
  "for_tooltip_v1",
1127
- E.buildTooltipWithFieldText(
1127
+ d.buildTooltipWithFieldText(
1128
1128
  "%{BKY_LOOP_V1_FOR_TOOLTIP}",
1129
1129
  "VAR"
1130
1130
  )
@@ -1173,9 +1173,9 @@ _([
1173
1173
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
1174
1174
  }
1175
1175
  ]);
1176
- E.register(
1176
+ d.register(
1177
1177
  "for_each_tooltip_v1",
1178
- E.buildTooltipWithFieldText(
1178
+ d.buildTooltipWithFieldText(
1179
1179
  "%{BKY_LOOP_V1_FOR_EACH_TOOLTIP}",
1180
1180
  "VAR"
1181
1181
  )
@@ -1210,9 +1210,9 @@ _([
1210
1210
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
1211
1211
  }
1212
1212
  ]);
1213
- E.register(
1213
+ d.register(
1214
1214
  "loop_while_until_tooltip_v1",
1215
- E.buildTooltipForDropdown("MODE", {
1215
+ d.buildTooltipForDropdown("MODE", {
1216
1216
  WHILE: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE}",
1217
1217
  UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
1218
1218
  })
@@ -1296,9 +1296,9 @@ const Xt = {
1296
1296
  STD_DEV: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_STD_DEV}",
1297
1297
  RANDOM: "%{BKY_MATH_V1_ON_LIST_TOOLTIP_RANDOM}"
1298
1298
  };
1299
- E.register(
1299
+ d.register(
1300
1300
  "math_op_tooltip_v1",
1301
- E.buildTooltipForDropdown("OP", Xt)
1301
+ d.buildTooltipForDropdown("OP", Xt)
1302
1302
  );
1303
1303
  _([
1304
1304
  {
@@ -1990,7 +1990,7 @@ 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(U.Align.RIGHT).appendField(new Ee("key"), "KEY" + e);
1993
+ this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(M.Align.RIGHT).appendField(new Ee("key"), "KEY" + e);
1994
1994
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
1995
1995
  this.removeInput("ADD" + e);
1996
1996
  }
@@ -2375,9 +2375,9 @@ const eo = {
2375
2375
  n.setKeyName(o.name, "");
2376
2376
  else
2377
2377
  try {
2378
- h.disable(), n = De(this.workspace, o.name, ""), n.outputConnection.connect(t);
2378
+ f.disable(), n = Ye(this.workspace, o.name, ""), n.outputConnection.connect(t);
2379
2379
  } finally {
2380
- h.enable();
2380
+ f.enable();
2381
2381
  }
2382
2382
  }
2383
2383
  }
@@ -2408,7 +2408,7 @@ const to = u.xml, oo = {
2408
2408
  },
2409
2409
  onchange: function(e) {
2410
2410
  var o;
2411
- if (e.type === h.BLOCK_DRAG) {
2411
+ if (e.type === f.BLOCK_DRAG) {
2412
2412
  const t = e;
2413
2413
  if (t.isStart || !((o = t.blocks) != null && o.find((n) => n.id === this.id)))
2414
2414
  return;
@@ -2471,9 +2471,9 @@ const no = /^\s*'([^']|\\')*'\s*$/;
2471
2471
  function ne(e) {
2472
2472
  return no.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2473
2473
  }
2474
- E.register(
2474
+ d.register(
2475
2475
  "text_append_tooltip_v1",
2476
- E.buildTooltipWithFieldText(
2476
+ d.buildTooltipWithFieldText(
2477
2477
  "%{BKY_TEXT_V1_APPEND_TOOLTIP}",
2478
2478
  "VAR"
2479
2479
  )
@@ -2742,7 +2742,7 @@ const io = u.xml, so = {
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
- U.Align.RIGHT
2745
+ M.Align.RIGHT
2746
2746
  );
2747
2747
  e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
2748
2748
  }
@@ -2752,7 +2752,7 @@ const io = u.xml, so = {
2752
2752
  }, lo = function() {
2753
2753
  this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ie.MutatorIcon(["text_join_item_v1"], this));
2754
2754
  };
2755
- E.registerMutator(
2755
+ d.registerMutator(
2756
2756
  "text_join_mutator_v1",
2757
2757
  so,
2758
2758
  lo
@@ -2998,7 +2998,7 @@ const ao = {
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(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"));
3001
+ this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(M.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(M.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(M.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(M.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;
@@ -3048,11 +3048,11 @@ const ro = {
3048
3048
  if (this.isInFlyout) {
3049
3049
  if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
3050
3050
  const o = {
3051
- text: O.RENAME_VARIABLE,
3051
+ text: m.RENAME_VARIABLE,
3052
3052
  enabled: !0,
3053
3053
  callback: co(this)
3054
3054
  }, t = this.getField("VAR").getText(), n = {
3055
- text: O.DELETE_VARIABLE.replace("%1", t),
3055
+ text: m.DELETE_VARIABLE.replace("%1", t),
3056
3056
  enabled: !0,
3057
3057
  callback: _o(this)
3058
3058
  };
@@ -3060,7 +3060,7 @@ const ro = {
3060
3060
  }
3061
3061
  } else {
3062
3062
  let o, t;
3063
- this.type === "variables_get_v1" ? (o = "variables_set_v1", t = O.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = O.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3063
+ this.type === "variables_get_v1" ? (o = "variables_set_v1", t = m.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = m.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3064
3064
  const n = this.getField("VAR"), i = {
3065
3065
  type: o,
3066
3066
  fields: { VAR: n.saveState(!0) }
@@ -3068,7 +3068,7 @@ const ro = {
3068
3068
  e.push({
3069
3069
  enabled: this.workspace.remainingCapacity() > 0,
3070
3070
  text: t.replace("%1", n.getText()),
3071
- callback: Me.callbackFactory(this, i)
3071
+ callback: Ue.callbackFactory(this, i)
3072
3072
  });
3073
3073
  }
3074
3074
  }
@@ -3083,7 +3083,7 @@ const ro = {
3083
3083
  o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
3084
3084
  };
3085
3085
  };
3086
- E.registerMixin(
3086
+ d.registerMixin(
3087
3087
  "context_menu_variable_v1",
3088
3088
  ro
3089
3089
  );
@@ -3146,7 +3146,7 @@ function uo() {
3146
3146
  const e = [];
3147
3147
  {
3148
3148
  const o = Ne.createElement("label");
3149
- o.setAttribute("text", O.LABEL_ASSET_LAYER), e.push(o);
3149
+ o.setAttribute("text", m.LABEL_ASSET_LAYER), e.push(o);
3150
3150
  }
3151
3151
  {
3152
3152
  const o = Ne.createElement("block");
@@ -3171,7 +3171,7 @@ function To() {
3171
3171
  const t = j.createElement("field");
3172
3172
  t.setAttribute("name", "NAME");
3173
3173
  const n = j.createTextNode(
3174
- O.PROCEDURE_DEFAULT_NAME
3174
+ m.PROCEDURE_DEFAULT_NAME
3175
3175
  );
3176
3176
  t.appendChild(n), o.appendChild(t);
3177
3177
  }
@@ -3235,7 +3235,7 @@ function ho(e) {
3235
3235
  t.sort(ut.compareByName);
3236
3236
  {
3237
3237
  const n = Z.createElement("label");
3238
- n.setAttribute("text", O.LABEL_CREATED), o.push(n);
3238
+ n.setAttribute("text", m.LABEL_CREATED), o.push(n);
3239
3239
  }
3240
3240
  return t.forEach((n) => {
3241
3241
  {
@@ -3252,21 +3252,21 @@ const N = {
3252
3252
  name: "VARIABLE_CATEGORY",
3253
3253
  callback: ho
3254
3254
  };
3255
- Ue.setConfirm(async (e, o) => {
3255
+ Ve.setConfirm(async (e, o) => {
3256
3256
  const t = await Ot({
3257
3257
  title: "",
3258
3258
  text: e
3259
3259
  });
3260
3260
  o(!!t);
3261
3261
  });
3262
- Ue.setPrompt(async (e, o, t) => {
3262
+ Ve.setPrompt(async (e, o, t) => {
3263
3263
  const n = await gt({
3264
3264
  title: "",
3265
3265
  value: o
3266
3266
  });
3267
3267
  t(String(n));
3268
3268
  });
3269
- const Ye = (e, o, t) => {
3269
+ const Ke = (e, o, t) => {
3270
3270
  const n = e[o];
3271
3271
  return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, a) => {
3272
3272
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -3280,11 +3280,11 @@ const Ye = (e, o, t) => {
3280
3280
  });
3281
3281
  };
3282
3282
  async function Re(e) {
3283
- const o = await Ye(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
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
  pt(o.default);
3285
3285
  }
3286
- function Ke(e) {
3287
- const o = w();
3286
+ function Fe(e) {
3287
+ const o = H();
3288
3288
  if (!o)
3289
3289
  return;
3290
3290
  const t = o.getBlockById(e);
@@ -3298,11 +3298,11 @@ function Ke(e) {
3298
3298
  }
3299
3299
  function mo() {
3300
3300
  var t;
3301
- const e = w();
3301
+ const e = H();
3302
3302
  if (!e)
3303
3303
  return;
3304
3304
  const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
3305
- o && Ke(o.id);
3305
+ o && Fe(o.id);
3306
3306
  }
3307
3307
  class Oo {
3308
3308
  init({ contextMenu: o = !0, shortcut: t = !0 } = {
@@ -3320,10 +3320,10 @@ class Oo {
3320
3320
  blockCopyToStorageContextMenu() {
3321
3321
  const o = {
3322
3322
  displayText: function() {
3323
- return O.CROSS_TAB_COPY ? O.CROSS_TAB_COPY : "Copy";
3323
+ return m.CROSS_TAB_COPY ? m.CROSS_TAB_COPY : "Copy";
3324
3324
  },
3325
3325
  preconditionFn: function() {
3326
- const t = Y();
3326
+ const t = D();
3327
3327
  return !t || !J(t) || !t.isDeletable() || !re(t) || !t.isMovable() || !$(t) ? "disabled" : "enabled";
3328
3328
  },
3329
3329
  callback: function(t) {
@@ -3333,16 +3333,16 @@ class Oo {
3333
3333
  JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
3334
3334
  );
3335
3335
  },
3336
- scopeType: V.ScopeType.BLOCK,
3336
+ scopeType: U.ScopeType.BLOCK,
3337
3337
  id: "blockCopyToStorage",
3338
3338
  weight: 0
3339
3339
  };
3340
- V.registry.register(o);
3340
+ U.registry.register(o);
3341
3341
  }
3342
3342
  blockPasteFromStorageContextMenu() {
3343
3343
  const o = {
3344
3344
  displayText: function() {
3345
- return O.CROSS_TAB_PASTE ? O.CROSS_TAB_PASTE : "Paste";
3345
+ return m.CROSS_TAB_PASTE ? m.CROSS_TAB_PASTE : "Paste";
3346
3346
  },
3347
3347
  preconditionFn: function(t) {
3348
3348
  var a;
@@ -3359,11 +3359,11 @@ class Oo {
3359
3359
  const i = JSON.parse(n);
3360
3360
  i && t.workspace && be.paste(i, t.workspace);
3361
3361
  },
3362
- scopeType: V.ScopeType.WORKSPACE,
3362
+ scopeType: U.ScopeType.WORKSPACE,
3363
3363
  id: "blockPasteFromStorage",
3364
3364
  weight: 0
3365
3365
  };
3366
- V.registry.register(o);
3366
+ U.registry.register(o);
3367
3367
  }
3368
3368
  blockCopyToStorageShortcut() {
3369
3369
  const o = g.registry.createSerializedKey(
@@ -3380,12 +3380,12 @@ class Oo {
3380
3380
  preconditionFn: function(a) {
3381
3381
  if (a.options.readOnly || ce.inProgress())
3382
3382
  return !1;
3383
- const r = Y();
3383
+ const r = D();
3384
3384
  return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !$(r));
3385
3385
  },
3386
3386
  callback: function(a, r) {
3387
3387
  r.preventDefault();
3388
- const c = Y();
3388
+ const c = D();
3389
3389
  if (!c || !$(c))
3390
3390
  return !1;
3391
3391
  const p = c.toCopyData();
@@ -3410,12 +3410,12 @@ class Oo {
3410
3410
  preconditionFn: function(a) {
3411
3411
  if (a.options.readOnly || ce.inProgress())
3412
3412
  return !1;
3413
- const r = Y();
3413
+ const r = D();
3414
3414
  return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !$(r) || r.workspace.isFlyout);
3415
3415
  },
3416
3416
  callback: function(a, r) {
3417
3417
  r.preventDefault();
3418
- const c = Y();
3418
+ const c = D();
3419
3419
  if (!c || !J(c) || !c.isDeletable() || !$(c))
3420
3420
  return !1;
3421
3421
  const p = c.toCopyData();
@@ -3461,12 +3461,12 @@ class Oo {
3461
3461
  }
3462
3462
  class go {
3463
3463
  init() {
3464
- const o = V.registry.getItem("cleanWorkspace");
3464
+ const o = U.registry.getItem("cleanWorkspace");
3465
3465
  o && (o.callback = function(t) {
3466
3466
  const n = t.workspace;
3467
3467
  if (!n)
3468
3468
  return;
3469
- n.setResizesEnabled(!1), h.setGroup(!0);
3469
+ n.setResizesEnabled(!1), f.setGroup(!0);
3470
3470
  const i = n.getTopBlocks(!0);
3471
3471
  let a = 0;
3472
3472
  for (let r = 0, c; c = i[r]; r++) {
@@ -3475,54 +3475,54 @@ class go {
3475
3475
  const p = c.getRelativeToSurfaceXY();
3476
3476
  c.moveBy(-p.x, a - p.y, ["cleanup"]), c.snapToGrid(), a = c.getRelativeToSurfaceXY().y + c.getHeightWidth().height + 100;
3477
3477
  }
3478
- h.setGroup(!1), n.setResizesEnabled(!0);
3478
+ f.setGroup(!1), n.setResizesEnabled(!0);
3479
3479
  });
3480
3480
  }
3481
3481
  }
3482
- function Fe(e) {
3482
+ function He(e) {
3483
3483
  const o = e.getParent();
3484
- return o && Fe(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3484
+ return o && He(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3485
3485
  }
3486
3486
  class Io {
3487
3487
  init() {
3488
- const o = V.registry.getItem("blockDisable");
3488
+ const o = U.registry.getItem("blockDisable");
3489
3489
  o && (o.preconditionFn = function(t) {
3490
3490
  const n = t.block;
3491
- return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || Fe(n) ? "disabled" : "enabled" : "hidden";
3491
+ return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || He(n) ? "disabled" : "enabled" : "hidden";
3492
3492
  });
3493
3493
  }
3494
3494
  }
3495
- class He extends _e {
3495
+ class we extends _e {
3496
3496
  constructor(t, n, i) {
3497
3497
  super(_e.SKIP_SETUP);
3498
3498
  /** The field's colour picker element. */
3499
- A(this, "picker", null);
3499
+ v(this, "picker", null);
3500
3500
  /** Index of the currently highlighted element. */
3501
- A(this, "highlightedIndex", null);
3501
+ v(this, "highlightedIndex", null);
3502
3502
  /**
3503
3503
  * Array holding info needed to unbind events.
3504
3504
  * Used for disposing.
3505
3505
  * Ex: [[node, name, func], [node, name, func]].
3506
3506
  */
3507
- A(this, "boundEvents", []);
3507
+ v(this, "boundEvents", []);
3508
3508
  /**
3509
3509
  * Serializable fields are saved by the serializer, non-serializable fields
3510
3510
  * are not. Editable fields should also be serializable.
3511
3511
  */
3512
- A(this, "SERIALIZABLE", !0);
3512
+ v(this, "SERIALIZABLE", !0);
3513
3513
  /** Mouse cursor style when over the hotspot that initiates the editor. */
3514
- A(this, "CURSOR", "default");
3514
+ v(this, "CURSOR", "default");
3515
3515
  /**
3516
3516
  * Used to tell if the field needs to be rendered the next time the block is
3517
3517
  * rendered. Colour fields are statically sized, and only need to be
3518
3518
  * rendered at initialization.
3519
3519
  */
3520
- A(this, "isDirty_", !1);
3520
+ v(this, "isDirty_", !1);
3521
3521
  /**
3522
3522
  * An array of colour strings for the palette.
3523
3523
  * Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
3524
3524
  */
3525
- A(this, "colours", [
3525
+ v(this, "colours", [
3526
3526
  // red
3527
3527
  "#F44336",
3528
3528
  // base
@@ -4084,11 +4084,11 @@ class He extends _e {
4084
4084
  * An array of tooltip strings for the palette. If not the same length as
4085
4085
  * COLOURS, the colour's hex code will be used for any missing titles.
4086
4086
  */
4087
- A(this, "titles", ["%{BKY_COLOR_RED}"]);
4087
+ v(this, "titles", ["%{BKY_COLOR_RED}"]);
4088
4088
  /**
4089
4089
  * Number of columns in the palette.
4090
4090
  */
4091
- A(this, "columns", 14);
4091
+ v(this, "columns", 14);
4092
4092
  t !== _e.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4093
4093
  }
4094
4094
  configure_(t) {
@@ -4198,8 +4198,8 @@ class He extends _e {
4198
4198
  const i = this.colours, a = this.columns;
4199
4199
  let r = this.highlightedIndex % a, c = Math.floor(this.highlightedIndex / a);
4200
4200
  r += t, c += n, t < 0 ? r < 0 && c > 0 ? (r = a - 1, c--) : r < 0 && (r = 0) : t > 0 ? r > a - 1 && c < Math.floor(i.length / a) - 1 ? (r = 0, c++) : r > a - 1 && r-- : n < 0 ? c < 0 && (c = 0) : n > 0 && c > Math.floor(i.length / a) - 1 && (c = Math.floor(i.length / a) - 1);
4201
- const p = this.picker.childNodes[c].childNodes[r], T = c * a + r;
4202
- this.setHighlightedCell(p, T);
4201
+ const p = this.picker.childNodes[c].childNodes[r], E = c * a + r;
4202
+ this.setHighlightedCell(p, E);
4203
4203
  }
4204
4204
  onMouseMove(t) {
4205
4205
  const n = t.target, i = n && Number(n.getAttribute("data-index"));
@@ -4258,7 +4258,7 @@ class He extends _e {
4258
4258
  ), p.style.backgroundColor = n[c], n[c] === i && (p.className = "blocklyColourSelected", this.highlightedIndex = c);
4259
4259
  }
4260
4260
  this.boundEvents.push(
4261
- D.conditionalBind(
4261
+ x.conditionalBind(
4262
4262
  a,
4263
4263
  "pointerdown",
4264
4264
  this,
@@ -4266,7 +4266,7 @@ class He extends _e {
4266
4266
  !0
4267
4267
  )
4268
4268
  ), this.boundEvents.push(
4269
- D.conditionalBind(
4269
+ x.conditionalBind(
4270
4270
  a,
4271
4271
  "pointermove",
4272
4272
  this,
@@ -4274,7 +4274,7 @@ class He extends _e {
4274
4274
  !0
4275
4275
  )
4276
4276
  ), this.boundEvents.push(
4277
- D.conditionalBind(
4277
+ x.conditionalBind(
4278
4278
  a,
4279
4279
  "pointerenter",
4280
4280
  this,
@@ -4282,7 +4282,7 @@ class He extends _e {
4282
4282
  !0
4283
4283
  )
4284
4284
  ), this.boundEvents.push(
4285
- D.conditionalBind(
4285
+ x.conditionalBind(
4286
4286
  a,
4287
4287
  "pointerleave",
4288
4288
  this,
@@ -4290,7 +4290,7 @@ class He extends _e {
4290
4290
  !0
4291
4291
  )
4292
4292
  ), this.boundEvents.push(
4293
- D.conditionalBind(
4293
+ x.conditionalBind(
4294
4294
  a,
4295
4295
  "keydown",
4296
4296
  this,
@@ -4302,14 +4302,14 @@ class He extends _e {
4302
4302
  /** Disposes of events and DOM-references belonging to the colour editor. */
4303
4303
  dropdownDispose() {
4304
4304
  for (const t of this.boundEvents)
4305
- D.unbind(t);
4305
+ x.unbind(t);
4306
4306
  this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
4307
4307
  }
4308
4308
  static fromJson(t) {
4309
4309
  return new this(t.colour, void 0, t);
4310
4310
  }
4311
4311
  }
4312
- He.prototype.DEFAULT_VALUE = "#ffffff";
4312
+ we.prototype.DEFAULT_VALUE = "#ffffff";
4313
4313
  dt.register(`
4314
4314
  .blocklyColourTable {
4315
4315
  border-collapse: collapse;
@@ -4338,7 +4338,7 @@ dt.register(`
4338
4338
  }
4339
4339
  `);
4340
4340
  function Lo() {
4341
- ft.register("field_colour", He);
4341
+ ft.register("field_colour", we);
4342
4342
  }
4343
4343
  const yo = new Oo();
4344
4344
  yo.init({ contextMenu: !0, shortcut: !0 });
@@ -4471,7 +4471,7 @@ se.Classic.categoryStyles = {
4471
4471
  colour: "#a55b80"
4472
4472
  }
4473
4473
  };
4474
- const Ao = Ve.defineTheme("light", {
4474
+ const Ao = Pe.defineTheme("light", {
4475
4475
  name: "light",
4476
4476
  base: se.Classic,
4477
4477
  componentStyles: {
@@ -4487,7 +4487,7 @@ const Ao = Ve.defineTheme("light", {
4487
4487
  scrollbarOpacity: 0.4,
4488
4488
  cursorColour: ""
4489
4489
  }
4490
- }), bo = Ve.defineTheme("dark", {
4490
+ }), bo = Pe.defineTheme("dark", {
4491
4491
  name: "dark",
4492
4492
  base: se.Classic,
4493
4493
  componentStyles: {
@@ -4505,7 +4505,7 @@ const Ao = Ve.defineTheme("light", {
4505
4505
  }
4506
4506
  });
4507
4507
  function ko(e) {
4508
- const o = w();
4508
+ const o = H();
4509
4509
  switch (console.log(o), e) {
4510
4510
  case "light":
4511
4511
  o.setTheme(Ao);
@@ -5261,28 +5261,28 @@ const me = {
5261
5261
  }
5262
5262
  ]
5263
5263
  }, Mo = /* @__PURE__ */ W({
5264
- __name: "cleanup",
5264
+ __name: "index",
5265
5265
  setup(e) {
5266
5266
  const o = () => {
5267
- const t = w();
5267
+ const t = H();
5268
5268
  if (!t)
5269
5269
  return;
5270
- const n = V.registry.getItem("cleanWorkspace");
5270
+ const n = U.registry.getItem("cleanWorkspace");
5271
5271
  n && n.callback({ workspace: t }, new PointerEvent("dummy"));
5272
5272
  };
5273
5273
  return (t, n) => {
5274
- const i = v("v-btn");
5275
- return L(), P(i, {
5274
+ const i = C("v-btn");
5275
+ return L(), V(i, {
5276
5276
  class: "mr-3",
5277
5277
  variant: "outlined",
5278
5278
  density: "comfortable",
5279
- icon: b(vt),
5279
+ icon: A(vt),
5280
5280
  onClick: o
5281
5281
  }, null, 8, ["icon"]);
5282
5282
  };
5283
5283
  }
5284
5284
  }), Uo = /* @__PURE__ */ W({
5285
- __name: "lock",
5285
+ __name: "index",
5286
5286
  props: {
5287
5287
  modelValue: { type: Boolean, required: !0 },
5288
5288
  modelModifiers: {}
@@ -5291,12 +5291,12 @@ const me = {
5291
5291
  setup(e) {
5292
5292
  const o = ue(e, "modelValue");
5293
5293
  return (t, n) => {
5294
- const i = v("v-btn");
5295
- return L(), P(i, {
5294
+ const i = C("v-btn");
5295
+ return L(), V(i, {
5296
5296
  class: "mr-3",
5297
5297
  variant: "outlined",
5298
5298
  density: "comfortable",
5299
- icon: o.value ? b(kt) : b(Nt),
5299
+ icon: o.value ? A(kt) : A(Nt),
5300
5300
  onClick: n[0] || (n[0] = (a) => o.value = !o.value)
5301
5301
  }, null, 8, ["icon"]);
5302
5302
  };
@@ -5307,58 +5307,58 @@ const me = {
5307
5307
  }, Po = /* @__PURE__ */ W({
5308
5308
  __name: "index",
5309
5309
  setup(e) {
5310
- const { t: o } = xe(), t = ee([]), n = () => {
5311
- var T;
5312
- const a = w();
5310
+ const { t: o } = De(), t = ee([]), n = () => {
5311
+ var E;
5312
+ const a = H();
5313
5313
  if (!a) {
5314
5314
  t.value = [];
5315
5315
  return;
5316
5316
  }
5317
- const r = [], c = a.getTopBlocks(!0), p = ((T = Y()) == null ? void 0 : T.id) ?? "";
5318
- c.forEach((f) => {
5319
- const I = f;
5317
+ const r = [], c = a.getTopBlocks(!0), p = ((E = D()) == null ? void 0 : E.id) ?? "";
5318
+ c.forEach((T) => {
5319
+ const I = T;
5320
5320
  if (I.type.startsWith("on_node_event_v"))
5321
5321
  console.log("1");
5322
5322
  else if (I.type.startsWith("procedure_def_v"))
5323
5323
  console.log("2");
5324
5324
  else {
5325
- const R = I.getRelativeToSurfaceXY();
5325
+ const O = I.getRelativeToSurfaceXY();
5326
5326
  r.push({
5327
5327
  id: I.id,
5328
- name: O.fffff,
5329
- x: R.x,
5330
- y: R.y,
5328
+ name: m.fffff,
5329
+ x: O.x,
5330
+ y: O.y,
5331
5331
  active: I.id === p
5332
5332
  });
5333
5333
  }
5334
5334
  }), t.value = r;
5335
5335
  };
5336
- Se(() => {
5336
+ Me(() => {
5337
5337
  de.on("codeUpdate", n);
5338
5338
  }), Ze(() => {
5339
5339
  de.off("codeUpdate", n);
5340
5340
  });
5341
5341
  const i = (a) => {
5342
- const r = w();
5342
+ const r = H();
5343
5343
  if (!r)
5344
5344
  return;
5345
5345
  const c = r.getBlockById(a.id);
5346
- c && (Ke(a.id), c.select());
5346
+ c && (Fe(a.id), c.select());
5347
5347
  };
5348
5348
  return (a, r) => {
5349
- const c = v("v-list-item-title"), p = v("v-list-item"), T = v("v-list");
5350
- return t.value.length > 0 ? (L(), P(T, { key: 0 }, {
5351
- default: K(() => [
5352
- (L(!0), X(et, null, tt(t.value, (f) => (L(), P(p, {
5353
- key: f.id,
5349
+ const c = C("v-list-item-title"), p = C("v-list-item"), E = C("v-list");
5350
+ return t.value.length > 0 ? (L(), V(E, { key: 0 }, {
5351
+ default: Y(() => [
5352
+ (L(!0), X(et, null, tt(t.value, (T) => (L(), V(p, {
5353
+ key: T.id,
5354
5354
  class: "d-flex justify-start",
5355
- active: f.active,
5356
- onClick: (I) => i(f)
5355
+ active: T.active,
5356
+ onClick: (I) => i(T)
5357
5357
  }, {
5358
- default: K(() => [
5358
+ default: Y(() => [
5359
5359
  B(c, null, {
5360
- default: K(() => [
5361
- ot(pe(f.name), 1)
5360
+ default: Y(() => [
5361
+ ot(pe(T.name), 1)
5362
5362
  ]),
5363
5363
  _: 2
5364
5364
  }, 1024)
@@ -5367,83 +5367,83 @@ const me = {
5367
5367
  }, 1032, ["active", "onClick"]))), 128))
5368
5368
  ]),
5369
5369
  _: 1
5370
- })) : (L(), X("span", Vo, pe(b(o)("x-block-lib.noOption")), 1));
5370
+ })) : (L(), X("span", Vo, pe(A(o)("x-block-lib.noOption")), 1));
5371
5371
  };
5372
5372
  }
5373
5373
  }), xo = { class: "text-subtitle-1 ml-3" }, Do = /* @__PURE__ */ W({
5374
5374
  __name: "index",
5375
5375
  setup(e) {
5376
- const { t: o } = xe(), t = Ct(), { sysBarAvail: n } = It(), { backgroundColor1: i } = Lt(), a = F(() => {
5377
- let T = "100%";
5378
- return t.mdAndUp.value && (T = "400px"), {
5376
+ const { t: o } = De(), t = Ct(), { sysBarAvail: n } = It(), { backgroundColor1: i } = Lt(), a = K(() => {
5377
+ let E = "100%";
5378
+ return t.mdAndUp.value && (E = "400px"), {
5379
5379
  background: i.value,
5380
- width: T,
5380
+ width: E,
5381
5381
  height: "100%"
5382
5382
  };
5383
- }), r = F(() => {
5384
- let T = 48;
5385
- return n.value && (T += 24), {
5383
+ }), r = K(() => {
5384
+ let E = 48;
5385
+ return n.value && (E += 24), {
5386
5386
  position: "relative",
5387
5387
  width: "100%",
5388
- height: `calc(100% - ${T}px)`
5388
+ height: `calc(100% - ${E}px)`
5389
5389
  };
5390
- }), c = F(() => ({
5390
+ }), c = K(() => ({
5391
5391
  height: "60px"
5392
- })), { open: p } = Pe("selectNodeDlg");
5393
- return (T, f) => {
5394
- const I = v("v-btn"), R = v("v-sheet"), m = v("v-icon"), x = v("v-dialog");
5395
- return L(), P(x, {
5396
- modelValue: b(p),
5397
- "onUpdate:modelValue": f[3] || (f[3] = (C) => nt(p) ? p.value = C : null),
5392
+ })), { open: p } = xe("selectNodeDlg");
5393
+ return (E, T) => {
5394
+ const I = C("v-btn"), O = C("v-sheet"), P = C("v-icon"), w = C("v-dialog");
5395
+ return L(), V(w, {
5396
+ modelValue: A(p),
5397
+ "onUpdate:modelValue": T[3] || (T[3] = (b) => nt(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: f[4] || (f[4] = it(le((C) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5402
+ onKeydown: T[4] || (T[4] = it(le((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5403
5403
  }, {
5404
- activator: K(({ props: C }) => [
5405
- B(I, st(C, {
5404
+ activator: Y(({ props: b }) => [
5405
+ B(I, st(b, {
5406
5406
  variant: "outlined",
5407
5407
  density: "comfortable",
5408
- icon: b(Bt)
5408
+ icon: A(Bt)
5409
5409
  }), null, 16, ["icon"])
5410
5410
  ]),
5411
- default: K(() => [
5412
- M("div", {
5411
+ default: Y(() => [
5412
+ S("div", {
5413
5413
  class: "w-100 h-100 d-flex flex-row-reverse",
5414
- onClick: f[1] || (f[1] = le((C) => p.value = !1, ["self"])),
5415
- onContextmenu: f[2] || (f[2] = le((C) => p.value = !1, ["self", "prevent"]))
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"]))
5416
5416
  }, [
5417
- M("div", {
5417
+ S("div", {
5418
5418
  class: "elevation-2",
5419
- style: H(a.value)
5419
+ style: F(a.value)
5420
5420
  }, [
5421
- b(n) ? (L(), P(R, {
5421
+ A(n) ? (L(), V(O, {
5422
5422
  key: 0,
5423
5423
  color: "transparent",
5424
5424
  height: 24
5425
5425
  })) : te("", !0),
5426
- B(R, {
5426
+ B(O, {
5427
5427
  class: "d-flex align-center px-3",
5428
5428
  color: "transparent",
5429
5429
  height: 48
5430
5430
  }, {
5431
- default: K(() => [
5432
- B(m, {
5433
- icon: b(At),
5434
- onClick: f[0] || (f[0] = (C) => p.value = !1)
5431
+ default: Y(() => [
5432
+ B(P, {
5433
+ icon: A(At),
5434
+ onClick: T[0] || (T[0] = (b) => p.value = !1)
5435
5435
  }, null, 8, ["icon"]),
5436
- M("span", xo, pe(b(o)("x-block-lib.navigator")), 1)
5436
+ S("span", xo, pe(A(o)("x-block-lib.navigator")), 1)
5437
5437
  ]),
5438
5438
  _: 1
5439
5439
  }),
5440
- M("div", {
5440
+ S("div", {
5441
5441
  class: "overflow-y-auto",
5442
- style: H(r.value)
5442
+ style: F(r.value)
5443
5443
  }, [
5444
5444
  B(Po),
5445
- M("div", {
5446
- style: H(c.value)
5445
+ S("div", {
5446
+ style: F(c.value)
5447
5447
  }, null, 4)
5448
5448
  ], 4)
5449
5449
  ], 4)
@@ -5453,7 +5453,57 @@ const me = {
5453
5453
  }, 8, ["modelValue"]);
5454
5454
  };
5455
5455
  }
5456
- }), Yo = { class: "position-relative w-100 h-100" }, Ko = /* @__PURE__ */ W({
5456
+ }), Se = {
5457
+ grid: {
5458
+ length: 2,
5459
+ snap: !0,
5460
+ spacing: 20
5461
+ },
5462
+ media: "https://cdn.z9os.com/lib/blockly/v11.0.0/media/",
5463
+ move: {
5464
+ drag: !0,
5465
+ scrollbars: !0,
5466
+ wheel: !0
5467
+ },
5468
+ readOnly: !1,
5469
+ theme: "light",
5470
+ trashcan: !1,
5471
+ zoom: {
5472
+ maxScale: 1,
5473
+ minScale: 0.1,
5474
+ scaleSpeed: 1.25,
5475
+ startScale: 1,
5476
+ wheel: !0
5477
+ }
5478
+ };
5479
+ function Yo(e, o, t) {
5480
+ let n;
5481
+ o === "app" ? t === "v1" && (n = Bo) : o === "func" ? t === "v1" && (n = So) : o === "flow" && t === "v1" && (n = Ro), console.assert(!!n), Se.toolbox = n;
5482
+ const i = Et(e, Se);
5483
+ return o === "app" ? t === "v1" && (i.registerToolboxCategoryCallback(
5484
+ fe.name,
5485
+ fe.callback
5486
+ ), i.registerToolboxCategoryCallback(
5487
+ k.name,
5488
+ k.callback
5489
+ ), i.registerToolboxCategoryCallback(
5490
+ N.name,
5491
+ N.callback
5492
+ )) : o === "func" ? t === "v1" && (i.registerToolboxCategoryCallback(
5493
+ k.name,
5494
+ k.callback
5495
+ ), i.registerToolboxCategoryCallback(
5496
+ N.name,
5497
+ N.callback
5498
+ )) : o === "flow" && t === "v1" && (i.registerToolboxCategoryCallback(
5499
+ k.name,
5500
+ k.callback
5501
+ ), i.registerToolboxCategoryCallback(
5502
+ N.name,
5503
+ N.callback
5504
+ )), i;
5505
+ }
5506
+ const Ko = { class: "position-relative w-100 h-100" }, Fo = /* @__PURE__ */ W({
5457
5507
  __name: "index",
5458
5508
  props: /* @__PURE__ */ Ae({
5459
5509
  type: {},
@@ -5467,31 +5517,9 @@ const me = {
5467
5517
  }),
5468
5518
  emits: /* @__PURE__ */ Ae(["ready", "change"], ["update:lock", "update:scale"]),
5469
5519
  setup(e, { expose: o, emit: t }) {
5470
- const n = yt(), { locale: i, dark: a } = mt(n), { open: r } = Pe("blocklyEditorFlyout"), c = ue(e, "lock"), p = ue(e, "scale"), T = e, f = t, I = ee(), R = {
5471
- grid: {
5472
- length: 2,
5473
- snap: !0,
5474
- spacing: 20
5475
- },
5476
- media: "https://cdn.z9os.com/lib/blockly/v11.0.0/media/",
5477
- move: {
5478
- drag: !0,
5479
- scrollbars: !0,
5480
- wheel: !0
5481
- },
5482
- readOnly: !1,
5483
- theme: a.value ? "dark" : "light",
5484
- trashcan: !1,
5485
- zoom: {
5486
- maxScale: 1,
5487
- minScale: 0.1,
5488
- scaleSpeed: 1.25,
5489
- startScale: 1,
5490
- wheel: !0
5491
- }
5492
- };
5493
- let m;
5494
- const x = ee(!1), C = ee(!1), we = F(() => ({
5520
+ const n = yt(), { locale: i, dark: a } = mt(n), { open: r } = xe("blocklyEditorFlyout"), c = ue(e, "lock"), p = ue(e, "scale"), E = e, T = t, I = ee();
5521
+ let O;
5522
+ const P = ee(!1), w = ee(!1), b = K(() => ({
5495
5523
  position: "absolute",
5496
5524
  background: a.value ? "#0000007f" : "#ffffff7f",
5497
5525
  top: "1px",
@@ -5500,7 +5528,7 @@ const me = {
5500
5528
  height: "calc(100% - 1px)",
5501
5529
  pointerEvents: "none",
5502
5530
  zIndex: 999
5503
- })), Ge = F(() => ({
5531
+ })), Ge = K(() => ({
5504
5532
  position: "absolute",
5505
5533
  background: a.value ? "#0000007f" : "#ffffff7f",
5506
5534
  top: "0px",
@@ -5508,73 +5536,52 @@ const me = {
5508
5536
  width: "100%",
5509
5537
  height: "100%",
5510
5538
  pointerEvents: "none"
5511
- })), $e = F(() => ({
5539
+ })), $e = K(() => ({
5512
5540
  position: "absolute",
5513
5541
  top: "0px",
5514
5542
  right: "0px",
5515
5543
  zIndex: 20
5516
5544
  }));
5517
- Se(async () => {
5518
- if (!I.value)
5545
+ Me(async () => {
5546
+ if (!I.value) {
5547
+ console.assert(!1);
5519
5548
  return;
5520
- await Re(i.value);
5521
- let d;
5522
- T.type === "app" ? T.version === "v1" && (d = Bo) : T.type === "func" ? T.version === "v1" && (d = So) : T.type === "flow" && T.version === "v1" && (d = Ro), R.toolbox = d, m = Et(I.value, R), T.type === "app" ? T.version === "v1" && (m.registerToolboxCategoryCallback(
5523
- fe.name,
5524
- fe.callback
5525
- ), m.registerToolboxCategoryCallback(
5526
- k.name,
5527
- k.callback
5528
- ), m.registerToolboxCategoryCallback(
5529
- N.name,
5530
- N.callback
5531
- )) : T.type === "func" ? T.version === "v1" && (m.registerToolboxCategoryCallback(
5532
- k.name,
5533
- k.callback
5534
- ), m.registerToolboxCategoryCallback(
5535
- N.name,
5536
- N.callback
5537
- )) : T.type === "flow" && T.version === "v1" && (m.registerToolboxCategoryCallback(
5538
- k.name,
5539
- k.callback
5540
- ), m.registerToolboxCategoryCallback(
5541
- N.name,
5542
- N.callback
5543
- )), m.addChangeListener(h.disableOrphans), m.addChangeListener(je), m.setScale(p.value), f("ready", m);
5549
+ }
5550
+ await Re(i.value), O = Yo(I.value, E.type, E.version), O.addChangeListener(f.disableOrphans), O.addChangeListener(je), O.setScale(p.value), T("ready", O);
5544
5551
  }), lt(() => {
5545
5552
  r.value = !1;
5546
5553
  });
5547
5554
  function ve() {
5548
- m && ht(m);
5555
+ O && ht(O);
5549
5556
  }
5550
- function je(d) {
5551
- if (d.type === h.FINISHED_LOADING) {
5552
- mo(), de.emit("codeUpdate"), x.value = !1;
5557
+ function je(h) {
5558
+ if (h.type === f.FINISHED_LOADING) {
5559
+ mo(), de.emit("codeUpdate"), P.value = !1;
5553
5560
  return;
5554
5561
  }
5555
- x.value || (d.type === h.BLOCK_DRAG && (d.isStart ? C.value = !0 : C.value = !1), f("change", d));
5562
+ P.value || (h.type === f.BLOCK_DRAG && (h.isStart ? w.value = !0 : w.value = !1), T("change", h));
5556
5563
  }
5557
5564
  return o({ load: () => {
5558
- x.value = !0;
5559
- }, save: () => {
5560
- } }), G(i, (d) => {
5561
- Re(d);
5562
- }), G(a, (d) => {
5563
- ko(d ? "dark" : "light");
5564
- }), G(r, (d) => {
5565
- var S;
5566
- d || (S = m.getToolbox()) == null || S.clearSelection();
5565
+ P.value = !0;
5566
+ }, resize: () => {
5567
+ } }), G(i, (h) => {
5568
+ Re(h);
5569
+ }), G(a, (h) => {
5570
+ ko(h ? "dark" : "light");
5571
+ }), G(r, (h) => {
5572
+ var R;
5573
+ h || (R = O.getToolbox()) == null || R.clearSelection();
5567
5574
  }), G(
5568
- () => T.active,
5569
- (d) => {
5570
- d && setTimeout(() => ve(), 1);
5575
+ () => E.active,
5576
+ (h) => {
5577
+ h && setTimeout(() => ve(), 1);
5571
5578
  }
5572
- ), G(p, (d) => {
5573
- m.setScale(d);
5574
- }), (d, S) => {
5575
- const Xe = v("v-icon"), We = v("x-loading"), Je = at("resize");
5576
- return L(), X("div", Yo, [
5577
- rt(M("div", {
5579
+ ), G(p, (h) => {
5580
+ O.setScale(h);
5581
+ }), (h, R) => {
5582
+ const Xe = C("v-icon"), We = C("x-loading"), Je = at("resize");
5583
+ return L(), X("div", Ko, [
5584
+ rt(S("div", {
5578
5585
  id: "blocklyEditor",
5579
5586
  ref_key: "blocklyDiv",
5580
5587
  ref: I,
@@ -5582,46 +5589,48 @@ const me = {
5582
5589
  }, null, 512), [
5583
5590
  [Je, ve]
5584
5591
  ]),
5585
- C.value ? (L(), X("div", {
5592
+ w.value ? (L(), X("div", {
5586
5593
  key: 0,
5587
5594
  class: "d-flex flex-column align-center justify-center",
5588
- style: H(we.value)
5595
+ style: F(b.value)
5589
5596
  }, [
5590
5597
  B(Xe, {
5591
- icon: b(bt),
5598
+ icon: A(bt),
5592
5599
  size: "x-large"
5593
5600
  }, null, 8, ["icon"])
5594
5601
  ], 4)) : te("", !0),
5595
5602
  c.value ? (L(), X("div", {
5596
5603
  key: 1,
5597
- style: H(Ge.value)
5604
+ style: F(Ge.value)
5598
5605
  }, null, 4)) : te("", !0),
5599
- M("div", {
5606
+ S("div", {
5600
5607
  class: "d-flex align-end pt-3 pr-3",
5601
- style: H($e.value)
5608
+ style: F($e.value)
5602
5609
  }, [
5603
5610
  B(Mo),
5604
5611
  B(Uo, {
5605
5612
  modelValue: c.value,
5606
- "onUpdate:modelValue": S[0] || (S[0] = (ze) => c.value = ze)
5613
+ "onUpdate:modelValue": R[0] || (R[0] = (ze) => c.value = ze)
5607
5614
  }, null, 8, ["modelValue"]),
5608
5615
  B(Do)
5609
5616
  ], 4),
5610
- x.value ? (L(), P(We, {
5617
+ P.value ? (L(), V(We, {
5611
5618
  key: 2,
5612
5619
  "z-index": 99
5613
5620
  })) : te("", !0)
5614
5621
  ]);
5615
5622
  };
5616
5623
  }
5617
- }), Fo = (e) => {
5618
- e.component("XBlockly", Ko);
5624
+ }), Ho = (e) => {
5625
+ e.component("x-blockly", Fo);
5619
5626
  };
5620
- async function Qo(e) {
5621
- return (await Ye(/* @__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;
5627
+ async function qo(e) {
5628
+ 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;
5622
5629
  }
5623
- const qo = { install: Fo };
5630
+ const Zo = { install: Ho };
5624
5631
  export {
5625
- qo as default,
5626
- Qo as loadLocaleMessageBlock
5632
+ Fo as XBlockly,
5633
+ Zo as default,
5634
+ Ho as install,
5635
+ qo as loadLocaleMessageBlock
5627
5636
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.4.7",
4
+ "version": "0.4.9",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",