@chaibuilder/sdk 2.5.6 → 2.5.8

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/core.d.ts CHANGED
@@ -639,6 +639,8 @@ export declare const useInlineEditing: () => {
639
639
  setEditingItemIndex: (args_0: number | ((prev: number) => number)) => void;
640
640
  };
641
641
 
642
+ export declare const useIsPageLoaded: () => [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
643
+
642
644
  export declare const useLanguages: () => {
643
645
  languages: any[];
644
646
  fallbackLang: string;
package/dist/core.js CHANGED
@@ -736,7 +736,7 @@ const useLanguages = () => {
736
736
  selectedLang: n,
737
737
  setSelectedLang: l
738
738
  };
739
- }, builderSaveStateAtom = atom("SAVED");
739
+ }, isPageLoadedAtom = atom(!1), useIsPageLoaded = () => useAtom$1(isPageLoadedAtom), builderSaveStateAtom = atom("SAVED");
740
740
  builderSaveStateAtom.debugLabel = "builderSaveStateAtom";
741
741
  const checkMissingTranslations = (o, r) => r ? o.some((n) => {
742
742
  if (!(n != null && n._type) || n._type === "PartialBlock")
@@ -751,43 +751,43 @@ const checkMissingTranslations = (o, r) => r ? o.some((n) => {
751
751
  return console.warn(`Failed to get block definition for type: ${n._type}`, a), !1;
752
752
  }
753
753
  }) : !1, useSavePage = () => {
754
- const [o, r] = useAtom$1(builderSaveStateAtom), n = useBuilderProp("onSave", async (m) => {
755
- }), a = useBuilderProp("onSaveStateChange", noop), l = useGetPageData(), [i] = useTheme(), { hasPermission: c } = usePermissions(), { selectedLang: d, fallbackLang: p } = useLanguages(), u = () => {
756
- const m = l();
757
- return !d || d === p ? !1 : checkMissingTranslations(m.blocks || [], d);
754
+ const [o, r] = useAtom$1(builderSaveStateAtom), n = useBuilderProp("onSave", async (f) => {
755
+ }), a = useBuilderProp("onSaveStateChange", noop), l = useGetPageData(), [i] = useTheme(), { hasPermission: c } = usePermissions(), { selectedLang: d, fallbackLang: p } = useLanguages(), [u] = useIsPageLoaded(), g = () => {
756
+ const f = l();
757
+ return !d || d === p ? !1 : checkMissingTranslations(f.blocks || [], d);
758
758
  };
759
759
  return { savePage: useThrottledCallback(
760
- async (m = !1) => {
761
- if (!c("save_page"))
760
+ async (f = !1) => {
761
+ if (!c("save_page") || !u)
762
762
  return;
763
763
  r("SAVING"), a("SAVING");
764
- const f = l();
764
+ const x = l();
765
765
  return await n({
766
- autoSave: m,
767
- blocks: f.blocks,
766
+ autoSave: f,
767
+ blocks: x.blocks,
768
768
  theme: i,
769
- needTranslations: u()
769
+ needTranslations: g()
770
770
  }), setTimeout(() => {
771
771
  r("SAVED"), a("SAVED");
772
772
  }, 100), !0;
773
773
  },
774
- [l, r, i, n, a],
774
+ [l, r, i, n, a, u],
775
775
  3e3
776
776
  // save only every 5 seconds
777
777
  ), savePageAsync: async () => {
778
- if (!c("save_page"))
778
+ if (!c("save_page") || !u)
779
779
  return;
780
780
  r("SAVING"), a("SAVING");
781
- const m = l();
781
+ const f = l();
782
782
  return await n({
783
783
  autoSave: !0,
784
- blocks: m.blocks,
784
+ blocks: f.blocks,
785
785
  theme: i,
786
- needTranslations: u()
786
+ needTranslations: g()
787
787
  }), setTimeout(() => {
788
788
  r("SAVED"), a("SAVED");
789
789
  }, 100), !0;
790
- }, saveState: o, setSaveState: r, needTranslations: u };
790
+ }, saveState: o, setSaveState: r, needTranslations: g };
791
791
  }, undoManager = new UndoManager();
792
792
  undoManager.setLimit(50);
793
793
  const undoRedoStateAtom = atom({
@@ -5492,8 +5492,8 @@ const BlockStylingProps = () => {
5492
5492
  const C = parseInt$1(S.target.value);
5493
5493
  let j = isNaN$1(C) ? 0 : C;
5494
5494
  S.keyCode === 38 && (j += 1), S.keyCode === 40 && (j -= 1);
5495
- const I = `${j}`, R = `${I.startsWith("-") ? "-" : ""}${d}[${I.replace("-", "")}${h === "-" ? "" : h}]`;
5496
- k(R);
5495
+ const I = `${j}`, P = `${I.startsWith("-") ? "-" : ""}${d}[${I.replace("-", "")}${h === "-" ? "" : h}]`;
5496
+ k(P);
5497
5497
  },
5498
5498
  onKeyUp: (S) => {
5499
5499
  _ && (S.preventDefault(), N(!1));
@@ -6468,16 +6468,16 @@ function ManualClasses() {
6468
6468
  const T = f.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
6469
6469
  u(h, T, !0), x("");
6470
6470
  }, [_, N] = useState([]), w = ({ value: T }) => {
6471
- const R = T.trim().toLowerCase(), L = R.match(/.+:/g);
6471
+ const P = T.trim().toLowerCase(), L = P.match(/.+:/g);
6472
6472
  let D = [];
6473
6473
  if (L && L.length > 0) {
6474
- const [P] = L, M = R.replace(P, "");
6474
+ const [R] = L, M = P.replace(R, "");
6475
6475
  D = i.search(M).map((O) => ({
6476
6476
  ...O,
6477
- item: { ...O.item, name: P + O.item.name }
6477
+ item: { ...O.item, name: R + O.item.name }
6478
6478
  }));
6479
6479
  } else
6480
- D = i.search(R);
6480
+ D = i.search(P);
6481
6481
  return N(map(D, "item"));
6482
6482
  }, k = () => {
6483
6483
  N([]);
@@ -6498,14 +6498,14 @@ function ManualClasses() {
6498
6498
  onKeyDown: (T) => {
6499
6499
  T.key === "Enter" && f.trim() !== "" && E();
6500
6500
  },
6501
- onChange: (T, { newValue: R }) => x(R),
6501
+ onChange: (T, { newValue: P }) => x(P),
6502
6502
  className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
6503
6503
  }),
6504
6504
  [f, c, o]
6505
6505
  ), C = (T) => {
6506
6506
  debugger;
6507
- const R = r.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
6508
- g(h, [T]), u(h, R, !0), n(""), l(-1);
6507
+ const P = r.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
6508
+ g(h, [T]), u(h, P, !0), n(""), l(-1);
6509
6509
  }, j = () => {
6510
6510
  if (navigator.clipboard === void 0) {
6511
6511
  toast.error(c("Clipboard not supported"));
@@ -6563,7 +6563,7 @@ function ManualClasses() {
6563
6563
  )
6564
6564
  ] }),
6565
6565
  /* @__PURE__ */ jsx("div", { className: "flex w-full flex-wrap gap-2 overflow-x-hidden", children: A.map(
6566
- (T, R) => a === R ? /* @__PURE__ */ jsx(
6566
+ (T, P) => a === P ? /* @__PURE__ */ jsx(
6567
6567
  "input",
6568
6568
  {
6569
6569
  ref: o,
@@ -7940,7 +7940,7 @@ const Input = ({ node: o }) => {
7940
7940
  var r;
7941
7941
  return o != null && o._name ? o._name : (o == null ? void 0 : o._type) === "Box" && (o != null && o.tag) && (o == null ? void 0 : o.tag) !== "div" ? startCase(o.tag) : ((r = o == null ? void 0 : o._type) == null ? void 0 : r.split("/").pop()) || "";
7942
7942
  }, Node = memo(({ node: o, style: r, dragHandle: n }) => {
7943
- var R;
7943
+ var P;
7944
7944
  const { t: a } = useTranslation(), [l, , i] = useHiddenBlockIds(), [c] = useAtom$1(canvasIframeAtom), { hasPermission: d } = usePermissions();
7945
7945
  let p = null;
7946
7946
  const u = o.children.length > 0, { highlightBlock: g, clearHighlight: h } = useBlockHighlight(), { id: m, data: f, isSelected: x, willReceiveDrop: y, isDragging: b, isEditing: A, handleClick: E } = o, _ = (L) => {
@@ -7964,10 +7964,10 @@ const Input = ({ node: o }) => {
7964
7964
  return () => clearTimeout(L);
7965
7965
  }, [y, o, b]);
7966
7966
  const j = (L, D) => {
7967
- const P = c.contentDocument || c.contentWindow.document, M = P.querySelector(`[data-block-id=${L}]`);
7967
+ const R = c.contentDocument || c.contentWindow.document, M = R.querySelector(`[data-block-id=${L}]`);
7968
7968
  M && M.setAttribute("data-drop", D);
7969
7969
  const $ = M.getBoundingClientRect(), O = c.getBoundingClientRect();
7970
- $.top >= O.top && $.left >= O.left && $.bottom <= O.bottom && $.right <= O.right || (P.documentElement.scrollTop = M.offsetTop - O.top);
7970
+ $.top >= O.top && $.left >= O.left && $.bottom <= O.bottom && $.right <= O.right || (R.documentElement.scrollTop = M.offsetTop - O.top);
7971
7971
  }, I = (L) => {
7972
7972
  S();
7973
7973
  const D = get(o, "parent.id");
@@ -8013,7 +8013,7 @@ const Input = ({ node: o }) => {
8013
8013
  L.preventDefault(), j(m, "no");
8014
8014
  },
8015
8015
  children: [
8016
- d(PERMISSIONS.ADD_BLOCK) && (o == null ? void 0 : o.rowIndex) > 0 && (o.parent.isOpen && canAddChildBlock(get(o, "parent.data._type")) || ((R = o == null ? void 0 : o.parent) == null ? void 0 : R.id) === "__REACT_ARBORIST_INTERNAL_ROOT__") && /* @__PURE__ */ jsx("div", { className: "group relative ml-5 h-full w-full cursor-pointer", children: /* @__PURE__ */ jsx(
8016
+ d(PERMISSIONS.ADD_BLOCK) && (o == null ? void 0 : o.rowIndex) > 0 && (o.parent.isOpen && canAddChildBlock(get(o, "parent.data._type")) || ((P = o == null ? void 0 : o.parent) == null ? void 0 : P.id) === "__REACT_ARBORIST_INTERNAL_ROOT__") && /* @__PURE__ */ jsx("div", { className: "group relative ml-5 h-full w-full cursor-pointer", children: /* @__PURE__ */ jsx(
8017
8017
  "div",
8018
8018
  {
8019
8019
  onClick: (L) => {
@@ -8359,9 +8359,36 @@ const Input = ({ node: o }) => {
8359
8359
  /* @__PURE__ */ jsx(SelectContent, { children: a.map((l) => /* @__PURE__ */ jsx(SelectItem, { value: l.family, children: l.family }, l.family)) })
8360
8360
  ] })
8361
8361
  ] });
8362
+ }, defaultShadcnPreset = {
8363
+ fontFamily: {
8364
+ heading: "Inter",
8365
+ body: "Inter"
8366
+ },
8367
+ borderRadius: "6px",
8368
+ colors: {
8369
+ background: ["#ffffff", "#0a0a0a"],
8370
+ foreground: ["#0a0a0a", "#fafafa"],
8371
+ primary: ["#171717", "#e5e5e5"],
8372
+ "primary-foreground": ["#fafafa", "#171717"],
8373
+ secondary: ["#f5f5f5", "#262626"],
8374
+ "secondary-foreground": ["#171717", "#fafafa"],
8375
+ muted: ["#f5f5f5", "#262626"],
8376
+ "muted-foreground": ["#737373", "#a1a1a1"],
8377
+ accent: ["#f5f5f5", "#404040"],
8378
+ "accent-foreground": ["#171717", "#fafafa"],
8379
+ destructive: ["#e7000b", "#ff6467"],
8380
+ "destructive-foreground": ["#ffffff", "#fafafa"],
8381
+ border: ["#e5e5e5", "#282828"],
8382
+ input: ["#e5e5e5", "#343434"],
8383
+ ring: ["#a1a1a1", "#737373"],
8384
+ card: ["#ffffff", "#171717"],
8385
+ "card-foreground": ["#0a0a0a", "#fafafa"],
8386
+ popover: ["#ffffff", "#262626"],
8387
+ "popover-foreground": ["#0a0a0a", "#fafafa"]
8388
+ }
8362
8389
  }, LazyCssImportModal = lazy(
8363
8390
  () => import("./css-import-modal-CcUf6F6T.js").then((o) => ({ default: o.CssImportModal }))
8364
- ), PREV_THEME_KEY = "chai-builder-previous-theme", setPreviousTheme = (o) => {
8391
+ ), PREV_THEME_KEY = "chai-builder-previous-theme", DEFAULT_THEME_PRESET = [{ shadcn_default: defaultShadcnPreset }], setPreviousTheme = (o) => {
8365
8392
  if (!(typeof window > "u"))
8366
8393
  try {
8367
8394
  localStorage.setItem(PREV_THEME_KEY, JSON.stringify(o));
@@ -8376,7 +8403,9 @@ const Input = ({ node: o }) => {
8376
8403
  console.warn("Failed to clear previous theme from localStorage:", o);
8377
8404
  }
8378
8405
  }, ThemeConfigPanel = React.memo(({ className: o = "" }) => {
8379
- const [r, n] = useDarkMode(), [a, l] = React.useState(""), [i, c] = React.useState(!1), d = useBuilderProp("themePresets", []), p = useBuilderProp("themePanelComponent", null), { hasPermission: u } = usePermissions(), [g, h] = useTheme(), m = useThemeOptions(), { t: f } = useTranslation(), x = React.useCallback(
8406
+ const [r, n] = useDarkMode(), [a, l] = React.useState(""), [i, c] = React.useState(!1), d = useBuilderProp("themePresets", []), p = useBuilderProp("themePanelComponent", null), { hasPermission: u } = usePermissions();
8407
+ d && !d.some((w) => Object.keys(w)[0] === "shadcn_default") && d.push(...DEFAULT_THEME_PRESET);
8408
+ const [g, h] = useTheme(), m = useThemeOptions(), { t: f } = useTranslation(), x = React.useCallback(
8380
8409
  (w) => {
8381
8410
  const k = { ...g };
8382
8411
  setPreviousTheme(k), h(w), toast.success("Theme updated", {
@@ -9492,22 +9521,22 @@ const AiAssistant = () => {
9492
9521
  k.key === "Enter" && !k.shiftKey && (k.preventDefault(), u !== null ? _() : b());
9493
9522
  }, w = useCallback((k) => {
9494
9523
  const v = (C) => /[.,!?;:]/.test(C), B = (C, j, I) => {
9495
- let T = "", R = "";
9524
+ let T = "", P = "";
9496
9525
  const L = j > 0 ? C[j - 1] : "", D = j < C.length ? C[j] : "";
9497
- return j > 0 && (L === "." || !v(L) && L !== " ") && (T = " "), j < C.length && !v(D) && D !== " " && (R = " "), {
9498
- text: T + I + R,
9526
+ return j > 0 && (L === "." || !v(L) && L !== " ") && (T = " "), j < C.length && !v(D) && D !== " " && (P = " "), {
9527
+ text: T + I + P,
9499
9528
  prefixLength: T.length,
9500
- suffixLength: R.length
9529
+ suffixLength: P.length
9501
9530
  };
9502
9531
  }, S = x.current;
9503
9532
  if (S) {
9504
9533
  const C = S.selectionStart || 0, j = S.value || "", I = S.selectionEnd || C;
9505
9534
  if (I > C) {
9506
- const P = `{{${k}}}`, { text: M } = B(j, C, P), $ = j.slice(0, C) + M + j.slice(I);
9535
+ const R = `{{${k}}}`, { text: M } = B(j, C, R), $ = j.slice(0, C) + M + j.slice(I);
9507
9536
  p($);
9508
9537
  return;
9509
9538
  }
9510
- const R = `{{${k}}}`, { text: L } = B(j, C, R), D = j.slice(0, C) + L + j.slice(C);
9539
+ const P = `{{${k}}}`, { text: L } = B(j, C, P), D = j.slice(0, C) + L + j.slice(C);
9511
9540
  p(D);
9512
9541
  }
9513
9542
  }, []);
@@ -10186,22 +10215,22 @@ const RootLayout = () => {
10186
10215
  }
10187
10216
  for (let j = v.length - 1; j >= 0; --j) {
10188
10217
  const [I, T] = v[j];
10189
- let R = !1;
10218
+ let P = !1;
10190
10219
  for (const L of T.d.keys())
10191
10220
  if (L !== I && a.has(L)) {
10192
- R = !0;
10221
+ P = !0;
10193
10222
  break;
10194
10223
  }
10195
- R && (y(I), E(I)), n.delete(I);
10224
+ P && (y(I), E(I)), n.delete(I);
10196
10225
  }
10197
10226
  }), y = h[3] || ((v) => {
10198
10227
  var B;
10199
10228
  const S = m(v);
10200
10229
  if (isAtomStateInitialized(S) && (r.has(v) && n.get(v) !== S.n || Array.from(S.d).every(
10201
- ([P, M]) => (
10230
+ ([R, M]) => (
10202
10231
  // Recursively, read the atom state of the dependency, and
10203
10232
  // check if the atom epoch number is unchanged
10204
- y(P).n === M
10233
+ y(R).n === M
10205
10234
  )
10206
10235
  )))
10207
10236
  return S;
@@ -10209,48 +10238,48 @@ const RootLayout = () => {
10209
10238
  let C = !0;
10210
10239
  const j = () => {
10211
10240
  r.has(v) && (E(v), x(), f());
10212
- }, I = (P) => {
10241
+ }, I = (R) => {
10213
10242
  var M;
10214
- if (isSelfAtom(v, P)) {
10215
- const O = m(P);
10243
+ if (isSelfAtom(v, R)) {
10244
+ const O = m(R);
10216
10245
  if (!isAtomStateInitialized(O))
10217
- if (hasInitialValue(P))
10218
- setAtomStateValueOrPromise(P, P.init, m);
10246
+ if (hasInitialValue(R))
10247
+ setAtomStateValueOrPromise(R, R.init, m);
10219
10248
  else
10220
10249
  throw new Error("no atom init");
10221
10250
  return returnAtomValue(O);
10222
10251
  }
10223
- const $ = y(P);
10252
+ const $ = y(R);
10224
10253
  try {
10225
10254
  return returnAtomValue($);
10226
10255
  } finally {
10227
- S.d.set(P, $.n), isPendingPromise(S.v) && addPendingPromiseToDependency(v, S.v, $), (M = r.get(P)) == null || M.t.add(v), C || j();
10256
+ S.d.set(R, $.n), isPendingPromise(S.v) && addPendingPromiseToDependency(v, S.v, $), (M = r.get(R)) == null || M.t.add(v), C || j();
10228
10257
  }
10229
10258
  };
10230
- let T, R;
10259
+ let T, P;
10231
10260
  const L = {
10232
10261
  get signal() {
10233
10262
  return T || (T = new AbortController()), T.signal;
10234
10263
  },
10235
10264
  get setSelf() {
10236
- return !R && isActuallyWritableAtom(v) && (R = (...P) => {
10265
+ return !P && isActuallyWritableAtom(v) && (P = (...R) => {
10237
10266
  if (!C)
10238
10267
  try {
10239
- return A(v, ...P);
10268
+ return A(v, ...R);
10240
10269
  } finally {
10241
10270
  x(), f();
10242
10271
  }
10243
- }), R;
10272
+ }), P;
10244
10273
  }
10245
10274
  }, D = S.n;
10246
10275
  try {
10247
- const P = d(v, I, L);
10248
- return setAtomStateValueOrPromise(v, P, m), isPromiseLike$1(P) && (registerAbortHandler(P, () => T == null ? void 0 : T.abort()), P.then(
10276
+ const R = d(v, I, L);
10277
+ return setAtomStateValueOrPromise(v, R, m), isPromiseLike$1(R) && (registerAbortHandler(R, () => T == null ? void 0 : T.abort()), R.then(
10249
10278
  j,
10250
10279
  j
10251
10280
  )), S;
10252
- } catch (P) {
10253
- return delete S.v, S.e = P, ++S.n, S;
10281
+ } catch (R) {
10282
+ return delete S.v, S.e = R, ++S.n, S;
10254
10283
  } finally {
10255
10284
  C = !1, D !== S.n && n.get(v) === D && (n.set(v, S.n), a.add(v), (B = c.c) == null || B.call(c, v));
10256
10285
  }
@@ -10266,14 +10295,14 @@ const RootLayout = () => {
10266
10295
  }), A = h[5] || ((v, ...B) => {
10267
10296
  let S = !0;
10268
10297
  const C = (I) => returnAtomValue(y(I)), j = (I, ...T) => {
10269
- var R;
10298
+ var P;
10270
10299
  const L = m(I);
10271
10300
  try {
10272
10301
  if (isSelfAtom(v, I)) {
10273
10302
  if (!hasInitialValue(I))
10274
10303
  throw new Error("atom not writable");
10275
- const D = L.n, P = T[0];
10276
- setAtomStateValueOrPromise(I, P, m), E(I), D !== L.n && (a.add(I), (R = c.c) == null || R.call(c, I), b(I));
10304
+ const D = L.n, R = T[0];
10305
+ setAtomStateValueOrPromise(I, R, m), E(I), D !== L.n && (a.add(I), (P = c.c) == null || P.call(c, I), b(I));
10277
10306
  return;
10278
10307
  } else
10279
10308
  return A(I, ...T);
@@ -10317,19 +10346,19 @@ const RootLayout = () => {
10317
10346
  }, r.set(v, C), (B = c.m) == null || B.call(c, v), isActuallyWritableAtom(v)) {
10318
10347
  const j = () => {
10319
10348
  let I = !0;
10320
- const T = (...R) => {
10349
+ const T = (...P) => {
10321
10350
  try {
10322
- return A(v, ...R);
10351
+ return A(v, ...P);
10323
10352
  } finally {
10324
10353
  I || (x(), f());
10325
10354
  }
10326
10355
  };
10327
10356
  try {
10328
- const R = g(v, T);
10329
- R && (C.u = () => {
10357
+ const P = g(v, T);
10358
+ P && (C.u = () => {
10330
10359
  I = !0;
10331
10360
  try {
10332
- R();
10361
+ P();
10333
10362
  } finally {
10334
10363
  I = !1;
10335
10364
  }
@@ -10503,7 +10532,7 @@ const useAutoSave = () => {
10503
10532
  }, ChaiWatchers = (o) => {
10504
10533
  const [, r] = useBlocksStore(), n = useBuilderReset(), [a] = useAtom(builderSaveStateAtom);
10505
10534
  useAtom(selectedLibraryAtom), useKeyEventWatcher(), useExpandTree(), useAutoSave(), useWatchPartailBlocks(), useUnmountBroadcastChannel();
10506
- const { postMessage: l } = useBroadcastChannel();
10535
+ const { postMessage: l } = useBroadcastChannel(), [, i] = useAtom(isPageLoadedAtom);
10507
10536
  return useEffect(() => {
10508
10537
  builderStore.set(
10509
10538
  // @ts-ignore
@@ -10513,17 +10542,17 @@ const useAutoSave = () => {
10513
10542
  }, [o]), useEffect(() => {
10514
10543
  builderStore.set(chaiPageExternalDataAtom, o.pageExternalData || {});
10515
10544
  }, [o.pageExternalData]), useEffect(() => {
10516
- setTimeout(() => {
10517
- const i = syncBlocksWithDefaults(o.blocks || []);
10518
- r(i), i && i.length > 0 && l({ type: "blocks-updated", blocks: i }), n();
10545
+ i(!1), setTimeout(() => {
10546
+ const c = syncBlocksWithDefaults(o.blocks || []);
10547
+ r(c), c && c.length > 0 && l({ type: "blocks-updated", blocks: c }), n(), i(!0);
10519
10548
  }, 400);
10520
10549
  }, [o.blocks]), useEffect(() => {
10521
10550
  i18n.changeLanguage(o.locale || "en");
10522
10551
  }, [o.locale]), useEffect(() => {
10523
10552
  setDebugLogs(o.debugLogs);
10524
10553
  }, [o.debugLogs]), useEffect(() => {
10525
- o.translations && each(o.translations, (i, c) => {
10526
- i18n.addResourceBundle(c, "translation", i, !0, !0);
10554
+ o.translations && each(o.translations, (c, d) => {
10555
+ i18n.addResourceBundle(d, "translation", c, !0, !0);
10527
10556
  });
10528
10557
  }, [o.translations]), useEffect(() => (a !== "SAVED" ? window.onbeforeunload = () => "" : window.onbeforeunload = null, () => {
10529
10558
  window.onbeforeunload = null;
@@ -10607,6 +10636,7 @@ export {
10607
10636
  useHiddenBlockIds,
10608
10637
  useHighlightBlockId,
10609
10638
  useInlineEditing,
10639
+ useIsPageLoaded,
10610
10640
  useLanguages,
10611
10641
  useLibraryBlocks,
10612
10642
  useMediaManagerComponent,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "2.5.6",
8
+ "version": "2.5.8",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",