x-block-lib 0.5.23 → 0.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +117 -112
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10,9 +10,9 @@
10
10
  var Zr = Object.defineProperty;
11
11
  var el = (e, t, n) => t in e ? Zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
12
12
  var Ke = (e, t, n) => el(e, typeof t != "symbol" ? t + "" : t, n);
13
- import { getCurrentScope as tl, onScopeDispose as nl, unref as Y, computed as Ee, watch as ht, ref as at, getCurrentInstance as Ao, onMounted as qt, defineComponent as tt, onBeforeUnmount as oo, resolveComponent as ve, openBlock as me, createBlock as je, withCtx as Qe, createVNode as Ae, mergeProps as Di, useModel as di, toRefs as ol, reactive as il, h as hi, onUnmounted as sl, nextTick as Mi, isRef as pn, resolveDirective as al, withDirectives as rl, createElementBlock as st, normalizeStyle as qe, createElementVNode as We, toDisplayString as vo, withModifiers as _n, Fragment as da, renderList as ll, withKeys as ha, createCommentVNode as Lt, mergeModels as is } from "vue";
13
+ import { getCurrentScope as tl, onScopeDispose as nl, unref as Y, computed as Ae, watch as ht, ref as at, getCurrentInstance as Ao, onMounted as qt, defineComponent as tt, onBeforeUnmount as oo, resolveComponent as ve, openBlock as me, createBlock as je, withCtx as Xe, createVNode as Te, mergeProps as Di, useModel as di, toRefs as ol, reactive as il, h as hi, onUnmounted as sl, nextTick as Mi, isRef as pn, resolveDirective as al, withDirectives as rl, createElementBlock as st, normalizeStyle as Je, createElementVNode as We, toDisplayString as vo, withModifiers as _n, Fragment as da, renderList as ll, withKeys as ha, createCommentVNode as Lt, mergeModels as is } from "vue";
14
14
  import { d as b, j as r, O as u, M as g, u as I, X as cl, E as P, B as D, F as V, i as te, a as Dt, b as Oo, c as he, C as fa, e as ul, P as fi, N as Pi, V as jn, g as At, f as pl, h as ga, s as _l, S as Le, k as Xn, l as Ht, m as xn, n as $o, o as sn, p as kt, q as ss, G as Go, r as dl, t as hl, v as Wo, U as wn, D as Vn, w as wt, x as fl, T as bo, y as ma, z as gl, A as ml, H as Tl, I as as, J as El } from "./blockly-h1celjt4.js";
15
- import { openConfirmDlg as Al, openPromptDlg as vl, eventBus as Je, messageWarning as Ta, useColor as Io, useViewStack as yo, useSystem as Ea, injectDark as Ol, injectLocale as bl } from "x-essential-lib";
15
+ import { openConfirmDlg as Al, openPromptDlg as vl, eventBus as Qe, messageWarning as Ta, useColor as Io, useViewStack as yo, useSystem as Ea, injectDark as Ol, injectLocale as bl } from "x-essential-lib";
16
16
  import { pkgs as Il, elements as ke, getPropTag as Co } from "x-runtime-lib";
17
17
  import { globalState as U } from "x-state-lib";
18
18
  import { useI18n as Nn } from "vue-i18n";
@@ -40,14 +40,14 @@ function Pl() {
40
40
  }
41
41
  function Ul(e) {
42
42
  const t = Pl();
43
- return Ee(() => (t.value, !!e()));
43
+ return Ae(() => (t.value, !!e()));
44
44
  }
