@versa-stack/v-craft 1.1.0-alpha.2 → 1.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { computed as N, toValue as Te, inject as he, defineAsyncComponent as mt, defineComponent as j, useSlots as Xe, useAttrs as gt, unref as d, openBlock as v, createBlock as A, resolveDynamicComponent as ye, normalizeProps as Ue, mergeProps as _e, createSlots as be, renderList as T, withCtx as q, renderSlot as Q, guardReactiveProps as yt, createCommentVNode as D, markRaw as ze, ref as H, watch as J, normalizeClass as ve, createTextVNode as oe, toDisplayString as ee, createElementBlock as _, withKeys as je, withModifiers as F, nextTick as pe, provide as W, resolveComponent as B, createVNode as z, Fragment as U, createElementVNode as w, toRef as de, onUnmounted as bt, toRefs as me, normalizeStyle as Me, withDirectives as Et, Teleport as Ct, vShow as _t, onMounted as Ne, onBeforeMount as Nt, onBeforeUnmount as xt, readonly as qe, onUpdated as Ot, toHandlers as $e, h as wt } from "vue";
2
- import { defineStore as Ye, storeToRefs as te } from "pinia";
3
- import { v4 as G } from "uuid";
4
- import { debounce as Qe } from "lodash-es";
5
- import { FormKit as se, FormKitSchema as Ge } from "@formkit/vue";
6
- class St {
1
+ import { computed as _, toValue as Be, inject as ge, defineAsyncComponent as Et, defineComponent as B, useSlots as Qe, useAttrs as Ct, unref as d, openBlock as v, createBlock as $, resolveDynamicComponent as Ce, normalizeProps as Le, mergeProps as xe, createSlots as Ne, renderList as U, withCtx as G, renderSlot as J, guardReactiveProps as Nt, createCommentVNode as M, markRaw as Ge, ref as K, watch as ne, normalizeClass as ye, createTextVNode as ie, toDisplayString as oe, createElementBlock as N, withKeys as Fe, withModifiers as V, nextTick as ve, provide as te, resolveComponent as H, createVNode as Q, Fragment as j, createElementVNode as O, toRef as he, onUnmounted as _t, toRefs as be, normalizeStyle as Ie, withDirectives as Pt, Teleport as xt, vShow as St, onMounted as Se, onBeforeMount as Ot, onBeforeUnmount as wt, readonly as We, onUpdated as kt, toHandlers as Te, reactive as He, h as Dt } from "vue";
2
+ import { defineStore as Ze, storeToRefs as se } from "pinia";
3
+ import { v4 as ee } from "uuid";
4
+ import { debounce as Je } from "lodash-es";
5
+ import { FormKit as le, FormKitSchema as et } from "@formkit/vue";
6
+ class At {
7
7
  /**
8
8
  * @callback HookCallback
9
9
  * @this {*|Jsep} this
@@ -46,7 +46,7 @@ class St {
46
46
  });
47
47
  }
48
48
  }
49
- class Pt {
49
+ class Rt {
50
50
  constructor(e) {
51
51
  this.jsep = e, this.registered = {};
52
52
  }
@@ -619,10 +619,10 @@ class c {
619
619
  };
620
620
  }
621
621
  }
622
- const kt = new St();
622
+ const Mt = new At();
623
623
  Object.assign(c, {
624
- hooks: kt,
625
- plugins: new Pt(c),
624
+ hooks: Mt,
625
+ plugins: new Rt(c),
626
626
  // Node Types
627
627
  // ----------
628
628
  // This is the full set of types that any JSEP node can be.
@@ -718,14 +718,14 @@ Object.assign(c, {
718
718
  });
719
719
  c.max_unop_len = c.getMaxKeyLen(c.unary_ops);
720
720
  c.max_binop_len = c.getMaxKeyLen(c.binary_ops);
721
- const Z = (t) => new c(t).parse(), Dt = Object.getOwnPropertyNames(class {
721
+ const re = (t) => new c(t).parse(), $t = Object.getOwnPropertyNames(class {
722
722
  });
723
- Object.getOwnPropertyNames(c).filter((t) => !Dt.includes(t) && Z[t] === void 0).forEach((t) => {
724
- Z[t] = c[t];
723
+ Object.getOwnPropertyNames(c).filter((t) => !$t.includes(t) && re[t] === void 0).forEach((t) => {
724
+ re[t] = c[t];
725
725
  });
726
- Z.Jsep = c;
727
- const At = "ConditionalExpression";
728
- var Mt = {
726
+ re.Jsep = c;
727
+ const It = "ConditionalExpression";
728
+ var Tt = {
729
729
  name: "ternary",
730
730
  init(t) {
731
731
  t.hooks.add("after-expression", function(r) {
@@ -736,7 +736,7 @@ var Mt = {
736
736
  this.index++;
737
737
  const s = this.gobbleExpression();
738
738
  if (s || this.throwError("Expected expression"), r.node = {
739
- type: At,
739
+ type: It,
740
740
  test: n,
741
741
  consequent: o,
742
742
  alternate: s
@@ -752,17 +752,17 @@ var Mt = {
752
752
  });
753
753
  }
754
754
  };
755
- Z.plugins.register(Mt);
756
- const Be = 47, $t = 92;
757
- var Rt = {
755
+ re.plugins.register(Tt);
756
+ const Ve = 47, Ut = 92;
757
+ var jt = {
758
758
  name: "regex",
759
759
  init(t) {
760
760
  t.hooks.add("gobble-token", function(r) {
761
- if (this.code === Be) {
761
+ if (this.code === Ve) {
762
762
  const n = ++this.index;
763
763
  let o = !1;
764
764
  for (; this.index < this.expr.length; ) {
765
- if (this.code === Be && !o) {
765
+ if (this.code === Ve && !o) {
766
766
  const s = this.expr.slice(n, this.index);
767
767
  let a = "";
768
768
  for (; ++this.index < this.expr.length; ) {
@@ -784,34 +784,34 @@ var Rt = {
784
784
  raw: this.expr.slice(n - 1, this.index)
785
785
  }, r.node = this.gobbleTokenProperty(r.node), r.node;
786
786
  }
787
- this.code === t.OBRACK_CODE ? o = !0 : o && this.code === t.CBRACK_CODE && (o = !1), this.index += this.code === $t ? 2 : 1;
787
+ this.code === t.OBRACK_CODE ? o = !0 : o && this.code === t.CBRACK_CODE && (o = !1), this.index += this.code === Ut ? 2 : 1;
788
788
  }
789
789
  this.throwError("Unclosed Regex");
790
790
  }
791
791
  });
792
792
  }
793
793
  };
794
- const Oe = 43, It = 45, ce = {
794
+ const we = 43, Bt = 45, fe = {
795
795
  name: "assignment",
796
796
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
797
- updateOperators: [Oe, It],
797
+ updateOperators: [we, Bt],
798
798
  assignmentPrecedence: 0.9,
799
799
  init(t) {
800
800
  const e = [t.IDENTIFIER, t.MEMBER_EXP];
801
- ce.assignmentOperators.forEach((n) => t.addBinaryOp(n, ce.assignmentPrecedence, !0)), t.hooks.add("gobble-token", function(o) {
801
+ fe.assignmentOperators.forEach((n) => t.addBinaryOp(n, fe.assignmentPrecedence, !0)), t.hooks.add("gobble-token", function(o) {
802
802
  const s = this.code;
803
- ce.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, o.node = {
803
+ fe.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, o.node = {
804
804
  type: "UpdateExpression",
805
- operator: s === Oe ? "++" : "--",
805
+ operator: s === we ? "++" : "--",
806
806
  argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
807
807
  prefix: !0
808
808
  }, (!o.node.argument || !e.includes(o.node.argument.type)) && this.throwError(`Unexpected ${o.node.operator}`));
809
809
  }), t.hooks.add("after-token", function(o) {
810
810
  if (o.node) {
811
811
  const s = this.code;
812
- ce.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (e.includes(o.node.type) || this.throwError(`Unexpected ${o.node.operator}`), this.index += 2, o.node = {
812
+ fe.updateOperators.some((a) => a === s && a === this.expr.charCodeAt(this.index + 1)) && (e.includes(o.node.type) || this.throwError(`Unexpected ${o.node.operator}`), this.index += 2, o.node = {
813
813
  type: "UpdateExpression",
814
- operator: s === Oe ? "++" : "--",
814
+ operator: s === we ? "++" : "--",
815
815
  argument: o.node,
816
816
  prefix: !1
817
817
  });
@@ -820,18 +820,18 @@ const Oe = 43, It = 45, ce = {
820
820
  o.node && r(o.node);
821
821
  });
822
822
  function r(n) {
823
- ce.assignmentOperators.has(n.operator) ? (n.type = "AssignmentExpression", r(n.left), r(n.right)) : n.operator || Object.values(n).forEach((o) => {
823
+ fe.assignmentOperators.has(n.operator) ? (n.type = "AssignmentExpression", r(n.left), r(n.right)) : n.operator || Object.values(n).forEach((o) => {
824
824
  o && typeof o == "object" && r(o);
825
825
  });
826
826
  }
827
827
  }
828
828
  };
829
- Z.plugins.register(Rt, ce);
830
- Z.addUnaryOp("typeof");
831
- Z.addUnaryOp("void");
832
- Z.addLiteral("null", null);
833
- Z.addLiteral("undefined", void 0);
834
- const Tt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), M = {
829
+ re.plugins.register(jt, fe);
830
+ re.addUnaryOp("typeof");
831
+ re.addUnaryOp("void");
832
+ re.addLiteral("null", null);
833
+ re.addLiteral("undefined", void 0);
834
+ const Lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"]), I = {
835
835
  /**
836
836
  * @param {jsep.Expression} ast
837
837
  * @param {Record<string, any>} subs
@@ -840,25 +840,25 @@ const Tt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
840
840
  switch (t.type) {
841
841
  case "BinaryExpression":
842
842
  case "LogicalExpression":
843
- return M.evalBinaryExpression(t, e);
843
+ return I.evalBinaryExpression(t, e);
844
844
  case "Compound":
845
- return M.evalCompound(t, e);
845
+ return I.evalCompound(t, e);
846
846
  case "ConditionalExpression":
847
- return M.evalConditionalExpression(t, e);
847
+ return I.evalConditionalExpression(t, e);
848
848
  case "Identifier":
849
- return M.evalIdentifier(t, e);
849
+ return I.evalIdentifier(t, e);
850
850
  case "Literal":
851
- return M.evalLiteral(t, e);
851
+ return I.evalLiteral(t, e);
852
852
  case "MemberExpression":
853
- return M.evalMemberExpression(t, e);
853
+ return I.evalMemberExpression(t, e);
854
854
  case "UnaryExpression":
855
- return M.evalUnaryExpression(t, e);
855
+ return I.evalUnaryExpression(t, e);
856
856
  case "ArrayExpression":
857
- return M.evalArrayExpression(t, e);
857
+ return I.evalArrayExpression(t, e);
858
858
  case "CallExpression":
859
- return M.evalCallExpression(t, e);
859
+ return I.evalCallExpression(t, e);
860
860
  case "AssignmentExpression":
861
- return M.evalAssignmentExpression(t, e);
861
+ return I.evalAssignmentExpression(t, e);
862
862
  default:
863
863
  throw SyntaxError("Unexpected expression", t);
864
864
  }
@@ -888,19 +888,19 @@ const Tt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
888
888
  "*": (n, o) => n * o(),
889
889
  "/": (n, o) => n / o(),
890
890
  "%": (n, o) => n % o()
891
- }[t.operator](M.evalAst(t.left, e), () => M.evalAst(t.right, e));
891
+ }[t.operator](I.evalAst(t.left, e), () => I.evalAst(t.right, e));
892
892
  },
893
893
  evalCompound(t, e) {
894
894
  let r;
895
895
  for (let n = 0; n < t.body.length; n++) {
896
896
  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);
897
897
  const o = t.body[n];
898
- r = M.evalAst(o, e);
898
+ r = I.evalAst(o, e);
899
899
  }
900
900
  return r;
901
901
  },
902
902
  evalConditionalExpression(t, e) {
903
- return M.evalAst(t.test, e) ? M.evalAst(t.consequent, e) : M.evalAst(t.alternate, e);
903
+ return I.evalAst(t.test, e) ? I.evalAst(t.consequent, e) : I.evalAst(t.alternate, e);
904
904
  },
905
905
  evalIdentifier(t, e) {
906
906
  if (Object.hasOwn(e, t.name))
@@ -915,33 +915,33 @@ const Tt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
915
915
  // NOTE: `String(value)` throws error when
916
916
  // value has overwritten the toString method to return non-string
917
917
  // i.e. `value = {toString: () => []}`
918
- t.computed ? M.evalAst(t.property) : t.property.name
918
+ t.computed ? I.evalAst(t.property) : t.property.name
919
919
  // `object.property` property is Identifier
920
- ), n = M.evalAst(t.object, e);
920
+ ), n = I.evalAst(t.object, e);
921
921
  if (n == null)
922
922
  throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);
923
- if (!Object.hasOwn(n, r) && Tt.has(r))
923
+ if (!Object.hasOwn(n, r) && Lt.has(r))
924
924
  throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);
925
925
  const o = n[r];
926
926
  return typeof o == "function" ? o.bind(n) : o;
927
927
  },
928
928
  evalUnaryExpression(t, e) {
929
929
  return {
930
- "-": (n) => -M.evalAst(n, e),
931
- "!": (n) => !M.evalAst(n, e),
932
- "~": (n) => ~M.evalAst(n, e),
930
+ "-": (n) => -I.evalAst(n, e),
931
+ "!": (n) => !I.evalAst(n, e),
932
+ "~": (n) => ~I.evalAst(n, e),
933
933
  // eslint-disable-next-line no-implicit-coercion -- API
934
- "+": (n) => +M.evalAst(n, e),
935
- typeof: (n) => typeof M.evalAst(n, e),
934
+ "+": (n) => +I.evalAst(n, e),
935
+ typeof: (n) => typeof I.evalAst(n, e),
936
936
  // eslint-disable-next-line no-void, sonarjs/void-use -- feature
937
- void: (n) => void M.evalAst(n, e)
937
+ void: (n) => void I.evalAst(n, e)
938
938
  }[t.operator](t.argument);
939
939
  },
940
940
  evalArrayExpression(t, e) {
941
- return t.elements.map((r) => M.evalAst(r, e));
941
+ return t.elements.map((r) => I.evalAst(r, e));
942
942
  },
943
943
  evalCallExpression(t, e) {
944
- const r = t.arguments.map((o) => M.evalAst(o, e)), n = M.evalAst(t.callee, e);
944
+ const r = t.arguments.map((o) => I.evalAst(o, e)), n = I.evalAst(t.callee, e);
945
945
  if (n === Function)
946
946
  throw new Error("Function constructor is disabled");
947
947
  return n(...r);
@@ -949,16 +949,16 @@ const Tt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
949
949
  evalAssignmentExpression(t, e) {
950
950
  if (t.left.type !== "Identifier")
951
951
  throw SyntaxError("Invalid left-hand side in assignment");
952
- const r = t.left.name, n = M.evalAst(t.right, e);
952
+ const r = t.left.name, n = I.evalAst(t.right, e);
953
953
  return e[r] = n, e[r];
954
954
  }
955
955
  };
956
- class Ut {
956
+ class Ft {
957
957
  /**
958
958
  * @param {string} expr Expression to evaluate
959
959
  */
960
960
  constructor(e) {
961
- this.code = e, this.ast = Z(this.code);
961
+ this.code = e, this.ast = re(this.code);
962
962
  }
963
963
  /**
964
964
  * @param {object} context Object whose items will be added
@@ -967,16 +967,16 @@ class Ut {
967
967
  */
968
968
  runInNewContext(e) {
969
969
  const r = Object.assign(/* @__PURE__ */ Object.create(null), e);
970
- return M.evalAst(this.ast, r);
970
+ return I.evalAst(this.ast, r);
971
971
  }
972
972
  }
973
- function ne(t, e) {
973
+ function ae(t, e) {
974
974
  return t = t.slice(), t.push(e), t;
975
975
  }
976
- function we(t, e) {
976
+ function ke(t, e) {
977
977
  return e = e.slice(), e.unshift(t), e;
978
978
  }
979
- class jt extends Error {
979
+ class Ht extends Error {
980
980
  /**
981
981
  * @param {AnyResult} value The evaluated scalar value
982
982
  */
@@ -984,10 +984,10 @@ class jt extends Error {
984
984
  super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError";
985
985
  }
986
986
  }
987
- function S(t, e, r, n, o) {
988
- if (!(this instanceof S))
987
+ function D(t, e, r, n, o) {
988
+ if (!(this instanceof D))
989
989
  try {
990
- return new S(t, e, r, n, o);
990
+ return new D(t, e, r, n, o);
991
991
  } catch (a) {
992
992
  if (!a.avoidNew)
993
993
  throw a;
@@ -1004,11 +1004,11 @@ function S(t, e, r, n, o) {
1004
1004
  s ? "json" in t && (a.json = t.json) : a.json = r;
1005
1005
  const i = this.evaluate(a);
1006
1006
  if (!i || typeof i != "object")
1007
- throw new jt(i);
1007
+ throw new Ht(i);
1008
1008
  return i;
1009
1009
  }
1010
1010
  }
1011
- S.prototype.evaluate = function(t, e, r, n) {
1011
+ D.prototype.evaluate = function(t, e, r, n) {
1012
1012
  let o = this.parent, s = this.parentProperty, {
1013
1013
  flatten: a,
1014
1014
  wrap: i
@@ -1022,9 +1022,9 @@ S.prototype.evaluate = function(t, e, r, n) {
1022
1022
  json: e
1023
1023
  } = t), a = Object.hasOwn(t, "flatten") ? t.flatten : a, this.currResultType = Object.hasOwn(t, "resultType") ? t.resultType : this.currResultType, this.currSandbox = Object.hasOwn(t, "sandbox") ? t.sandbox : this.currSandbox, i = Object.hasOwn(t, "wrap") ? t.wrap : i, 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;
1024
1024
  }
1025
- if (o = o || null, s = s || null, Array.isArray(t) && (t = S.toPathString(t)), !t && t !== "" || !e)
1025
+ if (o = o || null, s = s || null, Array.isArray(t) && (t = D.toPathString(t)), !t && t !== "" || !e)
1026
1026
  return;
1027
- const l = S.toPathArray(t);
1027
+ const l = D.toPathArray(t);
1028
1028
  l[0] === "$" && l.length > 1 && l.shift(), this._hasParentSelector = null;
1029
1029
  const u = this._trace(l, e, ["$"], o, s, r).filter(function(p) {
1030
1030
  return p && !p.isParentSelector;
@@ -1034,32 +1034,32 @@ S.prototype.evaluate = function(t, e, r, n) {
1034
1034
  return a && Array.isArray(f) ? p = p.concat(f) : p.push(f), p;
1035
1035
  }, []) : i ? [] : void 0;
1036
1036
  };
1037
- S.prototype._getPreferredOutput = function(t) {
1037
+ D.prototype._getPreferredOutput = function(t) {
1038
1038
  const e = this.currResultType;
1039
1039
  switch (e) {
1040
1040
  case "all": {
1041
- const r = Array.isArray(t.path) ? t.path : S.toPathArray(t.path);
1042
- return t.pointer = S.toPointer(r), t.path = typeof t.path == "string" ? t.path : S.toPathString(t.path), t;
1041
+ const r = Array.isArray(t.path) ? t.path : D.toPathArray(t.path);
1042
+ return t.pointer = D.toPointer(r), t.path = typeof t.path == "string" ? t.path : D.toPathString(t.path), t;
1043
1043
  }
1044
1044
  case "value":
1045
1045
  case "parent":
1046
1046
  case "parentProperty":
1047
1047
  return t[e];
1048
1048
  case "path":
1049
- return S.toPathString(t[e]);
1049
+ return D.toPathString(t[e]);
1050
1050
  case "pointer":
1051
- return S.toPointer(t.path);
1051
+ return D.toPointer(t.path);
1052
1052
  default:
1053
1053
  throw new TypeError("Unknown result type");
1054
1054
  }
1055
1055
  };
1056
- S.prototype._handleCallback = function(t, e, r) {
1056
+ D.prototype._handleCallback = function(t, e, r) {
1057
1057
  if (e) {
1058
1058
  const n = this._getPreferredOutput(t);
1059
- t.path = typeof t.path == "string" ? t.path : S.toPathString(t.path), e(n, r, t);
1059
+ t.path = typeof t.path == "string" ? t.path : D.toPathString(t.path), e(n, r, t);
1060
1060
  }
1061
1061
  };
1062
- S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1062
+ D.prototype._trace = function(t, e, r, n, o, s, a, i) {
1063
1063
  let l;
1064
1064
  if (!t.length)
1065
1065
  return l = {
@@ -1071,19 +1071,19 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1071
1071
  }, this._handleCallback(l, s, "value"), l;
1072
1072
  const u = t[0], p = t.slice(1), m = [];
1073
1073
  function f(h) {
1074
- Array.isArray(h) ? h.forEach((y) => {
1075
- m.push(y);
1074
+ Array.isArray(h) ? h.forEach((g) => {
1075
+ m.push(g);
1076
1076
  }) : m.push(h);
1077
1077
  }
1078
1078
  if ((typeof u != "string" || i) && e && Object.hasOwn(e, u))
1079
- f(this._trace(p, e[u], ne(r, u), e, u, s, a));
1079
+ f(this._trace(p, e[u], ae(r, u), e, u, s, a));
1080
1080
  else if (u === "*")
1081
1081
  this._walk(e, (h) => {
1082
- f(this._trace(p, e[h], ne(r, h), e, h, s, !0, !0));
1082
+ f(this._trace(p, e[h], ae(r, h), e, h, s, !0, !0));
1083
1083
  });
1084
1084
  else if (u === "..")
1085
1085
  f(this._trace(p, e, r, n, o, s, a)), this._walk(e, (h) => {
1086
- typeof e[h] == "object" && f(this._trace(t.slice(), e[h], ne(r, h), e, h, s, !0));
1086
+ typeof e[h] == "object" && f(this._trace(t.slice(), e[h], ae(r, h), e, h, s, !0));
1087
1087
  });
1088
1088
  else {
1089
1089
  if (u === "^")
@@ -1094,7 +1094,7 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1094
1094
  };
1095
1095
  if (u === "~")
1096
1096
  return l = {
1097
- path: ne(r, u),
1097
+ path: ae(r, u),
1098
1098
  value: o,
1099
1099
  parent: n,
1100
1100
  parentProperty: null
@@ -1106,21 +1106,21 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1106
1106
  else if (u.indexOf("?(") === 0) {
1107
1107
  if (this.currEval === !1)
1108
1108
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1109
- const h = u.replace(/^\?\((.*?)\)$/u, "$1"), y = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);
1110
- y ? this._walk(e, (x) => {
1111
- const P = [y[2]], g = y[1] ? e[x][y[1]] : e[x];
1112
- this._trace(P, g, r, n, o, s, !0).length > 0 && f(this._trace(p, e[x], ne(r, x), e, x, s, !0));
1113
- }) : this._walk(e, (x) => {
1114
- this._eval(h, e[x], x, r, n, o) && f(this._trace(p, e[x], ne(r, x), e, x, s, !0));
1109
+ const h = u.replace(/^\?\((.*?)\)$/u, "$1"), g = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(h);
1110
+ g ? this._walk(e, (P) => {
1111
+ const A = [g[2]], C = g[1] ? e[P][g[1]] : e[P];
1112
+ this._trace(A, C, r, n, o, s, !0).length > 0 && f(this._trace(p, e[P], ae(r, P), e, P, s, !0));
1113
+ }) : this._walk(e, (P) => {
1114
+ this._eval(h, e[P], P, r, n, o) && f(this._trace(p, e[P], ae(r, P), e, P, s, !0));
1115
1115
  });
1116
1116
  } else if (u[0] === "(") {
1117
1117
  if (this.currEval === !1)
1118
1118
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
1119
- f(this._trace(we(this._eval(u, e, r.at(-1), r.slice(0, -1), n, o), p), e, r, n, o, s, a));
1119
+ f(this._trace(ke(this._eval(u, e, r.at(-1), r.slice(0, -1), n, o), p), e, r, n, o, s, a));
1120
1120
  } else if (u[0] === "@") {
1121
1121
  let h = !1;
1122
- const y = u.slice(1, -2);
1123
- switch (y) {
1122
+ const g = u.slice(1, -2);
1123
+ switch (g) {
1124
1124
  case "scalar":
1125
1125
  (!e || !["object", "function"].includes(typeof e)) && (h = !0);
1126
1126
  break;
@@ -1128,7 +1128,7 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1128
1128
  case "string":
1129
1129
  case "undefined":
1130
1130
  case "function":
1131
- typeof e === y && (h = !0);
1131
+ typeof e === g && (h = !0);
1132
1132
  break;
1133
1133
  case "integer":
1134
1134
  Number.isFinite(e) && !(e % 1) && (h = !0);
@@ -1140,7 +1140,7 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1140
1140
  typeof e == "number" && !Number.isFinite(e) && (h = !0);
1141
1141
  break;
1142
1142
  case "object":
1143
- e && typeof e === y && (h = !0);
1143
+ e && typeof e === g && (h = !0);
1144
1144
  break;
1145
1145
  case "array":
1146
1146
  Array.isArray(e) && (h = !0);
@@ -1153,7 +1153,7 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1153
1153
  break;
1154
1154
  /* c8 ignore next 2 */
1155
1155
  default:
1156
- throw new TypeError("Unknown value type " + y);
1156
+ throw new TypeError("Unknown value type " + g);
1157
1157
  }
1158
1158
  if (h)
1159
1159
  return l = {
@@ -1164,30 +1164,30 @@ S.prototype._trace = function(t, e, r, n, o, s, a, i) {
1164
1164
  }, this._handleCallback(l, s, "value"), l;
1165
1165
  } else if (u[0] === "`" && e && Object.hasOwn(e, u.slice(1))) {
1166
1166
  const h = u.slice(1);
1167
- f(this._trace(p, e[h], ne(r, h), e, h, s, a, !0));
1167
+ f(this._trace(p, e[h], ae(r, h), e, h, s, a, !0));
1168
1168
  } else if (u.includes(",")) {
1169
1169
  const h = u.split(",");
1170
- for (const y of h)
1171
- f(this._trace(we(y, p), e, r, n, o, s, !0));
1172
- } else !i && e && Object.hasOwn(e, u) && f(this._trace(p, e[u], ne(r, u), e, u, s, a, !0));
1170
+ for (const g of h)
1171
+ f(this._trace(ke(g, p), e, r, n, o, s, !0));
1172
+ } else !i && e && Object.hasOwn(e, u) && f(this._trace(p, e[u], ae(r, u), e, u, s, a, !0));
1173
1173
  }
1174
1174
  if (this._hasParentSelector)
1175
1175
  for (let h = 0; h < m.length; h++) {
1176
- const y = m[h];
1177
- if (y && y.isParentSelector) {
1178
- const x = this._trace(y.expr, e, y.path, n, o, s, a);
1179
- if (Array.isArray(x)) {
1180
- m[h] = x[0];
1181
- const P = x.length;
1182
- for (let g = 1; g < P; g++)
1183
- h++, m.splice(h, 0, x[g]);
1176
+ const g = m[h];
1177
+ if (g && g.isParentSelector) {
1178
+ const P = this._trace(g.expr, e, g.path, n, o, s, a);
1179
+ if (Array.isArray(P)) {
1180
+ m[h] = P[0];
1181
+ const A = P.length;
1182
+ for (let C = 1; C < A; C++)
1183
+ h++, m.splice(h, 0, P[C]);
1184
1184
  } else
1185
- m[h] = x;
1185
+ m[h] = P;
1186
1186
  }
1187
1187
  }
1188
1188
  return m;
1189
1189
  };
1190
- S.prototype._walk = function(t, e) {
1190
+ D.prototype._walk = function(t, e) {
1191
1191
  if (Array.isArray(t)) {
1192
1192
  const r = t.length;
1193
1193
  for (let n = 0; n < r; n++)
@@ -1196,7 +1196,7 @@ S.prototype._walk = function(t, e) {
1196
1196
  e(r);
1197
1197
  });
1198
1198
  };
1199
- S.prototype._slice = function(t, e, r, n, o, s, a) {
1199
+ D.prototype._slice = function(t, e, r, n, o, s, a) {
1200
1200
  if (!Array.isArray(r))
1201
1201
  return;
1202
1202
  const i = r.length, l = t.split(":"), u = l[2] && Number.parseInt(l[2]) || 1;
@@ -1204,59 +1204,59 @@ S.prototype._slice = function(t, e, r, n, o, s, a) {
1204
1204
  p = p < 0 ? Math.max(0, p + i) : Math.min(i, p), m = m < 0 ? Math.max(0, m + i) : Math.min(i, m);
1205
1205
  const f = [];
1206
1206
  for (let h = p; h < m; h += u)
1207
- this._trace(we(h, e), r, n, o, s, a, !0).forEach((x) => {
1208
- f.push(x);
1207
+ this._trace(ke(h, e), r, n, o, s, a, !0).forEach((P) => {
1208
+ f.push(P);
1209
1209
  });
1210
1210
  return f;
1211
1211
  };
1212
- S.prototype._eval = function(t, e, r, n, o, s) {
1212
+ D.prototype._eval = function(t, e, r, n, o, s) {
1213
1213
  this.currSandbox._$_parentProperty = s, this.currSandbox._$_parent = o, this.currSandbox._$_property = r, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
1214
1214
  const a = t.includes("@path");
1215
- a && (this.currSandbox._$_path = S.toPathString(n.concat([r])));
1215
+ a && (this.currSandbox._$_path = D.toPathString(n.concat([r])));
1216
1216
  const i = this.currEval + "Script:" + t;
1217
- if (!S.cache[i]) {
1217
+ if (!D.cache[i]) {
1218
1218
  let l = t.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1219
1219
  if (a && (l = l.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1220
- S.cache[i] = new this.safeVm.Script(l);
1220
+ D.cache[i] = new this.safeVm.Script(l);
1221
1221
  else if (this.currEval === "native")
1222
- S.cache[i] = new this.vm.Script(l);
1222
+ D.cache[i] = new this.vm.Script(l);
1223
1223
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
1224
1224
  const u = this.currEval;
1225
- S.cache[i] = new u(l);
1225
+ D.cache[i] = new u(l);
1226
1226
  } else if (typeof this.currEval == "function")
1227
- S.cache[i] = {
1227
+ D.cache[i] = {
1228
1228
  runInNewContext: (u) => this.currEval(l, u)
1229
1229
  };
1230
1230
  else
1231
1231
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1232
1232
  }
1233
1233
  try {
1234
- return S.cache[i].runInNewContext(this.currSandbox);
1234
+ return D.cache[i].runInNewContext(this.currSandbox);
1235
1235
  } catch (l) {
1236
1236
  if (this.ignoreEvalErrors)
1237
1237
  return !1;
1238
1238
  throw new Error("jsonPath: " + l.message + ": " + t);
1239
1239
  }
1240
1240
  };
1241
- S.cache = {};
1242
- S.toPathString = function(t) {
1241
+ D.cache = {};
1242
+ D.toPathString = function(t) {
1243
1243
  const e = t, r = e.length;
1244
1244
  let n = "$";
1245
1245
  for (let o = 1; o < r; o++)
1246
1246
  /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += /^[0-9*]+$/u.test(e[o]) ? "[" + e[o] + "]" : "['" + e[o] + "']");
1247
1247
  return n;
1248
1248
  };
1249
- S.toPointer = function(t) {
1249
+ D.toPointer = function(t) {
1250
1250
  const e = t, r = e.length;
1251
1251
  let n = "";
1252
1252
  for (let o = 1; o < r; o++)
1253
1253
  /^(~|\^|@.*?\(\))$/u.test(e[o]) || (n += "/" + e[o].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
1254
1254
  return n;
1255
1255
  };
1256
- S.toPathArray = function(t) {
1256
+ D.toPathArray = function(t) {
1257
1257
  const {
1258
1258
  cache: e
1259
- } = S;
1259
+ } = D;
1260
1260
  if (e[t])
1261
1261
  return e[t].concat();
1262
1262
  const r = [], o = t.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(s, a) {
@@ -1271,17 +1271,17 @@ S.toPathArray = function(t) {
1271
1271
  });
1272
1272
  return e[t] = o, e[t].concat();
1273
1273
  };
1274
- S.prototype.safeVm = {
1275
- Script: Ut
1274
+ D.prototype.safeVm = {
1275
+ Script: Ft
1276
1276
  };
1277
- const Bt = function(t, e, r) {
1277
+ const Vt = function(t, e, r) {
1278
1278
  const n = t.length;
1279
1279
  for (let o = 0; o < n; o++) {
1280
1280
  const s = t[o];
1281
1281
  r(s) && e.push(t.splice(o--, 1)[0]);
1282
1282
  }
1283
1283
  };
1284
- class Lt {
1284
+ class Kt {
1285
1285
  /**
1286
1286
  * @param {string} expr Expression to evaluate
1287
1287
  */
@@ -1296,7 +1296,7 @@ class Lt {
1296
1296
  runInNewContext(e) {
1297
1297
  let r = this.code;
1298
1298
  const n = Object.keys(e), o = [];
1299
- Bt(n, o, (u) => typeof e[u] == "function");
1299
+ Vt(n, o, (u) => typeof e[u] == "function");
1300
1300
  const s = n.map((u) => e[u]);
1301
1301
  r = o.reduce((u, p) => {
1302
1302
  let m = e[p].toString();
@@ -1306,10 +1306,10 @@ class Lt {
1306
1306
  return new Function(...n, l)(...s);
1307
1307
  }
1308
1308
  }
1309
- S.prototype.vm = {
1310
- Script: Lt
1309
+ D.prototype.vm = {
1310
+ Script: Kt
1311
1311
  };
1312
- function Se(t, e, r) {
1312
+ function De(t, e, r) {
1313
1313
  const n = e.replace(/^\$\.?/, "").split(/\.|\[|\]/).filter(Boolean);
1314
1314
  let o = t;
1315
1315
  for (let a = 0; a < n.length - 1; a++) {
@@ -1331,34 +1331,34 @@ function Se(t, e, r) {
1331
1331
  } else
1332
1332
  o[s] = r;
1333
1333
  }
1334
- const Ft = (t, e) => {
1334
+ const Xt = (t, e) => {
1335
1335
  const r = {};
1336
1336
  return t && Object.entries(t).forEach(([n, o]) => {
1337
1337
  const s = e[n];
1338
1338
  s !== void 0 && Object.entries(o).forEach(([a, i]) => {
1339
- const l = S({
1339
+ const l = D({
1340
1340
  path: i,
1341
1341
  json: s,
1342
1342
  resultType: "value"
1343
1343
  });
1344
- l.length && Se(r, a, l[0]);
1344
+ l.length && De(r, a, l[0]);
1345
1345
  });
1346
1346
  }), r;
1347
- }, Ht = (t, e = {}) => ({
1348
- props: N(
1349
- () => Ft(Te(t)?.slotsPropsPropsMap, Te(e) || {})
1347
+ }, zt = (t, e = {}) => ({
1348
+ props: _(
1349
+ () => Xt(Be(t)?.slotsPropsPropsMap, Be(e) || {})
1350
1350
  )
1351
- }), Kt = (t, e) => {
1351
+ }), qt = (t, e) => {
1352
1352
  if (!t)
1353
1353
  return e.componentName;
1354
1354
  const r = t.resolveComponent(e);
1355
- return r ? typeof r == "function" && !("setup" in r) && !("render" in r) ? mt(r) : r : t.resolve(e.componentName)?.componentName || e.componentName;
1356
- }, Ee = (t, e = {}) => {
1357
- const r = he("resolver"), n = N(() => !r || !t?.value ? {} : r.value.resolve(
1355
+ return r ? typeof r == "function" && !("setup" in r) && !("render" in r) ? Et(r) : r : t.resolve(e.componentName)?.componentName || e.componentName;
1356
+ }, _e = (t, e = {}) => {
1357
+ const r = ge("resolver"), n = _(() => !r || !t?.value ? {} : r.value.resolve(
1358
1358
  t.value.componentName
1359
- )), o = N(() => n.value?.defaultProps || {}), s = N(
1360
- () => Kt(r?.value, t.value)
1361
- ), { props: a } = Ht(t, e), i = N(() => ({
1359
+ )), o = _(() => n.value?.defaultProps || {}), s = _(
1360
+ () => qt(r?.value, t.value)
1361
+ ), { props: a } = zt(t, e), i = _(() => ({
1362
1362
  ...o.value,
1363
1363
  ...t.value?.props,
1364
1364
  ...a.value
@@ -1370,48 +1370,48 @@ const Ft = (t, e) => {
1370
1370
  componentToRender: s,
1371
1371
  props: i
1372
1372
  };
1373
- }, Vt = /* @__PURE__ */ j({
1373
+ }, Yt = /* @__PURE__ */ B({
1374
1374
  name: "CraftCanvas",
1375
1375
  __name: "CraftCanvas",
1376
1376
  props: {
1377
1377
  componentName: {}
1378
1378
  },
1379
1379
  setup(t) {
1380
- const e = Xe(), r = gt(), n = t, o = N(() => ({
1380
+ const e = Qe(), r = Ct(), n = t, o = _(() => ({
1381
1381
  componentName: n.componentName,
1382
1382
  props: {},
1383
1383
  slots: {},
1384
1384
  uuid: ""
1385
- })), { componentToRender: s } = Ee(o);
1386
- return (a, i) => d(s) ? (v(), A(ye(d(s)), Ue(_e({ key: 0 }, d(r))), be({ _: 2 }, [
1387
- T(d(e), (l, u) => ({
1385
+ })), { componentToRender: s } = _e(o);
1386
+ return (a, i) => d(s) ? (v(), $(Ce(d(s)), Le(xe({ key: 0 }, d(r))), Ne({ _: 2 }, [
1387
+ U(d(e), (l, u) => ({
1388
1388
  name: u,
1389
- fn: q((p) => [
1390
- Q(a.$slots, u, Ue(yt(p || {})))
1389
+ fn: G((p) => [
1390
+ J(a.$slots, u, Le(Nt(p || {})))
1391
1391
  ])
1392
1392
  }))
1393
- ]), 1040)) : D("", !0);
1393
+ ]), 1040)) : M("", !0);
1394
1394
  }
1395
- }), Xt = () => {
1396
- const t = he("craftNode");
1395
+ }), Qt = () => {
1396
+ const t = ge("craftNode");
1397
1397
  if (!t)
1398
1398
  throw new Error("craftNode or resolver not provided");
1399
- const { resolver: e, resolvedNode: r, defaultProps: n } = Ee(t);
1399
+ const { resolver: e, resolvedNode: r, defaultProps: n } = _e(t);
1400
1400
  return {
1401
1401
  craftNode: t,
1402
1402
  resolver: e,
1403
1403
  resolvedNode: r,
1404
1404
  defaultProps: n
1405
1405
  };
1406
- }, We = (t) => t.visible === void 0 || t.visible, zt = (t) => {
1406
+ }, tt = (t) => t.visible === void 0 || t.visible, Gt = (t) => {
1407
1407
  let e = t;
1408
- const r = V();
1408
+ const r = q();
1409
1409
  for (; e.parentUuid; )
1410
- if (e = r.nodeMap.get(e.parentUuid), Y(e))
1410
+ if (e = r.nodeMap.get(e.parentUuid), W(e))
1411
1411
  return !0;
1412
1412
  return !1;
1413
- }, qt = (t) => zt(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, Ze = (t, e) => {
1414
- const r = V();
1413
+ }, Wt = (t) => Gt(t) ? t.rules?.canDrag ? t.rules.canDrag(t) : !0 : !1, rt = (t, e) => {
1414
+ const r = q();
1415
1415
  let n = e;
1416
1416
  for (; n?.parentUuid; ) {
1417
1417
  if (n.parentUuid === t.uuid)
@@ -1419,26 +1419,26 @@ const Ft = (t, e) => {
1419
1419
  n = r.nodeMap.get(n.parentUuid);
1420
1420
  }
1421
1421
  return !1;
1422
- }, ae = (t) => t.componentName === "CraftCanvas" ? t.props.componentName : t.componentName, fe = (t, e, r) => {
1423
- if (!Y(e) || t.uuid === e.uuid)
1422
+ }, ue = (t) => t.componentName === "CraftCanvas" ? t.props.componentName : t.componentName, me = (t, e, r) => {
1423
+ if (!W(e) || t.uuid === e.uuid)
1424
1424
  return !1;
1425
- const n = r.resolve(ae(e)), o = r.resolve(ae(t)), s = n?.rules || {}, a = o?.rules || {};
1425
+ const n = r.resolve(ue(e)), o = r.resolve(ue(t)), s = n?.rules || {}, a = o?.rules || {};
1426
1426
  if (t.parentUuid) {
1427
- const l = V().nodeMap.get(t.parentUuid), u = r.resolve(ae(l))?.rules || {};
1427
+ const l = q().nodeMap.get(t.parentUuid), u = r.resolve(ue(l))?.rules || {};
1428
1428
  if (u.canMoveOut && !u.canMoveOut(t, e, r))
1429
1429
  return;
1430
1430
  }
1431
- return !(a.canMoveInto && !a.canMoveInto(t, e, r) || Ze(t, e) || s.canMoveIn && !s.canMoveIn(t, e, r));
1432
- }, Y = (t) => t.componentName === "CraftCanvas", Ce = (t, e, r) => {
1433
- const n = V();
1434
- return e.uuid === t.uuid || !e.parentUuid ? !1 : fe(
1431
+ return !(a.canMoveInto && !a.canMoveInto(t, e, r) || rt(t, e) || s.canMoveIn && !s.canMoveIn(t, e, r));
1432
+ }, W = (t) => t.componentName === "CraftCanvas", Pe = (t, e, r) => {
1433
+ const n = q();
1434
+ return e.uuid === t.uuid || !e.parentUuid ? !1 : me(
1435
1435
  t,
1436
1436
  n.nodeMap.get(e.parentUuid),
1437
1437
  r
1438
1438
  );
1439
- }, Je = (t) => (t.uuid || (t.uuid = G()), t.slots && Object.values(t.slots).forEach((e) => {
1440
- e.forEach((r) => (r.uuid || (r.uuid = G()), r.parentUuid !== t.uuid && (r.parentUuid = t.uuid), Je(r), r));
1441
- }), t), et = (t, e) => {
1439
+ }, nt = (t) => (t.uuid || (t.uuid = ee()), t.slots && Object.values(t.slots).forEach((e) => {
1440
+ e.forEach((r) => (r.uuid || (r.uuid = ee()), r.parentUuid !== t.uuid && (r.parentUuid = t.uuid), nt(r), r));
1441
+ }), t), ot = (t, e) => {
1442
1442
  if (!t.slots || Object.keys(t.slots).length === 0) {
1443
1443
  const n = e.resolveNode?.(t)?.slots;
1444
1444
  n && n.length > 0 ? (t.slots = {}, n.forEach((o) => {
@@ -1446,7 +1446,7 @@ const Ft = (t, e) => {
1446
1446
  })) : t.slots = { default: [] };
1447
1447
  }
1448
1448
  return t;
1449
- }, V = Ye("editor", {
1449
+ }, q = Ze("editor", {
1450
1450
  state: () => ({
1451
1451
  nodeMap: /* @__PURE__ */ new Map(),
1452
1452
  rootNodes: [],
@@ -1457,7 +1457,9 @@ const Ft = (t, e) => {
1457
1457
  resolver: null,
1458
1458
  eventsContext: {},
1459
1459
  nodeDataMap: {},
1460
- draggingDisabled: !1
1460
+ draggingDisabled: !1,
1461
+ nodeRuntimeProps: {},
1462
+ pageState: {}
1461
1463
  }),
1462
1464
  actions: {
1463
1465
  clear() {
@@ -1484,7 +1486,7 @@ const Ft = (t, e) => {
1484
1486
  toggleNodeVisibility(t) {
1485
1487
  const e = this.nodeMap.get(t.uuid);
1486
1488
  if (e) {
1487
- if (e.visible = !We(e), e.slots) {
1489
+ if (e.visible = !tt(e), e.slots) {
1488
1490
  const r = (n) => (n.visible = e.visible, n.slots && Object.values(n.slots).forEach((o) => {
1489
1491
  o.forEach((s) => r(s));
1490
1492
  }), this.nodeMap.set(n.uuid, n), n);
@@ -1513,7 +1515,7 @@ const Ft = (t, e) => {
1513
1515
  setNodes(t) {
1514
1516
  this.clear(), this.rootNodes = [];
1515
1517
  const e = (r) => {
1516
- this.resolver && r.componentName === "CraftCanvas" && et(r, this.resolver);
1518
+ this.resolver && r.componentName === "CraftCanvas" && ot(r, this.resolver);
1517
1519
  const n = r.slots ? {} : { default: [] };
1518
1520
  r.slots && Object.keys(r.slots).forEach((o) => {
1519
1521
  n[o] = [];
@@ -1526,8 +1528,8 @@ const Ft = (t, e) => {
1526
1528
  t.forEach(e);
1527
1529
  },
1528
1530
  addNodeRecursively(t, e = null) {
1529
- const r = t.uuid || G(), n = { ...t, uuid: r, parentUuid: e };
1530
- this.nodeMap.set(r, ze(n)), e || this.rootNodes.push(r), t.slots && Object.values(t.slots).forEach((o) => {
1531
+ const r = t.uuid || ee(), n = { ...t, uuid: r, parentUuid: e };
1532
+ this.nodeMap.set(r, Ge(n)), e || this.rootNodes.push(r), t.slots && Object.values(t.slots).forEach((o) => {
1531
1533
  o.forEach((s) => this.addNodeRecursively(s, r));
1532
1534
  });
1533
1535
  },
@@ -1567,11 +1569,11 @@ const Ft = (t, e) => {
1567
1569
  },
1568
1570
  appendNodeTo(t, e, r = "default") {
1569
1571
  if (!this.resolver) throw new Error("Resolver is not set.");
1570
- if (!fe(t, e, this.resolver))
1572
+ if (!me(t, e, this.resolver))
1571
1573
  throw new Error(
1572
- `${ae(
1574
+ `${ue(
1573
1575
  t
1574
- )} is not allowed to be a child of ${ae(e)}.`
1576
+ )} is not allowed to be a child of ${ue(e)}.`
1575
1577
  );
1576
1578
  t = this.emancipateNode(t), t.parentUuid = e.uuid;
1577
1579
  const n = this.nodeMap.get(e.uuid);
@@ -1579,11 +1581,11 @@ const Ft = (t, e) => {
1579
1581
  },
1580
1582
  prependNodeTo(t, e, r = "default") {
1581
1583
  if (!this.resolver) throw new Error("Resolver is not set");
1582
- if (!fe(t, e, this.resolver))
1584
+ if (!me(t, e, this.resolver))
1583
1585
  throw new Error(
1584
- `${ae(
1586
+ `${ue(
1585
1587
  t
1586
- )} is not allowed to be a child of ${ae(e)}.`
1588
+ )} is not allowed to be a child of ${ue(e)}.`
1587
1589
  );
1588
1590
  t = this.emancipateNode(t), t.parentUuid = e.uuid;
1589
1591
  const n = this.nodeMap.get(e.uuid);
@@ -1591,7 +1593,7 @@ const Ft = (t, e) => {
1591
1593
  },
1592
1594
  insertNodeBefore(t, e, r) {
1593
1595
  if (!this.resolver) throw new Error("Resolver is not set");
1594
- if (!Ce(t, e, this.resolver))
1596
+ if (!Pe(t, e, this.resolver))
1595
1597
  throw new Error("Can not be the sibling of the target node.");
1596
1598
  t = this.emancipateNode(t);
1597
1599
  const n = e.parentUuid;
@@ -1611,7 +1613,7 @@ const Ft = (t, e) => {
1611
1613
  },
1612
1614
  insertNodeAfter(t, e, r) {
1613
1615
  if (!this.resolver) throw new Error("Resolver is not set");
1614
- if (!Ce(t, e, this.resolver))
1616
+ if (!Pe(t, e, this.resolver))
1615
1617
  throw new Error("Can not be the sibling of the target node.");
1616
1618
  t = this.emancipateNode(t);
1617
1619
  const n = e.parentUuid;
@@ -1631,6 +1633,9 @@ const Ft = (t, e) => {
1631
1633
  },
1632
1634
  setEventsContext(t) {
1633
1635
  this.eventsContext = t;
1636
+ },
1637
+ setNodeRuntimeProps(t, e) {
1638
+ this.nodeRuntimeProps[t] = { ...this.nodeRuntimeProps[t] || {}, ...e };
1634
1639
  }
1635
1640
  },
1636
1641
  getters: {
@@ -1658,7 +1663,7 @@ const Ft = (t, e) => {
1658
1663
  return t.rootNodes.map((r) => e(r));
1659
1664
  }
1660
1665
  }
1661
- }), Yt = ["value", "onKeyup"], Qt = /* @__PURE__ */ j({
1666
+ }), Zt = ["value", "onKeyup"], Jt = /* @__PURE__ */ B({
1662
1667
  __name: "CraftComponentSimpleText",
1663
1668
  props: {
1664
1669
  content: { default: "Lorem ipsum dolor sit amet..." },
@@ -1669,36 +1674,36 @@ const Ft = (t, e) => {
1669
1674
  setup(t, { emit: e }) {
1670
1675
  const r = t, n = e, s = (() => {
1671
1676
  try {
1672
- return V();
1677
+ return q();
1673
1678
  } catch {
1674
1679
  return null;
1675
1680
  }
1676
- })(), a = s ? te(s).enabled : H(!1), i = H(!1), l = H(null), u = H(""), { craftNode: p } = Xt(), m = N(() => !!s && a.value), f = N(() => m.value && !i.value), h = () => {
1677
- f.value && y();
1678
- }, y = () => {
1679
- u.value = r.content, i.value = !0, s?.disableDragging(), pe(() => {
1680
- l.value && (l.value.focus(), x());
1681
+ })(), a = s ? se(s).enabled : K(!1), i = K(!1), l = K(null), u = K(""), { craftNode: p } = Qt(), m = _(() => !!s && a.value), f = _(() => m.value && !i.value), h = () => {
1682
+ f.value && g();
1683
+ }, g = () => {
1684
+ u.value = r.content, i.value = !0, s?.disableDragging(), ve(() => {
1685
+ l.value && (l.value.focus(), P());
1681
1686
  });
1682
- }, x = () => {
1687
+ }, P = () => {
1683
1688
  l.value && (l.value.style.height = "auto", l.value.style.height = `${l.value.scrollHeight}px`);
1684
- }, P = async () => {
1689
+ }, A = async () => {
1685
1690
  if (s?.enableDragging(), !i.value) return;
1686
1691
  i.value = !1;
1687
- const E = l.value?.value.trim() ?? "";
1688
- E !== r.content && p.value?.uuid && (s?.nodeMap.set(p.value.uuid, {
1692
+ const b = l.value?.value.trim() ?? "";
1693
+ b !== r.content && p.value?.uuid && (s?.nodeMap.set(p.value.uuid, {
1689
1694
  ...p.value,
1690
1695
  props: {
1691
1696
  ...p.value.props,
1692
- content: E
1697
+ content: b
1693
1698
  }
1694
- }), await pe(), n("update:content", E));
1695
- }, g = () => {
1699
+ }), await ve(), n("update:content", b));
1700
+ }, C = () => {
1696
1701
  i.value = !1, n("update:content", u.value);
1697
1702
  };
1698
- return s && J(a, (E) => {
1699
- !E && i.value && g();
1700
- }), (E, b) => (v(), A(ye(t.componentName), {
1701
- class: ve({
1703
+ return s && ne(a, (b) => {
1704
+ !b && i.value && C();
1705
+ }), (b, T) => (v(), $(Ce(t.componentName), {
1706
+ class: ye({
1702
1707
  "pre-wrap": !i.value,
1703
1708
  "editable-text": m.value,
1704
1709
  "is-editable": m.value,
@@ -1706,31 +1711,31 @@ const Ft = (t, e) => {
1706
1711
  }),
1707
1712
  onDblclick: h
1708
1713
  }, {
1709
- default: q(() => [
1710
- oe(ee(i.value ? "" : t.content) + " ", 1),
1711
- i.value ? (v(), _("textarea", {
1714
+ default: G(() => [
1715
+ ie(oe(i.value ? "" : t.content) + " ", 1),
1716
+ i.value ? (v(), N("textarea", {
1712
1717
  key: 0,
1713
1718
  ref_key: "textareaRef",
1714
1719
  ref: l,
1715
1720
  class: "editable-text__textarea",
1716
1721
  value: t.content,
1717
- onInput: x,
1718
- onBlur: P,
1722
+ onInput: P,
1723
+ onBlur: A,
1719
1724
  onKeyup: [
1720
- je(F(P, ["exact"]), ["enter"]),
1721
- je(g, ["esc"])
1725
+ Fe(V(A, ["exact"]), ["enter"]),
1726
+ Fe(C, ["esc"])
1722
1727
  ]
1723
- }, null, 40, Yt)) : D("", !0)
1728
+ }, null, 40, Zt)) : M("", !0)
1724
1729
  ]),
1725
1730
  _: 1
1726
1731
  }, 40, ["class"]));
1727
1732
  }
1728
1733
  });
1729
- class xe {
1734
+ class Oe {
1730
1735
  resolverMap = {};
1731
1736
  resolveComponentHook;
1732
1737
  constructor(e = {}) {
1733
- return this.setResolverMap(e), ze(this);
1738
+ return this.setResolverMap(e), Ge(this);
1734
1739
  }
1735
1740
  setResolverMap(e) {
1736
1741
  this.resolverMap = {}, Object.entries(e).forEach(([r, n]) => {
@@ -1744,7 +1749,7 @@ class xe {
1744
1749
  return this.resolverMap[e];
1745
1750
  }
1746
1751
  resolveComponent(e) {
1747
- const r = Y(e) ? e.props.componentName : e.componentName, n = (o) => {
1752
+ const r = W(e) ? e.props.componentName : e.componentName, n = (o) => {
1748
1753
  const s = this.resolve(o);
1749
1754
  if (s?.component)
1750
1755
  return typeof s.component == "function" && !("setup" in s.component) && !("render" in s.component), s.component;
@@ -1760,7 +1765,7 @@ class xe {
1760
1765
  return this.resolveNode(e)?.defaultProps || {};
1761
1766
  }
1762
1767
  resolveNode(e) {
1763
- return Y(e) ? this.resolve(e.props.componentName) : this.resolve(e.componentName);
1768
+ return W(e) ? this.resolve(e.props.componentName) : this.resolve(e.componentName);
1764
1769
  }
1765
1770
  getSchema(e) {
1766
1771
  return this.resolveNode(e)?.propsSchema || {};
@@ -1775,7 +1780,7 @@ class xe {
1775
1780
  return this.resolveNode(e)?.slotsProps || {};
1776
1781
  }
1777
1782
  }
1778
- const Re = Ye("indicator", {
1783
+ const Ue = Ze("indicator", {
1779
1784
  state: () => ({
1780
1785
  barSize: 2,
1781
1786
  visible: !1,
@@ -1811,12 +1816,12 @@ const Re = Ye("indicator", {
1811
1816
  },
1812
1817
  pointInside(t) {
1813
1818
  this.show();
1814
- const e = Le(t), { top: r, left: n, width: o, height: s } = t.getBoundingClientRect(), a = Number.parseInt(e.paddingLeft), i = Number.parseInt(e.paddingTop), l = Number.parseInt(e.paddingRight);
1819
+ const e = Ke(t), { top: r, left: n, width: o, height: s } = t.getBoundingClientRect(), a = Number.parseInt(e.paddingLeft), i = Number.parseInt(e.paddingTop), l = Number.parseInt(e.paddingRight);
1815
1820
  this.coordinates.top = r + s - i, this.coordinates.left = n + a, this.dimensions.width = o - a - l, this.dimensions.height = this.barSize;
1816
1821
  },
1817
1822
  pointInsideTop(t) {
1818
1823
  this.show();
1819
- const e = Le(t), { top: r, left: n, width: o } = t.getBoundingClientRect(), s = Number.parseInt(e.paddingLeft), a = Number.parseInt(e.paddingTop), i = Number.parseInt(e.paddingRight);
1824
+ const e = Ke(t), { top: r, left: n, width: o } = t.getBoundingClientRect(), s = Number.parseInt(e.paddingLeft), a = Number.parseInt(e.paddingTop), i = Number.parseInt(e.paddingRight);
1820
1825
  this.coordinates.top = r + a, this.coordinates.left = n + s, this.dimensions.width = o - s - i, this.dimensions.height = this.barSize;
1821
1826
  }
1822
1827
  },
@@ -1827,7 +1832,7 @@ const Re = Ye("indicator", {
1827
1832
  size: (t) => t.dimensions
1828
1833
  }
1829
1834
  });
1830
- function Le(t) {
1835
+ function Ke(t) {
1831
1836
  if (!(t instanceof HTMLElement))
1832
1837
  return {
1833
1838
  paddingTop: "0",
@@ -1845,7 +1850,7 @@ function Le(t) {
1845
1850
  s[a] = parseInt(s[a].slice(0, -2), 10);
1846
1851
  }), s;
1847
1852
  }
1848
- const Gt = /* @__PURE__ */ j({
1853
+ const er = /* @__PURE__ */ B({
1849
1854
  __name: "CraftEditor",
1850
1855
  props: {
1851
1856
  config: {},
@@ -1853,26 +1858,26 @@ const Gt = /* @__PURE__ */ j({
1853
1858
  },
1854
1859
  emits: ["nodeDragStart", "nodeDragEnd", "iframeLoad"],
1855
1860
  setup(t, { emit: e }) {
1856
- const r = t, n = e, o = V(), s = Re(), { getDraggedNode: a } = te(o);
1857
- J(a, (l) => {
1861
+ const r = t, n = e, o = q(), s = Ue(), { getDraggedNode: a } = se(o);
1862
+ ne(a, (l) => {
1858
1863
  if (l) {
1859
1864
  n("nodeDragStart", l);
1860
1865
  return;
1861
1866
  }
1862
1867
  n("nodeDragEnd"), s.hide();
1863
1868
  });
1864
- const i = H(
1865
- r.config.resolver || new xe(r.config.resolverMap)
1869
+ const i = K(
1870
+ r.config.resolver || new Oe(r.config.resolverMap)
1866
1871
  );
1867
- return W("resolver", i), (l, u) => {
1868
- const p = B("CraftFrame"), m = B("CraftEditorPanelLayout");
1869
- return v(), A(m, {
1872
+ return te("resolver", i), (l, u) => {
1873
+ const p = H("CraftFrame"), m = H("CraftEditorPanelLayout");
1874
+ return v(), $(m, {
1870
1875
  blueprints: t.config.blueprintsLibrary
1871
- }, be({ _: 2 }, [
1876
+ }, Ne({ _: 2 }, [
1872
1877
  l.$slots["panel-layout"] ? {
1873
1878
  name: "panel-layout",
1874
- fn: q(({ blueprints: f, deselectNodes: h }) => [
1875
- Q(l.$slots, "panel-layout", {
1879
+ fn: G(({ blueprints: f, deselectNodes: h }) => [
1880
+ J(l.$slots, "panel-layout", {
1876
1881
  blueprints: f,
1877
1882
  deselectNodes: h
1878
1883
  })
@@ -1880,14 +1885,14 @@ const Gt = /* @__PURE__ */ j({
1880
1885
  key: "0"
1881
1886
  } : {
1882
1887
  name: "default",
1883
- fn: q(() => [
1884
- z(p, {
1888
+ fn: G(() => [
1889
+ Q(p, {
1885
1890
  iframe: t.iframe,
1886
1891
  resolverMap: t.config.resolverMap,
1887
1892
  onIframeLoad: u[0] || (u[0] = (f) => n("iframeLoad", f))
1888
1893
  }, {
1889
- default: q(() => [
1890
- Q(l.$slots, "default")
1894
+ default: G(() => [
1895
+ J(l.$slots, "default")
1891
1896
  ]),
1892
1897
  _: 3
1893
1898
  }, 8, ["iframe", "resolverMap"])
@@ -1897,69 +1902,69 @@ const Gt = /* @__PURE__ */ j({
1897
1902
  ]), 1032, ["blueprints"]);
1898
1903
  };
1899
1904
  }
1900
- }), Wt = /* @__PURE__ */ j({
1905
+ }), tr = /* @__PURE__ */ B({
1901
1906
  name: "CraftEditorBlueprint",
1902
1907
  __name: "CraftEditorBlueprint",
1903
1908
  props: {
1904
1909
  craftNode: {}
1905
1910
  },
1906
1911
  setup(t) {
1907
- const e = V(), r = t, n = (s) => {
1912
+ const e = q(), r = t, n = (s) => {
1908
1913
  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);
1909
1914
  }, o = (s) => {
1910
1915
  s.stopPropagation(), e.dragNode(null);
1911
1916
  };
1912
- return (s, a) => (v(), _("div", {
1917
+ return (s, a) => (v(), N("div", {
1913
1918
  draggable: !0,
1914
- onDragstart: F(n, ["stop"]),
1919
+ onDragstart: V(n, ["stop"]),
1915
1920
  onDragend: o
1916
1921
  }, [
1917
- Q(s.$slots, "default")
1922
+ J(s.$slots, "default")
1918
1923
  ], 32));
1919
1924
  }
1920
- }), tt = (t, e) => Object.keys(t.blueprints).map((r) => {
1925
+ }), st = (t, e) => Object.keys(t.blueprints).map((r) => {
1921
1926
  const n = t.blueprints[r], o = e.getDefaultProps({
1922
1927
  ...n,
1923
- uuid: G()
1928
+ uuid: ee()
1924
1929
  });
1925
1930
  return {
1926
1931
  ...n,
1927
1932
  props: { ...o, ...n.props }
1928
1933
  };
1929
- }), rt = (t) => {
1934
+ }), at = (t) => {
1930
1935
  let e = 0;
1931
1936
  for (let s = 0; s < t.length; s++)
1932
1937
  e = t.charCodeAt(s) + ((e << 5) - e);
1933
1938
  const r = e % 360, n = 70 + e % 30, o = 45 + e % 30;
1934
1939
  return `hsla(${r}, ${n}%, ${o}%, 0.9)`;
1935
- }, Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1940
+ }, rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1936
1941
  __proto__: null,
1937
- blueprintsWithDefaults: tt,
1938
- generateColorFromUUID: rt
1939
- }, Symbol.toStringTag, { value: "Module" })), Jt = { key: 0 }, er = { class: "flex flex-wrap gap-2 p-1" }, tr = { class: "v-craft-blueprint" }, rr = { class: "v-craft-blueprint-label" }, nr = /* @__PURE__ */ j({
1942
+ blueprintsWithDefaults: st,
1943
+ generateColorFromUUID: at
1944
+ }, Symbol.toStringTag, { value: "Module" })), nr = { key: 0 }, or = { class: "flex flex-wrap gap-2 p-1" }, sr = { class: "v-craft-blueprint" }, ar = { class: "v-craft-blueprint-label" }, ir = /* @__PURE__ */ B({
1940
1945
  __name: "CraftEditorBlueprintsList",
1941
1946
  props: {
1942
1947
  blueprints: {}
1943
1948
  },
1944
1949
  setup(t) {
1945
- const e = he("resolver");
1950
+ const e = ge("resolver");
1946
1951
  return (r, n) => {
1947
- const o = B("CraftEditorBlueprint");
1948
- return d(e) ? (v(), _("div", Jt, [
1949
- (v(!0), _(U, null, T(t.blueprints.groups, (s) => (v(), _("div", null, [
1950
- Q(r.$slots, "blueprint-group", {
1952
+ const o = H("CraftEditorBlueprint");
1953
+ return d(e) ? (v(), N("div", nr, [
1954
+ (v(!0), N(j, null, U(t.blueprints.groups, (s) => (v(), N("div", null, [
1955
+ J(r.$slots, "blueprint-group", {
1951
1956
  group: s,
1952
1957
  resolver: d(e)
1953
1958
  }, () => [
1954
- w("h4", null, ee(s.label), 1),
1955
- w("div", er, [
1956
- (v(!0), _(U, null, T(d(tt)(s, d(e)), (a, i) => (v(), A(o, {
1959
+ O("h4", null, oe(s.label), 1),
1960
+ O("div", or, [
1961
+ (v(!0), N(j, null, U(d(st)(s, d(e)), (a, i) => (v(), $(o, {
1957
1962
  craftNode: a,
1958
1963
  key: i
1959
1964
  }, {
1960
- default: q(() => [
1961
- w("div", tr, [
1962
- w("div", rr, ee(a.label), 1)
1965
+ default: G(() => [
1966
+ O("div", sr, [
1967
+ O("div", ar, oe(a.label), 1)
1963
1968
  ])
1964
1969
  ]),
1965
1970
  _: 2
@@ -1967,10 +1972,10 @@ const Gt = /* @__PURE__ */ j({
1967
1972
  ])
1968
1973
  ])
1969
1974
  ]))), 256))
1970
- ])) : D("", !0);
1975
+ ])) : M("", !0);
1971
1976
  };
1972
1977
  }
1973
- }), or = { class: "v-craft-panel v-craft-blueprints-panel" }, sr = { class: "v-craft-panel-content" }, ar = /* @__PURE__ */ j({
1978
+ }), lr = { class: "v-craft-panel v-craft-blueprints-panel" }, ur = { class: "v-craft-panel-content" }, cr = /* @__PURE__ */ B({
1974
1979
  name: "CraftEditorPanelBlueprints",
1975
1980
  __name: "CraftEditorPanelBlueprints",
1976
1981
  props: {
@@ -1979,21 +1984,21 @@ const Gt = /* @__PURE__ */ j({
1979
1984
  emits: ["close"],
1980
1985
  setup(t) {
1981
1986
  return (e, r) => {
1982
- const n = B("CraftEditorBlueprintsList");
1983
- return v(), _("div", or, [
1984
- r[0] || (r[0] = w("h3", { class: "v-craft-title" }, "blueprints", -1)),
1985
- w("div", sr, [
1986
- z(n, { blueprints: t.blueprints }, null, 8, ["blueprints"])
1987
+ const n = H("CraftEditorBlueprintsList");
1988
+ return v(), N("div", lr, [
1989
+ r[0] || (r[0] = O("h3", { class: "v-craft-title" }, "blueprints", -1)),
1990
+ O("div", ur, [
1991
+ Q(n, { blueprints: t.blueprints }, null, 8, ["blueprints"])
1987
1992
  ])
1988
1993
  ]);
1989
1994
  };
1990
1995
  }
1991
- }), ge = (t, e) => {
1996
+ }), Ee = (t, e) => {
1992
1997
  const r = t.__vccOpts || t;
1993
1998
  for (const [n, o] of e)
1994
1999
  r[n] = o;
1995
2000
  return r;
1996
- }, ir = /* @__PURE__ */ ge(ar, [["__scopeId", "data-v-a6de4dca"]]), lr = /* @__PURE__ */ j({
2001
+ }, dr = /* @__PURE__ */ Ee(cr, [["__scopeId", "data-v-a6de4dca"]]), pr = /* @__PURE__ */ B({
1997
2002
  __name: "CraftEditorPanelForm",
1998
2003
  props: {
1999
2004
  craftNode: {},
@@ -2002,34 +2007,34 @@ const Gt = /* @__PURE__ */ j({
2002
2007
  },
2003
2008
  emits: ["update"],
2004
2009
  setup(t, { emit: e }) {
2005
- const r = t, n = e, o = de(r, "model"), s = de(r, "schema"), a = de(r, "craftNode"), i = N(
2010
+ const r = t, n = e, o = he(r, "model"), s = he(r, "schema"), a = he(r, "craftNode"), i = _(
2006
2011
  () => o.value ? { ...o.value } : {}
2007
- ), l = Qe((p) => {
2012
+ ), l = Je((p) => {
2008
2013
  n("update", p);
2009
2014
  }, 50), u = (p) => {
2010
2015
  p != null && l(p);
2011
2016
  };
2012
- return bt(() => l.cancel()), (p, m) => Q(p.$slots, "panel-content", {
2017
+ return _t(() => l.cancel()), (p, m) => J(p.$slots, "panel-content", {
2013
2018
  craftNode: a.value,
2014
2019
  model: i.value,
2015
2020
  handleFormInput: u,
2016
2021
  schema: s.value
2017
2022
  });
2018
2023
  }
2019
- }), ur = { class: "v-craft-panel v-craft-layers-panel" }, cr = { class: "v-craft-layers" }, dr = { class: "v-craft-node-layers" }, pr = /* @__PURE__ */ j({
2024
+ }), fr = { class: "v-craft-panel v-craft-layers-panel" }, hr = { class: "v-craft-layers" }, vr = { class: "v-craft-node-layers" }, mr = /* @__PURE__ */ B({
2020
2025
  name: "CraftEditorPanelLayers",
2021
2026
  __name: "CraftEditorPanelLayers",
2022
2027
  setup(t) {
2023
- const e = V(), { nodeTree: r } = te(e), n = (o) => {
2028
+ const e = q(), { nodeTree: r } = se(e), n = (o) => {
2024
2029
  e.selectNode(o);
2025
2030
  };
2026
2031
  return (o, s) => {
2027
- const a = B("CraftEditorPanelNodeLayer");
2028
- return v(), _("div", ur, [
2029
- s[0] || (s[0] = w("h3", { class: "v-craft-title" }, "tree", -1)),
2030
- w("div", cr, [
2031
- w("ul", dr, [
2032
- (v(!0), _(U, null, T(d(r), (i, l) => (v(), A(a, {
2032
+ const a = H("CraftEditorPanelNodeLayer");
2033
+ return v(), N("div", fr, [
2034
+ s[0] || (s[0] = O("h3", { class: "v-craft-title" }, "tree", -1)),
2035
+ O("div", hr, [
2036
+ O("ul", vr, [
2037
+ (v(!0), N(j, null, U(d(r), (i, l) => (v(), $(a, {
2033
2038
  key: l,
2034
2039
  craftNode: i,
2035
2040
  onLayerClick: n
@@ -2039,51 +2044,51 @@ const Gt = /* @__PURE__ */ j({
2039
2044
  ]);
2040
2045
  };
2041
2046
  }
2042
- }), fr = /* @__PURE__ */ ge(pr, [["__scopeId", "data-v-ab795ec3"]]), hr = { key: 0 }, vr = {
2047
+ }), gr = /* @__PURE__ */ Ee(mr, [["__scopeId", "data-v-ab795ec3"]]), yr = { key: 0 }, br = {
2043
2048
  key: 1,
2044
2049
  class: "v-craft-panel-manager"
2045
- }, mr = { class: "flex w-full justify-between gap-10" }, gr = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, yr = { class: "v-craft-grid-panel v-craft-panel-right shrink max-w-[20vw]" }, br = /* @__PURE__ */ j({
2050
+ }, Er = { class: "flex w-full justify-between gap-10" }, Cr = { class: "v-craft-grid-panel v-craft-panel-left shrink" }, Nr = { class: "v-craft-grid-panel v-craft-panel-right shrink max-w-[20vw]" }, _r = /* @__PURE__ */ B({
2046
2051
  __name: "CraftEditorPanelLayout",
2047
2052
  props: {
2048
2053
  blueprints: {}
2049
2054
  },
2050
2055
  setup(t) {
2051
- const e = V(), r = () => {
2056
+ const e = q(), r = () => {
2052
2057
  e.selectNode(null);
2053
2058
  };
2054
2059
  return (n, o) => {
2055
- const s = B("CraftEditorPanelBlueprints"), a = B("CraftEditorPanelLayers"), i = B("CraftEditorPanelSettings");
2056
- return n.$slots["panel-layout"] ? (v(), _("div", hr, [
2057
- Q(n.$slots, "panel-layout", {
2060
+ const s = H("CraftEditorPanelBlueprints"), a = H("CraftEditorPanelLayers"), i = H("CraftEditorPanelSettings");
2061
+ return n.$slots["panel-layout"] ? (v(), N("div", yr, [
2062
+ J(n.$slots, "panel-layout", {
2058
2063
  blueprints: t.blueprints,
2059
2064
  deselectNodes: r
2060
2065
  }, void 0, !0)
2061
- ])) : (v(), _("div", vr, [
2062
- w("div", mr, [
2063
- w("div", gr, [
2064
- z(s, { blueprints: t.blueprints }, null, 8, ["blueprints"])
2066
+ ])) : (v(), N("div", br, [
2067
+ O("div", Er, [
2068
+ O("div", Cr, [
2069
+ Q(s, { blueprints: t.blueprints }, null, 8, ["blueprints"])
2065
2070
  ]),
2066
- w("div", {
2071
+ O("div", {
2067
2072
  class: "v-craft-panel-center flex grow",
2068
- onClick: F(r, ["stop"])
2073
+ onClick: V(r, ["stop"])
2069
2074
  }, [
2070
- Q(n.$slots, "default", {}, void 0, !0)
2075
+ J(n.$slots, "default", {}, void 0, !0)
2071
2076
  ]),
2072
- w("div", yr, [
2073
- z(a),
2074
- z(i)
2077
+ O("div", Nr, [
2078
+ Q(a),
2079
+ Q(i)
2075
2080
  ])
2076
2081
  ])
2077
2082
  ]));
2078
2083
  };
2079
2084
  }
2080
- }), Er = /* @__PURE__ */ ge(br, [["__scopeId", "data-v-7dd1d43b"]]), Cr = {
2085
+ }), Pr = /* @__PURE__ */ Ee(_r, [["__scopeId", "data-v-7dd1d43b"]]), xr = {
2081
2086
  key: 0,
2082
2087
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2083
- }, _r = {
2088
+ }, Sr = {
2084
2089
  key: 0,
2085
2090
  class: "formkit-help v-craft-data-source-error"
2086
- }, Nr = /* @__PURE__ */ j({
2091
+ }, Or = /* @__PURE__ */ B({
2087
2092
  __name: "CraftEditorPanelNodeDataSourceSettings",
2088
2093
  props: {
2089
2094
  craftNode: {},
@@ -2091,8 +2096,8 @@ const Gt = /* @__PURE__ */ j({
2091
2096
  },
2092
2097
  emits: ["update:nodeData"],
2093
2098
  setup(t, { emit: e }) {
2094
- const r = t, n = e, o = de(r, "craftNode"), s = H("single"), a = H(""), i = H("");
2095
- J(() => o.value?.uuid, () => {
2099
+ const r = t, n = e, o = he(r, "craftNode"), s = K("single"), a = K(""), i = K("");
2100
+ ne(() => o.value?.uuid, () => {
2096
2101
  const f = r.nodeData;
2097
2102
  s.value = f?.type === "list" ? "list" : "single", a.value = f ? JSON.stringify(
2098
2103
  f.type === "list" ? f.list || [] : f.item || {},
@@ -2119,20 +2124,20 @@ const Gt = /* @__PURE__ */ j({
2119
2124
  }, m = (f) => {
2120
2125
  a.value = f, u();
2121
2126
  };
2122
- return (f, h) => o.value ? (v(), _("fieldset", Cr, [
2123
- h[2] || (h[2] = w("legend", { class: "formkit-legend" }, "Data Source", -1)),
2124
- h[3] || (h[3] = w("p", { class: "formkit-help" }, [
2125
- oe(" Paste JSON here to experiment with mapping data fields into this subtree's props. Descendants read it via "),
2126
- w("code", null, "slotsPropsPropsMap"),
2127
- oe(" using the reserved "),
2128
- w("code", null, "data"),
2129
- oe(" context bucket (e.g. "),
2130
- w("code", null, '{ data: { title: "$.name" } }'),
2131
- oe("). This panel is a convenience for experimentation - production apps normally feed real data in via "),
2132
- w("code", null, "editor.setNodeData()"),
2133
- oe(" directly. ")
2127
+ return (f, h) => o.value ? (v(), N("fieldset", xr, [
2128
+ h[2] || (h[2] = O("legend", { class: "formkit-legend" }, "Data Source", -1)),
2129
+ h[3] || (h[3] = O("p", { class: "formkit-help" }, [
2130
+ ie(" Paste JSON here to experiment with mapping data fields into this subtree's props. Descendants read it via "),
2131
+ O("code", null, "slotsPropsPropsMap"),
2132
+ ie(" using the reserved "),
2133
+ O("code", null, "data"),
2134
+ ie(" context bucket (e.g. "),
2135
+ O("code", null, '{ data: { title: "$.name" } }'),
2136
+ ie("). This panel is a convenience for experimentation - production apps normally feed real data in via "),
2137
+ O("code", null, "editor.setNodeData()"),
2138
+ ie(" directly. ")
2134
2139
  ], -1)),
2135
- z(d(se), {
2140
+ Q(d(le), {
2136
2141
  type: "select",
2137
2142
  label: "Type",
2138
2143
  options: [
@@ -2140,22 +2145,22 @@ const Gt = /* @__PURE__ */ j({
2140
2145
  { value: "list", label: "List" }
2141
2146
  ],
2142
2147
  value: s.value,
2143
- onInput: h[0] || (h[0] = (y) => p(String(y ?? "single")))
2148
+ onInput: h[0] || (h[0] = (g) => p(String(g ?? "single")))
2144
2149
  }, null, 8, ["value"]),
2145
- z(d(se), {
2150
+ Q(d(le), {
2146
2151
  type: "textarea",
2147
2152
  label: "JSON",
2148
2153
  placeholder: s.value === "list" ? '[{ "title": "Alice" }, { "title": "Bob" }]' : '{ "title": "Alice" }',
2149
2154
  value: a.value,
2150
- onInput: h[1] || (h[1] = (y) => m(String(y ?? "")))
2155
+ onInput: h[1] || (h[1] = (g) => m(String(g ?? "")))
2151
2156
  }, null, 8, ["placeholder", "value"]),
2152
- i.value ? (v(), _("p", _r, ee(i.value), 1)) : D("", !0)
2153
- ])) : D("", !0);
2157
+ i.value ? (v(), N("p", Sr, oe(i.value), 1)) : M("", !0)
2158
+ ])) : M("", !0);
2154
2159
  }
2155
- }), xr = /* @__PURE__ */ ge(Nr, [["__scopeId", "data-v-7c1c5696"]]), Or = {
2160
+ }), wr = /* @__PURE__ */ Ee(Or, [["__scopeId", "data-v-7c1c5696"]]), kr = {
2156
2161
  key: 0,
2157
2162
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2158
- }, wr = /* @__PURE__ */ j({
2163
+ }, Dr = /* @__PURE__ */ B({
2159
2164
  __name: "CraftEditorPanelNodeEventsSettings",
2160
2165
  props: {
2161
2166
  craftNode: {},
@@ -2163,40 +2168,40 @@ const Gt = /* @__PURE__ */ j({
2163
2168
  },
2164
2169
  emits: ["update:events"],
2165
2170
  setup(t, { emit: e }) {
2166
- const r = t, { craftNode: n, schema: o } = me(r), s = e;
2171
+ const r = t, { craftNode: n, schema: o } = be(r), s = e;
2167
2172
  return (a, i) => {
2168
- const l = B("CraftEditorPanelForm");
2169
- return v(), A(l, {
2173
+ const l = H("CraftEditorPanelForm");
2174
+ return v(), $(l, {
2170
2175
  craftNode: d(n),
2171
2176
  schema: d(o),
2172
2177
  model: d(n)?.events,
2173
2178
  onUpdate: i[0] || (i[0] = (u) => s("update:events", u))
2174
2179
  }, {
2175
- "panel-content": q(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2176
- f ? (v(), _("fieldset", Or, [
2177
- i[1] || (i[1] = w("legend", { class: "formkit-legend" }, "Events", -1)),
2178
- (v(), A(d(se), {
2180
+ "panel-content": G(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2181
+ f ? (v(), N("fieldset", kr, [
2182
+ i[1] || (i[1] = O("legend", { class: "formkit-legend" }, "Events", -1)),
2183
+ (v(), $(d(le), {
2179
2184
  key: u?.uuid,
2180
2185
  type: "form",
2181
2186
  value: p,
2182
2187
  onInput: m,
2183
2188
  actions: !1
2184
2189
  }, {
2185
- default: q(() => [
2186
- z(d(Ge), { schema: f }, null, 8, ["schema"])
2190
+ default: G(() => [
2191
+ Q(d(et), { schema: f }, null, 8, ["schema"])
2187
2192
  ]),
2188
2193
  _: 2
2189
2194
  }, 1032, ["value", "onInput"]))
2190
- ])) : D("", !0)
2195
+ ])) : M("", !0)
2191
2196
  ]),
2192
2197
  _: 1
2193
2198
  }, 8, ["craftNode", "schema", "model"]);
2194
2199
  };
2195
2200
  }
2196
- }), Sr = { class: "v-craft-component-layer-face" }, Pr = { class: "v-craft-component-name" }, kr = {
2201
+ }), Ar = { class: "v-craft-component-layer-face" }, Rr = { class: "v-craft-component-name" }, Mr = {
2197
2202
  key: 0,
2198
2203
  class: "v-craft-node-layers nested-layers"
2199
- }, Dr = /* @__PURE__ */ j({
2204
+ }, $r = /* @__PURE__ */ B({
2200
2205
  __name: "CraftEditorPanelNodeLayer",
2201
2206
  props: {
2202
2207
  craftNode: {},
@@ -2204,46 +2209,46 @@ const Gt = /* @__PURE__ */ j({
2204
2209
  },
2205
2210
  emits: ["layer-click"],
2206
2211
  setup(t, { emit: e }) {
2207
- const r = t, { craftNode: n, visible: o } = me(r), s = N(
2212
+ const r = t, { craftNode: n, visible: o } = be(r), s = _(
2208
2213
  () => o.value && n.value.visible === void 0 || n.value.visible
2209
- ), a = e, i = V(), { selectedNode: l } = te(i), u = N(() => ae(n.value)), p = N(
2214
+ ), a = e, i = q(), { selectedNode: l } = se(i), u = _(() => ue(n.value)), p = _(
2210
2215
  () => l?.value?.uuid === n.value.uuid
2211
2216
  ), m = () => {
2212
2217
  i.toggleNodeVisibility(n.value);
2213
2218
  };
2214
2219
  return (f, h) => {
2215
- const y = B("CraftEditorPanelNodeLayer", !0);
2216
- return v(), _("li", {
2217
- class: ve(["v-craft-node-layer", {
2220
+ const g = H("CraftEditorPanelNodeLayer", !0);
2221
+ return v(), N("li", {
2222
+ class: ye(["v-craft-node-layer", {
2218
2223
  "v-craft-node-layer-selected": p.value
2219
2224
  }]),
2220
- onClick: h[1] || (h[1] = F((x) => a("layer-click", d(n)), ["prevent", "stop"]))
2225
+ onClick: h[1] || (h[1] = V((P) => a("layer-click", d(n)), ["prevent", "stop"]))
2221
2226
  }, [
2222
- w("div", Sr, [
2223
- w("div", Pr, ee(u.value), 1),
2224
- w("button", {
2227
+ O("div", Ar, [
2228
+ O("div", Rr, oe(u.value), 1),
2229
+ O("button", {
2225
2230
  type: "button",
2226
2231
  class: "v-craft-component-icon",
2227
- onClick: F(m, ["prevent", "stop"])
2228
- }, ee(s.value ? "hide" : "show"), 1)
2232
+ onClick: V(m, ["prevent", "stop"])
2233
+ }, oe(s.value ? "hide" : "show"), 1)
2229
2234
  ]),
2230
- d(n).slots && Object.keys(d(n).slots).length > 0 ? (v(), _("ul", kr, [
2231
- (v(!0), _(U, null, T(d(n).slots, (x, P) => (v(), _(U, { key: P }, [
2232
- (v(!0), _(U, null, T(x, (g, E) => (v(), A(y, {
2233
- key: `${P}-${E}`,
2234
- craftNode: g,
2235
- onLayerClick: h[0] || (h[0] = (b) => a("layer-click", b)),
2235
+ d(n).slots && Object.keys(d(n).slots).length > 0 ? (v(), N("ul", Mr, [
2236
+ (v(!0), N(j, null, U(d(n).slots, (P, A) => (v(), N(j, { key: A }, [
2237
+ (v(!0), N(j, null, U(P, (C, b) => (v(), $(g, {
2238
+ key: `${A}-${b}`,
2239
+ craftNode: C,
2240
+ onLayerClick: h[0] || (h[0] = (T) => a("layer-click", T)),
2236
2241
  visible: s.value
2237
2242
  }, null, 8, ["craftNode", "visible"]))), 128))
2238
2243
  ], 64))), 128))
2239
- ])) : D("", !0)
2244
+ ])) : M("", !0)
2240
2245
  ], 2);
2241
2246
  };
2242
2247
  }
2243
- }), Ar = /* @__PURE__ */ ge(Dr, [["__scopeId", "data-v-208a4e02"]]), Mr = {
2248
+ }), Ir = /* @__PURE__ */ Ee($r, [["__scopeId", "data-v-208a4e02"]]), Tr = {
2244
2249
  key: 0,
2245
2250
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2246
- }, $r = /* @__PURE__ */ j({
2251
+ }, Ur = /* @__PURE__ */ B({
2247
2252
  __name: "CraftEditorPanelNodeSettings",
2248
2253
  props: {
2249
2254
  craftNode: {},
@@ -2251,43 +2256,43 @@ const Gt = /* @__PURE__ */ j({
2251
2256
  },
2252
2257
  emits: ["update:props"],
2253
2258
  setup(t, { emit: e }) {
2254
- const r = t, { craftNode: n, schema: o } = me(r), s = e;
2259
+ const r = t, { craftNode: n, schema: o } = be(r), s = e;
2255
2260
  return (a, i) => {
2256
- const l = B("CraftEditorPanelForm");
2257
- return v(), A(l, {
2261
+ const l = H("CraftEditorPanelForm");
2262
+ return v(), $(l, {
2258
2263
  craftNode: d(n),
2259
2264
  schema: d(o),
2260
2265
  model: d(n)?.props,
2261
2266
  onUpdate: i[0] || (i[0] = (u) => s("update:props", u))
2262
2267
  }, {
2263
- "panel-content": q(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2264
- f ? (v(), _("fieldset", Mr, [
2265
- i[1] || (i[1] = w("legend", { class: "formkit-legend" }, "Properties", -1)),
2266
- (v(), A(d(se), {
2268
+ "panel-content": G(({ craftNode: u, model: p, handleFormInput: m, schema: f }) => [
2269
+ f ? (v(), N("fieldset", Tr, [
2270
+ i[1] || (i[1] = O("legend", { class: "formkit-legend" }, "Properties", -1)),
2271
+ (v(), $(d(le), {
2267
2272
  key: u?.uuid,
2268
2273
  type: "form",
2269
2274
  value: p,
2270
2275
  onInput: m,
2271
2276
  actions: !1
2272
2277
  }, {
2273
- default: q(() => [
2274
- z(d(Ge), { schema: f }, null, 8, ["schema"])
2278
+ default: G(() => [
2279
+ Q(d(et), { schema: f }, null, 8, ["schema"])
2275
2280
  ]),
2276
2281
  _: 2
2277
2282
  }, 1032, ["value", "onInput"]))
2278
- ])) : D("", !0)
2283
+ ])) : M("", !0)
2279
2284
  ]),
2280
2285
  _: 1
2281
2286
  }, 8, ["craftNode", "schema", "model"]);
2282
2287
  };
2283
2288
  }
2284
- }), Rr = (t) => {
2289
+ }), jr = (t) => {
2285
2290
  if (!t) return [];
2286
2291
  const e = t.type === "single" ? t.item : t.list?.[0];
2287
2292
  return e ? Object.keys(e) : [];
2288
- }, Ir = (t) => {
2289
- const e = V(), r = he("resolver");
2290
- return { buckets: N(() => {
2293
+ }, Br = (t) => {
2294
+ const e = q(), r = ge("resolver");
2295
+ return { buckets: _(() => {
2291
2296
  const o = [];
2292
2297
  let s = t.value;
2293
2298
  for (; s?.parentUuid; ) {
@@ -2310,18 +2315,18 @@ const Gt = /* @__PURE__ */ j({
2310
2315
  slotName: "data",
2311
2316
  ancestorUuid: a.uuid,
2312
2317
  ancestorComponentName: a.componentName,
2313
- keys: Rr(l)
2318
+ keys: jr(l)
2314
2319
  }), s = a;
2315
2320
  }
2316
2321
  return o;
2317
2322
  }) };
2318
- }, Tr = {
2323
+ }, Lr = {
2319
2324
  key: 0,
2320
2325
  class: "v-craft-panel-settings formkit-fieldset v-craft-scrollable-content"
2321
- }, Ur = {
2326
+ }, Fr = {
2322
2327
  key: 0,
2323
2328
  class: "formkit-help"
2324
- }, jr = ["onClick"], Br = ["onClick"], Lr = ["onClick"], Fr = /* @__PURE__ */ j({
2329
+ }, Hr = ["onClick"], Vr = ["onClick"], Kr = ["onClick"], Xr = /* @__PURE__ */ B({
2325
2330
  __name: "CraftEditorPanelNodeSlotPropsSettings",
2326
2331
  props: {
2327
2332
  craftNode: {},
@@ -2329,61 +2334,61 @@ const Gt = /* @__PURE__ */ j({
2329
2334
  },
2330
2335
  emits: ["update:slotsPropsPropsMap"],
2331
2336
  setup(t, { emit: e }) {
2332
- const r = t, n = e, o = de(r, "craftNode"), { buckets: s } = Ir(o), a = N(() => {
2333
- const g = /* @__PURE__ */ new Set();
2334
- return s.value.filter((E) => g.has(E.slotName) ? !1 : (g.add(E.slotName), !0)).map((E) => ({
2335
- value: E.slotName,
2336
- label: E.keys.length ? `${E.slotName} (${E.ancestorComponentName}: ${E.keys.join(", ")})` : `${E.slotName} (${E.ancestorComponentName})`
2337
+ const r = t, n = e, o = he(r, "craftNode"), { buckets: s } = Br(o), a = _(() => {
2338
+ const C = /* @__PURE__ */ new Set();
2339
+ return s.value.filter((b) => C.has(b.slotName) ? !1 : (C.add(b.slotName), !0)).map((b) => ({
2340
+ value: b.slotName,
2341
+ label: b.keys.length ? `${b.slotName} (${b.ancestorComponentName}: ${b.keys.join(", ")})` : `${b.slotName} (${b.ancestorComponentName})`
2337
2342
  }));
2338
- }), i = (g) => {
2339
- const E = r.availableProps || [];
2340
- return !g || E.some((b) => b.value === g) ? E : [{ value: g, label: `${g} (custom)` }, ...E];
2341
- }, l = H([]);
2342
- J(() => o.value?.uuid, () => {
2343
- const g = o.value;
2344
- l.value = Object.entries(g?.slotsPropsPropsMap || {}).map(
2345
- ([E, b]) => ({
2346
- id: G(),
2347
- bucket: E,
2348
- fields: Object.entries(b).map(([O, C]) => ({
2349
- id: G(),
2350
- targetProp: O,
2351
- fromPath: C
2343
+ }), i = (C) => {
2344
+ const b = r.availableProps || [];
2345
+ return !C || b.some((T) => T.value === C) ? b : [{ value: C, label: `${C} (custom)` }, ...b];
2346
+ }, l = K([]);
2347
+ ne(() => o.value?.uuid, () => {
2348
+ const C = o.value;
2349
+ l.value = Object.entries(C?.slotsPropsPropsMap || {}).map(
2350
+ ([b, T]) => ({
2351
+ id: ee(),
2352
+ bucket: b,
2353
+ fields: Object.entries(T).map(([E, w]) => ({
2354
+ id: ee(),
2355
+ targetProp: E,
2356
+ fromPath: w
2352
2357
  }))
2353
2358
  })
2354
2359
  );
2355
2360
  }, { immediate: !0 });
2356
2361
  const p = () => {
2357
- const g = {};
2358
- l.value.forEach((E) => {
2359
- if (!E.bucket.trim()) return;
2360
- const b = {};
2361
- E.fields.forEach((O) => {
2362
- O.targetProp.trim() && O.fromPath.trim() && (b[O.targetProp.trim()] = O.fromPath.trim());
2363
- }), Object.keys(b).length && (g[E.bucket.trim()] = b);
2364
- }), n("update:slotsPropsPropsMap", g);
2362
+ const C = {};
2363
+ l.value.forEach((b) => {
2364
+ if (!b.bucket.trim()) return;
2365
+ const T = {};
2366
+ b.fields.forEach((E) => {
2367
+ E.targetProp.trim() && E.fromPath.trim() && (T[E.targetProp.trim()] = E.fromPath.trim());
2368
+ }), Object.keys(T).length && (C[b.bucket.trim()] = T);
2369
+ }), n("update:slotsPropsPropsMap", C);
2365
2370
  }, m = () => {
2366
2371
  l.value.push({
2367
- id: G(),
2372
+ id: ee(),
2368
2373
  bucket: a.value[0]?.value || "",
2369
- fields: [{ id: G(), targetProp: "", fromPath: "" }]
2374
+ fields: [{ id: ee(), targetProp: "", fromPath: "" }]
2370
2375
  }), p();
2371
- }, f = (g) => {
2372
- l.value.splice(g, 1), p();
2373
- }, h = (g, E) => {
2374
- l.value[g].bucket = E, p();
2375
- }, y = (g) => {
2376
- l.value[g].fields.push({
2377
- id: G(),
2376
+ }, f = (C) => {
2377
+ l.value.splice(C, 1), p();
2378
+ }, h = (C, b) => {
2379
+ l.value[C].bucket = b, p();
2380
+ }, g = (C) => {
2381
+ l.value[C].fields.push({
2382
+ id: ee(),
2378
2383
  targetProp: "",
2379
2384
  fromPath: ""
2380
2385
  });
2381
- }, x = (g, E) => {
2382
- l.value[g].fields.splice(E, 1), p();
2383
- }, P = (g, E, b, O) => {
2384
- l.value[g].fields[E][b] = O, p();
2386
+ }, P = (C, b) => {
2387
+ l.value[C].fields.splice(b, 1), p();
2388
+ }, A = (C, b, T, E) => {
2389
+ l.value[C].fields[b][T] = E, p();
2385
2390
  };
2386
- return (g, E) => Q(g.$slots, "panel-content", {
2391
+ return (C, b) => J(C.$slots, "panel-content", {
2387
2392
  craftNode: o.value,
2388
2393
  mappingGroups: l.value,
2389
2394
  bucketOptions: a.value,
@@ -2392,82 +2397,82 @@ const Gt = /* @__PURE__ */ j({
2392
2397
  addGroup: m,
2393
2398
  removeGroup: f,
2394
2399
  updateBucket: h,
2395
- addField: y,
2396
- removeField: x,
2397
- updateField: P
2400
+ addField: g,
2401
+ removeField: P,
2402
+ updateField: A
2398
2403
  }, () => [
2399
- o.value ? (v(), _("fieldset", Tr, [
2400
- E[0] || (E[0] = w("legend", { class: "formkit-legend" }, "Props Mapping", -1)),
2401
- E[1] || (E[1] = w("p", { class: "formkit-help" }, [
2402
- oe(" Map fields from an ancestor slot's context into this component's own props using JSONPath (e.g. "),
2403
- w("code", null, "$.item.name"),
2404
- oe("). ")
2404
+ o.value ? (v(), N("fieldset", Lr, [
2405
+ b[0] || (b[0] = O("legend", { class: "formkit-legend" }, "Props Mapping", -1)),
2406
+ b[1] || (b[1] = O("p", { class: "formkit-help" }, [
2407
+ ie(" Map fields from an ancestor slot's context into this component's own props using JSONPath (e.g. "),
2408
+ O("code", null, "$.item.name"),
2409
+ ie("). ")
2405
2410
  ], -1)),
2406
- l.value.length ? D("", !0) : (v(), _("p", Ur, " No mappings configured. ")),
2407
- (v(!0), _(U, null, T(l.value, (b, O) => (v(), _("div", {
2408
- key: b.id,
2411
+ l.value.length ? M("", !0) : (v(), N("p", Fr, " No mappings configured. ")),
2412
+ (v(!0), N(j, null, U(l.value, (T, E) => (v(), N("div", {
2413
+ key: T.id,
2409
2414
  class: "v-craft-slot-props-map-group"
2410
2415
  }, [
2411
- z(d(se), {
2416
+ Q(d(le), {
2412
2417
  type: "select",
2413
2418
  label: "Context",
2414
2419
  placeholder: "Select context",
2415
2420
  options: a.value,
2416
- value: b.bucket,
2417
- onInput: (C) => h(O, String(C ?? ""))
2421
+ value: T.bucket,
2422
+ onInput: (w) => h(E, String(w ?? ""))
2418
2423
  }, null, 8, ["options", "value", "onInput"]),
2419
- (v(!0), _(U, null, T(b.fields, (C, I) => (v(), _(U, {
2420
- key: C.id
2424
+ (v(!0), N(j, null, U(T.fields, (w, y) => (v(), N(j, {
2425
+ key: w.id
2421
2426
  }, [
2422
- t.availableProps && t.availableProps.length ? (v(), A(d(se), {
2427
+ t.availableProps && t.availableProps.length ? (v(), $(d(le), {
2423
2428
  key: 0,
2424
2429
  type: "select",
2425
2430
  label: "Target Prop",
2426
2431
  placeholder: "target prop",
2427
- options: i(C.targetProp),
2428
- value: C.targetProp,
2429
- onInput: (R) => P(O, I, "targetProp", String(R ?? ""))
2430
- }, null, 8, ["options", "value", "onInput"])) : (v(), A(d(se), {
2432
+ options: i(w.targetProp),
2433
+ value: w.targetProp,
2434
+ onInput: (x) => A(E, y, "targetProp", String(x ?? ""))
2435
+ }, null, 8, ["options", "value", "onInput"])) : (v(), $(d(le), {
2431
2436
  key: 1,
2432
2437
  type: "text",
2433
2438
  label: "Target Prop",
2434
2439
  placeholder: "target prop",
2435
- value: C.targetProp,
2436
- onInput: (R) => P(O, I, "targetProp", String(R ?? ""))
2440
+ value: w.targetProp,
2441
+ onInput: (x) => A(E, y, "targetProp", String(x ?? ""))
2437
2442
  }, null, 8, ["value", "onInput"])),
2438
- z(d(se), {
2443
+ Q(d(le), {
2439
2444
  type: "text",
2440
2445
  label: "JSONPath",
2441
2446
  placeholder: "$.item.name",
2442
- value: C.fromPath,
2443
- onInput: (R) => P(O, I, "fromPath", String(R ?? ""))
2447
+ value: w.fromPath,
2448
+ onInput: (x) => A(E, y, "fromPath", String(x ?? ""))
2444
2449
  }, null, 8, ["value", "onInput"]),
2445
- w("button", {
2450
+ O("button", {
2446
2451
  type: "button",
2447
2452
  class: "formkit-input v-craft-slot-props-remove",
2448
- onClick: F((R) => x(O, I), ["prevent"])
2449
- }, " Remove field ", 8, jr)
2453
+ onClick: V((x) => P(E, y), ["prevent"])
2454
+ }, " Remove field ", 8, Hr)
2450
2455
  ], 64))), 128)),
2451
- w("button", {
2456
+ O("button", {
2452
2457
  type: "button",
2453
2458
  class: "formkit-input v-craft-slot-props-add",
2454
- onClick: F((C) => y(O), ["prevent"])
2455
- }, " + Add field ", 8, Br),
2456
- w("button", {
2459
+ onClick: V((w) => g(E), ["prevent"])
2460
+ }, " + Add field ", 8, Vr),
2461
+ O("button", {
2457
2462
  type: "button",
2458
2463
  class: "formkit-input v-craft-slot-props-remove",
2459
- onClick: F((C) => f(O), ["prevent"])
2460
- }, " Remove group ", 8, Lr)
2464
+ onClick: V((w) => f(E), ["prevent"])
2465
+ }, " Remove group ", 8, Kr)
2461
2466
  ]))), 128)),
2462
- w("button", {
2467
+ O("button", {
2463
2468
  type: "button",
2464
2469
  class: "formkit-input v-craft-slot-props-add",
2465
- onClick: F(m, ["prevent"])
2470
+ onClick: V(m, ["prevent"])
2466
2471
  }, " + Add mapping group ")
2467
- ])) : D("", !0)
2472
+ ])) : M("", !0)
2468
2473
  ], !0);
2469
2474
  }
2470
- }), Hr = /* @__PURE__ */ ge(Fr, [["__scopeId", "data-v-f762baf8"]]), Kr = (t) => Array.isArray(t) ? t.filter(
2475
+ }), zr = /* @__PURE__ */ Ee(Xr, [["__scopeId", "data-v-f762baf8"]]), qr = (t) => Array.isArray(t) ? t.filter(
2471
2476
  (e) => typeof e == "object" && e !== null && typeof e.name == "string"
2472
2477
  ).map((e) => {
2473
2478
  const r = e.name, n = e.label;
@@ -2475,47 +2480,47 @@ const Gt = /* @__PURE__ */ j({
2475
2480
  value: r,
2476
2481
  label: typeof n == "string" && n.trim() ? n : r
2477
2482
  };
2478
- }) : [], Vr = { class: "text-sm" }, Xr = { key: 0 }, zr = {
2483
+ }) : [], Yr = { class: "text-sm" }, Qr = { key: 0 }, Gr = {
2479
2484
  key: 0,
2480
2485
  class: "v-craft-settings"
2481
- }, qr = {
2486
+ }, Wr = {
2482
2487
  key: 1,
2483
2488
  class: "v-craft-settings"
2484
- }, Yr = {
2489
+ }, Zr = {
2485
2490
  key: 2,
2486
2491
  class: "v-craft-settings"
2487
- }, Qr = {
2492
+ }, Jr = {
2488
2493
  key: 3,
2489
2494
  class: "v-craft-settings"
2490
- }, Gr = {
2495
+ }, en = {
2491
2496
  class: "v-craft-actions",
2492
2497
  "data-type": "button"
2493
- }, Wr = /* @__PURE__ */ j({
2498
+ }, tn = /* @__PURE__ */ B({
2494
2499
  __name: "CraftEditorPanelSettings",
2495
2500
  setup(t) {
2496
- const e = V(), { selectedNode: r, nodeDataMap: n } = te(e), o = he("resolver"), s = N(() => !r.value || !o?.value ? [] : o.value.getSchema(r.value)), a = N(() => !r.value || !o?.value ? [] : o.value.getEventsSchema(r.value)), i = N(() => Kr(s.value)), l = N(
2501
+ const e = q(), { selectedNode: r, nodeDataMap: n } = se(e), o = ge("resolver"), s = _(() => !r.value || !o?.value ? [] : o.value.getSchema(r.value)), a = _(() => !r.value || !o?.value ? [] : o.value.getEventsSchema(r.value)), i = _(() => qr(s.value)), l = _(
2497
2502
  () => r.value && r.value.parentUuid
2498
2503
  ), u = () => {
2499
2504
  r.value && e.removeNode(r.value);
2500
- }, p = N(
2505
+ }, p = _(
2501
2506
  () => r.value ? `${o?.value?.resolveNode(r.value)?.componentName || "Unknown"}` : ""
2502
- ), m = (P) => {
2503
- r.value && P && e.updateNodeProps(r.value.uuid, P);
2504
- }, f = (P) => {
2505
- r.value && P && e.updateNodeEvents(r.value.uuid, P);
2506
- }, h = (P) => {
2507
+ ), m = (A) => {
2508
+ r.value && A && e.updateNodeProps(r.value.uuid, A);
2509
+ }, f = (A) => {
2510
+ r.value && A && e.updateNodeEvents(r.value.uuid, A);
2511
+ }, h = (A) => {
2507
2512
  r.value && e.updateNodeSlotsPropsPropsMap(
2508
2513
  r.value.uuid,
2509
- P
2514
+ A
2510
2515
  );
2511
- }, y = N(
2516
+ }, g = _(
2512
2517
  () => r.value ? n.value[r.value.uuid] ?? null : null
2513
- ), x = (P) => {
2514
- r.value && e.setNodeData(r.value.uuid, P);
2518
+ ), P = (A) => {
2519
+ r.value && e.setNodeData(r.value.uuid, A);
2515
2520
  };
2516
- return (P, g) => {
2517
- const E = B("CraftEditorPanelNodeSettings"), b = B("CraftEditorPanelNodeEventsSettings"), O = B("CraftEditorPanelNodeSlotPropsSettings"), C = B("CraftEditorPanelNodeDataSourceSettings");
2518
- return Q(P.$slots, "panel-content", {
2521
+ return (A, C) => {
2522
+ const b = H("CraftEditorPanelNodeSettings"), T = H("CraftEditorPanelNodeEventsSettings"), E = H("CraftEditorPanelNodeSlotPropsSettings"), w = H("CraftEditorPanelNodeDataSourceSettings");
2523
+ return J(A.$slots, "panel-content", {
2519
2524
  selectedNode: d(r),
2520
2525
  nodeName: p.value,
2521
2526
  handlePropsUpdate: m,
@@ -2524,69 +2529,69 @@ const Gt = /* @__PURE__ */ j({
2524
2529
  handleEventsUpdate: f,
2525
2530
  availableProps: i.value,
2526
2531
  handleSlotsPropsPropsMapUpdate: h,
2527
- nodeData: y.value,
2528
- handleNodeDataUpdate: x,
2532
+ nodeData: g.value,
2533
+ handleNodeDataUpdate: P,
2529
2534
  deleteable: l.value,
2530
2535
  removeNode: u
2531
2536
  }, () => [
2532
- w("div", {
2537
+ O("div", {
2533
2538
  ref: "panel",
2534
2539
  class: "v-craft-panel v-craft-settings-panel",
2535
- onClick: F(() => !1, ["prevent", "stop"])
2540
+ onClick: V(() => !1, ["prevent", "stop"])
2536
2541
  }, [
2537
- g[1] || (g[1] = w("h3", { class: "v-craft-title" }, "component inspector", -1)),
2538
- w("span", Vr, ee(d(r)?.uuid), 1),
2539
- d(r) ? D("", !0) : (v(), _("div", Xr, [...g[0] || (g[0] = [
2540
- w("p", null, "select a component to inspect", -1)
2542
+ C[1] || (C[1] = O("h3", { class: "v-craft-title" }, "component inspector", -1)),
2543
+ O("span", Yr, oe(d(r)?.uuid), 1),
2544
+ d(r) ? M("", !0) : (v(), N("div", Qr, [...C[0] || (C[0] = [
2545
+ O("p", null, "select a component to inspect", -1)
2541
2546
  ])])),
2542
- w("div", {
2543
- class: ve(["v-craft-properties", { "v-craft-visible": d(r) }])
2547
+ O("div", {
2548
+ class: ye(["v-craft-properties", { "v-craft-visible": d(r) }])
2544
2549
  }, [
2545
- w("h4", null, ee(p.value), 1),
2546
- s.value ? (v(), _("div", zr, [
2547
- z(E, {
2550
+ O("h4", null, oe(p.value), 1),
2551
+ s.value ? (v(), N("div", Gr, [
2552
+ Q(b, {
2548
2553
  craftNode: d(r),
2549
2554
  schema: s.value,
2550
2555
  "onUpdate:props": m
2551
2556
  }, null, 8, ["craftNode", "schema"])
2552
- ])) : D("", !0),
2553
- a.value && d(r) ? (v(), _("div", qr, [
2554
- z(b, {
2557
+ ])) : M("", !0),
2558
+ a.value && d(r) ? (v(), N("div", Wr, [
2559
+ Q(T, {
2555
2560
  craftNode: d(r),
2556
2561
  schema: a.value,
2557
2562
  "onUpdate:events": f
2558
2563
  }, null, 8, ["craftNode", "schema"])
2559
- ])) : D("", !0),
2560
- d(r) ? (v(), _("div", Yr, [
2561
- z(O, {
2564
+ ])) : M("", !0),
2565
+ d(r) ? (v(), N("div", Zr, [
2566
+ Q(E, {
2562
2567
  craftNode: d(r),
2563
2568
  availableProps: i.value,
2564
2569
  "onUpdate:slotsPropsPropsMap": h
2565
2570
  }, null, 8, ["craftNode", "availableProps"])
2566
- ])) : D("", !0),
2567
- d(r) ? (v(), _("div", Qr, [
2568
- z(C, {
2571
+ ])) : M("", !0),
2572
+ d(r) ? (v(), N("div", Jr, [
2573
+ Q(w, {
2569
2574
  craftNode: d(r),
2570
- nodeData: y.value,
2571
- "onUpdate:nodeData": x
2575
+ nodeData: g.value,
2576
+ "onUpdate:nodeData": P
2572
2577
  }, null, 8, ["craftNode", "nodeData"])
2573
- ])) : D("", !0),
2574
- w("div", Gr, [
2575
- l.value ? (v(), _("button", {
2578
+ ])) : M("", !0),
2579
+ O("div", en, [
2580
+ l.value ? (v(), N("button", {
2576
2581
  key: 0,
2577
2582
  class: "formkit-input v-craft-delete",
2578
- onClick: F(u, ["prevent"])
2579
- }, " Delete ")) : D("", !0)
2583
+ onClick: V(u, ["prevent"])
2584
+ }, " Delete ")) : M("", !0)
2580
2585
  ])
2581
2586
  ], 2)
2582
2587
  ], 512)
2583
2588
  ]);
2584
2589
  };
2585
2590
  }
2586
- }), Fe = /* @__PURE__ */ j({
2591
+ }), Xe = /* @__PURE__ */ B({
2587
2592
  __name: "CraftDropIndicator",
2588
2593
  setup(t) {
2589
- const e = Re(), r = () => {
2594
+ const e = Ue(), r = () => {
2590
2595
  const { top: n, left: o } = e.position, { width: s, height: a } = e.size;
2591
2596
  return {
2592
2597
  top: `${n}px`,
@@ -2595,13 +2600,13 @@ const Gt = /* @__PURE__ */ j({
2595
2600
  width: `${s}px`
2596
2601
  };
2597
2602
  };
2598
- return (n, o) => d(e).isShown ? (v(), _("div", {
2603
+ return (n, o) => d(e).isShown ? (v(), N("div", {
2599
2604
  key: 0,
2600
- class: ve(["v-craft-indicator", { "v-craft-forbidden": d(e).isForbidden }]),
2601
- style: Me(r())
2602
- }, null, 6)) : D("", !0);
2605
+ class: ye(["v-craft-indicator", { "v-craft-forbidden": d(e).isForbidden }]),
2606
+ style: Ie(r())
2607
+ }, null, 6)) : M("", !0);
2603
2608
  }
2604
- }), nt = /* @__PURE__ */ j({
2609
+ }), it = /* @__PURE__ */ B({
2605
2610
  __name: "CraftIframe",
2606
2611
  props: {
2607
2612
  iframeClass: { type: [Boolean, null, String, Object, Array], default: "" },
@@ -2613,8 +2618,8 @@ const Gt = /* @__PURE__ */ j({
2613
2618
  },
2614
2619
  emits: ["iframeLoad"],
2615
2620
  setup(t, { emit: e }) {
2616
- const r = t, n = H(), o = H(!1), s = H(), a = () => {
2617
- pe(() => {
2621
+ const r = t, n = K(), o = K(!1), s = K(), a = () => {
2622
+ ve(() => {
2618
2623
  if (!n.value) {
2619
2624
  console.error("iframe could not be loaded.");
2620
2625
  return;
@@ -2623,93 +2628,93 @@ const Gt = /* @__PURE__ */ j({
2623
2628
  n.value && l(n.value, f);
2624
2629
  }), r.styleSheets.forEach((f) => {
2625
2630
  n.value && u(n.value, f);
2626
- }), o.value = !0, pe(() => {
2631
+ }), o.value = !0, ve(() => {
2627
2632
  n.value && (s.value = n.value?.contentWindow?.document.body);
2628
2633
  });
2629
2634
  });
2630
2635
  }, i = () => {
2631
2636
  const f = n.value?.contentWindow?.parent.document;
2632
2637
  if (!f) return;
2633
- Array.from(f.querySelectorAll("style") ?? []).forEach((x) => {
2634
- n.value?.contentDocument?.head.appendChild(x.cloneNode(!0));
2635
- }), Array.from(f.querySelectorAll("link[rel='stylesheet']") ?? []).forEach((x) => {
2636
- n.value?.contentDocument?.head.appendChild(x.cloneNode(!0));
2638
+ Array.from(f.querySelectorAll("style") ?? []).forEach((P) => {
2639
+ n.value?.contentDocument?.head.appendChild(P.cloneNode(!0));
2640
+ }), Array.from(f.querySelectorAll("link[rel='stylesheet']") ?? []).forEach((P) => {
2641
+ n.value?.contentDocument?.head.appendChild(P.cloneNode(!0));
2637
2642
  });
2638
2643
  }, l = (f, h) => {
2639
- const y = document.createElement("style");
2640
- y.innerHTML = h, f?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(y);
2644
+ const g = document.createElement("style");
2645
+ g.innerHTML = h, f?.contentWindow?.document.getElementsByTagName("head").item(0)?.appendChild(g);
2641
2646
  }, u = (f, h) => {
2642
- const y = document.createElement("link");
2643
- y.rel = "stylesheet", y.href = h, f.contentWindow?.document.head.appendChild(y);
2647
+ const g = document.createElement("link");
2648
+ g.rel = "stylesheet", g.href = h, f.contentWindow?.document.head.appendChild(g);
2644
2649
  }, p = () => {
2645
2650
  const f = n.value?.contentWindow?.document;
2646
2651
  if (!f) return;
2647
2652
  const h = f.querySelector("body");
2648
2653
  if (!h) return;
2649
- const y = f.createAttribute("id");
2650
- y.nodeValue = "v-craft-body", h.attributes.setNamedItem(y);
2654
+ const g = f.createAttribute("id");
2655
+ g.nodeValue = "v-craft-body", h.attributes.setNamedItem(g);
2651
2656
  }, m = e;
2652
- return (f, h) => Et((v(), _("div", null, [
2653
- w("iframe", {
2657
+ return (f, h) => Pt((v(), N("div", null, [
2658
+ O("iframe", {
2654
2659
  id: "v-craft-iframe",
2655
2660
  ref_key: "iframeRef",
2656
2661
  ref: n,
2657
- class: ve(t.iframeClass),
2658
- style: Me(t.iframeStyle),
2662
+ class: ye(t.iframeClass),
2663
+ style: Ie(t.iframeStyle),
2659
2664
  onload: a
2660
2665
  }, null, 6),
2661
- o.value ? (v(), A(Ct, {
2666
+ o.value ? (v(), $(xt, {
2662
2667
  key: 0,
2663
2668
  to: n.value?.contentWindow?.document.body
2664
2669
  }, [
2665
- Q(f.$slots, "default")
2666
- ], 8, ["to"])) : D("", !0)
2670
+ J(f.$slots, "default")
2671
+ ], 8, ["to"])) : M("", !0)
2667
2672
  ], 512)), [
2668
- [_t, f.$slots.default]
2673
+ [St, f.$slots.default]
2669
2674
  ]);
2670
2675
  }
2671
- }), Zr = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", Pe = (t, e, r = null) => {
2672
- const n = Zr(e), { props: o } = e, s = {
2676
+ }), rn = (t) => typeof t.type == "symbol" ? "Fragment" : typeof t.type == "string" ? t.type : t.type.name ? t.type.name : "anonmymous", Ae = (t, e, r = null) => {
2677
+ const n = rn(e), { props: o } = e, s = {
2673
2678
  componentName: n,
2674
2679
  props: o,
2675
2680
  slots: {},
2676
2681
  parentUuid: r?.uuid ?? null,
2677
- uuid: G()
2682
+ uuid: ee()
2678
2683
  };
2679
2684
  return e.children && (typeof e.children == "object" && !Array.isArray(e.children) ? Object.entries(e.children).forEach(([a, i]) => {
2680
2685
  if (typeof i == "function") {
2681
2686
  const l = i();
2682
- l && (s.slots[a] = He(
2687
+ l && (s.slots[a] = ze(
2683
2688
  t,
2684
2689
  l,
2685
2690
  s
2686
2691
  ));
2687
2692
  }
2688
- }) : Array.isArray(e.children) && (s.slots.default = He(
2693
+ }) : Array.isArray(e.children) && (s.slots.default = ze(
2689
2694
  t,
2690
2695
  e.children,
2691
2696
  s
2692
2697
  ))), s;
2693
- }, He = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => Pe(t, n, r)).filter((n) => !!n), Jr = (t) => {
2694
- const e = V(), { hasNodes: r } = te(e), n = t ? H(new xe(t)) : he("resolver");
2695
- n?.value && e.setResolver(n.value), t && W("resolver", n);
2698
+ }, ze = (t, e, r) => !e || !(e instanceof Array) ? [] : e.map((n) => Ae(t, n, r)).filter((n) => !!n), nn = (t) => {
2699
+ const e = q(), { hasNodes: r } = se(e), n = t ? K(new Oe(t)) : ge("resolver");
2700
+ n?.value && e.setResolver(n.value), t && te("resolver", n);
2696
2701
  const o = () => {
2697
2702
  if (n?.value && !r.value) {
2698
- const s = Xe(), i = (s.default ? s.default() : []).flatMap((l) => {
2703
+ const s = Qe(), i = (s.default ? s.default() : []).flatMap((l) => {
2699
2704
  if (l.key === "_default" && l.children && Array.isArray(l.children))
2700
2705
  return l.children.map((u) => {
2701
- const p = Pe(n.value, u);
2706
+ const p = Ae(n.value, u);
2702
2707
  return p || console.error("Invalid node created from child:", u), p;
2703
2708
  }).filter(Boolean);
2704
2709
  {
2705
- const u = Pe(n.value, l);
2710
+ const u = Ae(n.value, l);
2706
2711
  return u || console.error("Invalid node created from slot:", l), [u];
2707
2712
  }
2708
2713
  }).filter(Boolean);
2709
2714
  i.length && e.setNodes(i);
2710
2715
  }
2711
2716
  };
2712
- return Ne(o), J(
2717
+ return Se(o), ne(
2713
2718
  () => n?.value,
2714
2719
  (s) => {
2715
2720
  s && e.setResolver(s);
@@ -2718,7 +2723,7 @@ const Gt = /* @__PURE__ */ j({
2718
2723
  editor: e,
2719
2724
  mountNodes: o
2720
2725
  };
2721
- }, en = { class: "v-craft-frame" }, tn = /* @__PURE__ */ j({
2726
+ }, on = { class: "v-craft-frame" }, sn = /* @__PURE__ */ B({
2722
2727
  name: "CraftFrame",
2723
2728
  __name: "CraftFrame",
2724
2729
  props: {
@@ -2728,168 +2733,168 @@ const Gt = /* @__PURE__ */ j({
2728
2733
  },
2729
2734
  emits: ["iframeLoad"],
2730
2735
  setup(t, { emit: e }) {
2731
- const r = t, { iframe: n } = me(r), o = (p) => {
2736
+ const r = t, { iframe: n } = be(r), o = (p) => {
2732
2737
  s("iframeLoad", p);
2733
- }, s = e, { editor: a } = Jr(r.resolverMap), { nodeTree: i, hasNodes: l, enabled: u } = te(a);
2738
+ }, s = e, { editor: a } = nn(r.resolverMap), { nodeTree: i, hasNodes: l, enabled: u } = se(a);
2734
2739
  return (p, m) => {
2735
- const f = B("CraftNodeViewer"), h = B("CraftNodeEditor");
2736
- return v(), _("div", en, [
2737
- d(n) ? (v(), A(nt, {
2740
+ const f = H("CraftNodeViewer"), h = H("CraftNodeEditor");
2741
+ return v(), N("div", on, [
2742
+ d(n) ? (v(), $(it, {
2738
2743
  key: 0,
2739
2744
  onIframeLoad: o,
2740
2745
  inheritStyles: d(n)?.inheritStyles,
2741
2746
  iframeStyle: d(n)?.iframeStyle,
2742
2747
  iframeClass: d(n)?.iframeClass,
2743
- class: ve(d(n)?.wrapperClass),
2744
- style: Me(d(n)?.wrapperStyle),
2748
+ class: ye(d(n)?.wrapperClass),
2749
+ style: Ie(d(n)?.wrapperStyle),
2745
2750
  styles: d(n)?.styles,
2746
2751
  styleSheets: d(n)?.styleSheets
2747
2752
  }, {
2748
- default: q(() => [
2749
- (t.viewOnly || !d(u)) && d(l) ? (v(!0), _(U, { key: 0 }, T(d(i), (y) => (v(), A(f, {
2750
- key: `${y.uuid}-view`,
2751
- craftNode: y
2752
- }, null, 8, ["craftNode"]))), 128)) : D("", !0),
2753
- !t.viewOnly && d(u) && d(l) ? (v(!0), _(U, { key: 1 }, T(d(i), (y) => (v(), A(h, {
2754
- key: `${y.uuid}-edit`,
2755
- craftNode: y
2756
- }, null, 8, ["craftNode"]))), 128)) : D("", !0),
2757
- !t.viewOnly && d(u) ? (v(), A(Fe, { key: 2 })) : D("", !0)
2753
+ default: G(() => [
2754
+ (t.viewOnly || !d(u)) && d(l) ? (v(!0), N(j, { key: 0 }, U(d(i), (g) => (v(), $(f, {
2755
+ key: `${g.uuid}-view`,
2756
+ craftNode: g
2757
+ }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2758
+ !t.viewOnly && d(u) && d(l) ? (v(!0), N(j, { key: 1 }, U(d(i), (g) => (v(), $(h, {
2759
+ key: `${g.uuid}-edit`,
2760
+ craftNode: g
2761
+ }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2762
+ !t.viewOnly && d(u) ? (v(), $(Xe, { key: 2 })) : M("", !0)
2758
2763
  ]),
2759
2764
  _: 1
2760
- }, 8, ["inheritStyles", "iframeStyle", "iframeClass", "class", "style", "styles", "styleSheets"])) : D("", !0),
2761
- !d(n) && (t.viewOnly || !d(u)) && d(l) ? (v(!0), _(U, { key: 1 }, T(d(i), (y) => (v(), A(f, {
2762
- key: `${y.uuid}-view`,
2763
- craftNode: y
2764
- }, null, 8, ["craftNode"]))), 128)) : D("", !0),
2765
- !d(n) && !t.viewOnly && d(u) && d(l) ? (v(!0), _(U, { key: 2 }, T(d(i), (y) => (v(), A(h, {
2766
- key: `${y.uuid}-edit`,
2767
- craftNode: y
2768
- }, null, 8, ["craftNode"]))), 128)) : D("", !0),
2769
- !d(n) && !t.viewOnly && d(u) ? (v(), A(Fe, { key: 3 })) : D("", !0)
2765
+ }, 8, ["inheritStyles", "iframeStyle", "iframeClass", "class", "style", "styles", "styleSheets"])) : M("", !0),
2766
+ !d(n) && (t.viewOnly || !d(u)) && d(l) ? (v(!0), N(j, { key: 1 }, U(d(i), (g) => (v(), $(f, {
2767
+ key: `${g.uuid}-view`,
2768
+ craftNode: g
2769
+ }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2770
+ !d(n) && !t.viewOnly && d(u) && d(l) ? (v(!0), N(j, { key: 2 }, U(d(i), (g) => (v(), $(h, {
2771
+ key: `${g.uuid}-edit`,
2772
+ craftNode: g
2773
+ }, null, 8, ["craftNode"]))), 128)) : M("", !0),
2774
+ !d(n) && !t.viewOnly && d(u) ? (v(), $(Xe, { key: 3 })) : M("", !0)
2770
2775
  ]);
2771
2776
  };
2772
2777
  }
2773
- }), rn = (t, e) => {
2774
- const r = V(), { enabled: n, selectedUuid: o, draggingDisabled: s } = te(r);
2778
+ }), an = (t, e) => {
2779
+ const r = q(), { enabled: n, selectedUuid: o, draggingDisabled: s } = se(r);
2775
2780
  let a = null;
2776
2781
  const i = () => {
2777
2782
  const m = e?.value?.$el;
2778
2783
  m && m !== a && (a = m, r.setNodeRef(t, m));
2779
2784
  };
2780
- Ne(i), J(e, i, { flush: "post" });
2781
- const l = N(
2785
+ Se(i), ne(e, i, { flush: "post" });
2786
+ const l = _(
2782
2787
  () => o.value === t.uuid
2783
2788
  );
2784
2789
  return {
2785
- isDraggable: N(() => n.value && !s.value && qt(t)),
2790
+ isDraggable: _(() => n.value && !s.value && Wt(t)),
2786
2791
  isSelected: l,
2787
2792
  selectNode: () => {
2788
2793
  n.value && r.selectNode(t);
2789
2794
  }
2790
2795
  };
2791
- }, Ie = (t, e, r, n) => {
2792
- const o = /* @__PURE__ */ new Map(), s = () => {
2793
- !t.value?.events || !Object.values(t.value.events).length || Object.entries(t.value.events).forEach(([a, i]) => {
2794
- if (!i.trim())
2796
+ }, je = (t, e, r = {}) => {
2797
+ const n = /* @__PURE__ */ new Map(), o = () => {
2798
+ !t.value?.events || !Object.values(t.value.events).length || Object.entries(t.value.events).forEach(([s, a]) => {
2799
+ if (!a.trim())
2795
2800
  return;
2796
- const l = (...u) => {
2801
+ const i = (...l) => {
2797
2802
  try {
2798
2803
  new Function(
2799
2804
  "ctx",
2800
2805
  "craftNode",
2801
2806
  "args",
2802
- i
2807
+ a
2803
2808
  )(
2804
- { ...e, getNodes: r, getNode: n },
2809
+ { ...e, ...r },
2805
2810
  t.value.uuid,
2806
- ...u
2811
+ ...l
2807
2812
  );
2808
- } catch (p) {
2813
+ } catch (u) {
2809
2814
  console.error(
2810
2815
  `Event code execution failed with code:
2811
- ${i}
2816
+ ${a}
2812
2817
 
2813
2818
  Error:`,
2814
- p
2819
+ u
2815
2820
  );
2816
2821
  }
2817
2822
  };
2818
- o.set(a, l);
2823
+ n.set(s, i);
2819
2824
  });
2820
2825
  };
2821
- return J(
2826
+ return ne(
2822
2827
  () => t,
2823
2828
  () => {
2824
- s();
2829
+ o();
2825
2830
  }
2826
- ), Nt(() => {
2827
- s();
2828
- }), xt(() => {
2829
- o.clear();
2831
+ ), Ot(() => {
2832
+ o();
2833
+ }), wt(() => {
2834
+ n.clear();
2830
2835
  }), {
2831
- eventHandlers: N(() => Object.fromEntries(o))
2836
+ eventHandlers: _(() => Object.fromEntries(n))
2832
2837
  };
2833
- }, ot = (t) => {
2838
+ }, lt = (t) => {
2834
2839
  const e = (() => {
2835
2840
  try {
2836
- return V();
2841
+ return q();
2837
2842
  } catch {
2838
2843
  return null;
2839
2844
  }
2840
- })(), r = N(() => e ? te(e).enabled?.value ?? !1 : !1), n = N(() => t.value?.visible !== !1);
2841
- return W("craftNode", qe(t)), {
2845
+ })(), r = _(() => e ? se(e).enabled?.value ?? !1 : !1), n = _(() => t.value?.visible !== !1);
2846
+ return te("craftNode", We(t)), {
2842
2847
  editor: e,
2843
2848
  craftNode: t,
2844
2849
  enabled: r,
2845
2850
  visible: n
2846
2851
  };
2847
- }, st = (t, e) => {
2852
+ }, ut = (t, e) => {
2848
2853
  if (!e.getBoundingClientRect) return !1;
2849
2854
  const r = e.getBoundingClientRect();
2850
2855
  return t.clientX - r.left < r.width / 2;
2851
- }, at = (t, e) => {
2856
+ }, ct = (t, e) => {
2852
2857
  if (!e.getBoundingClientRect) return !1;
2853
2858
  const r = e.getBoundingClientRect();
2854
2859
  return t.clientY - r.top < r.height / 2;
2855
- }, it = (t, e) => {
2860
+ }, dt = (t, e) => {
2856
2861
  if (!e.getBoundingClientRect) return !1;
2857
2862
  const r = e.getBoundingClientRect();
2858
2863
  return t.clientX - r.left < 15 || t.clientY - r.top < 15 || r.right - t.clientX < 15 || r.bottom - t.clientY < 15;
2859
- }, lt = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2864
+ }, pt = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2860
2865
  if (r.draggedNode) {
2861
- if (n.setIsForbidden(!Ce(r.draggedNode, o.value, s)), st(t, e)) {
2866
+ if (n.setIsForbidden(!Pe(r.draggedNode, o.value, s)), ut(t, e)) {
2862
2867
  n.pointBefore(e);
2863
2868
  return;
2864
2869
  }
2865
2870
  n.pointAfter(e);
2866
2871
  }
2867
- }, nn = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2872
+ }, ln = (t, e, { editor: r, indicator: n, craftNode: o, resolver: s }) => {
2868
2873
  if (!r.draggedNode) return;
2869
2874
  const i = t.target.closest(".v-craft-drop-text");
2870
2875
  if (i) {
2871
- const u = !fe(r.draggedNode, o.value, s);
2876
+ const u = !me(r.draggedNode, o.value, s);
2872
2877
  n.setIsForbidden(u), n.pointInside(i);
2873
2878
  return;
2874
2879
  }
2875
- if (it(t, e)) {
2876
- lt(t, e, { editor: r, indicator: n, craftNode: o, resolver: s });
2880
+ if (dt(t, e)) {
2881
+ pt(t, e, { editor: r, indicator: n, craftNode: o, resolver: s });
2877
2882
  return;
2878
2883
  }
2879
- const l = !fe(r.draggedNode, o.value, s);
2880
- if (n.setIsForbidden(l), at(t, e)) {
2884
+ const l = !me(r.draggedNode, o.value, s);
2885
+ if (n.setIsForbidden(l), ct(t, e)) {
2881
2886
  n.pointInsideTop(e);
2882
2887
  return;
2883
2888
  }
2884
2889
  n.pointInside(e);
2885
- }, on = (t, e, r) => {
2886
- if (Y(r.craftNode.value)) {
2887
- nn(t, e, r);
2890
+ }, un = (t, e, r) => {
2891
+ if (W(r.craftNode.value)) {
2892
+ ln(t, e, r);
2888
2893
  return;
2889
2894
  }
2890
- lt(t, e, r);
2891
- }, ut = (t, e, r, n) => {
2892
- if (!Ce(
2895
+ pt(t, e, r);
2896
+ }, ft = (t, e, r, n) => {
2897
+ if (!Pe(
2893
2898
  r,
2894
2899
  n.craftNode.value,
2895
2900
  n.resolver
@@ -2899,13 +2904,13 @@ Error:`,
2899
2904
  if (!o)
2900
2905
  return n.craftNode.value;
2901
2906
  const s = Object.values(o.slots || {}).flat().find((a) => a.uuid === n.craftNode.value.uuid);
2902
- return !s || s.uuid === r.uuid || (st(t, e) ? n.editor.insertNodeBefore(r, s) : n.editor.insertNodeAfter(r, s)), n.craftNode.value;
2903
- }, ct = (t, e, r, n) => {
2907
+ return !s || s.uuid === r.uuid || (ut(t, e) ? n.editor.insertNodeBefore(r, s) : n.editor.insertNodeAfter(r, s)), n.craftNode.value;
2908
+ }, ht = (t, e, r, n) => {
2904
2909
  const { editor: o, resolver: s, craftNode: a } = n, i = t.target, l = o.nodeMap.get(i.id);
2905
- if (l && Y(l))
2906
- return ct(t, e, r, {
2910
+ if (l && W(l))
2911
+ return ht(t, e, r, {
2907
2912
  ...n,
2908
- craftNode: H(l)
2913
+ craftNode: K(l)
2909
2914
  }), n.craftNode.value;
2910
2915
  const u = i.closest(".v-craft-drop-text");
2911
2916
  let p = "default";
@@ -2913,38 +2918,38 @@ Error:`,
2913
2918
  const m = u.getAttribute("data-slot-name");
2914
2919
  m && (p = m);
2915
2920
  } else {
2916
- if (it(t, e))
2917
- return ut(t, e, r, n);
2921
+ if (dt(t, e))
2922
+ return ft(t, e, r, n);
2918
2923
  const m = n.craftNode.value.slots || {}, f = Object.keys(m);
2919
2924
  p = f.length > 0 ? f[0] : "default";
2920
2925
  }
2921
- return fe(
2926
+ return me(
2922
2927
  r,
2923
2928
  n.craftNode.value,
2924
2929
  n.resolver
2925
- ) && (at(t, e) ? n.editor.prependNodeTo(
2930
+ ) && (ct(t, e) ? n.editor.prependNodeTo(
2926
2931
  r,
2927
2932
  n.craftNode.value,
2928
2933
  p
2929
2934
  ) : n.editor.appendNodeTo(r, n.craftNode.value, p)), n.craftNode.value;
2930
- }, sn = (t, e, r) => {
2935
+ }, cn = (t, e, r) => {
2931
2936
  if (!r.editor.draggedNode)
2932
2937
  return r.craftNode.value;
2933
2938
  const n = (() => {
2934
2939
  let o;
2935
- return r.editor.draggedNode?.uuid ? o = JSON.parse(JSON.stringify(r.editor.draggedNode)) : o = Je(
2940
+ return r.editor.draggedNode?.uuid ? o = JSON.parse(JSON.stringify(r.editor.draggedNode)) : o = nt(
2936
2941
  JSON.parse(JSON.stringify(r.editor.draggedNode))
2937
- ), et(o, r.resolver);
2942
+ ), ot(o, r.resolver);
2938
2943
  })();
2939
- return Y(r.craftNode.value) ? ct(t, e, n, r) : ut(t, e, n, r);
2940
- }, Ke = {
2941
- handleDragOver: on,
2942
- handleDrop: sn
2943
- }, an = (t, e, r) => {
2944
- const n = V(), o = Re(), s = (u) => {
2944
+ return W(r.craftNode.value) ? ht(t, e, n, r) : ft(t, e, n, r);
2945
+ }, qe = {
2946
+ handleDragOver: un,
2947
+ handleDrop: cn
2948
+ }, dn = (t, e, r) => {
2949
+ const n = q(), o = Ue(), s = (u) => {
2945
2950
  n.enabled && n.dragNode(t.value);
2946
- }, a = Qe((u) => {
2947
- n.enabled && e.value?.$el && Ke.handleDragOver(u, e.value.$el, {
2951
+ }, a = Je((u) => {
2952
+ n.enabled && e.value?.$el && qe.handleDragOver(u, e.value.$el, {
2948
2953
  editor: n,
2949
2954
  indicator: o,
2950
2955
  craftNode: t,
@@ -2955,7 +2960,7 @@ Error:`,
2955
2960
  handleDragStart: s,
2956
2961
  handleDragOver: a,
2957
2962
  handleDrop: (u) => {
2958
- n.enabled && e.value?.$el && Ke.handleDrop(u, e.value.$el, {
2963
+ n.enabled && e.value?.$el && qe.handleDrop(u, e.value.$el, {
2959
2964
  editor: n,
2960
2965
  indicator: o,
2961
2966
  craftNode: t,
@@ -2966,7 +2971,7 @@ Error:`,
2966
2971
  n.enabled && n.dragNode(null);
2967
2972
  }
2968
2973
  };
2969
- }, ln = ["data-slot-name"], un = { class: "v-craft-slot-name" }, cn = /* @__PURE__ */ j({
2974
+ }, pn = ["data-slot-name"], fn = { class: "v-craft-slot-name" }, hn = /* @__PURE__ */ B({
2970
2975
  name: "CraftNodeEditor",
2971
2976
  __name: "CraftNodeEditor",
2972
2977
  props: {
@@ -2974,143 +2979,161 @@ Error:`,
2974
2979
  context: {}
2975
2980
  },
2976
2981
  setup(t) {
2977
- const e = t, { craftNode: r } = me(e), { editor: n, visible: o } = ot(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = Ee(r, () => e.context || {}), u = (k, $ = {}, L) => {
2978
- const re = a?.value?.getSlotsProps?.(r.value)?.[k], K = re ? Object.fromEntries(
2979
- re.filter((X) => X in $).map((X) => [X, $[X]])
2980
- ) : $, ue = {
2982
+ const e = t, { craftNode: r } = be(e), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = _e(r, () => e.context || {}), u = (S, R = {}, F) => {
2983
+ const Z = a?.value?.getSlotsProps?.(r.value)?.[S], z = Z ? Object.fromEntries(
2984
+ Z.filter((Y) => Y in R).map((Y) => [Y, R[Y]])
2985
+ ) : R, pe = {
2981
2986
  ...e.context || {},
2982
- [k]: K
2987
+ [S]: z
2983
2988
  };
2984
- return L !== void 0 && (ue.data = L), ue;
2989
+ return F !== void 0 && (pe.data = F), pe;
2985
2990
  };
2986
- J(
2991
+ ne(
2987
2992
  a,
2988
- (k) => {
2989
- k && W("resolver", a);
2993
+ (S) => {
2994
+ S && te("resolver", a);
2990
2995
  },
2991
2996
  { immediate: !0 }
2992
2997
  );
2993
- const p = H(null), m = H(null), f = N(() => n?.nodeDataMap[r.value.uuid]), { isSelected: h, isDraggable: y, selectNode: x } = rn(
2998
+ const p = K(null), m = K(null), f = _(() => n?.nodeDataMap[r.value.uuid]), { isSelected: h, isDraggable: g, selectNode: P } = an(
2994
2999
  r.value,
2995
3000
  p
2996
- ), { handleDragStart: P, handleDragOver: g, handleDrop: E, handleDragEnd: b } = an(r, p, a.value), { eventHandlers: O } = Ie(
3001
+ ), { handleDragStart: A, handleDragOver: C, handleDrop: b, handleDragEnd: T } = dn(r, p, a.value), { eventHandlers: E } = je(
2997
3002
  r,
2998
3003
  n?.eventsContext || {},
2999
- () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3000
- (k) => n?.nodeMap[k] ?? null
3001
- ), C = N(() => {
3002
- const k = a?.value?.resolve(r.value.componentName);
3003
- return k?.label ? k.label : Y(r.value) ? r.value.props.componentName : k?.componentName || r.value.componentName;
3004
- }), I = N(() => rt(r.value.uuid)), R = () => {
3005
- const $ = (m.value?.ownerDocument ?? p.value?.$el?.ownerDocument ?? document).querySelector(
3004
+ {
3005
+ getNodes: () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3006
+ getNode: (S) => n?.nodeMap.get(S) ?? null,
3007
+ nodeValues: n?.nodeRuntimeProps,
3008
+ setNodeProps: (S, R) => n?.setNodeRuntimeProps(S, R),
3009
+ state: n?.pageState
3010
+ }
3011
+ ), w = _(() => n?.nodeRuntimeProps[r.value.uuid] || {}), y = (S) => {
3012
+ n?.setNodeRuntimeProps(r.value.uuid, { value: S });
3013
+ }, x = _(() => {
3014
+ const S = (R, F) => (...Z) => {
3015
+ F(...Z), E.value[R]?.(...Z);
3016
+ };
3017
+ return {
3018
+ ...E.value,
3019
+ input: S("input", (R) => y(R?.target?.value)),
3020
+ change: S("change", (R) => y(R?.target?.value)),
3021
+ "update:modelValue": S("update:modelValue", (R) => y(R))
3022
+ };
3023
+ }), k = _(() => {
3024
+ const S = a?.value?.resolve(r.value.componentName);
3025
+ return S?.label ? S.label : W(r.value) ? r.value.props.componentName : S?.componentName || r.value.componentName;
3026
+ }), L = _(() => at(r.value.uuid)), X = () => {
3027
+ const R = (m.value?.ownerDocument ?? p.value?.$el?.ownerDocument ?? document).querySelector(
3006
3028
  `[data-craft-uuid="${r.value.uuid}"]`
3007
3029
  );
3008
- if ($) return $;
3009
- let L = p.value?.$el;
3010
- for (; L && !(L instanceof HTMLElement); )
3011
- L = L.nextElementSibling ?? null;
3012
- return L ?? null;
3013
- }, ie = (k, $, L) => {
3014
- if (!(k instanceof Element)) {
3015
- console.error("resolveNodeEl returned a non-Element:", k);
3030
+ if (R) return R;
3031
+ let F = p.value?.$el;
3032
+ for (; F && !(F instanceof HTMLElement); )
3033
+ F = F.nextElementSibling ?? null;
3034
+ return F ?? null;
3035
+ }, ce = (S, R, F) => {
3036
+ if (!(S instanceof Element)) {
3037
+ console.error("resolveNodeEl returned a non-Element:", S);
3016
3038
  return;
3017
3039
  }
3018
- k.style.setProperty("--node-name", $), k.style.setProperty("--node-color", L), k.setAttribute("data-node-name", $);
3019
- }, le = () => {
3020
- const k = R();
3021
- k && (m.value = k, ie(k, C.value ?? "(n/a)", I.value));
3040
+ S.style.setProperty("--node-name", R), S.style.setProperty("--node-color", F), S.setAttribute("data-node-name", R);
3041
+ }, de = () => {
3042
+ const S = X();
3043
+ S && (m.value = S, ce(S, k.value ?? "(n/a)", L.value));
3022
3044
  };
3023
- Ne(() => pe(le)), Ot(() => pe(le)), J([C, I], () => {
3024
- m.value && ie(m.value, C.value ?? "", I.value);
3045
+ Se(() => ve(de)), kt(() => ve(de)), ne([k, L], () => {
3046
+ m.value && ce(m.value, k.value ?? "", L.value);
3025
3047
  });
3026
- const dt = N(() => {
3027
- const $ = a?.value?.resolveNode?.(r.value)?.slots;
3028
- return $ && $.length > 0 ? $ : ["default"];
3029
- }), pt = N(() => Y(r.value) ? !0 : Object.values(r.value.slots || {}).some(
3030
- (k) => k.length > 0
3031
- )), ft = () => x(), ht = (k, $) => f.value ? f.value.slotName && f.value.slotName !== $ ? [] : vt(f.value, k) : [], vt = (k, $) => k.type === "single" ? $.map((L) => ({
3032
- key: `${L.uuid}-single`,
3048
+ const vt = _(() => {
3049
+ const R = a?.value?.resolveNode?.(r.value)?.slots;
3050
+ return R && R.length > 0 ? R : ["default"];
3051
+ }), mt = _(() => W(r.value) ? !0 : Object.values(r.value.slots || {}).some(
3052
+ (S) => S.length > 0
3053
+ )), gt = () => P(), yt = (S, R) => f.value ? f.value.slotName && f.value.slotName !== R ? [] : bt(f.value, S) : [], bt = (S, R) => S.type === "single" ? R.map((F) => ({
3054
+ key: `${F.uuid}-single`,
3033
3055
  craftNode: {
3034
- ...L,
3035
- props: { ...L.props, ...k.item || {} }
3056
+ ...F,
3057
+ props: { ...F.props, ...S.item || {} }
3036
3058
  },
3037
- dataItem: k.item || {}
3038
- })) : k.type === "list" ? k.list ? $.reduce((L, re) => L.concat(
3039
- k.list.map((K, ue) => ({
3040
- key: `${re.uuid}-data-${ue}`,
3059
+ dataItem: S.item || {}
3060
+ })) : S.type === "list" ? S.list ? R.reduce((F, Z) => F.concat(
3061
+ S.list.map((z, pe) => ({
3062
+ key: `${Z.uuid}-data-${pe}`,
3041
3063
  craftNode: {
3042
- ...re,
3043
- props: { ...re.props, ...K || {} }
3064
+ ...Z,
3065
+ props: { ...Z.props, ...z || {} }
3044
3066
  },
3045
- dataItem: K || {}
3067
+ dataItem: z || {}
3046
3068
  }))
3047
3069
  ), []) : [] : [];
3048
- return (k, $) => {
3049
- const L = B("CraftNodeViewer"), re = B("CraftNodeEditor", !0);
3050
- return d(o) && d(r) && d(s) ? (v(), A(ye(d(i)), _e({
3070
+ return (S, R) => {
3071
+ const F = H("CraftNodeViewer"), Z = H("CraftNodeEditor", !0);
3072
+ return d(o) && d(r) && d(s) ? (v(), $(Ce(d(i)), xe({
3051
3073
  key: 0,
3052
3074
  ref_key: "nodeRef",
3053
3075
  ref: p
3054
3076
  }, {
3055
3077
  ...d(l),
3078
+ ...w.value,
3056
3079
  "data-craft-uuid": d(r).uuid
3057
- }, $e(d(O)), {
3080
+ }, Te(x.value), {
3058
3081
  class: {
3059
3082
  "v-craft-node-selected": d(h),
3060
3083
  "v-craft-node": d(n)?.enabled,
3061
- "v-craft-canvas": d(Y)(d(r)),
3062
- "v-craft-empty": !d(r).slots || Object.keys(d(r).slots).length === 0 || Object.values(d(r).slots).every((K) => K.length === 0),
3063
- "v-craft-other-node-dragged": d(n)?.draggedNode && !d(Ze)(d(n).draggedNode, d(r))
3084
+ "v-craft-canvas": d(W)(d(r)),
3085
+ "v-craft-empty": !d(r).slots || Object.keys(d(r).slots).length === 0 || Object.values(d(r).slots).every((z) => z.length === 0),
3086
+ "v-craft-other-node-dragged": d(n)?.draggedNode && !d(rt)(d(n).draggedNode, d(r))
3064
3087
  },
3065
- draggable: d(n)?.enabled && d(y),
3066
- onClick: F(ft, ["prevent", "stop"]),
3067
- onDragend: F(d(b), ["prevent", "stop"]),
3068
- onDragover: F(d(g), ["prevent", "stop"]),
3069
- onDragstart: F(d(P), ["stop"]),
3070
- onDrop: F(d(E), ["prevent", "stop"])
3071
- }), be({ _: 2 }, [
3072
- T(dt.value, (K) => ({
3073
- name: K,
3074
- fn: q((ue) => [
3075
- d(Y)(d(r)) && (!d(r).slots || d(r).slots[K]?.length == 0) ? (v(), _("div", {
3088
+ draggable: d(n)?.enabled && d(g),
3089
+ onClick: V(gt, ["prevent", "stop"]),
3090
+ onDragend: V(d(T), ["prevent", "stop"]),
3091
+ onDragover: V(d(C), ["prevent", "stop"]),
3092
+ onDragstart: V(d(A), ["stop"]),
3093
+ onDrop: V(d(b), ["prevent", "stop"])
3094
+ }), Ne({ _: 2 }, [
3095
+ U(vt.value, (z) => ({
3096
+ name: z,
3097
+ fn: G((pe) => [
3098
+ d(W)(d(r)) && (!d(r).slots || d(r).slots[z]?.length == 0) ? (v(), N("div", {
3076
3099
  key: 0,
3077
3100
  class: "v-craft-drop-text",
3078
- "data-slot-name": K,
3079
- onDragover: $[0] || ($[0] = F(
3101
+ "data-slot-name": z,
3102
+ onDragover: R[0] || (R[0] = V(
3080
3103
  //@ts-ignore
3081
- (...X) => d(g) && d(g)(...X),
3104
+ (...Y) => d(C) && d(C)(...Y),
3082
3105
  ["prevent", "stop"]
3083
3106
  )),
3084
- onDrop: $[1] || ($[1] = F(
3107
+ onDrop: R[1] || (R[1] = V(
3085
3108
  //@ts-ignore
3086
- (...X) => d(E) && d(E)(...X),
3109
+ (...Y) => d(b) && d(b)(...Y),
3087
3110
  ["prevent", "stop"]
3088
3111
  ))
3089
3112
  }, [
3090
- $[2] || ($[2] = w("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
3091
- w("span", un, ee(K), 1)
3092
- ], 40, ln)) : D("", !0),
3093
- pt.value ? (v(), _(U, { key: 1 }, [
3094
- f.value?.type && (!f.value.slotName || f.value.slotName === K) ? (v(!0), _(U, { key: 0 }, T(ht(
3095
- d(r).slots?.[K] || [],
3096
- K
3097
- ), (X) => (v(), A(L, {
3098
- key: X.key,
3099
- craftNode: X.craftNode,
3100
- context: u(K, ue, X.dataItem)
3101
- }, null, 8, ["craftNode", "context"]))), 128)) : D("", !0),
3102
- (v(!0), _(U, null, T(d(r).slots?.[K] || [], (X) => (v(), A(re, {
3103
- key: X.uuid,
3104
- craftNode: X,
3105
- context: u(K, ue)
3113
+ R[2] || (R[2] = O("span", { class: "v-craft-drop-text-label" }, "Drop a component here", -1)),
3114
+ O("span", fn, oe(z), 1)
3115
+ ], 40, pn)) : M("", !0),
3116
+ mt.value ? (v(), N(j, { key: 1 }, [
3117
+ f.value?.type && (!f.value.slotName || f.value.slotName === z) ? (v(!0), N(j, { key: 0 }, U(yt(
3118
+ d(r).slots?.[z] || [],
3119
+ z
3120
+ ), (Y) => (v(), $(F, {
3121
+ key: Y.key,
3122
+ craftNode: Y.craftNode,
3123
+ context: u(z, pe, Y.dataItem)
3124
+ }, null, 8, ["craftNode", "context"]))), 128)) : M("", !0),
3125
+ (v(!0), N(j, null, U(d(r).slots?.[z] || [], (Y) => (v(), $(Z, {
3126
+ key: Y.uuid,
3127
+ craftNode: Y,
3128
+ context: u(z, pe)
3106
3129
  }, null, 8, ["craftNode", "context"]))), 128))
3107
- ], 64)) : D("", !0)
3130
+ ], 64)) : M("", !0)
3108
3131
  ])
3109
3132
  }))
3110
- ]), 1040, ["class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : D("", !0);
3133
+ ]), 1040, ["class", "draggable", "onDragend", "onDragover", "onDragstart", "onDrop"])) : M("", !0);
3111
3134
  };
3112
3135
  }
3113
- }), ke = /* @__PURE__ */ j({
3136
+ }), Re = /* @__PURE__ */ B({
3114
3137
  name: "CraftNodeViewer",
3115
3138
  __name: "CraftNodeViewer",
3116
3139
  props: {
@@ -3120,77 +3143,94 @@ Error:`,
3120
3143
  context: {}
3121
3144
  },
3122
3145
  setup(t) {
3123
- const e = t, r = de(e, "craftNode"), { editor: n, visible: o } = ot(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = Ee(r, () => e.context || {});
3124
- W("resolver", a);
3125
- const u = (b, O = {}, C) => {
3126
- const I = a?.value?.getSlotsProps?.(r.value)?.[b], R = I ? Object.fromEntries(
3127
- I.filter((le) => le in O).map((le) => [le, O[le]])
3128
- ) : O, ie = {
3146
+ const e = t, r = he(e, "craftNode"), { editor: n, visible: o } = lt(r), { resolvedNode: s, resolver: a, componentToRender: i, props: l } = _e(r, () => e.context || {});
3147
+ te("resolver", a);
3148
+ const u = (y, x = {}, k) => {
3149
+ const L = a?.value?.getSlotsProps?.(r.value)?.[y], X = L ? Object.fromEntries(
3150
+ L.filter((de) => de in x).map((de) => [de, x[de]])
3151
+ ) : x, ce = {
3129
3152
  ...e.context || {},
3130
- [b]: R
3153
+ [y]: X
3131
3154
  };
3132
- return C !== void 0 && (ie.data = C), ie;
3133
- }, p = N(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), m = N(() => r.value.slots || {}), f = N(() => Y(r.value)), h = N(() => {
3134
- if (!y.value)
3155
+ return k !== void 0 && (ce.data = k), ce;
3156
+ }, p = _(() => e.nodeDataMap?.[r.value.uuid] || n?.nodeDataMap?.[r.value.uuid]), m = _(() => r.value.slots || {}), f = _(() => W(r.value)), h = _(() => {
3157
+ if (!g.value)
3135
3158
  return [];
3136
- const b = [], C = a?.value?.resolveNode?.(r.value)?.slots;
3137
- return C && C.length > 0 ? b.push(...C) : b.push("default"), b;
3138
- }), y = N(() => f.value ? !0 : Object.values(m.value).some((b) => b.length > 0)), x = (b, O) => p.value ? p.value.slotName && p.value.slotName !== O ? [] : E(p.value, b) : [], P = H(null), { eventHandlers: g } = Ie(
3159
+ const y = [], k = a?.value?.resolveNode?.(r.value)?.slots;
3160
+ return k && k.length > 0 ? y.push(...k) : y.push("default"), y;
3161
+ }), g = _(() => f.value ? !0 : Object.values(m.value).some((y) => y.length > 0)), P = (y, x) => p.value ? p.value.slotName && p.value.slotName !== x ? [] : w(p.value, y) : [], A = K(null), { eventHandlers: C } = je(
3139
3162
  r,
3140
3163
  e.eventsContext || n?.eventsContext || {},
3141
- () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3142
- (b) => n?.nodeMap[b] ?? null
3143
- );
3144
- Ne(() => {
3145
- P.value && r.value && n && n.setNodeRef(r.value, P.value);
3164
+ {
3165
+ getNodes: () => n?.nodeMap ? Object.fromEntries(n.nodeMap.entries()) : null,
3166
+ getNode: (y) => n?.nodeMap.get(y) ?? null,
3167
+ nodeValues: n?.nodeRuntimeProps,
3168
+ setNodeProps: (y, x) => n?.setNodeRuntimeProps(y, x),
3169
+ state: n?.pageState
3170
+ }
3171
+ ), b = _(() => n?.nodeRuntimeProps[r.value.uuid] || {}), T = (y) => {
3172
+ n?.setNodeRuntimeProps(r.value.uuid, { value: y });
3173
+ }, E = _(() => {
3174
+ const y = (x, k) => (...L) => {
3175
+ k(...L), C.value[x]?.(...L);
3176
+ };
3177
+ return {
3178
+ ...C.value,
3179
+ input: y("input", (x) => T(x?.target?.value)),
3180
+ change: y("change", (x) => T(x?.target?.value)),
3181
+ "update:modelValue": y("update:modelValue", (x) => T(x))
3182
+ };
3183
+ });
3184
+ Se(() => {
3185
+ A.value && r.value && n && n.setNodeRef(r.value, A.value);
3146
3186
  });
3147
- const E = (b, O) => b.type === "single" ? O.map((C) => ({
3148
- key: `${C.uuid}-single`,
3187
+ const w = (y, x) => y.type === "single" ? x.map((k) => ({
3188
+ key: `${k.uuid}-single`,
3149
3189
  craftNode: {
3150
- ...C,
3190
+ ...k,
3151
3191
  props: {
3152
- ...C.props,
3153
- ...b.item || {}
3192
+ ...k.props,
3193
+ ...y.item || {}
3154
3194
  }
3155
3195
  },
3156
- dataItem: b.item || {}
3157
- })) : b.type === "list" ? b.list ? O.reduce((C, I) => C.concat(
3196
+ dataItem: y.item || {}
3197
+ })) : y.type === "list" ? y.list ? x.reduce((k, L) => k.concat(
3158
3198
  //@ts-ignore
3159
- b.list.map((R, ie) => ({
3160
- key: `${I.uuid}-data-${ie}`,
3199
+ y.list.map((X, ce) => ({
3200
+ key: `${L.uuid}-data-${ce}`,
3161
3201
  craftNode: {
3162
- ...I,
3202
+ ...L,
3163
3203
  props: {
3164
- ...I.props,
3165
- ...R || {}
3204
+ ...L.props,
3205
+ ...X || {}
3166
3206
  }
3167
3207
  }
3168
3208
  }))
3169
3209
  ), []) : [] : [];
3170
- return (b, O) => d(o) && d(a) && d(s) ? (v(), A(ye(d(i)), _e({
3210
+ return (y, x) => d(o) && d(a) && d(s) ? (v(), $(Ce(d(i)), xe({
3171
3211
  key: 0,
3172
3212
  ref_key: "nodeRef",
3173
- ref: P
3174
- }, d(l), $e(d(g))), be({ _: 2 }, [
3175
- T(h.value, (C) => ({
3176
- name: C,
3177
- fn: q((I) => [
3178
- y.value ? (v(), _(U, { key: 0 }, [
3179
- p.value?.type ? (v(!0), _(U, { key: 1 }, T(x(m.value[C], C), (R) => (v(), A(ke, {
3180
- key: R.key,
3181
- craftNode: R.craftNode,
3182
- context: u(C, I, R.dataItem)
3183
- }, null, 8, ["craftNode", "context"]))), 128)) : (v(!0), _(U, { key: 0 }, T(m.value[C], (R) => (v(), A(ke, {
3184
- key: R.uuid,
3185
- craftNode: R,
3186
- context: u(C, I)
3213
+ ref: A
3214
+ }, { ...d(l), ...b.value }, Te(E.value)), Ne({ _: 2 }, [
3215
+ U(h.value, (k) => ({
3216
+ name: k,
3217
+ fn: G((L) => [
3218
+ g.value ? (v(), N(j, { key: 0 }, [
3219
+ p.value?.type ? (v(!0), N(j, { key: 1 }, U(P(m.value[k], k), (X) => (v(), $(Re, {
3220
+ key: X.key,
3221
+ craftNode: X.craftNode,
3222
+ context: u(k, L, X.dataItem)
3223
+ }, null, 8, ["craftNode", "context"]))), 128)) : (v(!0), N(j, { key: 0 }, U(m.value[k], (X) => (v(), $(Re, {
3224
+ key: X.uuid,
3225
+ craftNode: X,
3226
+ context: u(k, L)
3187
3227
  }, null, 8, ["craftNode", "context"]))), 128))
3188
- ], 64)) : D("", !0)
3228
+ ], 64)) : M("", !0)
3189
3229
  ])
3190
3230
  }))
3191
- ]), 1040)) : D("", !0);
3231
+ ]), 1040)) : M("", !0);
3192
3232
  }
3193
- }), De = /* @__PURE__ */ j({
3233
+ }), Me = /* @__PURE__ */ B({
3194
3234
  name: "CraftNodeStatic",
3195
3235
  __name: "CraftNodeStatic",
3196
3236
  props: {
@@ -3198,80 +3238,106 @@ Error:`,
3198
3238
  nodeMap: {},
3199
3239
  nodeDataMap: {},
3200
3240
  eventsContext: {},
3241
+ nodeRuntimeProps: {},
3242
+ pageState: {},
3201
3243
  context: {}
3202
3244
  },
3203
3245
  setup(t) {
3204
- const e = t, { craftNode: r, nodeMap: n } = me(e), { resolvedNode: o, resolver: s, componentToRender: a, props: i } = Ee(r, () => e.context || {});
3205
- W("resolver", s), W("craftNode", qe(r.value));
3206
- const l = (g, E = {}, b) => {
3207
- const O = s?.value?.getSlotsProps?.(r.value)?.[g], C = O ? Object.fromEntries(
3208
- O.filter((R) => R in E).map((R) => [R, E[R]])
3209
- ) : E, I = {
3246
+ const e = t, { craftNode: r, nodeMap: n } = be(e), { resolvedNode: o, resolver: s, componentToRender: a, props: i } = _e(r, () => e.context || {});
3247
+ te("resolver", s), te("craftNode", We(r.value));
3248
+ const l = (E, w = {}, y) => {
3249
+ const x = s?.value?.getSlotsProps?.(r.value)?.[E], k = x ? Object.fromEntries(
3250
+ x.filter((X) => X in w).map((X) => [X, w[X]])
3251
+ ) : w, L = {
3210
3252
  ...e.context || {},
3211
- [g]: C
3253
+ [E]: k
3212
3254
  };
3213
- return b !== void 0 && (I.data = b), I;
3214
- }, u = N(() => e.nodeDataMap?.[r.value.uuid] || null), p = N(() => r.value.slots || {}), m = N(() => Y(r.value)), f = N(() => {
3255
+ return y !== void 0 && (L.data = y), L;
3256
+ }, u = _(() => e.nodeDataMap?.[r.value.uuid] || null), p = _(() => r.value.slots || {}), m = _(() => W(r.value)), f = _(() => {
3215
3257
  if (!h.value)
3216
3258
  return [];
3217
- const g = [], b = s?.value?.resolveNode?.(r.value)?.slots;
3218
- return b && b.length > 0 ? g.push(...b) : g.push("default"), g;
3219
- }), h = N(() => m.value ? !0 : Object.values(p.value).some((g) => g.length > 0)), y = (g, E) => u.value ? u.value.slotName && u.value.slotName !== E ? [] : P(u.value, g) : [], { eventHandlers: x } = Ie(
3259
+ const E = [], y = s?.value?.resolveNode?.(r.value)?.slots;
3260
+ return y && y.length > 0 ? E.push(...y) : E.push("default"), E;
3261
+ }), h = _(() => m.value ? !0 : Object.values(p.value).some((E) => E.length > 0)), g = (E, w) => u.value ? u.value.slotName && u.value.slotName !== w ? [] : T(u.value, E) : [], P = (E, w) => {
3262
+ e.nodeRuntimeProps && (e.nodeRuntimeProps[E] = { ...e.nodeRuntimeProps[E] || {}, ...w });
3263
+ }, { eventHandlers: A } = je(
3220
3264
  r,
3221
3265
  e.eventsContext || {},
3222
- () => Object.fromEntries(n.value.entries()),
3223
- (g) => n.value[g] ?? null
3224
- ), P = (g, E) => g.type === "single" ? E.map((b) => ({
3225
- key: `${b.uuid}-single`,
3266
+ {
3267
+ getNodes: () => Object.fromEntries(n.value.entries()),
3268
+ getNode: (E) => n.value.get(E) ?? null,
3269
+ nodeValues: e.nodeRuntimeProps,
3270
+ setNodeProps: P,
3271
+ state: e.pageState
3272
+ }
3273
+ ), C = _(() => ({
3274
+ ...i.value,
3275
+ ...e.nodeRuntimeProps?.[r.value.uuid] || {}
3276
+ })), b = _(() => {
3277
+ const E = (w, y) => (...x) => {
3278
+ y(...x), A.value[w]?.(...x);
3279
+ };
3280
+ return {
3281
+ ...A.value,
3282
+ input: E("input", (w) => P(r.value.uuid, { value: w?.target?.value })),
3283
+ change: E("change", (w) => P(r.value.uuid, { value: w?.target?.value })),
3284
+ "update:modelValue": E("update:modelValue", (w) => P(r.value.uuid, { value: w }))
3285
+ };
3286
+ }), T = (E, w) => E.type === "single" ? w.map((y) => ({
3287
+ key: `${y.uuid}-single`,
3226
3288
  craftNode: {
3227
- ...b,
3289
+ ...y,
3228
3290
  props: {
3229
- ...b.props,
3230
- ...g.item || {}
3291
+ ...y.props,
3292
+ ...E.item || {}
3231
3293
  }
3232
3294
  },
3233
- dataItem: g.item || {}
3234
- })) : g.type === "list" ? g.list ? E.reduce((b, O) => b.concat(
3295
+ dataItem: E.item || {}
3296
+ })) : E.type === "list" ? E.list ? w.reduce((y, x) => y.concat(
3235
3297
  //@ts-ignore
3236
- g.list.map((C, I) => ({
3237
- key: `${O.uuid}-data-${I}`,
3298
+ E.list.map((k, L) => ({
3299
+ key: `${x.uuid}-data-${L}`,
3238
3300
  craftNode: {
3239
- ...O,
3301
+ ...x,
3240
3302
  props: {
3241
- ...O.props,
3242
- ...C || {}
3303
+ ...x.props,
3304
+ ...k || {}
3243
3305
  }
3244
3306
  },
3245
- dataItem: C || {}
3307
+ dataItem: k || {}
3246
3308
  }))
3247
3309
  ), []) : [] : [];
3248
- return (g, E) => (d(r).visible || d(r).visible === void 0) && d(s) && d(o) ? (v(), A(ye(d(a)), _e({
3310
+ return (E, w) => (d(r).visible || d(r).visible === void 0) && d(s) && d(o) ? (v(), $(Ce(d(a)), xe({
3249
3311
  key: 0,
3250
3312
  ref: "nodeRef"
3251
- }, d(i), $e(d(x))), be({ _: 2 }, [
3252
- T(f.value, (b) => ({
3253
- name: b,
3254
- fn: q((O) => [
3255
- u.value?.type ? (v(!0), _(U, { key: 1 }, T(y(p.value[b], b), (C) => (v(), A(De, {
3256
- key: C.key,
3257
- craftNode: C.craftNode,
3313
+ }, C.value, Te(b.value)), Ne({ _: 2 }, [
3314
+ U(f.value, (y) => ({
3315
+ name: y,
3316
+ fn: G((x) => [
3317
+ u.value?.type ? (v(!0), N(j, { key: 1 }, U(g(p.value[y], y), (k) => (v(), $(Me, {
3318
+ key: k.key,
3319
+ craftNode: k.craftNode,
3258
3320
  nodeMap: d(n),
3259
3321
  nodeDataMap: t.nodeDataMap,
3260
3322
  eventsContext: t.eventsContext,
3261
- context: l(b, O, C.dataItem)
3262
- }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "context"]))), 128)) : (v(!0), _(U, { key: 0 }, T(p.value[b], (C) => (v(), A(De, {
3263
- key: C.uuid,
3264
- craftNode: C,
3323
+ nodeRuntimeProps: t.nodeRuntimeProps,
3324
+ pageState: t.pageState,
3325
+ context: l(y, x, k.dataItem)
3326
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState", "context"]))), 128)) : (v(!0), N(j, { key: 0 }, U(p.value[y], (k) => (v(), $(Me, {
3327
+ key: k.uuid,
3328
+ craftNode: k,
3265
3329
  nodeMap: d(n),
3266
3330
  nodeDataMap: t.nodeDataMap,
3267
3331
  eventsContext: t.eventsContext,
3268
- context: l(b, O)
3269
- }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "context"]))), 128))
3332
+ nodeRuntimeProps: t.nodeRuntimeProps,
3333
+ pageState: t.pageState,
3334
+ context: l(y, x)
3335
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState", "context"]))), 128))
3270
3336
  ])
3271
3337
  }))
3272
- ]), 1040)) : D("", !0);
3338
+ ]), 1040)) : M("", !0);
3273
3339
  }
3274
- }), dn = /* @__PURE__ */ j({
3340
+ }), vn = /* @__PURE__ */ B({
3275
3341
  name: "CraftStaticRenderer",
3276
3342
  __name: "CraftStaticRenderer",
3277
3343
  props: {
@@ -3282,48 +3348,52 @@ Error:`,
3282
3348
  eventsContext: {}
3283
3349
  },
3284
3350
  setup(t) {
3285
- const e = t, r = (s, a) => {
3286
- a.set(s.uuid, s), Object.entries(s.slots).forEach(([i, l]) => {
3287
- l?.forEach && l.forEach((u) => r(u, a));
3351
+ const e = t, r = (i, l) => {
3352
+ l.set(i.uuid, i), Object.entries(i.slots).forEach(([u, p]) => {
3353
+ p?.forEach && p.forEach((m) => r(m, l));
3288
3354
  });
3289
- }, n = N(() => {
3290
- const s = /* @__PURE__ */ new Map();
3291
- return e.nodes.forEach((a) => r(a, s)), s;
3292
- }), o = N(
3293
- () => e.resolver || new xe(e.resolverMap)
3355
+ }, n = _(() => {
3356
+ const i = /* @__PURE__ */ new Map();
3357
+ return e.nodes.forEach((l) => r(l, i)), i;
3358
+ }), o = _(
3359
+ () => e.resolver || new Oe(e.resolverMap)
3294
3360
  );
3295
- return W("resolver", o), W("nodeDataMap", e.nodeDataMap || {}), W("eventsContext", e.eventsContext || {}), (s, a) => (v(!0), _(U, null, T(t.nodes, (i) => (v(), A(De, {
3296
- key: i.uuid,
3297
- craftNode: i,
3361
+ te("resolver", o), te("nodeDataMap", e.nodeDataMap || {}), te("eventsContext", e.eventsContext || {});
3362
+ const s = He({}), a = He({});
3363
+ return (i, l) => (v(!0), N(j, null, U(t.nodes, (u) => (v(), $(Me, {
3364
+ key: u.uuid,
3365
+ craftNode: u,
3298
3366
  nodeMap: n.value,
3299
3367
  nodeDataMap: t.nodeDataMap,
3300
- eventsContext: t.eventsContext
3301
- }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext"]))), 128));
3368
+ eventsContext: t.eventsContext,
3369
+ nodeRuntimeProps: s,
3370
+ pageState: a
3371
+ }, null, 8, ["craftNode", "nodeMap", "nodeDataMap", "eventsContext", "nodeRuntimeProps", "pageState"]))), 128));
3302
3372
  }
3303
- }), Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3373
+ }), Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3304
3374
  __proto__: null,
3305
- CraftCanvas: Vt,
3306
- CraftComponentSimpleText: Qt,
3307
- CraftEditor: Gt,
3308
- CraftEditorBlueprint: Wt,
3309
- CraftEditorBlueprintsList: nr,
3310
- CraftEditorPanelBlueprints: ir,
3311
- CraftEditorPanelForm: lr,
3312
- CraftEditorPanelLayers: fr,
3313
- CraftEditorPanelLayout: Er,
3314
- CraftEditorPanelNodeDataSourceSettings: xr,
3315
- CraftEditorPanelNodeEventsSettings: wr,
3316
- CraftEditorPanelNodeLayer: Ar,
3317
- CraftEditorPanelNodeSettings: $r,
3318
- CraftEditorPanelNodeSlotPropsSettings: Hr,
3319
- CraftEditorPanelSettings: Wr,
3320
- CraftFrame: tn,
3321
- CraftIframe: nt,
3322
- CraftNodeEditor: cn,
3323
- CraftNodeViewer: ke,
3324
- CraftStaticRenderer: dn,
3325
- Utils: Zt
3326
- }, Symbol.toStringTag, { value: "Module" })), Cn = {
3375
+ CraftCanvas: Yt,
3376
+ CraftComponentSimpleText: Jt,
3377
+ CraftEditor: er,
3378
+ CraftEditorBlueprint: tr,
3379
+ CraftEditorBlueprintsList: ir,
3380
+ CraftEditorPanelBlueprints: dr,
3381
+ CraftEditorPanelForm: pr,
3382
+ CraftEditorPanelLayers: gr,
3383
+ CraftEditorPanelLayout: Pr,
3384
+ CraftEditorPanelNodeDataSourceSettings: wr,
3385
+ CraftEditorPanelNodeEventsSettings: Dr,
3386
+ CraftEditorPanelNodeLayer: Ir,
3387
+ CraftEditorPanelNodeSettings: Ur,
3388
+ CraftEditorPanelNodeSlotPropsSettings: zr,
3389
+ CraftEditorPanelSettings: tn,
3390
+ CraftFrame: sn,
3391
+ CraftIframe: it,
3392
+ CraftNodeEditor: hn,
3393
+ CraftNodeViewer: Re,
3394
+ CraftStaticRenderer: vn,
3395
+ Utils: rr
3396
+ }, Symbol.toStringTag, { value: "Module" })), xn = {
3327
3397
  metadata: {
3328
3398
  name: "default"
3329
3399
  },
@@ -3339,8 +3409,8 @@ Error:`,
3339
3409
  }
3340
3410
  }
3341
3411
  };
3342
- function _n() {
3343
- const t = H(null);
3412
+ function Sn() {
3413
+ const t = K(null);
3344
3414
  return { nodeEl: t, vNodeEl: {
3345
3415
  mounted(r) {
3346
3416
  t.value = r;
@@ -3353,27 +3423,27 @@ function _n() {
3353
3423
  }
3354
3424
  } };
3355
3425
  }
3356
- const Nn = (t, e, r) => {
3426
+ const On = (t, e, r) => {
3357
3427
  const n = {
3358
3428
  type: e.type,
3359
3429
  item: e.type === "single" ? {} : void 0,
3360
3430
  list: e.type === "list" ? [] : void 0
3361
3431
  }, o = (a, i) => {
3362
3432
  let l = a;
3363
- return i.patchSource === "value" ? i.value ?? i.defaultValue ?? null : (i.patchSource === "child" && (l = r), (i.type === "single" ? S({ path: i.fromPath, json: l, resultType: "value" }) : S({ path: i.fromPath, json: l })) ?? i.defaultValue ?? null);
3364
- }, s = e.type === "single" ? S({ path: e.fromPath, json: t, resultType: "value" }) : S({ path: e.fromPath, json: t });
3433
+ return i.patchSource === "value" ? i.value ?? i.defaultValue ?? null : (i.patchSource === "child" && (l = r), (i.type === "single" ? D({ path: i.fromPath, json: l, resultType: "value" }) : D({ path: i.fromPath, json: l })) ?? i.defaultValue ?? null);
3434
+ }, s = e.type === "single" ? D({ path: e.fromPath, json: t, resultType: "value" }) : D({ path: e.fromPath, json: t });
3365
3435
  return e.type === "single" ? e.patches.forEach((a) => {
3366
3436
  const i = o(s, a);
3367
- Se(n.item, a.toPath, i);
3437
+ De(n.item, a.toPath, i);
3368
3438
  }) : e.type === "list" && (n.list = s.map((a) => {
3369
3439
  const i = {};
3370
3440
  return e.patches.forEach((l) => {
3371
3441
  const u = o(a, l);
3372
- Se(i, l.toPath, u);
3442
+ De(i, l.toPath, u);
3373
3443
  }), i;
3374
3444
  })), n;
3375
3445
  };
3376
- function pn(t, e) {
3446
+ function mn(t, e) {
3377
3447
  const r = {};
3378
3448
  return !t.events || !Object.keys(t.events).length || Object.entries(t.events).forEach(([n, o]) => {
3379
3449
  o?.trim() && (r[n] = (...s) => {
@@ -3396,7 +3466,7 @@ Error:`,
3396
3466
  });
3397
3467
  }), r;
3398
3468
  }
3399
- function fn(t, e, r = "default") {
3469
+ function gn(t, e, r = "default") {
3400
3470
  if (!t.slots || !t.slots[r]) return [];
3401
3471
  const n = t.slots[r];
3402
3472
  return e.type === "single" ? n.map((o) => ({
@@ -3411,20 +3481,20 @@ function fn(t, e, r = "default") {
3411
3481
  }))
3412
3482
  ) : [];
3413
3483
  }
3414
- function Ae(t, e, r, n, o) {
3415
- if (!We(t))
3484
+ function $e(t, e, r, n, o) {
3485
+ if (!tt(t))
3416
3486
  return null;
3417
3487
  const s = e.resolveNode(t), a = s?.componentName || t.componentName, i = r?.[a] || a, l = {
3418
3488
  ...s?.defaultProps || {},
3419
3489
  ...t.props
3420
- }, u = o ? pn(t, o) : {}, p = n?.[t.uuid];
3490
+ }, u = o ? mn(t, o) : {}, p = n?.[t.uuid];
3421
3491
  let m;
3422
- return p?.type ? m = fn(
3492
+ return p?.type ? m = gn(
3423
3493
  t,
3424
3494
  p,
3425
3495
  p.slotName || "default"
3426
3496
  ).map(
3427
- (h) => Ae(
3497
+ (h) => $e(
3428
3498
  h,
3429
3499
  e,
3430
3500
  r,
@@ -3432,19 +3502,19 @@ function Ae(t, e, r, n, o) {
3432
3502
  o
3433
3503
  )
3434
3504
  ).filter((h) => h !== null) : t.slots && (m = Object.values(t.slots).flat().map(
3435
- (f) => Ae(
3505
+ (f) => $e(
3436
3506
  f,
3437
3507
  e,
3438
3508
  r,
3439
3509
  n,
3440
3510
  o
3441
3511
  )
3442
- ).filter((f) => f !== null)), wt(i, { key: t.uuid, ...l, ...u }, m);
3512
+ ).filter((f) => f !== null)), Dt(i, { key: t.uuid, ...l, ...u }, m);
3443
3513
  }
3444
- function xn(t, e) {
3445
- const r = new xe(e.resolverMap);
3514
+ function wn(t, e) {
3515
+ const r = new Oe(e.resolverMap);
3446
3516
  return t.map(
3447
- (n) => Ae(
3517
+ (n) => $e(
3448
3518
  n,
3449
3519
  r,
3450
3520
  e.componentRegistry,
@@ -3453,7 +3523,7 @@ function xn(t, e) {
3453
3523
  )
3454
3524
  ).filter((n) => n !== null);
3455
3525
  }
3456
- const On = {
3526
+ const kn = {
3457
3527
  CraftComponentSimpleText: {
3458
3528
  componentName: "CraftComponentSimpleText",
3459
3529
  eventsSchema: {
@@ -3499,55 +3569,55 @@ const On = {
3499
3569
  CraftCanvas: {
3500
3570
  componentName: "CraftCanvas"
3501
3571
  }
3502
- }, hn = (t) => {
3503
- for (const e in Ve)
3504
- t.component(e, Ve[e]);
3505
- }, wn = { install: hn };
3572
+ }, yn = (t) => {
3573
+ for (const e in Ye)
3574
+ t.component(e, Ye[e]);
3575
+ }, Dn = { install: yn };
3506
3576
  export {
3507
- Vt as CraftCanvas,
3508
- Qt as CraftComponentSimpleText,
3509
- Gt as CraftEditor,
3510
- Wt as CraftEditorBlueprint,
3511
- nr as CraftEditorBlueprintsList,
3512
- ir as CraftEditorPanelBlueprints,
3513
- lr as CraftEditorPanelForm,
3514
- fr as CraftEditorPanelLayers,
3515
- Er as CraftEditorPanelLayout,
3516
- xr as CraftEditorPanelNodeDataSourceSettings,
3517
- wr as CraftEditorPanelNodeEventsSettings,
3518
- Ar as CraftEditorPanelNodeLayer,
3519
- $r as CraftEditorPanelNodeSettings,
3520
- Hr as CraftEditorPanelNodeSlotPropsSettings,
3521
- Wr as CraftEditorPanelSettings,
3522
- tn as CraftFrame,
3523
- nt as CraftIframe,
3524
- cn as CraftNodeEditor,
3525
- xe as CraftNodeResolver,
3526
- ke as CraftNodeViewer,
3527
- dn as CraftStaticRenderer,
3528
- Zt as Utils,
3529
- wn as VCraft,
3530
- Je as buildCraftNodeTree,
3531
- fe as craftNodeCanBeChildOf,
3532
- Ce as craftNodeCanBeSiblingOf,
3533
- zt as craftNodeInCanvas,
3534
- Ze as craftNodeIsAncestorOf,
3535
- Y as craftNodeIsCanvas,
3536
- qt as craftNodeIsDraggable,
3537
- Cn as defaultBlueprints,
3538
- On as defaultResolvers,
3539
- et as initializeSlotsFromResolver,
3540
- We as isVisible,
3541
- Nn as mapData,
3542
- Ae as renderCraftNodeToVNode,
3543
- xn as renderCraftNodesToVNodes,
3544
- ae as resolveNodeName,
3545
- Ir as useAncestorContextBuckets,
3546
- Xt as useCraftNode,
3547
- V as useEditor,
3548
- Re as useIndicator,
3549
- _n as useNodeElement,
3550
- Ee as useResolveCraftNode,
3551
- Ht as useResolveCraftNodeProps
3577
+ Yt as CraftCanvas,
3578
+ Jt as CraftComponentSimpleText,
3579
+ er as CraftEditor,
3580
+ tr as CraftEditorBlueprint,
3581
+ ir as CraftEditorBlueprintsList,
3582
+ dr as CraftEditorPanelBlueprints,
3583
+ pr as CraftEditorPanelForm,
3584
+ gr as CraftEditorPanelLayers,
3585
+ Pr as CraftEditorPanelLayout,
3586
+ wr as CraftEditorPanelNodeDataSourceSettings,
3587
+ Dr as CraftEditorPanelNodeEventsSettings,
3588
+ Ir as CraftEditorPanelNodeLayer,
3589
+ Ur as CraftEditorPanelNodeSettings,
3590
+ zr as CraftEditorPanelNodeSlotPropsSettings,
3591
+ tn as CraftEditorPanelSettings,
3592
+ sn as CraftFrame,
3593
+ it as CraftIframe,
3594
+ hn as CraftNodeEditor,
3595
+ Oe as CraftNodeResolver,
3596
+ Re as CraftNodeViewer,
3597
+ vn as CraftStaticRenderer,
3598
+ rr as Utils,
3599
+ Dn as VCraft,
3600
+ nt as buildCraftNodeTree,
3601
+ me as craftNodeCanBeChildOf,
3602
+ Pe as craftNodeCanBeSiblingOf,
3603
+ Gt as craftNodeInCanvas,
3604
+ rt as craftNodeIsAncestorOf,
3605
+ W as craftNodeIsCanvas,
3606
+ Wt as craftNodeIsDraggable,
3607
+ xn as defaultBlueprints,
3608
+ kn as defaultResolvers,
3609
+ ot as initializeSlotsFromResolver,
3610
+ tt as isVisible,
3611
+ On as mapData,
3612
+ $e as renderCraftNodeToVNode,
3613
+ wn as renderCraftNodesToVNodes,
3614
+ ue as resolveNodeName,
3615
+ Br as useAncestorContextBuckets,
3616
+ Qt as useCraftNode,
3617
+ q as useEditor,
3618
+ Ue as useIndicator,
3619
+ Sn as useNodeElement,
3620
+ _e as useResolveCraftNode,
3621
+ zt as useResolveCraftNodeProps
3552
3622
  };
3553
3623
  //# sourceMappingURL=v-craft.es.js.map