@chaibuilder/sdk 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{AddBlocks-d5a8235d.js → AddBlocks-b2d43d6c.js} +5 -6
  2. package/dist/AddBlocks-b510ac3a.cjs +3 -0
  3. package/dist/BrandingOptions-6fbe4b26.cjs +1 -0
  4. package/dist/{BrandingOptions-e77f91bc.js → BrandingOptions-7f66e02c.js} +5 -6
  5. package/dist/{CanvasArea-50356121.js → CanvasArea-68841a13.js} +10 -11
  6. package/dist/{CanvasArea-a09ed911.cjs → CanvasArea-a8d28eb3.cjs} +6 -6
  7. package/dist/{CurrentPage-0dd3a1fe.js → CurrentPage-6655ce50.js} +5 -6
  8. package/dist/CurrentPage-c10e6c89.cjs +1 -0
  9. package/dist/Layers-595cc98e.cjs +1 -0
  10. package/dist/{Layers-e17bbf6a.js → Layers-99bdc689.js} +48 -49
  11. package/dist/{MODIFIERS-c2e02614.js → MODIFIERS-2f19c314.js} +13 -7
  12. package/dist/MODIFIERS-4716c669.cjs +1 -0
  13. package/dist/{MarkAsGlobalBlock-3a58a10b.js → MarkAsGlobalBlock-522e170a.js} +5 -6
  14. package/dist/MarkAsGlobalBlock-ea769ea4.cjs +1 -0
  15. package/dist/{PagesPanel-68bb4554.js → PagesPanel-b0debeed.js} +5 -6
  16. package/dist/PagesPanel-e176d7e8.cjs +1 -0
  17. package/dist/{ProjectPanel-decfe6bb.js → ProjectPanel-9cec967c.js} +6 -7
  18. package/dist/ProjectPanel-d0f33df2.cjs +1 -0
  19. package/dist/Settings-208ab051.cjs +1 -0
  20. package/dist/{Settings-27bb6012.js → Settings-fd1e3b5d.js} +82 -83
  21. package/dist/SidePanels-40966390.cjs +1 -0
  22. package/dist/{SidePanels-839ecfae.js → SidePanels-ca294b35.js} +6 -7
  23. package/dist/{Topbar-d3dc4a34.js → Topbar-1edef1b2.js} +15 -16
  24. package/dist/Topbar-75c99c88.cjs +1 -0
  25. package/dist/add-page-modal-18f134c0.cjs +1 -0
  26. package/dist/{add-page-modal-da3e0ad5.js → add-page-modal-9985b5ce.js} +5 -6
  27. package/dist/core.cjs +1 -1
  28. package/dist/core.d.ts +1 -1
  29. package/dist/core.js +56 -57
  30. package/dist/delete-page-modal-393697d7.cjs +1 -0
  31. package/dist/{delete-page-modal-3aa66051.js → delete-page-modal-98272bf5.js} +8 -9
  32. package/dist/functions-83b1de8d.js +1106 -0
  33. package/dist/functions-f84d5e2a.cjs +2 -0
  34. package/dist/{html-to-json-8397fab5.js → html-to-json-45e0e3b5.js} +1 -1
  35. package/dist/{html-to-json-78bfa1f3.cjs → html-to-json-aadcbf66.cjs} +1 -1
  36. package/dist/{index-ca7c3430.js → index-436bba3e.js} +110 -111
  37. package/dist/{index-976ec896.cjs → index-c3a98a78.cjs} +40 -40
  38. package/dist/lib.cjs +1 -1
  39. package/dist/lib.d.ts +39 -1
  40. package/dist/lib.js +56 -45
  41. package/dist/page-viewer-32261f49.cjs +1 -0
  42. package/dist/{page-viewer-3e7a6d70.js → page-viewer-a3ac057a.js} +16 -17
  43. package/dist/{project-general-setting-c8aa9370.js → project-general-setting-21e324a9.js} +5 -6
  44. package/dist/project-general-setting-75a8e94b.cjs +1 -0
  45. package/dist/render.cjs +1 -2
  46. package/dist/render.d.ts +16 -17
  47. package/dist/render.js +88 -1169
  48. package/dist/server.cjs +1 -1
  49. package/dist/server.d.ts +21 -1
  50. package/dist/server.js +47 -35
  51. package/dist/{single-page-detail-55638cb1.js → single-page-detail-0e881b82.js} +6 -7
  52. package/dist/single-page-detail-649b1379.cjs +1 -0
  53. package/package.json +1 -1
  54. package/dist/AddBlocks-6fc9d7de.cjs +0 -3
  55. package/dist/BrandingOptions-e44ef105.cjs +0 -1
  56. package/dist/CurrentPage-19086054.cjs +0 -1
  57. package/dist/Layers-2dd7336a.cjs +0 -1
  58. package/dist/MODIFIERS-70fef873.cjs +0 -1
  59. package/dist/MarkAsGlobalBlock-d4fe0af6.cjs +0 -1
  60. package/dist/PagesPanel-fa54f8c4.cjs +0 -1
  61. package/dist/ProjectPanel-750e4a4f.cjs +0 -1
  62. package/dist/Settings-c18e276b.cjs +0 -1
  63. package/dist/SidePanels-90ac74bf.cjs +0 -1
  64. package/dist/Topbar-57cd1611.cjs +0 -1
  65. package/dist/_commonjsHelpers-10dfc225.js +0 -8
  66. package/dist/_commonjsHelpers-87b0abe8.cjs +0 -1
  67. package/dist/add-page-modal-f49ebaf3.cjs +0 -1
  68. package/dist/delete-page-modal-6667ee2b.cjs +0 -1
  69. package/dist/page-viewer-5f00c933.cjs +0 -1
  70. package/dist/project-general-setting-a23cc2c4.cjs +0 -1
  71. package/dist/single-page-detail-a4b59a16.cjs +0 -1