45
45
  function xl(e, t, n = {}) {
46
46
  const { window: o = Ml, ...i } = n;
47
47
  let s;
48
48
  const a = Ul(() => o && "ResizeObserver" in o), l = () => {
49
49
  s && (s.disconnect(), s = void 0);
50
- }, c = Ee(() => {
50
+ }, c = Ae(() => {
51
51
  const d = va(e);
52
52
  return Array.isArray(d) ? d.map((h) => rs(h)) : [rs(d)];
53
53
  }), p = ht(
@@ -10144,21 +10144,21 @@ const Ro = {
10144
10144
  s && s.callback({ workspace: i }, new PointerEvent("dummy"));
10145
10145
  };
10146
10146
  return qt(() => {
10147
- Je.on("cleanWorkspace", o);
10147
+ Qe.on("cleanWorkspace", o);
10148
10148
  }), oo(() => {
10149
- Je.off("cleanWorkspace", o);
10149
+ Qe.off("cleanWorkspace", o);
10150
10150
  }), (i, s) => {
10151
10151
  const a = ve("v-btn"), l = ve("v-tooltip");
10152
10152
  return me(), je(l, {
10153
10153
  text: Y(t)("x-block-lib.tip.hotkeyCtrlQ")
10154
10154
  }, {
10155
- activator: Qe(({ props: c }) => [
10156
- Ae(a, Di(c, {
10155
+ activator: Xe(({ props: c }) => [
10156
+ Te(a, Di(c, {
10157
10157
  class: "mr-3",
10158
10158
  variant: "outlined",
10159
10159
  density: "comfortable",
10160
10160
  icon: Y(Cl),
10161
- onClick: s[0] || (s[0] = (p) => Y(Je).emit("cleanWorkspace"))
10161
+ onClick: s[0] || (s[0] = (p) => Y(Qe).emit("cleanWorkspace"))
10162
10162
  }), null, 16, ["icon"])
10163
10163
  ]),
10164
10164
  _: 1
@@ -10179,8 +10179,8 @@ const Ro = {
10179
10179
  return me(), je(a, {
10180
10180
  text: Y(t)("x-block-lib.tip.hotkeyCtrlW")
10181
10181
  }, {
10182
- activator: Qe(({ props: l }) => [
10183
- Ae(s, Di(l, {
10182
+ activator: Xe(({ props: l }) => [
10183
+ Te(s, Di(l, {
10184
10184
  class: "mr-3",
10185
10185
  variant: "outlined",
10186
10186
  density: "comfortable",
@@ -11133,8 +11133,8 @@ R.prototype = /** @lends Sortable.prototype */
11133
11133
  return N(), t.insertBefore(T, ne), ue = t, K(), L(!0);
11134
11134
  } else if (n.parentNode === t) {
11135
11135
  i = ge(n);
11136
- var j = 0, Te, De = T.parentNode !== t, k = !pf(T.animated && T.toRect || o, n.animated && n.toRect || i, h), S = h ? "top" : "left", q = zs(n, "top", "top") || zs(T, "top", "top"), Q = q ? q.scrollTop : void 0;
11137
- Yt !== n && (Te = i[S], Tn = !1, Hn = !k && a.invertSwap || De), j = Tf(e, n, i, h, k ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Hn, Yt === n);
11136
+ var j = 0, Ee, De = T.parentNode !== t, k = !pf(T.animated && T.toRect || o, n.animated && n.toRect || i, h), S = h ? "top" : "left", q = zs(n, "top", "top") || zs(T, "top", "top"), Q = q ? q.scrollTop : void 0;
11137
+ Yt !== n && (Ee = i[S], Tn = !1, Hn = !k && a.invertSwap || De), j = Tf(e, n, i, h, k ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Hn, Yt === n);
11138
11138
  var X;
11139
11139
  if (j !== 0) {
11140
11140
  var Z = Fe(T);
@@ -11149,7 +11149,7 @@ R.prototype = /** @lends Sortable.prototype */
11149
11149
  C = j === 1;
11150
11150
  var se = Gn(re, t, T, o, n, i, e, C);
11151
11151
  if (se !== !1)
11152
- return (se === 1 || se === -1) && (C = se === 1), Li = !0, setTimeout(ff, 30), N(), C && !ce ? t.appendChild(T) : n.parentNode.insertBefore(T, C ? ce : n), q && Er(q, 0, Q - q.scrollTop), ue = T.parentNode, Te !== void 0 && !Hn && (Zn = Math.abs(Te - ge(n)[S])), K(), L(!0);
11152
+ return (se === 1 || se === -1) && (C = se === 1), Li = !0, setTimeout(ff, 30), N(), C && !ce ? t.appendChild(T) : n.parentNode.insertBefore(T, C ? ce : n), q && Er(q, 0, Q - q.scrollTop), ue = T.parentNode, Ee !== void 0 && !Hn && (Zn = Math.abs(Ee - ge(n)[S])), K(), L(!0);
11153
11153
  }
11154
11154
  if (t.contains(T))
11155
11155
  return L(!1);
@@ -11481,9 +11481,9 @@ var pi = Tr(function(e, t, n, o) {
11481
11481
  Si !== n && (Si = n, to(), cn = t.scroll, _ = t.scrollFn, cn === !0 && (cn = Tt(n, !0)));
11482
11482
  var d = 0, h = cn;
11483
11483
  do {
11484
- var m = h, O = ge(m), v = O.top, N = O.bottom, L = O.left, K = O.right, G = O.width, ne = O.height, j = void 0, Te = void 0, De = m.scrollWidth, k = m.scrollHeight, S = B(m), q = m.scrollLeft, Q = m.scrollTop;
11485
- m === c ? (j = G < De && (S.overflowX === "auto" || S.overflowX === "scroll" || S.overflowX === "visible"), Te = ne < k && (S.overflowY === "auto" || S.overflowY === "scroll" || S.overflowY === "visible")) : (j = G < De && (S.overflowX === "auto" || S.overflowX === "scroll"), Te = ne < k && (S.overflowY === "auto" || S.overflowY === "scroll"));
11486
- var X = j && (Math.abs(K - i) <= a && q + G < De) - (Math.abs(L - i) <= a && !!q), Z = Te && (Math.abs(N - s) <= a && Q + ne < k) - (Math.abs(v - s) <= a && !!Q);
11484
+ var m = h, O = ge(m), v = O.top, N = O.bottom, L = O.left, K = O.right, G = O.width, ne = O.height, j = void 0, Ee = void 0, De = m.scrollWidth, k = m.scrollHeight, S = B(m), q = m.scrollLeft, Q = m.scrollTop;
11485
+ m === c ? (j = G < De && (S.overflowX === "auto" || S.overflowX === "scroll" || S.overflowX === "visible"), Ee = ne < k && (S.overflowY === "auto" || S.overflowY === "scroll" || S.overflowY === "visible")) : (j = G < De && (S.overflowX === "auto" || S.overflowX === "scroll"), Ee = ne < k && (S.overflowY === "auto" || S.overflowY === "scroll"));
11486
+ var X = j && (Math.abs(K - i) <= a && q + G < De) - (Math.abs(L - i) <= a && !!q), Z = Ee && (Math.abs(N - s) <= a && Q + ne < k) - (Math.abs(v - s) <= a && !!Q);
11487
11487
  if (!fe[d])
11488
11488
  for (var ce = 0; ce <= d; ce++)
11489
11489
  fe[ce] || (fe[ce] = {});
@@ -11687,10 +11687,10 @@ function Nf(...e) {
11687
11687
  save: () => c == null ? void 0 : c.save(),
11688
11688
  toArray: () => c == null ? void 0 : c.toArray(),
11689
11689
  closest: (...k) => c == null ? void 0 : c.closest(...k)
11690
- }, Te = () => j == null ? void 0 : j.option("disabled", !0), De = () => j == null ? void 0 : j.option("disabled", !1);
11690
+ }, Ee = () => j == null ? void 0 : j.option("disabled", !0), De = () => j == null ? void 0 : j.option("disabled", !1);
11691
11691
  return yf(() => {
11692
11692
  p && ne();
11693
- }), If(j.destroy), Gt({ start: ne, pause: Te, resume: De }, j);
11693
+ }), If(j.destroy), Gt({ start: ne, pause: Ee, resume: De }, j);
11694
11694
  }
11695
11695
  const Ri = [
11696
11696
  "update",
@@ -11762,13 +11762,13 @@ const Ri = [
11762
11762
  const s = Ri.reduce((_, d) => {
11763
11763
  const h = `on${d.replace(/^\S/, (m) => m.toUpperCase())}`;
11764
11764
  return _[h] = (...m) => n(d, ...m), _;
11765
- }, {}), a = Ee(() => {
11765
+ }, {}), a = Ae(() => {
11766
11766
  const _ = ol(e), d = _r(_, ["modelValue"]), h = Object.entries(d).reduce((m, [O, v]) => {
11767
11767
  const N = Y(v);
11768
11768
  return N !== void 0 && (m[O] = N), m;
11769
11769
  }, {});
11770
11770
  return Gt(Gt({}, s), Yh(Gt(Gt({}, i), h)));
11771
- }), l = Ee({
11771
+ }), l = Ae({
11772
11772
  get: () => e.modelValue,
11773
11773
  set: (_) => n("update:modelValue", _)
11774
11774
  }), c = at(), p = il(
@@ -11788,13 +11788,13 @@ const Ri = [
11788
11788
  },
11789
11789
  emits: ["x-click"],
11790
11790
  setup(e, { emit: t }) {
11791
- const { primaryColor: n, backgroundColor2: o, highlightColor: i } = Io(), s = e, a = t, l = at(!1), c = Ee(() => ({
11791
+ const { primaryColor: n, backgroundColor2: o, highlightColor: i } = Io(), s = e, a = t, l = at(!1), c = Ae(() => ({
11792
11792
  position: "relative",
11793
11793
  background: l.value ? i.value : o.value,
11794
11794
  height: "48px",
11795
11795
  marginBottom: "1px",
11796
11796
  userSelect: "none"
11797
- })), p = Ee(() => ({
11797
+ })), p = Ae(() => ({
11798
11798
  display: s.select ? "block" : "none",
11799
11799
  position: "absolute",
11800
11800
  top: "0px",
@@ -11808,21 +11808,21 @@ const Ri = [
11808
11808
  const h = ve("v-spacer"), m = ve("v-icon"), O = al("ripple");
11809
11809
  return rl((me(), st("div", {
11810
11810
  class: "d-flex align-center cursor-pointer",
11811
- style: qe(c.value),
11811
+ style: Je(c.value),
11812
11812
  onClick: d[1] || (d[1] = (v) => a("x-click", s.id)),
11813
11813
  onMouseover: d[2] || (d[2] = (v) => l.value = !0),
11814
11814
  onMouseout: d[3] || (d[3] = (v) => l.value = !1)
11815
11815
  }, [
11816
11816
  We("span", Sf, vo(s.title), 1),
11817
- Ae(h),
11818
- Ae(m, {
11817
+ Te(h),
11818
+ Te(m, {
11819
11819
  class: "x-handle cursor-move mr-3",
11820
11820
  icon: Y(Ll),
11821
11821
  onMousedown: d[0] || (d[0] = _n(() => {
11822
11822
  }, ["stop"]))
11823
11823
  }, null, 8, ["icon"]),
11824
11824
  We("div", {
11825
- style: qe(p.value)
11825
+ style: Je(p.value)
11826
11826
  }, null, 4)
11827
11827
  ], 36)), [
11828
11828
  [O]
@@ -11861,9 +11861,9 @@ const Ri = [
11861
11861
  }), o.value = h;
11862
11862
  };
11863
11863
  qt(() => {
11864
- Je.on("codeUpdate", i);
11864
+ Qe.on("codeUpdate", i);
11865
11865
  }), oo(() => {
11866
- Je.off("codeUpdate", i);
11866
+ Qe.off("codeUpdate", i);
11867
11867
  });
11868
11868
  let s = [];
11869
11869
  const a = () => {
@@ -11897,7 +11897,7 @@ const Ri = [
11897
11897
  let N = -10;
11898
11898
  v !== "" && (N = h.getBlockById(v).getRelativeToSurfaceXY().y + 10);
11899
11899
  const L = O.getRelativeToSurfaceXY();
11900
- O.moveTo(new I.Coordinate(L.x, N)), Je.emit("cleanWorkspace"), sr();
11900
+ O.moveTo(new I.Coordinate(L.x, N)), Qe.emit("cleanWorkspace"), sr();
11901
11901
  }, { open: p } = yo("blocklyNavigatorDlg"), _ = async (d) => {
11902
11902
  const h = At();
11903
11903
  if (!h) {
@@ -11918,7 +11918,7 @@ const Ri = [
11918
11918
  onMove: l,
11919
11919
  onEnd: c
11920
11920
  }, {
11921
- default: Qe(() => [
11921
+ default: Xe(() => [
11922
11922
  (me(!0), st(da, null, ll(o.value, (m) => (me(), je(Bf, {
11923
11923
  id: m.id,
11924
11924
  key: m.id,
@@ -11946,27 +11946,27 @@ const xf = /* @__PURE__ */ Sr(Pf, [["render", Uf]]), wf = { class: "text-subtitl
11946
11946
  lock: { type: Boolean }
11947
11947
  },
11948
11948
  setup(e) {
11949
- const { t } = Nn(), n = yl(), { sysBarAvail: o } = Ea(), { backgroundColor1: i } = Io(), s = e, a = Ee(() => {
11949
+ const { t } = Nn(), n = yl(), { sysBarAvail: o } = Ea(), { backgroundColor1: i } = Io(), s = e, a = Ae(() => {
11950
11950
  let _ = "100%";
11951
11951
  return n.mdAndUp.value && (_ = "400px"), {
11952
11952
  background: i.value,
11953
11953
  width: _,
11954
11954
  height: "100%"
11955
11955
  };
11956
- }), l = Ee(() => {
11956
+ }), l = Ae(() => {
11957
11957
  let _ = 48;
11958
11958
  return o.value && (_ += 24), {
11959
11959
  position: "relative",
11960
11960
  width: "100%",
11961
11961
  height: `calc(100% - ${_}px)`
11962
11962
  };
11963
- }), c = Ee(() => ({
11963
+ }), c = Ae(() => ({
11964
11964
  height: "60px"
11965
11965
  })), { open: p } = yo("blocklyNavigatorDlg");
11966
11966
  return (_, d) => {
11967
11967
  const h = ve("v-sheet"), m = ve("v-icon"), O = ve("v-dialog"), v = ve("v-btn"), N = ve("v-tooltip");
11968
11968
  return me(), st(da, null, [
11969
- Ae(O, {
11969
+ Te(O, {
11970
11970
  modelValue: Y(p),
11971
11971
  "onUpdate:modelValue": d[3] || (d[3] = (L) => pn(p) ? p.value = L : null),
11972
11972
  transition: "scroll-x-reverse-transition",
@@ -11976,7 +11976,7 @@ const xf = /* @__PURE__ */ Sr(Pf, [["render", Uf]]), wf = { class: "text-subtitl
11976
11976
  eager: "",
11977
11977
  onKeydown: d[4] || (d[4] = ha(_n((L) => p.value = !1, ["stop", "prevent"]), ["esc"]))
11978
11978
  }, {
11979
- default: Qe(() => [
11979
+ default: Xe(() => [
11980
11980
  We("div", {
11981
11981
  class: "w-100 h-100 d-flex flex-row-reverse",
11982
11982
  onClick: d[1] || (d[1] = _n((L) => p.value = !1, ["self"])),
@@ -11984,20 +11984,20 @@ const xf = /* @__PURE__ */ Sr(Pf, [["render", Uf]]), wf = { class: "text-subtitl
11984
11984
  }, [
11985
11985
  We("div", {
11986
11986
  class: "elevation-2",
11987
- style: qe(a.value)
11987
+ style: Je(a.value)
11988
11988
  }, [
11989
11989
  Y(o) ? (me(), je(h, {
11990
11990
  key: 0,
11991
11991
  color: "transparent",
11992
11992
  height: 24
11993
11993
  })) : Lt("", !0),
11994
- Ae(h, {
11994
+ Te(h, {
11995
11995
  class: "d-flex align-center px-3",
11996
11996
  color: "transparent",
11997
11997
  height: 48
11998
11998
  }, {
11999
- default: Qe(() => [
12000
- Ae(m, {
11999
+ default: Xe(() => [
12000
+ Te(m, {
12001
12001
  icon: Y(Aa),
12002
12002
  onClick: d[0] || (d[0] = (L) => p.value = !1)
12003
12003
  }, null, 8, ["icon"]),
@@ -12007,14 +12007,14 @@ const xf = /* @__PURE__ */ Sr(Pf, [["render", Uf]]), wf = { class: "text-subtitl
12007
12007
  }),
12008
12008
  We("div", {
12009
12009
  class: "overflow-y-auto",
12010
- style: qe(l.value)
12010
+ style: Je(l.value)
12011
12011
  }, [
12012
12012
  s.type === "list" ? (me(), je(Mf, {
12013
12013
  key: 0,
12014
12014
  lock: s.lock
12015
12015
  }, null, 8, ["lock"])) : s.type === "tree" ? (me(), je(xf, { key: 1 })) : Lt("", !0),
12016
12016
  We("div", {
12017
- style: qe(c.value)
12017
+ style: Je(c.value)
12018
12018
  }, null, 4)
12019
12019
  ], 4)
12020
12020
  ], 4)
@@ -12022,11 +12022,11 @@ const xf = /* @__PURE__ */ Sr(Pf, [["render", Uf]]), wf = { class: "text-subtitl
12022
12022
  ]),
12023
12023
  _: 1
12024
12024
  }, 8, ["modelValue"]),
12025
- Ae(N, {
12025
+ Te(N, {
12026
12026
  text: Y(t)("x-block-lib.tip.hotkeyCtrlE")
12027
12027
  }, {
12028
- activator: Qe(({ props: L }) => [
12029
- Ae(v, Di(L, {
12028
+ activator: Xe(({ props: L }) => [
12029
+ Te(v, Di(L, {
12030
12030
  variant: "outlined",
12031
12031
  density: "comfortable",
12032
12032
  icon: Y(Bl),
@@ -12112,7 +12112,7 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12112
12112
  setup(e, { expose: t, emit: n }) {
12113
12113
  const o = Ol(), i = bl(), s = di(e, "lock"), a = di(e, "scale"), l = e, c = n, p = at();
12114
12114
  let _;
12115
- const d = at(!1), h = at(!1), m = Ee(() => l.type === "json" ? "tree" : "list"), O = Ee(() => ({
12115
+ const d = at(!1), h = at(!1), m = Ae(() => l.type === "json" ? "tree" : "list"), O = Ae(() => ({
12116
12116
  position: "absolute",
12117
12117
  background: o.value ? "#0000007f" : "#ffffff7f",
12118
12118
  top: "1px",
@@ -12120,12 +12120,12 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12120
12120
  width: "56px",
12121
12121
  height: "calc(100% - 1px)",
12122
12122
  zIndex: 999
12123
- })), v = Ee(() => ({
12123
+ })), v = Ae(() => ({
12124
12124
  position: "absolute",
12125
12125
  top: "0px",
12126
12126
  right: "0px",
12127
12127
  zIndex: 20
12128
- })), N = Ee(() => ({
12128
+ })), N = Ae(() => ({
12129
12129
  position: "absolute",
12130
12130
  background: o.value ? "#0000007f" : "#ffffff7f",
12131
12131
  top: "0px",
@@ -12133,7 +12133,7 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12133
12133
  width: "100%",
12134
12134
  height: "100%",
12135
12135
  pointerEvents: "none"
12136
- })), L = Ee(() => ({
12136
+ })), L = Ae(() => ({
12137
12137
  position: "absolute",
12138
12138
  background: o.value ? "#0000007f" : "#ffffff7f",
12139
12139
  top: "1px",
@@ -12161,7 +12161,7 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12161
12161
  });
12162
12162
  async function G(C) {
12163
12163
  if (C.type === P.FINISHED_LOADING) {
12164
- sr(), Je.emit("codeUpdate"), d.value = !1;
12164
+ sr(), Qe.emit("codeUpdate"), d.value = !1;
12165
12165
  return;
12166
12166
  }
12167
12167
  if (!d.value) {
@@ -12169,12 +12169,12 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12169
12169
  a.value = _.getScale();
12170
12170
  return;
12171
12171
  }
12172
- C.type === P.BLOCK_DRAG && (C.isStart ? h.value = !0 : h.value = !1), Je.emit("codeUpdate");
12172
+ C.type === P.BLOCK_DRAG && (C.isStart ? h.value = !0 : h.value = !1), Qe.emit("codeUpdate");
12173
12173
  }
12174
12174
  }
12175
12175
  const ne = (C) => {
12176
12176
  d.value = !0, as.workspaces.load(C, _);
12177
- }, j = () => as.workspaces.save(_), Te = () => r.workspaceToCode(_), De = () => {
12177
+ }, j = () => as.workspaces.save(_), Ee = () => r.workspaceToCode(_), De = () => {
12178
12178
  _.options.readOnly = s.value, _.options.readOnly && (K.value = !1);
12179
12179
  }, k = () => {
12180
12180
  _.setScale(a.value);
@@ -12201,11 +12201,11 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12201
12201
  return;
12202
12202
  }
12203
12203
  }, X = () => {
12204
- Je.emit("cleanWorkspace");
12204
+ Qe.emit("cleanWorkspace");
12205
12205
  }, Z = () => {
12206
12206
  s.value = !s.value;
12207
12207
  }, ce = () => {
12208
- Je.emit("blocklyNavigatorDlg");
12208
+ Qe.emit("blocklyNavigatorDlg");
12209
12209
  };
12210
12210
  return qt(() => {
12211
12211
  window.addEventListener("keydown", Q, !1);
@@ -12221,8 +12221,8 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12221
12221
  De();
12222
12222
  }), ht(a, () => {
12223
12223
  k();
12224
- }), t({ loading: d, load: ne, save: j, generateCode: Te, fireStateChange: q }), (C, se) => {
12225
- const f = ve("v-icon"), E = ve("x-loading");
12224
+ }), t({ loading: d, load: ne, save: j, generateCode: Ee, fireStateChange: q }), (C, se) => {
12225
+ const f = ve("v-icon"), E = ve("x-loading"), M = ve("v-fade-transition");
12226
12226
  return me(), st("div", $f, [
12227
12227
  We("div", {
12228
12228
  id: "blocklyEditor",
@@ -12233,39 +12233,44 @@ const $f = { class: "position-relative w-100 h-100" }, Gf = /* @__PURE__ */ tt({
12233
12233
  h.value ? (me(), st("div", {
12234
12234
  key: 0,
12235
12235
  class: "d-flex flex-column justify-center align-center",
12236
- style: qe(O.value)
12236
+ style: Je(O.value)
12237
12237
  }, [
12238
- Ae(f, {
12238
+ Te(f, {
12239
12239
  size: "x-large",
12240
12240
  icon: Y(Nl)
12241
12241
  }, null, 8, ["icon"])
12242
12242
  ], 4)) : Lt("", !0),
12243
12243
  We("div", {
12244
12244
  class: "d-flex align-end pt-3 pr-3",
12245
- style: qe(v.value)
12245
+ style: Je(v.value)
12246
12246
  }, [
12247
- Ae(Ph, { lock: s.value }, null, 8, ["lock"]),
12248
- Ae(Uh, {
12247
+ Te(Ph, { lock: s.value }, null, 8, ["lock"]),
12248
+ Te(Uh, {
12249
12249
  modelValue: s.value,
12250
- "onUpdate:modelValue": se[0] || (se[0] = (M) => s.value = M)
12250
+ "onUpdate:modelValue": se[0] || (se[0] = (H) => s.value = H)
12251
12251
  }, null, 8, ["modelValue"]),
12252
- Ae(Vf, {
12252
+ Te(Vf, {
12253
12253
  type: m.value,
12254
12254
  lock: s.value
12255
12255
  }, null, 8, ["type", "lock"])
12256
12256
  ], 4),
12257
12257
  s.value ? (me(), st("div", {
12258
12258
  key: 1,
12259
- style: qe(L.value)
12259
+ style: Je(L.value)
12260
12260
  }, null, 4)) : Lt("", !0),
12261
12261
  s.value ? (me(), st("div", {
12262
12262
  key: 2,
12263
- style: qe(N.value)
12263
+ style: Je(N.value)
12264
12264
  }, null, 4)) : Lt("", !0),
12265
- d.value ? (me(), je(E, {
12266
- key: 3,
12267
- "z-index": 99
12268
- })) : Lt("", !0)
12265
+ Te(M, null, {
12266
+ default: Xe(() => [
12267
+ d.value ? (me(), je(E, {
12268
+ key: 0,
12269
+ "z-index": 99
12270
+ })) : Lt("", !0)
12271
+ ]),
12272
+ _: 1
12273
+ })
12269
12274
  ]);
12270
12275
  };
12271
12276
  }
@@ -12970,14 +12975,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
12970
12975
  let y = w.keywordPatternRe.exec(oe), F = "";
12971
12976
  for (; y; ) {
12972
12977
  F += oe.substring(A, y.index);
12973
- const J = ze.case_insensitive ? y[0].toLowerCase() : y[0], Ce = Be(w, J);
12978
+ const J = qe.case_insensitive ? y[0].toLowerCase() : y[0], Ce = Be(w, J);
12974
12979
  if (Ce) {
12975
12980
  const [ot, Jr] = Ce;
12976
12981
  if (Oe.addText(F), F = "", ae[J] = (ae[J] || 0) + 1, ae[J] <= xg && (Un += Jr), ot.startsWith("_"))
12977
12982
  F += y[0];
12978
12983
  else {
12979
- const Qr = ze.classNameAliases[ot] || ot;
12980
- Xe(y[0], Qr);
12984
+ const Qr = qe.classNameAliases[ot] || ot;
12985
+ ze(y[0], Qr);
12981
12986
  }
12982
12987
  } else
12983
12988
  F += y[0];
@@ -13002,7 +13007,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13002
13007
  function Ue() {
13003
13008
  w.subLanguage != null ? Mn() : Ye(), oe = "";
13004
13009
  }
13005
- function Xe(A, y) {
13010
+ function ze(A, y) {
13006
13011
  A !== "" && (Oe.startScope(y), Oe.addText(A), Oe.endScope());
13007
13012
  }
13008
13013
  function Zi(A, y) {
@@ -13013,12 +13018,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13013
13018
  F++;
13014
13019
  continue;
13015
13020
  }
13016
- const Ce = ze.classNameAliases[A[F]] || A[F], ot = y[F];
13017
- Ce ? Xe(ot, Ce) : (oe = ot, Ye(), oe = ""), F++;
13021
+ const Ce = qe.classNameAliases[A[F]] || A[F], ot = y[F];
13022
+ Ce ? ze(ot, Ce) : (oe = ot, Ye(), oe = ""), F++;
13018
13023
  }
13019
13024
  }
13020
13025
  function es(A, y) {
13021
- return A.scope && typeof A.scope == "string" && Oe.openNode(ze.classNameAliases[A.scope] || A.scope), A.beginScope && (A.beginScope._wrap ? (Xe(oe, ze.classNameAliases[A.beginScope._wrap] || A.beginScope._wrap), oe = "") : A.beginScope._multi && (Zi(A.beginScope, y), oe = "")), w = Object.create(A, { parent: { value: w } }), w;
13026
+ return A.scope && typeof A.scope == "string" && Oe.openNode(qe.classNameAliases[A.scope] || A.scope), A.beginScope && (A.beginScope._wrap ? (ze(oe, qe.classNameAliases[A.beginScope._wrap] || A.beginScope._wrap), oe = "") : A.beginScope._multi && (Zi(A.beginScope, y), oe = "")), w = Object.create(A, { parent: { value: w } }), w;
13022
13027
  }
13023
13028
  function ts(A, y, F) {
13024
13029
  let J = Zf(A.endRe, F);
@@ -13051,7 +13056,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13051
13056
  if (!J)
13052
13057
  return ua;
13053
13058
  const Ce = w;
13054
- w.endScope && w.endScope._wrap ? (Ue(), Xe(y, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (Ue(), Zi(w.endScope, A)) : Ce.skip ? oe += y : (Ce.returnEnd || Ce.excludeEnd || (oe += y), Ue(), Ce.excludeEnd && (oe = y));
13059
+ w.endScope && w.endScope._wrap ? (Ue(), ze(y, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (Ue(), Zi(w.endScope, A)) : Ce.skip ? oe += y : (Ce.returnEnd || Ce.excludeEnd || (oe += y), Ue(), Ce.excludeEnd && (oe = y));
13055
13060
  do
13056
13061
  w.scope && Oe.closeNode(), !w.skip && !w.subLanguage && (Un += w.relevance), w = w.parent;
13057
13062
  while (w !== J.parent);
@@ -13059,7 +13064,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13059
13064
  }
13060
13065
  function zr() {
13061
13066
  const A = [];
13062
- for (let y = w; y !== ze; y = y.parent)
13067
+ for (let y = w; y !== qe; y = y.parent)
13063
13068
  y.scope && A.unshift(y.scope);
13064
13069
  A.forEach((y) => Oe.openNode(y));
13065
13070
  }
@@ -13091,17 +13096,17 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13091
13096
  throw new Error("potential infinite loop, way more iterations than matches");
13092
13097
  return oe += F, F.length;
13093
13098
  }
13094
- const ze = S(f);
13095
- if (!ze)
13099
+ const qe = S(f);
13100
+ if (!qe)
13096
13101
  throw St(s.replace("{}", f)), new Error('Unknown language: "' + f + '"');
13097
- const qr = Dg(ze);
13102
+ const qr = Dg(qe);
13098
13103
  let Yo = "", w = H || qr;
13099
13104
  const os = {}, Oe = new l.__emitter(l);
13100
13105
  zr();
13101
13106
  let oe = "", Un = 0, It = 0, Ko = 0, Ho = !1;
13102
13107
  try {
13103
- if (ze.__emitTokens)
13104
- ze.__emitTokens(E, Oe);
13108
+ if (qe.__emitTokens)
13109
+ qe.__emitTokens(E, Oe);
13105
13110
  else {
13106
13111
  for (w.matcher.considerAll(); ; ) {
13107
13112
  Ko++, Ho ? Ho = !1 : w.matcher.considerAll(), w.matcher.lastIndex = It;
@@ -13165,12 +13170,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13165
13170
  (Ue) => d(Ue, f, !1)
13166
13171
  );
13167
13172
  H.unshift(M);
13168
- const ae = H.sort((Ue, Xe) => {
13169
- if (Ue.relevance !== Xe.relevance) return Xe.relevance - Ue.relevance;
13170
- if (Ue.language && Xe.language) {
13171
- if (S(Ue.language).supersetOf === Xe.language)
13173
+ const ae = H.sort((Ue, ze) => {
13174
+ if (Ue.relevance !== ze.relevance) return ze.relevance - Ue.relevance;
13175
+ if (Ue.language && ze.language) {
13176
+ if (S(Ue.language).supersetOf === ze.language)
13172
13177
  return 1;
13173
- if (S(Xe.language).supersetOf === Ue.language)
13178
+ if (S(ze.language).supersetOf === Ue.language)
13174
13179
  return -1;
13175
13180
  }
13176
13181
  return 0;
@@ -13230,7 +13235,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13230
13235
  G && ne();
13231
13236
  }
13232
13237
  typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", j, !1);
13233
- function Te(f, E) {
13238
+ function Ee(f, E) {
13234
13239
  let M = null;
13235
13240
  try {
13236
13241
  M = E(e);
@@ -13300,7 +13305,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), ae = f, H = E), M ===
13300
13305
  configure: N,
13301
13306
  initHighlighting: L,
13302
13307
  initHighlightingOnLoad: K,
13303
- registerLanguage: Te,
13308
+ registerLanguage: Ee,
13304
13309
  unregisterLanguage: De,
13305
13310
  listLanguages: k,
13306
13311
  getLanguage: S,
@@ -13662,7 +13667,7 @@ function Hg(e) {
13662
13667
  keywords: l,
13663
13668
  contains: ["self"].concat(ne)
13664
13669
  }
13665
- ]), Te = {
13670
+ ]), Ee = {
13666
13671
  className: "params",
13667
13672
  // convert this to negative lookbehind in v12
13668
13673
  begin: /(\s*)\(/,
@@ -13757,7 +13762,7 @@ function Hg(e) {
13757
13762
  3: "title.function"
13758
13763
  },
13759
13764
  label: "func.def",
13760
- contains: [Te],
13765
+ contains: [Ee],
13761
13766
  illegal: /%/
13762
13767
  }, Q = {
13763
13768
  relevance: 0,
@@ -13805,7 +13810,7 @@ function Hg(e) {
13805
13810
  // eat to avoid empty params
13806
13811
  begin: /\(\)/
13807
13812
  },
13808
- Te
13813
+ Ee
13809
13814
  ]
13810
13815
  }, se = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", f = {
13811
13816
  match: [
@@ -13824,7 +13829,7 @@ function Hg(e) {
13824
13829
  3: "title.function"
13825
13830
  },
13826
13831
  contains: [
13827
- Te
13832
+ Ee
13828
13833
  ]
13829
13834
  };
13830
13835
  return {
@@ -13948,7 +13953,7 @@ function Hg(e) {
13948
13953
  returnBegin: !0,
13949
13954
  label: "func.def",
13950
13955
  contains: [
13951
- Te,
13956
+ Ee,
13952
13957
  e.inherit(e.TITLE_MODE, { begin: o, className: "title.function" })
13953
13958
  ]
13954
13959
  },
@@ -13968,7 +13973,7 @@ function Hg(e) {
13968
13973
  {
13969
13974
  match: [/\bconstructor(?=\s*\()/],
13970
13975
  className: { 1: "title.function" },
13971
- contains: [Te]
13976
+ contains: [Ee]
13972
13977
  },
13973
13978
  Z,
13974
13979
  Q,
@@ -13988,14 +13993,14 @@ var _a = tt({ props: { code: { type: String, required: !0 }, language: { type: S
13988
13993
  }, function(i) {
13989
13994
  t.value = i;
13990
13995
  });
13991
- var n = Ee(function() {
13996
+ var n = Ae(function() {
13992
13997
  return e.autodetect || !t.value;
13993
- }), o = Ee(function() {
13998
+ }), o = Ae(function() {
13994
13999
  return !n.value && !no.getLanguage(t.value);
13995
14000
  });
13996
- return { className: Ee(function() {
14001
+ return { className: Ae(function() {
13997
14002
  return o.value ? "" : "hljs " + t.value;
13998
- }), highlightedCode: Ee(function() {
14003
+ }), highlightedCode: Ae(function() {
13999
14004
  var i;
14000
14005
  if (o.value) return console.warn('The language "' + t.value + '" you specified could not be found.'), e.code.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
14001
14006
  if (n.value) {
@@ -14025,8 +14030,8 @@ const Gg = /* @__PURE__ */ tt({
14025
14030
  width: "100%",
14026
14031
  height: "100%"
14027
14032
  }, {
14028
- default: Qe(() => [
14029
- Ae(Y(n), {
14033
+ default: Xe(() => [
14034
+ Te(Y(n), {
14030
14035
  language: "js",
14031
14036
  code: t.code
14032
14037
  }, null, 8, ["code"])
@@ -14038,7 +14043,7 @@ const Gg = /* @__PURE__ */ tt({
14038
14043
  }), Wg = { class: "text-subtitle-1 ml-3" }, jg = /* @__PURE__ */ tt({
14039
14044
  __name: "index",
14040
14045
  setup(e) {
14041
- const { t } = Nn(), { sysBarAvail: n } = Ea(), { backgroundColor0: o, backgroundColor2: i } = Io(), s = at(""), a = Ee(() => {
14046
+ const { t } = Nn(), { sysBarAvail: n } = Ea(), { backgroundColor0: o, backgroundColor2: i } = Io(), s = at(""), a = Ae(() => {
14042
14047
  let p = 48;
14043
14048
  return n.value && (p += 24), {
14044
14049
  position: "relative",
@@ -14059,37 +14064,37 @@ const Gg = /* @__PURE__ */ tt({
14059
14064
  fullscreen: "",
14060
14065
  onKeydown: _[2] || (_[2] = ha(_n((v) => c.value = !1, ["stop", "prevent"]), ["esc"]))
14061
14066
  }, {
14062
- default: Qe(() => [
14063
- Ae(d, {
14067
+ default: Xe(() => [
14068
+ Te(d, {
14064
14069
  color: Y(o),
14065
14070
  width: "100%",
14066
14071
  height: "100%"
14067
14072
  }, {
14068
- default: Qe(() => [
14073
+ default: Xe(() => [
14069
14074
  Y(n) ? (me(), je(d, {
14070
14075
  key: 0,
14071
14076
  color: Y(i),
14072
14077
  height: 24
14073
14078
  }, null, 8, ["color"])) : Lt("", !0),
14074
- Ae(d, {
14079
+ Te(d, {
14075
14080
  class: "d-flex align-center px-3",
14076
14081
  color: Y(i),
14077
14082
  height: 48
14078
14083
  }, {
14079
- default: Qe(() => [
14080
- Ae(h, {
14084
+ default: Xe(() => [
14085
+ Te(h, {
14081
14086
  icon: Y(Aa),
14082
14087
  onClick: _[0] || (_[0] = (v) => c.value = !1)
14083
14088
  }, null, 8, ["icon"]),
14084
14089
  We("span", Wg, vo(Y(t)("x-block-lib.dlg.source.title")), 1),
14085
- Ae(m)
14090
+ Te(m)
14086
14091
  ]),
14087
14092
  _: 1
14088
14093
  }, 8, ["color"]),
14089
14094
  We("div", {
14090
- style: qe(a.value)
14095
+ style: Je(a.value)
14091
14096
  }, [
14092
- Ae(Gg, { code: s.value }, null, 8, ["code"])
14097
+ Te(Gg, { code: s.value }, null, 8, ["code"])
14093
14098
  ], 4)
14094
14099
  ]),
14095
14100
  _: 1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.5.23",
4
+ "version": "0.5.24",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "vue": "^3.5.12",
32
32
  "vue-draggable-plus": "^0.5.4",
33
33
  "vuetify": "^3.7.3",
34
- "x-essential-lib": "^0.7.11",
34
+ "x-essential-lib": "^0.7.15",
35
35
  "x-runtime-lib": "^0.5.39",
36
36
  "x-state-lib": "^0.1.7"
37
37
  },