@versa-stack/v-craft 1.0.4-rc.1 → 1.1.0-alpha.1

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 (37) hide show
  1. package/dist/types/components/CraftEditor.vue.d.ts +4 -7
  2. package/dist/types/components/CraftEditorBlueprint.vue.d.ts +2 -1
  3. package/dist/types/components/CraftEditorBlueprintsList.vue.d.ts +2 -1
  4. package/dist/types/components/CraftEditorPanelForm.vue.d.ts +17 -16
  5. package/dist/types/components/CraftEditorPanelLayers.vue.d.ts +2 -1
  6. package/dist/types/components/CraftEditorPanelLayout.vue.d.ts +2 -1
  7. package/dist/types/components/CraftEditorPanelNodeEventsSettings.vue.d.ts +6 -7
  8. package/dist/types/components/CraftEditorPanelNodeLayer.vue.d.ts +2 -1
  9. package/dist/types/components/CraftEditorPanelNodeSettings.vue.d.ts +6 -7
  10. package/dist/types/components/CraftEditorPanelSettings.vue.d.ts +4 -3
  11. package/dist/types/components/CraftFrame.vue.d.ts +4 -10
  12. package/dist/types/components/CraftIframe.vue.d.ts +1 -5
  13. package/dist/types/components/CraftNodeStatic.vue.d.ts +9 -0
  14. package/dist/types/components/CraftStaticRenderer.vue.d.ts +5 -3
  15. package/dist/types/components/composable/index.d.ts +1 -0
  16. package/dist/types/components/composable/useCraftFrame.d.ts +134 -104
  17. package/dist/types/components/composable/useCraftNode.d.ts +3 -3
  18. package/dist/types/components/composable/useCraftNodeEvents.d.ts +1 -2
  19. package/dist/types/components/composable/useCraftNodeWrapper.d.ts +133 -104
  20. package/dist/types/components/composable/useDragCraftNode.d.ts +2 -1
  21. package/dist/types/components/composable/useNodeElement.d.ts +9 -0
  22. package/dist/types/components/composable/useResolveCraftNode.d.ts +4 -2
  23. package/dist/types/components/index.d.ts +1 -1
  24. package/dist/types/components/utils.d.ts +3 -1
  25. package/dist/types/lib/CraftNodeResolver.d.ts +13 -6
  26. package/dist/types/lib/craftNode.d.ts +15 -12
  27. package/dist/types/lib/dragCraftNode/dragOver.d.ts +2 -1
  28. package/dist/types/lib/dragCraftNode/drop.d.ts +3 -2
  29. package/dist/types/lib/dragCraftNode/index.d.ts +2 -2
  30. package/dist/types/lib/model.d.ts +18 -3
  31. package/dist/types/lib/renderCraftNodes.d.ts +4 -3
  32. package/dist/types/lib/vNodeToCraftNode.d.ts +2 -1
  33. package/dist/types/store/editor.d.ts +134 -105
  34. package/dist/v-craft.css +1 -1
  35. package/dist/v-craft.es.js +1356 -1208
  36. package/dist/v-craft.es.js.map +1 -1
  37. package/package.json +1 -1
