@jsonpages/core 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -293,6 +293,11 @@ export declare interface PersistenceConfig {
293
293
  * src/data/config/*.json and src/data/pages/<slug>.json. No git push.
294
294
  */
295
295
  saveToFile?: (state: ProjectState, slug: string) => Promise<void>;
296
+ /**
297
+ * Optional. If true (default when saveToFile exists), the engine reloads the page after a successful save.
298
+ * Set to false when save is to cloud (e.g. JsonPages Platform) so the user can see post-save feedback (e.g. deploy pipeline) instead of a reload.
299
+ */
300
+ reloadAfterSave?: boolean;
296
301
  /**
297
302
  * Optional. If provided, flushes in-memory /uploaded-assets/ blobs to disk and returns oldUrl -> newUrl map.
298
303
  * Omit when uploads write directly to disk (e.g. public/assets/images) and section data already stores final URLs.
@@ -3,7 +3,7 @@ import ke, { createContext as Mt, useContext as ct, useEffect as ge, forwardRef
3
3
  import { BrowserRouter as Rc, Routes as Nc, Route as Bt, useParams as Si, useNavigate as jc } from "react-router-dom";
4
4
  import * as Cn from "react-dom";
5
5
  import Tc, { unstable_batchedUpdates as Br, createPortal as _a } from "react-dom";
6
- import { z as Ue } from "zod";
6
+ import { z as Be } from "zod";
7
7
  const Te = {
8
8
  // Parent -> Child (Data Injection)
9
9
  UPDATE_DRAFTS: "jsonpages:update-drafts",
@@ -2191,15 +2191,15 @@ function Pc() {
2191
2191
  for (L.max_code = ee, J = R.heap_len >> 1; 1 <= J; J--) ce(R, q, J);
2192
2192
  for (I = Y; J = R.heap[1], R.heap[1] = R.heap[R.heap_len--], ce(R, q, 1), F = R.heap[1], R.heap[--R.heap_max] = J, R.heap[--R.heap_max] = F, q[2 * I] = q[2 * J] + q[2 * F], R.depth[I] = (R.depth[J] >= R.depth[F] ? R.depth[J] : R.depth[F]) + 1, q[2 * J + 1] = q[2 * F + 1] = I, R.heap[1] = I++, ce(R, q, 1), 2 <= R.heap_len; ) ;
2193
2193
  R.heap[--R.heap_max] = R.heap[1], (function(se, de) {
2194
- var Ce, _e, Be, Ee, bt, Tt, Ze = de.dyn_tree, Lr = de.max_code, Mr = de.stat_desc.static_tree, qn = de.stat_desc.has_stree, Jn = de.stat_desc.extra_bits, Fr = de.stat_desc.extra_base, Oe = de.stat_desc.max_length, De = 0;
2194
+ var _e, Ce, We, Ee, bt, Tt, Ze = de.dyn_tree, Lr = de.max_code, Mr = de.stat_desc.static_tree, qn = de.stat_desc.has_stree, Jn = de.stat_desc.extra_bits, Fr = de.stat_desc.extra_base, Oe = de.stat_desc.max_length, De = 0;
2195
2195
  for (Ee = 0; Ee <= v; Ee++) se.bl_count[Ee] = 0;
2196
- for (Ze[2 * se.heap[se.heap_max] + 1] = 0, Ce = se.heap_max + 1; Ce < f; Ce++) Oe < (Ee = Ze[2 * Ze[2 * (_e = se.heap[Ce]) + 1] + 1] + 1) && (Ee = Oe, De++), Ze[2 * _e + 1] = Ee, Lr < _e || (se.bl_count[Ee]++, bt = 0, Fr <= _e && (bt = Jn[_e - Fr]), Tt = Ze[2 * _e], se.opt_len += Tt * (Ee + bt), qn && (se.static_len += Tt * (Mr[2 * _e + 1] + bt)));
2196
+ for (Ze[2 * se.heap[se.heap_max] + 1] = 0, _e = se.heap_max + 1; _e < f; _e++) Oe < (Ee = Ze[2 * Ze[2 * (Ce = se.heap[_e]) + 1] + 1] + 1) && (Ee = Oe, De++), Ze[2 * Ce + 1] = Ee, Lr < Ce || (se.bl_count[Ee]++, bt = 0, Fr <= Ce && (bt = Jn[Ce - Fr]), Tt = Ze[2 * Ce], se.opt_len += Tt * (Ee + bt), qn && (se.static_len += Tt * (Mr[2 * Ce + 1] + bt)));
2197
2197
  if (De !== 0) {
2198
2198
  do {
2199
2199
  for (Ee = Oe - 1; se.bl_count[Ee] === 0; ) Ee--;
2200
2200
  se.bl_count[Ee]--, se.bl_count[Ee + 1] += 2, se.bl_count[Oe]--, De -= 2;
2201
2201
  } while (0 < De);
2202
- for (Ee = Oe; Ee !== 0; Ee--) for (_e = se.bl_count[Ee]; _e !== 0; ) Lr < (Be = se.heap[--Ce]) || (Ze[2 * Be + 1] !== Ee && (se.opt_len += (Ee - Ze[2 * Be + 1]) * Ze[2 * Be], Ze[2 * Be + 1] = Ee), _e--);
2202
+ for (Ee = Oe; Ee !== 0; Ee--) for (Ce = se.bl_count[Ee]; Ce !== 0; ) Lr < (We = se.heap[--_e]) || (Ze[2 * We + 1] !== Ee && (se.opt_len += (Ee - Ze[2 * We + 1]) * Ze[2 * We], Ze[2 * We + 1] = Ee), Ce--);
2203
2203
  }
2204
2204
  })(R, L), te(q, ee, R.bl_count);
2205
2205
  }
@@ -6405,21 +6405,21 @@ function or(e) {
6405
6405
  function Zo(e) {
6406
6406
  return "nodeType" in e;
6407
6407
  }
6408
- function We(e) {
6408
+ function Ue(e) {
6409
6409
  var t, r;
6410
6410
  return e ? or(e) ? e : Zo(e) && (t = (r = e.ownerDocument) == null ? void 0 : r.defaultView) != null ? t : window : window;
6411
6411
  }
6412
6412
  function Xo(e) {
6413
6413
  const {
6414
6414
  Document: t
6415
- } = We(e);
6415
+ } = Ue(e);
6416
6416
  return e instanceof t;
6417
6417
  }
6418
6418
  function Rr(e) {
6419
- return or(e) ? !1 : e instanceof We(e).HTMLElement;
6419
+ return or(e) ? !1 : e instanceof Ue(e).HTMLElement;
6420
6420
  }
6421
6421
  function Ya(e) {
6422
- return e instanceof We(e).SVGElement;
6422
+ return e instanceof Ue(e).SVGElement;
6423
6423
  }
6424
6424
  function ir(e) {
6425
6425
  return e ? or(e) ? e.document : Zo(e) ? Xo(e) ? e : Rr(e) || Ya(e) ? e.ownerDocument : document : document : document;
@@ -6511,7 +6511,7 @@ function jn(e) {
6511
6511
  return !1;
6512
6512
  const {
6513
6513
  KeyboardEvent: t
6514
- } = We(e.target);
6514
+ } = Ue(e.target);
6515
6515
  return t && e instanceof t;
6516
6516
  }
6517
6517
  function Uu(e) {
@@ -6519,7 +6519,7 @@ function Uu(e) {
6519
6519
  return !1;
6520
6520
  const {
6521
6521
  TouchEvent: t
6522
- } = We(e.target);
6522
+ } = Ue(e.target);
6523
6523
  return t && e instanceof t;
6524
6524
  }
6525
6525
  function fn(e) {
@@ -7027,7 +7027,7 @@ function ar(e, t) {
7027
7027
  const {
7028
7028
  transform: c,
7029
7029
  transformOrigin: d
7030
- } = We(e).getComputedStyle(e);
7030
+ } = Ue(e).getComputedStyle(e);
7031
7031
  c && (r = cf(r, c, d));
7032
7032
  }
7033
7033
  const {
@@ -7064,10 +7064,10 @@ function uf(e) {
7064
7064
  };
7065
7065
  }
7066
7066
  function ff(e, t) {
7067
- return t === void 0 && (t = We(e).getComputedStyle(e)), t.position === "fixed";
7067
+ return t === void 0 && (t = Ue(e).getComputedStyle(e)), t.position === "fixed";
7068
7068
  }
7069
7069
  function hf(e, t) {
7070
- t === void 0 && (t = We(e).getComputedStyle(e));
7070
+ t === void 0 && (t = Ue(e).getComputedStyle(e));
7071
7071
  const r = /(auto|scroll|overlay)/;
7072
7072
  return ["overflow", "overflowX", "overflowY"].some((o) => {
7073
7073
  const i = t[o];
@@ -7083,7 +7083,7 @@ function Tn(e, t) {
7083
7083
  return r.push(o.scrollingElement), r;
7084
7084
  if (!Rr(o) || Ya(o) || r.includes(o))
7085
7085
  return r;
7086
- const i = We(e).getComputedStyle(o);
7086
+ const i = Ue(e).getComputedStyle(o);
7087
7087
  return o !== e && hf(o, i) && r.push(o), ff(o, i) ? r : n(o.parentNode);
7088
7088
  }
7089
7089
  return e ? n(e) : r;
@@ -7261,7 +7261,7 @@ class wr {
7261
7261
  function xf(e) {
7262
7262
  const {
7263
7263
  EventTarget: t
7264
- } = We(e);
7264
+ } = Ue(e);
7265
7265
  return e instanceof t ? e : ir(e);
7266
7266
  }
7267
7267
  function so(e, t) {
@@ -7321,7 +7321,7 @@ class Jo {
7321
7321
  target: r
7322
7322
  }
7323
7323
  } = t;
7324
- this.props = t, this.listeners = new wr(ir(r)), this.windowListeners = new wr(We(r)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
7324
+ this.props = t, this.listeners = new wr(ir(r)), this.windowListeners = new wr(Ue(r)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
7325
7325
  }
7326
7326
  attach() {
7327
7327
  this.handleStart(), this.windowListeners.add(qe.Resize, this.handleCancel), this.windowListeners.add(qe.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(qe.Keydown, this.handleKeyDown));
@@ -7477,7 +7477,7 @@ class Qo {
7477
7477
  } = t, {
7478
7478
  target: a
7479
7479
  } = i;
7480
- this.props = t, this.events = r, this.document = ir(a), this.documentListeners = new wr(this.document), this.listeners = new wr(n), this.windowListeners = new wr(We(a)), this.initialCoordinates = (o = fn(i)) != null ? o : tt, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
7480
+ this.props = t, this.events = r, this.document = ir(a), this.documentListeners = new wr(this.document), this.listeners = new wr(n), this.windowListeners = new wr(Ue(a)), this.initialCoordinates = (o = fn(i)) != null ? o : tt, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
7481
7481
  }
7482
7482
  attach() {
7483
7483
  const {
@@ -8096,7 +8096,7 @@ function cs(e) {
8096
8096
  const Yi = [];
8097
8097
  function Bf(e, t) {
8098
8098
  t === void 0 && (t = ar);
8099
- const [r] = e, n = cs(r ? We(r) : null), [o, i] = me(Yi);
8099
+ const [r] = e, n = cs(r ? Ue(r) : null), [o, i] = me(Yi);
8100
8100
  function a() {
8101
8101
  i(() => e.length ? e.map((l) => ns(l) ? n : new qo(t(l), l)) : Yi);
8102
8102
  }
@@ -8510,7 +8510,7 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8510
8510
  scrollAdjustedTranslate: null
8511
8511
  }), we = M.getNodeFor((r = pe.current.over) == null ? void 0 : r.id), x = Uf({
8512
8512
  measure: P.dragOverlay.measure
8513
- }), X = (n = x.nodeRef.current) != null ? n : he, H = j ? (o = x.rect) != null ? o : ie : null, O = !!(x.nodeRef.current && x.rect), R = If(O ? null : ie), L = cs(X ? We(X) : null), J = Df(j ? we ?? he : null), F = Bf(J), I = hs(u, {
8513
+ }), X = (n = x.nodeRef.current) != null ? n : he, H = j ? (o = x.rect) != null ? o : ie : null, O = !!(x.nodeRef.current && x.rect), R = If(O ? null : ie), L = cs(X ? Ue(X) : null), J = Df(j ? we ?? he : null), F = Bf(J), I = hs(u, {
8514
8514
  transform: {
8515
8515
  x: T.x - R.x,
8516
8516
  y: T.y - R.y,
@@ -8533,7 +8533,7 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8533
8533
  droppableRects: G,
8534
8534
  droppableContainers: N,
8535
8535
  pointerCoordinates: q
8536
- }) : null, Ce = qa(de, "id"), [_e, Be] = me(null), Ee = O ? I : Kt(I, Y), bt = af(Ee, (i = _e == null ? void 0 : _e.rect) != null ? i : null, ie), Tt = Se(null), Ze = ze(
8536
+ }) : null, _e = qa(de, "id"), [Ce, We] = me(null), Ee = O ? I : Kt(I, Y), bt = af(Ee, (i = Ce == null ? void 0 : Ce.rect) != null ? i : null, ie), Tt = Se(null), Ze = ze(
8537
8537
  (Oe, De) => {
8538
8538
  let {
8539
8539
  sensor: He,
@@ -8643,7 +8643,7 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8643
8643
  w.current = null, Br(() => {
8644
8644
  g({
8645
8645
  type: Me
8646
- }), C(_t.Uninitialized), Be(null), K(null), W(null), Tt.current = null;
8646
+ }), C(_t.Uninitialized), We(null), K(null), W(null), Tt.current = null;
8647
8647
  const pr = Me === Ie.DragEnd ? "onDragEnd" : "onDragCancel";
8648
8648
  if (yt) {
8649
8649
  const Qn = $.current[pr];
@@ -8720,7 +8720,7 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8720
8720
  return;
8721
8721
  const {
8722
8722
  onDragOver: Ve
8723
- } = $.current, ot = wt.get(Ce), Ft = ot && ot.rect.current ? {
8723
+ } = $.current, ot = wt.get(_e), Ft = ot && ot.rect.current ? {
8724
8724
  id: ot.id,
8725
8725
  rect: ot.rect.current,
8726
8726
  data: ot.data,
@@ -8736,14 +8736,14 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8736
8736
  over: Ft
8737
8737
  };
8738
8738
  Br(() => {
8739
- Be(Ft), Ve == null || Ve(Me), y({
8739
+ We(Ft), Ve == null || Ve(Me), y({
8740
8740
  type: "onDragOver",
8741
8741
  event: Me
8742
8742
  });
8743
8743
  });
8744
8744
  },
8745
8745
  // eslint-disable-next-line react-hooks/exhaustive-deps
8746
- [Ce]
8746
+ [_e]
8747
8747
  ), et(() => {
8748
8748
  pe.current = {
8749
8749
  activatorEvent: B,
@@ -8756,14 +8756,14 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8756
8756
  draggingNode: X,
8757
8757
  draggingNodeRect: H,
8758
8758
  droppableContainers: M,
8759
- over: _e,
8759
+ over: Ce,
8760
8760
  scrollableAncestors: J,
8761
8761
  scrollAdjustedTranslate: ee
8762
8762
  }, z.current = {
8763
8763
  initial: H,
8764
8764
  translated: se
8765
8765
  };
8766
- }, [D, he, de, se, A, X, H, G, M, _e, J, ee]), Ef({
8766
+ }, [D, he, de, se, A, X, H, G, M, Ce, J, ee]), Ef({
8767
8767
  ...ae,
8768
8768
  delta: T,
8769
8769
  draggingRect: se,
@@ -8782,14 +8782,14 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8782
8782
  draggableNodes: A,
8783
8783
  droppableContainers: M,
8784
8784
  droppableRects: G,
8785
- over: _e,
8785
+ over: Ce,
8786
8786
  measureDroppableContainers: Z,
8787
8787
  scrollableAncestors: J,
8788
8788
  scrollableAncestorRects: F,
8789
8789
  measuringConfiguration: P,
8790
8790
  measuringScheduled: re,
8791
8791
  windowRect: L
8792
- }), [D, he, ie, B, de, ce, x, A, M, G, _e, Z, J, F, P, re, L]), Jn = Re(() => ({
8792
+ }), [D, he, ie, B, de, ce, x, A, M, G, Ce, Z, J, F, P, re, L]), Jn = Re(() => ({
8793
8793
  activatorEvent: B,
8794
8794
  activators: Mr,
8795
8795
  active: D,
@@ -8799,9 +8799,9 @@ const Xf = /* @__PURE__ */ Cc(function(t) {
8799
8799
  },
8800
8800
  dispatch: g,
8801
8801
  draggableNodes: A,
8802
- over: _e,
8802
+ over: Ce,
8803
8803
  measureDroppableContainers: Z
8804
- }), [B, Mr, D, ie, g, Q, A, _e, Z]);
8804
+ }), [B, Mr, D, ie, g, Q, A, Ce, Z]);
8805
8805
  return ke.createElement(Ga.Provider, {
8806
8806
  value: k
8807
8807
  }, ke.createElement(Tr.Provider, {
@@ -9102,7 +9102,7 @@ function fh(e) {
9102
9102
  return;
9103
9103
  const {
9104
9104
  transform: d
9105
- } = We(a).getComputedStyle(a), h = Qa(d);
9105
+ } = Ue(a).getComputedStyle(a), h = Qa(d);
9106
9106
  if (!h)
9107
9107
  return;
9108
9108
  const m = typeof t == "function" ? t : hh(t);
@@ -13967,9 +13967,9 @@ const l0 = ({
13967
13967
  ] });
13968
13968
  }
13969
13969
  }, Do = (e) => {
13970
- if (e instanceof Ue.ZodOptional || e instanceof Ue.ZodDefault)
13970
+ if (e instanceof Be.ZodOptional || e instanceof Be.ZodDefault)
13971
13971
  return Do(e._def.innerType);
13972
- if (e instanceof Ue.ZodObject) {
13972
+ if (e instanceof Be.ZodObject) {
13973
13973
  const t = {
13974
13974
  id: crypto.randomUUID()
13975
13975
  };
@@ -13977,8 +13977,8 @@ const l0 = ({
13977
13977
  r !== "id" && (t[r] = Do(e.shape[r]));
13978
13978
  return t;
13979
13979
  }
13980
- return e instanceof Ue.ZodArray ? [] : e instanceof Ue.ZodString ? "" : e instanceof Ue.ZodNumber ? 0 : e instanceof Ue.ZodBoolean ? !1 : e instanceof Ue.ZodEnum ? e._def.values[0] : null;
13981
- }, Lo = (e) => e instanceof Ue.ZodOptional || e instanceof Ue.ZodDefault ? Lo(e._def.innerType) : e, en = (e, t) => e && !t ? "opacity-10" : "opacity-100", Vt = (e, t) => e != null && t.toLowerCase() === e.toLowerCase(), u0 = (e, t) => {
13980
+ return e instanceof Be.ZodArray ? [] : e instanceof Be.ZodString ? "" : e instanceof Be.ZodNumber ? 0 : e instanceof Be.ZodBoolean ? !1 : e instanceof Be.ZodEnum ? e._def.values[0] : null;
13981
+ }, Lo = (e) => e instanceof Be.ZodOptional || e instanceof Be.ZodDefault ? Lo(e._def.innerType) : e, en = (e, t) => e && !t ? "opacity-10" : "opacity-100", Vt = (e, t) => e != null && t.toLowerCase() === e.toLowerCase(), u0 = (e, t) => {
13982
13982
  if (!e) return;
13983
13983
  const r = t.toLowerCase(), n = Object.entries(e).find(([o]) => o.toLowerCase() === r);
13984
13984
  return n == null ? void 0 : n[1];
@@ -13988,7 +13988,7 @@ const l0 = ({
13988
13988
  const f = l[b];
13989
13989
  if (!f) return null;
13990
13990
  const v = Lo(f), g = f.description || "ui:text", y = t[b];
13991
- if (g === "ui:image-picker" && v instanceof Ue.ZodObject) {
13991
+ if (g === "ui:image-picker" && v instanceof Be.ZodObject) {
13992
13992
  const j = Vt(m, b), E = Qr["ui:image-picker"] || Qr["ui:text"];
13993
13993
  return /* @__PURE__ */ p.jsx(
13994
13994
  "div",
@@ -14007,7 +14007,7 @@ const l0 = ({
14007
14007
  b
14008
14008
  );
14009
14009
  }
14010
- if (v instanceof Ue.ZodObject) {
14010
+ if (v instanceof Be.ZodObject) {
14011
14011
  const j = y || {}, E = Vt(m, b);
14012
14012
  return /* @__PURE__ */ p.jsxs(
14013
14013
  "div",
@@ -14035,7 +14035,7 @@ const l0 = ({
14035
14035
  b
14036
14036
  );
14037
14037
  }
14038
- if (v instanceof Ue.ZodArray) {
14038
+ if (v instanceof Be.ZodArray) {
14039
14039
  const j = Array.isArray(y) ? y : [], E = Lo(v.element), A = (z, D) => {
14040
14040
  if (D < 0 || D >= j.length) return;
14041
14041
  const w = [...j], [U] = w.splice(z, 1);
@@ -14089,7 +14089,7 @@ const l0 = ({
14089
14089
  },
14090
14090
  onMoveUp: () => A(D, D - 1),
14091
14091
  onMoveDown: () => A(D, D + 1),
14092
- children: E instanceof Ue.ZodObject ? /* @__PURE__ */ p.jsx(
14092
+ children: E instanceof Be.ZodObject ? /* @__PURE__ */ p.jsx(
14093
14093
  kn,
14094
14094
  {
14095
14095
  schema: E,
@@ -14110,7 +14110,7 @@ const l0 = ({
14110
14110
  b
14111
14111
  );
14112
14112
  }
14113
- const k = Qr[g] || Qr["ui:text"], S = v instanceof Ue.ZodEnum ? v._def.values : void 0, C = Vt(m, b);
14113
+ const k = Qr[g] || Qr["ui:text"], S = v instanceof Be.ZodEnum ? v._def.values : void 0, C = Vt(m, b);
14114
14114
  return /* @__PURE__ */ p.jsx(
14115
14115
  "div",
14116
14116
  {
@@ -15938,8 +15938,8 @@ const vv = ({
15938
15938
  schema: ne,
15939
15939
  data: se,
15940
15940
  onChange: (de) => {
15941
- const Ce = { ...F.data, ...de };
15942
- o(U, q, oe, Ce);
15941
+ const _e = { ...F.data, ...de };
15942
+ o(U, q, oe, _e);
15943
15943
  },
15944
15944
  keys: ee
15945
15945
  }
@@ -16341,13 +16341,13 @@ function Rv({ config: e }) {
16341
16341
  Y.preventDefault();
16342
16342
  const ee = Y.currentTarget;
16343
16343
  ee.setPointerCapture(Y.pointerId);
16344
- const se = Y.clientX, de = he, Ce = (Be) => {
16345
- const Ee = se - Be.clientX, bt = Math.min(le, Math.max(ae, de + Ee));
16344
+ const se = Y.clientX, de = he, _e = (We) => {
16345
+ const Ee = se - We.clientX, bt = Math.min(le, Math.max(ae, de + Ee));
16346
16346
  te(bt);
16347
- }, _e = () => {
16348
- ee.releasePointerCapture(Y.pointerId), ee.removeEventListener("pointermove", Ce), ee.removeEventListener("pointerup", _e), ee.removeEventListener("pointercancel", _e), document.body.style.cursor = "", document.body.style.userSelect = "";
16347
+ }, Ce = () => {
16348
+ ee.releasePointerCapture(Y.pointerId), ee.removeEventListener("pointermove", _e), ee.removeEventListener("pointerup", Ce), ee.removeEventListener("pointercancel", Ce), document.body.style.cursor = "", document.body.style.userSelect = "";
16349
16349
  };
16350
- document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", ee.addEventListener("pointermove", Ce), ee.addEventListener("pointerup", _e), ee.addEventListener("pointercancel", _e);
16350
+ document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", ee.addEventListener("pointermove", _e), ee.addEventListener("pointerup", Ce), ee.addEventListener("pointercancel", Ce);
16351
16351
  }, [he]), ce = A ? [
16352
16352
  ...w.header ? [{ id: w.header.id, type: w.header.type, scope: "global", title: "Header" }] : [],
16353
16353
  ...A.sections.map((Y) => {
@@ -16370,10 +16370,10 @@ function Rv({ config: e }) {
16370
16370
  Y && T(JSON.parse(JSON.stringify(Y))), B(null), $(null), V(!1);
16371
16371
  }, [C, n]), we = ze(
16372
16372
  (Y, ee, se) => {
16373
- const de = [...se.sections], Ce = de.findIndex((Ee) => Ee.id === Y);
16374
- if (Ce === -1 || ee < 0 || ee >= de.length) return;
16375
- const [_e] = de.splice(Ce, 1), Be = ee > Ce ? ee - 1 : ee;
16376
- de.splice(Math.min(Be, de.length), 0, _e), T({ ...se, sections: de }), V(!0);
16373
+ const de = [...se.sections], _e = de.findIndex((Ee) => Ee.id === Y);
16374
+ if (_e === -1 || ee < 0 || ee >= de.length) return;
16375
+ const [Ce] = de.splice(_e, 1), We = ee > _e ? ee - 1 : ee;
16376
+ de.splice(Math.min(We, de.length), 0, Ce), T({ ...se, sections: de }), V(!0);
16377
16377
  },
16378
16378
  []
16379
16379
  ), x = ze(
@@ -16389,9 +16389,9 @@ function Rv({ config: e }) {
16389
16389
  ...de.itemId != null ? { itemId: String(de.itemId) } : {}
16390
16390
  })));
16391
16391
  else {
16392
- const de = Y.data.itemField, Ce = Y.data.itemId;
16392
+ const de = Y.data.itemField, _e = Y.data.itemId;
16393
16393
  $(typeof de == "string" ? [
16394
- { fieldKey: de, ...Ce != null ? { itemId: String(Ce) } : {} }
16394
+ { fieldKey: de, ..._e != null ? { itemId: String(_e) } : {} }
16395
16395
  ] : null);
16396
16396
  }
16397
16397
  }
@@ -16436,14 +16436,14 @@ function Rv({ config: e }) {
16436
16436
  }
16437
16437
  }, L = ze(
16438
16438
  (Y, ee, se, de) => {
16439
- var Ce, _e;
16439
+ var _e, Ce;
16440
16440
  if (V(!0), ee === "global")
16441
- ((Ce = w.header) == null ? void 0 : Ce.id) === Y ? U({ ...w, header: { ...w.header, data: de } }) : ((_e = w.footer) == null ? void 0 : _e.id) === Y && U({ ...w, footer: { ...w.footer, data: de } });
16441
+ ((_e = w.header) == null ? void 0 : _e.id) === Y ? U({ ...w, header: { ...w.header, data: de } }) : ((Ce = w.footer) == null ? void 0 : Ce.id) === Y && U({ ...w, footer: { ...w.footer, data: de } });
16442
16442
  else if (A) {
16443
- const Be = A.sections.map(
16443
+ const We = A.sections.map(
16444
16444
  (Ee) => Ee.id === Y ? { ...Ee, data: de } : Ee
16445
16445
  );
16446
- T({ ...A, sections: Be });
16446
+ T({ ...A, sections: We });
16447
16447
  }
16448
16448
  },
16449
16449
  [A, w]
@@ -16460,14 +16460,13 @@ function Rv({ config: e }) {
16460
16460
  menu: { main: (Y == null ? void 0 : Y.links) ?? [] },
16461
16461
  theme: i
16462
16462
  };
16463
- e.persistence.saveToFile(ee, C).then((Ce) => {
16464
- V(!1), D(!0);
16465
- const _e = e.mode;
16466
- ((Ce == null ? void 0 : Ce.shouldReload) ?? _e !== "cloud") && window.setTimeout(() => window.location.reload(), 1e3);
16467
- }).catch((Ce) => {
16468
- console.error("[JsonPages] saveToFile failed", Ce);
16469
- const _e = Ce instanceof Error ? Ce.message : String(Ce);
16470
- alert(`Save to file failed: ${_e}`);
16463
+ e.persistence.saveToFile(ee, C).then(() => {
16464
+ var _e;
16465
+ V(!1), D(!0), ((_e = e.persistence) == null ? void 0 : _e.reloadAfterSave) !== !1 && window.setTimeout(() => window.location.reload(), 1e3);
16466
+ }).catch((_e) => {
16467
+ console.error("[JsonPages] saveToFile failed", _e);
16468
+ const Ce = _e instanceof Error ? _e.message : String(_e);
16469
+ alert(`Save to file failed: ${Ce}`);
16471
16470
  });
16472
16471
  }, I = (Y) => {
16473
16472
  var de;