@chaibuilder/sdk 1.2.38 → 1.2.40

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 (77) hide show
  1. package/dist/AddBlocks-Q--k4QYI.js +144 -0
  2. package/dist/AddBlocks-a20tIXfX.cjs +1 -0
  3. package/dist/{CanvasArea-MuuWWyW0.cjs → CanvasArea-QQn0aXpj.cjs} +5 -5
  4. package/dist/{CanvasArea-WJYJtUFt.js → CanvasArea-ahsds4rc.js} +183 -184
  5. package/dist/{ChaiBuilderEditor-PLQ8Sq34.cjs → ChaiBuilderEditor-hcoLrtq8.cjs} +49 -49
  6. package/dist/{ChaiBuilderEditor-vzyVasJe.js → ChaiBuilderEditor-wfEkvtJ0.js} +8163 -8050
  7. package/dist/{CurrentPage-j6xVMVFH.js → CurrentPage-f_5eIFbX.js} +9 -10
  8. package/dist/CurrentPage-zo2GKFUx.cjs +1 -0
  9. package/dist/{ListTree-1oWz6vwo.js → ListTree-3riQsfip.js} +1 -2
  10. package/dist/ListTree-FWHoDfbO.cjs +1 -0
  11. package/dist/PagesPanel-0Wi0ezNZ.cjs +1 -0
  12. package/dist/{PagesPanel-PKnqTla9.js → PagesPanel-3KIZEXOS.js} +4 -5
  13. package/dist/{ProjectPanel-hx21JHK8.js → ProjectPanel-0W6XTu0Y.js} +5 -6
  14. package/dist/ProjectPanel-fEYrObPB.cjs +1 -0
  15. package/dist/{Settings-3omes6Yj.js → Settings-ifUbqcam.js} +4 -5
  16. package/dist/Settings-kDwumlBm.cjs +1 -0
  17. package/dist/{SidePanels-vNc0pvVt.js → SidePanels-0P4IaIVn.js} +159 -140
  18. package/dist/SidePanels-JIuL8NLu.cjs +1 -0
  19. package/dist/{BrandingOptions-z7hXgff2.js → ThemeConfiguration-7Hef-UKR.js} +42 -41
  20. package/dist/ThemeConfiguration-CcUA1_9A.cjs +1 -0
  21. package/dist/{Topbar-c3HIPa_q.js → Topbar-0hOp8tE7.js} +3 -4
  22. package/dist/Topbar-Wte9Jbw7.cjs +1 -0
  23. package/dist/UILibrariesPanel-qgwFZYvn.js +145 -0
  24. package/dist/UILibrariesPanel-vXOD3qRz.cjs +1 -0
  25. package/dist/UnsplashImages-Cfq1lKeC.cjs +1 -0
  26. package/dist/{UnsplashImages-IQo081nF.js → UnsplashImages-qUDa1vAS.js} +3 -4
  27. package/dist/{UploadImages-BAy3wsRT.js → UploadImages-Xh-lPuZy.js} +3 -4
  28. package/dist/UploadImages-Zle03BGi.cjs +1 -0
  29. package/dist/add-page-modal-0jmyeD0x.cjs +1 -0
  30. package/dist/{add-page-modal-WWRdRyDM.js → add-page-modal-ued8fkUY.js} +16 -17
  31. package/dist/{confirm-alert-h4RiwjkJ.js → confirm-alert-4kucBgrO.js} +3 -4
  32. package/dist/{confirm-alert-LvvLsCWh.cjs → confirm-alert-rucvO9GC.cjs} +1 -1
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.d.ts +22 -3
  35. package/dist/core.js +44 -45
  36. package/dist/delete-page-modal-Eym3aZzC.cjs +1 -0
  37. package/dist/{delete-page-modal-XymJxo7r.js → delete-page-modal-kxeOpfNd.js} +4 -5
  38. package/dist/email.cjs +1 -1
  39. package/dist/email.d.ts +22 -3
  40. package/dist/email.js +3 -4
  41. package/dist/{form-P0nEC3WH.js → form-2Veryr30.js} +1 -1
  42. package/dist/{form-I4uC5vkq.cjs → form-pdF1XhvW.cjs} +1 -1
  43. package/dist/{index-SP6aKHPH.js → index-OdzdznTv.js} +2 -2
  44. package/dist/{index-mVQVs_cP.cjs → index-SQ1sNajH.cjs} +1 -1
  45. package/dist/{page-viewer-OSlqdbEV.js → page-viewer-6qv40Sm2.js} +5 -6
  46. package/dist/page-viewer-qr3NscoT.cjs +1 -0
  47. package/dist/{project-general-setting-LXfl5i5Z.js → project-general-setting-GVzAsfrk.js} +5 -6
  48. package/dist/{project-general-setting-JR9L7fMQ.cjs → project-general-setting-fm1YfS_2.cjs} +1 -1
  49. package/dist/{project-seo-setting-cVDCPjBD.cjs → project-seo-setting-06jt9oDD.cjs} +1 -1
  50. package/dist/{project-seo-setting-lyzUUxe2.js → project-seo-setting-iPqsGKuc.js} +4 -5
  51. package/dist/{single-page-detail-GeG-SXWn.js → single-page-detail-GVtRl8Pt.js} +6 -7
  52. package/dist/single-page-detail-KQVwWJ-J.cjs +1 -0
  53. package/dist/studio.cjs +1 -1
  54. package/dist/studio.d.ts +22 -3
  55. package/dist/studio.js +3 -4
  56. package/dist/ui.cjs +1 -1
  57. package/dist/ui.d.ts +1 -1
  58. package/dist/ui.js +138 -139
  59. package/dist/{useCanvasSettings-_EzUaA9P.js → useCanvasSettings-E5uIyvUR.js} +1 -1
  60. package/dist/{useCanvasSettings-bP_V0UR2.cjs → useCanvasSettings-yYU51FJ3.cjs} +1 -1
  61. package/package.json +2 -2
  62. package/dist/AddBlocks-G9pjsIyq.cjs +0 -1
  63. package/dist/AddBlocks-dljjAE5r.js +0 -210
  64. package/dist/BrandingOptions-N7iDaMgM.cjs +0 -1
  65. package/dist/CurrentPage-LaeYQ-Ke.cjs +0 -1
  66. package/dist/ListTree-_7e5p_e3.cjs +0 -1
  67. package/dist/PagesPanel-BsELxMie.cjs +0 -1
  68. package/dist/ProjectPanel-1aAFwguw.cjs +0 -1
  69. package/dist/Settings-tYjuuUgX.cjs +0 -1
  70. package/dist/SidePanels-7WG6SXw0.cjs +0 -1
  71. package/dist/Topbar-1zU6Ljsn.cjs +0 -1
  72. package/dist/UnsplashImages-zCQkmow-.cjs +0 -1
  73. package/dist/UploadImages-6K3GdM-b.cjs +0 -1
  74. package/dist/add-page-modal-8FJnOckX.cjs +0 -1
  75. package/dist/delete-page-modal-IRX0oKZJ.cjs +0 -1
  76. package/dist/page-viewer-fonOyiuT.cjs +0 -1
  77. package/dist/single-page-detail-LL8m0Va7.cjs +0 -1
