@chaibuilder/sdk 1.2.6 → 1.2.8

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 (78) hide show
  1. package/dist/{AddBlocks-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
  2. package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
  3. package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
  4. package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
  5. package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
  6. package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
  7. package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
  8. package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
  9. package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
  10. package/dist/Layers-v-7k3W2I.cjs +1 -0
  11. package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
  12. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
  13. package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
  14. package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
  15. package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
  16. package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
  17. package/dist/Settings-iOjfw5NQ.cjs +1 -0
  18. package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
  19. package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
  20. package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
  21. package/dist/Topbar-V8xCetWF.cjs +1 -0
  22. package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
  23. package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
  24. package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
  25. package/dist/UploadImages-DnQ95_NW.cjs +1 -0
  26. package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
  27. package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
  28. package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
  29. package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
  30. package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
  31. package/dist/core.cjs +1 -1
  32. package/dist/core.js +19 -19
  33. package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
  34. package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
  35. package/dist/email-blocks.cjs +1 -1
  36. package/dist/email-blocks.js +263 -24
  37. package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
  38. package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
  39. package/dist/html-to-json-2PeOCVey.cjs +1 -0
  40. package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
  41. package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
  42. package/dist/index-H6vIwGfD.cjs +1 -0
  43. package/dist/index-e0c8PmRQ.js +205 -0
  44. package/dist/index-gi1LIOCw.cjs +1 -0
  45. package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
  46. package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
  47. package/dist/lib.cjs +1 -1
  48. package/dist/lib.js +20 -21
  49. package/dist/mockServiceWorker.js +1 -1
  50. package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
  51. package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
  52. package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
  53. package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
  54. package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
  55. package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
  56. package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
  57. package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
  58. package/dist/studio.cjs +1 -1
  59. package/dist/studio.js +4 -4
  60. package/dist/style.css +1 -1
  61. package/dist/ui.cjs +1 -1
  62. package/dist/ui.js +134 -133
  63. package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
  64. package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
  65. package/dist/web-blocks.cjs +2 -2
  66. package/dist/web-blocks.js +138 -139
  67. package/package.json +5 -5
  68. package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
  69. package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
  70. package/dist/Layers-4G-0aNk9.cjs +0 -1
  71. package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
  72. package/dist/Settings-SV08lVcH.cjs +0 -1
  73. package/dist/SidePanels-TOJotvzn.cjs +0 -1
  74. package/dist/Topbar-u5XKdWgQ.cjs +0 -1
  75. package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
  76. package/dist/UploadImages-eHYxwWAp.cjs +0 -1
  77. package/dist/html-to-json-5UoswV2Q.cjs +0 -1
  78. package/dist/index-IIJ_o44s.cjs +0 -1
@@ -1,27 +1,28 @@
1
- var wt = Object.defineProperty;
2
- var jt = (e, t, n) => t in e ? wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var J = (e, t, n) => (jt(e, typeof t != "symbol" ? t + "" : t, n), n);
1
+ var jt = Object.defineProperty;
2
+ var Tt = (e, t, n) => t in e ? jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var J = (e, t, n) => (Tt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
- import V, { createElement as _e, useCallback as we, useState as q, useEffect as M, Component as Ye, Children as Tt, Suspense as Ke, useRef as Be, useMemo as Ct } from "react";
6
- import { map as re, includes as Oe, toUpper as pe, round as It, throttle as Je, noop as te, isEmpty as K, first as ae, omit as Et, pick as St, get as B, isString as je, memoize as Dt, each as _t, find as Bt, filter as Ve, isNull as Ot } from "lodash-es";
7
- import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as At, DesktopIcon as Rt, DotsVerticalIcon as Pt, EraserIcon as Mt, ZoomInIcon as Lt, DragHandleDots2Icon as Nt, ArrowUpIcon as Ft, CopyIcon as Wt, TrashIcon as $t } from "@radix-ui/react-icons";
8
- import { p as Te, B as le, W as Ze, aH as Ht, aI as qt, aJ as Ut, aK as zt, aL as Yt, R as Ce, ai as Kt, i as Ge, aM as Jt, aN as Vt, aO as Zt, aP as Gt, aQ as Qt, aR as Xt, w as en, j as U, aj as Z, D as tn, E as nn, F as rn, G as on, H as sn, I as an, J as ln, K as cn, ap as dn, L as un, U as Qe, aG as ie, aS as pn, _ as Q, ab as fn, aT as X, ae as Ie, m as Xe, n as hn, k as gn, o as mn, h as et, l as tt, ag as yn, aU as vn, aV as nt, aW as xn, aX as bn, x as kn, a as wn, aY as jn, aZ as Tn, a6 as Cn, a_ as In, S as rt } from "./index-_OgCuSUz.js";
5
+ import V, { createElement as be, useCallback as je, useState as q, useEffect as M, Component as Ke, Children as Ct, Suspense as Je, useRef as Oe, useMemo as It } from "react";
6
+ import { map as re, includes as Ae, toUpper as pe, round as Et, throttle as Ve, noop as te, isEmpty as K, first as ae, omit as St, pick as Dt, get as D, isString as Te, memoize as Bt, each as _t, find as Ot, filter as Xe, isNull as At } from "lodash-es";
7
+ import { ResetIcon as Pe, MobileIcon as Re, LaptopIcon as Pt, DesktopIcon as Rt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as Ht } from "@radix-ui/react-icons";
8
+ import { p as Ce, B as le, X as Ze, aI as qt, aJ as Ut, aK as zt, aL as Yt, aM as Kt, U as Ie, aj as Jt, i as Ee, aN as Vt, aO as Xt, aP as Zt, aQ as Qt, aR as Gt, aS as en, w as tn, j as U, ak as X, E as nn, F as rn, G as on, H as sn, I as an, J as ln, K as cn, L as dn, aq as un, M as pn, V as Qe, aH as ie, aT as fn, $ as Q, ac as hn, aU as G, af as Se, m as Ge, n as gn, k as mn, o as yn, h as et, l as tt, ah as vn, aV as xn, aW as nt, aX as bn, aY as kn, x as wn, aZ as jn, a7 as Tn, a_ as Cn, S as rt } from "./index-niHREMmR.js";
9
9
  import { useTranslation as de } from "react-i18next";
10
- import { useAtom as F } from "jotai";
11
- import Pe from "react-dom";
12
- import { g as En } from "./_commonjsHelpers-UyOWmZb0.js";
13
- import { r as ot, u as Sn, B as Dn, E as _n } from "./index-482XFRhB.js";
10
+ import { useAtom as N } from "jotai";
11
+ import Me from "react-dom";
12
+ import { g as In } from "./_commonjsHelpers-UyOWmZb0.js";
13
+ import { r as ot, u as En, B as Sn, E as Dn } from "./index-EGUphg4R.js";
14
14
  import { Quill as Bn } from "react-quill";
15
- import { u as On } from "./useAddBlockByDrop-uPXvrg4G.js";
15
+ import { u as _n } from "./useAddBlockByDrop-_nwI4W3q.js";
16
16
  import { useFeature as st } from "flagged";
17
- import { flip as An } from "@floating-ui/dom";
18
- import { useFloating as Rn, shift as Pn } from "@floating-ui/react-dom";
19
- import { useResizeObserver as Mn } from "@react-hookz/web";
20
- import { tailwindcssPaletteGenerator as Ln } from "@bobthered/tailwindcss-palette-generator";
21
- import { Provider as Nn } from "react-wrap-balancer";
22
- import { twMerge as Fn } from "tailwind-merge";
23
- import { S as Me, a as it } from "./MODIFIERS-RiXS5Mn1.js";
24
- import { getBlockComponent as Wn } from "@chaibuilder/runtime";
17
+ import { flip as On } from "@floating-ui/dom";
18
+ import { useFloating as An, shift as Pn } from "@floating-ui/react-dom";
19
+ import { useResizeObserver as Rn } from "@react-hookz/web";
20
+ import { tailwindcssPaletteGenerator as Mn } from "@bobthered/tailwindcss-palette-generator";
21
+ import { Provider as Ln } from "react-wrap-balancer";
22
+ import { twMerge as Nn } from "tailwind-merge";
23
+ import { S as Le, a as it } from "./MODIFIERS-RiXS5Mn1.js";
24
+ import { getBlockComponent as at } from "@chaibuilder/runtime";
25
+ import { has as Fn } from "lodash";
25
26
  import "@radix-ui/react-toggle";
26
27
  import "class-variance-authority";
27
28
  import "./utils-AvyFzbPC.js";
@@ -54,25 +55,24 @@ import "react-dnd";
54
55
  import "@minoru/react-dnd-treeview";
55
56
  import "react-hotkeys-hook";
56
57
  import "sonner";
57
- import "./html-to-json-yjzEN9OX.js";
58
+ import "./html-to-json-57841sEK.js";
58
59
  import "himalaya";
59
- import "lodash";
60
60
  import "lucide-react";
61
61
  import "./web-blocks.js";
62
62
  import "./controls-XPXGHKht.js";
63
63
  const $n = () => {
64
- const { undoCount: e, redoCount: t, undo: n, redo: s } = Te();
64
+ const { undoCount: e, redoCount: t, undo: n, redo: s } = Ce();
65
65
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
66
- /* @__PURE__ */ r.jsx(le, { disabled: !e, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, {}) }),
67
- /* @__PURE__ */ r.jsx(le, { disabled: !t, onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, { className: "rotate-180 scale-y-[-1] transform" }) })
66
+ /* @__PURE__ */ r.jsx(le, { disabled: !e, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Pe, {}) }),
67
+ /* @__PURE__ */ r.jsx(le, { disabled: !t, onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Pe, { className: "rotate-180 scale-y-[-1] transform" }) })
68
68
  ] });
69
69
  };
