@chaibuilder/sdk 1.2.57 → 1.2.59

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 (44) hide show
  1. package/dist/CanvasArea-NLbaLcFM.cjs +59 -0
  2. package/dist/{CanvasArea-8f_Ki3B7.js → CanvasArea-akw7npWW.js} +385 -366
  3. package/dist/{CurrentPage-nzo4lszx.js → CurrentPage-cOvRmEIZ.js} +2 -2
  4. package/dist/{CurrentPage-7aEIhzQ0.cjs → CurrentPage-pwDwQsWa.cjs} +1 -1
  5. package/dist/{ListTree-KUGhFsb_.js → ListTree-0iy8aBgI.js} +74 -53
  6. package/dist/{ListTree-A-097CZ-.cjs → ListTree-Njsk1AzL.cjs} +1 -1
  7. package/dist/{PagesPanel-hleqqZBo.js → PagesPanel-A3du_vDn.js} +3 -3
  8. package/dist/{PagesPanel-L1mI3y_6.cjs → PagesPanel-bfNUqq2a.cjs} +1 -1
  9. package/dist/{ProjectPanel-RXEhYr0a.js → ProjectPanel-92EtwSrh.js} +3 -3
  10. package/dist/{ProjectPanel-HTxa1kHv.cjs → ProjectPanel-QMaTK2Jx.cjs} +1 -1
  11. package/dist/{Settings-b1ZuIn4y.js → Settings-3ZuMFtd6.js} +2 -2
  12. package/dist/Settings-8_Twq9DO.cjs +1 -0
  13. package/dist/{SidePanels-_6WlMWq_.cjs → SidePanels-C8RdCe7y.cjs} +1 -1
  14. package/dist/{SidePanels-6hZeCR5Z.js → SidePanels-XUVc9jMH.js} +3 -3
  15. package/dist/{Topbar-WdGZIIZp.cjs → Topbar-EkBS5_nt.cjs} +1 -1
  16. package/dist/{Topbar-YfsC1DZ2.js → Topbar-VdVqOT-8.js} +1 -1
  17. package/dist/UILibrariesPanel-CaGLzB9c.cjs +1 -0
  18. package/dist/UILibrariesPanel-raxCToMd.js +216 -0
  19. package/dist/{add-page-modal-CtMwNEsW.js → add-page-modal-OH7DL-Yz.js} +2 -2
  20. package/dist/{add-page-modal-DA5P4pVu.cjs → add-page-modal-VmIvQ5ug.cjs} +1 -1
  21. package/dist/core.cjs +1 -1
  22. package/dist/core.js +1 -1
  23. package/dist/{delete-page-modal-TMpN1Dvm.js → delete-page-modal--g92Sj1h.js} +2 -2
  24. package/dist/{delete-page-modal-AvUZI9Tk.cjs → delete-page-modal-uSFaC2aS.cjs} +1 -1
  25. package/dist/email.cjs +1 -1
  26. package/dist/email.js +1 -1
  27. package/dist/{index-IgLSTkN6.js → index--t_K8Sw6.js} +1 -1
  28. package/dist/{index-zaKhyTQ6.cjs → index-4C2qT6ju.cjs} +1 -1
  29. package/dist/{index-sspgZwTk.cjs → index-Phf9F3An.cjs} +1 -1
  30. package/dist/{index--hN9ZQsP.js → index-yVCgnTlS.js} +2 -2
  31. package/dist/mockServiceWorker.js +18 -10
  32. package/dist/{page-viewer-D8nsi13f.js → page-viewer-hBsE440V.js} +3 -3
  33. package/dist/{page-viewer-2BMSxxfd.cjs → page-viewer-yIl2jRO8.cjs} +1 -1
  34. package/dist/{project-general-setting-HGjTNFRx.js → project-general-setting-9AGMKDNq.js} +2 -2
  35. package/dist/{project-general-setting--0hX9Otn.cjs → project-general-setting-NFCzMKqN.cjs} +1 -1
  36. package/dist/{single-page-detail-eMnjt_Ih.js → single-page-detail-5qDQmlL-.js} +3 -3
  37. package/dist/{single-page-detail-7BpYAyMO.cjs → single-page-detail-wwJYm5lF.cjs} +1 -1
  38. package/dist/studio.cjs +1 -1
  39. package/dist/studio.js +2 -2
  40. package/package.json +1 -1
  41. package/dist/CanvasArea-UisRL54b.cjs +0 -56
  42. package/dist/Settings-7EMwx6zL.cjs +0 -1
  43. package/dist/UILibrariesPanel-5QxxXYg2.js +0 -191
  44. package/dist/UILibrariesPanel-r8nQzXQ-.cjs +0 -1
@@ -1,32 +1,33 @@
1
- var He = Object.defineProperty;
2
- var ze = (n, s, e) => s in n ? He(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
3
- var T = (n, s, e) => (ze(n, typeof s != "symbol" ? s + "" : s, e), e);
1
+ var Oe = Object.defineProperty;
2
+ var ze = (n, s, e) => s in n ? Oe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
3
+ var M = (n, s, e) => (ze(n, typeof s != "symbol" ? s + "" : s, e), e);
4
4
  import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
- import S, { createElement as pe, useCallback as q, useState as B, useEffect as j, Component as be, Children as Oe, Suspense as J, useRef as ue, useMemo as Ue } from "react";
6
- import { map as O, includes as V, toUpper as G, round as We, throttle as ye, has as ee, isEmpty as I, first as K, omit as ke, pick as qe, get as f, isString as ne, memoize as Ke, each as Ye, find as Xe, filter as we, isNull as Ge } from "lodash-es";
7
- import { ResetIcon as he, SunIcon as Qe, MobileIcon as me, LaptopIcon as Ze, DesktopIcon as Je, DotsVerticalIcon as Ve, EraserIcon as et, ZoomInIcon as tt, DragHandleDots2Icon as st, ArrowUpIcon as ot, CopyIcon as nt, TrashIcon as rt } from "@radix-ui/react-icons";
8
- import { v as je, B as Y, aa as Ce, aR as _e, aS as it, aT as lt, aU as at, a4 as re, as as ct, h as U, E as dt, F as pt, G as ut, H as ht, I as mt, aV as gt, aW as Be, r as D, at as M, A as ft, a as xt, b as vt, c as $t, d as bt, e as yt, f as kt, g as wt, P as jt, U as Ct, aX as _t, a5 as De, aQ as W, aY as Bt, a2 as Dt, ad as L, aZ as Ae, am as At, a_ as R, a$ as St, D as ie, t as Se, q as Ie, s as Ee, Q as It, b0 as Et, b1 as Nt, b2 as Tt, X as Mt, b3 as Lt, b4 as Ft, b5 as Rt, b6 as Pt, ai as Ht, b7 as zt, S as te, $ as Ot } from "./index-uLn8W3eR.js";
9
- import { a as Ut, u as Wt, B as qt, E as Kt } from "./index-IgLSTkN6.js";
10
- import { useTranslation as le } from "react-i18next";
5
+ import S, { createElement as ce, useCallback as q, useState as _, useEffect as j, Component as ye, Children as Ue, Suspense as V, useRef as de, useMemo as We } from "react";
6
+ import { map as z, includes as pe, toUpper as Z, round as qe, throttle as ke, has as K, isEmpty as I, first as Y, omit as we, pick as Ke, get as f, isString as oe, memoize as Ye, each as Xe, find as Ge, filter as je, isNull as Qe } from "lodash-es";
7
+ import { ResetIcon as ue, SunIcon as Ze, MobileIcon as he, LaptopIcon as Je, DesktopIcon as Ve, DotsVerticalIcon as et, EraserIcon as tt, ZoomInIcon as st, DragHandleDots2Icon as ot, ArrowUpIcon as nt, CopyIcon as rt, TrashIcon as it } from "@radix-ui/react-icons";
8
+ import { v as Ce, B as X, aa as _e, aR as Be, aS as lt, aT as at, aU as ct, a4 as G, as as dt, h as U, E as pt, F as ut, G as ht, H as mt, I as gt, aV as ft, aW as Ae, r as A, at as L, A as xt, a as vt, b as $t, c as bt, d as yt, e as kt, f as wt, g as jt, P as Ct, U as _t, aX as Bt, a5 as De, aQ as W, aY as At, a2 as Dt, ad as F, aZ as Se, am as St, a_ as P, a$ as It, D as ne, t as Ie, q as Ee, s as Te, Q as Et, b0 as Tt, b1 as Nt, b2 as Mt, X as Lt, b3 as Ft, b4 as Rt, b5 as Ht, b6 as Pt, ai as Ot, b7 as zt, S as ee, $ as Ut } from "./index-uLn8W3eR.js";
9
+ import { a as Wt, u as qt, B as Kt, E as Yt } from "./index--t_K8Sw6.js";
10
+ import { useTranslation as re } from "react-i18next";
11
11
  import { useAtom as b } from "jotai";
12
- import { SparklesIcon as Yt } from "lucide-react";
13
- import ge from "react-dom";
12
+ import { SparklesIcon as Xt } from "lucide-react";
13
+ import me from "react-dom";
14
14
  import w from "prop-types";
15
- import { Quill as Xt } from "react-quill";
16
- import { d as ae, a as Ne } from "./atoms-ZOWyNoiC.js";
17
- import { flip as Gt } from "@floating-ui/dom";
18
- import { useFloating as Qt, shift as Zt } from "@floating-ui/react-dom";
19
- import { useResizeObserver as Jt } from "@react-hookz/web";
20
- import { useFeature as Vt } from "flagged";
21
- import es from "@tailwindcss/typography";
22
- import ts from "@tailwindcss/forms";
23
- import ss from "@tailwindcss/aspect-ratio";
24
- import os from "tailwindcss-palette-generator";
25
- import { twMerge as ns } from "tailwind-merge";
26
- import { S as fe, a as Te } from "./MODIFIERS-fd5XOmum.js";
27
- import { getBlockComponent as rs } from "@chaibuilder/runtime";
28
- import { Provider as is } from "react-wrap-balancer";
29
- import { Resizable as ls } from "re-resizable";
15
+ import { Quill as Gt } from "react-quill";
16
+ import { d as ie, a as Ne } from "./atoms-ZOWyNoiC.js";
17
+ import { flip as Qt } from "@floating-ui/dom";
18
+ import { useFloating as Zt, shift as Jt } from "@floating-ui/react-dom";
19
+ import { useResizeObserver as Vt } from "@react-hookz/web";
20
+ import { useFeature as es } from "flagged";
21
+ import ts from "@tailwindcss/typography";
22
+ import ss from "@tailwindcss/forms";
23
+ import os from "@tailwindcss/aspect-ratio";
24
+ import ns from "tailwindcss-palette-generator";
25
+ import { twMerge as rs } from "tailwind-merge";
26
+ import { S as ge, a as Me } from "./MODIFIERS-fd5XOmum.js";
27
+ import { getBlockComponent as is } from "@chaibuilder/runtime";
28
+ import { includes as fe } from "lodash";
29
+ import { Provider as ls } from "react-wrap-balancer";
30
+ import { Resizable as as } from "re-resizable";
30
31
  import "./_commonjsHelpers-UyOWmZb0.js";
31
32
  import "@radix-ui/react-toggle";
32
33
  import "class-variance-authority";
@@ -56,19 +57,19 @@ import "tree-model";
56
57
  import "i18next";
57
58
  import "react-hotkeys-hook";
58
59
  import "./index-VBXQixVm.js";
59
- const as = () => {
60
- const { hasUndo: n, hasRedo: s, undo: e, redo: t } = je();
60
+ const cs = () => {
61
+ const { hasUndo: n, hasRedo: s, undo: e, redo: t } = Ce();
61
62
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
62
- /* @__PURE__ */ r.jsx(Y, { disabled: !n(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(he, {}) }),
63
- /* @__PURE__ */ r.jsx(Y, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(he, { className: "rotate-180 scale-y-[-1] transform" }) })
63
+ /* @__PURE__ */ r.jsx(X, { disabled: !n(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, {}) }),
64
+ /* @__PURE__ */ r.jsx(X, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, { className: "rotate-180 scale-y-[-1] transform" }) })
64
65
  ] });