@@ -18,26 +18,25 @@ var vs = (e, t, r, n) => ({
18
18
  import { j as oe } from "./jsx-runtime-944c88e2.js";
19
19
  import * as P from "react";
20
20
  import y, { createContext as nn, useReducer as Im, useEffect as Ce, useDebugValue as JA, useCallback as pe, useContext as br, useState as Re, useRef as xe, useLayoutEffect as Ef, forwardRef as we, cloneElement as Ll, Fragment as GA, Children as YA, useMemo as Wl, Component as Pm, isValidElement as HA, createElement as ci, memo as QA, Suspense as na, lazy as Fn } from "react";
21
- import { c as aa, g as Kl } from "./_commonjsHelpers-10dfc225.js";
22
- import km from "clsx";
21
+ import { c as aa, g as Kl, S as xn, I as km, a as Pu, B as ku } from "./MODIFIERS-2f19c314.js";
22
+ import xm from "clsx";
23
23
  import * as cn from "@radix-ui/react-scroll-area";
24
24
  import { flushSync as XA, createPortal as _A } from "react-dom";
25
- import { getOverflowAncestors as Qs, useFloating as $A, autoUpdate as eE, size as tE, offset as xm, shift as Of, limitShift as rE, flip as Rm, inline as Mm, arrow as Nm } from "@floating-ui/react-dom";
25
+ import { getOverflowAncestors as Qs, useFloating as $A, autoUpdate as eE, size as tE, offset as Rm, shift as Of, limitShift as rE, flip as Mm, inline as Nm, arrow as Tm } from "@floating-ui/react-dom";
26
26
  import { useAtom as Me, atom as ge, useAtomValue as Ge, useSetAtom as an, getDefaultStore as nE } from "jotai";
27
27
  import aE from "i18next";
28
28
  import { initReactI18next as oE } from "react-i18next";
29
29
  import { FlagsProvider as sE } from "flagged";
30
30
  import { DndProvider as iE } from "react-dnd";
31
- import { flatten as Ut, find as tr, filter as Le, map as ht, omit as Zl, isEmpty as gr, isString as Cf, set as $r, get as Be, includes as Ot, without as Tm, forIn as jm, has as Ul, findIndex as ys, last as lE, first as pr, startsWith as zm, isNull as Pu, each as Hr, pick as Qd, sortBy as ku, isObject as cE, capitalize as uE } from "lodash";
31
+ import { flatten as Ut, find as tr, filter as Le, map as ht, omit as Zl, isEmpty as gr, isString as Cf, set as $r, get as Be, includes as Ot, without as jm, forIn as zm, has as Ul, findIndex as ys, last as lE, first as pr, startsWith as Fm, isNull as xu, each as Hr, pick as Qd, sortBy as Ru, isObject as cE, capitalize as uE } from "lodash";
32
32
  import { getBackendOptions as fE, MultiBackend as dE } from "@minoru/react-dnd-treeview";
33
- import { u as la, c as Fm, B as qm, S as pE, T as hE, a as bE } from "./useBuilderProp-81a14920.js";
33
+ import { u as la, c as qm, B as Dm, S as pE, T as hE, a as bE } from "./useBuilderProp-81a14920.js";
34
34
  import { c as gE } from "./utils-ac68b2c8.js";
35
35
  import { useHotkeys as Nr } from "react-hotkeys-hook";
36
- import Dm from "flat-to-nested";
37
- import { g as Qr, c as Xs, a as mE, b as vE } from "./html-to-json-8397fab5.js";
36
+ import Bm from "flat-to-nested";
37
+ import { g as Qr, c as Xs, a as mE, b as vE } from "./html-to-json-45e0e3b5.js";
38
38
  import yE, { excludeAction as wE, ActionCreators as Lc } from "redux-undo";
39
39
  import { useThrottledCallback as SE } from "@react-hookz/web";
40
- import { S as xn, I as Bm, a as xu, B as Ru } from "./MODIFIERS-c2e02614.js";
41
40
  import { useChaiBlocks as AE, syncBlocksWithDefaults as EE } from "@chaibuilder/blocks";
42
41
  import { FileTextIcon as OE, GearIcon as CE, EyeClosedIcon as IE, EyeOpenIcon as PE } from "@radix-ui/react-icons";
43
42
  import { LogOutIcon as kE } from "lucide-react";
@@ -2941,7 +2940,7 @@ const { cssFactory: IC } = (() => {
2941
2940
  const { ref: i, args: l } = CC(s), u = Ta(l, n.registered);
2942
2941
  return Hl(n, u, !1), `${n.key}-${u.name}${i === void 0 ? "" : ` ${i}`}`;
2943
2942
  };
2944
- return { css: a, cx: (...s) => e(n.registered, a, km(s)) };
2943
+ return { css: a, cx: (...s) => e(n.registered, a, xm(s)) };
2945
2944
  }
2946
2945
  return { cssFactory: t };
2947
2946
  })();