70
- function Hn() {
70
+ function Wn() {
71
71
  const [e, t] = Ze(), { t: n } = de();
72
72
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
73
- /* @__PURE__ */ r.jsx(Ht, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
73
+ /* @__PURE__ */ r.jsx(qt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
74
74
  /* @__PURE__ */ r.jsxs(
75
- qt,
75
+ Ut,
76
76
  {
77
77
  id: "dark-mode-switch",
78
78
  checked: e,
@@ -96,7 +96,7 @@ function Hn() {
96
96
  )
97
97
  ] });
98
98
  }
99
- const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
99
+ const Ne = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
100
100
  "svg",
101
101
  {
102
102
  className: e ? "rotate-90" : "",
@@ -119,7 +119,7 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
119
119
  )
120
120
  ]
121
121
  }
122
- ), qn = [
122
+ ), Hn = [
123
123
  {
124
124
  title: "mobile_xs_title",
125
125
  content: "mobile_xs_content",
@@ -138,21 +138,21 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
138
138
  title: "tablet_md_title",
139
139
  content: "tablet_md_content",
140
140
  breakpoint: "md",
141
- icon: /* @__PURE__ */ r.jsx(Le, {}),
141
+ icon: /* @__PURE__ */ r.jsx(Ne, {}),
142
142
  width: 800
143
143
  },
144
144
  {
145
145
  title: "tablet_lg_title",
146
146
  content: "tablet_lg_content",
147
147
  breakpoint: "lg",
148
- icon: /* @__PURE__ */ r.jsx(Le, { landscape: !0 }),
148
+ icon: /* @__PURE__ */ r.jsx(Ne, { landscape: !0 }),
149
149
  width: 1024
150
150
  },
151
151
  {
152
152
  title: "desktop_xl_title",
153
153
  content: "desktop_xl_content",
154
154
  breakpoint: "xl",
155
- icon: /* @__PURE__ */ r.jsx(At, {}),
155
+ icon: /* @__PURE__ */ r.jsx(Pt, {}),
156
156
  width: 1420
157
157
  },
158
158
  {
@@ -162,51 +162,51 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
162
162
  icon: /* @__PURE__ */ r.jsx(Rt, {}),
163
163
  width: 1920
164
164
  }
165
- ], Ne = ({
165
+ ], Fe = ({
166
166
  title: e,
167
167
  content: t,
168
168
  currentBreakpoint: n,
169
169
  breakpoint: s,
170
170
  width: i,
171
- icon: a,
171
+ icon: l,
172
172
  onClick: d
173
173
  }) => {
174
174
  const { t: o } = de();
175
- return /* @__PURE__ */ r.jsxs(Ut, { children: [
176
- /* @__PURE__ */ r.jsx(zt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
175
+ return /* @__PURE__ */ r.jsxs(zt, { children: [
176
+ /* @__PURE__ */ r.jsx(Yt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
177
177
  le,
178
178
  {
179
179
  onClick: () => d(i),
180
180
  size: "sm",
181
181
  variant: s === n ? "secondary" : "ghost",
182
- children: a
182
+ children: l
183
183
  }
184
184
  ) }),
185
- /* @__PURE__ */ r.jsx(Yt, { 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: [
185
+ /* @__PURE__ */ r.jsx(Kt, { 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: [
186
186
  /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: o(e) }),
187
187
  /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: o(t) })
188
188
  ] }) }) })
189
189
  ] });
190
- }, Un = () => {
191
- const [, e, t] = Ce(), [n, s] = Kt(), { t: i } = de(), a = Ge("breakpoints", qn), d = (o) => {
190
+ }, qn = () => {
191
+ const [, e, t] = Ie(), [n, s] = Jt(), { t: i } = de(), l = Ee("breakpoints", Hn), d = (o) => {
192
192
  n.includes(o) ? n.length > 2 && s(n.filter((c) => c !== o)) : s((c) => [...c, o]);
193
193
  };
194
- return a.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: re(a, (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
194
+ return l.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: re(l, (o) => /* @__PURE__ */ be(Fe, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
195
195
  re(
196
- a.filter((o) => Oe(n, pe(o.breakpoint))),
197
- (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
196
+ l.filter((o) => Ae(n, pe(o.breakpoint))),
197
+ (o) => /* @__PURE__ */ be(Fe, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
198
198
  ),
199
- /* @__PURE__ */ r.jsxs(Jt, { children: [
200
- /* @__PURE__ */ r.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Pt, { className: "scale-90 transform" }) }) }),
199
+ /* @__PURE__ */ r.jsxs(Vt, { children: [
200
+ /* @__PURE__ */ r.jsx(Xt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Mt, { className: "scale-90 transform" }) }) }),
201
201
  /* @__PURE__ */ r.jsxs(Zt, { className: "w-56 border-border text-xs", children: [
202
- /* @__PURE__ */ r.jsx(Gt, { children: i("Breakpoints") }),
203
- /* @__PURE__ */ r.jsx(Qt, {}),
204
- re(a, (o) => /* @__PURE__ */ r.jsx(
205
- Xt,
202
+ /* @__PURE__ */ r.jsx(Qt, { children: i("Breakpoints") }),
203
+ /* @__PURE__ */ r.jsx(Gt, {}),
204
+ re(l, (o) => /* @__PURE__ */ r.jsx(
205
+ en,
206
206
  {
207
207
  disabled: o.breakpoint === "xs",
208
208
  onCheckedChange: () => d(pe(o.breakpoint)),
209
- checked: Oe(n, pe(o.breakpoint)),
209
+ checked: Ae(n, pe(o.breakpoint)),
210
210
  children: i(o.title)
211
211
  },
212
212
  o.breakpoint
@@ -214,42 +214,42 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
214
214
  ] })
215
215
  ] })
216
216
  ] });
217
- }, zn = () => {
218
- const { t: e } = de(), [t] = en(), { createSnapshot: n } = Te(), [, s] = U(), [, i] = Z(), a = we(() => {
217
+ }, Un = () => {
218
+ const { t: e } = de(), [t] = tn(), { createSnapshot: n } = Ce(), [, s] = U(), [, i] = X(), l = je(() => {
219
219
  t([]), s([]), i([]), n();
220
220
  }, [t, n]);
221
- return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(tn, { children: [
222
- /* @__PURE__ */ r.jsx(nn, { asChild: !0, children: /* @__PURE__ */ r.jsxs(le, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
223
- /* @__PURE__ */ r.jsx(Mt, {}),
221
+ return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(nn, { children: [
222
+ /* @__PURE__ */ r.jsx(rn, { asChild: !0, children: /* @__PURE__ */ r.jsxs(le, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
223
+ /* @__PURE__ */ r.jsx(Lt, {}),
224
224
  " ",
225
225
  e("clear")
226
226
  ] }) }),
227
- /* @__PURE__ */ r.jsxs(rn, { className: "border-border", children: [
228
- /* @__PURE__ */ r.jsxs(on, { children: [
229
- /* @__PURE__ */ r.jsx(sn, { children: e("clear_canvas_title") }),
230
- /* @__PURE__ */ r.jsx(an, { children: e("clear_canvas_description") })
227
+ /* @__PURE__ */ r.jsxs(on, { className: "border-border", children: [
228
+ /* @__PURE__ */ r.jsxs(sn, { children: [
229
+ /* @__PURE__ */ r.jsx(an, { children: e("clear_canvas_title") }),
230
+ /* @__PURE__ */ r.jsx(ln, { children: e("clear_canvas_description") })
231
231
  ] }),
232
- /* @__PURE__ */ r.jsxs(ln, { children: [
233
- /* @__PURE__ */ r.jsx(cn, { children: e("cancel") }),
234
- /* @__PURE__ */ r.jsx(dn, { onClick: a, children: e("yes") })
232
+ /* @__PURE__ */ r.jsxs(cn, { children: [
233
+ /* @__PURE__ */ r.jsx(dn, { children: e("cancel") }),
234
+ /* @__PURE__ */ r.jsx(un, { onClick: l, children: e("yes") })
235
235
  ] })
236
236
  ] })
237
237
  ] }) });
238
- }, Yn = () => {
239
- const e = un("darkMode", !1), [t] = Qe();
238
+ }, zn = () => {
239
+ const e = pn("darkMode", !1), [t] = Qe();
240
240
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
241
241
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
242
242
  e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
243
- /* @__PURE__ */ r.jsx(Hn, {}),
243
+ /* @__PURE__ */ r.jsx(Wn, {}),
244
244
  /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" })
245
245
  ] }) : null,
246
- /* @__PURE__ */ r.jsx(Un, {}),
246
+ /* @__PURE__ */ r.jsx(qn, {}),
247
247
  /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
248
248
  /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
249
- /* @__PURE__ */ r.jsx(Lt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
249
+ /* @__PURE__ */ r.jsx(Nt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
250
250
  " ",
251
251
  /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
252
- It(t, 0),
252
+ Et(t, 0),
253
253
  "%"
254
254
  ] })
255
255
  ] }),
@@ -258,10 +258,10 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
258
258
  ] }),
259
259
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
260
260
  /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
261
- /* @__PURE__ */ r.jsx(zn, {})
261
+ /* @__PURE__ */ r.jsx(Un, {})
262
262
  ] })
263
263
  ] });
264
- }, Kn = `<!doctype html>
264
+ }, Yn = `<!doctype html>
265
265
  <html class="scroll-smooth h-full overflow-y-auto">
266
266
  <head>
267
267
  <meta charset="UTF-8">
@@ -296,6 +296,7 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
296
296
  -moz-user-select: text;
297
297
  user-select: text;
298
298
  }
299
+ .frame-root .frame-content { height: 100%; }
299
300
  </style>
300
301
  <style id="hidden-blocks"></style>
301
302
  <style id="selected-block"></style>
@@ -305,11 +306,11 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
305
306
 
306
307
  </head>
307
308
  <body class="font-body antialiased h-full">
308
- <div class="frame-root"></div>
309
+ <div class="frame-root h-full"></div>
309
310
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
310
311
  </body>