@@ -1,30 +1,30 @@
1
- var Fe = Object.defineProperty;
2
- var Pe = (o, s, e) => s in o ? Fe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
3
- var A = (o, s, e) => (Pe(o, typeof s != "symbol" ? s + "" : s, e), e);
1
+ var Pe = Object.defineProperty;
2
+ var He = (o, s, e) => s in o ? Pe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
3
+ var _ = (o, s, e) => (He(o, typeof s != "symbol" ? s + "" : s, e), e);
4
4
  import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
- import _, { createElement as se, useCallback as P, useState as j, useEffect as k, Component as ue, Children as He, Suspense as he, useRef as ne, useMemo as Oe } from "react";
6
- import { map as F, includes as oe, toUpper as Y, round as ze, noop as T, has as Q, throttle as me, isEmpty as S, first as U, omit as Ue, pick as We, get as f, isString as G, memoize as qe, each as Ke, find as Ye, filter as ge, isNull as Je } from "lodash-es";
7
- import { ResetIcon as re, MobileIcon as ie, LaptopIcon as Qe, DesktopIcon as Ze, DotsVerticalIcon as Xe, EraserIcon as Ge, ZoomInIcon as Ve, DragHandleDots2Icon as et, ArrowUpIcon as tt, CopyIcon as st, TrashIcon as nt } from "@radix-ui/react-icons";
8
- import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as ot, at as rt, au as it, o as V, X as at, h as O, av as lt, aw as ct, ax as dt, ay as pt, az as ut, aA as ht, aB as mt, L as C, Y as N, A as gt, a as ft, b as xt, c as vt, d as $t, e as yt, f as bt, g as kt, a3 as wt, aC as jt, p as ye, ap as z, m as Ct, aD as Bt, z as M, Q as St, aE as L, aF as It, i as ee, w as be, E as ke, H as we, V as Dt, aG as At, aH as je, aI as _t, aJ as Nt, F as Mt, aK as Et, aL as Tt, aM as Lt, M as Rt, aN as Ft, ah as Ce, a2 as Pt } from "./ChaiBuilderEditor-vzyVasJe.js";
5
+ import A, { createElement as se, useCallback as H, useState as j, useEffect as k, Component as ue, Children as Oe, Suspense as he, useRef as ne, useMemo as ze } from "react";
6
+ import { map as P, includes as oe, toUpper as Y, round as Ue, noop as T, has as Q, throttle as me, isEmpty as D, first as U, omit as We, pick as qe, get as f, isString as G, memoize as Ke, each as Ye, find as Je, filter as ge, isNull as Qe } from "lodash-es";
7
+ import { ResetIcon as re, MobileIcon as ie, LaptopIcon as Ze, DesktopIcon as Xe, DotsVerticalIcon as Ge, EraserIcon as Ve, ZoomInIcon as et, DragHandleDots2Icon as tt, ArrowUpIcon as st, CopyIcon as nt, TrashIcon as ot } from "@radix-ui/react-icons";
8
+ import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as rt, at as it, au as at, o as V, X as lt, h as L, av as ct, aw as dt, ax as pt, ay as ut, az as ht, aA as mt, aB as gt, L as C, Y as N, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as ye, ap as z, m as Bt, aD as Dt, z as M, Q as It, aE as R, aF as St, i as ee, w as be, E as ke, H as we, V as _t, aG as At, aH as je, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Rt, M as Ft, aN as Pt, ah as Ce, a2 as Ht } from "./ChaiBuilderEditor-wfEkvtJ0.js";
9
9
  import { useTranslation as q } from "react-i18next";
10
10
  import { useAtom as y } from "jotai";
11
- import { SparklesIcon as Ht } from "lucide-react";
11
+ import { SparklesIcon as Ot } from "lucide-react";
12
12
  import ae from "react-dom";
13
13
  import b from "prop-types";
14
- import { Quill as Ot } from "react-quill";
14
+ import { Quill as zt } from "react-quill";
15
15
  import { useFeature as Be } from "flagged";
16
- import { flip as zt } from "@floating-ui/dom";
17
- import { useFloating as Ut, shift as Wt } from "@floating-ui/react-dom";
18
- import { useResizeObserver as qt } from "@react-hookz/web";
19
- import Kt from "@tailwindcss/typography";
20
- import Yt from "@tailwindcss/forms";
21
- import Jt from "@tailwindcss/aspect-ratio";
22
- import Qt from "tailwindcss-palette-generator";
23
- import { Provider as Zt } from "react-wrap-balancer";
24
- import { twMerge as Xt } from "tailwind-merge";
25
- import { S as le, a as Se } from "./STRINGS--j49GZJP.js";
26
- import { getBlockComponent as Gt } from "@chaibuilder/runtime";
27
- import { u as Vt } from "./useCanvasSettings-_EzUaA9P.js";
16
+ import { flip as Ut } from "@floating-ui/dom";
17
+ import { useFloating as Wt, shift as qt } from "@floating-ui/react-dom";
18
+ import { useResizeObserver as Kt } from "@react-hookz/web";
19
+ import Yt from "@tailwindcss/typography";
20
+ import Jt from "@tailwindcss/forms";
21
+ import Qt from "@tailwindcss/aspect-ratio";
22
+ import Zt from "tailwindcss-palette-generator";
23
+ import { Provider as Xt } from "react-wrap-balancer";
24
+ import { twMerge as Gt } from "tailwind-merge";
25
+ import { S as le, a as De } from "./STRINGS--j49GZJP.js";
26
+ import { getBlockComponent as Vt } from "@chaibuilder/runtime";
27
+ import { u as es } from "./useCanvasSettings-E5uIyvUR.js";
28
28
  import "./_commonjsHelpers-UyOWmZb0.js";
29
29
  import "clsx";
30
30
  import "@radix-ui/react-scroll-area";
@@ -53,15 +53,14 @@ import "cmdk";
53
53
  import "@radix-ui/react-context-menu";
54
54
  import "react-icons-picker";
55
55
  import "react-hotkeys-hook";
56
- import "lodash";
57
- const es = () => {
56
+ const ts = () => {
58
57
  const { hasUndo: o, hasRedo: s, undo: e, redo: t } = fe();
59
58
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
60
59
  /* @__PURE__ */ r.jsx(W, { disabled: !o(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, {}) }),
61
60
  /* @__PURE__ */ r.jsx(W, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, { className: "rotate-180 scale-y-[-1] transform" }) })
62
61
  ] });
63
62
  };
64
- function ts() {
63
+ function ss() {
65
64
  const [o, s] = xe(), { t: e } = q();
66
65
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
67
66
  /* @__PURE__ */ r.jsx(ve, { htmlFor: "dark-mode-switch", children: e("dark_mode") }),
@@ -113,7 +112,7 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
113
112
  )
114
113
  ]