65
66
  };
66
- function cs() {
67
- const [n, s] = Ce();
67
+ function ds() {
68
+ const [n, s] = _e();
68
69
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
69
- /* @__PURE__ */ r.jsx(Qe, { className: "size-4 shrink-0" }),
70
+ /* @__PURE__ */ r.jsx(Ze, { className: "size-4 shrink-0" }),
70
71
  /* @__PURE__ */ r.jsx(
71
- _e,
72
+ Be,
72
73
  {
73
74
  id: "dark-mode-switch",
74
75
  checked: n,
@@ -85,7 +86,7 @@ function cs() {
85
86
  )
86
87
  }
87
88
  ),
88
- /* @__PURE__ */ r.jsx(Ut, { className: "size-4 ml-3 shrink-0" })
89
+ /* @__PURE__ */ r.jsx(Wt, { className: "size-4 ml-3 shrink-0" })
89
90
  ] });
90
91
  }
91
92
  const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
@@ -111,19 +112,19 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
111
112
  )
112
113
  ]
113
114
  }
114
- ), ds = [
115
+ ), ps = [
115
116
  {
116
117
  title: "mobile_xs_title",
117
118
  content: "mobile_xs_content",
118
119
  breakpoint: "xs",
119
- icon: /* @__PURE__ */ r.jsx(me, {}),
120
+ icon: /* @__PURE__ */ r.jsx(he, {}),
120
121
  width: 400
121
122
  },
122
123
  {
123
124
  title: "mobile_sm_title",
124
125
  content: "mobile_sm_content",
125
126
  breakpoint: "sm",
126
- icon: /* @__PURE__ */ r.jsx(me, { className: "rotate-90" }),
127
+ icon: /* @__PURE__ */ r.jsx(he, { className: "rotate-90" }),
127
128
  width: 640
128
129
  },
129
130
  {
@@ -144,14 +145,14 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
144
145
  title: "desktop_xl_title",
145
146
  content: "desktop_xl_content",
146
147
  breakpoint: "xl",
147
- icon: /* @__PURE__ */ r.jsx(Ze, {}),
148
+ icon: /* @__PURE__ */ r.jsx(Je, {}),
148
149
  width: 1420
149
150
  },
150
151
  {
151
152
  title: "large_desktop_2xl_title",
152
153
  content: "large_desktop_2xl_content",
153
154
  breakpoint: "2xl",
154
- icon: /* @__PURE__ */ r.jsx(Je, {}),
155
+ icon: /* @__PURE__ */ r.jsx(Ve, {}),
155
156
  width: 1920
156
157
  }
157
158
  ], ve = ({
@@ -160,45 +161,45 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
160
161
  currentBreakpoint: e,
161
162
  breakpoint: t,
162
163
  width: o,
163
- icon: c,
164
+ icon: a,
164
165
  onClick: l
165
166
  }) => {
166
- const { t: i } = le();
167
- return /* @__PURE__ */ r.jsxs(it, { children: [
168
- /* @__PURE__ */ r.jsx(lt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
169
- Y,
167
+ const { t: i } = re();
168
+ return /* @__PURE__ */ r.jsxs(lt, { children: [
169
+ /* @__PURE__ */ r.jsx(at, { asChild: !0, children: /* @__PURE__ */ r.jsx(
170
+ X,
170
171
  {
171
172
  onClick: () => l(o),
172
173
  size: "sm",
173
174
  variant: t === e ? "secondary" : "ghost",
174
- children: c
175
+ children: a
175
176
  }
176
177
  ) }),
177
- /* @__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: [
178
+ /* @__PURE__ */ r.jsx(ct, { 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
179
  /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: i(n) }),
179
180
  /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
180
181
  ] }) }) })
181
182
  ] });
