@chaibuilder/sdk 1.2.55 → 1.2.57

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