x-block-lib 0.3.22 → 0.3.23

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.
@@ -15856,15 +15856,15 @@ export {
15856
15856
  _b as b,
15857
15857
  I_ as c,
15858
15858
  mb as d,
15859
- Db as e,
15860
- Sb as f,
15861
- vb as g,
15862
- xm as h,
15859
+ vb as e,
15860
+ Db as f,
15861
+ Tb as g,
15862
+ Sb as h,
15863
15863
  Rb as i,
15864
15864
  Zb as j,
15865
- ab as k,
15866
- x_ as l,
15867
- Tb as m,
15865
+ xm as k,
15866
+ ab as l,
15867
+ x_ as m,
15868
15868
  yb as n,
15869
15869
  Wb as o,
15870
15870
  Gb as s,
@@ -2,6 +2,7 @@ interface Props {
2
2
  type: 'app';
3
3
  version: 'v1';
4
4
  active: boolean;
5
+ scale: number;
5
6
  }
6
7
  declare let __VLS_typeProps: Props;
7
8
  type __VLS_PublicProps = {
@@ -1,6 +1,7 @@
1
1
  import './blocks';
2
2
  import './dialog';
3
3
  export * from './locale';
4
+ export * from './misc';
4
5
  import './plugins';
5
6
  export * from './theme';
6
7
  export * from './toolbox';
@@ -0,0 +1,3 @@
1
+ export declare function jumpBlock(id: string): void;
2
+ export declare function jumpRootBlock(id: string): void;
3
+ export declare function jumpFirstRootBlock(): void;
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
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
- import { defineComponent as B, resolveComponent as b, openBlock as O, createBlock as F, unref as S, useModel as X, computed as I, withCtx as U, createVNode as h, mergeProps as se, createElementVNode as V, normalizeStyle as E, mergeModels as H, ref as Y, onMounted as le, onBeforeUnmount as ae, watch as L, resolveDirective as ie, createElementBlock as R, withDirectives as ce, createCommentVNode as G } from "vue";
3
- import { storeToRefs as ue } from "pinia";
4
- import { openConfirmDlg as _e, openPromptDlg as pe, useGlobalStore as fe, useViewStack as de } from "x-essential-lib";
5
- import { d as C, j as ye, O as ge, E as p, u as i, M as f, C as me, a as y, b as j, s as he, S as u, c as w, g as k, i as T, e as K, f as v, h as m, k as W, G as M, B as be, T as x, l as J, m as $, n as Oe, o as Ce } from "./blockly-kru4jhu1.js";
6
- var ke = "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", ve = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", Se = "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", Le = "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", Te = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
7
- C([
2
+ import { defineComponent as M, resolveComponent as m, openBlock as d, createBlock as L, unref as R, useModel as $, computed as w, ref as K, onMounted as Z, onUnmounted as ue, withCtx as E, createVNode as S, mergeProps as _e, createElementVNode as G, normalizeStyle as V, createElementBlock as A, Fragment as pe, renderList as fe, createTextVNode as de, toDisplayString as ye, mergeModels as X, onBeforeUnmount as ge, watch as B, resolveDirective as me, withDirectives as he, createCommentVNode as D } from "vue";
3
+ import { d as I, j as be, O as ke, E as y, u as c, M as g, C as Ce, a as h, b as q, s as Oe, g as T, S as p, c as U, e as v, i as P, f as Y, h as x, k as C, l as j, G as H, B as ve, T as F, m as Q, n as Se, o as Le } from "./blockly-ijxiuski.js";
4
+ import { storeToRefs as Te } from "pinia";
5
+ import { openConfirmDlg as Ie, openPromptDlg as Ee, eventBus as W, useGlobalStore as Be, useViewStack as xe } from "x-essential-lib";
6
+ var Ae = "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", Re = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", Pe = "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", we = "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", Ke = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
7
+ I([
8
8
  {
9
9
  type: "boolean_v1",
10
10
  message0: "%1",
@@ -24,16 +24,16 @@ C([
24
24
  helpUrl: "%{BKY_LOGIC_V1_BOOLEAN_HELPURL}"
25
25
  }
26
26
  ]);
27
- ye.forBlock.boolean_v1 = function(t) {
28
- return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false", ge.ATOMIC];
27
+ be.forBlock.boolean_v1 = function(t) {
28
+ return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false", ke.ATOMIC];
29
29
  };
30
- const Ie = {
30
+ const Ve = {
31
31
  elseIfCount_: 0,
32
32
  hasElse_: !1,
33
33
  mutationToDom: function() {
34
34
  if (this.elseIfCount_ <= 0 && !this.hasElse_)
35
35
  return null;
36
- const t = i.xml.createElement("mutation");
36
+ const t = c.xml.createElement("mutation");
37
37
  return this.elseIfCount_ > 0 && t.setAttribute("elseIf", String(this.elseIfCount_)), this.hasElse_ && t.setAttribute("else", "TRUE"), t;
38
38
  },
39
39
  domToMutation: function(t) {
@@ -51,23 +51,23 @@ const Ie = {
51
51
  decompose: function(t) {
52
52
  const e = t.newBlock("if_if_v1");
53
53
  e.initSvg();
54
- let n = e.nextConnection;
55
- for (let o = 0; o < this.elseIfCount_; o++) {
54
+ let o = e.nextConnection;
55
+ for (let n = 0; n < this.elseIfCount_; n++) {
56
56
  const r = t.newBlock(
57
57
  "if_else_if_v1"
58
58
  );
59
- r.initSvg(), n.connect(r.previousConnection), n = r.nextConnection;
59
+ r.initSvg(), o.connect(r.previousConnection), o = r.nextConnection;
60
60
  }
61
61
  if (this.hasElse_) {
62
- const o = t.newBlock("if_else_v1");
63
- o.initSvg(), n.connect(o.previousConnection);
62
+ const n = t.newBlock("if_else_v1");
63
+ n.initSvg(), o.connect(n.previousConnection);
64
64
  }
65
65
  return e;
66
66
  },
67
67
  compose: function(t) {
68
68
  let e = t.nextConnection.targetBlock();
69
69
  this.elseIfCount_ = 0, this.hasElse_ = !1;
70
- const n = [null], o = [null];
70
+ const o = [null], n = [null];
71
71
  let r = null;
72
72
  for (; e; ) {
73
73
  if (e.isInsertionMarker()) {
@@ -76,9 +76,9 @@ const Ie = {
76
76
  }
77
77
  switch (e.type) {
78
78
  case "if_else_if_v1":
79
- this.elseIfCount_++, n.push(
79
+ this.elseIfCount_++, o.push(
80
80
  e.valueConnection_
81
- ), o.push(
81
+ ), n.push(
82
82
  e.statementConnection_
83
83
  );
84
84
  break;
@@ -91,13 +91,13 @@ const Ie = {
91
91
  e = e.getNextBlock();
92
92
  }
93
93
  this.updateShape_(), this.reconnectChildBlocks_(
94
- n,
95
94
  o,
95
+ n,
96
96
  r
97
97
  );
98
98
  },
99
99
  saveConnections: function(t) {
100
- let e = t.nextConnection.targetBlock(), n = 1;
100
+ let e = t.nextConnection.targetBlock(), o = 1;
101
101
  for (; e; ) {
102
102
  if (e.isInsertionMarker()) {
103
103
  e = e.getNextBlock();
@@ -105,13 +105,13 @@ const Ie = {
105
105
  }
106
106
  switch (e.type) {
107
107
  case "if_else_if_v1": {
108
- const o = this.getInput("IF" + n), r = this.getInput("DO" + n);
109
- e.valueConnection_ = o && o.connection.targetConnection, e.statementConnection_ = r && r.connection.targetConnection, n++;
108
+ const n = this.getInput("IF" + o), r = this.getInput("DO" + o);
109
+ e.valueConnection_ = n && n.connection.targetConnection, e.statementConnection_ = r && r.connection.targetConnection, o++;
110
110
  break;
111
111
  }
112
112
  case "if_else_v1": {
113
- const o = this.getInput("ELSE");
114
- e.statementConnection_ = o && o.connection.targetConnection;
113
+ const n = this.getInput("ELSE");
114
+ e.statementConnection_ = n && n.connection.targetConnection;
115
115
  break;
116
116
  }
117
117
  default:
@@ -122,16 +122,16 @@ const Ie = {
122
122
  },
123
123
  rebuildShape_: function() {
124
124
  const t = [null], e = [null];
125
- let n = null;
126
- this.getInput("ELSE") && (n = this.getInput("ELSE").connection.targetConnection);
127
- for (let o = 1; this.getInput("IF" + o); o++) {
128
- const r = this.getInput("IF" + o), s = this.getInput("DO" + o);
125
+ let o = null;
126
+ this.getInput("ELSE") && (o = this.getInput("ELSE").connection.targetConnection);
127
+ for (let n = 1; this.getInput("IF" + n); n++) {
128
+ const r = this.getInput("IF" + n), s = this.getInput("DO" + n);
129
129
  t.push(r.connection.targetConnection), e.push(s.connection.targetConnection);
130
130
  }
131
131
  this.updateShape_(), this.reconnectChildBlocks_(
132
132
  t,
133
133
  e,
134
- n
134
+ o
135
135
  );
136
136
  },
137
137
  updateShape_: function() {
@@ -139,23 +139,23 @@ const Ie = {
139
139
  for (let t = 1; this.getInput("IF" + t); t++)
140
140
  this.removeInput("IF" + t), this.removeInput("DO" + t);
141
141
  for (let t = 1; t <= this.elseIfCount_; t++)
142
- this.appendValueInput("IF" + t).setCheck("Boolean").appendField(f.LOGIC_ELSE_IF), this.appendStatementInput("DO" + t).appendField(f.LOGIC_DO);
143
- this.hasElse_ && this.appendStatementInput("ELSE").appendField(f.LOGIC_ELSE);
142
+ this.appendValueInput("IF" + t).setCheck("Boolean").appendField(g.LOGIC_ELSE_IF), this.appendStatementInput("DO" + t).appendField(g.LOGIC_DO);
143
+ this.hasElse_ && this.appendStatementInput("ELSE").appendField(g.LOGIC_ELSE);
144
144
  },
145
- reconnectChildBlocks_: function(t, e, n) {
146
- var o, r;
145
+ reconnectChildBlocks_: function(t, e, o) {
146
+ var n, r;
147
147
  for (let s = 1; s <= this.elseIfCount_; s++)
148
- (o = t[s]) == null || o.reconnect(this, "IF" + s), (r = e[s]) == null || r.reconnect(this, "DO" + s);
149
- n == null || n.reconnect(this, "ELSE");
148
+ (n = t[s]) == null || n.reconnect(this, "IF" + s), (r = e[s]) == null || r.reconnect(this, "DO" + s);
149
+ o == null || o.reconnect(this, "ELSE");
150
150
  }
151
151
  };
152
- p.registerMutator(
152
+ y.registerMutator(
153
153
  "if_v1_mutator",
154
- Ie,
154
+ Ve,
155
155
  void 0,
156
156
  ["if_else_if_v1", "if_else_v1"]
157
157
  );
158
- C([
158
+ I([
159
159
  {
160
160
  type: "if_v1",
161
161
  message0: "%{BKY_LOGIC_IF} %1",
@@ -203,12 +203,12 @@ C([
203
203
  style: "logic_blocks"
204
204
  }
205
205
  ]);
206
- const Ee = {
206
+ const Me = {
207
207
  customContextMenu: function(t) {
208
208
  if (this.isInFlyout)
209
209
  return;
210
- const e = this.getField("VAR"), n = e.getVariable(), o = n == null ? void 0 : n.name;
211
- if (!this.isCollapsed() && o) {
210
+ const e = this.getField("VAR"), o = e.getVariable(), n = o == null ? void 0 : o.name;
211
+ if (!this.isCollapsed() && n) {
212
212
  const r = {
213
213
  type: "variables_get",
214
214
  fields: {
@@ -217,33 +217,33 @@ const Ee = {
217
217
  };
218
218
  t.push({
219
219
  enabled: !0,
220
- text: f.VARIABLES_SET_CREATE_GET.replace("%1", o),
221
- callback: me.callbackFactory(this, r)
220
+ text: g.VARIABLES_SET_CREATE_GET.replace("%1", n),
221
+ callback: Ce.callbackFactory(this, r)
222
222
  });
223
223
  }
224
224
  }
225
225
  };
226
- p.registerMixin(
226
+ y.registerMixin(
227
227
  "contextMenu_newGetVariableBlock_v1",
228
- Ee
228
+ Me
229
229
  );
230
- p.register(
230
+ y.register(
231
231
  "flow_control_tooltip_v1",
232
- p.buildTooltipForDropdown("MODE", {
232
+ y.buildTooltipForDropdown("MODE", {
233
233
  BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
234
234
  CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
235
235
  })
236
236
  );
237
- const Be = /* @__PURE__ */ new Set([
237
+ const Fe = /* @__PURE__ */ new Set([
238
238
  "repeat_v1",
239
239
  "for_each_v1",
240
240
  "for_v1",
241
241
  "while_until_v1"
242
- ]), xe = {
242
+ ]), Ne = {
243
243
  getSurroundLoop: function() {
244
244
  let t = this;
245
245
  do {
246
- if (Be.has(t.type))
246
+ if (Fe.has(t.type))
247
247
  return !0;
248
248
  t = t == null ? void 0 : t.getSurroundParent();
249
249
  } while (t);
@@ -251,24 +251,24 @@ const Be = /* @__PURE__ */ new Set([
251
251
  },
252
252
  onchange: function(t) {
253
253
  const e = this.workspace;
254
- if (!e.isDragging || e.isDragging() || t.type !== y.BLOCK_MOVE && t.type !== y.BLOCK_CREATE)
254
+ if (!e.isDragging || e.isDragging() || t.type !== h.BLOCK_MOVE && t.type !== h.BLOCK_CREATE)
255
255
  return;
256
- const n = this.getSurroundLoop();
257
- if (console.log(t.type, n), this.setWarningText(
258
- n ? null : f.LOOP_FLOW_CONTROL_WARNING
256
+ const o = this.getSurroundLoop();
257
+ if (console.log(t.type, o), this.setWarningText(
258
+ o ? null : g.LOOP_FLOW_CONTROL_WARNING
259
259
  ), !this.isInFlyout)
260
260
  try {
261
- y.setRecordUndo(!1), this.setDisabledReason(!n, "FLOW_CONTROL_NOT_IN_LOOP");
261
+ h.setRecordUndo(!1), this.setDisabledReason(!o, "FLOW_CONTROL_NOT_IN_LOOP");
262
262
  } finally {
263
- y.setRecordUndo(!0);
263
+ h.setRecordUndo(!0);
264
264
  }
265
265
  }
266
266
  };
267
- p.registerMixin(
267
+ y.registerMixin(
268
268
  "flow_control_in_loop_check_v1",
269
- xe
269
+ Ne
270
270
  );
271
- C([
271
+ I([
272
272
  {
273
273
  type: "flow_control_v1",
274
274
  message0: "%1",
@@ -289,14 +289,14 @@ C([
289
289
  extensions: ["flow_control_tooltip_v1", "flow_control_in_loop_check_v1"]
290
290
  }
291
291
  ]);
292
- p.register(
292
+ y.register(
293
293
  "for_tooltip_v1",
294
- p.buildTooltipWithFieldText(
294
+ y.buildTooltipWithFieldText(
295
295
  "%{BKY_LOOP_V1_FOR_TOOLTIP}",
296
296
  "VAR"
297
297
  )
298
298
  );
299
- C([
299
+ I([
300
300
  {
301
301
  type: "for_v1",
302
302
  message0: "%{BKY_LOOP_V1_FOR_TITLE}",
@@ -340,14 +340,14 @@ C([
340
340
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
341
341
  }
342
342
  ]);
343
- p.register(
343
+ y.register(
344
344
  "for_each_tooltip_v1",
345
- p.buildTooltipWithFieldText(
345
+ y.buildTooltipWithFieldText(
346
346
  "%{BKY_LOOP_V1_FOR_EACH_TOOLTIP}",
347
347
  "VAR"
348
348
  )
349
349
  );
350
- C([
350
+ I([
351
351
  {
352
352
  type: "for_each_v1",
353
353
  message0: "%{BKY_LOOP_V1_FOR_EACH_TITLE}",
@@ -377,14 +377,14 @@ C([
377
377
  extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
378
378
  }
379
379
  ]);
380
- p.register(
380
+ y.register(
381
381
  "while_until_tooltip_v1",
382
- p.buildTooltipForDropdown("MODE", {
382
+ y.buildTooltipForDropdown("MODE", {
383
383
  WHILE: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE}",
384
384
  UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
385
385
  })
386
386
  );
387
- C([
387
+ I([
388
388
  {
389
389
  type: "while_until_v1",
390
390
  message0: "%1 %2",
@@ -417,172 +417,193 @@ C([
417
417
  extensions: ["while_until_tooltip_v1"]
418
418
  }
419
419
  ]);
420
- j.setConfirm(async (t, e) => {
421
- const n = await _e({
420
+ q.setConfirm(async (t, e) => {
421
+ const o = await Ie({
422
422
  title: "",
423
423
  text: t
424
424
  });
425
- e(!!n);
425
+ e(!!o);
426
426
  });
427
- j.setPrompt(async (t, e, n) => {
428
- const o = await pe({
427
+ q.setPrompt(async (t, e, o) => {
428
+ const n = await Ee({
429
429
  title: "",
430
430
  value: e
431
431
  });
432
- n(o);
432
+ o(n);
433
433
  });
434
- const Ae = (t, e, n) => {
435
- const o = t[e];
436
- return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((r, s) => {
434
+ const De = (t, e, o) => {
435
+ const n = t[e];
436
+ return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, s) => {
437
437
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
438
438
  s.bind(
439
439
  null,
440
440
  new Error(
441
- "Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : "")
441
+ "Unknown variable dynamic import: " + e + (e.split("/").length !== o ? ". Note that variables only represent file names one level deep." : "")
442
442
  )
443
443
  )
444
444
  );
445
445
  });
446
446
  };
447
- async function z(t) {
448
- const e = await Ae(/* @__PURE__ */ Object.assign({ "./msg/en/index.ts": () => import("./en-jrrs2wmb.js"), "./msg/zhHans/index.ts": () => import("./zhHans-jrrs2wmb.js") }), `./msg/${t}/index.ts`, 4);
449
- he(e.default);
447
+ async function J(t) {
448
+ const e = await De(/* @__PURE__ */ Object.assign({ "./msg/en/index.ts": () => import("./en-jrrs2wmb.js"), "./msg/zhHans/index.ts": () => import("./zhHans-jrrs2wmb.js") }), `./msg/${t}/index.ts`, 4);
449
+ Oe(e.default);
450
+ }
451
+ function ee(t) {
452
+ const e = T();
453
+ if (!e)
454
+ return;
455
+ const o = e.getBlockById(t);
456
+ if (!o)
457
+ return;
458
+ const n = o.getRootBlock();
459
+ if (!n)
460
+ return;
461
+ const r = n.getRelativeToSurfaceXY(), s = r.x * e.scale, l = r.y * e.scale;
462
+ e.scroll(-s, -l);
450
463
  }
451
- class Pe {
452
- init({ contextMenu: e = !0, shortcut: n = !0 } = {
464
+ function Ue() {
465
+ var o;
466
+ const t = T();
467
+ if (!t)
468
+ return;
469
+ const e = (o = t.getTopBlocks(!0)) == null ? void 0 : o[0];
470
+ e && ee(e.id);
471
+ }
472
+ class Ye {
473
+ init({ contextMenu: e = !0, shortcut: o = !0 } = {
453
474
  contextMenu: !0,
454
475
  shortcut: !0
455
476
  }) {
456
- e && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), n && (u.registry.unregister(
457
- w.names.COPY
458
- ), u.registry.unregister(
459
- w.names.CUT
460
- ), u.registry.unregister(
461
- w.names.PASTE
477
+ e && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), o && (p.registry.unregister(
478
+ U.names.COPY
479
+ ), p.registry.unregister(
480
+ U.names.CUT
481
+ ), p.registry.unregister(
482
+ U.names.PASTE
462
483
  ), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
463
484
  }
464
485
  blockCopyToStorageContextMenu() {
465
486
  const e = {
466
487
  displayText: function() {
467
- return f.CROSS_TAB_COPY ? f.CROSS_TAB_COPY : "Copy";
488
+ return g.CROSS_TAB_COPY ? g.CROSS_TAB_COPY : "Copy";
468
489
  },
469
490
  preconditionFn: function() {
470
- const n = k();
471
- return !n || !T(n) || !n.isDeletable() || !K(n) || !n.isMovable() || !v(n) ? "disabled" : "enabled";
491
+ const o = v();
492
+ return !o || !P(o) || !o.isDeletable() || !Y(o) || !o.isMovable() || !x(o) ? "disabled" : "enabled";
472
493
  },
473
- callback: function(n) {
474
- var o;
494
+ callback: function(o) {
495
+ var n;
475
496
  localStorage.setItem(
476
497
  "blocklyStash",
477
- JSON.stringify((o = n.block) == null ? void 0 : o.toCopyData())
498
+ JSON.stringify((n = o.block) == null ? void 0 : n.toCopyData())
478
499
  );
479
500
  },
480
- scopeType: m.ScopeType.BLOCK,
501
+ scopeType: C.ScopeType.BLOCK,
481
502
  id: "blockCopyToStorage",
482
503
  weight: 0
483
504
  };
484
- m.registry.register(e);
505
+ C.registry.register(e);
485
506
  }
486
507
  blockPasteFromStorageContextMenu() {
487
508
  const e = {
488
509
  displayText: function() {
489
- return f.CROSS_TAB_PASTE ? f.CROSS_TAB_PASTE : "Paste";
510
+ return g.CROSS_TAB_PASTE ? g.CROSS_TAB_PASTE : "Paste";
490
511
  },
491
- preconditionFn: function(n) {
512
+ preconditionFn: function(o) {
492
513
  var s;
493
- const o = localStorage.getItem("blocklyStash");
494
- if (!o)
514
+ const n = localStorage.getItem("blocklyStash");
515
+ if (!n)
495
516
  return "disabled";
496
- const r = JSON.parse(o);
497
- return !r || !((s = n.workspace) != null && s.isCapacityAvailable(r.typeCounts)) ? "disabled" : "enabled";
517
+ const r = JSON.parse(n);
518
+ return !r || !((s = o.workspace) != null && s.isCapacityAvailable(r.typeCounts)) ? "disabled" : "enabled";
498
519
  },
499
- callback: function(n) {
500
- const o = localStorage.getItem("blocklyStash");
501
- if (!o)
520
+ callback: function(o) {
521
+ const n = localStorage.getItem("blocklyStash");
522
+ if (!n)
502
523
  return;
503
- const r = JSON.parse(o);
504
- r && n.workspace && W.paste(r, n.workspace);
524
+ const r = JSON.parse(n);
525
+ r && o.workspace && j.paste(r, o.workspace);
505
526
  },
506
- scopeType: m.ScopeType.WORKSPACE,
527
+ scopeType: C.ScopeType.WORKSPACE,
507
528
  id: "blockPasteFromStorage",
508
529
  weight: 0
509
530
  };
510
- m.registry.register(e);
531
+ C.registry.register(e);
511
532
  }
512
533
  blockCopyToStorageShortcut() {
513
- const e = u.registry.createSerializedKey(
514
- i.KeyCodes.C,
515
- [i.KeyCodes.CTRL]
516
- ), n = u.registry.createSerializedKey(
517
- i.KeyCodes.C,
518
- [i.KeyCodes.ALT]
519
- ), o = u.registry.createSerializedKey(
520
- i.KeyCodes.C,
521
- [i.KeyCodes.META]
534
+ const e = p.registry.createSerializedKey(
535
+ c.KeyCodes.C,
536
+ [c.KeyCodes.CTRL]
537
+ ), o = p.registry.createSerializedKey(
538
+ c.KeyCodes.C,
539
+ [c.KeyCodes.ALT]
540
+ ), n = p.registry.createSerializedKey(
541
+ c.KeyCodes.C,
542
+ [c.KeyCodes.META]
522
543
  ), r = {
523
544
  name: "copy",
524
545
  preconditionFn: function(s) {
525
- if (s.options.readOnly || M.inProgress())
546
+ if (s.options.readOnly || H.inProgress())
526
547
  return !1;
527
- const l = k();
528
- return !(!l || !T(l) || !l.isDeletable() || !K(l) || !l.isMovable() || !v(l));
548
+ const l = v();
549
+ return !(!l || !P(l) || !l.isDeletable() || !Y(l) || !l.isMovable() || !x(l));
529
550
  },
530
551
  callback: function(s, l) {
531
552
  l.preventDefault();
532
- const a = k();
533
- if (!a || !v(a))
553
+ const a = v();
554
+ if (!a || !x(a))
534
555
  return !1;
535
- const _ = a.toCopyData();
536
- return _ ? (s.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(_)), !0) : !1;
556
+ const u = a.toCopyData();
557
+ return u ? (s.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(u)), !0) : !1;
537
558
  },
538
- keyCodes: [e, n, o]
559
+ keyCodes: [e, o, n]
539
560
  };
540
- u.registry.register(r);
561
+ p.registry.register(r);
541
562
  }
542
563
  blockCutToStorageShortcut() {
543
- const e = u.registry.createSerializedKey(
544
- i.KeyCodes.X,
545
- [i.KeyCodes.CTRL]
546
- ), n = u.registry.createSerializedKey(
547
- i.KeyCodes.X,
548
- [i.KeyCodes.ALT]
549
- ), o = u.registry.createSerializedKey(
550
- i.KeyCodes.X,
551
- [i.KeyCodes.META]
564
+ const e = p.registry.createSerializedKey(
565
+ c.KeyCodes.X,
566
+ [c.KeyCodes.CTRL]
567
+ ), o = p.registry.createSerializedKey(
568
+ c.KeyCodes.X,
569
+ [c.KeyCodes.ALT]
570
+ ), n = p.registry.createSerializedKey(
571
+ c.KeyCodes.X,
572
+ [c.KeyCodes.META]
552
573
  ), r = {
553
574
  name: "cut",
554
575
  preconditionFn: function(s) {
555
- if (s.options.readOnly || M.inProgress())
576
+ if (s.options.readOnly || H.inProgress())
556
577
  return !1;
557
- const l = k();
558
- return !(!l || !T(l) || !l.isDeletable() || !K(l) || !l.isMovable() || !v(l) || l.workspace.isFlyout);
578
+ const l = v();
579
+ return !(!l || !P(l) || !l.isDeletable() || !Y(l) || !l.isMovable() || !x(l) || l.workspace.isFlyout);
559
580
  },
560
581
  callback: function(s, l) {
561
582
  l.preventDefault();
562
- const a = k();
563
- if (!a || !T(a) || !a.isDeletable() || !v(a))
583
+ const a = v();
584
+ if (!a || !P(a) || !a.isDeletable() || !x(a))
564
585
  return !1;
565
- const _ = a.toCopyData();
566
- return _ ? (localStorage.setItem("blocklyStash", JSON.stringify(_)), a instanceof be ? a.checkAndDelete() : a.dispose(), !0) : !1;
586
+ const u = a.toCopyData();
587
+ return u ? (localStorage.setItem("blocklyStash", JSON.stringify(u)), a instanceof ve ? a.checkAndDelete() : a.dispose(), !0) : !1;
567
588
  },
568
- keyCodes: [e, n, o]
589
+ keyCodes: [e, o, n]
569
590
  };
570
- u.registry.register(r);
591
+ p.registry.register(r);
571
592
  }
572
593
  blockPasteFromStorageShortcut() {
573
- const e = u.registry.createSerializedKey(
574
- i.KeyCodes.V,
575
- [i.KeyCodes.CTRL]
576
- ), n = u.registry.createSerializedKey(
577
- i.KeyCodes.V,
578
- [i.KeyCodes.ALT]
579
- ), o = u.registry.createSerializedKey(
580
- i.KeyCodes.V,
581
- [i.KeyCodes.META]
594
+ const e = p.registry.createSerializedKey(
595
+ c.KeyCodes.V,
596
+ [c.KeyCodes.CTRL]
597
+ ), o = p.registry.createSerializedKey(
598
+ c.KeyCodes.V,
599
+ [c.KeyCodes.ALT]
600
+ ), n = p.registry.createSerializedKey(
601
+ c.KeyCodes.V,
602
+ [c.KeyCodes.META]
582
603
  ), r = {
583
604
  name: "paste",
584
605
  preconditionFn: function(s) {
585
- if (s.options.readOnly || M.inProgress())
606
+ if (s.options.readOnly || H.inProgress())
586
607
  return !1;
587
608
  const l = localStorage.getItem("blocklyStash");
588
609
  if (!l)
@@ -595,54 +616,54 @@ class Pe {
595
616
  const a = localStorage.getItem("blocklyStash");
596
617
  if (!a)
597
618
  return !1;
598
- const _ = JSON.parse(a);
599
- return _ ? (W.paste(_, s), !0) : !1;
619
+ const u = JSON.parse(a);
620
+ return u ? (j.paste(u, s), !0) : !1;
600
621
  },
601
- keyCodes: [e, n, o]
622
+ keyCodes: [e, o, n]
602
623
  };
603
- u.registry.register(r);
624
+ p.registry.register(r);
604
625
  }
605
626
  }
606
- class Re {
627
+ class He {
607
628
  init() {
608
- const e = m.registry.getItem("cleanWorkspace");
609
- e && (e.callback = function(n) {
610
- const o = n.workspace;
611
- if (!o)
629
+ const e = C.registry.getItem("cleanWorkspace");
630
+ e && (e.callback = function(o) {
631
+ const n = o.workspace;
632
+ if (!n)
612
633
  return;
613
- o.setResizesEnabled(!1), y.setGroup(!0);
614
- const r = o.getTopBlocks(!0);
634
+ n.setResizesEnabled(!1), h.setGroup(!0);
635
+ const r = n.getTopBlocks(!0);
615
636
  let s = 0;
616
637
  for (let l = 0, a; a = r[l]; l++) {
617
638
  if (!a.isMovable())
618
639
  continue;
619
- const _ = a.getRelativeToSurfaceXY();
620
- a.moveBy(-_.x, s - _.y, ["cleanup"]), a.snapToGrid(), s = a.getRelativeToSurfaceXY().y + a.getHeightWidth().height + 100;
640
+ const u = a.getRelativeToSurfaceXY();
641
+ a.moveBy(-u.x, s - u.y, ["cleanup"]), a.snapToGrid(), s = a.getRelativeToSurfaceXY().y + a.getHeightWidth().height + 100;
621
642
  }
622
- y.setGroup(!1), o.setResizesEnabled(!0);
643
+ h.setGroup(!1), n.setResizesEnabled(!0);
623
644
  });
624
645
  }
625
646
  }
626
- function Z(t) {
647
+ function te(t) {
627
648
  const e = t.getParent();
628
- return e && Z(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
649
+ return e && te(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
629
650
  }
630
- class we {
651
+ class Ge {
631
652
  init() {
632
- const e = m.registry.getItem("blockDisable");
633
- e && (e.preconditionFn = function(n) {
634
- const o = n.block;
635
- return o && !o.isInFlyout && o.workspace.options.disable && o.isEditable() ? o.getInheritedDisabled() || Z(o) ? "disabled" : "enabled" : "hidden";
653
+ const e = C.registry.getItem("blockDisable");
654
+ e && (e.preconditionFn = function(o) {
655
+ const n = o.block;
656
+ return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || te(n) ? "disabled" : "enabled" : "hidden";
636
657
  });
637
658
  }
638
659
  }
639
- const Ke = new Pe();
640
- Ke.init({ contextMenu: !0, shortcut: !0 });
641
- const Me = new Re();
642
- Me.init();
643
- const Ve = new we();
644
- Ve.init();
645
- x.Classic.blockStyles = {
660
+ const We = new Ye();
661
+ We.init({ contextMenu: !0, shortcut: !0 });
662
+ const ze = new He();
663
+ ze.init();
664
+ const Xe = new Ge();
665
+ Xe.init();
666
+ F.Classic.blockStyles = {
646
667
  color_blocks: {
647
668
  colourPrimary: "#a5745b",
648
669
  colourSecondary: "#ede3de",
@@ -716,7 +737,7 @@ x.Classic.blockStyles = {
716
737
  hat: ""
717
738
  }
718
739
  };
719
- x.Classic.categoryStyles = {
740
+ F.Classic.categoryStyles = {
720
741
  calc_category: {
721
742
  colour: "#757575"
722
743
  },
@@ -766,9 +787,9 @@ x.Classic.categoryStyles = {
766
787
  colour: "#a55b80"
767
788
  }
768
789
  };
769
- const Fe = J.defineTheme("light", {
790
+ const je = Q.defineTheme("light", {
770
791
  name: "light",
771
- base: x.Classic,
792
+ base: F.Classic,
772
793
  componentStyles: {
773
794
  workspaceBackgroundColour: "#ffffff",
774
795
  toolboxBackgroundColour: "#eeeeee",
@@ -782,9 +803,9 @@ const Fe = J.defineTheme("light", {
782
803
  scrollbarOpacity: 0.4,
783
804
  cursorColour: ""
784
805
  }
785
- }), Ne = J.defineTheme("dark", {
806
+ }), Je = Q.defineTheme("dark", {
786
807
  name: "dark",
787
- base: x.Classic,
808
+ base: F.Classic,
788
809
  componentStyles: {
789
810
  workspaceBackgroundColour: "#1e1e1e",
790
811
  toolboxBackgroundColour: "#272727",
@@ -799,18 +820,18 @@ const Fe = J.defineTheme("light", {
799
820
  cursorColour: ""
800
821
  }
801
822
  });
802
- function De(t) {
803
- const e = $();
823
+ function $e(t) {
824
+ const e = T();
804
825
  switch (console.log(e), t) {
805
826
  case "light":
806
- e.setTheme(Fe);
827
+ e.setTheme(je);
807
828
  break;
808
829
  case "dark":
809
- e.setTheme(Ne);
830
+ e.setTheme(Je);
810
831
  break;
811
832
  }
812
833
  }
813
- const Ue = {
834
+ const Ze = {
814
835
  kind: "category",
815
836
  name: "%{BKY_CATEGORY_LOGIC}",
816
837
  categorystyle: "logic_category",
@@ -828,7 +849,7 @@ const Ue = {
828
849
  type: "if_v1"
829
850
  }
830
851
  ]
831
- }, He = {
852
+ }, qe = {
832
853
  kind: "category",
833
854
  name: "%{BKY_CATEGORY_LOOP}",
834
855
  categorystyle: "loop_category",
@@ -850,31 +871,31 @@ const Ue = {
850
871
  type: "for_each_v1"
851
872
  }
852
873
  ]
853
- }, Ye = {
874
+ }, Qe = {
854
875
  kind: "categoryToolbox",
855
- contents: [Ue, He]
856
- }, Ge = /* @__PURE__ */ B({
876
+ contents: [Ze, qe]
877
+ }, et = /* @__PURE__ */ M({
857
878
  __name: "cleanup",
858
879
  setup(t) {
859
880
  const e = () => {
860
- const n = $();
861
- if (!n)
881
+ const o = T();
882
+ if (!o)
862
883
  return;
863
- const o = m.registry.getItem("cleanWorkspace");
864
- o && o.callback({ workspace: n }, new PointerEvent("dummy"));
884
+ const n = C.registry.getItem("cleanWorkspace");
885
+ n && n.callback({ workspace: o }, new PointerEvent("dummy"));
865
886
  };
866
- return (n, o) => {
867
- const r = b("v-btn");
868
- return O(), F(r, {
887
+ return (o, n) => {
888
+ const r = m("v-btn");
889
+ return d(), L(r, {
869
890
  onClick: e,
870
891
  class: "mr-3",
871
892
  variant: "outlined",
872
893
  density: "comfortable",
873
- icon: S(ke)
894
+ icon: R(Ae)
874
895
  }, null, 8, ["icon"]);
875
896
  };
876
897
  }
877
- }), We = /* @__PURE__ */ B({
898
+ }), tt = /* @__PURE__ */ M({
878
899
  __name: "lock",
879
900
  props: {
880
901
  modelValue: { type: Boolean, required: !0 },
@@ -882,63 +903,122 @@ const Ue = {
882
903
  },
883
904
  emits: ["update:modelValue"],
884
905
  setup(t) {
885
- const e = X(t, "modelValue");
886
- return (n, o) => {
887
- const r = b("v-btn");
888
- return O(), F(r, {
889
- onClick: o[0] || (o[0] = (s) => e.value = !e.value),
906
+ const e = $(t, "modelValue");
907
+ return (o, n) => {
908
+ const r = m("v-btn");
909
+ return d(), L(r, {
910
+ onClick: n[0] || (n[0] = (s) => e.value = !e.value),
890
911
  class: "mr-3",
891
912
  variant: "outlined",
892
913
  density: "comfortable",
893
- icon: e.value ? S(Se) : S(Le)
914
+ icon: e.value ? R(Pe) : R(we)
894
915
  }, null, 8, ["icon"]);
895
916
  };
896
917
  }
897
- }), ze = /* @__PURE__ */ B({
918
+ }), ot = {
919
+ key: 1,
920
+ class: "text-caption text-grey"
921
+ }, nt = /* @__PURE__ */ M({
898
922
  __name: "navigator",
899
923
  setup(t) {
900
- const e = I(() => ({
924
+ const e = w(() => ({
901
925
  maxHeight: "calc(100vh - 200px)"
902
- }));
903
- return (n, o) => {
904
- const r = b("v-btn"), s = b("v-list"), l = b("v-menu");
905
- return O(), F(l, {
926
+ })), o = K([]), n = () => {
927
+ var b;
928
+ const s = T();
929
+ if (!s) {
930
+ o.value = [];
931
+ return;
932
+ }
933
+ const l = [], a = s.getTopBlocks(!0), u = ((b = v()) == null ? void 0 : b.id) ?? "";
934
+ a.forEach((O) => {
935
+ const _ = O;
936
+ if (_.type.startsWith("on_node_event_v"))
937
+ console.log("1");
938
+ else if (_.type.startsWith("procedure_def_v"))
939
+ console.log("2");
940
+ else {
941
+ const f = _.getRelativeToSurfaceXY();
942
+ l.push({
943
+ id: _.id,
944
+ name: g.fffff,
945
+ x: f.x,
946
+ y: f.y,
947
+ active: _.id === u
948
+ });
949
+ }
950
+ }), o.value = l;
951
+ }, r = (s) => {
952
+ const l = T();
953
+ if (!l)
954
+ return;
955
+ const a = l.getBlockById(s.id);
956
+ a && (ee(s.id), a.select());
957
+ };
958
+ return Z(() => {
959
+ W.on("codeUpdate", n);
960
+ }), ue(() => {
961
+ W.off("codeUpdate", n);
962
+ }), (s, l) => {
963
+ const a = m("v-btn"), u = m("v-list-item-title"), b = m("v-list-item"), O = m("v-list"), _ = m("v-menu");
964
+ return d(), L(_, {
906
965
  "close-on-content-click": !1,
907
966
  transition: "slide-y-transition",
908
967
  "offset-y": ""
909
968
  }, {
910
- activator: U(({ props: a }) => [
911
- h(r, se(a, {
969
+ activator: E(({ props: f }) => [
970
+ S(a, _e(f, {
912
971
  variant: "outlined",
913
972
  density: "comfortable",
914
- icon: S(Te)
973
+ icon: R(Ke)
915
974
  }), null, 16, ["icon"])
916
975
  ]),
917
- default: U(() => [
918
- V("div", {
976
+ default: E(() => [
977
+ G("div", {
919
978
  class: "overflow-auto",
920
- style: E(e.value)
979
+ style: V(e.value)
921
980
  }, [
922
- h(s)
981
+ o.value.length > 0 ? (d(), L(O, { key: 0 }, {
982
+ default: E(() => [
983
+ (d(!0), A(pe, null, fe(o.value, (f) => (d(), L(b, {
984
+ key: f.id,
985
+ onClick: r,
986
+ class: "d-flex justify-start",
987
+ active: f.active
988
+ }, {
989
+ default: E(() => [
990
+ S(u, null, {
991
+ default: E(() => [
992
+ de(ye(f.name), 1)
993
+ ]),
994
+ _: 2
995
+ }, 1024)
996
+ ]),
997
+ _: 2
998
+ }, 1032, ["active"]))), 128))
999
+ ]),
1000
+ _: 1
1001
+ })) : (d(), A("span", ot, "xxxxxxxxxx"))
923
1002
  ], 4)
924
1003
  ]),
925
1004
  _: 1
926
1005
  });
927
1006
  };
928
1007
  }
929
- }), Xe = { class: "position-relative w-100 h-100" }, je = /* @__PURE__ */ B({
1008
+ }), rt = { class: "position-relative w-100 h-100" }, st = /* @__PURE__ */ M({
930
1009
  __name: "index",
931
- props: /* @__PURE__ */ H({
1010
+ props: /* @__PURE__ */ X({
932
1011
  type: {},
933
1012
  version: {},
934
- active: { type: Boolean }
1013
+ active: { type: Boolean },
1014
+ scale: {}
935
1015
  }, {
936
1016
  lock: { type: Boolean, required: !0 },
937
1017
  lockModifiers: {}
938
1018
  }),
939
- emits: /* @__PURE__ */ H(["ready", "change"], ["update:lock"]),
1019
+ emits: /* @__PURE__ */ X(["ready", "change"], ["update:lock"]),
940
1020
  setup(t, { emit: e }) {
941
- const n = fe(), { locale: o, dark: r } = ue(n), { open: s } = de("blocklyEditorFlyout"), l = t, a = X(t, "lock"), _ = e, A = Y(), N = {
1021
+ const o = Be(), { locale: n, dark: r } = Te(o), { open: s } = xe("blocklyEditorFlyout"), l = t, a = $(t, "lock"), u = e, b = K(), O = {
942
1022
  grid: {
943
1023
  length: 2,
944
1024
  snap: !0,
@@ -961,8 +1041,8 @@ const Ue = {
961
1041
  wheel: !0
962
1042
  }
963
1043
  };
964
- let g;
965
- const P = Y(!1), q = I(() => ({
1044
+ let _;
1045
+ const f = K(!0), N = K(!1), oe = w(() => ({
966
1046
  position: "absolute",
967
1047
  background: r.value ? "#0000007f" : "#ffffff7f",
968
1048
  top: "1px",
@@ -971,7 +1051,7 @@ const Ue = {
971
1051
  height: "100%",
972
1052
  pointerEvents: "none",
973
1053
  zIndex: 999
974
- })), Q = I(() => ({
1054
+ })), ne = w(() => ({
975
1055
  position: "absolute",
976
1056
  background: r.value ? "#0000007f" : "#ffffff7f",
977
1057
  top: "0px",
@@ -979,81 +1059,94 @@ const Ue = {
979
1059
  width: "100%",
980
1060
  height: "100%",
981
1061
  pointerEvents: "none"
982
- })), ee = I(() => ({
1062
+ })), re = w(() => ({
983
1063
  position: "absolute",
984
1064
  top: "0px",
985
1065
  right: "0px",
986
1066
  zIndex: 20
987
1067
  }));
988
- le(async () => {
989
- if (!A.value)
1068
+ Z(async () => {
1069
+ if (!b.value)
990
1070
  return;
991
- await z(o.value);
992
- let c;
993
- l.type === "app" && l.version === "v1" && (c = Ye), N.toolbox = c, g = Oe(A.value, N), g.addChangeListener(y.disableOrphans), g.addChangeListener(te), _("ready", g);
994
- }), ae(() => {
1071
+ await J(n.value);
1072
+ let i;
1073
+ l.type === "app" && l.version === "v1" && (i = Qe), O.toolbox = i, _ = Se(b.value, O), _.addChangeListener(h.disableOrphans), _.addChangeListener(se), u("ready", _);
1074
+ }), ge(() => {
995
1075
  s.value = !1;
996
1076
  });
997
- function D() {
998
- g && Ce(g);
1077
+ function z() {
1078
+ _ && Le(_);
999
1079
  }
1000
- function te(c) {
1001
- c.type === y.BLOCK_DRAG && (c.isStart ? P.value = !0 : P.value = !1), _("change", c);
1080
+ function se(i) {
1081
+ if (i.type === h.FINISHED_LOADING) {
1082
+ Ue(), W.emit("codeUpdate"), f.value = !1;
1083
+ return;
1084
+ }
1085
+ f.value || (i.type === h.BLOCK_DRAG && (i.isStart ? N.value = !0 : N.value = !1), u("change", i));
1002
1086
  }
1003
- return L(o, (c) => {
1004
- z(c);
1005
- }), L(r, (c) => {
1006
- De(c ? "dark" : "light");
1007
- }), L(s, (c) => {
1008
- var d;
1009
- c || (d = g.getToolbox()) == null || d.clearSelection();
1010
- }), L(
1087
+ return B(n, (i) => {
1088
+ J(i);
1089
+ }), B(r, (i) => {
1090
+ $e(i ? "dark" : "light");
1091
+ }), B(s, (i) => {
1092
+ var k;
1093
+ i || (k = _.getToolbox()) == null || k.clearSelection();
1094
+ }), B(
1011
1095
  () => l.active,
1012
- (c) => {
1013
- c && setTimeout(() => D(), 0);
1096
+ (i) => {
1097
+ i && setTimeout(() => z(), 1);
1098
+ }
1099
+ ), B(
1100
+ () => l.scale,
1101
+ (i) => {
1102
+ _.setScale(i);
1014
1103
  }
1015
- ), (c, d) => {
1016
- const oe = b("v-icon"), ne = ie("resize");
1017
- return O(), R("div", Xe, [
1018
- ce(V("div", {
1104
+ ), (i, k) => {
1105
+ const le = m("v-icon"), ae = m("x-loading"), ie = me("resize");
1106
+ return d(), A("div", rt, [
1107
+ he(G("div", {
1019
1108
  class: "w-100 h-100",
1020
1109
  ref_key: "blocklyDiv",
1021
- ref: A,
1110
+ ref: b,
1022
1111
  id: "blocklyEditor"
1023
1112
  }, null, 512), [
1024
- [ne, D]
1113
+ [ie, z]
1025
1114
  ]),
1026
- P.value ? (O(), R("div", {
1115
+ N.value ? (d(), A("div", {
1027
1116
  key: 0,
1028
1117
  class: "d-flex flex-column align-center justify-center",
1029
- style: E(q.value)
1118
+ style: V(oe.value)
1030
1119
  }, [
1031
- h(oe, {
1032
- icon: S(ve),
1120
+ S(le, {
1121
+ icon: R(Re),
1033
1122
  size: "x-large"
1034
1123
  }, null, 8, ["icon"])
1035
- ], 4)) : G("", !0),
1036
- a.value ? (O(), R("div", {
1124
+ ], 4)) : D("", !0),
1125
+ a.value ? (d(), A("div", {
1037
1126
  key: 1,
1038
- style: E(Q.value)
1039
- }, null, 4)) : G("", !0),
1040
- V("div", {
1127
+ style: V(ne.value)
1128
+ }, null, 4)) : D("", !0),
1129
+ G("div", {
1041
1130
  class: "d-flex align-end pt-3 pr-3",
1042
- style: E(ee.value)
1131
+ style: V(re.value)
1043
1132
  }, [
1044
- h(Ge),
1045
- h(We, {
1133
+ S(et),
1134
+ S(tt, {
1046
1135
  modelValue: a.value,
1047
- "onUpdate:modelValue": d[0] || (d[0] = (re) => a.value = re)
1136
+ "onUpdate:modelValue": k[0] || (k[0] = (ce) => a.value = ce)
1048
1137
  }, null, 8, ["modelValue"]),
1049
- h(ze)
1050
- ], 4)
1138
+ S(nt)
1139
+ ], 4),
1140
+ f.value ? (d(), L(ae, {
1141
+ key: 2,
1142
+ zIndex: 99
1143
+ })) : D("", !0)
1051
1144
  ]);
1052
1145
  };
1053
1146
  }
1054
- }), Je = (t) => {
1055
- t.component("x-blockly", je);
1056
- }, et = { install: Je };
1147
+ }), lt = (t) => {
1148
+ t.component("x-blockly", st);
1149
+ }, _t = { install: lt };
1057
1150
  export {
1058
- et as default
1151
+ _t as default
1059
1152
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.3.22",
4
+ "version": "0.3.23",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",