182
- }, ps = () => {
183
- const [, n, s] = re(), [e, t] = ct(), { t: o } = le(), c = U("breakpoints", ds), l = (i) => {
184
- e.includes(i) ? e.length > 2 && t(e.filter((d) => d !== i)) : t((d) => [...d, i]);
183
+ }, us = () => {
184
+ const [, n, s] = G(), [e, t] = dt(), { t: o } = re(), a = U("breakpoints", ps), l = (i) => {
185
+ e.includes(i) ? e.length > 2 && t(e.filter((c) => c !== i)) : t((c) => [...c, i]);
185
186
  };
186
- return c.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: O(c, (i) => /* @__PURE__ */ pe(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
187
- O(
188
- c.filter((i) => V(e, G(i.breakpoint))),
189
- (i) => /* @__PURE__ */ pe(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
187
+ return a.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: z(a, (i) => /* @__PURE__ */ ce(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
188
+ z(
189
+ a.filter((i) => pe(e, Z(i.breakpoint))),
190
+ (i) => /* @__PURE__ */ ce(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
190
191
  ),
191
- /* @__PURE__ */ r.jsxs(dt, { children: [
192
- /* @__PURE__ */ r.jsx(pt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ve, { className: "scale-90 transform" }) }) }),
193
- /* @__PURE__ */ r.jsxs(ut, { className: "w-56 border-border text-xs", children: [
194
- /* @__PURE__ */ r.jsx(ht, { children: o("Breakpoints") }),
195
- /* @__PURE__ */ r.jsx(mt, {}),
196
- O(c, (i) => /* @__PURE__ */ r.jsx(
197
- gt,
192
+ /* @__PURE__ */ r.jsxs(pt, { children: [
193
+ /* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(et, { className: "scale-90 transform" }) }) }),
194
+ /* @__PURE__ */ r.jsxs(ht, { className: "w-56 border-border text-xs", children: [
195
+ /* @__PURE__ */ r.jsx(mt, { children: o("Breakpoints") }),
196
+ /* @__PURE__ */ r.jsx(gt, {}),
197
+ z(a, (i) => /* @__PURE__ */ r.jsx(
198
+ ft,
198
199
  {
199
200
  disabled: i.breakpoint === "xs",
200
- onCheckedChange: () => l(G(i.breakpoint)),
201
- checked: V(e, G(i.breakpoint)),
201
+ onCheckedChange: () => l(Z(i.breakpoint)),
202
+ checked: pe(e, Z(i.breakpoint)),
202
203
  children: o(i.title)
203
204
  },
204
205
  i.breakpoint
@@ -206,36 +207,36 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
206
207
  ] })
207
208
  ] })
208
209
  ] });
209
- }, us = () => {
210
- const { t: n } = le(), { setNewBlocks: s } = Be(), [, e] = D(), [, t] = M(), o = q(() => {
210
+ }, hs = () => {
211
+ const { t: n } = re(), { setNewBlocks: s } = Ae(), [, e] = A(), [, t] = L(), o = q(() => {
211
212
  s([]), e([]), t([]);
212
213
  }, [s]);
213
- return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(ft, { children: [
214
- /* @__PURE__ */ r.jsx(xt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(Y, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
215
- /* @__PURE__ */ r.jsx(et, {}),
214
+ return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(xt, { children: [
215
+ /* @__PURE__ */ r.jsx(vt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(X, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
216
+ /* @__PURE__ */ r.jsx(tt, {}),
216
217
  " ",
217
218
  n("clear")
218
219
  ] }) }),
219
- /* @__PURE__ */ r.jsxs(vt, { className: "border-border", children: [
220
- /* @__PURE__ */ r.jsxs($t, { children: [
221
- /* @__PURE__ */ r.jsx(bt, { children: n("clear_canvas_title") }),
222
- /* @__PURE__ */ r.jsx(yt, { children: n("clear_canvas_description") })
220
+ /* @__PURE__ */ r.jsxs($t, { className: "border-border", children: [
221
+ /* @__PURE__ */ r.jsxs(bt, { children: [
222
+ /* @__PURE__ */ r.jsx(yt, { children: n("clear_canvas_title") }),
223
+ /* @__PURE__ */ r.jsx(kt, { children: n("clear_canvas_description") })
223
224
  ] }),
224
- /* @__PURE__ */ r.jsxs(kt, { children: [
225
- /* @__PURE__ */ r.jsx(wt, { children: n("cancel") }),
226
- /* @__PURE__ */ r.jsx(jt, { onClick: o, children: n("yes") })
225
+ /* @__PURE__ */ r.jsxs(wt, { children: [
226
+ /* @__PURE__ */ r.jsx(jt, { children: n("cancel") }),
227
+ /* @__PURE__ */ r.jsx(Ct, { onClick: o, children: n("yes") })
227
228
  ] })
228
229
  ] })
229
230
  ] }) });
230
- }, hs = () => {
231
- const [n, s] = b(Ct);
231
+ }, ms = () => {
232
+ const [n, s] = b(_t);
232
233
  return U("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
233
- /* @__PURE__ */ r.jsxs(_t, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
234
- /* @__PURE__ */ r.jsx(Yt, { className: "w-4" }),
234
+ /* @__PURE__ */ r.jsxs(Bt, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
235
+ /* @__PURE__ */ r.jsx(Xt, { className: "w-4" }),
235
236
  "AI Assistant"
236
237
  ] }),
237
238
  /* @__PURE__ */ r.jsx(
238
- _e,
239
+ Be,
239
240
  {
240
241
  className: "scale-90",
241
242
  checked: n,
@@ -246,34 +247,34 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
246
247
  }
247
248
  )
248
249
  ] }) : null;
249
- }, ms = () => {
250
+ }, gs = () => {
250
251
  const n = U("darkMode", !0), [s] = De();
251
252
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
252
253
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
253
- /* @__PURE__ */ r.jsx(ps, {}),
254
+ /* @__PURE__ */ r.jsx(us, {}),
254
255
  /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
255
256
  n ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
256
- /* @__PURE__ */ r.jsx(cs, {}),
257
+ /* @__PURE__ */ r.jsx(ds, {}),
257
258
  /* @__PURE__ */ r.jsx(W, { orientation: "vertical" })
258
259
  ] }) : null,
259
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: [
260
- /* @__PURE__ */ r.jsx(tt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
261
+ /* @__PURE__ */ r.jsx(st, { className: "h-3.5 w-3.5 flex-shrink-0" }),
261
262
  " ",
262
263
  /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
263
- We(s, 0),
264
+ qe(s, 0),
264
265
  "%"
265
266
  ] })
266
267
  ] }),
267
268
  /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
268
- /* @__PURE__ */ r.jsx(as, {})
269
+ /* @__PURE__ */ r.jsx(cs, {})
269
270
  ] }),
270
271
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
271
- /* @__PURE__ */ r.jsx(us, {}),
272
+ /* @__PURE__ */ r.jsx(hs, {}),
272
273
  /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
273
- /* @__PURE__ */ r.jsx(hs, {})
274
+ /* @__PURE__ */ r.jsx(ms, {})
274
275
  ] })
275
276
  ] });
276
- }, gs = `<!doctype html>
277
+ }, fs = `<!doctype html>
277
278
  <html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
278
279
  <head>
279
280
  <meta charset="UTF-8">
@@ -312,6 +313,9 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
312
313
  [data-drop="yes"] { outline: 2px dashed orange !important; outline-offset: -2px }
313
314
  [data-dnd="yes"] { pointer-events: auto !important}
314
315
  [data-dnd="no"] { pointer-events: none !important; }
316
+ [data-dnd-dragged="yes"] { opacity: 0.6; pointer-events: none; }
317
+ [data-dnd-dragged="no"] { opacity: 1; pointer-events: auto !important; }
318
+ [force-show] { display: block !important; }
315
319
  </style>
316
320
  <style id="hidden-blocks"></style>
317
321
  <style id="selected-block"></style>
@@ -324,36 +328,36 @@ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
324
328
  <div class="frame-root h-full"></div>
325
329
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
326
330
  </body>
327
- </html>`, fs = (n) => {
328
- const [s] = re(), [, e] = De(), [t, o] = B({}), c = q(() => {
331
+ </html>`, xs = (n) => {
332
+ const [s] = G(), [, e] = De(), [t, o] = _({}), a = q(() => {
329
333
  const { width: l, height: i } = n;
330
334
  if (l < s) {
331
- const d = parseFloat((l / s).toFixed(2).toString());
332
- let m = {};
333
- const a = i * d;
334
- i && (m = {
335
+ const c = parseFloat((l / s).toFixed(2).toString());
336
+ let h = {};
337
+ const m = i * c;
338
+ i && (h = {
335
339
  // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
336
- height: 100 + (i - a) / a * 100 + "%"
340
+ height: 100 + (i - m) / m * 100 + "%"
337
341
  }), o({
338
342
  position: "relative",
339
343
  top: 0,
340
- transform: `scale(${d})`,
344
+ transform: `scale(${c})`,
341
345
  transformOrigin: "top left",
342
- ...m,
346
+ ...h,
343
347
  maxWidth: "none"
344
- }), e(d * 100);
348
+ }), e(c * 100);
345
349
  } else
346
350
  o({}), e(100);
347
351
  }, [s, n, e]);
348
352
  return j(() => {
349
- c();
350
- }, [s, n, e, c]), t;
353
+ a();
354
+ }, [s, n, e, a]), t;
351
355
  };
352
- let Me, Le;
353
- typeof document < "u" && (Me = document);
354
- typeof window < "u" && (Le = window);
355
- const Fe = S.createContext({ document: Me, window: Le }), X = () => S.useContext(Fe), { Provider: xs, Consumer: Go } = Fe;
356
- class Re extends be {
356
+ let Le, Fe;
357
+ typeof document < "u" && (Le = document);
358
+ typeof window < "u" && (Fe = window);
359
+ const Re = S.createContext({ document: Le, window: Fe }), Q = () => S.useContext(Re), { Provider: vs, Consumer: Jo } = Re;
360
+ class He extends ye {
357
361
  componentDidMount() {
358
362
  this.props.contentDidMount();
359
363
  }
@@ -361,28 +365,28 @@ class Re extends be {
361
365
  this.props.contentDidUpdate();
362
366
  }
363
367
  render() {
364
- return Oe.only(this.props.children);
368
+ return Ue.only(this.props.children);
365
369
  }
366
370
  }
367
- T(Re, "propTypes", {
371
+ M(He, "propTypes", {
368
372
  children: w.element.isRequired,
369
373
  contentDidMount: w.func.isRequired,
370
374
  contentDidUpdate: w.func.isRequired
371
375
  });
372
- class se extends be {
376
+ class te extends ye {
373
377
  constructor(e, t) {
374
378
  super(e, t);
375
- T(this, "setRef", (e) => {
379
+ M(this, "setRef", (e) => {
376
380
  this.nodeRef.current = e;
377
381
  const { forwardedRef: t } = this.props;
378
382
  typeof t == "function" ? t(e) : t && (t.current = e);
379
383
  });
380
- T(this, "handleLoad", () => {
384
+ M(this, "handleLoad", () => {
381
385
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
382
386
  });
383
387
  // In certain situations on a cold cache DOMContentLoaded never gets called
384
388
  // fallback to an interval to check if that's the case
385
- T(this, "loadCheck", () => setInterval(() => {
389
+ M(this, "loadCheck", () => setInterval(() => {
386
390
  this.handleLoad();
387
391
  }, 500));
388
392
  this._isMounted = !1, this.nodeRef = S.createRef(), this.state = { iframeLoaded: !1 };
@@ -406,8 +410,8 @@ class se extends be {
406
410
  const e = this.getDoc();
407
411
  if (!e)
408
412
  return null;
409
- const t = this.props.contentDidMount, o = this.props.contentDidUpdate, c = e.defaultView || e.parentView, l = /* @__PURE__ */ r.jsx(Re, { contentDidMount: t, contentDidUpdate: o, children: /* @__PURE__ */ r.jsx(xs, { value: { document: e, window: c }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
410
- return [ge.createPortal(this.props.head, this.getDoc().head), ge.createPortal(l, i)];
413
+ const t = this.props.contentDidMount, o = this.props.contentDidUpdate, a = e.defaultView || e.parentView, l = /* @__PURE__ */ r.jsx(He, { contentDidMount: t, contentDidUpdate: o, children: /* @__PURE__ */ r.jsx(vs, { value: { document: e, window: a }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
414
+ return [me.createPortal(this.props.head, this.getDoc().head), me.createPortal(l, i)];
411
415
  }
412
416
  render() {
413
417
  const e = {
@@ -423,7 +427,7 @@ class se extends be {
423
427
  // also inject into the body and can mess up React. For this reason
424
428
  // initialContent is expected to have a div inside of the body
425
429
  // element that we render react into.
426
- T(se, "propTypes", {
430
+ M(te, "propTypes", {
427
431
  style: w.object,
428
432
  // eslint-disable-line
429
433
  head: w.node,
@@ -432,7 +436,7 @@ T(se, "propTypes", {
432
436
  contentDidMount: w.func,
433
437
  contentDidUpdate: w.func,
434
438
  children: w.oneOfType([w.element, w.arrayOf(w.element)])
435
- }), T(se, "defaultProps", {
439
+ }), M(te, "defaultProps", {
436
440
  style: {},
437
441
  head: null,
438
442
  children: void 0,
@@ -443,264 +447,255 @@ T(se, "propTypes", {
443
447
  },
444
448
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
445
449
  });
446
- const vs = S.forwardRef((n, s) => /* @__PURE__ */ r.jsx(se, { ...n, forwardedRef: s }));
447
- function ce(n) {
450
+ const $s = S.forwardRef((n, s) => /* @__PURE__ */ r.jsx(te, { ...n, forwardedRef: s }));
451
+ function le(n) {
448
452
  const s = window.getComputedStyle(n), e = s.display;
449
453
  if (e === "flex" || e === "inline-flex") {
450
454
  const t = s.flexDirection;
451
455
  return t === "column" || t === "column-reverse" ? "vertical" : "horizontal";
452
456
  } else if (e === "grid") {
453
- const t = s.gridAutoFlow, o = s.gridTemplateRows, c = s.gridTemplateColumns;
454
- return t.includes("column") || o.split(" ").length > c.split(" ").length ? "vertical" : "horizontal";
457
+ const t = s.gridAutoFlow, o = s.gridTemplateRows, a = s.gridTemplateColumns;
458
+ return t.includes("column") || o.split(" ").length > a.split(" ").length ? "vertical" : "horizontal";
455
459
  } else if (e === "block" || e === "inline-block")
456
460
  return "vertical";
457
461
  return "horizontal";
458
462
  }
459
- let $ = null, C = [], z = null, Q = null;
463
+ let y = null, B = [], H = null, J = null;
460
464
  const $e = (n, s, e) => {
461
- if (!$ || !n)
465
+ if (!y || !n)
462
466
  return;
463
- const t = $ == null ? void 0 : $.getElementById("placeholder"), o = C.map(([d]) => d), c = o.reduce(
464
- (d, m) => Math.abs(m - e) < Math.abs(d - e) ? m : d,
467
+ const t = y == null ? void 0 : y.getElementById("placeholder"), o = B.map(([c]) => c), a = o.reduce(
468
+ (c, h) => Math.abs(h - e) < Math.abs(c - e) ? h : c,
465
469
  0
466
- ), l = o.indexOf(c);
467
- if (!C[l])
470
+ ), l = o.indexOf(a);
471
+ if (!B[l])
468
472
  return;
469
- const i = C[l];
473
+ const i = B[l];
470
474
  t.style.width = s === "vertical" ? i[2] + "px" : "2px", t.style.height = s === "vertical" ? "2px" : i[2] + "px", t.style.display = "block", s === "vertical" ? (t.style.top = i[0] + "px", t.style.left = i[1] + "px") : (t.style.top = i[1] + "px", t.style.left = i[0] + "px");
471
475
  };
472
- function $s(n, s) {
476
+ function bs(n, s) {
473
477
  let e = 0, t = 1 / 0;
474
- return s.forEach((o, c) => {
478
+ return s.forEach((o, a) => {
475
479
  const l = Math.abs(o[0] - n);
476
- l < t && (t = l, e = c);
480
+ l < t && (t = l, e = a);
477
481
  }), e;
478
482
  }
479
- const bs = (n) => {
480
- const e = ce(n) === "horizontal";
481
- C = [], Array.from(n.children).forEach((t, o) => {
483
+ const ys = (n) => {
484
+ const e = le(n) === "horizontal";
485
+ B = [], Array.from(n.children).forEach((t, o) => {
482
486
  if (t.classList.contains("pointer-events-none"))
483
487
  return;
484
- const c = e ? t.offsetLeft : t.offsetTop, l = e ? [t.offsetTop, t.clientHeight] : [t.offsetLeft, t.clientWidth];
485
- if (C.push([c, l[0], l[1]]), o === n.children.length - 1) {
488
+ const a = e ? t.offsetLeft : t.offsetTop, l = e ? [t.offsetTop, t.clientHeight] : [t.offsetLeft, t.clientWidth];
489
+ if (B.push([a, l[0], l[1]]), o === n.children.length - 1) {
486
490
  const i = e ? t.offsetLeft + t.clientWidth : t.offsetTop + t.clientHeight;
487
- C.push([i, l[0], l[1]]);
491
+ B.push([i, l[0], l[1]]);
488
492
  }
489
493
  });
490
- }, ys = ye((n) => {
494
+ }, ks = ke((n) => {
491
495
  var o;
492
- const s = n.target, e = ce(s), t = (o = $ == null ? void 0 : $.defaultView) == null ? void 0 : o.scrollY;
496
+ const s = n.target, e = le(s), t = (o = y == null ? void 0 : y.defaultView) == null ? void 0 : o.scrollY;
493
497
  e === "vertical" ? $e(s, e, n.clientY + t) : $e(s, e, n.clientX);
494
498
  }, 0);
495
- function Z() {
496
- const n = $ == null ? void 0 : $.getElementById("placeholder");
497
- n.style.display = "none", ks("pointer-none"), ws();
499
+ function be() {
500
+ const n = y == null ? void 0 : y.getElementById("placeholder");
501
+ n.style.display = "none", ws("pointer-none"), js();
498
502
  }
499
- function ks(n) {
500
- ($ == null ? void 0 : $.querySelectorAll(`.${n}`)).forEach((e) => {
503
+ function ws(n) {
504
+ (y == null ? void 0 : y.querySelectorAll(`.${n}`)).forEach((e) => {
501
505
  e.classList.remove(n);
502
506
  });
503
507
  }
504
- function ws() {
505
- const n = $ == null ? void 0 : $.querySelector('[data-drop="yes"]');
508
+ function js() {
509
+ const n = y == null ? void 0 : y.querySelector('[data-drop="yes"]');
506
510
  n && n.removeAttribute("data-drop");
507
511
  }
508
- const js = () => {
509
- const { document: n } = X(), [s, e] = b(Bt), { addCoreBlock: t } = Dt(), [, o] = L(), [, c] = D(), { moveBlocks: l } = Be(), [, i] = b(Ae), [d, m] = b(ae), [, a] = b(Ne);
510
- return $ = n, {
512
+ const Cs = () => {
513
+ const { document: n } = Q(), [s, e] = b(At), { addCoreBlock: t } = Dt(), [, o] = F(), [, a] = A(), { moveBlocks: l } = Ae(), [, i] = b(Se), [c, h] = b(ie), [, m] = b(Ne), d = () => {
514
+ be(), e(!1), i(""), h(null), m(null), B = [];
515
+ };
516
+ return y = n, {
511
517
  isDragging: s,
512
- onDragOver: (u) => {
513
- u.preventDefault(), u.stopPropagation(), ys(u);
518
+ onDragOver: (p) => {
519
+ p.preventDefault(), p.stopPropagation(), ks(p);
514
520
  },
515
- onDrop: (u) => {
516
- var _;
517
- z == null || z.classList.remove("drop-target");
518
- const p = z, k = ce(p) === "vertical" ? u.clientY + ((_ = $ == null ? void 0 : $.defaultView) == null ? void 0 : _.scrollY) : u.clientX;
519
- Q = $s(k, C);
520
- const g = d, h = p.getAttribute("data-block-id");
521
- if (!ee(g, "_id")) {
522
- t(g, h === "canvas" ? null : h, Q), setTimeout(() => {
523
- Z();
524
- }, 300), C = [], e(!1), i(""), m(null), a(null);
521
+ onDrop: (p) => {
522
+ var D;
523
+ H == null || H.classList.remove("drop-target");
524
+ const x = H, g = le(x) === "vertical" ? p.clientY + ((D = y == null ? void 0 : y.defaultView) == null ? void 0 : D.scrollY) : p.clientX;
525
+ J = bs(g, B);
526
+ const u = c, k = x.getAttribute("data-block-id");
527
+ if (u === H) {
528
+ d();
525
529
  return;
526
530
  }
527
- let y = p.getAttribute("data-block-id");
528
- y === null && (y = u.target.parentElement.getAttribute("data-block-id")), l([g._id], y, Q), Z(), e(!1), i(""), C = [], setTimeout(() => Z(), 300);
531
+ if (!K(u, "_id")) {
532
+ t(u, k === "canvas" ? null : k, J), setTimeout(d, 300);
533
+ return;
534
+ }
535
+ let C = x.getAttribute("data-block-id");
536
+ C === null && (C = p.target.parentElement.getAttribute("data-block-id")), l([u._id], C, J), d(), setTimeout(be, 300);
529
537
  },
530
- onDragEnter: (u) => {
531
- const p = u, x = p.target;
532
- z = x;
533
- const k = x.getAttribute("data-block-id");
534
- a(k), p.stopPropagation(), p.preventDefault(), C = [], bs(x), console.log(C, u.clientY, $.defaultView.scrollY), x.classList.add("drop-target"), e(!0), o(""), c([]);
538
+ onDragEnter: (p) => {
539
+ const x = p, $ = x.target;
540
+ H = $;
541
+ const g = $.getAttribute("data-block-id");
542
+ m(g), x.stopPropagation(), x.preventDefault(), B = [], ys($), $.classList.add("drop-target"), e(!0), o(""), a([]);
535
543
  }
536
- // onDragLeave: (e: DragEvent) => {
537
- // const event = e;
538
- // event.stopPropagation();
539
- // event.preventDefault();
540
- // const target = event.target as HTMLElement;
541
- // if (target && target.classList.contains("drop-target")) {
542
- // target.classList.remove("drop-target");
543
- // if (dropTarget === target) {
544
- // dropTarget = null;
545
- // }
546
- // }
547
- // removePlaceholder();
548
- // },
549
544
  };
550
545
  };
551
- function de(n) {
546
+ function ae(n) {
552
547
  return n.getAttribute("data-block-id") ? n : n.closest("[data-block-id]");
553
548
  }
554
- function Cs(n) {
549
+ function _s(n) {
555
550
  n.container.innerHTML = "", n.container.parentNode.removeChild(n.container);
556
551
  var s = document.querySelector(".ql-toolbar");
557
552
  s && s.parentNode.removeChild(s), n = null;
558
553
  }
559
- const _s = () => {
560
- const n = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = At(), [, e] = L(), [t, o] = b(R);
561
- return (c) => {
562
- var u;
554
+ const Bs = () => {
555
+ const n = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = St(), [, e] = F(), [t, o] = b(P);
556
+ return (a) => {
557
+ var d;
563
558
  if (t)
564
559
  return;
565
- const l = de(c.target), i = l.getAttribute("data-block-type");
560
+ const l = ae(a.target), i = l.getAttribute("data-block-type");
566
561
  if (!i || !n.includes(i))
567
562
  return;
568
- const d = l.cloneNode(!0);
569
- l.style.display = "none", Array.from(d.attributes).forEach((p) => {
570
- p.name !== "class" && d.removeAttribute(p.name);
571
- }), i === "Text" && (d.style.display = "inline-block"), l.parentNode.insertBefore(d, l.nextSibling);
572
- const m = new Xt(d, { placeholder: "Type here..." });
573
- function a() {
574
- const p = m.getText(0, m.getLength());
575
- s([l.getAttribute("data-block-id")], { content: p }), l.removeAttribute("style"), d.removeEventListener("blur", a, !0), Cs(m), o(""), e("");
563
+ const c = l.cloneNode(!0);
564
+ l.style.display = "none", Array.from(c.attributes).forEach((p) => {
565
+ p.name !== "class" && c.removeAttribute(p.name);
566
+ }), i === "Text" && (c.style.display = "inline-block"), l.parentNode.insertBefore(c, l.nextSibling);
567
+ const h = new Gt(c, { placeholder: "Type here..." });
568
+ function m() {
569
+ const p = h.getText(0, h.getLength());
570
+ s([l.getAttribute("data-block-id")], { content: p }), l.removeAttribute("style"), c.removeEventListener("blur", m, !0), _s(h), o(""), e("");
576
571
  }
577
- d.addEventListener("blur", a, !0), d.addEventListener("keydown", (p) => {
578
- (p.key === "Enter" || p.key === "Escape") && a();
579
- }), m.focus(), (u = d.querySelector(".ql-clipboard")) == null || u.remove(), o(l.getAttribute("data-block-id"));
572
+ c.addEventListener("blur", m, !0), c.addEventListener("keydown", (p) => {
573
+ (p.key === "Enter" || p.key === "Escape") && m();
574
+ }), h.focus(), (d = c.querySelector(".ql-clipboard")) == null || d.remove(), o(l.getAttribute("data-block-id"));
580
575
  };
581
- }, Bs = () => {
582
- const [, n] = M(), [s, e] = D(), [, t] = L(), [o] = b(R), [c] = b(St);
576
+ }, As = () => {
577
+ const [, n] = L(), [s, e] = A(), [, t] = F(), [o] = b(P), [a] = b(It);
583
578
  return (l) => {
584
579
  if (o)
585
580
  return;
586
581
  l.stopPropagation();
587
- const i = de(l.target);
582
+ const i = ae(l.target);
588
583
  if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
589
584
  e([]), n([]), t("");
590
585
  return;
591
586
  }
592
587
  if (i != null && i.getAttribute("data-block-parent")) {
593
- const d = i.getAttribute("data-style-prop"), m = i.getAttribute("data-style-id"), a = i.getAttribute("data-block-parent");
594
- s.includes(a) || c == null || c.closeAll(), n([{ id: m, prop: d, blockId: a }]), e([a]);
588
+ const c = i.getAttribute("data-style-prop"), h = i.getAttribute("data-style-id"), m = i.getAttribute("data-block-parent");
589
+ s.includes(m) || a == null || a.closeAll(), n([{ id: h, prop: c, blockId: m }]), e([m]);
595
590
  } else if (i != null && i.getAttribute("data-block-id")) {
596
- let d = i.getAttribute("data-block-id");
597
- s.includes(d) || c == null || c.closeAll(), e([d]);
591
+ let c = i.getAttribute("data-block-id");
592
+ s.includes(c) || a == null || a.closeAll(), e([c]);
598
593
  }
599
594
  t("");
600
595
  };
601
- }, Ds = ye((n, s) => {
602
- const e = de(n.target);
596
+ }, Ds = ke((n, s) => {
597
+ const e = ae(n.target);
603
598
  e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
604
- }, 100), As = () => {
605
- const [, n] = L(), [s] = b(R);
599
+ }, 100), Ss = () => {
600
+ const [, n] = F(), [s] = b(P);
606
601
  return (e) => {
607
602
  s || Ds(e, n);
608
603
  };
609
- }, Ss = ({ children: n }) => {
610
- const { document: s } = X(), [e] = D(), [t, o] = M();
604
+ }, Is = ({ children: n }) => {
605
+ const { document: s } = Q(), [e] = A(), [t, o] = L();
611
606
  j(() => {
612
607
  setTimeout(() => {
613
608
  if (!I(t))
614
609
  return;
615
- const m = Pe(s, K(e));
616
- if (m) {
617
- const a = m.getAttribute("data-style-prop");
618
- if (a) {
619
- const u = m.getAttribute("data-style-id"), p = m.getAttribute("data-block-parent");
620
- o([{ id: u, prop: a, blockId: p }]);
610
+ const h = Pe(s, Y(e));
611
+ if (h) {
612
+ const m = h.getAttribute("data-style-prop");
613
+ if (m) {
614
+ const d = h.getAttribute("data-style-id"), p = h.getAttribute("data-block-parent");
615
+ o([{ id: d, prop: m, blockId: p }]);
621
616
  }
622
617
  }
623
618
  }, 100);
624
619
  }, [s, e, o, t]);
625
- const c = _s(), l = Bs(), i = As(), d = js();
620
+ const a = Bs(), l = As(), i = Ss(), c = Cs();
626
621
  return /* @__PURE__ */ r.jsx(
627
622
  "div",
628
623
  {
629
624
  "data-block-id": "canvas",
630
625
  id: "canvas",
631
626
  onClick: l,
632
- onDoubleClick: c,
627
+ onDoubleClick: a,
633
628
  onMouseMove: i,
634
- ...ke(d, "isDragging"),
635
- className: "relative mb-5 h-full max-w-full " + (d.isDragging ? "dragging" : ""),
629
+ ...we(c, "isDragging"),
630
+ className: "relative mb-5 h-full max-w-full " + (c.isDragging ? "dragging" : ""),
636
631
  children: n
637
632
  }
638
633
  );
639
- }, Pe = (n, s) => n.querySelector(`[data-block-id="${s}"]`), Is = () => {
640
- const { window: n } = X(), [s, e] = D(), [t] = ie(), [, o] = M(), { undo: c, redo: l } = je(), i = Se(), [, d] = Ie(), m = Ee(), { savePage: a } = It(), [u] = b(R), [, p] = b(Et), x = (g) => {
641
- g.key === "Enter" && (g.preventDefault(), s.length === 1 && p(K(s)));
642
- }, k = (g) => {
643
- const h = t.find((y) => y._id === g);
644
- return h ? h._parent : null;
634
+ }, Pe = (n, s) => n.querySelector(`[data-block-id="${s}"]`), Es = () => {
635
+ const { window: n } = Q(), [s, e] = A(), [t] = ne(), [, o] = L(), { undo: a, redo: l } = Ce(), i = Ie(), [, c] = Ee(), h = Te(), { savePage: m } = Et(), [d] = b(P), [, p] = b(Tt), x = (g) => {
636
+ g.key === "Enter" && (g.preventDefault(), s.length === 1 && p(Y(s)));
637
+ }, $ = (g) => {
638
+ const u = t.find((k) => k._id === g);
639
+ return u ? u._parent : null;
645
640
  };
646
641
  return j(() => {
647
- const g = (h) => {
648
- if (h.key === "Escape") {
642
+ const g = (u) => {
643
+ if (u.key === "Escape") {
649
644
  e([]), o([]);
650
645
  return;
651
646
  }
652
- if (x(h), !u && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), m(s)), h.ctrlKey || h.metaKey) {
653
- if (h.key === "ArrowUp") {
654
- h.preventDefault();
655
- const y = s.length > 0 ? k(s[0]) : null;
656
- y && e([y]);
647
+ if (x(u), !d && (u.key === "Delete" || u.key === "Backspace") && (u.preventDefault(), h(s)), u.ctrlKey || u.metaKey) {
648
+ if (u.key === "ArrowUp") {
649
+ u.preventDefault();
650
+ const k = s.length > 0 ? $(s[0]) : null;
651
+ k && e([k]);
657
652
  }
658
- if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(h.key)) {
659
- if (u && ["x", "z", "v"].includes(h.key))
653
+ if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(u.key)) {
654
+ if (d && ["x", "z", "v"].includes(u.key))
660
655
  return !0;
661
- h.preventDefault();
656
+ u.preventDefault();
662
657
  }
663
- h.key === "s" && (h.stopPropagation(), h.preventDefault(), a()), h.key === "z" && c(), h.key === "y" && l(), h.key === "d" && i(s);
658
+ u.key === "s" && (u.stopPropagation(), u.preventDefault(), m()), u.key === "z" && a(), u.key === "y" && l(), u.key === "d" && i(s);
664
659
  }
665
660
  };
666
661
  return n.removeEventListener("keydown", g), n.addEventListener("keydown", g), () => {
667
662
  n.removeEventListener("keydown", g);
668
663
  };
669
- }, [s, e, c, m, d, l, i, u, a, n]), null;
670
- }, Es = ({ block: n, label: s }) => {
671
- const [, e] = D(), [, t] = L(), [, o] = b(ae), c = Vt("dnd");
664
+ }, [s, e, a, h, c, l, i, d, m, n]), null;
665
+ }, Ts = ({ block: n, label: s }) => {
666
+ const [, e] = A(), [, t] = F(), [, o] = b(ie), a = es("dnd");
672
667
  return /* @__PURE__ */ r.jsxs(
673
668
  "div",
674
669
  {
675
670
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
676
- draggable: c ? "true" : "false",
671
+ draggable: a ? "true" : "false",
677
672
  onDragStart: (l) => {
678
- l.dataTransfer.setData("text/plain", JSON.stringify(qe(n, ["_id", "_type", "_name"]))), o(n), setTimeout(() => {
673
+ l.dataTransfer.setData("text/plain", JSON.stringify(Ke(n, ["_id", "_type", "_name"]))), o(n), setTimeout(() => {
679
674
  e([]), t(null);
680
675
  }, 200);
681
676
  },
682
677
  children: [
683
- /* @__PURE__ */ r.jsx(st, {}),
678
+ /* @__PURE__ */ r.jsx(ot, {}),
684
679
  s
685
680
  ]
686
681
  }
687
682
  );
688
683
  }, Ns = ({ selectedBlockElement: n, block: s }) => {
689
- const e = Ee(), t = Se(), [, o] = D(), [, c] = M(), [l] = b(R), { floatingStyles: i, refs: d, update: m } = Qt({
684
+ const e = Te(), t = Ie(), [, o] = A(), [, a] = L(), [l] = b(P), { floatingStyles: i, refs: c, update: h } = Zt({
690
685
  placement: "top-start",
691
- middleware: [Zt(), Gt()],
686
+ middleware: [Jt(), Qt()],
692
687
  elements: {
693
688
  reference: n
694
689
  }
695
690
  });
696
- Jt(n, () => m(), n !== null);
697
- const a = f(s, "_parent", null), u = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
691
+ Vt(n, () => h(), n !== null);
692
+ const m = f(s, "_parent", null), d = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
698
693
  return !n || !s || l ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
699
694
  "div",
700
695
  {
701
696
  role: "button",
702
697
  tabIndex: 0,
703
- ref: d.setFloating,
698
+ ref: c.setFloating,
704
699
  style: i,
705
700
  onClick: (p) => {
706
701
  p.stopPropagation(), p.preventDefault();
@@ -708,24 +703,24 @@ const _s = () => {
708
703
  onKeyDown: (p) => p.stopPropagation(),
709
704
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
710
705
  children: [
711
- /* @__PURE__ */ r.jsx(Es, { label: u, block: s }),
706
+ /* @__PURE__ */ r.jsx(Ts, { label: d, block: s }),
712
707
  /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
713
- a && /* @__PURE__ */ r.jsx(
714
- ot,
708
+ m && /* @__PURE__ */ r.jsx(
709
+ nt,
715
710
  {
716
711
  className: "hover:scale-105",
717
712
  onClick: () => {
718
- c([]), o([a]);
713
+ a([]), o([m]);
719
714
  }
720
715
  }
721
716
  ),
722
- Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
723
- Tt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
717
+ Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
718
+ Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(it, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
724
719
  ] })
725
720
  ]
726
721
  }
727
722
  ) });
728
- }, Ts = ({ addVariant: n, e: s }) => {
723
+ }, Ms = ({ addVariant: n, e: s }) => {
729
724
  n("hs-dropdown-open", [
730
725
  ({ modifySelectors: e, separator: t }) => {
731
726
  e(({ className: o }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${o}`)}`);
@@ -978,27 +973,27 @@ const _s = () => {
978
973
  }), n("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
979
974
  e(({ className: o }) => `.auto .${s(`hs-auto-mode-active${t}${o}`)}`);
980
975
  });
981
- }, Ms = ({ model: n }) => {
982
- const [s] = Mt(), [e] = D(), [t] = Ce(), [o] = L(), [c] = M(), [l] = b(Ae), { document: i, window: d } = X(), [m] = B(i == null ? void 0 : i.getElementById("highlighted-block")), [a] = B(
976
+ }, Ls = ({ model: n }) => {
977
+ const [s] = Lt(), [e] = A(), [t] = _e(), [o] = F(), [a] = L(), [l] = b(Se), { document: i, window: c } = Q(), [h] = _(i == null ? void 0 : i.getElementById("highlighted-block")), [m] = _(
983
978
  i == null ? void 0 : i.getElementById("selected-block")
984
- ), [u] = B(
979
+ ), [d] = _(
985
980
  i == null ? void 0 : i.getElementById("selected-styling-block")
986
- ), [p] = B(i == null ? void 0 : i.getElementById("dragged-block"));
981
+ ), [p] = _(i == null ? void 0 : i.getElementById("dragged-block"));
987
982
  j(() => {
988
983
  t ? i == null || i.documentElement.classList.add("dark") : i == null || i.documentElement.classList.remove("dark");
989
984
  }, [t, i]);
990
- const x = f(s, "headingFont", "DM Sans"), k = f(s, "bodyFont", "DM Sans");
985
+ const x = f(s, "headingFont", "DM Sans"), $ = f(s, "bodyFont", "DM Sans");
991
986
  return j(() => {
992
- const g = f(s, "primaryColor", "#000"), h = f(s, "secondaryColor", "#FFF"), y = f(s, "bodyBgLightColor", "#fff"), _ = f(s, "bodyBgDarkColor", "#000"), A = f(s, "bodyTextDarkColor", "#000"), P = f(s, "bodyTextLightColor", "#fff"), F = os([
987
+ const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), k = f(s, "bodyBgLightColor", "#fff"), C = f(s, "bodyBgDarkColor", "#000"), D = f(s, "bodyTextDarkColor", "#000"), E = f(s, "bodyTextLightColor", "#fff"), R = ns([
993
988
  { color: g, name: "primary" },
994
- { color: h, name: "secondary" }
995
- ]), H = {
996
- "bg-light": y,
997
- "bg-dark": _,
998
- "text-dark": A,
999
- "text-light": P
989
+ { color: u, name: "secondary" }
990
+ ]), O = {
991
+ "bg-light": k,
992
+ "bg-dark": C,
993
+ "text-dark": D,
994
+ "text-light": E
1000
995
  }, v = f(s, "roundedCorners", "0");
1001
- !d || !d.tailwind || (d.tailwind.config = {
996
+ !c || !c.tailwind || (c.tailwind.config = {
1002
997
  darkMode: "class",
1003
998
  theme: {
1004
999
  extend: {
@@ -1011,35 +1006,35 @@ const _s = () => {
1011
1006
  },
1012
1007
  fontFamily: {
1013
1008
  heading: [x],
1014
- body: [k]
1009
+ body: [$]
1015
1010
  },
1016
1011
  borderRadius: {
1017
1012
  DEFAULT: `${v || "0"}px`
1018
1013
  },
1019
- colors: { ...H, ...F }
1014
+ colors: { ...O, ...R }
1020
1015
  }
1021
1016
  },
1022
- plugins: [es, ts, ss, d.tailwind.plugin.withOptions(() => Ts)]
1017
+ plugins: [ts, ss, os, c.tailwind.plugin.withOptions(() => Ms)]
1023
1018
  });
1024
- }, [s, d, x, k]), j(() => {
1025
- a && (a.textContent = `${O(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1019
+ }, [s, c, x, $]), j(() => {
1020
+ m && (m.textContent = `${z(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1026
1021
  outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1027
1022
  }`);
1028
- }, [e, a]), j(() => {
1023
+ }, [e, m]), j(() => {
1029
1024
  if (!l) {
1030
1025
  p.textContent = "";
1031
1026
  return;
1032
1027
  }
1033
1028
  p.textContent = `[data-block-id="${l}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1034
1029
  }, [l]), j(() => {
1035
- m && (m.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1036
- }, [o, e, m]), j(() => {
1037
- u && (u.textContent = `${O(c, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1030
+ h && (h.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1031
+ }, [o, e, h]), j(() => {
1032
+ d && (d.textContent = `${z(a, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1038
1033
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1039
1034
  }`);
1040
- }, [c, u]), j(() => {
1041
- const g = f(s, "bodyTextLightColor", "#64748b"), h = f(s, "bodyTextDarkColor", "#94a3b8"), y = f(s, "bodyBgLightColor", "#FFFFFF"), _ = f(s, "bodyBgDarkColor", "#0f172a");
1042
- i.body.className = `font-body antialiased text-[${g}] bg-[${y}] dark:text-[${h}] dark:bg-[${_}]`;
1035
+ }, [a, d]), j(() => {
1036
+ const g = f(s, "bodyTextLightColor", "#64748b"), u = f(s, "bodyTextDarkColor", "#94a3b8"), k = f(s, "bodyBgLightColor", "#FFFFFF"), C = f(s, "bodyBgDarkColor", "#0f172a");
1037
+ i.body.className = `font-body antialiased text-[${g}] bg-[${k}] dark:text-[${u}] dark:bg-[${C}]`;
1043
1038
  }, [s, i, n]), n === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1044
1039
  x && /* @__PURE__ */ r.jsx(
1045
1040
  "link",
@@ -1054,13 +1049,13 @@ const _s = () => {
1054
1049
  media: "all"
1055
1050
  }
1056
1051
  ),
1057
- k && x !== k && /* @__PURE__ */ r.jsx(
1052
+ $ && x !== $ && /* @__PURE__ */ r.jsx(
1058
1053
  "link",
1059
1054
  {
1060
1055
  id: "body-font",
1061
1056
  rel: "stylesheet",
1062
1057
  type: "text/css",
1063
- href: `https://fonts.googleapis.com/css2?family=${k.replace(
1058
+ href: `https://fonts.googleapis.com/css2?family=${$.replace(
1064
1059
  / /g,
1065
1060
  "+"
1066
1061
  )}:wght@300;400;500;600;700;800;900&display=swap`,
@@ -1069,115 +1064,139 @@ const _s = () => {
1069
1064
  ),
1070
1065
  x && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${x}",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";}` })
1071
1066
  ] }) : null;
1072
- }, Ls = () => b(Lt), Fs = (n) => {
1067
+ }, Fs = () => b(Ft), Rs = (n, s) => {
1068
+ const e = ["xs", "sm", "md", "lg", "xl", "2xl"], t = e.indexOf(s), o = n.split(" ");
1069
+ let a = new Array(e.length).fill(!1);
1070
+ for (const l of o) {
1071
+ let [i, c] = l.split(":");
1072
+ c || (c = i, i = "xs");
1073
+ const h = e.indexOf(i);
1074
+ if (h <= t) {
1075
+ const m = ["block", "flex", "inline", "inline-block", "inline-flex", "grid", "table"], d = ["hidden"];
1076
+ if (m.includes(c))
1077
+ for (let p = h; p < e.length; p++)
1078
+ a[p] = !0;
1079
+ else if (d.includes(c))
1080
+ for (let p = h; p < e.length; p++)
1081
+ a[p] = !1;
1082
+ }
1083
+ }
1084
+ return a[t];
1085
+ }, Hs = (n) => {
1073
1086
  const s = {};
1074
1087
  return Object.keys(n).forEach((e) => {
1075
- ne(n[e]) && n[e].startsWith(fe) && (s[e] = n[e].replace(fe, "").split(","));
1088
+ oe(n[e]) && n[e].startsWith(ge) && (s[e] = n[e].replace(ge, "").split(","));
1076
1089
  }), s;
1077
- }, Rs = Ke((n) => {
1078
- const s = n.replace(Te, "").split(",");
1079
- return ns(s[0], s[1]);
1090
+ }, Ps = Ye((n) => {
1091
+ const s = n.replace(Me, "").split(",");
1092
+ return rs(s[0], s[1]);
1080
1093
  });
1081
- function Ps(n, s) {
1094
+ function Os(n, s) {
1082
1095
  return f(n, `${s}_attrs`, {});
1083
1096
  }
1084
- function Hs(n) {
1085
- const s = {};
1086
- return Object.keys(n).forEach((e) => {
1087
- if (ne(n[e]) && n[e].startsWith(Te)) {
1088
- const t = Rs(n[e]);
1089
- s.__key = e, s[e] = {
1090
- className: t,
1091
- "data-style-prop": e,
1097
+ function zs(n, s) {
1098
+ const e = {};
1099
+ return Object.keys(n).forEach((t) => {
1100
+ if (oe(n[t]) && n[t].startsWith(Me)) {
1101
+ const o = Ps(n[t]), a = Os(n, t);
1102
+ e[t] = {
1103
+ className: o,
1104
+ "data-style-prop": t,
1092
1105
  "data-block-parent": n._id,
1093
- "data-style-id": `${e}-${n._id}`,
1094
- ...Ps(n, e)
1106
+ "data-style-id": `${t}-${n._id}`,
1107
+ ...a
1095
1108
  };
1109
+ const l = K(a, "x-show") || K(a, "x-if");
1110
+ l && (e.__isHidden = l && !Rs(o, s));
1096
1111
  }
1097
- }), s;
1112
+ }), e;
1098
1113
  }
1099
- function zs(n, s) {
1114
+ function Us(n, s) {
1100
1115
  const e = f(n, "_bindings", {});
1101
- return I(e) ? { ...n } : (Ye(e, (t, o) => {
1102
- ne(t) && f(s, t, null) && (n[o] = f(s, t, null));
1116
+ return I(e) ? { ...n } : (Xe(e, (t, o) => {
1117
+ oe(t) && f(s, t, null) && (n[o] = f(s, t, null));
1103
1118
  }), n);
1104
1119
  }
1105
- function oe({ blocks: n }) {
1106
- const [s] = ie(), [e] = b(Ft), [t] = b(ae), [o] = b(Ne), [c] = Ls(), l = q((a) => Hs(a), []), [i] = Wt(), [d] = b(R), m = q(
1107
- (a) => a.reduce((u, p) => {
1108
- const x = f(c, p, {});
1109
- return { ...u, ...x };
1120
+ function se({ blocks: n }) {
1121
+ const [s] = ne(), [e] = b(Rt), [t] = b(ie), [o] = b(Ne), [, a] = G(), [l] = Fs(), i = q((d) => zs(d, a), [a]), [c] = qt(), [h] = b(P), m = q(
1122
+ (d) => d.reduce((p, x) => {
1123
+ const $ = f(l, x, {});
1124
+ return { ...p, ...$ };
1110
1125
  }, {}),
1111
- [c, s]
1126
+ [l, s]
1112
1127
  );
1113
1128
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: S.Children.toArray(
1114
- n.map((a, u) => {
1115
- if (d === a._id)
1129
+ n.map((d, p) => {
1130
+ if (h === d._id)
1116
1131
  return null;
1117
- const p = Fs(a), x = {};
1118
- I(p) || Object.keys(p).forEach((F) => {
1119
- x[F] = S.Children.toArray(
1120
- p[F].map((H) => /* @__PURE__ */ r.jsx(oe, { blocks: [Xe(s, { _id: H })] }))
1132
+ const x = Hs(d), $ = {};
1133
+ I(x) || Object.keys(x).forEach((R) => {
1134
+ $[R] = S.Children.toArray(
1135
+ x[R].map((O) => /* @__PURE__ */ r.jsx(se, { blocks: [Ge(s, { _id: O })] }))
1121
1136
  );
1122
1137
  });
1123
- const k = we(s, { _parent: a._id });
1124
- x.children = k.length ? /* @__PURE__ */ r.jsx(oe, { blocks: k }) : null;
1125
- const g = rs(a._type), h = f(g, "builderComponent", f(g, "component", null));
1126
- if (Ge(h))
1127
- return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${a == null ? void 0 : a._type} not registered -->` });
1128
- const y = ee(g, "getBlockStateFrom") ? g == null ? void 0 : g.getBlockStateFrom(a, s) : [], _ = m(y), A = l(a), P = f(A, "__key", "styles");
1129
- return ee(A, P + ".x-show") && !V(e, a._id) ? null : /* @__PURE__ */ r.jsx(J, { children: S.createElement(h, {
1138
+ const g = je(s, { _parent: d._id });
1139
+ $.children = g.length ? /* @__PURE__ */ r.jsx(se, { blocks: g }) : null;
1140
+ const u = is(d._type), k = f(u, "builderComponent", f(u, "component", null));
1141
+ if (Qe(k))
1142
+ return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${d == null ? void 0 : d._type} not registered -->` });
1143
+ const C = K(u, "getBlockStateFrom") ? u == null ? void 0 : u.getBlockStateFrom(d, s) : [], D = m(C), E = i(d);
1144
+ return f(E, "__isHidden", !1) && !fe(e, d._id) ? null : /* @__PURE__ */ r.jsx(V, { children: S.createElement(k, {
1130
1145
  blockProps: {
1131
- "data-block-id": a._id,
1132
- "data-block-type": a._type,
1146
+ ...fe(e, d._id) ? { "force-show": "" } : {},
1147
+ "data-block-id": d._id,
1148
+ "data-block-type": d._type,
1133
1149
  ...t ? (
1134
1150
  // @ts-ignore
1135
- { "data-dnd": Rt(a._type, t == null ? void 0 : t._type) ? "yes" : "no" }
1151
+ {
1152
+ "data-dnd": Ht(d._type, t == null ? void 0 : t._type) ? "yes" : "no",
1153
+ "data-dnd-dragged": t._id === d._id ? "yes" : "no"
1154
+ }
1136
1155
  ) : {},
1137
- ...o === a._id ? { "data-drop": "yes" } : {}
1156
+ ...o === d._id ? { "data-drop": "yes" } : {}
1138
1157
  },
1139
- index: u,
1140
- ...zs(a, i),
1141
- ...ke(A, ["__key"]),
1142
- ...x,
1158
+ index: p,
1159
+ ...Us(d, c),
1160
+ ...we(E, ["__isHidden"]),
1161
+ ...$,
1143
1162
  inBuilder: !0,
1144
- blockState: _
1163
+ blockState: D
1145
1164
  }) });
1146
1165
  })
1147
1166
  ) });
1148
1167
  }
1149
- const Os = () => {
1150
- const [n] = ie(), s = I(n) ? null : /* @__PURE__ */ r.jsx(qt, { children: /* @__PURE__ */ r.jsx(oe, { blocks: we(n, (e) => I(e._parent)) }) });
1168
+ const Ws = () => {
1169
+ const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsx(se, { blocks: je(n, (e) => I(e._parent)) }) });
1151
1170
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: s });
1152
- }, Us = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Ws = () => {
1153
- const [n] = b(Pt), [s] = Ie(), [e] = re(), [, t] = D(), o = Ht(), [, c] = L(), l = ue(null), i = ue(null), [d, m] = B({ width: 0, height: 0 }), a = fs(d), [u, p] = B(0), [x, k] = B([]), [, g] = B([]), [, h] = b(zt), [y, _] = M(), A = U("loading", !1), P = U("htmlDir", "ltr");
1171
+ }, qs = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Ks = () => {
1172
+ const [n] = b(Pt), [s] = Ee(), [e] = G(), [, t] = A(), o = Ot(), [, a] = F(), l = de(null), i = de(null), [c, h] = _({ width: 0, height: 0 }), m = xs(c), [d, p] = _(0), [x, $] = _([]), [, g] = _([]), [, u] = b(zt), [k, C] = L(), D = U("loading", !1), E = U("htmlDir", "ltr");
1154
1173
  j(() => {
1155
- const { clientWidth: v, clientHeight: E } = i.current;
1156
- m({ width: v, height: E }), u === 0 && p(v);
1157
- }, [i, e, u]);
1158
- const F = (v, E = 0) => {
1174
+ const { clientWidth: v, clientHeight: T } = i.current;
1175
+ h({ width: v, height: T }), d === 0 && p(v);
1176
+ }, [i, e, d]);
1177
+ const R = (v, T = 0) => {
1159
1178
  const { top: N } = v.getBoundingClientRect();
1160
- return N + E >= 0 && N - E <= window.innerHeight;
1179
+ return N + T >= 0 && N - T <= window.innerHeight;
1161
1180
  };
1162
1181
  j(() => {
1163
- var v, E;
1182
+ var v, T;
1164
1183
  if (o && o.type !== "Multiple" && l.current) {
1165
1184
  const N = Pe(l.current.contentDocument, o._id);
1166
- N && (F(N) || (E = (v = l.current) == null ? void 0 : v.contentWindow) == null || E.scrollTo({ top: N.offsetTop, behavior: "smooth" }), k([N]));
1185
+ N && (R(N) || (T = (v = l.current) == null ? void 0 : v.contentWindow) == null || T.scrollTo({ top: N.offsetTop, behavior: "smooth" }), $([N]));
1167
1186
  }
1168
1187
  }, [o]), j(() => {
1169
- if (!I(y) && l.current) {
1170
- const v = Us(
1188
+ if (!I(k) && l.current) {
1189
+ const v = qs(
1171
1190
  l.current.contentDocument,
1172
- K(y).id
1191
+ Y(k).id
1173
1192
  );
1174
1193
  g(v ? [v] : [null]);
1175
1194
  } else
1176
1195
  g([null]);
1177
- }, [y]);
1178
- const H = Ue(() => {
1179
- let v = gs;
1180
- return v = v.replace("__HTML_DIR__", P), n === "offline" && (v = v.replace(
1196
+ }, [k]);
1197
+ const O = We(() => {
1198
+ let v = fs;
1199
+ return v = v.replace("__HTML_DIR__", E), n === "offline" && (v = v.replace(
1181
1200
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1182
1201
  "/offline/tailwind.cdn.js"
1183
1202
  ), v = v.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), v = v.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), v;
@@ -1186,32 +1205,32 @@ const Os = () => {
1186
1205
  "div",
1187
1206
  {
1188
1207
  onClick: () => {
1189
- t([]), _([]);
1208
+ t([]), C([]);
1190
1209
  },
1191
- onMouseLeave: () => setTimeout(() => c(""), 300),
1210
+ onMouseLeave: () => setTimeout(() => a(""), 300),
1192
1211
  className: "relative mx-auto h-full w-full overflow-hidden",
1193
- style: u > 0 && !I(a) ? { width: s ? "100%" : u } : {},
1212
+ style: d > 0 && !I(m) ? { width: s ? "100%" : d } : {},
1194
1213
  ref: i,
1195
1214
  children: /* @__PURE__ */ r.jsxs(
1196
- vs,
1215
+ $s,
1197
1216
  {
1198
- contentDidMount: () => h(l.current),
1217
+ contentDidMount: () => u(l.current),
1199
1218
  ref: l,
1200
1219
  id: "canvas-iframe",
1201
- style: { width: `${e}px`, ...a },
1220
+ style: { width: `${e}px`, ...m },
1202
1221
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1203
- initialContent: H,
1222
+ initialContent: O,
1204
1223
  children: [
1205
- /* @__PURE__ */ r.jsx(Is, {}),
1224
+ /* @__PURE__ */ r.jsx(Es, {}),
1206
1225
  /* @__PURE__ */ r.jsx(
1207
1226
  Ns,
1208
1227
  {
1209
1228
  block: o,
1210
- selectedBlockElement: K(x)
1229
+ selectedBlockElement: Y(x)
1211
1230
  }
1212
1231
  ),
1213
- /* @__PURE__ */ r.jsx(Ms, { model: "page" }),
1214
- /* @__PURE__ */ r.jsx(is, { children: /* @__PURE__ */ r.jsx(Ss, { children: A ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(te, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Os, {}) }) }),
1232
+ /* @__PURE__ */ r.jsx(Ls, { model: "page" }),
1233
+ /* @__PURE__ */ r.jsx(ls, { children: /* @__PURE__ */ r.jsx(Is, { children: D ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ws, {}) }) }),
1215
1234
  /* @__PURE__ */ r.jsx("br", {}),
1216
1235
  /* @__PURE__ */ r.jsx(
1217
1236
  "div",
@@ -1225,16 +1244,16 @@ const Os = () => {
1225
1244
  )
1226
1245
  }
1227
1246
  );
1228
- }, qs = S.lazy(() => import("./CodeEditor-zYBqhBv3.js")), Qo = () => {
1229
- const [n] = Ot();
1247
+ }, Ys = S.lazy(() => import("./CodeEditor-zYBqhBv3.js")), Vo = () => {
1248
+ const [n] = Ut();
1230
1249
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1231
- /* @__PURE__ */ r.jsx(ms, {}),
1250
+ /* @__PURE__ */ r.jsx(gs, {}),
1232
1251
  /* @__PURE__ */ r.jsxs("div", { className: "relative flex h-full flex-col 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: [
1233
- /* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(te, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsx(Ws, {}) }) }),
1234
- n ? /* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(te, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(ls, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ r.jsx(qs, {}) }) }) : null
1252
+ /* @__PURE__ */ r.jsx(V, { fallback: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Yt, { children: /* @__PURE__ */ r.jsx(Ks, {}) }) }),
1253
+ n ? /* @__PURE__ */ r.jsx(V, { fallback: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(as, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ r.jsx(Ys, {}) }) }) : null
1235
1254
  ] })
1236
1255
  ] });
1237
1256
  };
1238
1257
  export {
1239
- Qo as default
1258
+ Vo as default
1240
1259
  };