@@ -6079,8 +6078,8 @@ function Py({
6079
6078
  }, [e]);
6080
6079
  }
6081
6080
  function hk(e) {
6082
- const t = [xm(e.offset)];
6083
- return e.middlewares.shift && t.push(Of({ limiter: rE() })), e.middlewares.flip && t.push(Rm()), e.middlewares.inline && t.push(Mm()), t.push(Nm({ element: e.arrowRef, padding: e.arrowOffset })), t;
6081
+ const t = [Rm(e.offset)];
6082
+ return e.middlewares.shift && t.push(Of({ limiter: rE() })), e.middlewares.flip && t.push(Mm()), e.middlewares.inline && t.push(Nm()), t.push(Tm({ element: e.arrowRef, padding: e.arrowOffset })), t;
6084
6083
  }
6085
6084
  function bk(e) {
6086
6085
  const [t, r] = Fa({
@@ -6164,7 +6163,7 @@ const Ak = {
6164
6163
  id: s ? u.getTargetId() : n.props.id
6165
6164
  } : {};
6166
6165
  return Ll(n, xs(wk(xs(xs(xs({}, l), f), u.targetProps), {
6167
- className: km(u.targetProps.className, l.className, n.props.className),
6166
+ className: xm(u.targetProps.className, l.className, n.props.className),
6168
6167
  [a]: c
6169
6168
  }), u.controlled ? null : { onClick: u.onToggle }));
6170
6169
  });
@@ -9113,11 +9112,11 @@ function EN(e) {
9113
9112
  open: a,
9114
9113
  onOpenChange: c,
9115
9114
  middleware: [
9116
- xm(e.offset),
9115
+ Rm(e.offset),
9117
9116
  Of({ padding: 8 }),
9118
- Rm(),
9119
- Nm({ element: e.arrowRef, padding: e.arrowOffset }),
9120
- ...e.inline ? [Mm()] : []
9117
+ Mm(),
9118
+ Tm({ element: e.arrowRef, padding: e.arrowOffset }),
9119
+ ...e.inline ? [Nm()] : []
9121
9120
  ]
9122
9121
  }), { getReferenceProps: S, getFloatingProps: E } = pk([
9123
9122
  ek(h, {
@@ -26608,7 +26607,7 @@ class $B extends y.Component {
26608
26607
  const eV = (e) => {
26609
26608
  const t = e.replace(xn, "").split(",");
26610
26609
  return { baseClasses: t[0], classes: t[1] };
26611
- }, tV = new Dm({ children: "blockNodes" }), FS = (e, t = null) => Ut(
26610
+ }, tV = new Bm({ children: "blockNodes" }), FS = (e, t = null) => Ut(
26612
26611
  e.map((r) => {
26613
26612
  if (r = t !== null ? { ...r, parent: t } : r, r.children && r.children.length) {
26614
26613
  const n = [...r.children];
@@ -26713,7 +26712,7 @@ iV.debugLabel = "addBlocksModalAtom";
26713
26712
  const Yt = () => {
26714
26713
  const [, e] = Me(Ac);
26715
26714
  return e;
26716
- }, nZ = () => {
26715
+ }, rZ = () => {
26717
26716
  const e = Yt(), t = Ge(BS), r = pe(
26718
26717
  (n) => {
26719
26718
  const a = FS(n);
@@ -26732,11 +26731,11 @@ const Yt = () => {
26732
26731
  )];
26733
26732
  }, of = (e) => ["Box", "Slot", "Form", "DataProvider", "Link", "List", "ListItem", "Row", "Column", "Table", "TableCell"].includes(
26734
26733
  e
26735
- ), aZ = (e) => !["Slot"].includes(e), oZ = (e) => !["Slot"].includes(e);
26734
+ ), nZ = (e) => !["Slot"].includes(e), aZ = (e) => !["Slot"].includes(e);
26736
26735
  function cV(e, t) {
26737
26736
  return e === "Slot" || t === "List" && e !== "ListItem" || t === "Row" && e !== "Column" ? !1 : of(t);
26738
26737
  }
26739
- const sZ = (e, { dragSource: t, dropTarget: r }) => {
26738
+ const oZ = (e, { dragSource: t, dropTarget: r }) => {
26740
26739
  const n = Be(t, "data._type", ""), a = Be(r, "data._type", "");
26741
26740
  return n === "Slot" || Be(t, "id") && Be(t, "id") === Be(r, "id") ? !1 : gr(a) ? !0 : cV(n, a);
26742
26741
  }, Md = ge([]);
@@ -26770,13 +26769,13 @@ const jd = ge("");
26770
26769
  jd.debugLabel = "styleStateAtom";
26771
26770
  const WS = Pt("styleBreakpoint", "xs");
26772
26771
  WS.debugLabel = "styleBreakpointAtom";
26773
- const iZ = () => ({
26772
+ const sZ = () => ({
26774
26773
  flexChild: Ge(VS),
26775
26774
  gridChild: Ge(LS)
26776
- }), lZ = () => Ge(Td), Wn = () => {
26775
+ }), iZ = () => Ge(Td), Wn = () => {
26777
26776
  const [e, t] = Me(Md), r = pe(
26778
26777
  (n) => {
26779
- t((a) => Ot(a, n) ? Tm(a, n) : [...a, n]);
26778
+ t((a) => Ot(a, n) ? jm(a, n) : [...a, n]);
26780
26779
  },
26781
26780
  [t]
26782
26781
  );
@@ -26855,8 +26854,8 @@ const iZ = () => ({
26855
26854
  const { itemProperties: t } = e;
26856
26855
  return ht(e.default, (r) => {
26857
26856
  const n = { ...r };
26858
- return jm(r, (a, o) => {
26859
- Ul(t, o) && Be(t[o], "i18n", !1) && (n[o] = Bm);
26857
+ return zm(r, (a, o) => {
26858
+ Ul(t, o) && Be(t[o], "i18n", !1) && (n[o] = km);
26860
26859
  }), n;
26861
26860
  });
26862
26861
  }, pV = (e) => {
@@ -26864,10 +26863,10 @@ const iZ = () => ({
26864
26863
  case "styles":
26865
26864
  return e.default;
26866
26865
  case "slot":
26867
- return `${xu}${Qr()}`;
26866
+ return `${Pu}${Qr()}`;
26868
26867
  case "singular":
26869
26868
  const { i18n: t, schema: r } = e;
26870
- return t ? Bm : Be(r, "default", "");
26869
+ return t ? km : Be(r, "default", "");
26871
26870
  case "model":
26872
26871
  return KS(e.properties);
26873
26872
  case "list":
@@ -26893,7 +26892,7 @@ function Mg(e, t, r, n, a) {
26893
26892
  const i = o + 1;
26894
26893
  return e.splice(i, 0, ...n), e;
26895
26894
  }
26896
- const cZ = () => {
26895
+ const lZ = () => {
26897
26896
  const e = Yt(), t = hV(), [, r] = Wn(), n = pe(
26898
26897
  (o, s, i) => {
26899
26898
  var c;
@@ -26921,9 +26920,9 @@ const cZ = () => {
26921
26920
  return n(h, s, i);
26922
26921
  }
26923
26922
  const l = Qr(), u = KS(o.props), c = [];
26924
- jm(u, (h, g) => {
26925
- if (zm(h, xu)) {
26926
- const m = h.replace(xu, "");
26923
+ zm(u, (h, g) => {
26924
+ if (Fm(h, Pu)) {
26925
+ const m = h.replace(Pu, "");
26927
26926
  c.push({
26928
26927
  _id: m,
26929
26928
  _type: "Slot",
@@ -26984,8 +26983,8 @@ function gV(e = "", t = "", r = []) {
26984
26983
  e = e.trim().replace(/ +/g, "");
26985
26984
  let n = Le(
26986
26985
  ht(e.split(" "), Xs),
26987
- (u) => !Pu(u)
26988
- ), a = Le(ht(t.split(" "), Xs), (u) => !Pu(u));
26986
+ (u) => !xu(u)
26987
+ ), a = Le(ht(t.split(" "), Xs), (u) => !xu(u));
26989
26988
  a = Le(
26990
26989
  a,
26991
26990
  (u) => !Ot(jg, u.property)
@@ -27009,11 +27008,11 @@ function gV(e = "", t = "", r = []) {
27009
27008
  }
27010
27009
  });
27011
27010
  const i = ht(
27012
- ku([...n, ...o], (u) => Ng[u.mq]),
27011
+ Ru([...n, ...o], (u) => Ng[u.mq]),
27013
27012
  "fullCls"
27014
27013
  ).join(" ");
27015
27014
  return `${ht(
27016
- ku([...a, ...s], (u) => Ng[u.mq]),
27015
+ Ru([...a, ...s], (u) => Ng[u.mq]),
27017
27016
  "fullCls"
27018
27017
  ).join(" ").trim()},${i.trim()}`.trim().replace(/ +/g, "");
27019
27018
  }
@@ -27040,7 +27039,7 @@ const ZS = () => Me(os), mV = (e) => {
27040
27039
  }
27041
27040
  });
27042
27041
  });
27043
- }), uZ = () => {
27042
+ }), cZ = () => {
27044
27043
  const e = Yt(), t = an(vV);
27045
27044
  return pe(
27046
27045
  (r, n, a) => {
@@ -27061,13 +27060,13 @@ const yV = ge((e) => {
27061
27060
  }, AV = ge(!1), JS = () => {
27062
27061
  const [e, t] = Me(AV);
27063
27062
  return [e, t];
27064
- }, EV = ge(Ru), GS = () => {
27063
+ }, EV = ge(ku), GS = () => {
27065
27064
  const [e, t] = Me(EV);
27066
27065
  return [
27067
- cE(e) ? { ...Ru, ...e } : Ru,
27066
+ cE(e) ? { ...ku, ...e } : ku,
27068
27067
  t
27069
27068
  ];
27070
- }, OV = ge(null), CV = () => ({ currentPage: Ge(OV) }), YS = new Dm({});
27069
+ }, OV = ge(null), CV = () => ({ currentPage: Ge(OV) }), YS = new Bm({});
27071
27070
  function IV(e) {
27072
27071
  let t = YS.convert(e);
27073
27072
  return t = !t.type && t.children && t.children.length ? t.children : gr(t) ? [] : [t], t;
@@ -27170,7 +27169,7 @@ const qd = ge([]);
27170
27169
  qd.debugLabel = "dataProvidersAtom";
27171
27170
  const VV = () => Me(qd), Oc = ge("SAVED");
27172
27171
  Oc.debugLabel = "pageSyncStateAtom";
27173
- const fZ = () => {
27172
+ const uZ = () => {
27174
27173
  const [e, t] = Me(Oc), r = la("onSaveBlocks", async () => {
27175
27174
  }), n = la("onSavePage", async () => {
27176
27175
  }), a = la("onSyncStatusChange", () => {
@@ -27218,12 +27217,12 @@ const fZ = () => {
27218
27217
  }, LV = () => Me(WS), eA = Pt("canvasWidth", 800), tA = ge((e) => {
27219
27218
  const t = e(eA);
27220
27219
  return mE(t).toLowerCase();
27221
- }), dZ = () => {
27220
+ }), fZ = () => {
27222
27221
  const [e, t] = Me(eA), r = Ge(tA), [n, a] = LV();
27223
27222
  return Ce(() => {
27224
27223
  n !== "xs" && a(r);
27225
27224
  }, [r, n, a]), [e, r, t];
27226
- }, WV = Pt("canvasZoom", 100), pZ = () => Me(WV), rA = ge([]), nA = () => {
27225
+ }, WV = Pt("canvasZoom", 100), dZ = () => Me(WV), rA = ge([]), nA = () => {
27227
27226
  const [e, t] = Me(rA), r = an(Dd), n = pe(
27228
27227
  (a) => {
27229
27228
  t(a), r([]);
@@ -27239,10 +27238,10 @@ const fZ = () => {
27239
27238
  [t, r]
27240
27239
  );
27241
27240
  return [e, n];
27242
- }, aA = Pt("darkMode", !1), hZ = () => {
27241
+ }, aA = Pt("darkMode", !1), pZ = () => {
27243
27242
  const [e, t] = Me(aA);
27244
27243
  return [e, t];
27245
- }, ZV = ge(!1), bZ = () => {
27244
+ }, ZV = ge(!1), hZ = () => {
27246
27245
  const [e, t] = Me(ZV);
27247
27246
  return [e, t];
27248
27247
  }, oA = () => {
@@ -27257,15 +27256,15 @@ const fZ = () => {
27257
27256
  },
27258
27257
  [t, r, e]
27259
27258
  );
27260
- }, UV = ge([]), gZ = () => {
27259
+ }, UV = ge([]), bZ = () => {
27261
27260
  const [e, t] = Me(UV), r = pe(
27262
27261
  (n) => {
27263
- t((a) => Ot(a, n) ? Tm(a, n) : [...a, n]);
27262
+ t((a) => Ot(a, n) ? jm(a, n) : [...a, n]);
27264
27263
  },
27265
27264
  [t]
27266
27265
  );
27267
27266
  return [e, t, r];
27268
- }, JV = ge(""), GV = () => Me(JV), mZ = () => {
27267
+ }, JV = ge(""), GV = () => Me(JV), gZ = () => {
27269
27268
  const e = Ge(Gt), t = Yt(), r = _S(), [, , n] = SV();
27270
27269
  return pe(
27271
27270
  async (a, o) => {
@@ -27274,7 +27273,7 @@ const fZ = () => {
27274
27273
  },
27275
27274
  [e, t, r, n]
27276
27275
  );
27277
- }, vZ = () => ({}), YV = () => {
27276
+ }, mZ = () => ({}), YV = () => {
27278
27277
  const e = Ge(Gt), t = Yt();
27279
27278
  return pe(
27280
27279
  (r, n) => {
@@ -27297,7 +27296,7 @@ const fZ = () => {
27297
27296
  [t, e, n, a, r]
27298
27297
  )
27299
27298
  };
27300
- }, QV = ge(""), yZ = () => {
27299
+ }, QV = ge(""), vZ = () => {
27301
27300
  const e = Ge(QV), t = pe(() => {
27302
27301
  }, []), r = pe(() => {
27303
27302
  }, []), n = pe(() => {
@@ -27345,7 +27344,7 @@ const fZ = () => {
27345
27344
  }
27346
27345
  });
27347
27346
  });
27348
- }), wZ = () => {
27347
+ }), yZ = () => {
27349
27348
  const e = Yt(), t = an(_V);
27350
27349
  return pe(
27351
27350
  (r, n) => {
@@ -27358,11 +27357,11 @@ const fZ = () => {
27358
27357
  if (!t || t.blockId !== Be(r, "_id", null))
27359
27358
  return [];
27360
27359
  const a = Be(r, t.prop, `${xn},`).replace(xn, "").split(",").join(" ");
27361
- return Le(ht(a.trim().split(" "), Xs), (o) => !Pu(o));
27362
- }), SZ = () => Ge(iA), zg = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, $V = ge((e) => {
27360
+ return Le(ht(a.trim().split(" "), Xs), (o) => !xu(o));
27361
+ }), wZ = () => Ge(iA), zg = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, $V = ge((e) => {
27363
27362
  const t = e(tA), r = e(jd), n = e(aA), a = eL(t);
27364
27363
  let o = Le(e(iA), { mod: r });
27365
- return zm(r, "_") || (o = Le(o, (s) => a.includes(s.mq))), o = o.sort((s, i) => zg[s.mq] - zg[i.mq]), n || (o = Le(o, { dark: !1 })), o;
27364
+ return Fm(r, "_") || (o = Le(o, (s) => a.includes(s.mq))), o = o.sort((s, i) => zg[s.mq] - zg[i.mq]), n || (o = Le(o, { dark: !1 })), o;
27366
27365
  }), eL = (e) => {
27367
27366
  let t = [];
27368
27367
  switch (e) {
@@ -27389,12 +27388,12 @@ const fZ = () => {
27389
27388
  break;
27390
27389
  }
27391
27390
  return t;
27392
- }, AZ = () => Ge($V), EZ = () => Me(jd), lA = ge(null, (e, t, { blockIds: r, props: n, dispatch: a }) => {
27391
+ }, SZ = () => Ge($V), AZ = () => Me(jd), lA = ge(null, (e, t, { blockIds: r, props: n, dispatch: a }) => {
27393
27392
  a({
27394
27393
  type: "update_props_realtime",
27395
27394
  payload: { ids: r, props: n }
27396
27395
  });
27397
- }), OZ = () => {
27396
+ }), EZ = () => {
27398
27397
  const { createSnapshot: e } = Cc(), t = Yt(), r = an(lA);
27399
27398
  return pe(
27400
27399
  (n, a) => {
@@ -27402,7 +27401,7 @@ const fZ = () => {
27402
27401
  },
27403
27402
  [e, t, r]
27404
27403
  );
27405
- }, CZ = () => {
27404
+ }, OZ = () => {
27406
27405
  const e = Yt(), t = an(lA);
27407
27406
  return pe(
27408
27407
  (r, n) => {
@@ -27415,7 +27414,7 @@ const fZ = () => {
27415
27414
  props: {},
27416
27415
  modalProps: {},
27417
27416
  backdropClose: !0
27418
- }, tL = ge(cA), IZ = () => {
27417
+ }, tL = ge(cA), CZ = () => {
27419
27418
  const [e, t] = Me(tL), r = pe(
27420
27419
  (a, o = {}, s = {}) => {
27421
27420
  t({ name: a, props: o, modalProps: s });
@@ -27433,7 +27432,7 @@ const fZ = () => {
27433
27432
  openModal: r,
27434
27433
  closeModal: n
27435
27434
  };
27436
- }, PZ = () => Ge($S), rL = ge(""), nL = ge(null), kZ = () => Me(rL), xZ = () => Me(nL), aL = Pt("selectedBreakpoints", ["XS", "MD", "XL"]), RZ = () => {
27435
+ }, IZ = () => Ge($S), rL = ge(""), nL = ge(null), PZ = () => Me(rL), kZ = () => Me(nL), aL = Pt("selectedBreakpoints", ["XS", "MD", "XL"]), xZ = () => {
27437
27436
  const [e, t] = Me(aL);
27438
27437
  return [e, t];
27439
27438
  }, uA = () => {
@@ -27441,7 +27440,7 @@ const fZ = () => {
27441
27440
  return () => {
27442
27441
  r([]), a([]), n(""), t(), e({ undoCount: 0, redoCount: 0 });
27443
27442
  };
27444
- }, oL = ge({ en: {} }), MZ = () => {
27443
+ }, oL = ge({ en: {} }), RZ = () => {
27445
27444
  const [e, t] = Me(oL), r = pe(
27446
27445
  (n, a, o) => {
27447
27446
  $r(e, `${n}.${a}`, o), t(e);
@@ -27449,21 +27448,21 @@ const fZ = () => {
27449
27448
  [e, t]
27450
27449
  );
27451
27450
  return [e, r];
27452
- }, NZ = (e, t) => {
27453
- const [r] = Me(Fm);
27451
+ }, MZ = (e, t) => {
27452
+ const [r] = Me(qm);
27454
27453
  return Be(r, e, t);
27455
- }, sL = ge([]), TZ = () => {
27454
+ }, sL = ge([]), NZ = () => {
27456
27455
  const [e, t] = Re(!1), [r, n] = Me(sL), a = la("getUILibraryBlocks", () => []);
27457
27456
  return Ce(() => {
27458
27457
  (async () => r.length > 0 || (t(!0), n(await a()), t(!1)))();
27459
27458
  }, []), { data: r, isLoading: e };
27460
- }, iL = ge("en"), lL = ge("en"), cL = ge(["en"]), uL = () => Me(iL), jZ = () => Me(lL), zZ = () => Me(cL), FZ = (e, t) => {
27459
+ }, iL = ge("en"), lL = ge("en"), cL = ge(["en"]), uL = () => Me(iL), TZ = () => Me(lL), jZ = () => Me(cL), zZ = (e, t) => {
27461
27460
  const [r] = uL(), n = `${e}${r ? `-${r}` : ""}`;
27462
27461
  return { content: Be(t, n, Be(t, e, "")), propKey: e };
27463
27462
  }, fL = () => {
27464
27463
  const [e, t] = JS(), r = la("previewComponent");
27465
27464
  return /* @__PURE__ */ oe.jsxs("div", { className: gE("fixed inset-0 z-[999] bg-background", e ? "block" : "hidden"), children: [
27466
- /* @__PURE__ */ oe.jsx(qm, { size: "sm", className: "absolute right-0 top-0 m-4", onClick: () => t(!1), children: "Close Preview" }),
27465
+ /* @__PURE__ */ oe.jsx(Dm, { size: "sm", className: "absolute right-0 top-0 m-4", onClick: () => t(!1), children: "Close Preview" }),
27467
27466
  /* @__PURE__ */ oe.jsx("div", { children: r ? /* @__PURE__ */ oe.jsx(na, { fallback: /* @__PURE__ */ oe.jsx(pE, { className: "h-96 w-full" }), children: y.createElement(r) }) : null })
27468
27467
  ] });
27469
27468
  }, dL = () => {
@@ -27489,7 +27488,7 @@ const fZ = () => {
27489
27488
  const a = pr(e);
27490
27489
  Cf(a) && (n = [a, ...pL(t, a)]), r(n);
27491
27490
  }, [e, t, r]);
27492
- }, qZ = () => Ge(fA), bL = Fn(() => import("./SidePanels-839ecfae.js")), gL = Fn(() => import("./Topbar-d3dc4a34.js")), mL = Fn(() => import("./CanvasArea-50356121.js")), vL = Fn(() => import("./Settings-27bb6012.js")), yL = () => {
27491
+ }, FZ = () => Ge(fA), bL = Fn(() => import("./SidePanels-ca294b35.js")), gL = Fn(() => import("./Topbar-1edef1b2.js")), mL = Fn(() => import("./CanvasArea-68841a13.js")), vL = Fn(() => import("./Settings-fd1e3b5d.js")), yL = () => {
27493
27492
  const [e] = Me(Oc), t = (r) => {
27494
27493
  r.preventDefault();
27495
27494
  };
@@ -28744,7 +28743,7 @@ function hW() {
28744
28743
  };
28745
28744
  return nW(om(om({}, t), e));
28746
28745
  }
28747
- const bW = "@chaibuilder/sdk", gW = "0.1.19", mW = "module", vW = [
28746
+ const bW = "@chaibuilder/sdk", gW = "0.1.21", mW = "module", vW = [
28748
28747
  "dist"
28749
28748
  ], yW = "dist/core.js", wW = !1, SW = {
28750
28749
  ".": {
@@ -28960,7 +28959,7 @@ const xW = (e) => /* @__PURE__ */ oe.jsx(oe.Fragment, { children: e.children }),
28960
28959
  return Ce(() => {
28961
28960
  Fg.set(
28962
28961
  // @ts-ignore
28963
- Fm,
28962
+ qm,
28964
28963
  Zl(e, ["blocks", "subPages", "brandingOptions", "dataProvidersAtom"])
28965
28964
  );
28966
28965
  }, [e]), Ce(() => {
@@ -30741,7 +30740,7 @@ const ls = () => {
30741
30740
  return (a) => e !== "SAVED" ? (Or.error("You have unsaved changes. Please save before changing the page."), !1) : t === a.uuid ? !1 : (n(), setTimeout(() => {
30742
30741
  r(a.uuid);
30743
30742
  }, 100), !0);
30744
- }, DZ = () => {
30743
+ }, qZ = () => {
30745
30744
  const e = Pr(), t = dK(), r = kt();
30746
30745
  return kr({
30747
30746
  mutationFn: async (n) => fetch(`${r}/pages`, {
@@ -30777,7 +30776,7 @@ const ls = () => {
30777
30776
  });
30778
30777
  }
30779
30778
  });
30780
- }, BZ = () => {
30779
+ }, DZ = () => {
30781
30780
  const e = Pr(), t = kt();
30782
30781
  return kr({
30783
30782
  mutationFn: async (r) => fetch(`${t}/page`, {
@@ -30793,7 +30792,7 @@ const ls = () => {
30793
30792
  return kr({
30794
30793
  mutationFn: async () => {
30795
30794
  const t = await fetch(`${e}/library`).then((r) => r.json());
30796
- return ku(
30795
+ return Ru(
30797
30796
  Le(t, (r) => !Ul(r, "hidden")),
30798
30797
  "group"
30799
30798
  );
@@ -30827,7 +30826,7 @@ const ls = () => {
30827
30826
  })).json();
30828
30827
  }
30829
30828
  });
30830
- }, vK = Fn(() => import("./PagesPanel-68bb4554.js")), yK = Fn(() => import("./ProjectPanel-decfe6bb.js")), wK = Fn(() => import("./CurrentPage-0dd3a1fe.js")), SK = () => /* @__PURE__ */ oe.jsx("h2", { children: "Your Logo" }), AK = () => {
30829
+ }, vK = Fn(() => import("./PagesPanel-b0debeed.js")), yK = Fn(() => import("./ProjectPanel-9cec967c.js")), wK = Fn(() => import("./CurrentPage-6655ce50.js")), SK = () => /* @__PURE__ */ oe.jsx("h2", { children: "Your Logo" }), AK = () => {
30831
30830
  const e = Pr();
30832
30831
  return /* @__PURE__ */ oe.jsx("div", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ oe.jsx(
30833
30832
  kE,
@@ -30840,7 +30839,7 @@ const ls = () => {
30840
30839
  ) });
30841
30840
  }, EK = () => {
30842
30841
  const { mutate: e } = hK();
30843
- return /* @__PURE__ */ oe.jsx(qm, { onClick: e, className: "bg-blue-600 text-white", children: "Publish" });
30842
+ return /* @__PURE__ */ oe.jsx(Dm, { onClick: e, className: "bg-blue-600 text-white", children: "Publish" });
30844
30843
  }, OK = (e) => {
30845
30844
  const { data: t, isLoading: r } = Gd(), { data: n, isLoading: a } = KA(), { data: o } = uK(), { mutate: s } = fK(), { mutate: i } = pK(), [l] = ls(), u = mK(), c = bK(), f = gK(), d = kt(), p = pe(
30846
30845
  async (v) => await u.mutateAsync(v),
@@ -30980,7 +30979,7 @@ const ls = () => {
30980
30979
  return Ce(() => {
30981
30980
  n.setQueryData(["apiBaseUrl"], e.apiBaseUrl || "/api/chaibuilder");
30982
30981
  }, [e.apiBaseUrl, n]), r ? /* @__PURE__ */ oe.jsx(Af, {}) : t != null && t.valid ? /* @__PURE__ */ oe.jsx(OK, { ...e }) : /* @__PURE__ */ oe.jsx(PK, { logo: e.logo });
30983
- }, xK = new JW(), VZ = (e) => /* @__PURE__ */ oe.jsxs(XW, { client: xK, children: [
30982
+ }, xK = new JW(), BZ = (e) => /* @__PURE__ */ oe.jsxs(XW, { client: xK, children: [
30984
30983
  /* @__PURE__ */ oe.jsx(xE, { richColors: !0 }),
30985
30984
  /* @__PURE__ */ oe.jsx(kK, { ...e })
30986
30985
  ] });
@@ -30989,68 +30988,68 @@ export {
30989
30988
  GV as A,
30990
30989
  hV as B,
30991
30990
  MV as C,
30992
- lZ as D,
30991
+ iZ as D,
30993
30992
  FV as E,
30994
30993
  $B as F,
30995
- CZ as G,
30994
+ OZ as G,
30996
30995
  uL as H,
30997
30996
  Rg as I,
30998
30997
  xg as J,
30999
- uZ as K,
31000
- wZ as L,
31001
- EZ as M,
31002
- AZ as N,
31003
- iZ as O,
30998
+ cZ as K,
30999
+ yZ as L,
31000
+ AZ as M,
31001
+ SZ as N,
31002
+ sZ as O,
31004
31003
  RV as P,
31005
31004
  KA as Q,
31006
31005
  Gd as R,
31007
31006
  fK as S,
31008
31007
  dK as T,
31009
31008
  ls as U,
31010
- gZ as V,
31011
- cZ as W,
31012
- qZ as X,
31013
- sZ as Y,
31014
- TZ as Z,
31009
+ bZ as V,
31010
+ lZ as W,
31011
+ FZ as X,
31012
+ oZ as Y,
31013
+ NZ as Z,
31015
31014
  DV as _,
31016
31015
  qV as a,
31017
- DZ as a0,
31018
- mZ as a1,
31016
+ qZ as a0,
31017
+ gZ as a1,
31019
31018
  Pr as a2,
31020
31019
  pK as a3,
31021
- BZ as a4,
31020
+ DZ as a4,
31022
31021
  MW as a5,
31023
31022
  uA as a6,
31024
- PZ as a7,
31025
- IZ as a8,
31023
+ IZ as a7,
31024
+ CZ as a8,
31026
31025
  SV as a9,
31027
31026
  CV as aa,
31028
- bZ as ab,
31027
+ hZ as ab,
31029
31028
  _S as ac,
31030
- vZ as ad,
31031
- yZ as ae,
31032
- MZ as af,
31033
- SZ as ag,
31029
+ mZ as ad,
31030
+ vZ as ae,
31031
+ RZ as af,
31032
+ wZ as ag,
31034
31033
  LV as ah,
31035
- nZ as ai,
31036
- OZ as aj,
31037
- kZ as ak,
31038
- xZ as al,
31039
- jZ as am,
31040
- zZ as an,
31041
- FZ as ao,
31042
- VZ as ap,
31034
+ rZ as ai,
31035
+ EZ as aj,
31036
+ PZ as ak,
31037
+ kZ as al,
31038
+ TZ as am,
31039
+ jZ as an,
31040
+ zZ as ao,
31041
+ BZ as ap,
31043
31042
  iV as b,
31044
- fZ as c,
31043
+ uZ as c,
31045
31044
  Cc as d,
31046
- hZ as e,
31047
- dZ as f,
31048
- RZ as g,
31045
+ pZ as e,
31046
+ fZ as f,
31047
+ xZ as g,
31049
31048
  lV as h,
31050
31049
  Wn as i,
31051
31050
  ZS as j,
31052
- NZ as k,
31053
- pZ as l,
31051
+ MZ as k,
31052
+ dZ as l,
31054
31053
  oA as m,
31055
31054
  nA as n,
31056
31055
  KV as o,
@@ -31062,7 +31061,7 @@ export {
31062
31061
  VV as u,
31063
31062
  xV as v,
31064
31063
  TV as w,
31065
- aZ as x,
31066
- oZ as y,
31064
+ nZ as x,
31065
+ aZ as y,
31067
31066
  GS as z
31068
31067
  };