115
114
  }
116
- ), ss = [
115
+ ), ns = [
117
116
  {
118
117
  title: "mobile_xs_title",
119
118
  content: "mobile_xs_content",
@@ -146,14 +145,14 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
146
145
  title: "desktop_xl_title",
147
146
  content: "desktop_xl_content",
148
147
  breakpoint: "xl",
149
- icon: /* @__PURE__ */ r.jsx(Qe, {}),
148
+ icon: /* @__PURE__ */ r.jsx(Ze, {}),
150
149
  width: 1420
151
150
  },
152
151
  {
153
152
  title: "large_desktop_2xl_title",
154
153
  content: "large_desktop_2xl_content",
155
154
  breakpoint: "2xl",
156
- icon: /* @__PURE__ */ r.jsx(Ze, {}),
155
+ icon: /* @__PURE__ */ r.jsx(Xe, {}),
157
156
  width: 1920
158
157
  }
159
158
  ], de = ({
@@ -166,8 +165,8 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
166
165
  onClick: a
167
166
  }) => {
168
167
  const { t: i } = q();
169
- return /* @__PURE__ */ r.jsxs(ot, { children: [
170
- /* @__PURE__ */ r.jsx(rt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
168
+ return /* @__PURE__ */ r.jsxs(rt, { children: [
169
+ /* @__PURE__ */ r.jsx(it, { asChild: !0, children: /* @__PURE__ */ r.jsx(
171
170
  W,
172
171
  {
173
172
  onClick: () => a(n),
@@ -176,27 +175,27 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
176
175
  children: d
177
176
  }
178
177
  ) }),
179
- /* @__PURE__ */ r.jsx(it, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
178
+ /* @__PURE__ */ r.jsx(at, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
180
179
  /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: i(o) }),
181
180
  /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
182
181
  ] }) }) })
183
182
  ] });
184
- }, ns = () => {
185
- const [, o, s] = V(), [e, t] = at(), { t: n } = q(), d = O("breakpoints", ss), a = (i) => {
183
+ }, os = () => {
184
+ const [, o, s] = V(), [e, t] = lt(), { t: n } = q(), d = L("breakpoints", ns), a = (i) => {
186
185
  e.includes(i) ? e.length > 2 && t(e.filter((l) => l !== i)) : t((l) => [...l, i]);
187
186
  };
188
- return d.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: F(d, (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
189
- F(
187
+ return d.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: P(d, (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
188
+ P(
190
189
  d.filter((i) => oe(e, Y(i.breakpoint))),
191
190
  (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })
192
191
  ),
193
- /* @__PURE__ */ r.jsxs(lt, { children: [
194
- /* @__PURE__ */ r.jsx(ct, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Xe, { className: "scale-90 transform" }) }) }),
195
- /* @__PURE__ */ r.jsxs(dt, { className: "w-56 border-border text-xs", children: [
196
- /* @__PURE__ */ r.jsx(pt, { children: n("Breakpoints") }),
197
- /* @__PURE__ */ r.jsx(ut, {}),
198
- F(d, (i) => /* @__PURE__ */ r.jsx(
199
- ht,
192
+ /* @__PURE__ */ r.jsxs(ct, { children: [
193
+ /* @__PURE__ */ r.jsx(dt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ge, { className: "scale-90 transform" }) }) }),
194
+ /* @__PURE__ */ r.jsxs(pt, { className: "w-56 border-border text-xs", children: [
195
+ /* @__PURE__ */ r.jsx(ut, { children: n("Breakpoints") }),
196
+ /* @__PURE__ */ r.jsx(ht, {}),
197
+ P(d, (i) => /* @__PURE__ */ r.jsx(
198
+ mt,
200
199
  {
201
200
  disabled: i.breakpoint === "xs",
202
201
  onCheckedChange: () => a(Y(i.breakpoint)),
@@ -208,32 +207,32 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
208
207
  ] })
209
208
  ] })
210
209
  ] });
211
- }, os = () => {
212
- const { t: o } = q(), { setNewBlocks: s } = mt(), [, e] = C(), [, t] = N(), n = P(() => {
210
+ }, rs = () => {
211
+ const { t: o } = q(), { setNewBlocks: s } = gt(), [, e] = C(), [, t] = N(), n = H(() => {
213
212
  s([]), e([]), t([]);
214
213
  }, [s]);
215
- return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(gt, { children: [
216
- /* @__PURE__ */ r.jsx(ft, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
217
- /* @__PURE__ */ r.jsx(Ge, {}),
214
+ return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(ft, { children: [
215
+ /* @__PURE__ */ r.jsx(xt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
216
+ /* @__PURE__ */ r.jsx(Ve, {}),
218
217
  " ",
219
218
  o("clear")
220
219
  ] }) }),
221
- /* @__PURE__ */ r.jsxs(xt, { className: "border-border", children: [
222
- /* @__PURE__ */ r.jsxs(vt, { children: [
223
- /* @__PURE__ */ r.jsx($t, { children: o("clear_canvas_title") }),
224
- /* @__PURE__ */ r.jsx(yt, { children: o("clear_canvas_description") })
220
+ /* @__PURE__ */ r.jsxs(vt, { className: "border-border", children: [
221
+ /* @__PURE__ */ r.jsxs($t, { children: [
222
+ /* @__PURE__ */ r.jsx(yt, { children: o("clear_canvas_title") }),
223
+ /* @__PURE__ */ r.jsx(bt, { children: o("clear_canvas_description") })
225
224
  ] }),
226
- /* @__PURE__ */ r.jsxs(bt, { children: [
227
- /* @__PURE__ */ r.jsx(kt, { children: o("cancel") }),
228
- /* @__PURE__ */ r.jsx(wt, { onClick: n, children: o("yes") })
225
+ /* @__PURE__ */ r.jsxs(kt, { children: [
226
+ /* @__PURE__ */ r.jsx(wt, { children: o("cancel") }),
227
+ /* @__PURE__ */ r.jsx(jt, { onClick: n, children: o("yes") })
229
228
  ] })
230
229
  ] })
231
230
  ] }) });
232
- }, rs = () => {
233
- const [o, s] = y(jt);
234
- return O("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
231
+ }, is = () => {
232
+ const [o, s] = y(Ct);
233
+ return L("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
235
234
  /* @__PURE__ */ r.jsxs(ve, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
236
- /* @__PURE__ */ r.jsx(Ht, { className: "w-4" }),
235
+ /* @__PURE__ */ r.jsx(Ot, { className: "w-4" }),
237
236
  "AI Assistant"
238
237
  ] }),
239
238
  /* @__PURE__ */ r.jsx(
@@ -248,35 +247,35 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
248
247
  }
249
248
  )
250
249
  ] }) : null;
251
- }, is = () => {
252
- const o = O("darkMode", !1), [s] = ye();
250
+ }, as = () => {
251
+ const o = L("darkMode", !1), [s] = ye();
253
252
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
254
253
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
255
254
  o ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
256
- /* @__PURE__ */ r.jsx(ts, {}),
255
+ /* @__PURE__ */ r.jsx(ss, {}),
257
256
  /* @__PURE__ */ r.jsx(z, { orientation: "vertical" })
258
257
  ] }) : null,
259
- /* @__PURE__ */ r.jsx(ns, {}),
258
+ /* @__PURE__ */ r.jsx(os, {}),
260
259
  /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
261
- /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
262
- /* @__PURE__ */ r.jsx(Ve, { className: "h-3.5 w-3.5 flex-shrink-0" }),
260
+ /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
261
+ /* @__PURE__ */ r.jsx(et, { className: "h-3.5 w-3.5 flex-shrink-0" }),
263
262
  " ",
264
263
  /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
265
- ze(s, 0),
264
+ Ue(s, 0),
266
265
  "%"
267
266
  ] })
268
267
  ] }),
269
268
  /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
270
- /* @__PURE__ */ r.jsx(es, {})
269
+ /* @__PURE__ */ r.jsx(ts, {})
271
270
  ] }),
