@chaibuilder/sdk 2.5.6 → 2.5.7

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