@@ -1,54 +1,67 @@
1
- import { defineComponent as $, useSlots as Be, useAttrs as ot, inject as ae, computed as w, openBlock as v, createBlock as N, resolveDynamicComponent as me, normalizeProps as Ae, mergeProps as Oe, unref as f, createSlots as ge, renderList as M, withCtx as X, renderSlot as W, guardReactiveProps as it, createCommentVNode as x, markRaw as Ue, ref as K, watch as le, normalizeClass as oe, createTextVNode as at, toDisplayString as ne, createElementBlock as E, withKeys as Pe, withModifiers as V, nextTick as ue, provide as re, resolveComponent as B, createVNode as G, Fragment as T, createElementVNode as O, toRef as ce, onUnmounted as Le, toRefs as fe, normalizeStyle as je, withDirectives as lt, Teleport as ut, vShow as ct, onMounted as Ne, onBeforeMount as dt, onBeforeUnmount as ft, readonly as ht, toHandlers as Fe, h as pt } from "vue";
2
- import { defineStore as He, storeToRefs as Z } from "pinia";
3
- import { v4 as de } from "uuid";
4
- import { debounce as Ve } from "lodash-es";
5
- import { FormKit as Ke, FormKitSchema as Xe } from "@formkit/vue";
6
- const vt = /* @__PURE__ */ $({
1
+ import { inject as ue, computed as b, defineAsyncComponent as ft, defineComponent as I, useSlots as je, useAttrs as ht, unref as d, openBlock as m, createBlock as x, resolveDynamicComponent as ce, normalizeProps as Pe, mergeProps as ge, createSlots as de, renderList as $, withCtx as H, renderSlot as Y, guardReactiveProps as pt, createCommentVNode as k, markRaw as Fe, ref as F, watch as te, normalizeClass as se, createTextVNode as vt, toDisplayString as ee, createElementBlock as y, withKeys as Me, withModifiers as j, nextTick as ne, provide as q, resolveComponent as U, createVNode as W, Fragment as R, createElementVNode as S, toRef as ve, onUnmounted as mt, toRefs as ie, normalizeStyle as Se, withDirectives as gt, Teleport as yt, vShow as bt, onMounted as ye, onBeforeMount as Et, onBeforeUnmount as Ct, readonly as He, onUpdated as _t, toHandlers as ke, h as Nt } from "vue";
2
+ import { defineStore as Ve, storeToRefs as G } from "pinia";
3
+ import { v4 as le } from "uuid";
4
+ import { debounce as Ke } from "lodash-es";
5
+ import { FormKit as Xe, FormKitSchema as ze } from "@formkit/vue";
6
+ const wt = (t, e) => {
7
+ if (!t)
8
+ return e.componentName;
9
+ const r = t.resolveComponent(e);
10
+ return r ? typeof r == "function" && !("setup" in r) && !("render" in r) ? ft(r) : r : t.resolve(e.componentName)?.componentName || e.componentName;
11
+ }, fe = (t) => {
12
+ const e = ue("resolver"), r = b(() => !e || !t?.value ? {} : e.value.resolve(
13
+ t.value.componentName
14
+ )), n = b(() => r.value?.defaultProps || {}), o = b(
15
+ () => wt(e?.value, t.value)
16
+ );
17
+ return {
18
+ resolvedNode: r,
19
+ resolver: e,
20
+ defaultProps: n,
21
+ componentToRender: o
22
+ };
23
+ }, Ot = /* @__PURE__ */ I({
7
24
  name: "CraftCanvas",
8
25
  __name: "CraftCanvas",
9
26
  props: {
10
27
  componentName: {}
11
28
  },
12
29
  setup(t) {
13
- const e = Be(), r = ot(), n = t, s = ae("resolver"), o = w(() => s?.value.resolve(n.componentName)), i = w(() => o.value?.componentName || n.componentName);
14
- return (a, c) => i.value ? (v(), N(me(i.value), Ae(Oe({ key: 0 }, f(r))), ge({ _: 2 }, [
15
- M(f(e), (u, d) => ({
16
- name: d,
17
- fn: X((h) => [
18
- W(a.$slots, d, Ae(it(h || {})))
30
+ const e = je(), r = ht(), n = t, o = b(() => ({
31
+ componentName: n.componentName,
32
+ props: {},
33
+ slots: {},
34
+ uuid: ""
35
+ })), { componentToRender: s } = fe(o);
36
+ return (i, a) => d(s) ? (m(), x(ce(d(s)), Pe(ge({ key: 0 }, d(r))), de({ _: 2 }, [
37
+ $(d(e), (u, c) => ({
38
+ name: c,
39
+ fn: H((f) => [
40
+ Y(i.$slots, c, Pe(pt(f || {})))
19
41
  ])
20
42
  }))
21
- ]), 1040)) : x("", !0);
43
+ ]), 1040)) : k("", !0);
22
44
  }
23
- }), xe = (t) => {
24
- const e = ae("resolver"), r = w(() => !e || !t?.value ? {} : e.value.resolve(
25
- t.value.componentName
26
- )), n = w(() => r.value?.defaultProps || {});
27
- return {
28
- resolvedNode: r,
29
- resolver: e,
30
- defaultProps: n
31
- };
32
- }, mt = () => {
33
- const t = ae("craftNode");
45
+ }), xt = () => {
46
+ const t = ue("craftNode");
34
47
  if (!t)
35
48
  throw new Error("craftNode or resolver not provided");
36
- const { resolver: e, resolvedNode: r, defaultProps: n } = xe(t);
49
+ const { resolver: e, resolvedNode: r, defaultProps: n } = fe(t);
37
50
  return {
38
51
  craftNode: t,
39
52
  resolver: e,
40
53
  resolvedNode: r,
41
54
  defaultProps: n
42
55
  };
43
- }, ze = (t) => t.visible === void 0 || t.visible, gt = (t) => {
56
+ }, qe = (t) => t.visible === void 0 || t.visible, St = (t) => {
44
57
  let e = t;
45
- const r = j();
58
+ const r = L();
46
59
  for (; e.parentUuid; )
47
- if (e = r.nodeMap.get(e.parentUuid), q(e))
60
+ if (e = r.nodeMap.get(e.parentUuid), K(e))
48
61
  return !0;
49
62
  return !1;
50
- }, yt = (t) => gt(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, qe = (t, e) => {
51
- const r = j();
63
+ }, kt = (t) => St(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, Ye = (t, e) => {
64
+ const r = L();
52
65
  let n = e;
53
66
  for (; n?.parentUuid; ) {
54
67
  if (n.parentUuid === t.uuid)
@@ -56,26 +69,34 @@ const vt = /* @__PURE__ */ $({
56
69
  n = r.nodeMap.get(n.parentUuid);
57
70
  }
58
71
  return !1;
59
- }, te = (t) => t.componentName === "CraftCanvas" ? t.props.componentName : t.componentName, ie = (t, e, r) => {
60
- if (!q(e) || t.uuid === e.uuid)
72
+ }, J = (t) => t.componentName === "CraftCanvas" ? t.props.componentName : t.componentName, oe = (t, e, r) => {
73
+ if (!K(e) || t.uuid === e.uuid)
61
74
  return !1;
62
- const n = r.resolve(te(e)), s = r.resolve(te(t)), o = n?.rules || {}, i = s?.rules || {};
75
+ const n = r.resolve(J(e)), o = r.resolve(J(t)), s = n?.rules || {}, i = o?.rules || {};
63
76
  if (t.parentUuid) {
64
- const c = j().nodeMap.get(t.parentUuid), u = r.resolve(te(c))?.rules || {};
65
- if (u.canMoveOut && !u.canMoveOut(t, e, r))
77
+ const u = L().nodeMap.get(t.parentUuid), c = r.resolve(J(u))?.rules || {};
78
+ if (c.canMoveOut && !c.canMoveOut(t, e, r))
66
79
  return;
67
80
  }
68
- return !(i.canMoveInto && !i.canMoveInto(t, e, r) || qe(t, e) || o.canMoveIn && !o.canMoveIn(t, e, r));
69
- }, q = (t) => t.componentName === "CraftCanvas", pe = (t, e, r) => {
70
- const n = j();
71
- return e.uuid === t.uuid || !e.parentUuid ? !1 : ie(
81
+ return !(i.canMoveInto && !i.canMoveInto(t, e, r) || Ye(t, e) || s.canMoveIn && !s.canMoveIn(t, e, r));
82
+ }, K = (t) => t.componentName === "CraftCanvas", me = (t, e, r) => {
83
+ const n = L();
84
+ return e.uuid === t.uuid || !e.parentUuid ? !1 : oe(
72
85
  t,
73
86
  n.nodeMap.get(e.parentUuid),
74
87
  r
75
88
  );
76
- }, We = (t) => (t.uuid || (t.uuid = de()), t.slots && Object.values(t.slots).forEach((e) => {
77
- e.forEach((r) => (r.uuid || (r.uuid = de()), r.parentUuid !== t.uuid && (r.parentUuid = t.uuid), We(r), r));
78
- }), t), j = He("editor", {
89
+ }, Qe = (t) => (t.uuid || (t.uuid = le()), t.slots && Object.values(t.slots).forEach((e) => {
90
+ e.forEach((r) => (r.uuid || (r.uuid = le()), r.parentUuid !== t.uuid && (r.parentUuid = t.uuid), Qe(r), r));
91
+ }), t), We = (t, e) => {
92
+ if (!t.slots || Object.keys(t.slots).length === 0) {
93
+ const n = e.resolveNode?.(t)?.slots;
94
+ n && n.length > 0 ? (t.slots = {}, n.forEach((o) => {
95
+ t.slots[o] = [];
96
+ })) : t.slots = { default: [] };
97
+ }
98
+ return t;
99
+ }, L = Ve("editor", {
79
100
  state: () => ({
80
101
  nodeMap: /* @__PURE__ */ new Map(),
81
102
  rootNodes: [],
@@ -113,12 +134,12 @@ const vt = /* @__PURE__ */ $({
113
134
  toggleNodeVisibility(t) {
114
135
  const e = this.nodeMap.get(t.uuid);
115
136
  if (e) {
116
- if (e.visible = !ze(e), e.slots) {
117
- const r = (n) => (n.visible = e.visible, n.slots && Object.values(n.slots).forEach((s) => {
118
- s.forEach((o) => r(o));
137
+ if (e.visible = !qe(e), e.slots) {
138
+ const r = (n) => (n.visible = e.visible, n.slots && Object.values(n.slots).forEach((o) => {
139
+ o.forEach((s) => r(s));
119
140
  }), this.nodeMap.set(n.uuid, n), n);
120
141
  Object.values(e.slots).forEach((n) => {
121
- n.forEach((s) => r(s));
142
+ n.forEach((o) => r(o));
122
143
  });
123
144
  }
124
145
  this.nodeMap.set(e.uuid, e);
@@ -138,18 +159,22 @@ const vt = /* @__PURE__ */ $({
138
159
  setNodes(t) {
139
160
  this.clear(), this.rootNodes = [];
140
161
  const e = (r) => {
141
- this.nodeMap.set(r.uuid, { ...r, slots: {} }), r.parentUuid || this.rootNodes.push(r.uuid), r.slots && Object.entries(r.slots).forEach(([n, s]) => {
142
- s.forEach((o) => {
143
- o.parentUuid = r.uuid, e(o), this.nodeMap.get(r.uuid).slots[n] || (this.nodeMap.get(r.uuid).slots[n] = []), this.nodeMap.get(r.uuid).slots[n].push(o);
162
+ this.resolver && r.componentName === "CraftCanvas" && We(r, this.resolver);
163
+ const n = r.slots ? {} : { default: [] };
164
+ r.slots && Object.keys(r.slots).forEach((o) => {
165
+ n[o] = [];
166
+ }), this.nodeMap.set(r.uuid, { ...r, slots: n }), r.parentUuid || this.rootNodes.push(r.uuid), r.slots && Object.entries(r.slots).forEach(([o, s]) => {
167
+ s.forEach((i) => {
168
+ i.parentUuid = r.uuid, e(i), this.nodeMap.get(r.uuid).slots[o] || (this.nodeMap.get(r.uuid).slots[o] = []), this.nodeMap.get(r.uuid).slots[o].push(i);
144
169
  });
145
170
  });
146
171
  };
147
172
  t.forEach(e);
148
173
  },
149
174
  addNodeRecursively(t, e = null) {
150
- const r = t.uuid || de(), n = { ...t, uuid: r, parentUuid: e };
151
- this.nodeMap.set(r, Ue(n)), e || this.rootNodes.push(r), t.slots && Object.values(t.slots).forEach((s) => {
152
- s.forEach((o) => this.addNodeRecursively(o, r));
175
+ const r = t.uuid || le(), n = { ...t, uuid: r, parentUuid: e };
176
+ this.nodeMap.set(r, Fe(n)), e || this.rootNodes.push(r), t.slots && Object.values(t.slots).forEach((o) => {
177
+ o.forEach((s) => this.addNodeRecursively(s, r));
153
178
  });
154
179
  },
155
180
  selectNode(t) {
@@ -162,8 +187,8 @@ const vt = /* @__PURE__ */ $({
162
187
  this.emancipateNode(t), t.uuid === this.selectedUuid && (this.selectedUuid = null);
163
188
  const e = (r) => {
164
189
  r.slots && Object.values(r.slots).forEach((n) => {
165
- n.forEach((s) => {
166
- this.nodeMap.delete(s.uuid), delete this.nodeRefsRecord[s.uuid], e(s);
190
+ n.forEach((o) => {
191
+ this.nodeMap.delete(o.uuid), delete this.nodeRefsRecord[o.uuid], e(o);
167
192
  });
168
193
  });
169
194
  };
@@ -175,9 +200,9 @@ const vt = /* @__PURE__ */ $({
175
200
  const e = t.parentUuid;
176
201
  if (!e) return t;
177
202
  const r = this.nodeMap.get(e);
178
- return r && r.slots && Object.entries(r.slots).forEach(([n, s]) => {
179
- r.slots[n] = s.filter(
180
- (o) => o.uuid !== t.uuid
203
+ return r && r.slots && Object.entries(r.slots).forEach(([n, o]) => {
204
+ r.slots[n] = o.filter(
205
+ (s) => s.uuid !== t.uuid
181
206
  );
182
207
  }), t.parentUuid = null, this.nodeMap.get(t.uuid) === t && this.nodeMap.delete(t.uuid), t;
183
208
  },
@@ -188,11 +213,11 @@ const vt = /* @__PURE__ */ $({
188
213
  },
189
214
  appendNodeTo(t, e, r = "default") {
190
215
  if (!this.resolver) throw new Error("Resolver is not set.");
191
- if (!ie(t, e, this.resolver))
216
+ if (!oe(t, e, this.resolver))
192
217
  throw new Error(
193
- `${te(
218
+ `${J(
194
219
  t
195
- )} is not allowed to be a child of ${te(e)}.`
220
+ )} is not allowed to be a child of ${J(e)}.`
196
221
  );
197
222
  t = this.emancipateNode(t), t.parentUuid = e.uuid;
198
223
  const n = this.nodeMap.get(e.uuid);
@@ -200,11 +225,11 @@ const vt = /* @__PURE__ */ $({
200
225
  },
201
226
  prependNodeTo(t, e, r = "default") {
202
227
  if (!this.resolver) throw new Error("Resolver is not set");
203
- if (!ie(t, e, this.resolver))
228
+ if (!oe(t, e, this.resolver))
204
229
  throw new Error(
205
- `${te(
230
+ `${J(
206
231
  t
207
- )} is not allowed to be a child of ${te(e)}.`
232
+ )} is not allowed to be a child of ${J(e)}.`
208
233
  );
209
234
  t = this.emancipateNode(t), t.parentUuid = e.uuid;
210
235
  const n = this.nodeMap.get(e.uuid);
@@ -212,41 +237,41 @@ const vt = /* @__PURE__ */ $({
212
237
  },
213
238
  insertNodeBefore(t, e, r) {
214
239
  if (!this.resolver) throw new Error("Resolver is not set");
215
- if (!pe(t, e, this.resolver))
240
+ if (!me(t, e, this.resolver))
216
241
  throw new Error("Can not be the sibling of the target node.");
217
242
  t = this.emancipateNode(t);
218
243
  const n = e.parentUuid;
219
244
  if (!n) throw new Error("Target node has no parent.");
220
- const s = this.nodeMap.get(n);
221
- if (s && s.slots) {
222
- const o = r || Object.keys(s.slots).find(
223
- (i) => s.slots[i].some((a) => a.uuid === e.uuid)
245
+ const o = this.nodeMap.get(n);
246
+ if (o && o.slots) {
247
+ const s = r || Object.keys(o.slots).find(
248
+ (i) => o.slots[i].some((a) => a.uuid === e.uuid)
224
249
  );
225
- if (o && s.slots[o]) {
226
- const i = s.slots[o].findIndex(
250
+ if (s && o.slots[s]) {
251
+ const i = o.slots[s].findIndex(
227
252
  (a) => a.uuid === e.uuid
228
253
  );
229
- i !== -1 && (s.slots[o].splice(i, 0, t), t.parentUuid = n, this.nodeMap.set(s.uuid, s), this.addNodeAndChildrenToMap(t));
254
+ i !== -1 && (o.slots[s].splice(i, 0, t), t.parentUuid = n, this.nodeMap.set(o.uuid, o), this.addNodeAndChildrenToMap(t));
230
255
  }
231
256
  }
232
257
  },
233
258
  insertNodeAfter(t, e, r) {
234
259
  if (!this.resolver) throw new Error("Resolver is not set");
235
- if (!pe(t, e, this.resolver))
260
+ if (!me(t, e, this.resolver))
236
261
  throw new Error("Can not be the sibling of the target node.");
237
262
  t = this.emancipateNode(t);
238
263
  const n = e.parentUuid;
239
264
  if (!n) throw new Error("Target node has no parent.");
240
- const s = this.nodeMap.get(n);
241
- if (s && s.slots) {
242
- const o = r || Object.keys(s.slots).find(
243
- (i) => s.slots[i].some((a) => a.uuid === e.uuid)
265
+ const o = this.nodeMap.get(n);
266
+ if (o && o.slots) {
267
+ const s = r || Object.keys(o.slots).find(
268
+ (i) => o.slots[i].some((a) => a.uuid === e.uuid)
244
269
  );
245
- if (o && s.slots[o]) {
246
- const i = s.slots[o].findIndex(
270
+ if (s && o.slots[s]) {
271
+ const i = o.slots[s].findIndex(
247
272
  (a) => a.uuid === e.uuid
248
273
  );
249
- i !== -1 && (s.slots[o].splice(i + 1, 0, t), t.parentUuid = n, this.nodeMap.set(s.uuid, s), this.addNodeAndChildrenToMap(t));
274
+ i !== -1 && (o.slots[s].splice(i + 1, 0, t), t.parentUuid = n, this.nodeMap.set(o.uuid, o), this.addNodeAndChildrenToMap(t));
250
275
  }
251
276
  }
252
277
  },
@@ -266,18 +291,20 @@ const vt = /* @__PURE__ */ $({
266
291
  const n = t.nodeMap.get(r);
267
292
  if (!n)
268
293
  throw new Error(`Node with UUID ${r} not found`);
269
- const s = {};
270
- return n.slots && Object.entries(n.slots).forEach(([o, i]) => {
271
- s[o] = i.map((a) => e(a.uuid));
294
+ const o = {};
295
+ return n.slots && Object.entries(n.slots).forEach(([s, i]) => {
296
+ o[s] = i.map(
297
+ (a) => e(a.uuid)
298
+ );
272
299
  }), {
273
300
  ...n,
274
- slots: s
301
+ slots: o
275
302
  };
276
303
  };
277
304
  return t.rootNodes.map((r) => e(r));
278
305
  }
279
306
  }
280
- }), bt = ["value", "onKeyup"], Et = /* @__PURE__ */ $({
307
+ }), Dt = ["value", "onKeyup"], At = /* @__PURE__ */ I({
281
308
  __name: "CraftComponentSimpleText",
282
309
  props: {
283
310
  content: { default: "Lorem ipsum dolor sit amet..." },
@@ -286,77 +313,100 @@ const vt = /* @__PURE__ */ $({
286
313
  },
287
314
  emits: ["update:content"],
288
315
  setup(t, { emit: e }) {
289
- const r = t, n = e, s = K(!1), o = K(null), i = K(""), a = j(), { enabled: c } = Z(a), { craftNode: u } = mt(), d = w(() => c.value && !s.value), h = () => {
290
- d.value && m();
291
- }, m = () => {
292
- i.value = r.content, s.value = !0, a.disableDragging(), ue(() => {
293
- o.value && (o.value.focus(), p());
294
- });
295
- }, p = () => {
296
- o.value && (o.value.style.height = "auto", o.value.style.height = `${o.value.scrollHeight}px`);
297
- }, b = async () => {
298
- if (a.enableDragging(), s.value) {
299
- s.value = !1;
300
- const D = o.value?.value.trim() || "";
301
- if (D !== r.content) {
302
- if (!u.value?.uuid)
303
- return;
304
- a.nodeMap.set(u.value.uuid, {
305
- ...u.value,
306
- props: {
307
- ...u.value.props,
308
- content: D
309
- }
310
- }), await ue(), n("update:content", D);
311
- }
316
+ const r = t, n = e, s = (() => {
317
+ try {
318
+ return L();
319
+ } catch {
320
+ return null;
312
321
  }
322
+ })(), i = s ? G(s).enabled : F(!1), a = F(!1), u = F(null), c = F(""), { craftNode: f } = xt(), p = b(() => !!s && i.value), v = b(() => p.value && !a.value), h = () => {
323
+ v.value && g();
313
324
  }, g = () => {
314
- s.value = !1, n("update:content", i.value);
325
+ c.value = r.content, a.value = !0, s?.disableDragging(), ne(() => {
326
+ u.value && (u.value.focus(), C());
327
+ });
328
+ }, C = () => {
329
+ u.value && (u.value.style.height = "auto", u.value.style.height = `${u.value.scrollHeight}px`);
330
+ }, T = async () => {
331
+ if (s?.enableDragging(), !a.value) return;
332
+ a.value = !1;
333
+ const A = u.value?.value.trim() ?? "";
334
+ A !== r.content && f.value?.uuid && (s?.nodeMap.set(f.value.uuid, {
335
+ ...f.value,
336
+ props: {
337
+ ...f.value.props,
338
+ content: A
339
+ }
340
+ }), await ne(), n("update:content", A));
341
+ }, N = () => {
342
+ a.value = !1, n("update:content", c.value);
315
343
  };
316
- return le(c, (D) => {
317
- !D && s.value && g();
318
- }), (D, F) => (v(), N(me(t.componentName), {
319
- class: oe({ "pre-wrap": !s.value, "editable-text": f(c), "is-editable": f(c), "is-editing": s.value }),
344
+ return s && te(i, (A) => {
345
+ !A && a.value && N();
346
+ }), (A, E) => (m(), x(ce(t.componentName), {
347
+ class: se({
348
+ "pre-wrap": !a.value,
349
+ "editable-text": p.value,
350
+ "is-editable": p.value,
351
+ "is-editing": a.value
352
+ }),
320
353
  onDblclick: h
321
354
  }, {
322
- default: X(() => [
323
- at(ne(s.value ? "" : t.content) + " ", 1),
324
- s.value ? (v(), E("textarea", {
355
+ default: H(() => [
356
+ vt(ee(a.value ? "" : t.content) + " ", 1),
357
+ a.value ? (m(), y("textarea", {
325
358
  key: 0,
326
359
  ref_key: "textareaRef",
327
- ref: o,
360
+ ref: u,
328
361
  class: "editable-text__textarea",
329
362
  value: t.content,
330
- onInput: p,
331
- onBlur: b,
363
+ onInput: C,
364
+ onBlur: T,
332
365
  onKeyup: [
333
- Pe(V(b, ["exact"]), ["enter"]),
334
- Pe(g, ["esc"])
366
+ Me(j(T, ["exact"]), ["enter"]),
367
+ Me(N, ["esc"])
335
368
  ]
336
- }, null, 40, bt)) : x("", !0)
369
+ }, null, 40, Dt)) : k("", !0)
337
370
  ]),
338
371
  _: 1
339
372
  }, 40, ["class"]));
340
373
  }
341
374
  });
342
- class ye {
375
+ class be {
343
376
  resolverMap = {};
377
+ resolveComponentHook;
344
378
  constructor(e = {}) {
345
- return this.setResolverMap(e), Ue(this);
379
+ return this.setResolverMap(e), Fe(this);
346
380
  }
347
381
  setResolverMap(e) {
348
382
  this.resolverMap = {}, Object.entries(e).forEach(([r, n]) => {
349
383
  this.resolverMap[n.componentName] = n;
350
384
  });
351
385
  }
386
+ onResolveComponent(e) {
387
+ this.resolveComponentHook = e;
388
+ }
352
389
  resolve(e) {
353
390
  return this.resolverMap[e];
354
391
  }
392
+ resolveComponent(e) {
393
+ const r = K(e) ? e.props.componentName : e.componentName, n = (o) => {
394
+ const s = this.resolve(o);
395
+ if (s?.component)
396
+ return typeof s.component == "function" && !("setup" in s.component) && !("render" in s.component), s.component;
397
+ };
398
+ if (this.resolveComponentHook) {
399
+ const o = this.resolveComponentHook(e, n);
400
+ if (o)
401
+ return o;
402
+ }
403
+ return n(r);
404
+ }
355
405
  getDefaultProps(e) {
356
406
  return this.resolveNode(e)?.defaultProps || {};
357
407
  }
358
408
  resolveNode(e) {
359
- return q(e) ? this.resolve(e.props.componentName) : this.resolve(e.componentName);
409
+ return K(e) ? this.resolve(e.props.componentName) : this.resolve(e.componentName);
360
410
  }
361
411
  getSchema(e) {
362
412
  return this.resolveNode(e)?.propsSchema || {};
@@ -368,63 +418,7 @@ class ye {
368
418
  return this.resolveNode(e)?.rules || {};
369
419
  }
370
420
  }
371
- const Ct = /* @__PURE__ */ $({
372
- __name: "CraftEditor",
373
- props: {
374
- config: {},
375
- useIframe: { type: Boolean, default: !1 },
376
- iFrameStyleSheets: { default: () => [] },
377
- iFrameClass: { type: [Boolean, null, String, Object, Array], default: "" },
378
- inheritStyles: { type: Boolean, default: !1 }
379
- },
380
- emits: ["nodeDragStart", "nodeDragEnd", "iframeLoad"],
381
- setup(t, { emit: e }) {
382
- const r = t, n = e, s = j(), { getDraggedNode: o } = Z(s);
383
- le(o, (a) => {
384
- if (a) {
385
- n("nodeDragStart", a);
386
- return;
387
- }
388
- n("nodeDragEnd");
389
- });
390
- const i = K(new ye(r.config.resolverMap));
391
- return re("resolver", i), (a, c) => {
392
- const u = B("CraftFrame"), d = B("CraftEditorPanelLayout");
393
- return v(), N(d, {
394
- blueprints: t.config.blueprintsLibrary
395
- }, ge({ _: 2 }, [
396
- a.$slots["panel-layout"] ? {
397
- name: "panel-layout",
398
- fn: X(({ blueprints: h, deselectNodes: m }) => [
399
- W(a.$slots, "panel-layout", {
400
- blueprints: h,
401
- deselectNodes: m
402
- })
403
- ]),
404
- key: "0"
405
- } : {
406
- name: "default",
407
- fn: X(() => [
408
- G(u, {
409
- useIframe: t.useIframe,
410
- inheritStyles: t.inheritStyles,
411
- iFrameStyleSheets: t.iFrameStyleSheets,
412
- iFrameClass: t.iFrameClass,
413
- resolverMap: t.config.resolverMap,
414
- onIframeLoad: c[0] || (c[0] = (h) => n("iframeLoad", h))
415
- }, {
416
- default: X(() => [
417
- W(a.$slots, "default")
418
- ]),
419
- _: 3
420
- }, 8, ["useIframe", "inheritStyles", "iFrameStyleSheets", "iFrameClass", "resolverMap"])
421
- ]),
422
- key: "1"
423
- }
424
- ]), 1032, ["blueprints"]);
425
- };
426
- }
427
- }), Se = He("indicator", {
421
+ const De = Ve("indicator", {
428
422
  state: () => ({
429
423
  barSize: 2,
430
424
  visible: !1,
@@ -455,18 +449,18 @@ const Ct = /* @__PURE__ */ $({
455
449
  },
456
450
  pointAfter(t) {
457
451
  this.show();
458
- const { top: e, left: r, width: n, height: s } = t.getBoundingClientRect();
459
- this.coordinates.top = e, this.coordinates.left = r + n, this.dimensions.width = this.barSize, this.dimensions.height = s;
452
+ const { top: e, left: r, width: n, height: o } = t.getBoundingClientRect();
453
+ this.coordinates.top = e, this.coordinates.left = r + n, this.dimensions.width = this.barSize, this.dimensions.height = o;
460
454
  },
461
455
  pointInside(t) {
462
456
  this.show();
463
- const e = De(t), { top: r, left: n, width: s, height: o } = t.getBoundingClientRect(), i = Number.parseInt(e.paddingLeft), a = Number.parseInt(e.paddingTop), c = Number.parseInt(e.paddingRight);
464
- this.coordinates.top = r + o - a, this.coordinates.left = n + i, this.dimensions.width = s - i - c, this.dimensions.height = this.barSize;
457
+ const e = $e(t), { top: r, left: n, width: o, height: s } = t.getBoundingClientRect(), i = Number.parseInt(e.paddingLeft), a = Number.parseInt(e.paddingTop), u = Number.parseInt(e.paddingRight);
458
+ this.coordinates.top = r + s - a, this.coordinates.left = n + i, this.dimensions.width = o - i - u, this.dimensions.height = this.barSize;
465
459
  },
466
460
  pointInsideTop(t) {
467
461
  this.show();
468
- const e = De(t), { top: r, left: n, width: s } = t.getBoundingClientRect(), o = Number.parseInt(e.paddingLeft), i = Number.parseInt(e.paddingTop), a = Number.parseInt(e.paddingRight);
469
- this.coordinates.top = r + i, this.coordinates.left = n + o, this.dimensions.width = s - o - a, this.dimensions.height = this.barSize;
462
+ const e = $e(t), { top: r, left: n, width: o } = t.getBoundingClientRect(), s = Number.parseInt(e.paddingLeft), i = Number.parseInt(e.paddingTop), a = Number.parseInt(e.paddingRight);
463
+ this.coordinates.top = r + i, this.coordinates.left = n + s, this.dimensions.width = o - s - a, this.dimensions.height = this.barSize;
470
464
  }
471
465
  },
472
466
  getters: {
@@ -476,73 +470,139 @@ const Ct = /* @__PURE__ */ $({
476
470
  size: (t) => t.dimensions
477
471
  }
478
472
  });
479
- function De(t) {
480
- const { paddingTop: e, paddingLeft: r, paddingRight: n, paddingBottom: s } = getComputedStyle(t), o = {
473
+ function $e(t) {
474
+ if (!(t instanceof HTMLElement))
475
+ return {
476
+ paddingTop: "0",
477
+ paddingLeft: "0",
478
+ paddingRight: "0",
479
+ paddingBottom: "0"
480
+ };
481
+ const { paddingTop: e, paddingLeft: r, paddingRight: n, paddingBottom: o } = getComputedStyle(t), s = {
481
482
  paddingTop: e,
482
483
  paddingLeft: r,
483
484
  paddingRight: n,
484
- paddingBottom: s
485
+ paddingBottom: o
485
486
  };
486
- return Object.keys(o).forEach((i) => {
487
- o[i] = parseInt(o[i].slice(0, -2), 10);
488
- }), o;
487
+ return Object.keys(s).forEach((i) => {
488
+ s[i] = parseInt(s[i].slice(0, -2), 10);
489
+ }), s;
489
490
  }
490
- const wt = /* @__PURE__ */ $({
491
+ const Pt = /* @__PURE__ */ I({
492
+ __name: "CraftEditor",
493
+ props: {
494
+ config: {},
495
+ iframe: {}
496
+ },
497
+ emits: ["nodeDragStart", "nodeDragEnd", "iframeLoad"],
498
+ setup(t, { emit: e }) {
499
+ const r = t, n = e, o = L(), s = De(), { getDraggedNode: i } = G(o);
500
+ te(i, (u) => {
501
+ if (u) {
502
+ n("nodeDragStart", u);
503
+ return;
504
+ }
505
+ n("nodeDragEnd"), s.hide();
506
+ });
507
+ const a = F(
508
+ r.config.resolver || new be(r.config.resolverMap)
509
+ );
510
+ return q("resolver", a), (u, c) => {
511
+ const f = U("CraftFrame"), p = U("CraftEditorPanelLayout");
512
+ return m(), x(p, {
513
+ blueprints: t.config.blueprintsLibrary
514
+ }, de({ _: 2 }, [
515
+ u.$slots["panel-layout"] ? {
516
+ name: "panel-layout",
517
+ fn: H(({ blueprints: v, deselectNodes: h }) => [
518
+ Y(u.$slots, "panel-layout", {
519
+ blueprints: v,
520
+ deselectNodes: h
521
+ })
522
+ ]),
523
+ key: "0"
524
+ } : {
525
+ name: "default",
526
+ fn: H(() => [
527
+ W(f, {
528
+ iframe: t.iframe,
529
+ resolverMap: t.config.resolverMap,
530
+ onIframeLoad: c[0] || (c[0] = (v) => n("iframeLoad", v))
531
+ }, {
532
+ default: H(() => [
533
+ Y(u.$slots, "default")
534
+ ]),
535
+ _: 3
536
+ }, 8, ["iframe", "resolverMap"])
537
+ ]),
538
+ key: "1"
539
+ }
540
+ ]), 1032, ["blueprints"]);
541
+ };
542
+ }
543
+ }), Mt = /* @__PURE__ */ I({
491
544
  name: "CraftEditorBlueprint",
492
545
  __name: "CraftEditorBlueprint",
493
546
  props: {
494
547
  craftNode: {}
495
548
  },
496
549
  setup(t) {
497
- const e = j(), r = Se(), n = t, s = (i) => {
498
- console.log("CraftEditorBlueprint - dragging node:", n.craftNode), console.log("CraftEditorBlueprint - node.componentName:", n.craftNode.componentName), console.log("CraftEditorBlueprint - node.props:", n.craftNode.props), e.dragNode(n.craftNode);
499
- }, o = (i) => {
500
- i.stopPropagation(), e.dragNode(null), r.hide();
550
+ const e = L(), r = t, n = (s) => {
551
+ console.log("CraftEditorBlueprint - dragging node:", r.craftNode), console.log("CraftEditorBlueprint - node.componentName:", r.craftNode.componentName), console.log("CraftEditorBlueprint - node.props:", r.craftNode.props), e.dragNode(r.craftNode);
552
+ }, o = (s) => {
553
+ s.stopPropagation(), e.dragNode(null);
501
554
  };
502
- return (i, a) => (v(), E("div", {
555
+ return (s, i) => (m(), y("div", {
503
556
  draggable: !0,
504
- onDragstart: V(s, ["stop"]),
557
+ onDragstart: j(n, ["stop"]),
505
558
  onDragend: o
506
559
  }, [
507
- W(i.$slots, "default")
560
+ Y(s.$slots, "default")
508
561
  ], 32));
509
562
  }
510
- }), Ye = (t, e) => Object.keys(t.blueprints).map((r) => {
511
- const n = t.blueprints[r], s = e.getDefaultProps({
563
+ }), Ge = (t, e) => Object.keys(t.blueprints).map((r) => {
564
+ const n = t.blueprints[r], o = e.getDefaultProps({
512
565
  ...n,
513
- uuid: de()
566
+ uuid: le()
514
567
  });
515
568
  return {
516
569
  ...n,
517
- props: { ...s, ...n.props }
570
+ props: { ...o, ...n.props }
518
571
  };
519
- }), _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
572
+ }), Ze = (t) => {
573
+ let e = 0;
574
+ for (let s = 0; s < t.length; s++)
575
+ e = t.charCodeAt(s) + ((e << 5) - e);
576
+ const r = e % 360, n = 70 + e % 30, o = 45 + e % 30;
577
+ return `hsla(${r}, ${n}%, ${o}%, 0.9)`;
578
+ }, $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
520
579
  __proto__: null,
521
- blueprintsWithDefaults: Ye
522
- }, Symbol.toStringTag, { value: "Module" })), Ot = { key: 0 }, Nt = { class: "flex flex-wrap gap-2 p-1" }, xt = { class: "v-craft-blueprint" }, St = { class: "v-craft-blueprint-label" }, At = /* @__PURE__ */ $({
580
+ blueprintsWithDefaults: Ge,
581
+ generateColorFromUUID: Ze
582
+ }, Symbol.toStringTag, { value: "Module" })), Rt = { key: 0 }, It = { class: "flex flex-wrap gap-2 p-1" }, Tt = { class: "v-craft-blueprint" }, Ut = { class: "v-craft-blueprint-label" }, Bt = /* @__PURE__ */ I({
523
583
  __name: "CraftEditorBlueprintsList",
524
584
  props: {
525
585
  blueprints: {}
526
586
  },
527
587
  setup(t) {
528
- const e = ae("resolver");
588
+ const e = ue("resolver");
529
589
  return (r, n) => {
530
- const s = B("CraftEditorBlueprint");
531
- return f(e) ? (v(), E("div", Ot, [
532
- (v(!0), E(T, null, M(t.blueprints.groups, (o) => (v(), E("div", null, [
533
- W(r.$slots, "blueprint-group", {
534
- group: o,
535
- resolver: f(e)
590
+ const o = U("CraftEditorBlueprint");
591
+ return d(e) ? (m(), y("div", Rt, [
592
+ (m(!0), y(R, null, $(t.blueprints.groups, (s) => (m(), y("div", null, [
593
+ Y(r.$slots, "blueprint-group", {
594
+ group: s,
595
+ resolver: d(e)
536
596
  }, () => [
537
- O("h4", null, ne(o.label), 1),
538
- O("div", Nt, [
539
- (v(!0), E(T, null, M(f(Ye)(o, f(e)), (i, a) => (v(), N(s, {
597
+ S("h4", null, ee(s.label), 1),
598
+ S("div", It, [
599
+ (m(!0), y(R, null, $(d(Ge)(s, d(e)), (i, a) => (m(), x(o, {
540
600
  craftNode: i,
541
601
  key: a
542
602
  }, {
543
- default: X(() => [
544
- O("div", xt, [
545
- O("div", St, ne(i.label), 1)
603
+ default: H(() => [
604
+ S("div", Tt, [
605
+ S("div", Ut, ee(i.label), 1)
546
606
  ])
547
607
  ]),
548
608
  _: 2
@@ -550,10 +610,10 @@ const wt = /* @__PURE__ */ $({
550
610
  ])
551
611
  ])
552
612
  ]))), 256))
553
- ])) : x("", !0);
613
+ ])) : k("", !0);
554
614
  };
555
615
  }
556
- }), Pt = { class: "v-craft-panel v-craft-blueprints-panel" }, Dt = { class: "v-craft-panel-content" }, kt = /* @__PURE__ */ $({
616
+ }), Lt = { class: "v-craft-panel v-craft-blueprints-panel" }, jt = { class: "v-craft-panel-content" }, Ft = /* @__PURE__ */ I({
557
617
  name: "CraftEditorPanelBlueprints",
558
618
  __name: "CraftEditorPanelBlueprints",
559
619
  props: {
@@ -562,21 +622,21 @@ const wt = /* @__PURE__ */ $({
562
622
  emits: ["close"],
563
623
  setup(t) {
564
624
  return (e, r) => {
565
- const n = B("CraftEditorBlueprintsList");
566
- return v(), E("div", Pt, [
567
- r[0] || (r[0] = O("h3", { class: "v-craft-title" }, "blueprints", -1)),
568
- O("div", Dt, [
569
- G(n, { blueprints: t.blueprints }, null, 8, ["blueprints"])
625
+ const n = U("CraftEditorBlueprintsList");
626
+ return m(), y("div", Lt, [
627
+ r[0] || (r[0] = S("h3", { class: "v-craft-title" }, "blueprints", -1)),
628
+ S("div", jt, [
629
+ W(n, { blueprints: t.blueprints }, null, 8, ["blueprints"])
570
630
  ])
571
631
  ]);
572
632
  };
573
633
  }
574
- }), be = (t, e) => {
634
+ }), Ee = (t, e) => {
575
635
  const r = t.__vccOpts || t;
576
- for (const [n, s] of e)
577
- r[n] = s;
636
+ for (const [n, o] of e)
637
+ r[n] = o;
578
638
  return r;
579
- }, $t = /* @__PURE__ */ be(kt, [["__scopeId", "data-v-a6de4dca"]]), Rt = /* @__PURE__ */ $({
639
+ }, Ht = /* @__PURE__ */ Ee(Ft, [["__scopeId", "data-v-a6de4dca"]]), Vt = /* @__PURE__ */ I({
580
640
  __name: "CraftEditorPanelForm",
581
641
  props: {
582
642
  craftNode: {},
@@ -585,35 +645,35 @@ const wt = /* @__PURE__ */ $({
585
645
  },
586
646
  emits: ["update"],
587
647
  setup(t, { emit: e }) {
588
- const r = t, n = e, s = ce(r, "model"), o = ce(r, "schema"), i = ce(r, "craftNode"), a = w(
589
- () => s.value ? { ...s.value } : {}
590
- ), c = Ve((d) => {
591
- n("update", d);
592
- }, 50), u = (d) => {
593
- d != null && c(d);
648
+ const r = t, n = e, o = ve(r, "model"), s = ve(r, "schema"), i = ve(r, "craftNode"), a = b(
649
+ () => o.value ? { ...o.value } : {}
650
+ ), u = Ke((f) => {
651
+ n("update", f);
652
+ }, 50), c = (f) => {
653
+ f != null && u(f);
594
654
  };
595
- return Le(() => c.cancel()), (d, h) => W(d.$slots, "panel-content", {
655
+ return mt(() => u.cancel()), (f, p) => Y(f.$slots, "panel-content", {
596
656
  craftNode: i.value,
597
657
  model: a.value,
598
- handleFormInput: u,
599
- schema: o.value
658
+ handleFormInput: c,
659
+ schema: s.value
600
660
  });
601
661
  }
602
- }), It = { class: "v-craft-panel v-craft-layers-panel" }, Mt = { class: "v-craft-layers" }, Tt = { class: "v-craft-node-layers" }, Bt = /* @__PURE__ */ $({
662
+ }), Kt = { class: "v-craft-panel v-craft-layers-panel" }, Xt = { class: "v-craft-layers" }, zt = { class: "v-craft-node-layers" }, qt = /* @__PURE__ */ I({
603
663
  name: "CraftEditorPanelLayers",
604
664
  __name: "CraftEditorPanelLayers",
605
665
  setup(t) {
606
- const e = j(), { nodeTree: r } = Z(e), n = (s) => {
607
- e.selectNode(s);
666
+ const e = L(), { nodeTree: r } = G(e), n = (o) => {
667
+ e.selectNode(o);
608
668
  };
609
- return (s, o) => {
610
- const i = B("CraftEditorPanelNodeLayer");
611
- return v(), E("div", It, [
612
- o[0] || (o[0] = O("h3", { class: "v-craft-title" }, "tree", -1)),
613
- O("div", Mt, [
614
- O("ul", Tt, [
615
- (v(!0), E(T, null, M(f(r), (a, c) => (v(), N(i, {
616
- key: c,
669
+ return (o, s) => {
670
+ const i = U("CraftEditorPanelNodeLayer");
671
+ return m(), y("div", Kt, [
672
+ s[0] || (s[0] = S("h3", { class: "v-craft-title" }, "tree", -1)),
673
+ S("div", Xt, [
674
+ S("ul", zt, [
675
+ (m(!0), y(R, null, $(d(r), (a, u) => (m(), x(i, {
676
+ key: u,
617
677
  craftNode: a,
618
678
  onLayerClick: n
619
679
  }, null, 8, ["craftNode"]))), 128))
@@ -622,91 +682,89 @@ const wt = /* @__PURE__ */ $({
622
682
  ]);
623
683
  };
624
684
  }
625
- }), Ut = /* @__PURE__ */ be(Bt, [["__scopeId", "data-v-e2502bab"]]), Lt = { key: 0 }, jt = {
685
+ }), Yt = /* @__PURE__ */ Ee(qt, [["__scopeId", "data-v-ab795ec3"]]), Qt = { key: 0 }, Wt = {
626
686
  key: 1,
627
687
  class: "v-craft-panel-manager"
628
- }, Ft = { class: "flex w-full justify-between gap-10" }, Ht = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, Vt = { class: "v-craft-grid-panel v-craft-panel-right shrink" }, Kt = /* @__PURE__ */ $({
688
+ }, Gt = { class: "flex w-full justify-between gap-10" }, Zt = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, Jt = { class: "v-craft-grid-panel v-craft-panel-right shrink" }, er = /* @__PURE__ */ I({
629
689
  __name: "CraftEditorPanelLayout",
630
690
  props: {
631
691
  blueprints: {}
632
692
  },
633
693
  setup(t) {
634
- const e = j(), r = () => {
694
+ const e = L(), r = () => {
635
695
  e.selectNode(null);
636
696
  };
637
- return (n, s) => {
638
- const o = B("CraftEditorPanelBlueprints"), i = B("CraftEditorPanelLayers"), a = B("CraftEditorPanelSettings");
639
- return n.$slots["panel-layout"] ? (v(), E("div", Lt, [
640
- W(n.$slots, "panel-layout", {
697
+ return (n, o) => {
698
+ const s = U("CraftEditorPanelBlueprints"), i = U("CraftEditorPanelLayers"), a = U("CraftEditorPanelSettings");
699
+ return n.$slots["panel-layout"] ? (m(), y("div", Qt, [
700
+ Y(n.$slots, "panel-layout", {
641
701
  blueprints: t.blueprints,
642
702
  deselectNodes: r
643
703
  }, void 0, !0)
644
- ])) : (v(), E("div", jt, [
645
- O("div", Ft, [
646
- O("div", Ht, [
647
- G(o, { blueprints: t.blueprints }, null, 8, ["blueprints"])
704
+ ])) : (m(), y("div", Wt, [
705
+ S("div", Gt, [
706
+ S("div", Zt, [
707
+ W(s, { blueprints: t.blueprints }, null, 8, ["blueprints"])
648
708
  ]),
649
- O("div", {
709
+ S("div", {
650
710
  class: "v-craft-panel-center flex grow",
651
- onClick: V(r, ["stop"])
711
+ onClick: j(r, ["stop"])
652
712
  }, [
653
- W(n.$slots, "default", {}, void 0, !0)
713
+ Y(n.$slots, "default", {}, void 0, !0)
654
714
  ]),
655
- O("div", Vt, [
656
- G(i),
657
- G(a)
715
+ S("div", Jt, [
716
+ W(i),
717
+ W(a)
658
718
  ])
659
719
  ])
660
720
  ]));
661
721
  };
662
722
  }
663
- }), Xt = /* @__PURE__ */ be(Kt, [["__scopeId", "data-v-d60526f7"]]), zt = {
723
+ }), tr = /* @__PURE__ */ Ee(er, [["__scopeId", "data-v-81a2200d"]]), rr = {
664
724
  key: 0,
665
725
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
666
- }, qt = /* @__PURE__ */ $({
726
+ }, nr = /* @__PURE__ */ I({
667
727
  __name: "CraftEditorPanelNodeEventsSettings",
668
728
  props: {
669
729
  craftNode: {},
670
- schema: { default: () => ({}) }
730
+ schema: { default: () => [] }
671
731
  },
672
732
  emits: ["update:events"],
673
733
  setup(t, { emit: e }) {
674
- const r = t, { craftNode: n, schema: s } = fe(r), o = e;
734
+ const r = t, { craftNode: n, schema: o } = ie(r), s = e;
675
735
  return (i, a) => {
676
- const c = B("CraftEditorPanelForm");
677
- return v(), N(c, {
678
- craftNode: f(n),
679
- schema: f(s),
680
- model: f(n)?.events,
681
- onUpdate: a[0] || (a[0] = (u) => o("update:events", u))
736
+ const u = U("CraftEditorPanelForm");
737
+ return m(), x(u, {
738
+ craftNode: d(n),
739
+ schema: d(o),
740
+ model: d(n)?.events,
741
+ onUpdate: a[0] || (a[0] = (c) => s("update:events", c))
682
742
  }, {
683
- "panel-content": X(({ craftNode: u, model: d, handleFormInput: h, schema: m }) => [
684
- m ? (v(), E("fieldset", zt, [
685
- a[1] || (a[1] = O("legend", { class: "formkit-legend" }, "Events", -1)),
686
- (v(), N(f(Ke), {
687
- key: u?.uuid,
743
+ "panel-content": H(({ craftNode: c, model: f, handleFormInput: p, schema: v }) => [
744
+ v ? (m(), y("fieldset", rr, [
745
+ a[1] || (a[1] = S("legend", { class: "formkit-legend" }, "Events", -1)),
746
+ (m(), x(d(Xe), {
747
+ key: c?.uuid,
688
748
  type: "form",
689
- value: d,
690
- onInput: h,
749
+ value: f,
750
+ onInput: p,
691
751
  actions: !1
692
752
  }, {
693
- default: X(() => [
694
- G(f(Xe), {
695
- schema: m
696
- }, null, 8, ["schema"])
753
+ default: H(() => [
754
+ W(d(ze), { schema: v }, null, 8, ["schema"])
697
755
  ]),
698
756
  _: 2
699
757
  }, 1032, ["value", "onInput"]))
700
- ])) : x("", !0)
758
+ ])) : k("", !0)
701
759
  ]),
702
760
  _: 1
703
761
  }, 8, ["craftNode", "schema", "model"]);
704
762
  };
705
763
  }
706
- }), Wt = { class: "v-craft-component-layer-face" }, Yt = { class: "v-craft-component-name" }, Qt = {
764
+ }), or = { class: "v-craft-component-layer-face" }, sr = { class: "v-craft-component-name" }, ir = {
707
765
  key: 0,
708
766
  class: "v-craft-node-layers nested-layers"
709
- }, Gt = /* @__PURE__ */ $({
767
+ }, ar = /* @__PURE__ */ I({
710
768
  __name: "CraftEditorPanelNodeLayer",
711
769
  props: {
712
770
  craftNode: {},
@@ -714,46 +772,46 @@ const wt = /* @__PURE__ */ $({
714
772
  },
715
773
  emits: ["layer-click"],
716
774
  setup(t, { emit: e }) {
717
- const r = t, { craftNode: n, visible: s } = fe(r), o = w(
718
- () => s.value && n.value.visible === void 0 || n.value.visible
719
- ), i = e, a = j(), { selectedNode: c } = Z(a), u = w(() => te(n.value)), d = w(
720
- () => c?.value?.uuid === n.value.uuid
721
- ), h = () => {
775
+ const r = t, { craftNode: n, visible: o } = ie(r), s = b(
776
+ () => o.value && n.value.visible === void 0 || n.value.visible
777
+ ), i = e, a = L(), { selectedNode: u } = G(a), c = b(() => J(n.value)), f = b(
778
+ () => u?.value?.uuid === n.value.uuid
779
+ ), p = () => {
722
780
  a.toggleNodeVisibility(n.value);
723
781
  };
724
- return (m, p) => {
725
- const b = B("CraftEditorPanelNodeLayer", !0);
726
- return v(), E("li", {
727
- class: oe(["v-craft-node-layer", {
728
- "v-craft-node-layer-selected": d.value
782
+ return (v, h) => {
783
+ const g = U("CraftEditorPanelNodeLayer", !0);
784
+ return m(), y("li", {
785
+ class: se(["v-craft-node-layer", {
786
+ "v-craft-node-layer-selected": f.value
729
787
  }]),
730
- onClick: p[1] || (p[1] = V((g) => i("layer-click", f(n)), ["prevent", "stop"]))
788
+ onClick: h[1] || (h[1] = j((C) => i("layer-click", d(n)), ["prevent", "stop"]))
731
789
  }, [
732
- O("div", Wt, [
733
- O("div", Yt, ne(u.value), 1),
734
- O("button", {
790
+ S("div", or, [
791
+ S("div", sr, ee(c.value), 1),
792
+ S("button", {
735
793
  type: "button",
736
794
  class: "v-craft-component-icon",
737
- onClick: V(h, ["prevent", "stop"])
738
- }, ne(o.value ? "hide" : "show"), 1)
795
+ onClick: j(p, ["prevent", "stop"])
796
+ }, ee(s.value ? "hide" : "show"), 1)
739
797
  ]),
740
- f(n).slots && Object.keys(f(n).slots).length > 0 ? (v(), E("ul", Qt, [
741
- (v(!0), E(T, null, M(f(n).slots, (g, D) => (v(), E(T, { key: D }, [
742
- (v(!0), E(T, null, M(g, (F, A) => (v(), N(b, {
743
- key: `${D}-${A}`,
744
- craftNode: F,
745
- onLayerClick: p[0] || (p[0] = (z) => i("layer-click", z)),
746
- visible: o.value
798
+ d(n).slots && Object.keys(d(n).slots).length > 0 ? (m(), y("ul", ir, [
799
+ (m(!0), y(R, null, $(d(n).slots, (C, T) => (m(), y(R, { key: T }, [
800
+ (m(!0), y(R, null, $(C, (N, A) => (m(), x(g, {
801
+ key: `${T}-${A}`,
802
+ craftNode: N,
803
+ onLayerClick: h[0] || (h[0] = (E) => i("layer-click", E)),
804
+ visible: s.value
747
805
  }, null, 8, ["craftNode", "visible"]))), 128))
748
806
  ], 64))), 128))
749
- ])) : x("", !0)
807
+ ])) : k("", !0)
750
808
  ], 2);
751
809
  };
752
810
  }
753
- }), Zt = /* @__PURE__ */ be(Gt, [["__scopeId", "data-v-0b94201d"]]), Jt = {
811
+ }), lr = /* @__PURE__ */ Ee(ar, [["__scopeId", "data-v-208a4e02"]]), ur = {
754
812
  key: 0,
755
813
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
756
- }, er = /* @__PURE__ */ $({
814
+ }, cr = /* @__PURE__ */ I({
757
815
  __name: "CraftEditorPanelNodeSettings",
758
816
  props: {
759
817
  craftNode: {},
@@ -761,132 +819,130 @@ const wt = /* @__PURE__ */ $({
761
819
  },
762
820
  emits: ["update:props"],
763
821
  setup(t, { emit: e }) {
764
- const r = t, { craftNode: n, schema: s } = fe(r), o = e;
822
+ const r = t, { craftNode: n, schema: o } = ie(r), s = e;
765
823
  return (i, a) => {
766
- const c = B("CraftEditorPanelForm");
767
- return v(), N(c, {
768
- craftNode: f(n),
769
- schema: f(s),
770
- model: f(n)?.props,
771
- onUpdate: a[0] || (a[0] = (u) => o("update:props", u))
824
+ const u = U("CraftEditorPanelForm");
825
+ return m(), x(u, {
826
+ craftNode: d(n),
827
+ schema: d(o),
828
+ model: d(n)?.props,
829
+ onUpdate: a[0] || (a[0] = (c) => s("update:props", c))
772
830
  }, {
773
- "panel-content": X(({ craftNode: u, model: d, handleFormInput: h, schema: m }) => [
774
- m ? (v(), E("fieldset", Jt, [
775
- a[1] || (a[1] = O("legend", { class: "formkit-legend" }, "Properties", -1)),
776
- (v(), N(f(Ke), {
777
- key: u?.uuid,
831
+ "panel-content": H(({ craftNode: c, model: f, handleFormInput: p, schema: v }) => [
832
+ v ? (m(), y("fieldset", ur, [
833
+ a[1] || (a[1] = S("legend", { class: "formkit-legend" }, "Properties", -1)),
834
+ (m(), x(d(Xe), {
835
+ key: c?.uuid,
778
836
  type: "form",
779
- value: d,
780
- onInput: h,
837
+ value: f,
838
+ onInput: p,
781
839
  actions: !1
782
840
  }, {
783
- default: X(() => [
784
- G(f(Xe), {
785
- schema: m
786
- }, null, 8, ["schema"])
841
+ default: H(() => [
842
+ W(d(ze), { schema: v }, null, 8, ["schema"])
787
843
  ]),
788
844
  _: 2
789
845
  }, 1032, ["value", "onInput"]))
790
- ])) : x("", !0)
846
+ ])) : k("", !0)
791
847
  ]),
792
848
  _: 1
793
849
  }, 8, ["craftNode", "schema", "model"]);
794
850
  };
795
851
  }
796
- }), tr = { class: "text-sm" }, rr = { key: 0 }, nr = {
852
+ }), dr = { class: "text-sm" }, fr = { key: 0 }, hr = {
797
853
  key: 0,
798
854
  class: "v-craft-settings"
799
- }, sr = {
855
+ }, pr = {
800
856
  key: 1,
801
857
  class: "v-craft-settings"
802
- }, or = {
858
+ }, vr = {
803
859
  class: "v-craft-actions",
804
860
  "data-type": "button"
805
- }, ir = /* @__PURE__ */ $({
861
+ }, mr = /* @__PURE__ */ I({
806
862
  __name: "CraftEditorPanelSettings",
807
863
  setup(t) {
808
- const e = j(), { selectedNode: r } = Z(e), n = ae("resolver"), s = w(() => !r.value || !n?.value ? [] : n.value.getSchema(r.value)), o = w(() => !r.value || !n?.value ? [] : n.value.getEventsSchema(r.value)), i = w(
864
+ const e = L(), { selectedNode: r } = G(e), n = ue("resolver"), o = b(() => !r.value || !n?.value ? [] : n.value.getSchema(r.value)), s = b(() => !r.value || !n?.value ? [] : n.value.getEventsSchema(r.value)), i = b(
809
865
  () => r.value && r.value.parentUuid
810
866
  ), a = () => {
811
867
  r.value && e.removeNode(r.value);
812
- }, c = w(
868
+ }, u = b(
813
869
  () => r.value ? `${n?.value?.resolveNode(r.value)?.componentName || "Unknown"}` : ""
814
- ), u = (h) => {
815
- r.value && h && e.updateNodeProps(r.value.uuid, h);
816
- }, d = (h) => {
817
- r.value && h && e.updateNodeEvents(r.value.uuid, h);
870
+ ), c = (p) => {
871
+ r.value && p && e.updateNodeProps(r.value.uuid, p);
872
+ }, f = (p) => {
873
+ r.value && p && e.updateNodeEvents(r.value.uuid, p);
818
874
  };
819
- return (h, m) => {
820
- const p = B("CraftEditorPanelNodeSettings"), b = B("CraftEditorPanelNodeEventsSettings");
821
- return W(h.$slots, "panel-content", {
822
- selectedNode: f(r),
823
- nodeName: c.value,
824
- handlePropsUpdate: u,
825
- schema: s.value,
826
- eventsSchema: o.value,
827
- handleEventsUpdate: d,
875
+ return (p, v) => {
876
+ const h = U("CraftEditorPanelNodeSettings"), g = U("CraftEditorPanelNodeEventsSettings");
877
+ return Y(p.$slots, "panel-content", {
878
+ selectedNode: d(r),
879
+ nodeName: u.value,
880
+ handlePropsUpdate: c,
881
+ schema: o.value,
882
+ eventsSchema: s.value,
883
+ handleEventsUpdate: f,
828
884
  deleteable: i.value,
829
885
  removeNode: a
830
886
  }, () => [
831
- O("div", {
887
+ S("div", {
832
888
  ref: "panel",
833
889
  class: "v-craft-panel v-craft-settings-panel",
834
- onClick: V(() => !1, ["prevent", "stop"])
890
+ onClick: j(() => !1, ["prevent", "stop"])
835
891
  }, [
836
- m[1] || (m[1] = O("h3", { class: "v-craft-title" }, "component inspector", -1)),
837
- O("span", tr, ne(f(r)?.uuid), 1),
838
- f(r) ? x("", !0) : (v(), E("div", rr, [...m[0] || (m[0] = [
839
- O("p", null, "select a component to inspect", -1)
892
+ v[1] || (v[1] = S("h3", { class: "v-craft-title" }, "component inspector", -1)),
893
+ S("span", dr, ee(d(r)?.uuid), 1),
894
+ d(r) ? k("", !0) : (m(), y("div", fr, [...v[0] || (v[0] = [
895
+ S("p", null, "select a component to inspect", -1)
840
896
  ])])),
841
- O("div", {
842
- class: oe(["v-craft-properties", { "v-craft-visible": f(r) }])
897
+ S("div", {
898
+ class: se(["v-craft-properties", { "v-craft-visible": d(r) }])
843
899
  }, [
844
- O("h4", null, ne(c.value), 1),
845
- s.value ? (v(), E("div", nr, [
846
- G(p, {
847
- craftNode: f(r),
848
- schema: s.value,
849
- "onUpdate:props": u
850
- }, null, 8, ["craftNode", "schema"])
851
- ])) : x("", !0),
852
- o.value && f(r) ? (v(), E("div", sr, [
853
- G(b, {
854
- craftNode: f(r),
900
+ S("h4", null, ee(u.value), 1),
901
+ o.value ? (m(), y("div", hr, [
902
+ W(h, {
903
+ craftNode: d(r),
855
904
  schema: o.value,
856
- "onUpdate:events": d
905
+ "onUpdate:props": c
906
+ }, null, 8, ["craftNode", "schema"])
907
+ ])) : k("", !0),
908
+ s.value && d(r) ? (m(), y("div", pr, [
909
+ W(g, {
910
+ craftNode: d(r),
911
+ schema: s.value,
912
+ "onUpdate:events": f
857
913
  }, null, 8, ["craftNode", "schema"])
858
- ])) : x("", !0),
859
- O("div", or, [
860
- i.value ? (v(), E("button", {
914
+ ])) : k("", !0),
915
+ S("div", vr, [
916
+ i.value ? (m(), y("button", {
861
917
  key: 0,
862
918
  class: "formkit-input v-craft-delete",
863
- onClick: V(a, ["prevent"])
864
- }, " Delete ")) : x("", !0)
919
+ onClick: j(a, ["prevent"])
920
+ }, " Delete ")) : k("", !0)
865
921
  ])
866
922
  ], 2)
867
923
  ], 512)
868
924
  ]);
869
925
  };
870
926
  }
871
- }), ke = /* @__PURE__ */ $({
927
+ }), Re = /* @__PURE__ */ I({
872
928
  __name: "CraftDropIndicator",
873
929
  setup(t) {
874
- const e = Se(), r = () => {
875
- const { top: n, left: s } = e.position, { width: o, height: i } = e.size;
930
+ const e = De(), r = () => {
931
+ const { top: n, left: o } = e.position, { width: s, height: i } = e.size;
876
932
  return {
877
933
  top: `${n}px`,
878
- left: `${s}px`,
934
+ left: `${o}px`,
879
935
  height: `${i}px`,
880
- width: `${o}px`
936
+ width: `${s}px`
881
937
  };
882
938
  };
883
- return (n, s) => f(e).isShown ? (v(), E("div", {
939
+ return (n, o) => d(e).isShown ? (m(), y("div", {
884
940
  key: 0,
885
- class: oe(["v-craft-indicator", { "v-craft-forbidden": f(e).isForbidden }]),
886
- style: je(r())
887
- }, null, 6)) : x("", !0);
941
+ class: se(["v-craft-indicator", { "v-craft-forbidden": d(e).isForbidden }]),
942
+ style: Se(r())
943
+ }, null, 6)) : k("", !0);
888
944
  }
889
- }), Qe = /* @__PURE__ */ $({
945
+ }), Je = /* @__PURE__ */ I({
890
946
  __name: "CraftIframe",
891
947
  props: {
892
948
  iframeClass: { type: [Boolean, null, String, Object, Array], default: "" },
@@ -894,535 +950,496 @@ const wt = /* @__PURE__ */ $({
894
950
  inheritStyles: { type: Boolean, default: !1 },
895
951
  styleSheets: { default: () => [] },
896
952
  styles: { default: () => [] },
897
- iframeId: { default: "v-craft-iframe" },
898
- width: { default: "auto" },
899
- height: { default: "auto" }
953
+ iframeId: { default: "v-craft-iframe" }
900
954
  },
901
955
  emits: ["iframeLoad"],
902
956
  setup(t, { emit: e }) {
903
- const r = t, n = K(), s = K(!1), o = K(), i = K(), a = K(), { height: c, width: u } = fe(r), d = w(() => c.value === "auto");
904
- let h = 0, m = !1;
905
- const p = () => {
906
- ue(() => {
957
+ const r = t, n = F(), o = F(!1), s = F(), i = () => {
958
+ ne(() => {
907
959
  if (!n.value) {
908
960
  console.error("iframe could not be loaded.");
909
961
  return;
910
962
  }
911
- R("iframeLoad", n.value), n.value?.setAttribute("data-iframe-ready", "true"), z(), r.inheritStyles && D(), r.styles.forEach((y) => {
912
- n.value && F(n.value, y);
913
- }), r.styleSheets.forEach((y) => {
914
- n.value && A(n.value, y);
915
- }), s.value = !0, ue(() => {
916
- n.value && (o.value = n.value?.contentWindow?.document.body, b());
963
+ p("iframeLoad", n.value), n.value?.setAttribute("data-iframe-ready", "true"), f(), r.inheritStyles && a(), r.styles.forEach((v) => {
964
+ n.value && u(n.value, v);
965
+ }), r.styleSheets.forEach((v) => {
966
+ n.value && c(n.value, v);
967
+ }), o.value = !0, ne(() => {
968
+ n.value && (s.value = n.value?.contentWindow?.document.body);
917
969
  });
918
970
  });
919
- };
920
- le([u, c], ([y, k]) => {
921
- b();
922
- });
923
- const b = () => {
924
- if (!n.value)
925
- return;
926
- const y = n.value.contentWindow;
927
- if (!y) return;
928
- if (i.value?.disconnect(), a.value?.disconnect(), c.value !== "auto" || u.value !== "auto") {
929
- n.value.style.height = `${c.value}px`, n.value.style.width = `${u.value}px`;
930
- return;
931
- }
932
- n.value.style.width = "100%", n.value.style.height = "100%", i.value = new MutationObserver(() => {
933
- setTimeout(g, 100);
934
- }), i.value.observe(y.document.body, {
935
- childList: !0,
936
- subtree: !0,
937
- attributes: !0,
938
- characterData: !0
971
+ }, a = () => {
972
+ const v = n.value?.contentWindow?.parent.document;
973
+ if (!v) return;
974
+ Array.from(v.querySelectorAll("style") ?? []).forEach((C) => {
975
+ n.value?.contentDocument?.head.appendChild(C.cloneNode(!0));
976
+ }), Array.from(v.querySelectorAll("link[rel='stylesheet']") ?? []).forEach((C) => {
977
+ n.value?.contentDocument?.head.appendChild(C.cloneNode(!0));
939
978
  });
940
- const k = new ResizeObserver(() => {
941
- g(), k.disconnect();
942
- });
943
- k.observe(y.document.documentElement), g();
944
- }, g = () => {
945
- m || (m = !0, ue(() => {
946
- const y = n.value?.contentWindow?.document;
947
- if (!y) {
948
- m = !1;
949
- return;
950
- }
951
- const k = n.value?.parentElement;
952
- let I = 0;
953
- if (k) {
954
- const U = k.clientHeight, Q = n.value?.offsetTop || 0;
955
- I = U - Q;
956
- }
957
- const J = y.body, he = y.documentElement, P = Math.max(
958
- 150,
959
- J.scrollHeight,
960
- J.offsetHeight,
961
- he.scrollHeight,
962
- he.offsetHeight
963
- ), S = Math.max(P, I);
964
- n.value && Math.abs(S - h) > 1 && (h = S, n.value.style.height = `${S}px`), m = !1;
965
- }));
966
- }, D = () => {
967
- const y = n.value?.contentWindow?.parent.document;
968
- if (!y) return;
969
- Array.from(y.querySelectorAll("style") ?? []).forEach((J) => {
970
- n.value?.contentDocument?.head.appendChild(J.cloneNode(!0));
971
- }), Array.from(y.querySelectorAll("link[rel='stylesheet']") ?? []).forEach((J) => {
972
- n.value?.contentDocument?.head.appendChild(J.cloneNode(!0));
973
- });
974
- }, F = (y, k) => {
975
- const I = document.createElement("style");
976
- I.innerHTML = k, y?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(I);
977
- }, A = (y, k) => {
978
- const I = document.createElement("link");
979
- I.rel = "stylesheet", I.href = k, y.contentWindow?.document.head.appendChild(I);
980
- }, z = () => {
981
- const y = n.value?.contentWindow?.document;
982
- if (!y) return;
983
- const k = y.querySelector("body");
984
- if (!k) return;
985
- const I = y.createAttribute("id");
986
- I.nodeValue = "v-craft-body", k.attributes.setNamedItem(I);
987
- }, R = e;
988
- return Le(() => {
989
- i.value?.disconnect(), a.value?.disconnect();
990
- }), (y, k) => lt((v(), E("div", {
991
- class: oe({ "h-full": d.value })
992
- }, [
993
- O("iframe", {
979
+ }, u = (v, h) => {
980
+ const g = document.createElement("style");
981
+ g.innerHTML = h, v?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(g);
982
+ }, c = (v, h) => {
983
+ const g = document.createElement("link");
984
+ g.rel = "stylesheet", g.href = h, v.contentWindow?.document.head.appendChild(g);
985
+ }, f = () => {
986
+ const v = n.value?.contentWindow?.document;
987
+ if (!v) return;
988
+ const h = v.querySelector("body");
989
+ if (!h) return;
990
+ const g = v.createAttribute("id");
991
+ g.nodeValue = "v-craft-body", h.attributes.setNamedItem(g);
992
+ }, p = e;
993
+ return (v, h) => gt((m(), y("div", null, [
994
+ S("iframe", {
994
995
  id: "v-craft-iframe",
995
996
  ref_key: "iframeRef",
996
997
  ref: n,
997
- class: oe(t.iframeClass),
998
- style: je(t.iframeStyle),
999
- onload: p
998
+ class: se(t.iframeClass),
999
+ style: Se(t.iframeStyle),
1000
+ onload: i
1000
1001
  }, null, 6),
1001
- s.value ? (v(), N(ut, {
1002
+ o.value ? (m(), x(yt, {
1002
1003
  key: 0,
1003
1004
  to: n.value?.contentWindow?.document.body
1004
1005
  }, [
1005
- W(y.$slots, "default")
1006
- ], 8, ["to"])) : x("", !0)
1007
- ], 2)), [
1008
- [ct, y.$slots.default]
1006
+ Y(v.$slots, "default")
1007
+ ], 8, ["to"])) : k("", !0)
1008
+ ], 512)), [
1009
+ [bt, v.$slots.default]
1009
1010
  ]);
1010
1011
  }
1011
- }), ar = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", Ce = (t, e, r = null) => {
1012
- const n = ar(e), { props: s } = e, o = {
1012
+ }), gr = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", _e = (t, e, r = null) => {
1013
+ const n = gr(e), { props: o } = e, s = {
1013
1014
  componentName: n,
1014
- props: s,
1015
+ props: o,
1015
1016
  slots: {},
1016
1017
  parentUuid: r?.uuid ?? null,
1017
- uuid: de()
1018
+ uuid: le()
1018
1019
  };
1019
1020
  return e.children && (typeof e.children == "object" && !Array.isArray(e.children) ? Object.entries(e.children).forEach(([i, a]) => {
1020
1021
  if (typeof a == "function") {
1021
- const c = a();
1022
- c && (o.slots[i] = $e(t, c, o));
1022
+ const u = a();
1023
+ u && (s.slots[i] = Ie(
1024
+ t,
1025
+ u,
1026
+ s
1027
+ ));
1023
1028
  }
1024
- }) : Array.isArray(e.children) && (o.slots.default = $e(t, e.children, o))), o;
1025
- }, $e = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => Ce(t, n, r)).filter((n) => !!n), lr = (t) => {
1026
- const e = j(), { hasNodes: r } = Z(e), n = t ? K(new ye(t)) : ae("resolver");
1027
- n?.value && e.setResolver(n.value), t && re("resolver", n);
1028
- const s = () => {
1029
+ }) : Array.isArray(e.children) && (s.slots.default = Ie(
1030
+ t,
1031
+ e.children,
1032
+ s
1033
+ ))), s;
1034
+ }, Ie = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => _e(t, n, r)).filter((n) => !!n), yr = (t) => {
1035
+ const e = L(), { hasNodes: r } = G(e), n = t ? F(new be(t)) : ue("resolver");
1036
+ n?.value && e.setResolver(n.value), t && q("resolver", n);
1037
+ const o = () => {
1029
1038
  if (n?.value && !r.value) {
1030
- const o = Be(), a = (o.default ? o.default() : []).flatMap((c) => {
1031
- if (c.key === "_default" && c.children && Array.isArray(c.children))
1032
- return c.children.map((u) => {
1033
- const d = Ce(n.value, u);
1034
- return d || console.error("Invalid node created from child:", u), d;
1039
+ const s = je(), a = (s.default ? s.default() : []).flatMap((u) => {
1040
+ if (u.key === "_default" && u.children && Array.isArray(u.children))
1041
+ return u.children.map((c) => {
1042
+ const f = _e(n.value, c);
1043
+ return f || console.error("Invalid node created from child:", c), f;
1035
1044
  }).filter(Boolean);
1036
1045
  {
1037
- const u = Ce(n.value, c);
1038
- return u || console.error("Invalid node created from slot:", c), [u];
1046
+ const c = _e(n.value, u);
1047
+ return c || console.error("Invalid node created from slot:", u), [c];
1039
1048
  }
1040
1049
  }).filter(Boolean);
1041
1050
  a.length && e.setNodes(a);
1042
1051
  }
1043
1052
  };
1044
- return Ne(s), le(
1053
+ return ye(o), te(
1045
1054
  () => n?.value,
1046
- (o) => {
1047
- o && e.setResolver(o);
1055
+ (s) => {
1056
+ s && e.setResolver(s);
1048
1057
  }
1049
1058
  ), {
1050
1059
  editor: e,
1051
- mountNodes: s
1060
+ mountNodes: o
1052
1061
  };
1053
- }, ur = { class: "v-craft-frame" }, cr = /* @__PURE__ */ $({
1062
+ }, br = { class: "v-craft-frame" }, Er = /* @__PURE__ */ I({
1054
1063
  name: "CraftFrame",
1055
1064
  __name: "CraftFrame",
1056
1065
  props: {
1057
- iFrameHeight: { default: "auto" },
1058
- iFrameStyle: { type: [Boolean, null, String, Object, Array], default: () => ({}) },
1059
- iFrameStyleSheets: { default: () => [] },
1060
- iFrameStyles: { default: () => [] },
1061
- iFrameWidth: { default: "auto" },
1062
- iFrameClass: { type: [Boolean, null, String, Object, Array] },
1063
- inheritStyles: { type: Boolean, default: !1 },
1066
+ iframe: {},
1064
1067
  resolverMap: {},
1065
- useIframe: { type: Boolean, default: !1 },
1066
1068
  viewOnly: { type: Boolean, default: !1 }
1067
1069
  },
1068
1070
  emits: ["iframeLoad"],
1069
1071
  setup(t, { emit: e }) {
1070
- const r = t, { iFrameWidth: n, iFrameHeight: s } = fe(r), o = (h) => {
1071
- i("iframeLoad", h);
1072
- }, i = e, { editor: a } = lr(r.resolverMap), { nodeTree: c, hasNodes: u, enabled: d } = Z(a);
1073
- return (h, m) => {
1074
- const p = B("CraftNodeViewer"), b = B("CraftNodeEditor");
1075
- return v(), E("div", ur, [
1076
- t.useIframe ? (v(), N(Qe, {
1072
+ const r = t, { iframe: n } = ie(r), o = (f) => {
1073
+ s("iframeLoad", f);
1074
+ }, s = e, { editor: i } = yr(r.resolverMap), { nodeTree: a, hasNodes: u, enabled: c } = G(i);
1075
+ return (f, p) => {
1076
+ const v = U("CraftNodeViewer"), h = U("CraftNodeEditor");
1077
+ return m(), y("div", br, [
1078
+ d(n) ? (m(), x(Je, {
1077
1079
  key: 0,
1078
1080
  onIframeLoad: o,
1079
- inheritStyles: t.inheritStyles,
1080
- styles: [
1081
- ...t.iFrameStyles
1082
- ],
1083
- "iframe-style": t.iFrameStyle,
1084
- "iframe-class": t.iFrameClass,
1085
- "style-sheets": t.iFrameStyleSheets,
1086
- width: f(n),
1087
- height: f(s)
1081
+ inheritStyles: d(n)?.inheritStyles,
1082
+ iframeStyle: d(n)?.iframeStyle,
1083
+ iframeClass: d(n)?.iframeClass,
1084
+ class: se(d(n)?.wrapperClass),
1085
+ style: Se(d(n)?.wrapperStyle),
1086
+ styles: d(n)?.styles,
1087
+ styleSheets: d(n)?.styleSheets
1088
1088
  }, {
1089
- default: X(() => [
1090
- (t.viewOnly || !f(d)) && f(u) ? (v(!0), E(T, { key: 0 }, M(f(c), (g) => (v(), N(p, {
1089
+ default: H(() => [
1090
+ (t.viewOnly || !d(c)) && d(u) ? (m(!0), y(R, { key: 0 }, $(d(a), (g) => (m(), x(v, {
1091
1091
  key: `${g.uuid}-view`,
1092
1092
  craftNode: g
1093
- }, null, 8, ["craftNode"]))), 128)) : x("", !0),
1094
- !t.viewOnly && f(d) && f(u) ? (v(!0), E(T, { key: 1 }, M(f(c), (g) => (v(), N(b, {
1093
+ }, null, 8, ["craftNode"]))), 128)) : k("", !0),
1094
+ !t.viewOnly && d(c) && d(u) ? (m(!0), y(R, { key: 1 }, $(d(a), (g) => (m(), x(h, {
1095
1095
  key: `${g.uuid}-edit`,
1096
1096
  craftNode: g
1097
- }, null, 8, ["craftNode"]))), 128)) : x("", !0),
1098
- !t.viewOnly && f(d) ? (v(), N(ke, { key: 2 })) : x("", !0)
1097
+ }, null, 8, ["craftNode"]))), 128)) : k("", !0),
1098
+ !t.viewOnly && d(c) ? (m(), x(Re, { key: 2 })) : k("", !0)
1099
1099
  ]),
1100
1100
  _: 1
1101
- }, 8, ["inheritStyles", "styles", "iframe-style", "iframe-class", "style-sheets", "width", "height"])) : x("", !0),
1102
- !t.useIframe && (t.viewOnly || !f(d)) && f(u) ? (v(!0), E(T, { key: 1 }, M(f(c), (g) => (v(), N(p, {
1101
+ }, 8, ["inheritStyles", "iframeStyle", "iframeClass", "class", "style", "styles", "styleSheets"])) : k("", !0),
1102
+ !d(n) && (t.viewOnly || !d(c)) && d(u) ? (m(!0), y(R, { key: 1 }, $(d(a), (g) => (m(), x(v, {
1103
1103
  key: `${g.uuid}-view`,
1104
1104
  craftNode: g
1105
- }, null, 8, ["craftNode"]))), 128)) : x("", !0),
1106
- !t.useIframe && !t.viewOnly && f(d) && f(u) ? (v(!0), E(T, { key: 2 }, M(f(c), (g) => (v(), N(b, {
1105
+ }, null, 8, ["craftNode"]))), 128)) : k("", !0),
1106
+ !d(n) && !t.viewOnly && d(c) && d(u) ? (m(!0), y(R, { key: 2 }, $(d(a), (g) => (m(), x(h, {
1107
1107
  key: `${g.uuid}-edit`,
1108
1108
  craftNode: g
1109
- }, null, 8, ["craftNode"]))), 128)) : x("", !0),
1110
- !t.useIframe && !t.viewOnly && f(d) ? (v(), N(ke, { key: 3 })) : x("", !0)
1109
+ }, null, 8, ["craftNode"]))), 128)) : k("", !0),
1110
+ !d(n) && !t.viewOnly && d(c) ? (m(), x(Re, { key: 3 })) : k("", !0)
1111
1111
  ]);
1112
1112
  };
1113
1113
  }
1114
- }), dr = (t, e) => {
1115
- const r = j(), { enabled: n, selectedUuid: s, draggingDisabled: o } = Z(r);
1114
+ }), Cr = (t, e) => {
1115
+ const r = L(), { enabled: n, selectedUuid: o, draggingDisabled: s } = G(r);
1116
1116
  let i = null;
1117
1117
  const a = () => {
1118
- const h = e?.value?.$el;
1119
- h && h !== i && (i = h, r.setNodeRef(t, h));
1118
+ const p = e?.value?.$el;
1119
+ p && p !== i && (i = p, r.setNodeRef(t, p));
1120
1120
  };
1121
- Ne(a), le(e, a, { flush: "post" });
1122
- const c = w(
1123
- () => s.value === t.uuid
1121
+ ye(a), te(e, a, { flush: "post" });
1122
+ const u = b(
1123
+ () => o.value === t.uuid
1124
1124
  );
1125
1125
  return {
1126
- isDraggable: w(() => n.value && !o.value && yt(t)),
1127
- isSelected: c,
1126
+ isDraggable: b(() => n.value && !s.value && kt(t)),
1127
+ isSelected: u,
1128
1128
  selectNode: () => {
1129
1129
  n.value && r.selectNode(t);
1130
1130
  }
1131
1131
  };
1132
- }, Ge = (t, e, r) => {
1133
- const n = /* @__PURE__ */ new Map(), s = () => {
1134
- !t.value?.events || !Object.values(t.value.events).length || Object.entries(t.value.events).forEach(([o, i]) => {
1135
- if (!i.trim())
1132
+ }, Ae = (t, e, r, n) => {
1133
+ const o = /* @__PURE__ */ new Map(), s = () => {
1134
+ !t.value?.events || !Object.values(t.value.events).length || Object.entries(t.value.events).forEach(([i, a]) => {
1135
+ if (!a.trim())
1136
1136
  return;
1137
- const a = (...c) => {
1137
+ const u = (...c) => {
1138
1138
  try {
1139
1139
  new Function(
1140
1140
  "ctx",
1141
1141
  "craftNode",
1142
1142
  "args",
1143
- i
1143
+ a
1144
1144
  )(
1145
- { ...r, editor: e },
1146
- e.nodeMap.get(t.value.uuid),
1145
+ { ...e, getNodes: r, getNode: n },
1146
+ t.value.uuid,
1147
1147
  ...c
1148
1148
  );
1149
- } catch (u) {
1149
+ } catch (f) {
1150
1150
  console.error(
1151
1151
  `Event code execution failed with code:
1152
- ${i}
1152
+ ${a}
1153
1153
 
1154
1154
  Error:`,
1155
- u
1155
+ f
1156
1156
  );
1157
1157
  }
1158
1158
  };
1159
- n.set(o, a);
1159
+ o.set(i, u);
1160
1160
  });
1161
1161
  };
1162
- return le(
1162
+ return te(
1163
1163
  () => t,
1164
1164
  () => {
1165
1165
  s();
1166
1166
  }
1167
- ), dt(() => {
1167
+ ), Et(() => {
1168
1168
  s();
1169
- }), ft(() => {
1170
- n.clear();
1169
+ }), Ct(() => {
1170
+ o.clear();
1171
1171
  }), {
1172
- eventHandlers: w(() => Object.fromEntries(n))
1172
+ eventHandlers: b(() => Object.fromEntries(o))
1173
1173
  };
1174
- }, Ze = (t) => {
1174
+ }, et = (t) => {
1175
1175
  const e = (() => {
1176
1176
  try {
1177
- return j();
1177
+ return L();
1178
1178
  } catch {
1179
1179
  return null;
1180
1180
  }
1181
- })(), r = w(() => e ? Z(e).enabled?.value ?? !1 : !1), n = w(() => t.value?.visible !== !1);
1182
- return re("craftNode", ht(t)), {
1181
+ })(), r = b(() => e ? G(e).enabled?.value ?? !1 : !1), n = b(() => t.value?.visible !== !1);
1182
+ return q("craftNode", He(t)), {
1183
1183
  editor: e,
1184
1184
  craftNode: t,
1185
1185
  enabled: r,
1186
1186
  visible: n
1187
1187
  };
1188
- }, Je = (t, e) => {
1188
+ }, tt = (t, e) => {
1189
+ if (!e.getBoundingClientRect) return !1;
1189
1190
  const r = e.getBoundingClientRect();
1190
1191
  return t.clientX - r.left < r.width / 2;
1191
- }, et = (t, e) => {
1192
+ }, rt = (t, e) => {
1193
+ if (!e.getBoundingClientRect) return !1;
1192
1194
  const r = e.getBoundingClientRect();
1193
1195
  return t.clientY - r.top < r.height / 2;
1194
- }, tt = (t, e) => {
1196
+ }, nt = (t, e) => {
1197
+ if (!e.getBoundingClientRect) return !1;
1195
1198
  const r = e.getBoundingClientRect();
1196
1199
  return t.clientX - r.left < 15 || t.clientY - r.top < 15 || r.right - t.clientX < 15 || r.bottom - t.clientY < 15;
1197
- }, rt = (t, e, { editor: r, indicator: n, craftNode: s, resolver: o }) => {
1200
+ }, ot = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
1198
1201
  if (r.draggedNode) {
1199
- if (n.setIsForbidden(!pe(r.draggedNode, s.value, o)), Je(t, e)) {
1202
+ if (n.setIsForbidden(!me(r.draggedNode, o.value, s)), tt(t, e)) {
1200
1203
  n.pointBefore(e);
1201
1204
  return;
1202
1205
  }
1203
1206
  n.pointAfter(e);
1204
1207
  }
1205
- }, fr = (t, e, { editor: r, indicator: n, craftNode: s, resolver: o }) => {
1208
+ }, _r = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
1206
1209
  if (!r.draggedNode) return;
1207
1210
  const a = t.target.closest(".v-craft-drop-text");
1208
1211
  if (a) {
1209
- const u = !ie(r.draggedNode, s.value, o);
1210
- n.setIsForbidden(u), n.pointInside(a);
1212
+ const c = !oe(r.draggedNode, o.value, s);
1213
+ n.setIsForbidden(c), n.pointInside(a);
1211
1214
  return;
1212
1215
  }
1213
- if (tt(t, e)) {
1214
- rt(t, e, { editor: r, indicator: n, craftNode: s, resolver: o });
1216
+ if (nt(t, e)) {
1217
+ ot(t, e, { editor: r, indicator: n, craftNode: o, resolver: s });
1215
1218
  return;
1216
1219
  }
1217
- const c = !ie(r.draggedNode, s.value, o);
1218
- if (n.setIsForbidden(c), et(t, e)) {
1220
+ const u = !oe(r.draggedNode, o.value, s);
1221
+ if (n.setIsForbidden(u), rt(t, e)) {
1219
1222
  n.pointInsideTop(e);
1220
1223
  return;
1221
1224
  }
1222
1225
  n.pointInside(e);
1223
- }, hr = (t, e, r) => {
1224
- if (q(r.craftNode.value)) {
1225
- fr(t, e, r);
1226
+ }, Nr = (t, e, r) => {
1227
+ if (K(r.craftNode.value)) {
1228
+ _r(t, e, r);
1226
1229
  return;
1227
1230
  }
1228
- rt(t, e, r);
1229
- }, nt = (t, e, r, n) => {
1230
- if (!pe(
1231
+ ot(t, e, r);
1232
+ }, st = (t, e, r, n) => {
1233
+ if (!me(
1231
1234
  r,
1232
1235
  n.craftNode.value,
1233
1236
  n.resolver
1234
1237
  ))
1235
1238
  return n.craftNode.value;
1236
- const s = n.craftNode.value.parentUuid ? n.editor.nodeMap.get(n.craftNode.value.parentUuid) : null;
1237
- if (!s)
1239
+ const o = n.craftNode.value.parentUuid ? n.editor.nodeMap.get(n.craftNode.value.parentUuid) : null;
1240
+ if (!o)
1238
1241
  return n.craftNode.value;
1239
- const o = Object.values(s.slots || {}).flat().find(
1240
- (i) => i.uuid === n.craftNode.value.uuid
1241
- );
1242
- return !o || o.uuid === r.uuid || (Je(t, e) ? n.editor.insertNodeBefore(r, o) : n.editor.insertNodeAfter(r, o)), n.craftNode.value;
1243
- }, pr = (t, e) => {
1244
- if (!t.slots || Object.keys(t.slots).length === 0) {
1245
- const n = e.resolveNode?.(t)?.slots;
1246
- n && n.length > 0 ? (t.slots = {}, n.forEach((s) => {
1247
- t.slots[s] = [];
1248
- })) : t.slots = { default: [] };
1249
- }
1250
- return t;
1251
- }, st = (t, e, r, n) => {
1252
- const { editor: s, resolver: o, craftNode: i } = n, a = t.target, c = s.nodeMap.get(a.id);
1253
- if (c && q(c))
1254
- return st(t, e, r, { ...n, craftNode: K(c) }), n.craftNode.value;
1255
- const u = a.closest(".v-craft-drop-text");
1256
- let d = "default";
1257
- if (u) {
1258
- const h = u.getAttribute("data-slot-name");
1259
- h && (d = h);
1242
+ const s = Object.values(o.slots || {}).flat().find((i) => i.uuid === n.craftNode.value.uuid);
1243
+ return !s || s.uuid === r.uuid || (tt(t, e) ? n.editor.insertNodeBefore(r, s) : n.editor.insertNodeAfter(r, s)), n.craftNode.value;
1244
+ }, it = (t, e, r, n) => {
1245
+ const { editor: o, resolver: s, craftNode: i } = n, a = t.target, u = o.nodeMap.get(a.id);
1246
+ if (u && K(u))
1247
+ return it(t, e, r, {
1248
+ ...n,
1249
+ craftNode: F(u)
1250
+ }), n.craftNode.value;
1251
+ const c = a.closest(".v-craft-drop-text");
1252
+ let f = "default";
1253
+ if (c) {
1254
+ const p = c.getAttribute("data-slot-name");
1255
+ p && (f = p);
1260
1256
  } else {
1261
- if (tt(t, e))
1262
- return nt(t, e, r, n);
1263
- const h = n.craftNode.value.slots || {}, m = Object.keys(h);
1264
- d = m.length > 0 ? m[0] : "default";
1257
+ if (nt(t, e))
1258
+ return st(t, e, r, n);
1259
+ const p = n.craftNode.value.slots || {}, v = Object.keys(p);
1260
+ f = v.length > 0 ? v[0] : "default";
1265
1261
  }
1266
- return ie(
1262
+ return oe(
1267
1263
  r,
1268
1264
  n.craftNode.value,
1269
1265
  n.resolver
1270
- ) && (et(t, e) ? n.editor.prependNodeTo(r, n.craftNode.value, d) : n.editor.appendNodeTo(r, n.craftNode.value, d)), n.craftNode.value;
1271
- }, vr = (t, e, r) => {
1266
+ ) && (rt(t, e) ? n.editor.prependNodeTo(
1267
+ r,
1268
+ n.craftNode.value,
1269
+ f
1270
+ ) : n.editor.appendNodeTo(r, n.craftNode.value, f)), n.craftNode.value;
1271
+ }, wr = (t, e, r) => {
1272
1272
  if (!r.editor.draggedNode)
1273
1273
  return r.craftNode.value;
1274
1274
  const n = (() => {
1275
- let s;
1276
- return r.editor.draggedNode?.uuid ? s = JSON.parse(JSON.stringify(r.editor.draggedNode)) : s = We(
1275
+ let o;
1276
+ return r.editor.draggedNode?.uuid ? o = JSON.parse(JSON.stringify(r.editor.draggedNode)) : o = Qe(
1277
1277
  JSON.parse(JSON.stringify(r.editor.draggedNode))
1278
- ), pr(s, r.resolver);
1278
+ ), We(o, r.resolver);
1279
1279
  })();
1280
- return q(r.craftNode.value) ? st(t, e, n, r) : nt(t, e, n, r);
1281
- }, Re = {
1282
- handleDragOver: hr,
1283
- handleDrop: vr
1284
- }, mr = (t, e, r) => {
1285
- const n = j(), s = Se(), o = (u) => {
1280
+ return K(r.craftNode.value) ? it(t, e, n, r) : st(t, e, n, r);
1281
+ }, Te = {
1282
+ handleDragOver: Nr,
1283
+ handleDrop: wr
1284
+ }, Or = (t, e, r) => {
1285
+ const n = L(), o = De(), s = (c) => {
1286
1286
  n.enabled && n.dragNode(t.value);
1287
- }, i = Ve((u) => {
1288
- n.enabled && e.value?.$el && Re.handleDragOver(u, e.value.$el, {
1287
+ }, i = Ke((c) => {
1288
+ n.enabled && e.value?.$el && Te.handleDragOver(c, e.value.$el, {
1289
1289
  editor: n,
1290
- indicator: s,
1290
+ indicator: o,
1291
1291
  craftNode: t,
1292
1292
  resolver: r
1293
1293
  });
1294
1294
  }, 8);
1295
1295
  return {
1296
- handleDragStart: o,
1296
+ handleDragStart: s,
1297
1297
  handleDragOver: i,
1298
- handleDrop: (u) => {
1299
- n.enabled && e.value?.$el && Re.handleDrop(u, e.value.$el, {
1298
+ handleDrop: (c) => {
1299
+ n.enabled && e.value?.$el && Te.handleDrop(c, e.value.$el, {
1300
1300
  editor: n,
1301
- indicator: s,
1301
+ indicator: o,
1302
1302
  craftNode: t,
1303
1303
  resolver: r
1304
1304
  });
1305
1305
  },
1306
1306
  handleDragEnd: () => {
1307
- n.enabled && (n.dragNode(null), s.hide());
1307
+ n.enabled && n.dragNode(null);
1308
1308
  }
1309
1309
  };
1310
- }, gr = ["data-slot-name"], yr = { class: "v-craft-slot-name" }, br = /* @__PURE__ */ $({
1310
+ }, xr = ["data-slot-name"], Sr = { class: "v-craft-slot-name" }, kr = /* @__PURE__ */ I({
1311
1311
  name: "CraftNodeEditor",
1312
1312
  __name: "CraftNodeEditor",
1313
1313
  props: {
1314
1314
  craftNode: {}
1315
1315
  },
1316
1316
  setup(t) {
1317
- const r = ce(t, "craftNode"), { editor: n, visible: s } = Ze(r), { resolvedNode: o, defaultProps: i, resolver: a } = xe(r);
1318
- a.value && re("resolver", a);
1319
- const c = K(null), u = w(() => n?.nodeDataMap[r.value.uuid]), { isSelected: d, isDraggable: h, selectNode: m } = dr(
1317
+ const e = t, { craftNode: r } = ie(e), { editor: n, visible: o } = et(r), { resolvedNode: s, defaultProps: i, resolver: a, componentToRender: u } = fe(r);
1318
+ te(
1319
+ a,
1320
+ (w) => {
1321
+ w && q("resolver", a);
1322
+ },
1323
+ { immediate: !0 }
1324
+ );
1325
+ const c = F(null), f = F(null), p = b(() => n?.nodeDataMap[r.value.uuid]), { isSelected: v, isDraggable: h, selectNode: g } = Cr(
1320
1326
  r.value,
1321
1327
  c
1322
- ), { handleDragStart: p, handleDragOver: b, handleDrop: g, handleDragEnd: D } = mr(r, c, a.value), { eventHandlers: F } = Ge(
1328
+ ), { handleDragStart: C, handleDragOver: T, handleDrop: N, handleDragEnd: A } = Or(r, c, a.value), { eventHandlers: E } = Ae(
1323
1329
  r,
1324
- n,
1325
- n?.eventsContext || {}
1326
- ), A = w(() => {
1327
- const P = a?.value?.resolve(r.value.componentName);
1328
- return q(r.value) ? r.value.props.componentName : P?.componentName || r.value.componentName;
1329
- }), z = () => {
1330
- m();
1331
- }, R = (P) => {
1332
- let S = 0;
1333
- for (let L = 0; L < P.length; L++)
1334
- S = P.charCodeAt(L) + ((S << 5) - S);
1335
- const U = S % 360, Q = 70 + S % 30, H = 45 + S % 30;
1336
- return `hsla(${U}, ${Q}%, ${H}%, 0.9)`;
1337
- }, y = w(() => R(r.value.uuid)), k = w(() => {
1338
- const P = [], U = a?.value?.resolveNode?.(r.value)?.slots;
1339
- return U && U.length > 0 ? P.push(...U) : P.push("default"), P;
1340
- }), I = w(() => q(r.value) ? !0 : Object.values(r.value.slots || {}).some(
1341
- (P) => P.length > 0
1342
- )), J = (P, S) => u.value ? u.value.slotName && u.value.slotName !== S ? [] : he(u.value, P) : [], he = (P, S) => P.type === "single" ? S.map((U) => ({
1343
- key: `${U.uuid}-single`,
1330
+ n?.eventsContext || {},
1331
+ () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
1332
+ (w) => n?.nodeMap[w] ?? null
1333
+ ), P = b(() => {
1334
+ const w = a?.value?.resolve(r.value.componentName);
1335
+ return w?.label ? w.label : K(r.value) ? r.value.props.componentName : w?.componentName || r.value.componentName;
1336
+ }), M = b(() => Ze(r.value.uuid)), V = () => {
1337
+ const D = (f.value?.ownerDocument ?? c.value?.$el?.ownerDocument ?? document).querySelector(
1338
+ `[data-craft-uuid="${r.value.uuid}"]`
1339
+ );
1340
+ if (D) return D;
1341
+ let B = c.value?.$el;
1342
+ for (; B && !(B instanceof HTMLElement); )
1343
+ B = B.nextElementSibling ?? null;
1344
+ return B ?? null;
1345
+ }, he = (w, D, B) => {
1346
+ if (!(w instanceof Element)) {
1347
+ console.error("resolveNodeEl returned a non-Element:", w);
1348
+ return;
1349
+ }
1350
+ w.style.setProperty("--node-name", D), w.style.setProperty("--node-color", B), w.setAttribute("data-node-name", D);
1351
+ }, pe = () => {
1352
+ const w = V();
1353
+ w && (f.value = w, he(w, P.value ?? "(n/a)", M.value));
1354
+ };
1355
+ ye(() => ne(pe)), _t(() => ne(pe)), te([P, M], () => {
1356
+ f.value && he(f.value, P.value ?? "", M.value);
1357
+ });
1358
+ const at = b(() => {
1359
+ const D = a?.value?.resolveNode?.(r.value)?.slots;
1360
+ return D && D.length > 0 ? D : ["default"];
1361
+ }), lt = b(() => K(r.value) ? !0 : Object.values(r.value.slots || {}).some(
1362
+ (w) => w.length > 0
1363
+ )), ut = () => g(), ct = (w, D) => p.value ? p.value.slotName && p.value.slotName !== D ? [] : dt(p.value, w) : [], dt = (w, D) => w.type === "single" ? D.map((B) => ({
1364
+ key: `${B.uuid}-single`,
1344
1365
  craftNode: {
1345
- ...U,
1346
- props: {
1347
- ...U.props,
1348
- ...P.item || {}
1349
- }
1366
+ ...B,
1367
+ props: { ...B.props, ...w.item || {} }
1350
1368
  }
1351
- })) : P.type === "list" ? P.list ? S.reduce((U, Q) => U.concat(
1352
- P.list.map((H, L) => ({
1353
- key: `${Q.uuid}-data-${L}`,
1369
+ })) : w.type === "list" ? w.list ? D.reduce((B, ae) => B.concat(
1370
+ w.list.map((X, z) => ({
1371
+ key: `${ae.uuid}-data-${z}`,
1354
1372
  craftNode: {
1355
- ...Q,
1356
- props: {
1357
- ...Q.props,
1358
- ...H || {}
1359
- }
1373
+ ...ae,
1374
+ props: { ...ae.props, ...X || {} }
1360
1375
  }
1361
1376
  }))
1362
1377
  ), []) : [] : [];
1363
- return (P, S) => {
1364
- const U = B("CraftNodeViewer"), Q = B("CraftNodeEditor", !0);
1365
- return f(s) && r.value && f(o) ? (v(), N(me(f(o).componentName), Oe({
1378
+ return (w, D) => {
1379
+ const B = U("CraftNodeViewer"), ae = U("CraftNodeEditor", !0);
1380
+ return d(o) && d(r) && d(s) ? (m(), x(ce(d(u)), ge({
1366
1381
  key: 0,
1367
1382
  ref_key: "nodeRef",
1368
1383
  ref: c
1369
- }, { ...f(i), ...r.value.props }, Fe(f(F)), {
1370
- "data-node-name": A.value,
1371
- style: { "--node-color": y.value },
1384
+ }, {
1385
+ ...d(i),
1386
+ ...d(r).props,
1387
+ "data-craft-uuid": d(r).uuid
1388
+ }, ke(d(E)), {
1372
1389
  class: {
1373
- "v-craft-node-selected": f(d),
1374
- "v-craft-node": f(n)?.enabled,
1375
- "v-craft-canvas": f(q)(r.value),
1376
- "v-craft-empty": !r.value.slots || Object.keys(r.value.slots).length === 0 || Object.values(r.value.slots).every((H) => H.length === 0),
1377
- "v-craft-other-node-dragged": f(n)?.draggedNode && !f(qe)(f(n).draggedNode, r.value)
1390
+ "v-craft-node-selected": d(v),
1391
+ "v-craft-node": d(n)?.enabled,
1392
+ "v-craft-canvas": d(K)(d(r)),
1393
+ "v-craft-empty": !d(r).slots || Object.keys(d(r).slots).length === 0 || Object.values(d(r).slots).every((X) => X.length === 0),
1394
+ "v-craft-other-node-dragged": d(n)?.draggedNode && !d(Ye)(d(n).draggedNode, d(r))
1378
1395
  },
1379
- draggable: f(n)?.enabled && f(h),
1380
- onClick: V(z, ["prevent", "stop"]),
1381
- onDragend: V(f(D), ["prevent", "stop"]),
1382
- onDragover: V(f(b), ["prevent", "stop"]),
1383
- onDragstart: V(f(p), ["stop"]),
1384
- onDrop: V(f(g), ["prevent", "stop"])
1385
- }), ge({ _: 2 }, [
1386
- M(k.value, (H) => ({
1387
- name: H,
1388
- fn: X(() => [
1389
- f(q)(r.value) && r.value.slots[H]?.length == 0 ? (v(), E("div", {
1396
+ draggable: d(n)?.enabled && d(h),
1397
+ onClick: j(ut, ["prevent", "stop"]),
1398
+ onDragend: j(d(A), ["prevent", "stop"]),
1399
+ onDragover: j(d(T), ["prevent", "stop"]),
1400
+ onDragstart: j(d(C), ["stop"]),
1401
+ onDrop: j(d(N), ["prevent", "stop"])
1402
+ }), de({ _: 2 }, [
1403
+ $(at.value, (X) => ({
1404
+ name: X,
1405
+ fn: H(() => [
1406
+ d(K)(d(r)) && (!d(r).slots || d(r).slots[X]?.length == 0) ? (m(), y("div", {
1390
1407
  key: 0,
1391
1408
  class: "v-craft-drop-text",
1392
- "data-slot-name": H,
1393
- onDragover: S[0] || (S[0] = V(
1409
+ "data-slot-name": X,
1410
+ onDragover: D[0] || (D[0] = j(
1394
1411
  //@ts-ignore
1395
- (...L) => f(b) && f(b)(...L),
1412
+ (...z) => d(T) && d(T)(...z),
1396
1413
  ["prevent", "stop"]
1397
1414
  )),
1398
- onDrop: S[1] || (S[1] = V(
1415
+ onDrop: D[1] || (D[1] = j(
1399
1416
  //@ts-ignore
1400
- (...L) => f(g) && f(g)(...L),
1417
+ (...z) => d(N) && d(N)(...z),
1401
1418
  ["prevent", "stop"]
1402
1419
  ))
1403
1420
  }, [
1404
- S[2] || (S[2] = O("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
1405
- O("span", yr, ne(H), 1)
1406
- ], 40, gr)) : x("", !0),
1407
- I.value ? (v(), E(T, { key: 1 }, [
1408
- u.value?.type && u.value.slotName === H ? (v(!0), E(T, { key: 0 }, M(J(
1409
- r.value.slots?.[H] || [],
1410
- H
1411
- ), (L) => (v(), N(U, {
1412
- key: L.key,
1413
- craftNode: L.craftNode
1414
- }, null, 8, ["craftNode"]))), 128)) : x("", !0),
1415
- (v(!0), E(T, null, M(r.value.slots?.[H] || [], (L) => (v(), N(Q, {
1416
- key: L.uuid,
1417
- craftNode: L
1421
+ D[2] || (D[2] = S("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
1422
+ S("span", Sr, ee(X), 1)
1423
+ ], 40, xr)) : k("", !0),
1424
+ lt.value ? (m(), y(R, { key: 1 }, [
1425
+ p.value?.type && p.value.slotName === X ? (m(!0), y(R, { key: 0 }, $(ct(
1426
+ d(r).slots?.[X] || [],
1427
+ X
1428
+ ), (z) => (m(), x(B, {
1429
+ key: z.key,
1430
+ craftNode: z.craftNode
1431
+ }, null, 8, ["craftNode"]))), 128)) : k("", !0),
1432
+ (m(!0), y(R, null, $(d(r).slots?.[X] || [], (z) => (m(), x(ae, {
1433
+ key: z.uuid,
1434
+ craftNode: z
1418
1435
  }, null, 8, ["craftNode"]))), 128))
1419
- ], 64)) : x("", !0)
1436
+ ], 64)) : k("", !0)
1420
1437
  ])
1421
1438
  }))
1422
- ]), 1040, ["data-node-name", "style", "class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : x("", !0);
1439
+ ]), 1040, ["class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : k("", !0);
1423
1440
  };
1424
1441
  }
1425
- }), ve = /* @__PURE__ */ $({
1442
+ }), Ne = /* @__PURE__ */ I({
1426
1443
  name: "CraftNodeViewer",
1427
1444
  __name: "CraftNodeViewer",
1428
1445
  props: {
@@ -1431,105 +1448,192 @@ Error:`,
1431
1448
  eventsContext: {}
1432
1449
  },
1433
1450
  setup(t) {
1434
- const e = t, r = ce(e, "craftNode"), { editor: n, visible: s } = Ze(r), { resolvedNode: o, defaultProps: i, resolver: a } = xe(r);
1435
- re("resolver", a);
1436
- const c = w(() => ({
1451
+ const e = t, r = ve(e, "craftNode"), { editor: n, visible: o } = et(r), { resolvedNode: s, defaultProps: i, resolver: a, componentToRender: u } = fe(r);
1452
+ q("resolver", a);
1453
+ const c = b(() => ({
1437
1454
  ...i.value,
1438
1455
  ...r.value?.props
1439
- })), u = w(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), d = w(() => r.value.slots || {}), h = w(() => q(r.value)), m = w(() => {
1440
- const A = [], R = a?.value?.resolveNode?.(r.value)?.slots;
1441
- return R && R.length > 0 ? A.push(...R) : A.push("default"), A;
1442
- }), p = w(() => h.value ? !0 : Object.values(d.value).some((A) => A.length > 0)), b = (A, z) => u.value ? u.value.slotName && u.value.slotName !== z ? [] : F(u.value, A) : [], g = K(null), { eventHandlers: D } = Ge(
1456
+ })), f = b(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), p = b(() => r.value.slots || {}), v = b(() => K(r.value)), h = b(() => {
1457
+ if (!g.value)
1458
+ return [];
1459
+ const E = [], M = a?.value?.resolveNode?.(r.value)?.slots;
1460
+ return M && M.length > 0 ? E.push(...M) : E.push("default"), E;
1461
+ }), g = b(() => v.value ? !0 : Object.values(p.value).some((E) => E.length > 0)), C = (E, P) => f.value ? f.value.slotName && f.value.slotName !== P ? [] : A(f.value, E) : [], T = F(null), { eventHandlers: N } = Ae(
1443
1462
  r,
1444
- n,
1445
- e.eventsContext || n?.eventsContext || {}
1463
+ e.eventsContext || n?.eventsContext || {},
1464
+ () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
1465
+ (E) => n?.nodeMap[E] ?? null
1446
1466
  );
1447
- Ne(() => {
1448
- g.value && r.value && n && n.setNodeRef(r.value, g.value);
1467
+ ye(() => {
1468
+ T.value && r.value && n && n.setNodeRef(r.value, T.value);
1449
1469
  });
1450
- const F = (A, z) => A.type === "single" ? z.map((R) => ({
1451
- key: `${R.uuid}-single`,
1470
+ const A = (E, P) => E.type === "single" ? P.map((M) => ({
1471
+ key: `${M.uuid}-single`,
1452
1472
  craftNode: {
1453
- ...R,
1473
+ ...M,
1454
1474
  props: {
1455
- ...R.props,
1456
- ...A.item || {}
1475
+ ...M.props,
1476
+ ...E.item || {}
1457
1477
  }
1458
1478
  }
1459
- })) : A.type === "list" ? A.list ? z.reduce((R, y) => R.concat(
1479
+ })) : E.type === "list" ? E.list ? P.reduce((M, V) => M.concat(
1460
1480
  //@ts-ignore
1461
- A.list.map((k, I) => ({
1462
- key: `${y.uuid}-data-${I}`,
1481
+ E.list.map((he, pe) => ({
1482
+ key: `${V.uuid}-data-${pe}`,
1463
1483
  craftNode: {
1464
- ...y,
1484
+ ...V,
1465
1485
  props: {
1466
- ...y.props,
1467
- ...k || {}
1486
+ ...V.props,
1487
+ ...he || {}
1468
1488
  }
1469
1489
  }
1470
1490
  }))
1471
1491
  ), []) : [] : [];
1472
- return (A, z) => f(s) && f(a) && f(o) ? (v(), N(me(f(o).componentName), Oe({
1492
+ return (E, P) => d(o) && d(a) && d(s) ? (m(), x(ce(d(u)), ge({
1473
1493
  key: 0,
1474
1494
  ref_key: "nodeRef",
1475
- ref: g
1476
- }, c.value, Fe(f(D))), ge({ _: 2 }, [
1477
- M(m.value, (R) => ({
1478
- name: R,
1479
- fn: X(() => [
1480
- p.value ? (v(), E(T, { key: 0 }, [
1481
- u.value?.type ? (v(!0), E(T, { key: 1 }, M(b(d.value[R], R), (y) => (v(), N(ve, {
1482
- key: y.key,
1483
- craftNode: y.craftNode
1484
- }, null, 8, ["craftNode"]))), 128)) : (v(!0), E(T, { key: 0 }, M(d.value[R], (y) => (v(), N(ve, {
1485
- key: y.uuid,
1486
- craftNode: y
1495
+ ref: T
1496
+ }, c.value, ke(d(N))), de({ _: 2 }, [
1497
+ $(h.value, (M) => ({
1498
+ name: M,
1499
+ fn: H(() => [
1500
+ g.value ? (m(), y(R, { key: 0 }, [
1501
+ f.value?.type ? (m(!0), y(R, { key: 1 }, $(C(p.value[M], M), (V) => (m(), x(Ne, {
1502
+ key: V.key,
1503
+ craftNode: V.craftNode
1504
+ }, null, 8, ["craftNode"]))), 128)) : (m(!0), y(R, { key: 0 }, $(p.value[M], (V) => (m(), x(Ne, {
1505
+ key: V.uuid,
1506
+ craftNode: V
1487
1507
  }, null, 8, ["craftNode"]))), 128))
1488
- ], 64)) : x("", !0)
1508
+ ], 64)) : k("", !0)
1509
+ ])
1510
+ }))
1511
+ ]), 1040)) : k("", !0);
1512
+ }
1513
+ }), we = /* @__PURE__ */ I({
1514
+ name: "CraftNodeStatic",
1515
+ __name: "CraftNodeStatic",
1516
+ props: {
1517
+ craftNode: {},
1518
+ nodeMap: {},
1519
+ nodeDataMap: {},
1520
+ eventsContext: {}
1521
+ },
1522
+ setup(t) {
1523
+ const e = t, { craftNode: r, nodeMap: n } = ie(e), { resolvedNode: o, defaultProps: s, resolver: i, componentToRender: a } = fe(r);
1524
+ q("resolver", i), q("craftNode", He(r.value));
1525
+ const u = b(() => ({
1526
+ ...s.value,
1527
+ ...r.value?.props
1528
+ })), c = b(() => e.nodeDataMap?.[r.value.uuid] || null), f = b(() => r.value.slots || {}), p = b(() => K(r.value)), v = b(() => {
1529
+ if (!h.value)
1530
+ return [];
1531
+ const N = [], E = i?.value?.resolveNode?.(r.value)?.slots;
1532
+ return E && E.length > 0 ? N.push(...E) : N.push("default"), N;
1533
+ }), h = b(() => p.value ? !0 : Object.values(f.value).some((N) => N.length > 0)), g = (N, A) => c.value ? c.value.slotName && c.value.slotName !== A ? [] : T(c.value, N) : [], { eventHandlers: C } = Ae(
1534
+ r,
1535
+ e.eventsContext || {},
1536
+ () => Object.fromEntries(n.value.entries()),
1537
+ (N) => n.value[N] ?? null
1538
+ ), T = (N, A) => N.type === "single" ? A.map((E) => ({
1539
+ key: `${E.uuid}-single`,
1540
+ craftNode: {
1541
+ ...E,
1542
+ props: {
1543
+ ...E.props,
1544
+ ...N.item || {}
1545
+ }
1546
+ }
1547
+ })) : N.type === "list" ? N.list ? A.reduce((E, P) => E.concat(
1548
+ //@ts-ignore
1549
+ N.list.map((M, V) => ({
1550
+ key: `${P.uuid}-data-${V}`,
1551
+ craftNode: {
1552
+ ...P,
1553
+ props: {
1554
+ ...P.props,
1555
+ ...M || {}
1556
+ }
1557
+ }
1558
+ }))
1559
+ ), []) : [] : [];
1560
+ return (N, A) => (d(r).visible || d(r).visible === void 0) && d(i) && d(o) ? (m(), x(ce(d(a)), ge({
1561
+ key: 0,
1562
+ ref: "nodeRef"
1563
+ }, u.value, ke(d(C))), de({ _: 2 }, [
1564
+ $(v.value, (E) => ({
1565
+ name: E,
1566
+ fn: H(() => [
1567
+ h.value ? (m(), y(R, { key: 0 }, [
1568
+ c.value?.type ? (m(!0), y(R, { key: 1 }, $(g(f.value[E], E), (P) => (m(), x(we, {
1569
+ key: P.key,
1570
+ craftNode: P.craftNode,
1571
+ nodeMap: d(n),
1572
+ nodeDataMap: t.nodeDataMap,
1573
+ eventsContext: t.eventsContext
1574
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext"]))), 128)) : (m(!0), y(R, { key: 0 }, $(f.value[E], (P) => (m(), x(we, {
1575
+ key: P.uuid,
1576
+ craftNode: P,
1577
+ nodeMap: d(n),
1578
+ nodeDataMap: t.nodeDataMap,
1579
+ eventsContext: t.eventsContext
1580
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext"]))), 128))
1581
+ ], 64)) : k("", !0)
1489
1582
  ])
1490
1583
  }))
1491
- ]), 1040)) : x("", !0);
1584
+ ]), 1040)) : k("", !0);
1492
1585
  }
1493
- }), Er = /* @__PURE__ */ $({
1586
+ }), Dr = /* @__PURE__ */ I({
1494
1587
  name: "CraftStaticRenderer",
1495
1588
  __name: "CraftStaticRenderer",
1496
1589
  props: {
1497
1590
  nodes: {},
1498
1591
  resolverMap: {},
1592
+ resolver: {},
1499
1593
  nodeDataMap: {},
1500
1594
  eventsContext: {}
1501
1595
  },
1502
1596
  setup(t) {
1503
- const e = t, r = w(() => new ye(e.resolverMap));
1504
- return re("resolver", r), re("nodeDataMap", e.nodeDataMap || {}), re("eventsContext", e.eventsContext || {}), (n, s) => (v(!0), E(T, null, M(t.nodes, (o) => (v(), N(ve, {
1505
- key: o.uuid,
1506
- craftNode: o,
1597
+ const e = t, r = (s, i) => {
1598
+ i.set(s.uuid, s), Object.entries(s.slots).forEach(([a, u]) => {
1599
+ u?.forEach && u.forEach((c) => r(c, i));
1600
+ });
1601
+ }, n = b(() => {
1602
+ const s = /* @__PURE__ */ new Map();
1603
+ return e.nodes.forEach((i) => r(i, s)), s;
1604
+ }), o = b(
1605
+ () => e.resolver || new be(e.resolverMap)
1606
+ );
1607
+ return q("resolver", o), q("nodeDataMap", e.nodeDataMap || {}), q("eventsContext", e.eventsContext || {}), (s, i) => (m(!0), y(R, null, $(t.nodes, (a) => (m(), x(we, {
1608
+ key: a.uuid,
1609
+ craftNode: a,
1610
+ nodeMap: n.value,
1507
1611
  nodeDataMap: t.nodeDataMap,
1508
1612
  eventsContext: t.eventsContext
1509
- }, null, 8, ["craftNode", "nodeDataMap", "eventsContext"]))), 128));
1613
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext"]))), 128));
1510
1614
  }
1511
- }), Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1615
+ }), Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1512
1616
  __proto__: null,
1513
- CraftCanvas: vt,
1514
- CraftComponentSimpleText: Et,
1515
- CraftEditor: Ct,
1516
- CraftEditorBlueprint: wt,
1517
- CraftEditorBlueprintsList: At,
1518
- CraftEditorPanelBlueprints: $t,
1519
- CraftEditorPanelForm: Rt,
1520
- CraftEditorPanelLayers: Ut,
1521
- CraftEditorPanelLayout: Xt,
1522
- CraftEditorPanelNodeEventsSettings: qt,
1523
- CraftEditorPanelNodeLayer: Zt,
1524
- CraftEditorPanelNodeSettings: er,
1525
- CraftEditorPanelSettings: ir,
1526
- CraftFrame: cr,
1527
- CraftIframe: Qe,
1528
- CraftNodeEditor: br,
1529
- CraftNodeViewer: ve,
1530
- CraftStaticRenderer: Er,
1531
- Utils: _t
1532
- }, Symbol.toStringTag, { value: "Module" })), Vr = {
1617
+ CraftCanvas: Ot,
1618
+ CraftComponentSimpleText: At,
1619
+ CraftEditor: Pt,
1620
+ CraftEditorBlueprint: Mt,
1621
+ CraftEditorBlueprintsList: Bt,
1622
+ CraftEditorPanelBlueprints: Ht,
1623
+ CraftEditorPanelForm: Vt,
1624
+ CraftEditorPanelLayers: Yt,
1625
+ CraftEditorPanelLayout: tr,
1626
+ CraftEditorPanelNodeEventsSettings: nr,
1627
+ CraftEditorPanelNodeLayer: lr,
1628
+ CraftEditorPanelNodeSettings: cr,
1629
+ CraftEditorPanelSettings: mr,
1630
+ CraftFrame: Er,
1631
+ CraftIframe: Je,
1632
+ CraftNodeEditor: kr,
1633
+ CraftNodeViewer: Ne,
1634
+ CraftStaticRenderer: Dr,
1635
+ Utils: $t
1636
+ }, Symbol.toStringTag, { value: "Module" })), Zr = {
1533
1637
  metadata: {
1534
1638
  name: "default"
1535
1639
  },
@@ -1545,7 +1649,21 @@ Error:`,
1545
1649
  }
1546
1650
  }
1547
1651
  };
1548
- class Cr {
1652
+ function Jr() {
1653
+ const t = F(null);
1654
+ return { nodeEl: t, vNodeEl: {
1655
+ mounted(r) {
1656
+ t.value = r;
1657
+ },
1658
+ updated(r) {
1659
+ t.value = r;
1660
+ },
1661
+ unmounted() {
1662
+ t.value = null;
1663
+ }
1664
+ } };
1665
+ }
1666
+ class Ar {
1549
1667
  /**
1550
1668
  * @callback HookCallback
1551
1669
  * @this {*|Jsep} this
@@ -1566,11 +1684,11 @@ class Cr {
1566
1684
  */
1567
1685
  add(e, r, n) {
1568
1686
  if (typeof arguments[0] != "string")
1569
- for (let s in arguments[0])
1570
- this.add(s, arguments[0][s], arguments[1]);
1687
+ for (let o in arguments[0])
1688
+ this.add(o, arguments[0][o], arguments[1]);
1571
1689
  else
1572
- (Array.isArray(e) ? e : [e]).forEach(function(s) {
1573
- this[s] = this[s] || [], r && this[s][n ? "unshift" : "push"](r);
1690
+ (Array.isArray(e) ? e : [e]).forEach(function(o) {
1691
+ this[o] = this[o] || [], r && this[o][n ? "unshift" : "push"](r);
1574
1692
  }, this);
1575
1693
  }
1576
1694
  /**
@@ -1588,7 +1706,7 @@ class Cr {
1588
1706
  });
1589
1707
  }
1590
1708
  }
1591
- class wr {
1709
+ class Pr {
1592
1710
  constructor(e) {
1593
1711
  this.jsep = e, this.registered = {};
1594
1712
  }
@@ -1608,10 +1726,10 @@ class wr {
1608
1726
  register() {
1609
1727
  for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
1610
1728
  r[n] = arguments[n];
1611
- r.forEach((s) => {
1612
- if (typeof s != "object" || !s.name || !s.init)
1729
+ r.forEach((o) => {
1730
+ if (typeof o != "object" || !o.name || !o.init)
1613
1731
  throw new Error("Invalid JSEP plugin format");
1614
- this.registered[s.name] || (s.init(this.jsep), this.registered[s.name] = s);
1732
+ this.registered[o.name] || (o.init(this.jsep), this.registered[o.name] = o);
1615
1733
  });
1616
1734
  }
1617
1735
  }
@@ -1853,12 +1971,12 @@ class l {
1853
1971
  * @returns {jsep.Expression[]}
1854
1972
  */
1855
1973
  gobbleExpressions(e) {
1856
- let r = [], n, s;
1974
+ let r = [], n, o;
1857
1975
  for (; this.index < this.expr.length; )
1858
1976
  if (n = this.code, n === l.SEMCOL_CODE || n === l.COMMA_CODE)
1859
1977
  this.index++;
1860
- else if (s = this.gobbleExpression())
1861
- r.push(s);
1978
+ else if (o = this.gobbleExpression())
1979
+ r.push(o);
1862
1980
  else if (this.index < this.expr.length) {
1863
1981
  if (n === e)
1864
1982
  break;
@@ -1897,40 +2015,40 @@ class l {
1897
2015
  * @returns {?jsep.BinaryExpression}
1898
2016
  */
1899
2017
  gobbleBinaryExpression() {
1900
- let e, r, n, s, o, i, a, c, u;
2018
+ let e, r, n, o, s, i, a, u, c;
1901
2019
  if (i = this.gobbleToken(), !i || (r = this.gobbleBinaryOp(), !r))
1902
2020
  return i;
1903
- for (o = {
2021
+ for (s = {
1904
2022
  value: r,
1905
2023
  prec: l.binaryPrecedence(r),
1906
2024
  right_a: l.right_associative.has(r)
1907
- }, a = this.gobbleToken(), a || this.throwError("Expected expression after " + r), s = [i, o, a]; r = this.gobbleBinaryOp(); ) {
2025
+ }, a = this.gobbleToken(), a || this.throwError("Expected expression after " + r), o = [i, s, a]; r = this.gobbleBinaryOp(); ) {
1908
2026
  if (n = l.binaryPrecedence(r), n === 0) {
1909
2027
  this.index -= r.length;
1910
2028
  break;
1911
2029
  }
1912
- o = {
2030
+ s = {
1913
2031
  value: r,
1914
2032
  prec: n,
1915
2033
  right_a: l.right_associative.has(r)
1916
- }, u = r;
1917
- const d = (h) => o.right_a && h.right_a ? n > h.prec : n <= h.prec;
1918
- for (; s.length > 2 && d(s[s.length - 2]); )
1919
- a = s.pop(), r = s.pop().value, i = s.pop(), e = {
2034
+ }, c = r;
2035
+ const f = (p) => s.right_a && p.right_a ? n > p.prec : n <= p.prec;
2036
+ for (; o.length > 2 && f(o[o.length - 2]); )
2037
+ a = o.pop(), r = o.pop().value, i = o.pop(), e = {
1920
2038
  type: l.BINARY_EXP,
1921
2039
  operator: r,
1922
2040
  left: i,
1923
2041
  right: a
1924
- }, s.push(e);
1925
- e = this.gobbleToken(), e || this.throwError("Expected expression after " + u), s.push(o, e);
2042
+ }, o.push(e);
2043
+ e = this.gobbleToken(), e || this.throwError("Expected expression after " + c), o.push(s, e);
1926
2044
  }
1927
- for (c = s.length - 1, e = s[c]; c > 1; )
2045
+ for (u = o.length - 1, e = o[u]; u > 1; )
1928
2046
  e = {
1929
2047
  type: l.BINARY_EXP,
1930
- operator: s[c - 1].value,
1931
- left: s[c - 2],
2048
+ operator: o[u - 1].value,
2049
+ left: o[u - 2],
1932
2050
  right: e
1933
- }, c -= 2;
2051
+ }, u -= 2;
1934
2052
  return e;
1935
2053
  }
1936
2054
  /**
@@ -1939,38 +2057,38 @@ class l {
1939
2057
  * @returns {boolean|jsep.Expression}
1940
2058
  */
1941
2059
  gobbleToken() {
1942
- let e, r, n, s;
1943
- if (this.gobbleSpaces(), s = this.searchHook("gobble-token"), s)
1944
- return this.runHook("after-token", s);
2060
+ let e, r, n, o;
2061
+ if (this.gobbleSpaces(), o = this.searchHook("gobble-token"), o)
2062
+ return this.runHook("after-token", o);
1945
2063
  if (e = this.code, l.isDecimalDigit(e) || e === l.PERIOD_CODE)
1946
2064
  return this.gobbleNumericLiteral();
1947
2065
  if (e === l.SQUOTE_CODE || e === l.DQUOTE_CODE)
1948
- s = this.gobbleStringLiteral();
2066
+ o = this.gobbleStringLiteral();
1949
2067
  else if (e === l.OBRACK_CODE)
1950
- s = this.gobbleArray();
2068
+ o = this.gobbleArray();
1951
2069
  else {
1952
2070
  for (r = this.expr.substr(this.index, l.max_unop_len), n = r.length; n > 0; ) {
1953
2071
  if (l.unary_ops.hasOwnProperty(r) && (!l.isIdentifierStart(this.code) || this.index + r.length < this.expr.length && !l.isIdentifierPart(this.expr.charCodeAt(this.index + r.length)))) {
1954
2072
  this.index += n;
1955
- const o = this.gobbleToken();
1956
- return o || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
2073
+ const s = this.gobbleToken();
2074
+ return s || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
1957
2075
  type: l.UNARY_EXP,
1958
2076
  operator: r,
1959
- argument: o,
2077
+ argument: s,
1960
2078
  prefix: !0
1961
2079
  });
1962
2080
  }
1963
2081
  r = r.substr(0, --n);
1964
2082
  }
1965
- l.isIdentifierStart(e) ? (s = this.gobbleIdentifier(), l.literals.hasOwnProperty(s.name) ? s = {
2083
+ l.isIdentifierStart(e) ? (o = this.gobbleIdentifier(), l.literals.hasOwnProperty(o.name) ? o = {
1966
2084
  type: l.LITERAL,
1967
- value: l.literals[s.name],
1968
- raw: s.name
1969
- } : s.name === l.this_str && (s = {
2085
+ value: l.literals[o.name],
2086
+ raw: o.name
2087
+ } : o.name === l.this_str && (o = {
1970
2088
  type: l.THIS_EXP
1971
- })) : e === l.OPAREN_CODE && (s = this.gobbleGroup());
2089
+ })) : e === l.OPAREN_CODE && (o = this.gobbleGroup());
1972
2090
  }
1973
- return s ? (s = this.gobbleTokenProperty(s), this.runHook("after-token", s)) : this.runHook("after-token", !1);
2091
+ return o ? (o = this.gobbleTokenProperty(o), this.runHook("after-token", o)) : this.runHook("after-token", !1);
1974
2092
  }
1975
2093
  /**
1976
2094
  * Gobble properties of of identifiers/strings/arrays/groups.
@@ -2039,14 +2157,14 @@ class l {
2039
2157
  gobbleStringLiteral() {
2040
2158
  let e = "";
2041
2159
  const r = this.index, n = this.expr.charAt(this.index++);
2042
- let s = !1;
2160
+ let o = !1;
2043
2161
  for (; this.index < this.expr.length; ) {
2044
- let o = this.expr.charAt(this.index++);
2045
- if (o === n) {
2046
- s = !0;
2162
+ let s = this.expr.charAt(this.index++);
2163
+ if (s === n) {
2164
+ o = !0;
2047
2165
  break;
2048
- } else if (o === "\\")
2049
- switch (o = this.expr.charAt(this.index++), o) {
2166
+ } else if (s === "\\")
2167
+ switch (s = this.expr.charAt(this.index++), s) {
2050
2168
  case "n":
2051
2169
  e += `
2052
2170
  `;
@@ -2067,12 +2185,12 @@ class l {
2067
2185
  e += "\v";
2068
2186
  break;
2069
2187
  default:
2070
- e += o;
2188
+ e += s;
2071
2189
  }
2072
2190
  else
2073
- e += o;
2191
+ e += s;
2074
2192
  }
2075
- return s || this.throwError('Unclosed quote after "' + e + '"'), {
2193
+ return o || this.throwError('Unclosed quote after "' + e + '"'), {
2076
2194
  type: l.LITERAL,
2077
2195
  value: e,
2078
2196
  raw: this.expr.substring(r, this.index)
@@ -2105,22 +2223,22 @@ class l {
2105
2223
  */
2106
2224
  gobbleArguments(e) {
2107
2225
  const r = [];
2108
- let n = !1, s = 0;
2226
+ let n = !1, o = 0;
2109
2227
  for (; this.index < this.expr.length; ) {
2110
2228
  this.gobbleSpaces();
2111
- let o = this.code;
2112
- if (o === e) {
2113
- n = !0, this.index++, e === l.CPAREN_CODE && s && s >= r.length && this.throwError("Unexpected token " + String.fromCharCode(e));
2229
+ let s = this.code;
2230
+ if (s === e) {
2231
+ n = !0, this.index++, e === l.CPAREN_CODE && o && o >= r.length && this.throwError("Unexpected token " + String.fromCharCode(e));
2114
2232
  break;
2115
- } else if (o === l.COMMA_CODE) {
2116
- if (this.index++, s++, s !== r.length) {
2233
+ } else if (s === l.COMMA_CODE) {
2234
+ if (this.index++, o++, o !== r.length) {
2117
2235
  if (e === l.CPAREN_CODE)
2118
2236
  this.throwError("Unexpected token ,");
2119
2237
  else if (e === l.CBRACK_CODE)
2120
- for (let i = r.length; i < s; i++)
2238
+ for (let i = r.length; i < o; i++)
2121
2239
  r.push(null);
2122
2240
  }
2123
- } else if (r.length !== s && s !== 0)
2241
+ } else if (r.length !== o && o !== 0)
2124
2242
  this.throwError("Expected comma");
2125
2243
  else {
2126
2244
  const i = this.gobbleExpression();
@@ -2161,10 +2279,10 @@ class l {
2161
2279
  };
2162
2280
  }
2163
2281
  }
2164
- const _r = new Cr();
2282
+ const Mr = new Ar();
2165
2283
  Object.assign(l, {
2166
- hooks: _r,
2167
- plugins: new wr(l),
2284
+ hooks: Mr,
2285
+ plugins: new Pr(l),
2168
2286
  // Node Types
2169
2287
  // ----------
2170
2288
  // This is the full set of types that any JSEP node can be.
@@ -2260,28 +2378,28 @@ Object.assign(l, {
2260
2378
  });
2261
2379
  l.max_unop_len = l.getMaxKeyLen(l.unary_ops);
2262
2380
  l.max_binop_len = l.getMaxKeyLen(l.binary_ops);
2263
- const Y = (t) => new l(t).parse(), Or = Object.getOwnPropertyNames(class {
2381
+ const Q = (t) => new l(t).parse(), $r = Object.getOwnPropertyNames(class {
2264
2382
  });
2265
- Object.getOwnPropertyNames(l).filter((t) => !Or.includes(t) && Y[t] === void 0).forEach((t) => {
2266
- Y[t] = l[t];
2383
+ Object.getOwnPropertyNames(l).filter((t) => !$r.includes(t) && Q[t] === void 0).forEach((t) => {
2384
+ Q[t] = l[t];
2267
2385
  });
2268
- Y.Jsep = l;
2269
- const Nr = "ConditionalExpression";
2270
- var xr = {
2386
+ Q.Jsep = l;
2387
+ const Rr = "ConditionalExpression";
2388
+ var Ir = {
2271
2389
  name: "ternary",
2272
2390
  init(t) {
2273
2391
  t.hooks.add("after-expression", function(r) {
2274
2392
  if (r.node && this.code === t.QUMARK_CODE) {
2275
2393
  this.index++;
2276
- const n = r.node, s = this.gobbleExpression();
2277
- if (s || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === t.COLON_CODE) {
2394
+ const n = r.node, o = this.gobbleExpression();
2395
+ if (o || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === t.COLON_CODE) {
2278
2396
  this.index++;
2279
- const o = this.gobbleExpression();
2280
- if (o || this.throwError("Expected expression"), r.node = {
2281
- type: Nr,
2397
+ const s = this.gobbleExpression();
2398
+ if (s || this.throwError("Expected expression"), r.node = {
2399
+ type: Rr,
2282
2400
  test: n,
2283
- consequent: s,
2284
- alternate: o
2401
+ consequent: o,
2402
+ alternate: s
2285
2403
  }, n.operator && t.binary_ops[n.operator] <= 0.9) {
2286
2404
  let i = n;
2287
2405
  for (; i.right.operator && t.binary_ops[i.right.operator] <= 0.9; )
@@ -2294,31 +2412,31 @@ var xr = {
2294
2412
  });
2295
2413
  }
2296
2414
  };
2297
- Y.plugins.register(xr);
2298
- const Me = 47, Sr = 92;
2299
- var Ar = {
2415
+ Q.plugins.register(Ir);
2416
+ const Be = 47, Tr = 92;
2417
+ var Ur = {
2300
2418
  name: "regex",
2301
2419
  init(t) {
2302
2420
  t.hooks.add("gobble-token", function(r) {
2303
- if (this.code === Me) {
2421
+ if (this.code === Be) {
2304
2422
  const n = ++this.index;
2305
- let s = !1;
2423
+ let o = !1;
2306
2424
  for (; this.index < this.expr.length; ) {
2307
- if (this.code === Me && !s) {
2308
- const o = this.expr.slice(n, this.index);
2425
+ if (this.code === Be && !o) {
2426
+ const s = this.expr.slice(n, this.index);
2309
2427
  let i = "";
2310
2428
  for (; ++this.index < this.expr.length; ) {
2311
- const c = this.code;
2312
- if (c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57)
2429
+ const u = this.code;
2430
+ if (u >= 97 && u <= 122 || u >= 65 && u <= 90 || u >= 48 && u <= 57)
2313
2431
  i += this.char;
2314
2432
  else
2315
2433
  break;
2316
2434
  }
2317
2435
  let a;
2318
2436
  try {
2319
- a = new RegExp(o, i);
2320
- } catch (c) {
2321
- this.throwError(c.message);
2437
+ a = new RegExp(s, i);
2438
+ } catch (u) {
2439
+ this.throwError(u.message);
2322
2440
  }
2323
2441
  return r.node = {
2324
2442
  type: t.LITERAL,
@@ -2326,54 +2444,54 @@ var Ar = {
2326
2444
  raw: this.expr.slice(n - 1, this.index)
2327
2445
  }, r.node = this.gobbleTokenProperty(r.node), r.node;
2328
2446
  }
2329
- this.code === t.OBRACK_CODE ? s = !0 : s && this.code === t.CBRACK_CODE && (s = !1), this.index += this.code === Sr ? 2 : 1;
2447
+ this.code === t.OBRACK_CODE ? o = !0 : o && this.code === t.CBRACK_CODE && (o = !1), this.index += this.code === Tr ? 2 : 1;
2330
2448
  }
2331
2449
  this.throwError("Unclosed Regex");
2332
2450
  }
2333
2451
  });
2334
2452
  }
2335
2453
  };
2336
- const Ee = 43, Pr = 45, se = {
2454
+ const Ce = 43, Br = 45, re = {
2337
2455
  name: "assignment",
2338
2456
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
2339
- updateOperators: [Ee, Pr],
2457
+ updateOperators: [Ce, Br],
2340
2458
  assignmentPrecedence: 0.9,
2341
2459
  init(t) {
2342
2460
  const e = [t.IDENTIFIER, t.MEMBER_EXP];
2343
- se.assignmentOperators.forEach((n) => t.addBinaryOp(n, se.assignmentPrecedence, !0)), t.hooks.add("gobble-token", function(s) {
2344
- const o = this.code;
2345
- se.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, s.node = {
2461
+ re.assignmentOperators.forEach((n) => t.addBinaryOp(n, re.assignmentPrecedence, !0)), t.hooks.add("gobble-token", function(o) {
2462
+ const s = this.code;
2463
+ re.updateOperators.some((i) => i === s && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, o.node = {
2346
2464
  type: "UpdateExpression",
2347
- operator: o === Ee ? "++" : "--",
2465
+ operator: s === Ce ? "++" : "--",
2348
2466
  argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
2349
2467
  prefix: !0
2350
- }, (!s.node.argument || !e.includes(s.node.argument.type)) && this.throwError(`Unexpected ${s.node.operator}`));
2351
- }), t.hooks.add("after-token", function(s) {
2352
- if (s.node) {
2353
- const o = this.code;
2354
- se.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (e.includes(s.node.type) || this.throwError(`Unexpected ${s.node.operator}`), this.index += 2, s.node = {
2468
+ }, (!o.node.argument || !e.includes(o.node.argument.type)) && this.throwError(`Unexpected ${o.node.operator}`));
2469
+ }), t.hooks.add("after-token", function(o) {
2470
+ if (o.node) {
2471
+ const s = this.code;
2472
+ re.updateOperators.some((i) => i === s && i === this.expr.charCodeAt(this.index + 1)) && (e.includes(o.node.type) || this.throwError(`Unexpected ${o.node.operator}`), this.index += 2, o.node = {
2355
2473
  type: "UpdateExpression",
2356
- operator: o === Ee ? "++" : "--",
2357
- argument: s.node,
2474
+ operator: s === Ce ? "++" : "--",
2475
+ argument: o.node,
2358
2476
  prefix: !1
2359
2477
  });
2360
2478
  }
2361
- }), t.hooks.add("after-expression", function(s) {
2362
- s.node && r(s.node);
2479
+ }), t.hooks.add("after-expression", function(o) {
2480
+ o.node && r(o.node);
2363
2481
  });
2364
2482
  function r(n) {
2365
- se.assignmentOperators.has(n.operator) ? (n.type = "AssignmentExpression", r(n.left), r(n.right)) : n.operator || Object.values(n).forEach((s) => {
2366
- s && typeof s == "object" && r(s);
2483
+ re.assignmentOperators.has(n.operator) ? (n.type = "AssignmentExpression", r(n.left), r(n.right)) : n.operator || Object.values(n).forEach((o) => {
2484
+ o && typeof o == "object" && r(o);
2367
2485
  });
2368
2486
  }
2369
2487
  }
2370
2488
  };
2371
- Y.plugins.register(Ar, se);
2372
- Y.addUnaryOp("typeof");
2373
- Y.addUnaryOp("void");
2374
- Y.addLiteral("null", null);
2375
- Y.addLiteral("undefined", void 0);
2376
- const Dr = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), _ = {
2489
+ Q.plugins.register(Ur, re);
2490
+ Q.addUnaryOp("typeof");
2491
+ Q.addUnaryOp("void");
2492
+ Q.addLiteral("null", null);
2493
+ Q.addLiteral("undefined", void 0);
2494
+ const Lr = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), O = {
2377
2495
  /**
2378
2496
  * @param {jsep.Expression} ast
2379
2497
  * @param {Record<string, any>} subs
@@ -2382,67 +2500,67 @@ const Dr = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
2382
2500
  switch (t.type) {
2383
2501
  case "BinaryExpression":
2384
2502
  case "LogicalExpression":
2385
- return _.evalBinaryExpression(t, e);
2503
+ return O.evalBinaryExpression(t, e);
2386
2504
  case "Compound":
2387
- return _.evalCompound(t, e);
2505
+ return O.evalCompound(t, e);
2388
2506
  case "ConditionalExpression":
2389
- return _.evalConditionalExpression(t, e);
2507
+ return O.evalConditionalExpression(t, e);
2390
2508
  case "Identifier":
2391
- return _.evalIdentifier(t, e);
2509
+ return O.evalIdentifier(t, e);
2392
2510
  case "Literal":
2393
- return _.evalLiteral(t, e);
2511
+ return O.evalLiteral(t, e);
2394
2512
  case "MemberExpression":
2395
- return _.evalMemberExpression(t, e);
2513
+ return O.evalMemberExpression(t, e);
2396
2514
  case "UnaryExpression":
2397
- return _.evalUnaryExpression(t, e);
2515
+ return O.evalUnaryExpression(t, e);
2398
2516
  case "ArrayExpression":
2399
- return _.evalArrayExpression(t, e);
2517
+ return O.evalArrayExpression(t, e);
2400
2518
  case "CallExpression":
2401
- return _.evalCallExpression(t, e);
2519
+ return O.evalCallExpression(t, e);
2402
2520
  case "AssignmentExpression":
2403
- return _.evalAssignmentExpression(t, e);
2521
+ return O.evalAssignmentExpression(t, e);
2404
2522
  default:
2405
2523
  throw SyntaxError("Unexpected expression", t);
2406
2524
  }
2407
2525
  },
2408
2526
  evalBinaryExpression(t, e) {
2409
2527
  return {
2410
- "||": (n, s) => n || s(),
2411
- "&&": (n, s) => n && s(),
2412
- "|": (n, s) => n | s(),
2413
- "^": (n, s) => n ^ s(),
2414
- "&": (n, s) => n & s(),
2528
+ "||": (n, o) => n || o(),
2529
+ "&&": (n, o) => n && o(),
2530
+ "|": (n, o) => n | o(),
2531
+ "^": (n, o) => n ^ o(),
2532
+ "&": (n, o) => n & o(),
2415
2533
  // eslint-disable-next-line eqeqeq -- API
2416
- "==": (n, s) => n == s(),
2534
+ "==": (n, o) => n == o(),
2417
2535
  // eslint-disable-next-line eqeqeq -- API
2418
- "!=": (n, s) => n != s(),
2419
- "===": (n, s) => n === s(),
2420
- "!==": (n, s) => n !== s(),
2421
- "<": (n, s) => n < s(),
2422
- ">": (n, s) => n > s(),
2423
- "<=": (n, s) => n <= s(),
2424
- ">=": (n, s) => n >= s(),
2425
- "<<": (n, s) => n << s(),
2426
- ">>": (n, s) => n >> s(),
2427
- ">>>": (n, s) => n >>> s(),
2428
- "+": (n, s) => n + s(),
2429
- "-": (n, s) => n - s(),
2430
- "*": (n, s) => n * s(),
2431
- "/": (n, s) => n / s(),
2432
- "%": (n, s) => n % s()
2433
- }[t.operator](_.evalAst(t.left, e), () => _.evalAst(t.right, e));
2536
+ "!=": (n, o) => n != o(),
2537
+ "===": (n, o) => n === o(),
2538
+ "!==": (n, o) => n !== o(),
2539
+ "<": (n, o) => n < o(),
2540
+ ">": (n, o) => n > o(),
2541
+ "<=": (n, o) => n <= o(),
2542
+ ">=": (n, o) => n >= o(),
2543
+ "<<": (n, o) => n << o(),
2544
+ ">>": (n, o) => n >> o(),
2545
+ ">>>": (n, o) => n >>> o(),
2546
+ "+": (n, o) => n + o(),
2547
+ "-": (n, o) => n - o(),
2548
+ "*": (n, o) => n * o(),
2549
+ "/": (n, o) => n / o(),
2550
+ "%": (n, o) => n % o()
2551
+ }[t.operator](O.evalAst(t.left, e), () => O.evalAst(t.right, e));
2434
2552
  },
2435
2553
  evalCompound(t, e) {
2436
2554
  let r;
2437
2555
  for (let n = 0; n < t.body.length; n++) {
2438
2556
  t.body[n].type === "Identifier" && ["var", "let", "const"].includes(t.body[n].name) && t.body[n + 1] && t.body[n + 1].type === "AssignmentExpression" && (n += 1);
2439
- const s = t.body[n];
2440
- r = _.evalAst(s, e);
2557
+ const o = t.body[n];
2558
+ r = O.evalAst(o, e);
2441
2559
  }
2442
2560
  return r;
2443
2561
  },
2444
2562
  evalConditionalExpression(t, e) {
2445
- return _.evalAst(t.test, e) ? _.evalAst(t.consequent, e) : _.evalAst(t.alternate, e);
2563
+ return O.evalAst(t.test, e) ? O.evalAst(t.consequent, e) : O.evalAst(t.alternate, e);
2446
2564
  },
2447
2565
  evalIdentifier(t, e) {
2448
2566
  if (Object.hasOwn(e, t.name))
@@ -2457,33 +2575,33 @@ const Dr = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
2457
2575
  // NOTE: `String(value)` throws error when
2458
2576
  // value has overwritten the toString method to return non-string
2459
2577
  // i.e. `value = {toString: () => []}`
2460
- t.computed ? _.evalAst(t.property) : t.property.name
2578
+ t.computed ? O.evalAst(t.property) : t.property.name
2461
2579
  // `object.property` property is Identifier
2462
- ), n = _.evalAst(t.object, e);
2580
+ ), n = O.evalAst(t.object, e);
2463
2581
  if (n == null)
2464
2582
  throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);
2465
- if (!Object.hasOwn(n, r) && Dr.has(r))
2583
+ if (!Object.hasOwn(n, r) && Lr.has(r))
2466
2584
  throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);
2467
- const s = n[r];
2468
- return typeof s == "function" ? s.bind(n) : s;
2585
+ const o = n[r];
2586
+ return typeof o == "function" ? o.bind(n) : o;
2469
2587
  },
2470
2588
  evalUnaryExpression(t, e) {
2471
2589
  return {
2472
- "-": (n) => -_.evalAst(n, e),
2473
- "!": (n) => !_.evalAst(n, e),
2474
- "~": (n) => ~_.evalAst(n, e),
2590
+ "-": (n) => -O.evalAst(n, e),
2591
+ "!": (n) => !O.evalAst(n, e),
2592
+ "~": (n) => ~O.evalAst(n, e),
2475
2593
  // eslint-disable-next-line no-implicit-coercion -- API
2476
- "+": (n) => +_.evalAst(n, e),
2477
- typeof: (n) => typeof _.evalAst(n, e),
2594
+ "+": (n) => +O.evalAst(n, e),
2595
+ typeof: (n) => typeof O.evalAst(n, e),
2478
2596
  // eslint-disable-next-line no-void, sonarjs/void-use -- feature
2479
- void: (n) => void _.evalAst(n, e)
2597
+ void: (n) => void O.evalAst(n, e)
2480
2598
  }[t.operator](t.argument);
2481
2599
  },
2482
2600
  evalArrayExpression(t, e) {
2483
- return t.elements.map((r) => _.evalAst(r, e));
2601
+ return t.elements.map((r) => O.evalAst(r, e));
2484
2602
  },
2485
2603
  evalCallExpression(t, e) {
2486
- const r = t.arguments.map((s) => _.evalAst(s, e)), n = _.evalAst(t.callee, e);
2604
+ const r = t.arguments.map((o) => O.evalAst(o, e)), n = O.evalAst(t.callee, e);
2487
2605
  if (n === Function)
2488
2606
  throw new Error("Function constructor is disabled");
2489
2607
  return n(...r);
@@ -2491,16 +2609,16 @@ const Dr = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
2491
2609
  evalAssignmentExpression(t, e) {
2492
2610
  if (t.left.type !== "Identifier")
2493
2611
  throw SyntaxError("Invalid left-hand side in assignment");
2494
- const r = t.left.name, n = _.evalAst(t.right, e);
2612
+ const r = t.left.name, n = O.evalAst(t.right, e);
2495
2613
  return e[r] = n, e[r];
2496
2614
  }
2497
2615
  };
2498
- class kr {
2616
+ class jr {
2499
2617
  /**
2500
2618
  * @param {string} expr Expression to evaluate
2501
2619
  */
2502
2620
  constructor(e) {
2503
- this.code = e, this.ast = Y(this.code);
2621
+ this.code = e, this.ast = Q(this.code);
2504
2622
  }
2505
2623
  /**
2506
2624
  * @param {object} context Object whose items will be added
@@ -2509,16 +2627,16 @@ class kr {
2509
2627
  */
2510
2628
  runInNewContext(e) {
2511
2629
  const r = Object.assign(/* @__PURE__ */ Object.create(null), e);
2512
- return _.evalAst(this.ast, r);
2630
+ return O.evalAst(this.ast, r);
2513
2631
  }
2514
2632
  }
2515
- function ee(t, e) {
2633
+ function Z(t, e) {
2516
2634
  return t = t.slice(), t.push(e), t;
2517
2635
  }
2518
- function we(t, e) {
2636
+ function Oe(t, e) {
2519
2637
  return e = e.slice(), e.unshift(t), e;
2520
2638
  }
2521
- class $r extends Error {
2639
+ class Fr extends Error {
2522
2640
  /**
2523
2641
  * @param {AnyResult} value The evaluated scalar value
2524
2642
  */
@@ -2526,32 +2644,32 @@ class $r extends Error {
2526
2644
  super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError";
2527
2645
  }
2528
2646
  }
2529
- function C(t, e, r, n, s) {
2530
- if (!(this instanceof C))
2647
+ function _(t, e, r, n, o) {
2648
+ if (!(this instanceof _))
2531
2649
  try {
2532
- return new C(t, e, r, n, s);
2650
+ return new _(t, e, r, n, o);
2533
2651
  } catch (i) {
2534
2652
  if (!i.avoidNew)
2535
2653
  throw i;
2536
2654
  return i.value;
2537
2655
  }
2538
- typeof t == "string" && (s = n, n = r, r = e, e = t, t = null);
2539
- const o = t && typeof t == "object";
2540
- if (t = t || {}, this.json = t.json || r, this.path = t.path || e, this.resultType = t.resultType || "value", this.flatten = t.flatten || !1, this.wrap = Object.hasOwn(t, "wrap") ? t.wrap : !0, this.sandbox = t.sandbox || {}, this.eval = t.eval === void 0 ? "safe" : t.eval, this.ignoreEvalErrors = typeof t.ignoreEvalErrors > "u" ? !1 : t.ignoreEvalErrors, this.parent = t.parent || null, this.parentProperty = t.parentProperty || null, this.callback = t.callback || n || null, this.otherTypeCallback = t.otherTypeCallback || s || function() {
2656
+ typeof t == "string" && (o = n, n = r, r = e, e = t, t = null);
2657
+ const s = t && typeof t == "object";
2658
+ if (t = t || {}, this.json = t.json || r, this.path = t.path || e, this.resultType = t.resultType || "value", this.flatten = t.flatten || !1, this.wrap = Object.hasOwn(t, "wrap") ? t.wrap : !0, this.sandbox = t.sandbox || {}, this.eval = t.eval === void 0 ? "safe" : t.eval, this.ignoreEvalErrors = typeof t.ignoreEvalErrors > "u" ? !1 : t.ignoreEvalErrors, this.parent = t.parent || null, this.parentProperty = t.parentProperty || null, this.callback = t.callback || n || null, this.otherTypeCallback = t.otherTypeCallback || o || function() {
2541
2659
  throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.");
2542
2660
  }, t.autostart !== !1) {
2543
2661
  const i = {
2544
- path: o ? t.path : e
2662
+ path: s ? t.path : e
2545
2663
  };
2546
- o ? "json" in t && (i.json = t.json) : i.json = r;
2664
+ s ? "json" in t && (i.json = t.json) : i.json = r;
2547
2665
  const a = this.evaluate(i);
2548
2666
  if (!a || typeof a != "object")
2549
- throw new $r(a);
2667
+ throw new Fr(a);
2550
2668
  return a;
2551
2669
  }
2552
2670
  }
2553
- C.prototype.evaluate = function(t, e, r, n) {
2554
- let s = this.parent, o = this.parentProperty, {
2671
+ _.prototype.evaluate = function(t, e, r, n) {
2672
+ let o = this.parent, s = this.parentProperty, {
2555
2673
  flatten: i,
2556
2674
  wrap: a
2557
2675
  } = this;
@@ -2562,174 +2680,174 @@ C.prototype.evaluate = function(t, e, r, n) {
2562
2680
  throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');
2563
2681
  ({
2564
2682
  json: e
2565
- } = t), i = Object.hasOwn(t, "flatten") ? t.flatten : i, this.currResultType = Object.hasOwn(t, "resultType") ? t.resultType : this.currResultType, this.currSandbox = Object.hasOwn(t, "sandbox") ? t.sandbox : this.currSandbox, a = Object.hasOwn(t, "wrap") ? t.wrap : a, this.currEval = Object.hasOwn(t, "eval") ? t.eval : this.currEval, r = Object.hasOwn(t, "callback") ? t.callback : r, this.currOtherTypeCallback = Object.hasOwn(t, "otherTypeCallback") ? t.otherTypeCallback : this.currOtherTypeCallback, s = Object.hasOwn(t, "parent") ? t.parent : s, o = Object.hasOwn(t, "parentProperty") ? t.parentProperty : o, t = t.path;
2683
+ } = t), i = Object.hasOwn(t, "flatten") ? t.flatten : i, this.currResultType = Object.hasOwn(t, "resultType") ? t.resultType : this.currResultType, this.currSandbox = Object.hasOwn(t, "sandbox") ? t.sandbox : this.currSandbox, a = Object.hasOwn(t, "wrap") ? t.wrap : a, this.currEval = Object.hasOwn(t, "eval") ? t.eval : this.currEval, r = Object.hasOwn(t, "callback") ? t.callback : r, this.currOtherTypeCallback = Object.hasOwn(t, "otherTypeCallback") ? t.otherTypeCallback : this.currOtherTypeCallback, o = Object.hasOwn(t, "parent") ? t.parent : o, s = Object.hasOwn(t, "parentProperty") ? t.parentProperty : s, t = t.path;
2566
2684
  }
2567
- if (s = s || null, o = o || null, Array.isArray(t) && (t = C.toPathString(t)), !t && t !== "" || !e)
2685
+ if (o = o || null, s = s || null, Array.isArray(t) && (t = _.toPathString(t)), !t && t !== "" || !e)
2568
2686
  return;
2569
- const c = C.toPathArray(t);
2570
- c[0] === "$" && c.length > 1 && c.shift(), this._hasParentSelector = null;
2571
- const u = this._trace(c, e, ["$"], s, o, r).filter(function(d) {
2572
- return d && !d.isParentSelector;
2687
+ const u = _.toPathArray(t);
2688
+ u[0] === "$" && u.length > 1 && u.shift(), this._hasParentSelector = null;
2689
+ const c = this._trace(u, e, ["$"], o, s, r).filter(function(f) {
2690
+ return f && !f.isParentSelector;
2573
2691
  });
2574
- return u.length ? !a && u.length === 1 && !u[0].hasArrExpr ? this._getPreferredOutput(u[0]) : u.reduce((d, h) => {
2575
- const m = this._getPreferredOutput(h);
2576
- return i && Array.isArray(m) ? d = d.concat(m) : d.push(m), d;
2692
+ return c.length ? !a && c.length === 1 && !c[0].hasArrExpr ? this._getPreferredOutput(c[0]) : c.reduce((f, p) => {
2693
+ const v = this._getPreferredOutput(p);
2694
+ return i && Array.isArray(v) ? f = f.concat(v) : f.push(v), f;
2577
2695
  }, []) : a ? [] : void 0;
2578
2696
  };
2579
- C.prototype._getPreferredOutput = function(t) {
2697
+ _.prototype._getPreferredOutput = function(t) {
2580
2698
  const e = this.currResultType;
2581
2699
  switch (e) {
2582
2700
  case "all": {
2583
- const r = Array.isArray(t.path) ? t.path : C.toPathArray(t.path);
2584
- return t.pointer = C.toPointer(r), t.path = typeof t.path == "string" ? t.path : C.toPathString(t.path), t;
2701
+ const r = Array.isArray(t.path) ? t.path : _.toPathArray(t.path);
2702
+ return t.pointer = _.toPointer(r), t.path = typeof t.path == "string" ? t.path : _.toPathString(t.path), t;
2585
2703
  }
2586
2704
  case "value":
2587
2705
  case "parent":
2588
2706
  case "parentProperty":
2589
2707
  return t[e];
2590
2708
  case "path":
2591
- return C.toPathString(t[e]);
2709
+ return _.toPathString(t[e]);
2592
2710
  case "pointer":
2593
- return C.toPointer(t.path);
2711
+ return _.toPointer(t.path);
2594
2712
  default:
2595
2713
  throw new TypeError("Unknown result type");
2596
2714
  }
2597
2715
  };
2598
- C.prototype._handleCallback = function(t, e, r) {
2716
+ _.prototype._handleCallback = function(t, e, r) {
2599
2717
  if (e) {
2600
2718
  const n = this._getPreferredOutput(t);
2601
- t.path = typeof t.path == "string" ? t.path : C.toPathString(t.path), e(n, r, t);
2719
+ t.path = typeof t.path == "string" ? t.path : _.toPathString(t.path), e(n, r, t);
2602
2720
  }
2603
2721
  };
2604
- C.prototype._trace = function(t, e, r, n, s, o, i, a) {
2605
- let c;
2722
+ _.prototype._trace = function(t, e, r, n, o, s, i, a) {
2723
+ let u;
2606
2724
  if (!t.length)
2607
- return c = {
2725
+ return u = {
2608
2726
  path: r,
2609
2727
  value: e,
2610
2728
  parent: n,
2611
- parentProperty: s,
2729
+ parentProperty: o,
2612
2730
  hasArrExpr: i
2613
- }, this._handleCallback(c, o, "value"), c;
2614
- const u = t[0], d = t.slice(1), h = [];
2615
- function m(p) {
2616
- Array.isArray(p) ? p.forEach((b) => {
2617
- h.push(b);
2618
- }) : h.push(p);
2619
- }
2620
- if ((typeof u != "string" || a) && e && Object.hasOwn(e, u))
2621
- m(this._trace(d, e[u], ee(r, u), e, u, o, i));
2622
- else if (u === "*")
2623
- this._walk(e, (p) => {
2624
- m(this._trace(d, e[p], ee(r, p), e, p, o, !0, !0));
2731
+ }, this._handleCallback(u, s, "value"), u;
2732
+ const c = t[0], f = t.slice(1), p = [];
2733
+ function v(h) {
2734
+ Array.isArray(h) ? h.forEach((g) => {
2735
+ p.push(g);
2736
+ }) : p.push(h);
2737
+ }
2738
+ if ((typeof c != "string" || a) && e && Object.hasOwn(e, c))
2739
+ v(this._trace(f, e[c], Z(r, c), e, c, s, i));
2740
+ else if (c === "*")
2741
+ this._walk(e, (h) => {
2742
+ v(this._trace(f, e[h], Z(r, h), e, h, s, !0, !0));
2625
2743
  });
2626
- else if (u === "..")
2627
- m(this._trace(d, e, r, n, s, o, i)), this._walk(e, (p) => {
2628
- typeof e[p] == "object" && m(this._trace(t.slice(), e[p], ee(r, p), e, p, o, !0));
2744
+ else if (c === "..")
2745
+ v(this._trace(f, e, r, n, o, s, i)), this._walk(e, (h) => {
2746
+ typeof e[h] == "object" && v(this._trace(t.slice(), e[h], Z(r, h), e, h, s, !0));
2629
2747
  });
2630
2748
  else {
2631
- if (u === "^")
2749
+ if (c === "^")
2632
2750
  return this._hasParentSelector = !0, {
2633
2751
  path: r.slice(0, -1),
2634
- expr: d,
2752
+ expr: f,
2635
2753
  isParentSelector: !0
2636
2754
  };
2637
- if (u === "~")
2638
- return c = {
2639
- path: ee(r, u),
2640
- value: s,
2755
+ if (c === "~")
2756
+ return u = {
2757
+ path: Z(r, c),
2758
+ value: o,
2641
2759
  parent: n,
2642
2760
  parentProperty: null
2643
- }, this._handleCallback(c, o, "property"), c;
2644
- if (u === "$")
2645
- m(this._trace(d, e, r, null, null, o, i));
2646
- else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(u))
2647
- m(this._slice(u, d, e, r, n, s, o));
2648
- else if (u.indexOf("?(") === 0) {
2761
+ }, this._handleCallback(u, s, "property"), u;
2762
+ if (c === "$")
2763
+ v(this._trace(f, e, r, null, null, s, i));
2764
+ else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))
2765
+ v(this._slice(c, f, e, r, n, o, s));
2766
+ else if (c.indexOf("?(") === 0) {
2649
2767
  if (this.currEval === !1)
2650
2768
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
2651
- const p = u.replace(/^\?\((.*?)\)$/u, "$1"), b = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(p);
2652
- b ? this._walk(e, (g) => {
2653
- const D = [b[2]], F = b[1] ? e[g][b[1]] : e[g];
2654
- this._trace(D, F, r, n, s, o, !0).length > 0 && m(this._trace(d, e[g], ee(r, g), e, g, o, !0));
2655
- }) : this._walk(e, (g) => {
2656
- this._eval(p, e[g], g, r, n, s) && m(this._trace(d, e[g], ee(r, g), e, g, o, !0));
2769
+ const h = c.replace(/^\?\((.*?)\)$/u, "$1"), g = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);
2770
+ g ? this._walk(e, (C) => {
2771
+ const T = [g[2]], N = g[1] ? e[C][g[1]] : e[C];
2772
+ this._trace(T, N, r, n, o, s, !0).length > 0 && v(this._trace(f, e[C], Z(r, C), e, C, s, !0));
2773
+ }) : this._walk(e, (C) => {
2774
+ this._eval(h, e[C], C, r, n, o) && v(this._trace(f, e[C], Z(r, C), e, C, s, !0));
2657
2775
  });
2658
- } else if (u[0] === "(") {
2776
+ } else if (c[0] === "(") {
2659
2777
  if (this.currEval === !1)
2660
2778
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
2661
- m(this._trace(we(this._eval(u, e, r.at(-1), r.slice(0, -1), n, s), d), e, r, n, s, o, i));
2662
- } else if (u[0] === "@") {
2663
- let p = !1;
2664
- const b = u.slice(1, -2);
2665
- switch (b) {
2779
+ v(this._trace(Oe(this._eval(c, e, r.at(-1), r.slice(0, -1), n, o), f), e, r, n, o, s, i));
2780
+ } else if (c[0] === "@") {
2781
+ let h = !1;
2782
+ const g = c.slice(1, -2);
2783
+ switch (g) {
2666
2784
  case "scalar":
2667
- (!e || !["object", "function"].includes(typeof e)) && (p = !0);
2785
+ (!e || !["object", "function"].includes(typeof e)) && (h = !0);
2668
2786
  break;
2669
2787
  case "boolean":
2670
2788
  case "string":
2671
2789
  case "undefined":
2672
2790
  case "function":
2673
- typeof e === b && (p = !0);
2791
+ typeof e === g && (h = !0);
2674
2792
  break;
2675
2793
  case "integer":
2676
- Number.isFinite(e) && !(e % 1) && (p = !0);
2794
+ Number.isFinite(e) && !(e % 1) && (h = !0);
2677
2795
  break;
2678
2796
  case "number":
2679
- Number.isFinite(e) && (p = !0);
2797
+ Number.isFinite(e) && (h = !0);
2680
2798
  break;
2681
2799
  case "nonFinite":
2682
- typeof e == "number" && !Number.isFinite(e) && (p = !0);
2800
+ typeof e == "number" && !Number.isFinite(e) && (h = !0);
2683
2801
  break;
2684
2802
  case "object":
2685
- e && typeof e === b && (p = !0);
2803
+ e && typeof e === g && (h = !0);
2686
2804
  break;
2687
2805
  case "array":
2688
- Array.isArray(e) && (p = !0);
2806
+ Array.isArray(e) && (h = !0);
2689
2807
  break;
2690
2808
  case "other":
2691
- p = this.currOtherTypeCallback(e, r, n, s);
2809
+ h = this.currOtherTypeCallback(e, r, n, o);
2692
2810
  break;
2693
2811
  case "null":
2694
- e === null && (p = !0);
2812
+ e === null && (h = !0);
2695
2813
  break;
2696
2814
  /* c8 ignore next 2 */
2697
2815
  default:
2698
- throw new TypeError("Unknown value type " + b);
2816
+ throw new TypeError("Unknown value type " + g);
2699
2817
  }
2700
- if (p)
2701
- return c = {
2818
+ if (h)
2819
+ return u = {
2702
2820
  path: r,
2703
2821
  value: e,
2704
2822
  parent: n,
2705
- parentProperty: s
2706
- }, this._handleCallback(c, o, "value"), c;
2707
- } else if (u[0] === "`" && e && Object.hasOwn(e, u.slice(1))) {
2708
- const p = u.slice(1);
2709
- m(this._trace(d, e[p], ee(r, p), e, p, o, i, !0));
2710
- } else if (u.includes(",")) {
2711
- const p = u.split(",");
2712
- for (const b of p)
2713
- m(this._trace(we(b, d), e, r, n, s, o, !0));
2714
- } else !a && e && Object.hasOwn(e, u) && m(this._trace(d, e[u], ee(r, u), e, u, o, i, !0));
2823
+ parentProperty: o
2824
+ }, this._handleCallback(u, s, "value"), u;
2825
+ } else if (c[0] === "`" && e && Object.hasOwn(e, c.slice(1))) {
2826
+ const h = c.slice(1);
2827
+ v(this._trace(f, e[h], Z(r, h), e, h, s, i, !0));
2828
+ } else if (c.includes(",")) {
2829
+ const h = c.split(",");
2830
+ for (const g of h)
2831
+ v(this._trace(Oe(g, f), e, r, n, o, s, !0));
2832
+ } else !a && e && Object.hasOwn(e, c) && v(this._trace(f, e[c], Z(r, c), e, c, s, i, !0));
2715
2833
  }
2716
2834
  if (this._hasParentSelector)
2717
- for (let p = 0; p < h.length; p++) {
2718
- const b = h[p];
2719
- if (b && b.isParentSelector) {
2720
- const g = this._trace(b.expr, e, b.path, n, s, o, i);
2721
- if (Array.isArray(g)) {
2722
- h[p] = g[0];
2723
- const D = g.length;
2724
- for (let F = 1; F < D; F++)
2725
- p++, h.splice(p, 0, g[F]);
2835
+ for (let h = 0; h < p.length; h++) {
2836
+ const g = p[h];
2837
+ if (g && g.isParentSelector) {
2838
+ const C = this._trace(g.expr, e, g.path, n, o, s, i);
2839
+ if (Array.isArray(C)) {
2840
+ p[h] = C[0];
2841
+ const T = C.length;
2842
+ for (let N = 1; N < T; N++)
2843
+ h++, p.splice(h, 0, C[N]);
2726
2844
  } else
2727
- h[p] = g;
2845
+ p[h] = C;
2728
2846
  }
2729
2847
  }
2730
- return h;
2848
+ return p;
2731
2849
  };
2732
- C.prototype._walk = function(t, e) {
2850
+ _.prototype._walk = function(t, e) {
2733
2851
  if (Array.isArray(t)) {
2734
2852
  const r = t.length;
2735
2853
  for (let n = 0; n < r; n++)
@@ -2738,92 +2856,92 @@ C.prototype._walk = function(t, e) {
2738
2856
  e(r);
2739
2857
  });
2740
2858
  };
2741
- C.prototype._slice = function(t, e, r, n, s, o, i) {
2859
+ _.prototype._slice = function(t, e, r, n, o, s, i) {
2742
2860
  if (!Array.isArray(r))
2743
2861
  return;
2744
- const a = r.length, c = t.split(":"), u = c[2] && Number.parseInt(c[2]) || 1;
2745
- let d = c[0] && Number.parseInt(c[0]) || 0, h = c[1] && Number.parseInt(c[1]) || a;
2746
- d = d < 0 ? Math.max(0, d + a) : Math.min(a, d), h = h < 0 ? Math.max(0, h + a) : Math.min(a, h);
2747
- const m = [];
2748
- for (let p = d; p < h; p += u)
2749
- this._trace(we(p, e), r, n, s, o, i, !0).forEach((g) => {
2750
- m.push(g);
2862
+ const a = r.length, u = t.split(":"), c = u[2] && Number.parseInt(u[2]) || 1;
2863
+ let f = u[0] && Number.parseInt(u[0]) || 0, p = u[1] && Number.parseInt(u[1]) || a;
2864
+ f = f < 0 ? Math.max(0, f + a) : Math.min(a, f), p = p < 0 ? Math.max(0, p + a) : Math.min(a, p);
2865
+ const v = [];
2866
+ for (let h = f; h < p; h += c)
2867
+ this._trace(Oe(h, e), r, n, o, s, i, !0).forEach((C) => {
2868
+ v.push(C);
2751
2869
  });
2752
- return m;
2870
+ return v;
2753
2871
  };
2754
- C.prototype._eval = function(t, e, r, n, s, o) {
2755
- this.currSandbox._$_parentProperty = o, this.currSandbox._$_parent = s, this.currSandbox._$_property = r, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
2872
+ _.prototype._eval = function(t, e, r, n, o, s) {
2873
+ this.currSandbox._$_parentProperty = s, this.currSandbox._$_parent = o, this.currSandbox._$_property = r, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
2756
2874
  const i = t.includes("@path");
2757
- i && (this.currSandbox._$_path = C.toPathString(n.concat([r])));
2875
+ i && (this.currSandbox._$_path = _.toPathString(n.concat([r])));
2758
2876
  const a = this.currEval + "Script:" + t;
2759
- if (!C.cache[a]) {
2760
- let c = t.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
2761
- if (i && (c = c.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
2762
- C.cache[a] = new this.safeVm.Script(c);
2877
+ if (!_.cache[a]) {
2878
+ let u = t.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
2879
+ if (i && (u = u.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
2880
+ _.cache[a] = new this.safeVm.Script(u);
2763
2881
  else if (this.currEval === "native")
2764
- C.cache[a] = new this.vm.Script(c);
2882
+ _.cache[a] = new this.vm.Script(u);
2765
2883
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
2766
- const u = this.currEval;
2767
- C.cache[a] = new u(c);
2884
+ const c = this.currEval;
2885
+ _.cache[a] = new c(u);
2768
2886
  } else if (typeof this.currEval == "function")
2769
- C.cache[a] = {
2770
- runInNewContext: (u) => this.currEval(c, u)
2887
+ _.cache[a] = {
2888
+ runInNewContext: (c) => this.currEval(u, c)
2771
2889
  };
2772
2890
  else
2773
2891
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
2774
2892
  }
2775
2893
  try {
2776
- return C.cache[a].runInNewContext(this.currSandbox);
2777
- } catch (c) {
2894
+ return _.cache[a].runInNewContext(this.currSandbox);
2895
+ } catch (u) {
2778
2896
  if (this.ignoreEvalErrors)
2779
2897
  return !1;
2780
- throw new Error("jsonPath: " + c.message + ": " + t);
2898
+ throw new Error("jsonPath: " + u.message + ": " + t);
2781
2899
  }
2782
2900
  };
2783
- C.cache = {};
2784
- C.toPathString = function(t) {
2901
+ _.cache = {};
2902
+ _.toPathString = function(t) {
2785
2903
  const e = t, r = e.length;
2786
2904
  let n = "$";
2787
- for (let s = 1; s < r; s++)
2788
- /^(~|\^|@.*?\(\))$/u.test(e[s]) || (n += /^[0-9*]+$/u.test(e[s]) ? "[" + e[s] + "]" : "['" + e[s] + "']");
2905
+ for (let o = 1; o < r; o++)
2906
+ /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += /^[0-9*]+$/u.test(e[o]) ? "[" + e[o] + "]" : "['" + e[o] + "']");
2789
2907
  return n;
2790
2908
  };
2791
- C.toPointer = function(t) {
2909
+ _.toPointer = function(t) {
2792
2910
  const e = t, r = e.length;
2793
2911
  let n = "";
2794
- for (let s = 1; s < r; s++)
2795
- /^(~|\^|@.*?\(\))$/u.test(e[s]) || (n += "/" + e[s].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
2912
+ for (let o = 1; o < r; o++)
2913
+ /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += "/" + e[o].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
2796
2914
  return n;
2797
2915
  };
2798
- C.toPathArray = function(t) {
2916
+ _.toPathArray = function(t) {
2799
2917
  const {
2800
2918
  cache: e
2801
- } = C;
2919
+ } = _;
2802
2920
  if (e[t])
2803
2921
  return e[t].concat();
2804
- const r = [], s = t.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(o, i) {
2922
+ const r = [], o = t.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(s, i) {
2805
2923
  return "[#" + (r.push(i) - 1) + "]";
2806
- }).replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function(o, i) {
2924
+ }).replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function(s, i) {
2807
2925
  return "['" + i.replaceAll(".", "%@%").replaceAll("~", "%%@@%%") + "']";
2808
- }).replaceAll("~", ";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ";").replaceAll("%@%", ".").replaceAll("%%@@%%", "~").replaceAll(/(?:;)?(\^+)(?:;)?/gu, function(o, i) {
2926
+ }).replaceAll("~", ";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ";").replaceAll("%@%", ".").replaceAll("%%@@%%", "~").replaceAll(/(?:;)?(\^+)(?:;)?/gu, function(s, i) {
2809
2927
  return ";" + i.split("").join(";") + ";";
2810
- }).replaceAll(/;;;|;;/gu, ";..;").replaceAll(/;$|'?\]|'$/gu, "").split(";").map(function(o) {
2811
- const i = o.match(/#(\d+)/u);
2812
- return !i || !i[1] ? o : r[i[1]];
2928
+ }).replaceAll(/;;;|;;/gu, ";..;").replaceAll(/;$|'?\]|'$/gu, "").split(";").map(function(s) {
2929
+ const i = s.match(/#(\d+)/u);
2930
+ return !i || !i[1] ? s : r[i[1]];
2813
2931
  });
2814
- return e[t] = s, e[t].concat();
2932
+ return e[t] = o, e[t].concat();
2815
2933
  };
2816
- C.prototype.safeVm = {
2817
- Script: kr
2934
+ _.prototype.safeVm = {
2935
+ Script: jr
2818
2936
  };
2819
- const Rr = function(t, e, r) {
2937
+ const Hr = function(t, e, r) {
2820
2938
  const n = t.length;
2821
- for (let s = 0; s < n; s++) {
2822
- const o = t[s];
2823
- r(o) && e.push(t.splice(s--, 1)[0]);
2939
+ for (let o = 0; o < n; o++) {
2940
+ const s = t[o];
2941
+ r(s) && e.push(t.splice(o--, 1)[0]);
2824
2942
  }
2825
2943
  };
2826
- class Ir {
2944
+ class Vr {
2827
2945
  /**
2828
2946
  * @param {string} expr Expression to evaluate
2829
2947
  */
@@ -2837,106 +2955,134 @@ class Ir {
2837
2955
  */
2838
2956
  runInNewContext(e) {
2839
2957
  let r = this.code;
2840
- const n = Object.keys(e), s = [];
2841
- Rr(n, s, (u) => typeof e[u] == "function");
2842
- const o = n.map((u) => e[u]);
2843
- r = s.reduce((u, d) => {
2844
- let h = e[d].toString();
2845
- return /function/u.test(h) || (h = "function " + h), "var " + d + "=" + h + ";" + u;
2958
+ const n = Object.keys(e), o = [];
2959
+ Hr(n, o, (c) => typeof e[c] == "function");
2960
+ const s = n.map((c) => e[c]);
2961
+ r = o.reduce((c, f) => {
2962
+ let p = e[f].toString();
2963
+ return /function/u.test(p) || (p = "function " + p), "var " + f + "=" + p + ";" + c;
2846
2964
  }, "") + r, !/(['"])use strict\1/u.test(r) && !n.includes("arguments") && (r = "var arguments = undefined;" + r), r = r.replace(/;\s*$/u, "");
2847
- const a = r.lastIndexOf(";"), c = a !== -1 ? r.slice(0, a + 1) + " return " + r.slice(a + 1) : " return " + r;
2848
- return new Function(...n, c)(...o);
2965
+ const a = r.lastIndexOf(";"), u = a !== -1 ? r.slice(0, a + 1) + " return " + r.slice(a + 1) : " return " + r;
2966
+ return new Function(...n, u)(...s);
2849
2967
  }
2850
2968
  }
2851
- C.prototype.vm = {
2852
- Script: Ir
2969
+ _.prototype.vm = {
2970
+ Script: Vr
2853
2971
  };
2854
- function Te(t, e, r) {
2972
+ function Le(t, e, r) {
2855
2973
  const n = e.replace(/^\$\.?/, "").split(/\.|\[|\]/).filter(Boolean);
2856
- let s = t;
2974
+ let o = t;
2857
2975
  for (let i = 0; i < n.length - 1; i++) {
2858
- const a = n[i], c = n[i + 1], u = /^\d+$/.test(c);
2976
+ const a = n[i], u = n[i + 1], c = /^\d+$/.test(u);
2859
2977
  if (a === "__proto__" || a === "constructor" || a === "prototype")
2860
2978
  throw new Error("Invalid path part: " + a);
2861
- if (a in s || (s[a] = u ? [] : {}), u) {
2862
- const d = parseInt(c, 10);
2863
- Array.isArray(s[a]) || (s[a] = []), s[a].length <= d && (s[a][d] = i === n.length - 2 ? r : {}), s = s[a][d], i++;
2979
+ if (a in o || (o[a] = c ? [] : {}), c) {
2980
+ const f = parseInt(u, 10);
2981
+ Array.isArray(o[a]) || (o[a] = []), o[a].length <= f && (o[a][f] = i === n.length - 2 ? r : {}), o = o[a][f], i++;
2864
2982
  } else
2865
- s = s[a];
2866
- }
2867
- const o = n[n.length - 1];
2868
- if (o === "__proto__" || o === "constructor" || o === "prototype")
2869
- throw new Error("Invalid path part: " + o);
2870
- if (/^\d+$/.test(o)) {
2871
- const i = parseInt(o, 10);
2872
- Array.isArray(s) || (s = []), s[i] = r;
2983
+ o = o[a];
2984
+ }
2985
+ const s = n[n.length - 1];
2986
+ if (s === "__proto__" || s === "constructor" || s === "prototype")
2987
+ throw new Error("Invalid path part: " + s);
2988
+ if (/^\d+$/.test(s)) {
2989
+ const i = parseInt(s, 10);
2990
+ Array.isArray(o) || (o = []), o[i] = r;
2873
2991
  } else
2874
- s[o] = r;
2992
+ o[s] = r;
2875
2993
  }
2876
- const Xr = (t, e, r) => {
2994
+ const tn = (t, e, r) => {
2877
2995
  const n = {
2878
2996
  type: e.type,
2879
2997
  item: e.type === "single" ? {} : void 0,
2880
2998
  list: e.type === "list" ? [] : void 0
2881
- }, s = (i, a) => {
2882
- let c = i;
2883
- return a.patchSource === "value" ? a.value ?? a.defaultValue ?? null : (a.patchSource === "child" && (c = r), (a.type === "single" ? C({ path: a.fromPath, json: c, resultType: "value" }) : C({ path: a.fromPath, json: c })) ?? a.defaultValue ?? null);
2884
- }, o = e.type === "single" ? C({ path: e.fromPath, json: t, resultType: "value" }) : C({ path: e.fromPath, json: t });
2999
+ }, o = (i, a) => {
3000
+ let u = i;
3001
+ return a.patchSource === "value" ? a.value ?? a.defaultValue ?? null : (a.patchSource === "child" && (u = r), (a.type === "single" ? _({ path: a.fromPath, json: u, resultType: "value" }) : _({ path: a.fromPath, json: u })) ?? a.defaultValue ?? null);
3002
+ }, s = e.type === "single" ? _({ path: e.fromPath, json: t, resultType: "value" }) : _({ path: e.fromPath, json: t });
2885
3003
  return e.type === "single" ? e.patches.forEach((i) => {
2886
- const a = s(o, i);
2887
- Te(n.item, i.toPath, a);
2888
- }) : e.type === "list" && (n.list = o.map((i) => {
3004
+ const a = o(s, i);
3005
+ Le(n.item, i.toPath, a);
3006
+ }) : e.type === "list" && (n.list = s.map((i) => {
2889
3007
  const a = {};
2890
- return e.patches.forEach((c) => {
2891
- const u = s(i, c);
2892
- Te(a, c.toPath, u);
3008
+ return e.patches.forEach((u) => {
3009
+ const c = o(i, u);
3010
+ Le(a, u.toPath, c);
2893
3011
  }), a;
2894
3012
  })), n;
2895
3013
  };
2896
- function Mr(t, e) {
3014
+ function Kr(t, e) {
2897
3015
  const r = {};
2898
- return !t.events || !Object.keys(t.events).length || Object.entries(t.events).forEach(([n, s]) => {
2899
- s?.trim() && (r[n] = (...o) => {
3016
+ return !t.events || !Object.keys(t.events).length || Object.entries(t.events).forEach(([n, o]) => {
3017
+ o?.trim() && (r[n] = (...s) => {
2900
3018
  try {
2901
- new Function("ctx", "craftNode", "args", s)(e, t, ...o);
3019
+ new Function(
3020
+ "ctx",
3021
+ "craftNode",
3022
+ "args",
3023
+ o
3024
+ )(e, t, ...s);
2902
3025
  } catch (i) {
2903
- console.error(`Event code execution failed with code:
2904
- ${s}
3026
+ console.error(
3027
+ `Event code execution failed with code:
3028
+ ${o}
2905
3029
 
2906
- Error:`, i);
3030
+ Error:`,
3031
+ i
3032
+ );
2907
3033
  }
2908
3034
  });
2909
3035
  }), r;
2910
3036
  }
2911
- function Tr(t, e, r = "default") {
3037
+ function Xr(t, e, r = "default") {
2912
3038
  if (!t.slots || !t.slots[r]) return [];
2913
3039
  const n = t.slots[r];
2914
- return e.type === "single" ? n.map((s) => ({
2915
- ...s,
2916
- uuid: `${s.uuid}-single`,
2917
- props: { ...s.props, ...e.item || {} }
3040
+ return e.type === "single" ? n.map((o) => ({
3041
+ ...o,
3042
+ uuid: `${o.uuid}-single`,
3043
+ props: { ...o.props, ...e.item || {} }
2918
3044
  })) : e.type === "list" && e.list ? n.flatMap(
2919
- (s) => e.list.map((o, i) => ({
2920
- ...s,
2921
- uuid: `${s.uuid}-data-${i}`,
2922
- props: { ...s.props, ...o || {} }
3045
+ (o) => e.list.map((s, i) => ({
3046
+ ...o,
3047
+ uuid: `${o.uuid}-data-${i}`,
3048
+ props: { ...o.props, ...s || {} }
2923
3049
  }))
2924
3050
  ) : [];
2925
3051
  }
2926
- function _e(t, e, r, n, s) {
2927
- if (!ze(t))
3052
+ function xe(t, e, r, n, o) {
3053
+ if (!qe(t))
2928
3054
  return null;
2929
- const o = e.resolveNode(t), i = o?.componentName || t.componentName, a = r?.[i] || i, c = {
2930
- ...o?.defaultProps || {},
3055
+ const s = e.resolveNode(t), i = s?.componentName || t.componentName, a = r?.[i] || i, u = {
3056
+ ...s?.defaultProps || {},
2931
3057
  ...t.props
2932
- }, u = s ? Mr(t, s) : {}, d = n?.[t.uuid];
2933
- let h;
2934
- return d?.type ? h = Tr(t, d, d.slotName || "default").map((p) => _e(p, e, r, n, s)).filter((p) => p !== null) : t.slots && (h = Object.values(t.slots).flat().map((m) => _e(m, e, r, n, s)).filter((m) => m !== null)), pt(a, { key: t.uuid, ...c, ...u }, h);
3058
+ }, c = o ? Kr(t, o) : {}, f = n?.[t.uuid];
3059
+ let p;
3060
+ return f?.type ? p = Xr(
3061
+ t,
3062
+ f,
3063
+ f.slotName || "default"
3064
+ ).map(
3065
+ (h) => xe(
3066
+ h,
3067
+ e,
3068
+ r,
3069
+ n,
3070
+ o
3071
+ )
3072
+ ).filter((h) => h !== null) : t.slots && (p = Object.values(t.slots).flat().map(
3073
+ (v) => xe(
3074
+ v,
3075
+ e,
3076
+ r,
3077
+ n,
3078
+ o
3079
+ )
3080
+ ).filter((v) => v !== null)), Nt(a, { key: t.uuid, ...u, ...c }, p);
2935
3081
  }
2936
- function zr(t, e) {
2937
- const r = new ye(e.resolverMap);
3082
+ function rn(t, e) {
3083
+ const r = new be(e.resolverMap);
2938
3084
  return t.map(
2939
- (n) => _e(
3085
+ (n) => xe(
2940
3086
  n,
2941
3087
  r,
2942
3088
  e.componentRegistry,
@@ -2945,7 +3091,7 @@ function zr(t, e) {
2945
3091
  )
2946
3092
  ).filter((n) => n !== null);
2947
3093
  }
2948
- const qr = {
3094
+ const nn = {
2949
3095
  CraftComponentSimpleText: {
2950
3096
  componentName: "CraftComponentSimpleText",
2951
3097
  eventsSchema: {
@@ -2991,49 +3137,51 @@ const qr = {
2991
3137
  CraftCanvas: {
2992
3138
  componentName: "CraftCanvas"
2993
3139
  }
2994
- }, Br = (t) => {
2995
- for (const e in Ie)
2996
- t.component(e, Ie[e]);
2997
- }, Wr = { install: Br };
3140
+ }, zr = (t) => {
3141
+ for (const e in Ue)
3142
+ t.component(e, Ue[e]);
3143
+ }, on = { install: zr };
2998
3144
  export {
2999
- vt as CraftCanvas,
3000
- Et as CraftComponentSimpleText,
3001
- Ct as CraftEditor,
3002
- wt as CraftEditorBlueprint,
3003
- At as CraftEditorBlueprintsList,
3004
- $t as CraftEditorPanelBlueprints,
3005
- Rt as CraftEditorPanelForm,
3006
- Ut as CraftEditorPanelLayers,
3007
- Xt as CraftEditorPanelLayout,
3008
- qt as CraftEditorPanelNodeEventsSettings,
3009
- Zt as CraftEditorPanelNodeLayer,
3010
- er as CraftEditorPanelNodeSettings,
3011
- ir as CraftEditorPanelSettings,
3012
- cr as CraftFrame,
3013
- Qe as CraftIframe,
3014
- br as CraftNodeEditor,
3015
- ye as CraftNodeResolver,
3016
- ve as CraftNodeViewer,
3017
- Er as CraftStaticRenderer,
3018
- _t as Utils,
3019
- Wr as VCraft,
3020
- We as buildCraftNodeTree,
3021
- ie as craftNodeCanBeChildOf,
3022
- pe as craftNodeCanBeSiblingOf,
3023
- gt as craftNodeInCanvas,
3024
- qe as craftNodeIsAncestorOf,
3025
- q as craftNodeIsCanvas,
3026
- yt as craftNodeIsDraggable,
3027
- Vr as defaultBlueprints,
3028
- qr as defaultResolvers,
3029
- ze as isVisible,
3030
- Xr as mapData,
3031
- _e as renderCraftNodeToVNode,
3032
- zr as renderCraftNodesToVNodes,
3033
- te as resolveNodeName,
3034
- mt as useCraftNode,
3035
- j as useEditor,
3036
- Se as useIndicator,
3037
- xe as useResolveCraftNode
3145
+ Ot as CraftCanvas,
3146
+ At as CraftComponentSimpleText,
3147
+ Pt as CraftEditor,
3148
+ Mt as CraftEditorBlueprint,
3149
+ Bt as CraftEditorBlueprintsList,
3150
+ Ht as CraftEditorPanelBlueprints,
3151
+ Vt as CraftEditorPanelForm,
3152
+ Yt as CraftEditorPanelLayers,
3153
+ tr as CraftEditorPanelLayout,
3154
+ nr as CraftEditorPanelNodeEventsSettings,
3155
+ lr as CraftEditorPanelNodeLayer,
3156
+ cr as CraftEditorPanelNodeSettings,
3157
+ mr as CraftEditorPanelSettings,
3158
+ Er as CraftFrame,
3159
+ Je as CraftIframe,
3160
+ kr as CraftNodeEditor,
3161
+ be as CraftNodeResolver,
3162
+ Ne as CraftNodeViewer,
3163
+ Dr as CraftStaticRenderer,
3164
+ $t as Utils,
3165
+ on as VCraft,
3166
+ Qe as buildCraftNodeTree,
3167
+ oe as craftNodeCanBeChildOf,
3168
+ me as craftNodeCanBeSiblingOf,
3169
+ St as craftNodeInCanvas,
3170
+ Ye as craftNodeIsAncestorOf,
3171
+ K as craftNodeIsCanvas,
3172
+ kt as craftNodeIsDraggable,
3173
+ Zr as defaultBlueprints,
3174
+ nn as defaultResolvers,
3175
+ We as initializeSlotsFromResolver,
3176
+ qe as isVisible,
3177
+ tn as mapData,
3178
+ xe as renderCraftNodeToVNode,
3179
+ rn as renderCraftNodesToVNodes,
3180
+ J as resolveNodeName,
3181
+ xt as useCraftNode,
3182
+ L as useEditor,
3183
+ De as useIndicator,
3184
+ Jr as useNodeElement,
3185
+ fe as useResolveCraftNode
3038
3186
  };
3039
3187
  //# sourceMappingURL=v-craft.es.js.map