@chaibuilder/sdk 1.2.8 → 1.2.10-7.beta.1

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 (122) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
  3. package/dist/CodeEditor-bUqM7eCa.js +129 -0
  4. package/dist/STRINGS-Xxstm-7I.js +7 -0
  5. package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
  6. package/dist/Topbar-P7-9Rps1.js +124 -0
  7. package/dist/Topbar-xwQ4JUZD.cjs +1 -0
  8. package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
  9. package/dist/UnsplashImages-nQSvWPU0.js +244 -0
  10. package/dist/UploadImages-L9LlI-jl.cjs +1 -0
  11. package/dist/UploadImages-SVnIHigg.js +153 -0
  12. package/dist/context-menu-YGd09SE1.js +979 -0
  13. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  14. package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
  15. package/dist/controls-p9IwFnPx.cjs +1 -0
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-Ief2hJUZ.js +130 -0
  20. package/dist/iconBase-aZzpqff_.cjs +1 -0
  21. package/dist/index-3NV_rst1.js +9051 -0
  22. package/dist/index-qTKBamQ6.cjs +63 -0
  23. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  24. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-UiUFs2fK.js +44 -0
  27. package/dist/plugin-f6SDZ_Or.js +108 -0
  28. package/dist/plugin-jum1MjXp.cjs +1 -0
  29. package/dist/plugin-xOpS-UNV.cjs +1 -0
  30. package/dist/render.cjs +3 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +129 -85
  33. package/dist/runtime.cjs +1 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +2 -2
  37. package/dist/tailwind.cjs +1 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +16 -20
  40. package/dist/ui.cjs +1 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +363 -163
  43. package/dist/web-blocks.cjs +3 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +725 -766
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-EfZgx-gN.js +0 -1425
  52. package/dist/CanvasArea-rIDwPHl5.cjs +0 -60
  53. package/dist/CurrentPage-QNFPD078.cjs +0 -1
  54. package/dist/CurrentPage-ulHTz4MD.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-rehZkz78.js +0 -404
  58. package/dist/Layers-v-7k3W2I.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel-acGVGJf-.js +0 -69
  64. package/dist/PagesPanel-x5ms_LOD.cjs +0 -1
  65. package/dist/ProjectPanel-5BHQ5ANP.cjs +0 -1
  66. package/dist/ProjectPanel-aLFJq49M.js +0 -90
  67. package/dist/Settings-iOjfw5NQ.cjs +0 -1
  68. package/dist/Settings-v-txwlII.js +0 -2193
  69. package/dist/SidePanels-Vdc-J5wK.js +0 -349
  70. package/dist/SidePanels-t0g9ZQFT.cjs +0 -1
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-0YAI9dXr.cjs +0 -1
  80. package/dist/add-page-modal-6DlGzdA4.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/delete-page-modal-T_rlQfNd.js +0 -88
  85. package/dist/delete-page-modal-qXpi_2xR.cjs +0 -1
  86. package/dist/email-blocks.cjs +0 -1
  87. package/dist/email-blocks.d.ts +0 -3
  88. package/dist/email-blocks.js +0 -274
  89. package/dist/form-OVmsLOrc.js +0 -125
  90. package/dist/form-VbouZlAW.cjs +0 -1
  91. package/dist/functions-Ox_svtKm.cjs +0 -1
  92. package/dist/functions-xIebp8Aw.js +0 -23
  93. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  94. package/dist/html-to-json-57841sEK.js +0 -183
  95. package/dist/index-EGUphg4R.js +0 -41620
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-e0c8PmRQ.js +0 -205
  98. package/dist/index-gi1LIOCw.cjs +0 -1
  99. package/dist/index-jw8RxsTv.cjs +0 -206
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  102. package/dist/lib.cjs +0 -4
  103. package/dist/lib.d.ts +0 -78
  104. package/dist/lib.js +0 -1322
  105. package/dist/page-viewer-EoYYnA56.js +0 -115
  106. package/dist/page-viewer-Ou8vDXGV.cjs +0 -1
  107. package/dist/project-general-setting-92q4oEYv.cjs +0 -1
  108. package/dist/project-general-setting-DC_nADG-.js +0 -83
  109. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  110. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  111. package/dist/server.cjs +0 -1
  112. package/dist/server.d.ts +0 -299
  113. package/dist/server.js +0 -216
  114. package/dist/single-page-detail-QmmhR_h2.cjs +0 -1
  115. package/dist/single-page-detail-xtNZ9YxX.js +0 -222
  116. package/dist/studio.cjs +0 -1
  117. package/dist/studio.d.ts +0 -13
  118. package/dist/studio.js +0 -58
  119. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  120. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  121. package/dist/utils-AvyFzbPC.js +0 -1075
  122. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,1425 +0,0 @@
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
- import { j as r } from "./jsx-runtime-WbnYoNE9.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
- import { useTranslation as de } from "react-i18next";
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
- import { Quill as Bn } from "react-quill";
15
- import { u as _n } from "./useAddBlockByDrop-_nwI4W3q.js";
16
- import { useFeature as st } from "flagged";
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";
26
- import "@radix-ui/react-toggle";
27
- import "class-variance-authority";
28
- import "./utils-AvyFzbPC.js";
29
- import "clsx";
30
- import "@radix-ui/react-switch";
31
- import "@radix-ui/react-slot";
32
- import "@radix-ui/react-accordion";
33
- import "@radix-ui/react-alert-dialog";
34
- import "@radix-ui/react-dialog";
35
- import "@radix-ui/react-label";
36
- import "@radix-ui/react-scroll-area";
37
- import "@radix-ui/react-tabs";
38
- import "@radix-ui/react-tooltip";
39
- import "@radix-ui/react-popover";
40
- import "@radix-ui/react-menubar";
41
- import "@radix-ui/react-hover-card";
42
- import "@radix-ui/react-select";
43
- import "@radix-ui/react-dropdown-menu";
44
- import "@radix-ui/react-separator";
45
- import "@radix-ui/react-toast";
46
- import "cmdk";
47
- import "@radix-ui/react-context-menu";
48
- import "react-icons-picker";
49
- import "flat-to-nested";
50
- import "./Functions-7jnEwJyw.js";
51
- import "redux-undo";
52
- import "i18next";
53
- import "react-textarea-autosize";
54
- import "react-dnd";
55
- import "@minoru/react-dnd-treeview";
56
- import "react-hotkeys-hook";
57
- import "sonner";
58
- import "./html-to-json-57841sEK.js";
59
- import "himalaya";
60
- import "lucide-react";
61
- import "./web-blocks.js";
62
- import "./controls-XPXGHKht.js";
63
- const $n = () => {
64
- const { undoCount: e, redoCount: t, undo: n, redo: s } = Ce();
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(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
- ] });
69
- };
70
- function Wn() {
71
- const [e, t] = Ze(), { t: n } = de();
72
- return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
73
- /* @__PURE__ */ r.jsx(qt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
74
- /* @__PURE__ */ r.jsxs(
75
- Ut,
76
- {
77
- id: "dark-mode-switch",
78
- checked: e,
79
- onCheckedChange: () => {
80
- t(!e);
81
- },
82
- className: `${e ? "bg-violet-600" : "bg-violet-300"}
83
- relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,
84
- children: [
85
- /* @__PURE__ */ r.jsx("span", { className: "sr-only", children: n("use_setting") }),
86
- /* @__PURE__ */ r.jsx(
87
- "span",
88
- {
89
- "aria-hidden": "true",
90
- className: `${e ? "translate-x-5" : "translate-x-0"}
91
- pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`
92
- }
93
- )
94
- ]
95
- }
96
- )
97
- ] });
98
- }
99
- const Ne = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
100
- "svg",
101
- {
102
- className: e ? "rotate-90" : "",
103
- xmlns: "http://www.w3.org/2000/svg",
104
- viewBox: "0 0 13 13",
105
- xmlSpace: "preserve",
106
- width: 13,
107
- height: 13,
108
- children: [
109
- /* @__PURE__ */ r.jsx("g", { strokeWidth: 0 }),
110
- /* @__PURE__ */ r.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round" }),
111
- /* @__PURE__ */ r.jsx(
112
- "path",
113
- {
114
- d: "M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",
115
- style: {
116
- fill: "#000"
117
- }
118
- }
119
- )
120
- ]
121
- }
122
- ), Hn = [
123
- {
124
- title: "mobile_xs_title",
125
- content: "mobile_xs_content",
126
- breakpoint: "xs",
127
- icon: /* @__PURE__ */ r.jsx(Re, {}),
128
- width: 400
129
- },
130
- {
131
- title: "mobile_sm_title",
132
- content: "mobile_sm_content",
133
- breakpoint: "sm",
134
- icon: /* @__PURE__ */ r.jsx(Re, { className: "rotate-90" }),
135
- width: 640
136
- },
137
- {
138
- title: "tablet_md_title",
139
- content: "tablet_md_content",
140
- breakpoint: "md",
141
- icon: /* @__PURE__ */ r.jsx(Ne, {}),
142
- width: 800
143
- },
144
- {
145
- title: "tablet_lg_title",
146
- content: "tablet_lg_content",
147
- breakpoint: "lg",
148
- icon: /* @__PURE__ */ r.jsx(Ne, { landscape: !0 }),
149
- width: 1024
150
- },
151
- {
152
- title: "desktop_xl_title",
153
- content: "desktop_xl_content",
154
- breakpoint: "xl",
155
- icon: /* @__PURE__ */ r.jsx(Pt, {}),
156
- width: 1420
157
- },
158
- {
159
- title: "large_desktop_2xl_title",
160
- content: "large_desktop_2xl_content",
161
- breakpoint: "2xl",
162
- icon: /* @__PURE__ */ r.jsx(Rt, {}),
163
- width: 1920
164
- }
165
- ], Fe = ({
166
- title: e,
167
- content: t,
168
- currentBreakpoint: n,
169
- breakpoint: s,
170
- width: i,
171
- icon: l,
172
- onClick: d
173
- }) => {
174
- const { t: o } = de();
175
- return /* @__PURE__ */ r.jsxs(zt, { children: [
176
- /* @__PURE__ */ r.jsx(Yt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
177
- le,
178
- {
179
- onClick: () => d(i),
180
- size: "sm",
181
- variant: s === n ? "secondary" : "ghost",
182
- children: l
183
- }
184
- ) }),
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
- /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: o(e) }),
187
- /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: o(t) })
188
- ] }) }) })
189
- ] });
190
- }, qn = () => {
191
- const [, e, t] = Ie(), [n, s] = Jt(), { t: i } = de(), l = Ee("breakpoints", Hn), d = (o) => {
192
- n.includes(o) ? n.length > 2 && s(n.filter((c) => c !== o)) : s((c) => [...c, o]);
193
- };
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
- re(
196
- l.filter((o) => Ae(n, pe(o.breakpoint))),
197
- (o) => /* @__PURE__ */ be(Fe, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
198
- ),
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
- /* @__PURE__ */ r.jsxs(Zt, { className: "w-56 border-border text-xs", children: [
202
- /* @__PURE__ */ r.jsx(Qt, { children: i("Breakpoints") }),
203
- /* @__PURE__ */ r.jsx(Gt, {}),
204
- re(l, (o) => /* @__PURE__ */ r.jsx(
205
- en,
206
- {
207
- disabled: o.breakpoint === "xs",
208
- onCheckedChange: () => d(pe(o.breakpoint)),
209
- checked: Ae(n, pe(o.breakpoint)),
210
- children: i(o.title)
211
- },
212
- o.breakpoint
213
- ))
214
- ] })
215
- ] })
216
- ] });
217
- }, Un = () => {
218
- const { t: e } = de(), [t] = tn(), { createSnapshot: n } = Ce(), [, s] = U(), [, i] = X(), l = je(() => {
219
- t([]), s([]), i([]), n();
220
- }, [t, n]);
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
- " ",
225
- e("clear")
226
- ] }) }),
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
- ] }),
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
- ] })
236
- ] })
237
- ] }) });
238
- }, zn = () => {
239
- const e = pn("darkMode", !1), [t] = Qe();
240
- return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
241
- /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
242
- e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
243
- /* @__PURE__ */ r.jsx(Wn, {}),
244
- /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" })
245
- ] }) : null,
246
- /* @__PURE__ */ r.jsx(qn, {}),
247
- /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
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(Nt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
250
- " ",
251
- /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
252
- Et(t, 0),
253
- "%"
254
- ] })
255
- ] }),
256
- /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
257
- /* @__PURE__ */ r.jsx($n, {})
258
- ] }),
259
- /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
260
- /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
261
- /* @__PURE__ */ r.jsx(Un, {})
262
- ] })
263
- ] });
264
- }, Yn = `<!doctype html>
265
- <html class="scroll-smooth h-full overflow-y-auto">
266
- <head>
267
- <meta charset="UTF-8">
268
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
269
- <script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
270
- <style>
271
- html { height: 100%; overflow:auto; }
272
- body { height: 100%; }
273
- .air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
274
- .air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
275
- body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
276
- -moz-user-select: none;-ms-user-select: none; user-select: none; }
277
- html{
278
- -ms-overflow-style: none; /* IE and Edge */
279
- scrollbar-width: none; /* Firefox */
280
- }
281
- /** IMPORTANT: Make fields content editable in SAFARI */
282
- [contenteditable] {-webkit-user-select: text;user-select: text;}
283
-
284
- html::-webkit-scrollbar { width: 0 !important }
285
- .aspect-auto{aspect-ratio: auto;}
286
- .aspect-square{aspect-ratio: 1/1;}
287
- .aspect-video{aspect-ratio: 16/9;}
288
- .dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
289
- .dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
290
- a{ pointer-events: none !important; }
291
- [contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
292
- [contenteditable="true"] {
293
- outline: none;
294
- box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
295
- -webkit-user-select: text;
296
- -moz-user-select: text;
297
- user-select: text;
298
- }
299
- .frame-root .frame-content { height: 100%; }
300
- </style>
301
- <style id="hidden-blocks"></style>
302
- <style id="selected-block"></style>
303
- <style id="selected-styling-block"></style>
304
- <style id="highlighted-block"></style>
305
- <style id="dragged-block"></style>
306
-
307
- </head>
308
- <body class="font-body antialiased h-full">
309
- <div class="frame-root h-full"></div>
310
- <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
311
- </body>
312
- </html>`, Kn = (e) => {
313
- const [t] = Ie(), [, n] = Qe(), [s, i] = q({}), l = je(() => {
314
- const { width: d, height: o } = e;
315
- if (d < t) {
316
- const c = parseFloat((d / t).toFixed(2).toString());
317
- let p = {};
318
- const f = o * c;
319
- o && (p = {
320
- // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
321
- height: 100 + (o - f) / f * 100 + "%"
322
- }), i({
323
- position: "relative",
324
- top: 0,
325
- transform: `scale(${c})`,
326
- transformOrigin: "top left",
327
- ...p,
328
- maxWidth: "none"
329
- }), n(c * 100);
330
- } else
331
- i({}), n(100);
332
- }, [t, e, n]);
333
- return M(() => {
334
- l();
335
- }, [t, e, n, l]), s;
336
- };
337
- var ce = { exports: {} };
338
- /*
339
- object-assign
340
- (c) Sindre Sorhus
341
- @license MIT
342
- */
343
- var fe, $e;
344
- function Jn() {
345
- if ($e)
346
- return fe;
347
- $e = 1;
348
- var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
349
- function s(l) {
350
- if (l == null)
351
- throw new TypeError("Object.assign cannot be called with null or undefined");
352
- return Object(l);
353
- }
354
- function i() {
355
- try {
356
- if (!Object.assign)
357
- return !1;
358
- var l = new String("abc");
359
- if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
360
- return !1;
361
- for (var d = {}, o = 0; o < 10; o++)
362
- d["_" + String.fromCharCode(o)] = o;
363
- var c = Object.getOwnPropertyNames(d).map(function(f) {
364
- return d[f];
365
- });
366
- if (c.join("") !== "0123456789")
367
- return !1;
368
- var p = {};
369
- return "abcdefghijklmnopqrst".split("").forEach(function(f) {
370
- p[f] = f;
371
- }), Object.keys(Object.assign({}, p)).join("") === "abcdefghijklmnopqrst";
372
- } catch {
373
- return !1;
374
- }
375
- }
376
- return fe = i() ? Object.assign : function(l, d) {
377
- for (var o, c = s(l), p, f = 1; f < arguments.length; f++) {
378
- o = Object(arguments[f]);
379
- for (var h in o)
380
- t.call(o, h) && (c[h] = o[h]);
381
- if (e) {
382
- p = e(o);
383
- for (var g = 0; g < p.length; g++)
384
- n.call(o, p[g]) && (c[p[g]] = o[p[g]]);
385
- }
386
- }
387
- return c;
388
- }, fe;
389
- }
390
- var he, We;
391
- function De() {
392
- if (We)
393
- return he;
394
- We = 1;
395
- var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
396
- return he = e, he;
397
- }
398
- var ge, He;
399
- function lt() {
400
- return He || (He = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
401
- }
402
- var me, qe;
403
- function Vn() {
404
- if (qe)
405
- return me;
406
- qe = 1;
407
- var e = function() {
408
- };
409
- if (process.env.NODE_ENV !== "production") {
410
- var t = De(), n = {}, s = lt();
411
- e = function(l) {
412
- var d = "Warning: " + l;
413
- typeof console < "u" && console.error(d);
414
- try {
415
- throw new Error(d);
416
- } catch {
417
- }
418
- };
419
- }
420
- function i(l, d, o, c, p) {
421
- if (process.env.NODE_ENV !== "production") {
422
- for (var f in l)
423
- if (s(l, f)) {
424
- var h;
425
- try {
426
- if (typeof l[f] != "function") {
427
- var g = Error(
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`."
429
- );
430
- throw g.name = "Invariant Violation", g;
431
- }
432
- h = l[f](d, f, c, o, null, t);
433
- } catch (A) {
434
- h = A;
435
- }
436
- if (h && !(h instanceof Error) && e(
437
- (c || "React class") + ": type specification of " + o + " `" + f + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
438
- ), h instanceof Error && !(h.message in n)) {
439
- n[h.message] = !0;
440
- var E = p ? p() : "";
441
- e(
442
- "Failed " + o + " type: " + h.message + (E ?? "")
443
- );
444
- }
445
- }
446
- }
447
- }
448
- return i.resetWarningCache = function() {
449
- process.env.NODE_ENV !== "production" && (n = {});
450
- }, me = i, me;
451
- }
452
- var ye, Ue;
453
- function Xn() {
454
- if (Ue)
455
- return ye;
456
- Ue = 1;
457
- var e = ot, t = Jn(), n = De(), s = lt(), i = Vn(), l = function() {
458
- };
459
- process.env.NODE_ENV !== "production" && (l = function(o) {
460
- var c = "Warning: " + o;
461
- typeof console < "u" && console.error(c);
462
- try {
463
- throw new Error(c);
464
- } catch {
465
- }
466
- });
467
- function d() {
468
- return null;
469
- }
470
- return ye = function(o, c) {
471
- var p = typeof Symbol == "function" && Symbol.iterator, f = "@@iterator";
472
- function h(a) {
473
- var u = a && (p && a[p] || a[f]);
474
- if (typeof u == "function")
475
- return u;
476
- }
477
- var g = "<<anonymous>>", E = {
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"),
486
- any: O(),
487
- arrayOf: w,
488
- element: F(),
489
- elementType: $(),
490
- instanceOf: _,
491
- node: yt(),
492
- objectOf: H,
493
- oneOf: W,
494
- oneOfType: mt,
495
- shape: vt,
496
- exact: xt
497
- };
498
- function A(a, u) {
499
- return a === u ? a !== 0 || 1 / a === 1 / u : a !== a && u !== u;
500
- }
501
- function b(a, u) {
502
- this.message = a, this.data = u && typeof u == "object" ? u : {}, this.stack = "";
503
- }
504
- b.prototype = Error.prototype;
505
- function S(a) {
506
- if (process.env.NODE_ENV !== "production")
507
- var u = {}, k = 0;
508
- function v(j, y, x, T, I, C, L) {
509
- if (T = T || g, C = C || x, L !== n) {
510
- if (c) {
511
- var P = new Error(
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"
513
- );
514
- throw P.name = "Invariant Violation", P;
515
- } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
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(
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."
520
- ), u[Z] = !0, k++);
521
- }
522
- }
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);
524
- }
525
- var m = v.bind(null, !1);
526
- return m.isRequired = v.bind(null, !0), m;
527
- }
528
- function B(a) {
529
- function u(k, v, m, j, y, x) {
530
- var T = k[v], I = z(T);
531
- if (I !== a) {
532
- var C = ee(T);
533
- return new b(
534
- "Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected ") + ("`" + a + "`."),
535
- { expectedType: a }
536
- );
537
- }
538
- return null;
539
- }
540
- return S(u);
541
- }
542
- function O() {
543
- return S(d);
544
- }
545
- function w(a) {
546
- function u(k, v, m, j, y) {
547
- if (typeof a != "function")
548
- return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside arrayOf.");
549
- var x = k[v];
550
- if (!Array.isArray(x)) {
551
- var T = z(x);
552
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an array."));
553
- }
554
- for (var I = 0; I < x.length; I++) {
555
- var C = a(x, I, m, j, y + "[" + I + "]", n);
556
- if (C instanceof Error)
557
- return C;
558
- }
559
- return null;
560
- }
561
- return S(u);
562
- }
563
- function F() {
564
- function a(u, k, v, m, j) {
565
- var y = u[k];
566
- if (!o(y)) {
567
- var x = z(y);
568
- return new b("Invalid " + m + " `" + j + "` of type " + ("`" + x + "` supplied to `" + v + "`, expected a single ReactElement."));
569
- }
570
- return null;
571
- }
572
- return S(a);
573
- }
574
- function $() {
575
- function a(u, k, v, m, j) {
576
- var y = u[k];
577
- if (!e.isValidElementType(y)) {
578
- var x = z(y);
579
- return new b("Invalid " + m + " `" + j + "` of type " + ("`" + x + "` supplied to `" + v + "`, expected a single ReactElement type."));
580
- }
581
- return null;
582
- }
583
- return S(a);
584
- }
585
- function _(a) {
586
- function u(k, v, m, j, y) {
587
- if (!(k[v] instanceof a)) {
588
- var x = a.name || g, T = wt(k[v]);
589
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected ") + ("instance of `" + x + "`."));
590
- }
591
- return null;
592
- }
593
- return S(u);
594
- }
595
- function W(a) {
596
- if (!Array.isArray(a))
597
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? l(
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])."
599
- ) : l("Invalid argument supplied to oneOf, expected an array.")), d;
600
- function u(k, v, m, j, y) {
601
- for (var x = k[v], T = 0; T < a.length; T++)
602
- if (A(x, a[T]))
603
- return null;
604
- var I = JSON.stringify(a, function(L, P) {
605
- var Z = ee(P);
606
- return Z === "symbol" ? String(P) : P;
607
- });
608
- return new b("Invalid " + j + " `" + y + "` of value `" + String(x) + "` " + ("supplied to `" + m + "`, expected one of " + I + "."));
609
- }
610
- return S(u);
611
- }
612
- function H(a) {
613
- function u(k, v, m, j, y) {
614
- if (typeof a != "function")
615
- return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside objectOf.");
616
- var x = k[v], T = z(x);
617
- if (T !== "object")
618
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an object."));
619
- for (var I in x)
620
- if (s(x, I)) {
621
- var C = a(x, I, m, j, y + "." + I, n);
622
- if (C instanceof Error)
623
- return C;
624
- }
625
- return null;
626
- }
627
- return S(u);
628
- }
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];
634
- if (typeof k != "function")
635
- return l(
636
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + kt(k) + " at index " + u + "."
637
- ), d;
638
- }
639
- function v(m, j, y, x, T) {
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)
643
- return null;
644
- P.data && s(P.data, "expectedType") && I.push(P.data.expectedType);
645
- }
646
- var Z = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
647
- return new b("Invalid " + x + " `" + T + "` supplied to " + ("`" + y + "`" + Z + "."));
648
- }
649
- return S(v);
650
- }
651
- function yt() {
652
- function a(u, k, v, m, j) {
653
- return se(u[k]) ? null : new b("Invalid " + m + " `" + j + "` supplied to " + ("`" + v + "`, expected a ReactNode."));
654
- }
655
- return S(a);
656
- }
657
- function _e(a, u, k, v, m) {
658
- return new b(
659
- (a || "React class") + ": " + u + " type `" + k + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + m + "`."
660
- );
661
- }
662
- function vt(a) {
663
- function u(k, v, m, j, y) {
664
- var x = k[v], T = z(x);
665
- if (T !== "object")
666
- return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
667
- for (var I in a) {
668
- var C = a[I];
669
- if (typeof C != "function")
670
- return _e(m, j, y, I, ee(C));
671
- var L = C(x, I, m, j, y + "." + I, n);
672
- if (L)
673
- return L;
674
- }
675
- return null;
676
- }
677
- return S(u);
678
- }
679
- function xt(a) {
680
- function u(k, v, m, j, y) {
681
- var x = k[v], T = z(x);
682
- if (T !== "object")
683
- return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
684
- var I = t({}, k[v], a);
685
- for (var C in I) {
686
- var L = a[C];
687
- if (s(a, C) && typeof L != "function")
688
- return _e(m, j, y, C, ee(L));
689
- if (!L)
690
- return new b(
691
- "Invalid " + j + " `" + y + "` key `" + C + "` supplied to `" + m + "`.\nBad object: " + JSON.stringify(k[v], null, " ") + `
692
- Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
693
- );
694
- var P = L(x, C, m, j, y + "." + C, n);
695
- if (P)
696
- return P;
697
- }
698
- return null;
699
- }
700
- return S(u);
701
- }
702
- function se(a) {
703
- switch (typeof a) {
704
- case "number":
705
- case "string":
706
- case "undefined":
707
- return !0;
708
- case "boolean":
709
- return !a;
710
- case "object":
711
- if (Array.isArray(a))
712
- return a.every(se);
713
- if (a === null || o(a))
714
- return !0;
715
- var u = h(a);
716
- if (u) {
717
- var k = u.call(a), v;
718
- if (u !== a.entries) {
719
- for (; !(v = k.next()).done; )
720
- if (!se(v.value))
721
- return !1;
722
- } else
723
- for (; !(v = k.next()).done; ) {
724
- var m = v.value;
725
- if (m && !se(m[1]))
726
- return !1;
727
- }
728
- } else
729
- return !1;
730
- return !0;
731
- default:
732
- return !1;
733
- }
734
- }
735
- function bt(a, u) {
736
- return a === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
737
- }
738
- function z(a) {
739
- var u = typeof a;
740
- return Array.isArray(a) ? "array" : a instanceof RegExp ? "object" : bt(u, a) ? "symbol" : u;
741
- }
742
- function ee(a) {
743
- if (typeof a > "u" || a === null)
744
- return "" + a;
745
- var u = z(a);
746
- if (u === "object") {
747
- if (a instanceof Date)
748
- return "date";
749
- if (a instanceof RegExp)
750
- return "regexp";
751
- }
752
- return u;
753
- }
754
- function kt(a) {
755
- var u = ee(a);
756
- switch (u) {
757
- case "array":
758
- case "object":
759
- return "an " + u;
760
- case "boolean":
761
- case "date":
762
- case "regexp":
763
- return "a " + u;
764
- default:
765
- return u;
766
- }
767
- }
768
- function wt(a) {
769
- return !a.constructor || !a.constructor.name ? g : a.constructor.name;
770
- }
771
- return E.checkPropTypes = i, E.resetWarningCache = i.resetWarningCache, E.PropTypes = E, E;
772
- }, ye;
773
- }
774
- var ve, ze;
775
- function Zn() {
776
- if (ze)
777
- return ve;
778
- ze = 1;
779
- var e = De();
780
- function t() {
781
- }
782
- function n() {
783
- }
784
- return n.resetWarningCache = t, ve = function() {
785
- function s(d, o, c, p, f, h) {
786
- if (h !== e) {
787
- var g = new Error(
788
- "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"
789
- );
790
- throw g.name = "Invariant Violation", g;
791
- }
792
- }
793
- s.isRequired = s;
794
- function i() {
795
- return s;
796
- }
797
- var l = {
798
- array: s,
799
- bigint: s,
800
- bool: s,
801
- func: s,
802
- number: s,
803
- object: s,
804
- string: s,
805
- symbol: s,
806
- any: s,
807
- arrayOf: i,
808
- element: s,
809
- elementType: s,
810
- instanceOf: i,
811
- node: s,
812
- objectOf: i,
813
- oneOf: i,
814
- oneOfType: i,
815
- shape: i,
816
- exact: i,
817
- checkPropTypes: n,
818
- resetWarningCache: t
819
- };
820
- return l.PropTypes = l, l;
821
- }, ve;
822
- }
823
- var Ao = ce.exports;
824
- if (process.env.NODE_ENV !== "production") {
825
- var Qn = ot, Gn = !0;
826
- ce.exports = Xn()(Qn.isElement, Gn);
827
- } else
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 {
836
- componentDidMount() {
837
- this.props.contentDidMount();
838
- }
839
- componentDidUpdate() {
840
- this.props.contentDidUpdate();
841
- }
842
- render() {
843
- return Ct.only(this.props.children);
844
- }
845
- }
846
- J(pt, "propTypes", {
847
- children: R.element.isRequired,
848
- contentDidMount: R.func.isRequired,
849
- contentDidUpdate: R.func.isRequired
850
- });
851
- class ke extends Ke {
852
- constructor(n, s) {
853
- super(n, s);
854
- J(this, "setRef", (n) => {
855
- this.nodeRef.current = n;
856
- const { forwardedRef: s } = this.props;
857
- typeof s == "function" ? s(n) : s && (s.current = n);
858
- });
859
- J(this, "handleLoad", () => {
860
- clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
861
- });
862
- // In certain situations on a cold cache DOMContentLoaded never gets called
863
- // fallback to an interval to check if that's the case
864
- J(this, "loadCheck", () => setInterval(() => {
865
- this.handleLoad();
866
- }, 500));
867
- this._isMounted = !1, this.nodeRef = V.createRef(), this.state = { iframeLoaded: !1 };
868
- }
869
- componentDidMount() {
870
- this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
871
- }
872
- componentWillUnmount() {
873
- this._isMounted = !1, this.nodeRef.current.removeEventListener("DOMContentLoaded", this.handleLoad);
874
- }
875
- getDoc() {
876
- return this.nodeRef.current ? this.nodeRef.current.contentDocument : null;
877
- }
878
- getMountTarget() {
879
- const n = this.getDoc();
880
- return this.props.mountTarget ? n.querySelector(this.props.mountTarget) : n.body.children[0];
881
- }
882
- renderFrameContents() {
883
- if (!this._isMounted)
884
- return null;
885
- const n = this.getDoc();
886
- if (!n)
887
- return null;
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)];
890
- }
891
- render() {
892
- const n = {
893
- ...this.props,
894
- srcDoc: this.props.initialContent,
895
- children: void 0
896
- // The iframe isn't ready so we drop children from props here. #12, #17
897
- };
898
- return delete n.head, delete n.initialContent, delete n.mountTarget, delete n.contentDidMount, delete n.contentDidUpdate, delete n.forwardedRef, /* @__PURE__ */ r.jsx("iframe", { ...n, ref: this.setRef, onLoad: this.handleLoad, children: this.state.iframeLoaded && this.renderFrameContents() });
899
- }
900
- }
901
- // React warns when you render directly into the body since browser extensions
902
- // also inject into the body and can mess up React. For this reason
903
- // initialContent is expected to have a div inside of the body
904
- // element that we render react into.
905
- J(ke, "propTypes", {
906
- style: R.object,
907
- // eslint-disable-line
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", {
915
- style: {},
916
- head: null,
917
- children: void 0,
918
- mountTarget: void 0,
919
- contentDidMount: () => {
920
- },
921
- contentDidUpdate: () => {
922
- },
923
- initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
924
- });
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 };
930
- }
931
- const Ye = (e, t, n) => {
932
- if (!Y)
933
- return;
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";
936
- const p = oe.reduce(
937
- (f, h) => Math.abs(h - n) < Math.abs(f - n) ? h : f
938
- );
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;
943
- oe = [d], Array.from(e.children).forEach((o) => {
944
- const c = window.getComputedStyle(o), p = parseInt(
945
- s ? c.marginLeft + c.marginRight : c.marginTop + c.marginBottom
946
- ), f = s ? o.offsetWidth : o.offsetHeight;
947
- oe.push(d + f + p), d += f + p;
948
- });
949
- };
950
- function ht(e) {
951
- const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
952
- if (t === "flex")
953
- return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
954
- if (t === "grid") {
955
- const s = window.getComputedStyle(e).gridTemplateRows, i = window.getComputedStyle(e).gridTemplateColumns;
956
- if (s.includes("auto"))
957
- return "vertical";
958
- if (i.includes("auto"))
959
- return "horizontal";
960
- }
961
- return t === "block" ? "vertical" : "horizontal";
962
- }
963
- const sr = Ve((e) => {
964
- const t = e.target, n = ht(t);
965
- if (n === "vertical") {
966
- const s = e.clientY - t.offsetTop;
967
- Ye(t, n, s);
968
- } else {
969
- const s = e.clientX - t.offsetLeft;
970
- Ye(t, n, s);
971
- }
972
- }, 200), ir = (e) => {
973
- e.preventDefault(), e.stopPropagation(), sr(e);
974
- };
975
- function xe() {
976
- const e = Y == null ? void 0 : Y.getElementById("placeholder");
977
- e.style.display = "none";
978
- }
979
- const ar = () => {
980
- const { document: e } = ue(), [t, n] = N(fn), s = _n(), i = st("dnd"), [, l] = Q(), [, d] = U();
981
- return Y = e, {
982
- isDragging: t,
983
- "data-dnd": "branch",
984
- onDragOver: i ? ir : te,
985
- onDrop: i ? (o) => {
986
- ne == null || ne.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
987
- const c = JSON.parse(o.dataTransfer.getData("text/plain"));
988
- let p = o.target.getAttribute("data-block-id");
989
- p === null && (p = o.target.parentElement.getAttribute("data-block-id")), s({ block: c, dropTargetId: p || null, relativeIndex: ft }), n(!1), xe(), setTimeout(() => {
990
- xe();
991
- }, 300);
992
- } : te,
993
- onDragEnter: i ? (o) => {
994
- const c = o;
995
- ne = c.target, c.stopPropagation(), c.preventDefault(), oe = [];
996
- const p = c.target;
997
- or(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), l(""), d([]);
998
- } : te,
999
- onDragLeave: i ? (o) => {
1000
- const c = o;
1001
- ne = null, c.stopPropagation(), c.preventDefault(), c.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
1002
- } : te,
1003
- onMouseOut: i ? () => {
1004
- n(!1), xe();
1005
- } : te
1006
- };
1007
- };
1008
- function Be(e) {
1009
- return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
1010
- }
1011
- function lr(e) {
1012
- e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
1013
- var t = document.querySelector(".ql-toolbar");
1014
- t && t.parentNode.removeChild(t), e = null;
1015
- }
1016
- const cr = () => {
1017
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = hn(), [, n] = Q(), [s, i] = N(G);
1018
- return (l) => {
1019
- var h;
1020
- if (s)
1021
- return;
1022
- const d = Be(l.target), o = d.getAttribute("data-block-type");
1023
- if (!o || !e.includes(o))
1024
- return;
1025
- const c = d.cloneNode(!0);
1026
- d.style.display = "none", Array.from(c.attributes).forEach((g) => {
1027
- g.name !== "class" && c.removeAttribute(g.name);
1028
- }), o === "Text" && (c.style.display = "inline-block"), d.parentNode.insertBefore(c, d.nextSibling);
1029
- const p = new Bn(c, { placeholder: "Type here..." });
1030
- function f() {
1031
- const g = p.getText(0, p.getLength());
1032
- t([d.getAttribute("data-block-id")], { content: g }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0), lr(p), i(""), n("");
1033
- }
1034
- c.addEventListener("blur", f, !0), p.focus(), (h = c.querySelector(".ql-clipboard")) == null || h.remove(), i(d.getAttribute("data-block-id"));
1035
- };
1036
- }, dr = () => {
1037
- const [, e] = X(), [, t] = U(), [n] = N(G);
1038
- return (s) => {
1039
- if (n)
1040
- return;
1041
- s.stopPropagation();
1042
- const i = Be(s.target);
1043
- if (i != null && i.getAttribute("data-block-parent")) {
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]);
1046
- } else
1047
- i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
1048
- };
1049
- }, ur = Ve((e, t) => {
1050
- const n = Be(e.target);
1051
- n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
1052
- }, 100), pr = () => {
1053
- const [, e] = Q(), [t] = N(G);
1054
- return (n) => {
1055
- t || ur(n, e);
1056
- };
1057
- }, fr = ({ children: e }) => {
1058
- const { document: t } = ue(), [n] = U(), [s, i] = X();
1059
- M(() => {
1060
- setTimeout(() => {
1061
- if (!K(s))
1062
- return;
1063
- const p = gt(t, ae(n));
1064
- if (p) {
1065
- const f = p.getAttribute("data-style-prop");
1066
- if (f) {
1067
- const h = p.getAttribute("data-style-id"), g = p.getAttribute("data-block-parent");
1068
- i([{ id: h, prop: f, blockId: g }]);
1069
- }
1070
- }
1071
- }, 100);
1072
- }, [t, n, i, s]);
1073
- const l = cr(), d = dr(), o = pr(), c = ar();
1074
- return /* @__PURE__ */ r.jsx(
1075
- "div",
1076
- {
1077
- "data-block-id": "container",
1078
- id: "canvas",
1079
- onClick: d,
1080
- onDoubleClick: l,
1081
- onMouseMove: o,
1082
- ...St(c, "isDragging"),
1083
- className: "relative mb-5 h-full max-w-full " + (c.isDragging ? "dragging" : ""),
1084
- children: e
1085
- }
1086
- );
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) => {
1089
- O.key === "Enter" && (O.preventDefault(), t.length === 1 && b(ae(t)));
1090
- }, B = (O) => {
1091
- const w = s.find((F) => F._id === O);
1092
- return w ? w._parent : null;
1093
- };
1094
- return M(() => {
1095
- const O = (w) => {
1096
- if (w.key === "Escape") {
1097
- n([]), i([]);
1098
- return;
1099
- }
1100
- if (S(w), !A && (w.key === "Delete" || w.key === "Backspace") && (w.preventDefault(), g(t)), w.ctrlKey || w.metaKey) {
1101
- if (w.key === "ArrowUp") {
1102
- w.preventDefault();
1103
- const F = t.length > 0 ? B(t[0]) : null;
1104
- F && n([F]);
1105
- }
1106
- if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(w.key)) {
1107
- if (A && ["x", "z", "v"].includes(w.key))
1108
- return !0;
1109
- w.preventDefault();
1110
- }
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]);
1112
- }
1113
- };
1114
- return e.removeEventListener("keydown", O), e.addEventListener("keydown", O), () => {
1115
- e.removeEventListener("keydown", O);
1116
- };
1117
- }, [
1118
- t,
1119
- n,
1120
- l,
1121
- g,
1122
- h,
1123
- d,
1124
- o,
1125
- c,
1126
- p,
1127
- f,
1128
- A,
1129
- E,
1130
- e
1131
- ]), null;
1132
- }, gr = ({ block: e, label: t }) => {
1133
- const [, n] = U(), [, s] = Q(), [, i] = N(nt), l = st("dnd");
1134
- return /* @__PURE__ */ r.jsxs(
1135
- "div",
1136
- {
1137
- className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
1138
- draggable: l ? "true" : "false",
1139
- onDragStart: (d) => {
1140
- d.dataTransfer.setData("text/plain", JSON.stringify(Dt(e, ["_id", "_type"]))), i(e._id), setTimeout(() => {
1141
- n([]), s(null);
1142
- }, 200);
1143
- },
1144
- children: [
1145
- /* @__PURE__ */ r.jsx(Ft, {}),
1146
- t
1147
- ]
1148
- }
1149
- );
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({
1152
- placement: "top-start",
1153
- middleware: [Pn(), On()],
1154
- elements: {
1155
- reference: e
1156
- }
1157
- });
1158
- Rn(e, () => p(), e !== null);
1159
- const f = D(t, "_parent", null), h = K(D(t, "_name", "")) ? D(t, "_type", "") : D(t, "_name", "");
1160
- return !e || !t || d ? null : /* @__PURE__ */ r.jsxs(
1161
- "div",
1162
- {
1163
- role: "button",
1164
- tabIndex: 0,
1165
- ref: c.setFloating,
1166
- style: o,
1167
- onClick: (g) => {
1168
- g.stopPropagation(), g.preventDefault();
1169
- },
1170
- onKeyDown: (g) => g.stopPropagation(),
1171
- className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
1172
- children: [
1173
- /* @__PURE__ */ r.jsx(gr, { label: h, block: t }),
1174
- /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1 ", children: [
1175
- f && /* @__PURE__ */ r.jsx(
1176
- $t,
1177
- {
1178
- className: "hover:scale-105 ",
1179
- onClick: () => {
1180
- l([]), i([f]);
1181
- }
1182
- }
1183
- ),
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
1186
- ] })
1187
- ]
1188
- }
1189
- );
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(
1192
- o == null ? void 0 : o.getElementById("selected-block")
1193
- ), [h] = q(
1194
- o == null ? void 0 : o.getElementById("selected-styling-block")
1195
- ), [g] = q(o == null ? void 0 : o.getElementById("dragged-block"));
1196
- M(() => {
1197
- s ? o == null || o.documentElement.classList.add("dark") : o == null || o.documentElement.classList.remove("dark");
1198
- }, [s, o]);
1199
- const E = D(t, "headingFont", "DM Sans"), A = D(t, "bodyFont", "DM Sans");
1200
- return M(() => {
1201
- const b = D(t, "primaryColor", "#000"), S = D(t, "secondaryColor", "#FFF"), B = Mn({
1202
- colors: [b, S],
1203
- names: ["primary", "secondary"]
1204
- });
1205
- B.primary.DEFAULT = b, B.secondary.DEFAULT = S;
1206
- const O = D(t, "roundedCorners", "0");
1207
- !c || !c.tailwind || (c.tailwind.config = {
1208
- darkMode: "class",
1209
- theme: {
1210
- fontFamily: {
1211
- heading: [E],
1212
- body: [A]
1213
- },
1214
- extend: {
1215
- borderRadius: {
1216
- global: `${O || "0"}px`
1217
- },
1218
- colors: B
1219
- }
1220
- },
1221
- plugins: [
1222
- // @ts-ignore
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])`
1231
- ]);
1232
- })
1233
- ]
1234
- });
1235
- }, [t, c, E, A]), M(() => {
1236
- f && (f.textContent = `${re(n, (b) => `[data-block-id="${b}"]`).join(",")}{
1237
- outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1238
- }`);
1239
- }, [n, f]), M(() => {
1240
- if (!d) {
1241
- g.textContent = "";
1242
- return;
1243
- }
1244
- g.textContent = `[data-block-id="${d}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1245
- }, [d]), M(() => {
1246
- p && (p.textContent = i ? `[data-style-id="${i}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1247
- }, [i, n, p]), M(() => {
1248
- h && (h.textContent = `${re(l, ({ id: b }) => `[data-style-id="${b}"]`).join(",")}{
1249
- outline: 1px solid #42a1fc !important; outline-offset: -1px;
1250
- }`);
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}]`;
1254
- }, [t, o, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1255
- E && /* @__PURE__ */ r.jsx(
1256
- "link",
1257
- {
1258
- id: "heading-font",
1259
- rel: "stylesheet",
1260
- type: "text/css",
1261
- href: `https://fonts.googleapis.com/css2?family=${E.replace(
1262
- / /g,
1263
- "+"
1264
- )}:wght@300;400;500;600;700;800;900&display=swap`,
1265
- media: "all"
1266
- }
1267
- ),
1268
- A && E !== A && /* @__PURE__ */ r.jsx(
1269
- "link",
1270
- {
1271
- id: "body-font",
1272
- rel: "stylesheet",
1273
- type: "text/css",
1274
- href: `https://fonts.googleapis.com/css2?family=${A.replace(
1275
- / /g,
1276
- "+"
1277
- )}:wght@300;400;500;600;700;800;900&display=swap`,
1278
- media: "all"
1279
- }
1280
- ),
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";}` })
1282
- ] }) : null;
1283
- }, vr = (e) => {
1284
- const t = {};
1285
- return Object.keys(e).forEach((n) => {
1286
- Te(e[n]) && e[n].startsWith(Le) && (t[n] = e[n].replace(Le, "").split(","));
1287
- }), t;
1288
- }, xr = Bt((e) => {
1289
- const t = e.replace(it, "").split(",");
1290
- return Nn(t[0], t[1]);
1291
- });
1292
- function br(e, t) {
1293
- return D(e, `${t}_attrs`, {});
1294
- }
1295
- function kr(e) {
1296
- const t = {};
1297
- return Object.keys(e).forEach((n) => {
1298
- if (Te(e[n]) && e[n].startsWith(it)) {
1299
- const s = xr(e[n]);
1300
- t[n] = {
1301
- className: s,
1302
- "data-style-prop": n,
1303
- "data-block-parent": e._id,
1304
- "data-style-id": `${n}-${e._id}`,
1305
- ...br(e, n)
1306
- };
1307
- }
1308
- }), t;
1309
- }
1310
- function wr(e, t) {
1311
- const n = D(e, "_bindings", {});
1312
- return K(n) ? { ...e } : (_t(n, (s, i) => {
1313
- Te(s) && D(t, s, null) && (e[i] = D(t, s, null));
1314
- }), e);
1315
- }
1316
- function we({ blocks: e }) {
1317
- const t = Se(), n = je((l) => kr(l), []), [s] = En(), [i] = N(G);
1318
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: V.Children.toArray(
1319
- e.map((l, d) => {
1320
- if (i === l._id)
1321
- return null;
1322
- const o = vr(l), c = {};
1323
- K(o) || Object.keys(o).forEach((g) => {
1324
- c[g] = V.Children.toArray(
1325
- o[g].map((E) => /* @__PURE__ */ r.jsx(we, { blocks: [Ot(t, { _id: E })] }))
1326
- );
1327
- });
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, {
1332
- blockProps: {
1333
- "data-block-id": l._id,
1334
- "data-block-type": l._type,
1335
- "data-dnd": Fn(f, "canAcceptBlock") ? "branch" : "leaf"
1336
- },
1337
- inBuilder: !0,
1338
- index: d,
1339
- ...wr(l, s),
1340
- ...n(l),
1341
- ...c
1342
- }) });
1343
- })
1344
- ) });
1345
- }
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);
1351
- M(() => {
1352
- const { clientWidth: _, clientHeight: W } = o.current;
1353
- p({ width: _, height: W }), h === 0 && g(_);
1354
- }, [o, n, h]);
1355
- const F = (_, W = 0) => {
1356
- const { top: H } = _.getBoundingClientRect();
1357
- return H + W >= 0 && H - W <= window.innerHeight;
1358
- };
1359
- M(() => {
1360
- var _, W;
1361
- if (i && i.type !== "Multiple" && d.current) {
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]));
1364
- }
1365
- }, [i]), M(() => {
1366
- if (!K(B) && d.current) {
1367
- const _ = Tr(
1368
- d.current.contentDocument,
1369
- ae(B).id
1370
- );
1371
- b(_ ? [_] : [null]);
1372
- } else
1373
- b([null]);
1374
- }, [B]);
1375
- const $ = It(() => {
1376
- let _ = Yn;
1377
- return e === "offline" && (_ = _.replace(
1378
- "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1379
- "/offline/tailwind.cdn.js"
1380
- ), _ = _.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), _ = _.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), _;
1381
- }, [e]);
1382
- return /* @__PURE__ */ r.jsx(
1383
- "div",
1384
- {
1385
- onClick: () => {
1386
- s([]), O([]);
1387
- },
1388
- onMouseLeave: () => setTimeout(() => l(""), 300),
1389
- className: "relative mx-auto overflow-hidden h-full w-full",
1390
- style: h > 0 && !K(f) ? { width: t ? "100%" : h } : {},
1391
- ref: o,
1392
- children: /* @__PURE__ */ r.jsxs(
1393
- nr,
1394
- {
1395
- contentDidMount: () => S(d.current),
1396
- ref: d,
1397
- id: "canvas-iframe",
1398
- style: { width: `${n}px`, ...f },
1399
- className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1400
- initialContent: $,
1401
- children: [
1402
- /* @__PURE__ */ r.jsx(hr, {}),
1403
- /* @__PURE__ */ r.jsx(
1404
- mr,
1405
- {
1406
- block: i,
1407
- selectedBlockElement: ae(E)
1408
- }
1409
- ),
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, {}) }),
1412
- /* @__PURE__ */ r.jsx("br", {}),
1413
- /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
1414
- ]
1415
- }
1416
- )
1417
- }
1418
- );
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, {}) }) }) })
1422
- ] });
1423
- export {
1424
- Ro as default
1425
- };