272
271
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
273
- /* @__PURE__ */ r.jsx(os, {}),
272
+ /* @__PURE__ */ r.jsx(rs, {}),
274
273
  /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
275
- /* @__PURE__ */ r.jsx(rs, {})
274
+ /* @__PURE__ */ r.jsx(is, {})
276
275
  ] })
277
276
  ] });
278
- }, as = `<!doctype html>
279
- <html lang="en" class="scroll-smooth h-full overflow-y-auto">
277
+ }, ls = `<!doctype html>
278
+ <html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
280
279
  <head>
281
280
  <meta charset="UTF-8">
282
281
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -323,8 +322,8 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
323
322
  <div class="frame-root h-full"></div>
324
323
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
325
324
  </body>
326
- </html>`, ls = (o) => {
327
- const [s] = V(), [, e] = ye(), [t, n] = j({}), d = P(() => {
325
+ </html>`, cs = (o) => {
326
+ const [s] = V(), [, e] = ye(), [t, n] = j({}), d = H(() => {
328
327
  const { width: a, height: i } = o;
329
328
  if (a < s) {
330
329
  const l = parseFloat((a / s).toFixed(2).toString());
@@ -348,11 +347,11 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
348
347
  d();
349
348
  }, [s, o, e, d]), t;
350
349
  };
351
- let Ie, De;
350
+ let Ie, Se;
352
351
  typeof document < "u" && (Ie = document);
353
- typeof window < "u" && (De = window);
354
- const Ae = _.createContext({ document: Ie, window: De }), K = () => _.useContext(Ae), { Provider: cs, Consumer: Rn } = Ae;
355
- class _e extends ue {
352
+ typeof window < "u" && (Se = window);
353
+ const _e = A.createContext({ document: Ie, window: Se }), K = () => A.useContext(_e), { Provider: ds, Consumer: Rn } = _e;
354
+ class Ae extends ue {
356
355
  componentDidMount() {
357
356
  this.props.contentDidMount();
358
357
  }
@@ -360,10 +359,10 @@ class _e extends ue {
360
359
  this.props.contentDidUpdate();
361
360
  }
362
361
  render() {
363
- return He.only(this.props.children);
362
+ return Oe.only(this.props.children);
364
363
  }
365
364
  }
366
- A(_e, "propTypes", {
365
+ _(Ae, "propTypes", {
367
366
  children: b.element.isRequired,
368
367
  contentDidMount: b.func.isRequired,
369
368
  contentDidUpdate: b.func.isRequired
@@ -371,20 +370,20 @@ A(_e, "propTypes", {
371
370
  class Z extends ue {
372
371
  constructor(e, t) {
373
372
  super(e, t);
374
- A(this, "setRef", (e) => {
373
+ _(this, "setRef", (e) => {
375
374
  this.nodeRef.current = e;
376
375
  const { forwardedRef: t } = this.props;
377
376
  typeof t == "function" ? t(e) : t && (t.current = e);
378
377
  });
379
- A(this, "handleLoad", () => {
378
+ _(this, "handleLoad", () => {
380
379
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
381
380
  });
382
381
  // In certain situations on a cold cache DOMContentLoaded never gets called
383
382
  // fallback to an interval to check if that's the case
384
- A(this, "loadCheck", () => setInterval(() => {
383
+ _(this, "loadCheck", () => setInterval(() => {
385
384
  this.handleLoad();
386
385
  }, 500));
387
- this._isMounted = !1, this.nodeRef = _.createRef(), this.state = { iframeLoaded: !1 };
386
+ this._isMounted = !1, this.nodeRef = A.createRef(), this.state = { iframeLoaded: !1 };
388
387
  }
389
388
  componentDidMount() {
390
389
  this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
@@ -405,7 +404,7 @@ class Z extends ue {
405
404
  const e = this.getDoc();
406
405
  if (!e)
407
406
  return null;
408
- const t = this.props.contentDidMount, n = this.props.contentDidUpdate, d = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(_e, { contentDidMount: t, contentDidUpdate: n, children: /* @__PURE__ */ r.jsx(cs, { value: { document: e, window: d }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
407
+ const t = this.props.contentDidMount, n = this.props.contentDidUpdate, d = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(Ae, { contentDidMount: t, contentDidUpdate: n, children: /* @__PURE__ */ r.jsx(ds, { value: { document: e, window: d }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
409
408
  return [ae.createPortal(this.props.head, this.getDoc().head), ae.createPortal(a, i)];
410
409
  }
411
410
  render() {
@@ -422,7 +421,7 @@ class Z extends ue {
422
421
  // also inject into the body and can mess up React. For this reason
423
422
  // initialContent is expected to have a div inside of the body
424
423
  // element that we render react into.
425
- A(Z, "propTypes", {
424
+ _(Z, "propTypes", {
426
425
  style: b.object,
427
426
  // eslint-disable-line
428
427
  head: b.node,
@@ -431,7 +430,7 @@ A(Z, "propTypes", {
431
430
  contentDidMount: b.func,
432
431
  contentDidUpdate: b.func,
433
432
  children: b.oneOfType([b.element, b.arrayOf(b.element)])
434
- }), A(Z, "defaultProps", {
433
+ }), _(Z, "defaultProps", {
435
434
  style: {},
436
435
  head: null,
437
436
  children: void 0,
@@ -442,9 +441,9 @@ A(Z, "propTypes", {
442
441
  },
443
442
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
444
443
  });
445
- const ds = _.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef: s })), ps = () => {
446
- const { addCoreBlock: o } = Ct(), s = O("getExternalPredefinedBlock", T);
447
- return P(
444
+ const ps = A.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef: s })), us = () => {
445
+ const { addCoreBlock: o } = Bt(), s = L("getExternalPredefinedBlock", T);
446
+ return H(
448
447
  async (e) => {
449
448
  const { block: t, dropTargetId: n, relativeIndex: d } = e;
450
449
  if (Q(t, "format")) {
@@ -456,28 +455,28 @@ const ds = _.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef:
456
455
  [o]
457
456
  );
458
457
  };
459
- let B = null, H = [], R = null, Ne = null;
460
- function us(o) {
458
+ let B = null, O = [], F = null, Ne = null;
459
+ function hs(o) {
461
460
  const s = window.getComputedStyle(o), e = parseInt(s.paddingLeft, 10), t = parseInt(s.paddingTop, 10), n = parseInt(s.paddingRight, 10), d = parseInt(s.paddingBottom, 10);
462
461
  return { paddingLeft: e, paddingTop: t, paddingRight: n, paddingBottom: d };
463
462
  }
464
463
  const pe = (o, s, e) => {
465
464
  if (!B)
466
465
  return;
467
- const t = o.getBoundingClientRect(), n = B == null ? void 0 : B.getElementById("placeholder"), { paddingLeft: d, paddingTop: a, paddingRight: i, paddingBottom: l } = us(o);
466
+ const t = o.getBoundingClientRect(), n = B == null ? void 0 : B.getElementById("placeholder"), { paddingLeft: d, paddingTop: a, paddingRight: i, paddingBottom: l } = hs(o);
468
467
  n.style.width = s === "vertical" ? t.width - d - i + "px" : "2px", n.style.height = s === "vertical" ? "2px" : t.height - a - l + "px", n.style.display = "block";
469
- const c = H.reduce(
468
+ const c = O.reduce(
470
469
  (p, m) => Math.abs(m - e) < Math.abs(p - e) ? m : p
471
470
  );
472
- Ne = H.indexOf(c), s === "vertical" ? (n.style.top = o.offsetTop + c + "px", n.style.left = o.offsetLeft + d + "px") : (n.style.top = o.offsetTop + a + "px", n.style.left = o.offsetLeft + c + "px");
473
- }, hs = (o) => {
471
+ Ne = O.indexOf(c), s === "vertical" ? (n.style.top = o.offsetTop + c + "px", n.style.left = o.offsetLeft + d + "px") : (n.style.top = o.offsetTop + a + "px", n.style.left = o.offsetLeft + c + "px");
472
+ }, ms = (o) => {
474
473
  const s = Me(o), e = window.getComputedStyle(o), t = s === "horizontal", n = parseInt(e.paddingLeft), d = parseInt(e.paddingTop);
475
474
  let a = t ? n : d;
476
- H = [a], Array.from(o.children).forEach((i) => {
475
+ O = [a], Array.from(o.children).forEach((i) => {
477
476
  const l = window.getComputedStyle(i), c = parseInt(
478
477
  t ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
479
478
  ), p = t ? i.offsetWidth : i.offsetHeight;
480
- H.push(a + p + c), a += p + c;
479
+ O.push(a + p + c), a += p + c;
481
480
  });
482
481
  };
483
482
  function Me(o) {
@@ -493,7 +492,7 @@ function Me(o) {
493
492
  }
494
493
  return s === "block" ? "vertical" : "horizontal";
495
494
  }
496
- const ms = me((o) => {
495
+ const gs = me((o) => {
497
496
  const s = o.target, e = Me(s);
498
497
  if (e === "vertical") {
499
498
  const t = o.clientY - s.offsetTop;
@@ -502,21 +501,21 @@ const ms = me((o) => {
502
501
  const t = o.clientX - s.offsetLeft;
503
502
  pe(s, e, t);
504
503
  }
505
- }, 200), gs = (o) => {
506
- o.preventDefault(), o.stopPropagation(), ms(o);
504
+ }, 200), fs = (o) => {
505
+ o.preventDefault(), o.stopPropagation(), gs(o);
507
506
  };
508
507
  function J() {
509
508
  const o = B == null ? void 0 : B.getElementById("placeholder");
510
509
  o.style.display = "none";
511
510
  }
512
- const fs = () => {
513
- const { document: o } = K(), [s, e] = y(Bt), t = ps(), n = Be("dnd"), [, d] = M(), [, a] = C();
511
+ const xs = () => {
512
+ const { document: o } = K(), [s, e] = y(Dt), t = us(), n = Be("dnd"), [, d] = M(), [, a] = C();
514
513
  return B = o, {
515
514
  isDragging: s,
516
515
  "data-dnd": "branch",
517
- onDragOver: n ? gs : T,
516
+ onDragOver: n ? fs : T,
518
517
  onDrop: n ? (i) => {
519
- R == null || R.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
518
+ F == null || F.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
520
519
  const l = JSON.parse(i.dataTransfer.getData("text/plain"));
521
520
  let c = i.target.getAttribute("data-block-id");
522
521
  c === null && (c = i.target.parentElement.getAttribute("data-block-id")), t({ block: l, dropTargetId: c || null, relativeIndex: Ne }), e(!1), J(), setTimeout(() => {
@@ -525,13 +524,13 @@ const fs = () => {
525
524
  } : T,
526
525
  onDragEnter: n ? (i) => {
527
526
  const l = i;
528
- R = l.target, l.stopPropagation(), l.preventDefault(), H = [];
527
+ F = l.target, l.stopPropagation(), l.preventDefault(), O = [];
529
528
  const c = l.target;
530
- hs(c), c.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), e(!0), d(""), a([]);
529
+ ms(c), c.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), e(!0), d(""), a([]);
531
530
  } : T,
532
531
  onDragLeave: n ? (i) => {
533
532
  const l = i;
534
- R = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
533
+ F = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
535
534
  } : T,
536
535
  onMouseOut: n ? () => {
537
536
  e(!1), J();
@@ -541,13 +540,13 @@ const fs = () => {
541
540
  function te(o) {
542
541
  return o.getAttribute("data-block-id") ? o : o.closest("[data-block-id]");
543
542
  }
544
- function xs(o) {
543
+ function vs(o) {
545
544
  o.container.innerHTML = "", o.container.parentNode.removeChild(o.container);
546
545
  var s = document.querySelector(".ql-toolbar");
547
546
  s && s.parentNode.removeChild(s), o = null;
548
547
  }
549
- const vs = () => {
550
- const o = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = St(), [, e] = M(), [t, n] = y(L);
548
+ const $s = () => {
549
+ const o = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = It(), [, e] = M(), [t, n] = y(R);
551
550
  return (d) => {
552
551
  var m;
553
552
  if (t)
@@ -559,17 +558,17 @@ const vs = () => {
559
558
  a.style.display = "none", Array.from(l.attributes).forEach((h) => {
560
559
  h.name !== "class" && l.removeAttribute(h.name);
561
560
  }), i === "Text" && (l.style.display = "inline-block"), a.parentNode.insertBefore(l, a.nextSibling);
562
- const c = new Ot(l, { placeholder: "Type here..." });
561
+ const c = new zt(l, { placeholder: "Type here..." });
563
562
  function p() {
564
563
  const h = c.getText(0, c.getLength());
565
- s([a.getAttribute("data-block-id")], { content: h }), a.removeAttribute("style"), l.removeEventListener("blur", p, !0), xs(c), n(""), e("");
564
+ s([a.getAttribute("data-block-id")], { content: h }), a.removeAttribute("style"), l.removeEventListener("blur", p, !0), vs(c), n(""), e("");
566
565
  }
567
566
  l.addEventListener("blur", p, !0), l.addEventListener("keydown", (h) => {
568
567
  (h.key === "Enter" || h.key === "Escape") && p();
569
568
  }), c.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), n(a.getAttribute("data-block-id"));
570
569
  };
571
- }, $s = () => {
572
- const [, o] = N(), [, s] = C(), [, e] = M(), [t] = y(L), [n] = y(It);
570
+ }, ys = () => {
571
+ const [, o] = N(), [, s] = C(), [, e] = M(), [t] = y(R), [n] = y(St);
573
572
  return (d) => {
574
573
  if (t)
575
574
  return;
@@ -586,19 +585,19 @@ const vs = () => {
586
585
  a != null && a.getAttribute("data-block-id") && s([a.getAttribute("data-block-id")]);
587
586
  e("");
588
587
  };
589
- }, ys = me((o, s) => {
588
+ }, bs = me((o, s) => {
590
589
  const e = te(o.target);
591
590
  e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
592
- }, 100), bs = () => {
593
- const [, o] = M(), [s] = y(L);
591
+ }, 100), ks = () => {
592
+ const [, o] = M(), [s] = y(R);
594
593
  return (e) => {
595
- s || ys(e, o);
594
+ s || bs(e, o);
596
595
  };
597
- }, ks = ({ children: o }) => {
596
+ }, ws = ({ children: o }) => {
598
597
  const { document: s } = K(), [e] = C(), [t, n] = N();
599
598
  k(() => {
600
599
  setTimeout(() => {
601
- if (!S(t))
600
+ if (!D(t))
602
601
  return;
603
602
  const c = Ee(s, U(e));
604
603
  if (c) {
@@ -610,7 +609,7 @@ const vs = () => {
610
609
  }
611
610
  }, 100);
612
611
  }, [s, e, n, t]);
613
- const d = vs(), a = $s(), i = bs(), l = fs();
612
+ const d = $s(), a = ys(), i = ks(), l = xs();
614
613
  return /* @__PURE__ */ r.jsx(
615
614
  "div",
616
615
  {
@@ -619,13 +618,13 @@ const vs = () => {
619
618
  onClick: a,
620
619
  onDoubleClick: d,
621
620
  onMouseMove: i,
622
- ...Ue(l, "isDragging"),
621
+ ...We(l, "isDragging"),
623
622
  className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
624
623
  children: o
625
624
  }
626
625
  );
627
- }, Ee = (o, s) => o.querySelector(`[data-block-id="${s}"]`), ws = () => {
628
- const { window: o } = K(), [s, e] = C(), [t] = ee(), [, n] = N(), { undo: d, redo: a } = fe(), i = be(), [, l] = ke(), c = we(), { savePage: p } = Dt(), [m] = y(L), [, h] = y(At), v = (g) => {
626
+ }, Ee = (o, s) => o.querySelector(`[data-block-id="${s}"]`), js = () => {
627
+ const { window: o } = K(), [s, e] = C(), [t] = ee(), [, n] = N(), { undo: d, redo: a } = fe(), i = be(), [, l] = ke(), c = we(), { savePage: p } = _t(), [m] = y(R), [, h] = y(At), v = (g) => {
629
628
  g.key === "Enter" && (g.preventDefault(), s.length === 1 && h(U(s)));
630
629
  }, w = (g) => {
631
630
  const u = t.find(($) => $._id === g);
@@ -655,7 +654,7 @@ const vs = () => {
655
654
  o.removeEventListener("keydown", g);
656
655
  };
657
656
  }, [s, e, d, c, l, a, i, m, p, o]), null;
658
- }, js = ({ block: o, label: s }) => {
657
+ }, Cs = ({ block: o, label: s }) => {
659
658
  const [, e] = C(), [, t] = M(), [, n] = y(je), d = Be("dnd");
660
659
  return /* @__PURE__ */ r.jsxs(
661
660
  "div",
@@ -663,26 +662,26 @@ const vs = () => {
663
662
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
664
663
  draggable: d ? "true" : "false",
665
664
  onDragStart: (a) => {
666
- a.dataTransfer.setData("text/plain", JSON.stringify(We(o, ["_id", "_type"]))), n(o._id), setTimeout(() => {
665
+ a.dataTransfer.setData("text/plain", JSON.stringify(qe(o, ["_id", "_type"]))), n(o._id), setTimeout(() => {
667
666
  e([]), t(null);
668
667
  }, 200);
669
668
  },
670
669
  children: [
671
- /* @__PURE__ */ r.jsx(et, {}),
670
+ /* @__PURE__ */ r.jsx(tt, {}),
672
671
  s
673
672
  ]
674
673
  }
675
674
  );
676
- }, Cs = ({ selectedBlockElement: o, block: s }) => {
677
- const e = we(), t = be(), [, n] = C(), [, d] = N(), [a] = y(L), { floatingStyles: i, refs: l, update: c } = Ut({
675
+ }, Bs = ({ selectedBlockElement: o, block: s }) => {
676
+ const e = we(), t = be(), [, n] = C(), [, d] = N(), [a] = y(R), { floatingStyles: i, refs: l, update: c } = Wt({
678
677
  placement: "top-start",
679
- middleware: [Wt(), zt()],
678
+ middleware: [qt(), Ut()],
680
679
  elements: {
681
680
  reference: o
682
681
  }
683
682
  });
684
- qt(o, () => c(), o !== null);
685
- const p = f(s, "_parent", null), m = S(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
683
+ Kt(o, () => c(), o !== null);
684
+ const p = f(s, "_parent", null), m = D(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
686
685
  return !o || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
687
686
  "div",
688
687
  {
@@ -696,10 +695,10 @@ const vs = () => {
696
695
  onKeyDown: (h) => h.stopPropagation(),
697
696
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
698
697
  children: [
699
- /* @__PURE__ */ r.jsx(js, { label: m, block: s }),
698
+ /* @__PURE__ */ r.jsx(Cs, { label: m, block: s }),
700
699
  /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
701
700
  p && /* @__PURE__ */ r.jsx(
702
- tt,
701
+ st,
703
702
  {
704
703
  className: "hover:scale-105",
705
704
  onClick: () => {
@@ -707,13 +706,13 @@ const vs = () => {
707
706
  }
708
707
  }
709
708
  ),
710
- _t(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(st, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
711
- Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
709
+ Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
710
+ Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(ot, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
712
711
  ] })
713
712
  ]
714
713
  }
715
714
  ) });
716
- }, Bs = ({ addVariant: o, e: s }) => {
715
+ }, Ds = ({ addVariant: o, e: s }) => {
717
716
  o("hs-dropdown-open", [
718
717
  ({ modifySelectors: e, separator: t }) => {
719
718
  e(({ className: n }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${n}`)}`);
@@ -966,8 +965,8 @@ const vs = () => {
966
965
  }), o("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
967
966
  e(({ className: n }) => `.auto .${s(`hs-auto-mode-active${t}${n}`)}`);
968
967
  });
969
- }, Ss = ({ model: o }) => {
970
- const [s] = Mt(), [e] = C(), [t] = xe(), [n] = M(), [d] = N(), [a] = y(je), { document: i, window: l } = K(), [c] = j(i == null ? void 0 : i.getElementById("highlighted-block")), [p] = j(
968
+ }, Is = ({ model: o }) => {
969
+ const [s] = Et(), [e] = C(), [t] = xe(), [n] = M(), [d] = N(), [a] = y(je), { document: i, window: l } = K(), [c] = j(i == null ? void 0 : i.getElementById("highlighted-block")), [p] = j(
971
970
  i == null ? void 0 : i.getElementById("selected-block")
972
971
  ), [m] = j(
973
972
  i == null ? void 0 : i.getElementById("selected-styling-block")
@@ -977,7 +976,7 @@ const vs = () => {
977
976
  }, [t, i]);
978
977
  const v = f(s, "headingFont", "DM Sans"), w = f(s, "bodyFont", "DM Sans");
979
978
  return k(() => {
980
- const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), $ = Qt([
979
+ const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), $ = Zt([
981
980
  { color: g, name: "primary" },
982
981
  { color: u, name: "secondary" }
983
982
  ]), E = f(s, "roundedCorners", "0");
@@ -995,10 +994,10 @@ const vs = () => {
995
994
  colors: $
996
995
  }
997
996
  },
998
- plugins: [Kt, Yt, Jt, l.tailwind.plugin.withOptions(() => Bs)]
997
+ plugins: [Yt, Jt, Qt, l.tailwind.plugin.withOptions(() => Ds)]
999
998
  });
1000
999
  }, [s, l, v, w]), k(() => {
1001
- p && (p.textContent = `${F(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1000
+ p && (p.textContent = `${P(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1002
1001
  outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1003
1002
  }`);
1004
1003
  }, [e, p]), k(() => {
@@ -1010,7 +1009,7 @@ const vs = () => {
1010
1009
  }, [a]), k(() => {
1011
1010
  c && (c.textContent = n ? `[data-style-id="${n}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1012
1011
  }, [n, e, c]), k(() => {
1013
- m && (m.textContent = `${F(d, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1012
+ m && (m.textContent = `${P(d, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1014
1013
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1015
1014
  }`);
1016
1015
  }, [d, m]), k(() => {
@@ -1045,23 +1044,23 @@ const vs = () => {
1045
1044
  ),
1046
1045
  v && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${v}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}` })
1047
1046
  ] }) : null;
1048
- }, Is = (o) => {
1047
+ }, Ss = (o) => {
1049
1048
  const s = {};
1050
1049
  return Object.keys(o).forEach((e) => {
1051
1050
  G(o[e]) && o[e].startsWith(le) && (s[e] = o[e].replace(le, "").split(","));
1052
1051
  }), s;
1053
- }, Ds = qe((o) => {
1054
- const s = o.replace(Se, "").split(",");
1055
- return Xt(s[0], s[1]);
1052
+ }, _s = Ke((o) => {
1053
+ const s = o.replace(De, "").split(",");
1054
+ return Gt(s[0], s[1]);
1056
1055
  });
1057
1056
  function As(o, s) {
1058
1057
  return f(o, `${s}_attrs`, {});
1059
1058
  }
1060
- function _s(o) {
1059
+ function Ns(o) {
1061
1060
  const s = {};
1062
1061
  return Object.keys(o).forEach((e) => {
1063
- if (G(o[e]) && o[e].startsWith(Se)) {
1064
- const t = Ds(o[e]);
1062
+ if (G(o[e]) && o[e].startsWith(De)) {
1063
+ const t = _s(o[e]);
1065
1064
  s[e] = {
1066
1065
  className: t,
1067
1066
  "data-style-prop": e,
@@ -1072,44 +1071,44 @@ function _s(o) {
1072
1071
  }
1073
1072
  }), s;
1074
1073
  }
1075
- function Ns(o, s) {
1074
+ function Ms(o, s) {
1076
1075
  const e = f(o, "_bindings", {});
1077
- return S(e) ? { ...o } : (Ke(e, (t, n) => {
1076
+ return D(e) ? { ...o } : (Ye(e, (t, n) => {
1078
1077
  G(t) && f(s, t, null) && (o[n] = f(s, t, null));
1079
1078
  }), o);
1080
1079
  }
1081
1080
  function X({ blocks: o }) {
1082
- const [s] = ee(), [e] = Vt(), t = P((i) => _s(i), []), [n] = Et(), [d] = y(L), a = P(
1081
+ const [s] = ee(), [e] = es(), t = H((i) => Ns(i), []), [n] = Tt(), [d] = y(R), a = H(
1083
1082
  (i) => i.reduce((l, c) => {
1084
1083
  const p = f(e, c, {});
1085
1084
  return { ...l, ...p };
1086
1085
  }, {}),
1087
1086
  [e, s]
1088
1087
  );
1089
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: _.Children.toArray(
1088
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: A.Children.toArray(
1090
1089
  o.map((i, l) => {
1091
1090
  if (d === i._id)
1092
1091
  return null;
1093
- const c = Is(i), p = {};
1094
- S(c) || Object.keys(c).forEach((u) => {
1095
- p[u] = _.Children.toArray(
1096
- c[u].map(($) => /* @__PURE__ */ r.jsx(X, { blocks: [Ye(s, { _id: $ })] }))
1092
+ const c = Ss(i), p = {};
1093
+ D(c) || Object.keys(c).forEach((u) => {
1094
+ p[u] = A.Children.toArray(
1095
+ c[u].map(($) => /* @__PURE__ */ r.jsx(X, { blocks: [Je(s, { _id: $ })] }))
1097
1096
  );
1098
1097
  });
1099
1098
  const m = ge(s, { _parent: i._id });
1100
1099
  p.children = m.length ? /* @__PURE__ */ r.jsx(X, { blocks: m }) : null;
1101
- const h = Gt(i._type), v = f(h, "builderComponent", f(h, "component", null));
1102
- if (Je(v))
1100
+ const h = Vt(i._type), v = f(h, "builderComponent", f(h, "component", null));
1101
+ if (Qe(v))
1103
1102
  return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` });
1104
1103
  const w = Q(h, "getBlockStateFrom") ? h == null ? void 0 : h.getBlockStateFrom(i, s) : [], g = a(w);
1105
- return /* @__PURE__ */ r.jsx(he, { children: _.createElement(v, {
1104
+ return /* @__PURE__ */ r.jsx(he, { children: A.createElement(v, {
1106
1105
  blockProps: {
1107
1106
  "data-block-id": i._id,
1108
1107
  "data-block-type": i._type,
1109
1108
  "data-dnd": Q(h, "canAcceptBlock") ? "branch" : "leaf"
1110
1109
  },
1111
1110
  index: l,
1112
- ...Ns(i, n),
1111
+ ...Ms(i, n),
1113
1112
  ...t(i),
1114
1113
  ...p,
1115
1114
  inBuilder: !0,
@@ -1118,28 +1117,28 @@ function X({ blocks: o }) {
1118
1117
  })
1119
1118
  ) });
1120
1119
  }
1121
- const Ms = () => {
1122
- const [o] = ee(), s = S(o) ? null : /* @__PURE__ */ r.jsx(Tt, { children: /* @__PURE__ */ r.jsx(X, { blocks: ge(o, (e) => S(e._parent)) }) });
1123
- return /* @__PURE__ */ r.jsx(Zt, { children: s });
1124
- }, Es = (o, s) => o.querySelector(`[data-style-id="${s}"]`), Ts = () => {
1125
- const [o] = y(Lt), [s] = ke(), [e] = V(), [, t] = C(), n = Rt(), [, d] = M(), a = ne(null), i = ne(null), [l, c] = j({ width: 0, height: 0 }), p = ls(l), [m, h] = j(0), [v, w] = j([]), [, g] = j([]), [, u] = y(Ft), [$, E] = N(), Te = O("loading", !1);
1120
+ const Es = () => {
1121
+ const [o] = ee(), s = D(o) ? null : /* @__PURE__ */ r.jsx(Lt, { children: /* @__PURE__ */ r.jsx(X, { blocks: ge(o, (e) => D(e._parent)) }) });
1122
+ return /* @__PURE__ */ r.jsx(Xt, { children: s });
1123
+ }, Ts = (o, s) => o.querySelector(`[data-style-id="${s}"]`), Ls = () => {
1124
+ const [o] = y(Rt), [s] = ke(), [e] = V(), [, t] = C(), n = Ft(), [, d] = M(), a = ne(null), i = ne(null), [l, c] = j({ width: 0, height: 0 }), p = cs(l), [m, h] = j(0), [v, w] = j([]), [, g] = j([]), [, u] = y(Pt), [$, E] = N(), Te = L("loading", !1), Le = L("htmlDir", "ltr");
1126
1125
  k(() => {
1127
1126
  const { clientWidth: x, clientHeight: I } = i.current;
1128
1127
  c({ width: x, height: I }), m === 0 && h(x);
1129
1128
  }, [i, e, m]);
1130
- const Le = (x, I = 0) => {
1131
- const { top: D } = x.getBoundingClientRect();
1132
- return D + I >= 0 && D - I <= window.innerHeight;
1129
+ const Re = (x, I = 0) => {
1130
+ const { top: S } = x.getBoundingClientRect();
1131
+ return S + I >= 0 && S - I <= window.innerHeight;
1133
1132
  };
1134
1133
  k(() => {
1135
1134
  var x, I;
1136
1135
  if (n && n.type !== "Multiple" && a.current) {
1137
- const D = Ee(a.current.contentDocument, n._id);
1138
- D && (Le(D) || (I = (x = a.current) == null ? void 0 : x.contentWindow) == null || I.scrollTo({ top: D.offsetTop, behavior: "smooth" }), w([D]));
1136
+ const S = Ee(a.current.contentDocument, n._id);
1137
+ S && (Re(S) || (I = (x = a.current) == null ? void 0 : x.contentWindow) == null || I.scrollTo({ top: S.offsetTop, behavior: "smooth" }), w([S]));
1139
1138
  }
1140
1139
  }, [n]), k(() => {
1141
- if (!S($) && a.current) {
1142
- const x = Es(
1140
+ if (!D($) && a.current) {
1141
+ const x = Ts(
1143
1142
  a.current.contentDocument,
1144
1143
  U($).id
1145
1144
  );
@@ -1147,9 +1146,9 @@ const Ms = () => {
1147
1146
  } else
1148
1147
  g([null]);
1149
1148
  }, [$]);
1150
- const Re = Oe(() => {
1151
- let x = as;
1152
- return o === "offline" && (x = x.replace(
1149
+ const Fe = ze(() => {
1150
+ let x = ls;
1151
+ return x = x.replace("__HTML_DIR__", Le), o === "offline" && (x = x.replace(
1153
1152
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1154
1153
  "/offline/tailwind.cdn.js"
1155
1154
  ), x = x.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), x = x.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), x;
@@ -1162,28 +1161,28 @@ const Ms = () => {
1162
1161
  },
1163
1162
  onMouseLeave: () => setTimeout(() => d(""), 300),
1164
1163
  className: "relative mx-auto h-full w-full overflow-hidden",
1165
- style: m > 0 && !S(p) ? { width: s ? "100%" : m } : {},
1164
+ style: m > 0 && !D(p) ? { width: s ? "100%" : m } : {},
1166
1165
  ref: i,
1167
1166
  children: /* @__PURE__ */ r.jsxs(
1168
- ds,
1167
+ ps,
1169
1168
  {
1170
1169
  contentDidMount: () => u(a.current),
1171
1170
  ref: a,
1172
1171
  id: "canvas-iframe",
1173
1172
  style: { width: `${e}px`, ...p },
1174
1173
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1175
- initialContent: Re,
1174
+ initialContent: Fe,
1176
1175
  children: [
1177
- /* @__PURE__ */ r.jsx(ws, {}),
1176
+ /* @__PURE__ */ r.jsx(js, {}),
1178
1177
  /* @__PURE__ */ r.jsx(
1179
- Cs,
1178
+ Bs,
1180
1179
  {
1181
1180
  block: n,
1182
1181
  selectedBlockElement: U(v)
1183
1182
  }
1184
1183
  ),
1185
- /* @__PURE__ */ r.jsx(Ss, { model: "page" }),
1186
- /* @__PURE__ */ r.jsx(ks, { children: Te ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ms, {}) }),
1184
+ /* @__PURE__ */ r.jsx(Is, { model: "page" }),
1185
+ /* @__PURE__ */ r.jsx(ws, { children: Te ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Es, {}) }),
1187
1186
  /* @__PURE__ */ r.jsx("br", {}),
1188
1187
  /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
1189
1188
  ]
@@ -1192,8 +1191,8 @@ const Ms = () => {
1192
1191
  }
1193
1192
  );
1194
1193
  }, Fn = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1195
- /* @__PURE__ */ r.jsx(is, {}),
1196
- /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(he, { fallback: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Pt, { children: /* @__PURE__ */ r.jsx(Ts, {}) }) }) })
1194
+ /* @__PURE__ */ r.jsx(as, {}),
1195
+ /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(he, { fallback: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Ht, { children: /* @__PURE__ */ r.jsx(Ls, {}) }) }) })
1197
1196
  ] });
1198
1197
  export {
1199
1198
  Fn as default