311
- </html>`, Jn = (e) => {
312
- const [t] = Ce(), [, n] = Qe(), [s, i] = q({}), a = we(() => {
312
+ </html>`, Kn = (e) => {
313
+ const [t] = Ie(), [, n] = Qe(), [s, i] = q({}), l = je(() => {
313
314
  const { width: d, height: o } = e;
314
315
  if (d < t) {
315
316
  const c = parseFloat((d / t).toFixed(2).toString());
@@ -330,8 +331,8 @@ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
330
331
  i({}), n(100);
331
332
  }, [t, e, n]);
332
333
  return M(() => {
333
- a();
334
- }, [t, e, n, a]), s;
334
+ l();
335
+ }, [t, e, n, l]), s;
335
336
  };
336
337
  var ce = { exports: {} };
337
338
  /*
@@ -339,23 +340,23 @@ object-assign
339
340
  (c) Sindre Sorhus
340
341
  @license MIT
341
342
  */
342
- var fe, Fe;
343
- function Vn() {
344
- if (Fe)
343
+ var fe, $e;
344
+ function Jn() {
345
+ if ($e)
345
346
  return fe;
346
- Fe = 1;
347
+ $e = 1;
347
348
  var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
348
- function s(a) {
349
- if (a == null)
349
+ function s(l) {
350
+ if (l == null)
350
351
  throw new TypeError("Object.assign cannot be called with null or undefined");
351
- return Object(a);
352
+ return Object(l);
352
353
  }
353
354
  function i() {
354
355
  try {
355
356
  if (!Object.assign)
356
357
  return !1;
357
- var a = new String("abc");
358
- if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
358
+ var l = new String("abc");
359
+ if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
359
360
  return !1;
360
361
  for (var d = {}, o = 0; o < 10; o++)
361
362
  d["_" + String.fromCharCode(o)] = o;
@@ -372,8 +373,8 @@ function Vn() {
372
373
  return !1;
373
374
  }
374
375
  }
375
- return fe = i() ? Object.assign : function(a, d) {
376
- for (var o, c = s(a), p, f = 1; f < arguments.length; f++) {
376
+ return fe = i() ? Object.assign : function(l, d) {
377
+ for (var o, c = s(l), p, f = 1; f < arguments.length; f++) {
377
378
  o = Object(arguments[f]);
378
379
  for (var h in o)
379
380
  t.call(o, h) && (c[h] = o[h]);
@@ -387,28 +388,28 @@ function Vn() {
387
388
  }, fe;
388
389
  }
389
390
  var he, We;
390
- function Ee() {
391
+ function De() {
391
392
  if (We)
392
393
  return he;
393
394
  We = 1;
394
395
  var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
395
396
  return he = e, he;
396
397
  }
397
- var ge, $e;
398
- function at() {
399
- return $e || ($e = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
398
+ var ge, He;
399
+ function lt() {
400
+ return He || (He = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
400
401
  }
401
- var me, He;
402
- function Zn() {
403
- if (He)
402
+ var me, qe;
403
+ function Vn() {
404
+ if (qe)
404
405
  return me;
405
- He = 1;
406
+ qe = 1;
406
407
  var e = function() {
407
408
  };
408
409
  if (process.env.NODE_ENV !== "production") {
409
- var t = Ee(), n = {}, s = at();
410
- e = function(a) {
411
- var d = "Warning: " + a;
410
+ var t = De(), n = {}, s = lt();
411
+ e = function(l) {
412
+ var d = "Warning: " + l;
412
413
  typeof console < "u" && console.error(d);
413
414
  try {
414
415
  throw new Error(d);
@@ -416,19 +417,19 @@ function Zn() {
416
417
  }
417
418
  };
418
419
  }
419
- function i(a, d, o, c, p) {
420
+ function i(l, d, o, c, p) {
420
421
  if (process.env.NODE_ENV !== "production") {
421
- for (var f in a)
422
- if (s(a, f)) {
422
+ for (var f in l)
423
+ if (s(l, f)) {
423
424
  var h;
424
425
  try {
425
- if (typeof a[f] != "function") {
426
+ if (typeof l[f] != "function") {
426
427
  var g = Error(
427
- (c || "React class") + ": " + o + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
428
+ (c || "React class") + ": " + o + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof l[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
428
429
  );
429
430
  throw g.name = "Invariant Violation", g;
430
431
  }
431
- h = a[f](d, f, c, o, null, t);
432
+ h = l[f](d, f, c, o, null, t);
432
433
  } catch (A) {
433
434
  h = A;
434
435
  }
@@ -448,14 +449,14 @@ function Zn() {
448
449
  process.env.NODE_ENV !== "production" && (n = {});
449
450
  }, me = i, me;
450
451
  }
451
- var ye, qe;
452
- function Gn() {
453
- if (qe)
452
+ var ye, Ue;
453
+ function Xn() {
454
+ if (Ue)
454
455
  return ye;
455
- qe = 1;
456
- var e = ot, t = Vn(), n = Ee(), s = at(), i = Zn(), a = function() {
456
+ Ue = 1;
457
+ var e = ot, t = Jn(), n = De(), s = lt(), i = Vn(), l = function() {
457
458
  };
458
- process.env.NODE_ENV !== "production" && (a = function(o) {
459
+ process.env.NODE_ENV !== "production" && (l = function(o) {
459
460
  var c = "Warning: " + o;
460
461
  typeof console < "u" && console.error(c);
461
462
  try {
@@ -468,70 +469,70 @@ function Gn() {
468
469
  }
469
470
  return ye = function(o, c) {
470
471
  var p = typeof Symbol == "function" && Symbol.iterator, f = "@@iterator";
471
- function h(l) {
472
- var u = l && (p && l[p] || l[f]);
472
+ function h(a) {
473
+ var u = a && (p && a[p] || a[f]);
473
474
  if (typeof u == "function")
474
475
  return u;
475
476
  }
476
477
  var g = "<<anonymous>>", E = {
477
- array: D("array"),
478
- bigint: D("bigint"),
479
- bool: D("boolean"),
480
- func: D("function"),
481
- number: D("number"),
482
- object: D("object"),
483
- string: D("string"),
484
- symbol: D("symbol"),
478
+ array: B("array"),
479
+ bigint: B("bigint"),
480
+ bool: B("boolean"),
481
+ func: B("function"),
482
+ number: B("number"),
483
+ object: B("object"),
484
+ string: B("string"),
485
+ symbol: B("symbol"),
485
486
  any: O(),
486
487
  arrayOf: w,
487
- element: N(),
488
- elementType: W(),
488
+ element: F(),
489
+ elementType: $(),
489
490
  instanceOf: _,
490
- node: mt(),
491
+ node: yt(),
491
492
  objectOf: H,
492
- oneOf: $,
493
- oneOfType: gt,
494
- shape: yt,
495
- exact: vt
493
+ oneOf: W,
494
+ oneOfType: mt,
495
+ shape: vt,
496
+ exact: xt
496
497
  };
497
- function A(l, u) {
498
- return l === u ? l !== 0 || 1 / l === 1 / u : l !== l && u !== u;
498
+ function A(a, u) {
499
+ return a === u ? a !== 0 || 1 / a === 1 / u : a !== a && u !== u;
499
500
  }
500
- function b(l, u) {
501
- this.message = l, this.data = u && typeof u == "object" ? u : {}, this.stack = "";
501
+ function b(a, u) {
502
+ this.message = a, this.data = u && typeof u == "object" ? u : {}, this.stack = "";
502
503
  }
503
504
  b.prototype = Error.prototype;
504
- function S(l) {
505
+ function S(a) {
505
506
  if (process.env.NODE_ENV !== "production")
506
507
  var u = {}, k = 0;
507
508
  function v(j, y, x, T, I, C, L) {
508
509
  if (T = T || g, C = C || x, L !== n) {
509
510
  if (c) {
510
- var R = new Error(
511
+ var P = new Error(
511
512
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
512
513
  );
513
- throw R.name = "Invariant Violation", R;
514
+ throw P.name = "Invariant Violation", P;
514
515
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
515
- var G = T + ":" + x;
516
- !u[G] && // Avoid spamming the console because they are often not actionable except for lib authors
517
- k < 3 && (a(
516
+ var Z = T + ":" + x;
517
+ !u[Z] && // Avoid spamming the console because they are often not actionable except for lib authors
518
+ k < 3 && (l(
518
519
  "You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
519
- ), u[G] = !0, k++);
520
+ ), u[Z] = !0, k++);
520
521
  }
521
522
  }
522
- return y[x] == null ? j ? y[x] === null ? new b("The " + I + " `" + C + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new b("The " + I + " `" + C + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : l(y, x, T, I, C);
523
+ return y[x] == null ? j ? y[x] === null ? new b("The " + I + " `" + C + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new b("The " + I + " `" + C + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : a(y, x, T, I, C);
523
524
  }
524
525
  var m = v.bind(null, !1);
525
526
  return m.isRequired = v.bind(null, !0), m;
526
527
  }
527
- function D(l) {
528
+ function B(a) {
528
529
  function u(k, v, m, j, y, x) {
529
530
  var T = k[v], I = z(T);
530
- if (I !== l) {
531
+ if (I !== a) {
531
532
  var C = ee(T);
532
533
  return new b(
533
- "Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected ") + ("`" + l + "`."),
534
- { expectedType: l }
534
+ "Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected ") + ("`" + a + "`."),
535
+ { expectedType: a }
535
536
  );
536
537
  }
537
538
  return null;
@@ -541,9 +542,9 @@ function Gn() {
541
542
  function O() {
542
543
  return S(d);
543
544
  }
544
- function w(l) {
545
+ function w(a) {
545
546
  function u(k, v, m, j, y) {
546
- if (typeof l != "function")
547
+ if (typeof a != "function")
547
548
  return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside arrayOf.");
548
549
  var x = k[v];
549
550
  if (!Array.isArray(x)) {
@@ -551,7 +552,7 @@ function Gn() {
551
552
  return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an array."));
552
553
  }
553
554
  for (var I = 0; I < x.length; I++) {
554
- var C = l(x, I, m, j, y + "[" + I + "]", n);
555
+ var C = a(x, I, m, j, y + "[" + I + "]", n);
555
556
  if (C instanceof Error)
556
557
  return C;
557
558
  }
@@ -559,8 +560,8 @@ function Gn() {
559
560
  }
560
561
  return S(u);
561
562
  }
562
- function N() {
563
- function l(u, k, v, m, j) {
563
+ function F() {
564
+ function a(u, k, v, m, j) {
564
565
  var y = u[k];
565
566
  if (!o(y)) {
566
567
  var x = z(y);
@@ -568,10 +569,10 @@ function Gn() {
568
569
  }
569
570
  return null;
570
571
  }
571
- return S(l);
572
+ return S(a);
572
573
  }
573
- function W() {
574
- function l(u, k, v, m, j) {
574
+ function $() {
575
+ function a(u, k, v, m, j) {
575
576
  var y = u[k];
576
577
  if (!e.isValidElementType(y)) {
577
578
  var x = z(y);
@@ -579,45 +580,45 @@ function Gn() {
579
580
  }
580
581
  return null;
581
582
  }
582
- return S(l);
583
+ return S(a);
583
584
  }
584
- function _(l) {
585
+ function _(a) {
585
586
  function u(k, v, m, j, y) {
586
- if (!(k[v] instanceof l)) {
587
- var x = l.name || g, T = kt(k[v]);
587
+ if (!(k[v] instanceof a)) {
588
+ var x = a.name || g, T = wt(k[v]);
588
589
  return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected ") + ("instance of `" + x + "`."));
589
590
  }
590
591
  return null;
591
592
  }
592
593
  return S(u);
593
594
  }
594
- function $(l) {
595
- if (!Array.isArray(l))
596
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
595
+ function W(a) {
596
+ if (!Array.isArray(a))
597
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? l(
597
598
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
598
- ) : a("Invalid argument supplied to oneOf, expected an array.")), d;
599
+ ) : l("Invalid argument supplied to oneOf, expected an array.")), d;
599
600
  function u(k, v, m, j, y) {
600
- for (var x = k[v], T = 0; T < l.length; T++)
601
- if (A(x, l[T]))
601
+ for (var x = k[v], T = 0; T < a.length; T++)
602
+ if (A(x, a[T]))
602
603
  return null;
603
- var I = JSON.stringify(l, function(L, R) {
604
- var G = ee(R);
605
- return G === "symbol" ? String(R) : R;
604
+ var I = JSON.stringify(a, function(L, P) {
605
+ var Z = ee(P);
606
+ return Z === "symbol" ? String(P) : P;
606
607
  });
607
608
  return new b("Invalid " + j + " `" + y + "` of value `" + String(x) + "` " + ("supplied to `" + m + "`, expected one of " + I + "."));
608
609
  }
609
610
  return S(u);
610
611
  }
611
- function H(l) {
612
+ function H(a) {
612
613
  function u(k, v, m, j, y) {
613
- if (typeof l != "function")
614
+ if (typeof a != "function")
614
615
  return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside objectOf.");
615
616
  var x = k[v], T = z(x);
616
617
  if (T !== "object")
617
618
  return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an object."));
618
619
  for (var I in x)
619
620
  if (s(x, I)) {
620
- var C = l(x, I, m, j, y + "." + I, n);
621
+ var C = a(x, I, m, j, y + "." + I, n);
621
622
  if (C instanceof Error)
622
623
  return C;
623
624
  }
@@ -625,48 +626,48 @@ function Gn() {
625
626
  }
626
627
  return S(u);
627
628
  }
628
- function gt(l) {
629
- if (!Array.isArray(l))
630
- return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), d;
631
- for (var u = 0; u < l.length; u++) {
632
- var k = l[u];
629
+ function mt(a) {
630
+ if (!Array.isArray(a))
631
+ return process.env.NODE_ENV !== "production" && l("Invalid argument supplied to oneOfType, expected an instance of array."), d;
632
+ for (var u = 0; u < a.length; u++) {
633
+ var k = a[u];
633
634
  if (typeof k != "function")
634
- return a(
635
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + bt(k) + " at index " + u + "."
635
+ return l(
636
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + kt(k) + " at index " + u + "."
636
637
  ), d;
637
638
  }
638
639
  function v(m, j, y, x, T) {
639
- for (var I = [], C = 0; C < l.length; C++) {
640
- var L = l[C], R = L(m, j, y, x, T, n);
641
- if (R == null)
640
+ for (var I = [], C = 0; C < a.length; C++) {
641
+ var L = a[C], P = L(m, j, y, x, T, n);
642
+ if (P == null)
642
643
  return null;
643
- R.data && s(R.data, "expectedType") && I.push(R.data.expectedType);
644
+ P.data && s(P.data, "expectedType") && I.push(P.data.expectedType);
644
645
  }
645
- var G = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
646
- return new b("Invalid " + x + " `" + T + "` supplied to " + ("`" + y + "`" + G + "."));
646
+ var Z = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
647
+ return new b("Invalid " + x + " `" + T + "` supplied to " + ("`" + y + "`" + Z + "."));
647
648
  }
648
649
  return S(v);
649
650
  }
650
- function mt() {
651
- function l(u, k, v, m, j) {
651
+ function yt() {
652
+ function a(u, k, v, m, j) {
652
653
  return se(u[k]) ? null : new b("Invalid " + m + " `" + j + "` supplied to " + ("`" + v + "`, expected a ReactNode."));
653
654
  }
654
- return S(l);
655
+ return S(a);
655
656
  }
656
- function De(l, u, k, v, m) {
657
+ function _e(a, u, k, v, m) {
657
658
  return new b(
658
- (l || "React class") + ": " + u + " type `" + k + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + m + "`."
659
+ (a || "React class") + ": " + u + " type `" + k + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + m + "`."
659
660
  );
660
661
  }
661
- function yt(l) {
662
+ function vt(a) {
662
663
  function u(k, v, m, j, y) {
663
664
  var x = k[v], T = z(x);
664
665
  if (T !== "object")
665
666
  return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
666
- for (var I in l) {
667
- var C = l[I];
667
+ for (var I in a) {
668
+ var C = a[I];
668
669
  if (typeof C != "function")
669
- return De(m, j, y, I, ee(C));
670
+ return _e(m, j, y, I, ee(C));
670
671
  var L = C(x, I, m, j, y + "." + I, n);
671
672
  if (L)
672
673
  return L;
@@ -675,46 +676,46 @@ function Gn() {
675
676
  }
676
677
  return S(u);
677
678
  }
678
- function vt(l) {
679
+ function xt(a) {
679
680
  function u(k, v, m, j, y) {
680
681
  var x = k[v], T = z(x);
681
682
  if (T !== "object")
682
683
  return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
683
- var I = t({}, k[v], l);
684
+ var I = t({}, k[v], a);
684
685
  for (var C in I) {
685
- var L = l[C];
686
- if (s(l, C) && typeof L != "function")
687
- return De(m, j, y, C, ee(L));
686
+ var L = a[C];
687
+ if (s(a, C) && typeof L != "function")
688
+ return _e(m, j, y, C, ee(L));
688
689
  if (!L)
689
690
  return new b(
690
691
  "Invalid " + j + " `" + y + "` key `" + C + "` supplied to `" + m + "`.\nBad object: " + JSON.stringify(k[v], null, " ") + `
691
- Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
692
+ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
692
693
  );
693
- var R = L(x, C, m, j, y + "." + C, n);
694
- if (R)
695
- return R;
694
+ var P = L(x, C, m, j, y + "." + C, n);
695
+ if (P)
696
+ return P;
696
697
  }
697
698
  return null;
698
699
  }
699
700
  return S(u);
700
701
  }
701
- function se(l) {
702
- switch (typeof l) {
702
+ function se(a) {
703
+ switch (typeof a) {
703
704
  case "number":
704
705
  case "string":
705
706
  case "undefined":
706
707
  return !0;
707
708
  case "boolean":
708
- return !l;
709
+ return !a;
709
710
  case "object":
710
- if (Array.isArray(l))
711
- return l.every(se);
712
- if (l === null || o(l))
711
+ if (Array.isArray(a))
712
+ return a.every(se);
713
+ if (a === null || o(a))
713
714
  return !0;
714
- var u = h(l);
715
+ var u = h(a);
715
716
  if (u) {
716
- var k = u.call(l), v;
717
- if (u !== l.entries) {
717
+ var k = u.call(a), v;
718
+ if (u !== a.entries) {
718
719
  for (; !(v = k.next()).done; )
719
720
  if (!se(v.value))
720
721
  return !1;
@@ -731,27 +732,27 @@ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
731
732
  return !1;
732
733
  }
733
734
  }
734
- function xt(l, u) {
735
- return l === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
735
+ function bt(a, u) {
736
+ return a === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
736
737
  }
737
- function z(l) {
738
- var u = typeof l;
739
- return Array.isArray(l) ? "array" : l instanceof RegExp ? "object" : xt(u, l) ? "symbol" : u;
738
+ function z(a) {
739
+ var u = typeof a;
740
+ return Array.isArray(a) ? "array" : a instanceof RegExp ? "object" : bt(u, a) ? "symbol" : u;
740
741
  }
741
- function ee(l) {
742
- if (typeof l > "u" || l === null)
743
- return "" + l;
744
- var u = z(l);
742
+ function ee(a) {
743
+ if (typeof a > "u" || a === null)
744
+ return "" + a;
745
+ var u = z(a);
745
746
  if (u === "object") {
746
- if (l instanceof Date)
747
+ if (a instanceof Date)
747
748
  return "date";
748
- if (l instanceof RegExp)
749
+ if (a instanceof RegExp)
749
750
  return "regexp";
750
751
  }
751
752
  return u;
752
753
  }
753
- function bt(l) {
754
- var u = ee(l);
754
+ function kt(a) {
755
+ var u = ee(a);
755
756
  switch (u) {
756
757
  case "array":
757
758
  case "object":
@@ -764,18 +765,18 @@ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
764
765
  return u;
765
766
  }
766
767
  }
767
- function kt(l) {
768
- return !l.constructor || !l.constructor.name ? g : l.constructor.name;
768
+ function wt(a) {
769
+ return !a.constructor || !a.constructor.name ? g : a.constructor.name;
769
770
  }
770
771
  return E.checkPropTypes = i, E.resetWarningCache = i.resetWarningCache, E.PropTypes = E, E;
771
772
  }, ye;
772
773
  }
773
- var ve, Ue;
774
- function Qn() {
775
- if (Ue)
774
+ var ve, ze;
775
+ function Zn() {
776
+ if (ze)
776
777
  return ve;
777
- Ue = 1;
778
- var e = Ee();
778
+ ze = 1;
779
+ var e = De();
779
780
  function t() {
780
781
  }
781
782
  function n() {
@@ -793,7 +794,7 @@ function Qn() {
793
794
  function i() {
794
795
  return s;
795
796
  }
796
- var a = {
797
+ var l = {
797
798
  array: s,
798
799
  bigint: s,
799
800
  bool: s,
@@ -816,22 +817,22 @@ function Qn() {
816
817
  checkPropTypes: n,
817
818
  resetWarningCache: t
818
819
  };
819
- return a.PropTypes = a, a;
820
+ return l.PropTypes = l, l;
820
821
  }, ve;
821
822
  }
822
- var Ro = ce.exports;
823
+ var Ao = ce.exports;
823
824
  if (process.env.NODE_ENV !== "production") {
824
- var Xn = ot, er = !0;
825
- ce.exports = Gn()(Xn.isElement, er);
825
+ var Qn = ot, Gn = !0;
826
+ ce.exports = Xn()(Qn.isElement, Gn);
826
827
  } else
827
- ce.exports = Qn()();
828
- var tr = ce.exports;
829
- const P = /* @__PURE__ */ En(tr);
830
- let lt, ct;
831
- typeof document < "u" && (lt = document);
832
- typeof window < "u" && (ct = window);
833
- const dt = V.createContext({ document: lt, window: ct }), ue = () => V.useContext(dt), { Provider: nr, Consumer: Po } = dt;
834
- class ut extends Ye {
828
+ ce.exports = Zn()();
829
+ var er = ce.exports;
830
+ const R = /* @__PURE__ */ In(er);
831
+ let ct, dt;
832
+ typeof document < "u" && (ct = document);
833
+ typeof window < "u" && (dt = window);
834
+ const ut = V.createContext({ document: ct, window: dt }), ue = () => V.useContext(ut), { Provider: tr, Consumer: Po } = ut;
835
+ class pt extends Ke {
835
836
  componentDidMount() {
836
837
  this.props.contentDidMount();
837
838
  }
@@ -839,15 +840,15 @@ class ut extends Ye {
839
840
  this.props.contentDidUpdate();
840
841
  }
841
842
  render() {
842
- return Tt.only(this.props.children);
843
+ return Ct.only(this.props.children);
843
844
  }
844
845
  }
845
- J(ut, "propTypes", {
846
- children: P.element.isRequired,
847
- contentDidMount: P.func.isRequired,
848
- contentDidUpdate: P.func.isRequired
846
+ J(pt, "propTypes", {
847
+ children: R.element.isRequired,
848
+ contentDidMount: R.func.isRequired,
849
+ contentDidUpdate: R.func.isRequired
849
850
  });
850
- class be extends Ye {
851
+ class ke extends Ke {
851
852
  constructor(n, s) {
852
853
  super(n, s);
853
854
  J(this, "setRef", (n) => {
@@ -884,8 +885,8 @@ class be extends Ye {
884
885
  const n = this.getDoc();
885
886
  if (!n)
886
887
  return null;
887
- const s = this.props.contentDidMount, i = this.props.contentDidUpdate, a = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(nr, { value: { document: n, window: a }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
888
- return [Pe.createPortal(this.props.head, this.getDoc().head), Pe.createPortal(d, o)];
888
+ const s = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(pt, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(tr, { value: { document: n, window: l }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
889
+ return [Me.createPortal(this.props.head, this.getDoc().head), Me.createPortal(d, o)];
889
890
  }
890
891
  render() {
891
892
  const n = {
@@ -901,16 +902,16 @@ class be extends Ye {
901
902
  // also inject into the body and can mess up React. For this reason
902
903
  // initialContent is expected to have a div inside of the body
903
904
  // element that we render react into.
904
- J(be, "propTypes", {
905
- style: P.object,
905
+ J(ke, "propTypes", {
906
+ style: R.object,
906
907
  // eslint-disable-line
907
- head: P.node,
908
- initialContent: P.string,
909
- mountTarget: P.string,
910
- contentDidMount: P.func,
911
- contentDidUpdate: P.func,
912
- children: P.oneOfType([P.element, P.arrayOf(P.element)])
913
- }), J(be, "defaultProps", {
908
+ head: R.node,
909
+ initialContent: R.string,
910
+ mountTarget: R.string,
911
+ contentDidMount: R.func,
912
+ contentDidUpdate: R.func,
913
+ children: R.oneOfType([R.element, R.arrayOf(R.element)])
914
+ }), J(ke, "defaultProps", {
914
915
  style: {},
915
916
  head: null,
916
917
  children: void 0,
@@ -921,24 +922,24 @@ J(be, "propTypes", {
921
922
  },
922
923
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
923
924
  });
924
- const rr = V.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
925
- let Y = null, oe = [], ne = null, pt = null;
926
- function or(e) {
927
- const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), s = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), a = parseInt(t.paddingBottom, 10);
928
- return { paddingLeft: n, paddingTop: s, paddingRight: i, paddingBottom: a };
925
+ const nr = V.forwardRef((e, t) => /* @__PURE__ */ r.jsx(ke, { ...e, forwardedRef: t }));
926
+ let Y = null, oe = [], ne = null, ft = null;
927
+ function rr(e) {
928
+ const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), s = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), l = parseInt(t.paddingBottom, 10);
929
+ return { paddingLeft: n, paddingTop: s, paddingRight: i, paddingBottom: l };
929
930
  }
930
- const ze = (e, t, n) => {
931
+ const Ye = (e, t, n) => {
931
932
  if (!Y)
932
933
  return;
933
- const s = e.getBoundingClientRect(), i = Y == null ? void 0 : Y.getElementById("placeholder"), { paddingLeft: a, paddingTop: d, paddingRight: o, paddingBottom: c } = or(e);
934
- i.style.width = t === "vertical" ? s.width - a - o + "px" : "2px", i.style.height = t === "vertical" ? "2px" : s.height - d - c + "px", i.style.display = "block";
934
+ const s = e.getBoundingClientRect(), i = Y == null ? void 0 : Y.getElementById("placeholder"), { paddingLeft: l, paddingTop: d, paddingRight: o, paddingBottom: c } = rr(e);
935
+ i.style.width = t === "vertical" ? s.width - l - o + "px" : "2px", i.style.height = t === "vertical" ? "2px" : s.height - d - c + "px", i.style.display = "block";
935
936
  const p = oe.reduce(
936
937
  (f, h) => Math.abs(h - n) < Math.abs(f - n) ? h : f
937
938
  );
938
- pt = oe.indexOf(p), t === "vertical" ? (i.style.top = e.offsetTop + p + "px", i.style.left = e.offsetLeft + a + "px") : (i.style.top = e.offsetTop + d + "px", i.style.left = e.offsetLeft + p + "px");
939
- }, sr = (e) => {
940
- const t = ft(e), n = window.getComputedStyle(e), s = t === "horizontal", i = parseInt(n.paddingLeft), a = parseInt(n.paddingTop);
941
- let d = s ? i : a;
939
+ ft = oe.indexOf(p), t === "vertical" ? (i.style.top = e.offsetTop + p + "px", i.style.left = e.offsetLeft + l + "px") : (i.style.top = e.offsetTop + d + "px", i.style.left = e.offsetLeft + p + "px");
940
+ }, or = (e) => {
941
+ const t = ht(e), n = window.getComputedStyle(e), s = t === "horizontal", i = parseInt(n.paddingLeft), l = parseInt(n.paddingTop);
942
+ let d = s ? i : l;
942
943
  oe = [d], Array.from(e.children).forEach((o) => {
943
944
  const c = window.getComputedStyle(o), p = parseInt(
944
945
  s ? c.marginLeft + c.marginRight : c.marginTop + c.marginBottom
@@ -946,7 +947,7 @@ const ze = (e, t, n) => {
946
947
  oe.push(d + f + p), d += f + p;
947
948
  });
948
949
  };
949
- function ft(e) {
950
+ function ht(e) {
950
951
  const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
951
952
  if (t === "flex")
952
953
  return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
@@ -959,33 +960,33 @@ function ft(e) {
959
960
  }
960
961
  return t === "block" ? "vertical" : "horizontal";
961
962
  }
962
- const ir = Je((e) => {
963
- const t = e.target, n = ft(t);
963
+ const sr = Ve((e) => {
964
+ const t = e.target, n = ht(t);
964
965
  if (n === "vertical") {
965
966
  const s = e.clientY - t.offsetTop;
966
- ze(t, n, s);
967
+ Ye(t, n, s);
967
968
  } else {
968
969
  const s = e.clientX - t.offsetLeft;
969
- ze(t, n, s);
970
+ Ye(t, n, s);
970
971
  }
971
- }, 200), ar = (e) => {
972
- e.preventDefault(), e.stopPropagation(), ir(e);
972
+ }, 200), ir = (e) => {
973
+ e.preventDefault(), e.stopPropagation(), sr(e);
973
974
  };
974
975
  function xe() {
975
976
  const e = Y == null ? void 0 : Y.getElementById("placeholder");
976
977
  e.style.display = "none";
977
978
  }
978
- const lr = () => {
979
- const { document: e } = ue(), [t, n] = F(pn), s = On(), i = st("dnd"), [, a] = Q(), [, d] = U();
979
+ const ar = () => {
980
+ const { document: e } = ue(), [t, n] = N(fn), s = _n(), i = st("dnd"), [, l] = Q(), [, d] = U();
980
981
  return Y = e, {
981
982
  isDragging: t,
982
983
  "data-dnd": "branch",
983
- onDragOver: i ? ar : te,
984
+ onDragOver: i ? ir : te,
984
985
  onDrop: i ? (o) => {
985
986
  ne == null || ne.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
986
987
  const c = JSON.parse(o.dataTransfer.getData("text/plain"));
987
988
  let p = o.target.getAttribute("data-block-id");
988
- p === null && (p = o.target.parentElement.getAttribute("data-block-id")), s({ block: c, dropTargetId: p || null, relativeIndex: pt }), n(!1), xe(), setTimeout(() => {
989
+ p === null && (p = o.target.parentElement.getAttribute("data-block-id")), s({ block: c, dropTargetId: p || null, relativeIndex: ft }), n(!1), xe(), setTimeout(() => {
989
990
  xe();
990
991
  }, 300);
991
992
  } : te,
@@ -993,7 +994,7 @@ const lr = () => {
993
994
  const c = o;
994
995
  ne = c.target, c.stopPropagation(), c.preventDefault(), oe = [];
995
996
  const p = c.target;
996
- sr(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), a(""), d([]);
997
+ or(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), l(""), d([]);
997
998
  } : te,
998
999
  onDragLeave: i ? (o) => {
999
1000
  const c = o;
@@ -1004,21 +1005,21 @@ const lr = () => {
1004
1005
  } : te
1005
1006
  };
1006
1007
  };
1007
- function Se(e) {
1008
+ function Be(e) {
1008
1009
  return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
1009
1010
  }
1010
- function cr(e) {
1011
+ function lr(e) {
1011
1012
  e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
1012
1013
  var t = document.querySelector(".ql-toolbar");
1013
1014
  t && t.parentNode.removeChild(t), e = null;
1014
1015
  }
1015
- const dr = () => {
1016
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = Q(), [s, i] = F(X);
1017
- return (a) => {
1016
+ const cr = () => {
1017
+ const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = hn(), [, n] = Q(), [s, i] = N(G);
1018
+ return (l) => {
1018
1019
  var h;
1019
1020
  if (s)
1020
1021
  return;
1021
- const d = Se(a.target), o = d.getAttribute("data-block-type");
1022
+ const d = Be(l.target), o = d.getAttribute("data-block-type");
1022
1023
  if (!o || !e.includes(o))
1023
1024
  return;
1024
1025
  const c = d.cloneNode(!0);
@@ -1028,38 +1029,38 @@ const dr = () => {
1028
1029
  const p = new Bn(c, { placeholder: "Type here..." });
1029
1030
  function f() {
1030
1031
  const g = p.getText(0, p.getLength());
1031
- t([d.getAttribute("data-block-id")], { content: g }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0), cr(p), i(""), n("");
1032
+ t([d.getAttribute("data-block-id")], { content: g }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0), lr(p), i(""), n("");
1032
1033
  }
1033
1034
  c.addEventListener("blur", f, !0), p.focus(), (h = c.querySelector(".ql-clipboard")) == null || h.remove(), i(d.getAttribute("data-block-id"));
1034
1035
  };
1035
- }, ur = () => {
1036
- const [, e] = Z(), [, t] = U(), [n] = F(X);
1036
+ }, dr = () => {
1037
+ const [, e] = X(), [, t] = U(), [n] = N(G);
1037
1038
  return (s) => {
1038
1039
  if (n)
1039
1040
  return;
1040
1041
  s.stopPropagation();
1041
- const i = Se(s.target);
1042
+ const i = Be(s.target);
1042
1043
  if (i != null && i.getAttribute("data-block-parent")) {
1043
- const a = i.getAttribute("data-style-prop"), d = i.getAttribute("data-style-id"), o = i.getAttribute("data-block-parent");
1044
- e([{ id: d, prop: a, blockId: o }]), t([o]);
1044
+ const l = i.getAttribute("data-style-prop"), d = i.getAttribute("data-style-id"), o = i.getAttribute("data-block-parent");
1045
+ e([{ id: d, prop: l, blockId: o }]), t([o]);
1045
1046
  } else
1046
1047
  i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
1047
1048
  };
1048
- }, pr = Je((e, t) => {
1049
- const n = Se(e.target);
1049
+ }, ur = Ve((e, t) => {
1050
+ const n = Be(e.target);
1050
1051
  n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
1051
- }, 100), fr = () => {
1052
- const [, e] = Q(), [t] = F(X);
1052
+ }, 100), pr = () => {
1053
+ const [, e] = Q(), [t] = N(G);
1053
1054
  return (n) => {
1054
- t || pr(n, e);
1055
+ t || ur(n, e);
1055
1056
  };
1056
- }, hr = ({ children: e }) => {
1057
- const { document: t } = ue(), [n] = U(), [s, i] = Z();
1057
+ }, fr = ({ children: e }) => {
1058
+ const { document: t } = ue(), [n] = U(), [s, i] = X();
1058
1059
  M(() => {
1059
1060
  setTimeout(() => {
1060
1061
  if (!K(s))
1061
1062
  return;
1062
- const p = ht(t, ae(n));
1063
+ const p = gt(t, ae(n));
1063
1064
  if (p) {
1064
1065
  const f = p.getAttribute("data-style-prop");
1065
1066
  if (f) {
@@ -1069,24 +1070,25 @@ const dr = () => {
1069
1070
  }
1070
1071
  }, 100);
1071
1072
  }, [t, n, i, s]);
1072
- const a = dr(), d = ur(), o = fr(), c = lr();
1073
+ const l = cr(), d = dr(), o = pr(), c = ar();
1073
1074
  return /* @__PURE__ */ r.jsx(
1074
1075
  "div",
1075
1076
  {
1077
+ "data-block-id": "container",
1076
1078
  id: "canvas",
1077
1079
  onClick: d,
1078
- onDoubleClick: a,
1080
+ onDoubleClick: l,
1079
1081
  onMouseMove: o,
1080
- ...Et(c, "isDragging"),
1081
- className: "relative mb-5 max-w-full " + (c.isDragging ? "dragging" : ""),
1082
+ ...St(c, "isDragging"),
1083
+ className: "relative mb-5 h-full max-w-full " + (c.isDragging ? "dragging" : ""),
1082
1084
  children: e
1083
1085
  }
1084
1086
  );
1085
- }, ht = (e, t) => e.querySelector(`[data-block-id="${t}"]`), gr = () => {
1086
- const { window: e } = ue(), [t, n] = U(), s = Ie(), [, i] = Z(), { undo: a, redo: d } = Te(), o = Xe(), [, c] = hn(), [, p] = gn(), { pasteBlocks: f } = mn(), [, h] = et(), g = tt(), { savePage: E } = yn(), [A] = F(X), [, b] = F(vn), S = (O) => {
1087
+ }, gt = (e, t) => e.querySelector(`[data-block-id="${t}"]`), hr = () => {
1088
+ const { window: e } = ue(), [t, n] = U(), s = Se(), [, i] = X(), { undo: l, redo: d } = Ce(), o = Ge(), [, c] = gn(), [, p] = mn(), { pasteBlocks: f } = yn(), [, h] = et(), g = tt(), { savePage: E } = vn(), [A] = N(G), [, b] = N(xn), S = (O) => {
1087
1089
  O.key === "Enter" && (O.preventDefault(), t.length === 1 && b(ae(t)));
1088
- }, D = (O) => {
1089
- const w = s.find((N) => N._id === O);
1090
+ }, B = (O) => {
1091
+ const w = s.find((F) => F._id === O);
1090
1092
  return w ? w._parent : null;
1091
1093
  };
1092
1094
  return M(() => {
@@ -1098,15 +1100,15 @@ const dr = () => {
1098
1100
  if (S(w), !A && (w.key === "Delete" || w.key === "Backspace") && (w.preventDefault(), g(t)), w.ctrlKey || w.metaKey) {
1099
1101
  if (w.key === "ArrowUp") {
1100
1102
  w.preventDefault();
1101
- const N = t.length > 0 ? D(t[0]) : null;
1102
- N && n([N]);
1103
+ const F = t.length > 0 ? B(t[0]) : null;
1104
+ F && n([F]);
1103
1105
  }
1104
1106
  if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(w.key)) {
1105
1107
  if (A && ["x", "z", "v"].includes(w.key))
1106
1108
  return !0;
1107
1109
  w.preventDefault();
1108
1110
  }
1109
- w.key === "s" && (w.stopPropagation(), w.preventDefault(), E()), w.key === "z" && a(), w.key === "y" && d(), w.key === "d" && o(t), w.key === "x" && c(t), w.key === "c" && p(t), w.key === "v" && t.length > 0 && f(t[0]);
1111
+ w.key === "s" && (w.stopPropagation(), w.preventDefault(), E()), w.key === "z" && l(), w.key === "y" && d(), w.key === "d" && o(t), w.key === "x" && c(t), w.key === "c" && p(t), w.key === "v" && t.length > 0 && f(t[0]);
1110
1112
  }
1111
1113
  };
1112
1114
  return e.removeEventListener("keydown", O), e.addEventListener("keydown", O), () => {
@@ -1115,7 +1117,7 @@ const dr = () => {
1115
1117
  }, [
1116
1118
  t,
1117
1119
  n,
1118
- a,
1120
+ l,
1119
1121
  g,
1120
1122
  h,
1121
1123
  d,
@@ -1127,34 +1129,34 @@ const dr = () => {
1127
1129
  E,
1128
1130
  e
1129
1131
  ]), null;
1130
- }, mr = ({ block: e, label: t }) => {
1131
- const [, n] = U(), [, s] = Q(), [, i] = F(nt), a = st("dnd");
1132
+ }, gr = ({ block: e, label: t }) => {
1133
+ const [, n] = U(), [, s] = Q(), [, i] = N(nt), l = st("dnd");
1132
1134
  return /* @__PURE__ */ r.jsxs(
1133
1135
  "div",
1134
1136
  {
1135
1137
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
1136
- draggable: a ? "true" : "false",
1138
+ draggable: l ? "true" : "false",
1137
1139
  onDragStart: (d) => {
1138
- d.dataTransfer.setData("text/plain", JSON.stringify(St(e, ["_id", "_type"]))), i(e._id), setTimeout(() => {
1140
+ d.dataTransfer.setData("text/plain", JSON.stringify(Dt(e, ["_id", "_type"]))), i(e._id), setTimeout(() => {
1139
1141
  n([]), s(null);
1140
1142
  }, 200);
1141
1143
  },
1142
1144
  children: [
1143
- /* @__PURE__ */ r.jsx(Nt, {}),
1145
+ /* @__PURE__ */ r.jsx(Ft, {}),
1144
1146
  t
1145
1147
  ]
1146
1148
  }
1147
1149
  );
1148
- }, yr = ({ selectedBlockElement: e, block: t }) => {
1149
- const n = tt(), s = Xe(), [, i] = U(), [, a] = Z(), [d] = F(X), { floatingStyles: o, refs: c, update: p } = Rn({
1150
+ }, mr = ({ selectedBlockElement: e, block: t }) => {
1151
+ const n = tt(), s = Ge(), [, i] = U(), [, l] = X(), [d] = N(G), { floatingStyles: o, refs: c, update: p } = An({
1150
1152
  placement: "top-start",
1151
- middleware: [Pn(), An()],
1153
+ middleware: [Pn(), On()],
1152
1154
  elements: {
1153
1155
  reference: e
1154
1156
  }
1155
1157
  });
1156
- Mn(e, () => p(), e !== null);
1157
- const f = B(t, "_parent", null), h = K(B(t, "_name", "")) ? B(t, "_type", "") : B(t, "_name", "");
1158
+ Rn(e, () => p(), e !== null);
1159
+ const f = D(t, "_parent", null), h = K(D(t, "_name", "")) ? D(t, "_type", "") : D(t, "_name", "");
1158
1160
  return !e || !t || d ? null : /* @__PURE__ */ r.jsxs(
1159
1161
  "div",
1160
1162
  {
@@ -1168,25 +1170,25 @@ const dr = () => {
1168
1170
  onKeyDown: (g) => g.stopPropagation(),
1169
1171
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
1170
1172
  children: [
1171
- /* @__PURE__ */ r.jsx(mr, { label: h, block: t }),
1173
+ /* @__PURE__ */ r.jsx(gr, { label: h, block: t }),
1172
1174
  /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1 ", children: [
1173
1175
  f && /* @__PURE__ */ r.jsx(
1174
- Ft,
1176
+ $t,
1175
1177
  {
1176
1178
  className: "hover:scale-105 ",
1177
1179
  onClick: () => {
1178
- a([]), i([f]);
1180
+ l([]), i([f]);
1179
1181
  }
1180
1182
  }
1181
1183
  ),
1182
- xn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105 ", onClick: () => s([t == null ? void 0 : t._id]) }) : null,
1183
- bn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx($t, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1184
+ bn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105 ", onClick: () => s([t == null ? void 0 : t._id]) }) : null,
1185
+ kn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Ht, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1184
1186
  ] })
1185
1187
  ]
1186
1188
  }
1187
1189
  );
1188
- }, vr = ({ model: e }) => {
1189
- const [t] = kn(), [n] = U(), [s] = Ze(), [i] = Q(), [a] = Z(), [d] = F(nt), { document: o, window: c } = ue(), [p] = q(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = q(
1190
+ }, yr = ({ model: e }) => {
1191
+ const [t] = wn(), [n] = U(), [s] = Ze(), [i] = Q(), [l] = X(), [d] = N(nt), { document: o, window: c } = ue(), [p] = q(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = q(
1190
1192
  o == null ? void 0 : o.getElementById("selected-block")
1191
1193
  ), [h] = q(
1192
1194
  o == null ? void 0 : o.getElementById("selected-styling-block")
@@ -1194,14 +1196,14 @@ const dr = () => {
1194
1196
  M(() => {
1195
1197
  s ? o == null || o.documentElement.classList.add("dark") : o == null || o.documentElement.classList.remove("dark");
1196
1198
  }, [s, o]);
1197
- const E = B(t, "headingFont", "DM Sans"), A = B(t, "bodyFont", "DM Sans");
1199
+ const E = D(t, "headingFont", "DM Sans"), A = D(t, "bodyFont", "DM Sans");
1198
1200
  return M(() => {
1199
- const b = B(t, "primaryColor", "#000"), S = B(t, "secondaryColor", "#FFF"), D = Ln({
1201
+ const b = D(t, "primaryColor", "#000"), S = D(t, "secondaryColor", "#FFF"), B = Mn({
1200
1202
  colors: [b, S],
1201
1203
  names: ["primary", "secondary"]
1202
1204
  });
1203
- D.primary.DEFAULT = b, D.secondary.DEFAULT = S;
1204
- const O = B(t, "roundedCorners", "0");
1205
+ B.primary.DEFAULT = b, B.secondary.DEFAULT = S;
1206
+ const O = D(t, "roundedCorners", "0");
1205
1207
  !c || !c.tailwind || (c.tailwind.config = {
1206
1208
  darkMode: "class",
1207
1209
  theme: {
@@ -1213,19 +1215,19 @@ const dr = () => {
1213
1215
  borderRadius: {
1214
1216
  global: `${O || "0"}px`
1215
1217
  },
1216
- colors: D
1218
+ colors: B
1217
1219
  }
1218
1220
  },
1219
1221
  plugins: [
1220
1222
  // @ts-ignore
1221
- c.tailwind.plugin.withOptions(({ prefix: w = "ui" } = {}) => ({ addVariant: N }) => {
1222
- for (const W of ["open", "checked", "selected", "active", "disabled"])
1223
- N(`${w}-${W}`, [
1224
- `&[data-headlessui-state~="${W}"]`,
1225
- `:where([data-headlessui-state~="${W}"]) &`
1226
- ]), N(`${w}-not-${W}`, [
1227
- `&[data-headlessui-state]:not([data-headlessui-state~="${W}"])`,
1228
- `:where([data-headlessui-state]:not([data-headlessui-state~="${W}"])) &:not([data-headlessui-state])`
1223
+ c.tailwind.plugin.withOptions(({ prefix: w = "ui" } = {}) => ({ addVariant: F }) => {
1224
+ for (const $ of ["open", "checked", "selected", "active", "disabled"])
1225
+ F(`${w}-${$}`, [
1226
+ `&[data-headlessui-state~="${$}"]`,
1227
+ `:where([data-headlessui-state~="${$}"]) &`
1228
+ ]), F(`${w}-not-${$}`, [
1229
+ `&[data-headlessui-state]:not([data-headlessui-state~="${$}"])`,
1230
+ `:where([data-headlessui-state]:not([data-headlessui-state~="${$}"])) &:not([data-headlessui-state])`
1229
1231
  ]);
1230
1232
  })
1231
1233
  ]
@@ -1243,12 +1245,12 @@ const dr = () => {
1243
1245
  }, [d]), M(() => {
1244
1246
  p && (p.textContent = i ? `[data-style-id="${i}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1245
1247
  }, [i, n, p]), M(() => {
1246
- h && (h.textContent = `${re(a, ({ id: b }) => `[data-style-id="${b}"]`).join(",")}{
1248
+ h && (h.textContent = `${re(l, ({ id: b }) => `[data-style-id="${b}"]`).join(",")}{
1247
1249
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1248
1250
  }`);
1249
- }, [a, h]), M(() => {
1250
- const b = B(t, "bodyTextLightColor", "#64748b"), S = B(t, "bodyTextDarkColor", "#94a3b8"), D = B(t, "bodyBgLightColor", "#FFFFFF"), O = B(t, "bodyBgDarkColor", "#0f172a");
1251
- o.body.className = `font-body antialiased text-[${b}] bg-[${D}] dark:text-[${S}] dark:bg-[${O}]`;
1251
+ }, [l, h]), M(() => {
1252
+ const b = D(t, "bodyTextLightColor", "#64748b"), S = D(t, "bodyTextDarkColor", "#94a3b8"), B = D(t, "bodyBgLightColor", "#FFFFFF"), O = D(t, "bodyBgDarkColor", "#0f172a");
1253
+ o.body.className = `font-body antialiased text-[${b}] bg-[${B}] dark:text-[${S}] dark:bg-[${O}]`;
1252
1254
  }, [t, o, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1253
1255
  E && /* @__PURE__ */ r.jsx(
1254
1256
  "link",
@@ -1278,100 +1280,100 @@ const dr = () => {
1278
1280
  ),
1279
1281
  E && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${E}",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";}` })
1280
1282
  ] }) : null;
1281
- }, xr = (e) => {
1283
+ }, vr = (e) => {
1282
1284
  const t = {};
1283
1285
  return Object.keys(e).forEach((n) => {
1284
- je(e[n]) && e[n].startsWith(Me) && (t[n] = e[n].replace(Me, "").split(","));
1286
+ Te(e[n]) && e[n].startsWith(Le) && (t[n] = e[n].replace(Le, "").split(","));
1285
1287
  }), t;
1286
- }, br = Dt((e) => {
1288
+ }, xr = Bt((e) => {
1287
1289
  const t = e.replace(it, "").split(",");
1288
- return Fn(t[0], t[1]);
1290
+ return Nn(t[0], t[1]);
1289
1291
  });
1290
- function kr(e, t) {
1291
- return B(e, `${t}_attrs`, {});
1292
+ function br(e, t) {
1293
+ return D(e, `${t}_attrs`, {});
1292
1294
  }
1293
- function wr(e) {
1295
+ function kr(e) {
1294
1296
  const t = {};
1295
1297
  return Object.keys(e).forEach((n) => {
1296
- if (je(e[n]) && e[n].startsWith(it)) {
1297
- const s = br(e[n]);
1298
+ if (Te(e[n]) && e[n].startsWith(it)) {
1299
+ const s = xr(e[n]);
1298
1300
  t[n] = {
1299
1301
  className: s,
1300
1302
  "data-style-prop": n,
1301
1303
  "data-block-parent": e._id,
1302
1304
  "data-style-id": `${n}-${e._id}`,
1303
- ...kr(e, n)
1305
+ ...br(e, n)
1304
1306
  };
1305
1307
  }
1306
1308
  }), t;
1307
1309
  }
1308
- function jr(e, t) {
1309
- const n = B(e, "_bindings", {});
1310
+ function wr(e, t) {
1311
+ const n = D(e, "_bindings", {});
1310
1312
  return K(n) ? { ...e } : (_t(n, (s, i) => {
1311
- je(s) && B(t, s, null) && (e[i] = B(t, s, null));
1313
+ Te(s) && D(t, s, null) && (e[i] = D(t, s, null));
1312
1314
  }), e);
1313
1315
  }
1314
- function ke({ blocks: e }) {
1315
- const t = Ie(), n = we((a) => wr(a), []), [s] = Sn(), [i] = wn(X);
1316
+ function we({ blocks: e }) {
1317
+ const t = Se(), n = je((l) => kr(l), []), [s] = En(), [i] = N(G);
1316
1318
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: V.Children.toArray(
1317
- e.map((a, d) => {
1318
- if (i === a._id)
1319
+ e.map((l, d) => {
1320
+ if (i === l._id)
1319
1321
  return null;
1320
- const o = xr(a), c = {};
1322
+ const o = vr(l), c = {};
1321
1323
  K(o) || Object.keys(o).forEach((g) => {
1322
1324
  c[g] = V.Children.toArray(
1323
- o[g].map((E) => /* @__PURE__ */ r.jsx(ke, { blocks: [Bt(t, { _id: E })] }))
1325
+ o[g].map((E) => /* @__PURE__ */ r.jsx(we, { blocks: [Ot(t, { _id: E })] }))
1324
1326
  );
1325
1327
  });
1326
- const p = Ve(t, { _parent: a._id });
1327
- c.children = p.length ? /* @__PURE__ */ r.jsx(ke, { blocks: p }) : null;
1328
- const f = Wn(a._type), h = B(f, "component", null);
1329
- return Ot(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${a == null ? void 0 : a._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ke, { children: V.createElement(h, {
1328
+ const p = Xe(t, { _parent: l._id });
1329
+ c.children = p.length ? /* @__PURE__ */ r.jsx(we, { blocks: p }) : null;
1330
+ const f = at(l._type), h = D(f, "builderComponent", D(f, "component", null));
1331
+ return At(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Je, { children: V.createElement(h, {
1330
1332
  blockProps: {
1331
- "data-block-id": a._id,
1332
- "data-block-type": a._type,
1333
- "data-dnd": jn(a._type) ? "branch" : "leaf"
1333
+ "data-block-id": l._id,
1334
+ "data-block-type": l._type,
1335
+ "data-dnd": Fn(f, "canAcceptBlock") ? "branch" : "leaf"
1334
1336
  },
1335
1337
  inBuilder: !0,
1336
1338
  index: d,
1337
- ...jr(a, s),
1338
- ...n(a),
1339
+ ...wr(l, s),
1340
+ ...n(l),
1339
1341
  ...c
1340
1342
  }) });
1341
1343
  })
1342
1344
  ) });
1343
1345
  }
1344
- const Tr = () => {
1345
- const e = Ie();
1346
- return /* @__PURE__ */ r.jsx(Nn, { children: K(e) ? null : /* @__PURE__ */ r.jsx(Dn, { children: /* @__PURE__ */ r.jsx(ke, { blocks: Ve(e, (t) => K(t._parent)) }) }) });
1347
- }, Cr = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Ir = () => {
1348
- const [e] = F(Tn), [t] = et(), [n] = Ce(), [, s] = U(), i = Cn(), [, a] = Q(), d = Be(null), o = Be(null), [c, p] = q({ width: 0, height: 0 }), f = Jn(c), [h, g] = q(0), [E, A] = q([]), [, b] = q([]), [, S] = F(In), [D, O] = Z(), w = Ge("loadingCanvas", !1);
1346
+ const jr = () => {
1347
+ const e = Se(), t = Ee("container", null), n = K(e) ? null : /* @__PURE__ */ r.jsx(Sn, { children: /* @__PURE__ */ r.jsx(we, { blocks: Xe(e, (i) => K(i._parent)) }) }), s = t ? be(at(t).component, {}, n) : n;
1348
+ return /* @__PURE__ */ r.jsx(Ln, { children: s });
1349
+ }, Tr = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Cr = () => {
1350
+ const [e] = N(jn), [t] = et(), [n] = Ie(), [, s] = U(), i = Tn(), [, l] = Q(), d = Oe(null), o = Oe(null), [c, p] = q({ width: 0, height: 0 }), f = Kn(c), [h, g] = q(0), [E, A] = q([]), [, b] = q([]), [, S] = N(Cn), [B, O] = X(), w = Ee("loadingCanvas", !1);
1349
1351
  M(() => {
1350
- const { clientWidth: _, clientHeight: $ } = o.current;
1351
- p({ width: _, height: $ }), h === 0 && g(_);
1352
+ const { clientWidth: _, clientHeight: W } = o.current;
1353
+ p({ width: _, height: W }), h === 0 && g(_);
1352
1354
  }, [o, n, h]);
1353
- const N = (_, $ = 0) => {
1355
+ const F = (_, W = 0) => {
1354
1356
  const { top: H } = _.getBoundingClientRect();
1355
- return H + $ >= 0 && H - $ <= window.innerHeight;
1357
+ return H + W >= 0 && H - W <= window.innerHeight;
1356
1358
  };
1357
1359
  M(() => {
1358
- var _, $;
1360
+ var _, W;
1359
1361
  if (i && i.type !== "Multiple" && d.current) {
1360
- const H = ht(d.current.contentDocument, i._id);
1361
- H && (N(H) || ($ = (_ = d.current) == null ? void 0 : _.contentWindow) == null || $.scrollTo({ top: H.offsetTop, behavior: "smooth" }), A([H]));
1362
+ const H = gt(d.current.contentDocument, i._id);
1363
+ H && (F(H) || (W = (_ = d.current) == null ? void 0 : _.contentWindow) == null || W.scrollTo({ top: H.offsetTop, behavior: "smooth" }), A([H]));
1362
1364
  }
1363
1365
  }, [i]), M(() => {
1364
- if (!K(D) && d.current) {
1365
- const _ = Cr(
1366
+ if (!K(B) && d.current) {
1367
+ const _ = Tr(
1366
1368
  d.current.contentDocument,
1367
- ae(D).id
1369
+ ae(B).id
1368
1370
  );
1369
1371
  b(_ ? [_] : [null]);
1370
1372
  } else
1371
1373
  b([null]);
1372
- }, [D]);
1373
- const W = Ct(() => {
1374
- let _ = Kn;
1374
+ }, [B]);
1375
+ const $ = It(() => {
1376
+ let _ = Yn;
1375
1377
  return e === "offline" && (_ = _.replace(
1376
1378
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1377
1379
  "/offline/tailwind.cdn.js"
@@ -1383,30 +1385,30 @@ const Tr = () => {
1383
1385
  onClick: () => {
1384
1386
  s([]), O([]);
1385
1387
  },
1386
- onMouseLeave: () => setTimeout(() => a(""), 300),
1388
+ onMouseLeave: () => setTimeout(() => l(""), 300),
1387
1389
  className: "relative mx-auto overflow-hidden h-full w-full",
1388
1390
  style: h > 0 && !K(f) ? { width: t ? "100%" : h } : {},
1389
1391
  ref: o,
1390
1392
  children: /* @__PURE__ */ r.jsxs(
1391
- rr,
1393
+ nr,
1392
1394
  {
1393
1395
  contentDidMount: () => S(d.current),
1394
1396
  ref: d,
1395
1397
  id: "canvas-iframe",
1396
1398
  style: { width: `${n}px`, ...f },
1397
1399
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1398
- initialContent: W,
1400
+ initialContent: $,
1399
1401
  children: [
1400
- /* @__PURE__ */ r.jsx(gr, {}),
1402
+ /* @__PURE__ */ r.jsx(hr, {}),
1401
1403
  /* @__PURE__ */ r.jsx(
1402
- yr,
1404
+ mr,
1403
1405
  {
1404
1406
  block: i,
1405
1407
  selectedBlockElement: ae(E)
1406
1408
  }
1407
1409
  ),
1408
- /* @__PURE__ */ r.jsx(vr, { model: "page" }),
1409
- /* @__PURE__ */ r.jsx(hr, { children: w ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Tr, {}) }),
1410
+ /* @__PURE__ */ r.jsx(yr, { model: "page" }),
1411
+ /* @__PURE__ */ r.jsx(fr, { children: w ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(jr, {}) }),
1410
1412
  /* @__PURE__ */ r.jsx("br", {}),
1411
1413
  /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
1412
1414
  ]
@@ -1414,10 +1416,10 @@ const Tr = () => {
1414
1416
  )
1415
1417
  }
1416
1418
  );
1417
- }, Mo = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1418
- /* @__PURE__ */ r.jsx(Yn, {}),
1419
- /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 px-2 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]", children: /* @__PURE__ */ r.jsx(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(_n, { children: /* @__PURE__ */ r.jsx(Ir, {}) }) }) })
1419
+ }, Ro = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1420
+ /* @__PURE__ */ r.jsx(zn, {}),
1421
+ /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(Je, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Dn, { children: /* @__PURE__ */ r.jsx(Cr, {}) }) }) })
1420
1422
  ] });
1421
1423
  export {
1422
- Mo as default
1424
+ Ro as default
1423
1425
  };