@chaibuilder/sdk 1.2.43 → 1.2.45

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 (98) hide show
  1. package/dist/AddBlocks-UjnfO1xM.cjs +1 -0
  2. package/dist/{AddBlocks-9UM7zj57.js → AddBlocks-vkMNQu2M.js} +48 -46
  3. package/dist/CanvasArea-DLg9e6l5.js +1216 -0
  4. package/dist/CanvasArea-tyXurhEm.cjs +57 -0
  5. package/dist/{ChaiBuilderEditor-yf2LRjL1.js → ChaiBuilderEditor-1K-wcF5D.js} +3910 -3933
  6. package/dist/{ChaiBuilderEditor--NV-B5az.cjs → ChaiBuilderEditor-iXQwbYNr.cjs} +44 -44
  7. package/dist/CurrentPage-6t2cmyoQ.cjs +1 -0
  8. package/dist/{CurrentPage-hKtVFDxU.js → CurrentPage-JjZQQ8fp.js} +11 -10
  9. package/dist/{ListTree-ulr_sjdn.js → ListTree-KsggM2ac.js} +4 -3
  10. package/dist/ListTree-OTrtj3iM.cjs +1 -0
  11. package/dist/{PagesPanel-EHLY-cfj.js → PagesPanel-bElLBHNI.js} +6 -5
  12. package/dist/PagesPanel-zm1EC6Iw.cjs +1 -0
  13. package/dist/ProjectPanel-4zPiPARX.cjs +1 -0
  14. package/dist/{ProjectPanel-qiqyRbwH.js → ProjectPanel-o1BnitsI.js} +7 -6
  15. package/dist/Settings-7LXieIrg.cjs +1 -0
  16. package/dist/{Settings-a7j3ihRx.js → Settings-Bj2wI1at.js} +966 -892
  17. package/dist/SidePanels-9DSI8ysE.cjs +1 -0
  18. package/dist/{SidePanels-9XdRZ7rz.js → SidePanels-Q23Yldya.js} +7 -6
  19. package/dist/{ThemeConfiguration-MaGPPza1.js → ThemeConfiguration-GY85_LR8.js} +6 -5
  20. package/dist/ThemeConfiguration-mgyKWvYY.cjs +1 -0
  21. package/dist/Topbar-_7BQ50Y4.cjs +1 -0
  22. package/dist/{Topbar-OpgHjdWn.js → Topbar-_T58hnmh.js} +5 -4
  23. package/dist/UILibrariesPanel-28G5q5uW.cjs +1 -0
  24. package/dist/{UILibrariesPanel-HVpapacm.js → UILibrariesPanel-e9sgXFmR.js} +6 -5
  25. package/dist/{UnsplashImages-Gx7dy6mp.js → UnsplashImages-2Iew1REO.js} +12 -11
  26. package/dist/UnsplashImages-wiV_0gCf.cjs +1 -0
  27. package/dist/{UploadImages-aClrfKqQ.js → UploadImages--batsol9.js} +10 -9
  28. package/dist/UploadImages-XNNW2MnE.cjs +1 -0
  29. package/dist/{add-page-modal-kP7x8GYO.js → add-page-modal-1hTp3XOU.js} +18 -17
  30. package/dist/add-page-modal-AvOI8Zy3.cjs +1 -0
  31. package/dist/atoms-ZOWyNoiC.js +6 -0
  32. package/dist/atoms-a0H_593V.cjs +1 -0
  33. package/dist/confirm-alert-8gHBC9xl.cjs +1 -0
  34. package/dist/{confirm-alert-gemzBTIt.js → confirm-alert-pMcaye-H.js} +5 -4
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +1 -1
  37. package/dist/core.js +46 -45
  38. package/dist/delete-page-modal--GqB4-ya.cjs +1 -0
  39. package/dist/{delete-page-modal-ER-TAzRL.js → delete-page-modal-pPp6AAO1.js} +6 -5
  40. package/dist/email-blocks.cjs +1 -1
  41. package/dist/email-blocks.js +30 -30
  42. package/dist/email.cjs +1 -1
  43. package/dist/email.d.ts +1 -1
  44. package/dist/email.js +5 -4
  45. package/dist/empty-slot-Lsxjts7Q.js +6 -0
  46. package/dist/empty-slot-Sy930lX6.cjs +1 -0
  47. package/dist/{form-UruaB3s_.js → form-BbIs9ZUH.js} +5 -5
  48. package/dist/{form-l4PB76nt.cjs → form-svmj4OQd.cjs} +1 -1
  49. package/dist/{index-rKrjj7Vz.js → index-GRkx-GlC.js} +2 -2
  50. package/dist/{index-PXyps6Qc.cjs → index-ssLLO7-s.cjs} +1 -1
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +3 -3
  53. package/dist/page-viewer-0QMFEzfk.cjs +1 -0
  54. package/dist/{page-viewer-bCH5PPSH.js → page-viewer-3ne7tW8e.js} +7 -6
  55. package/dist/{project-general-setting-rdCQBkQZ.js → project-general-setting-cIjIy8PW.js} +11 -10
  56. package/dist/project-general-setting-oNYVjfNV.cjs +1 -0
  57. package/dist/project-seo-setting-5699qkWN.cjs +1 -0
  58. package/dist/{project-seo-setting-_SGBKl0c.js → project-seo-setting-HLwPjaL2.js} +6 -5
  59. package/dist/{single-page-detail-H3Rb5gkJ.js → single-page-detail-MLxPXKfu.js} +8 -7
  60. package/dist/single-page-detail-amfiKMF_.cjs +1 -0
  61. package/dist/studio.cjs +1 -1
  62. package/dist/studio.d.ts +1 -1
  63. package/dist/studio.js +5 -4
  64. package/dist/style.css +1 -1
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.d.ts +3 -3
  67. package/dist/ui.js +130 -129
  68. package/dist/{useCanvasSettings-IalZcnSd.cjs → useCanvasSettings-KDwtap3V.cjs} +1 -1
  69. package/dist/{useCanvasSettings-tkzd9Qrw.js → useCanvasSettings-qs-7bwyA.js} +1 -1
  70. package/dist/utils-K3Zk762G.cjs +1 -0
  71. package/dist/{Class-6Hz2KzYb.js → utils-iMv3T4WT.js} +16 -15
  72. package/dist/web-blocks.cjs +4 -4
  73. package/dist/web-blocks.js +237 -238
  74. package/package.json +3 -2
  75. package/dist/AddBlocks-_6X3bnJZ.cjs +0 -1
  76. package/dist/CanvasArea-HmbcRpgP.cjs +0 -55
  77. package/dist/CanvasArea-a3WMBMi3.js +0 -1199
  78. package/dist/Class-Zc8hpE7f.cjs +0 -1
  79. package/dist/CurrentPage-rgu6shCq.cjs +0 -1
  80. package/dist/ListTree-fwN6Y_EA.cjs +0 -1
  81. package/dist/PagesPanel-v6Nl5KWy.cjs +0 -1
  82. package/dist/ProjectPanel-ck-mOBEg.cjs +0 -1
  83. package/dist/Settings-Rtk4HDKy.cjs +0 -1
  84. package/dist/SidePanels-biCoYtzR.cjs +0 -1
  85. package/dist/ThemeConfiguration-f6AxqpmO.cjs +0 -1
  86. package/dist/Topbar-cDxKWgN6.cjs +0 -1
  87. package/dist/UILibrariesPanel-d08F5Ri0.cjs +0 -1
  88. package/dist/UnsplashImages-uyokFuF-.cjs +0 -1
  89. package/dist/UploadImages-kLPXfW7W.cjs +0 -1
  90. package/dist/add-page-modal-H5MTzKBT.cjs +0 -1
  91. package/dist/confirm-alert-zZAmXzx0.cjs +0 -1
  92. package/dist/delete-page-modal-E8MFNVWF.cjs +0 -1
  93. package/dist/empty-slot-ZBlsQi6m.js +0 -15
  94. package/dist/empty-slot-nzYOgZuS.cjs +0 -1
  95. package/dist/page-viewer-wQq2qD96.cjs +0 -1
  96. package/dist/project-general-setting-A5OelyCo.cjs +0 -1
  97. package/dist/project-seo-setting-Y_q0WJSy.cjs +0 -1
  98. package/dist/single-page-detail-xAO7x8a1.cjs +0 -1
@@ -1,1199 +0,0 @@
1
- var Pe = Object.defineProperty;
2
- var He = (o, s, e) => s in o ? Pe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
3
- var _ = (o, s, e) => (He(o, typeof s != "symbol" ? s + "" : s, e), e);
4
- import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
- import A, { createElement as se, useCallback as H, useState as j, useEffect as k, Component as ue, Children as Oe, Suspense as he, useRef as ne, useMemo as ze } from "react";
6
- import { map as P, includes as oe, toUpper as Y, round as Ue, noop as T, has as Q, throttle as me, isEmpty as D, first as U, omit as We, pick as qe, get as f, isString as G, memoize as Ke, each as Ye, find as Je, filter as ge, isNull as Qe } from "lodash-es";
7
- import { ResetIcon as re, MobileIcon as ie, LaptopIcon as Ze, DesktopIcon as Xe, DotsVerticalIcon as Ge, EraserIcon as Ve, ZoomInIcon as et, DragHandleDots2Icon as tt, ArrowUpIcon as st, CopyIcon as nt, TrashIcon as ot } from "@radix-ui/react-icons";
8
- import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as rt, at as it, au as at, o as V, X as lt, h as L, av as ct, aw as dt, ax as pt, ay as ut, az as ht, aA as mt, aB as gt, L as C, Y as N, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as ye, ap as z, m as Bt, aD as Dt, z as M, Q as It, aE as R, aF as St, i as ee, w as be, E as ke, H as we, V as _t, aG as At, aH as je, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Rt, M as Ft, aN as Pt, ah as Ce, a2 as Ht } from "./ChaiBuilderEditor-yf2LRjL1.js";
9
- import { useTranslation as q } from "react-i18next";
10
- import { useAtom as y } from "jotai";
11
- import { SparklesIcon as Ot } from "lucide-react";
12
- import ae from "react-dom";
13
- import b from "prop-types";
14
- import { Quill as zt } from "react-quill";
15
- import { useFeature as Be } from "flagged";
16
- import { flip as Ut } from "@floating-ui/dom";
17
- import { useFloating as Wt, shift as qt } from "@floating-ui/react-dom";
18
- import { useResizeObserver as Kt } from "@react-hookz/web";
19
- import Yt from "@tailwindcss/typography";
20
- import Jt from "@tailwindcss/forms";
21
- import Qt from "@tailwindcss/aspect-ratio";
22
- import Zt from "tailwindcss-palette-generator";
23
- import { Provider as Xt } from "react-wrap-balancer";
24
- import { twMerge as Gt } from "tailwind-merge";
25
- import { S as le, a as De } from "./STRINGS--j49GZJP.js";
26
- import { getBlockComponent as Vt } from "@chaibuilder/runtime";
27
- import { u as es } from "./useCanvasSettings-tkzd9Qrw.js";
28
- import "./_commonjsHelpers-UyOWmZb0.js";
29
- import "clsx";
30
- import "@radix-ui/react-scroll-area";
31
- import "i18next";
32
- import "./Functions-7jnEwJyw.js";
33
- import "./MODIFIERS-cBT31iqE.js";
34
- import "@radix-ui/react-toggle";
35
- import "class-variance-authority";
36
- import "./Class-6Hz2KzYb.js";
37
- import "@radix-ui/react-switch";
38
- import "@radix-ui/react-slot";
39
- import "@radix-ui/react-accordion";
40
- import "@radix-ui/react-alert-dialog";
41
- import "@radix-ui/react-dialog";
42
- import "@radix-ui/react-label";
43
- import "@radix-ui/react-tabs";
44
- import "@radix-ui/react-tooltip";
45
- import "@radix-ui/react-popover";
46
- import "@radix-ui/react-menubar";
47
- import "@radix-ui/react-hover-card";
48
- import "@radix-ui/react-select";
49
- import "@radix-ui/react-dropdown-menu";
50
- import "@radix-ui/react-separator";
51
- import "@radix-ui/react-toast";
52
- import "cmdk";
53
- import "@radix-ui/react-context-menu";
54
- import "react-icons-picker";
55
- import "react-hotkeys-hook";
56
- const ts = () => {
57
- const { hasUndo: o, hasRedo: s, undo: e, redo: t } = fe();
58
- return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
59
- /* @__PURE__ */ r.jsx(W, { disabled: !o(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, {}) }),
60
- /* @__PURE__ */ r.jsx(W, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, { className: "rotate-180 scale-y-[-1] transform" }) })
61
- ] });
62
- };
63
- function ss() {
64
- const [o, s] = xe(), { t: e } = q();
65
- return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
66
- /* @__PURE__ */ r.jsx(ve, { htmlFor: "dark-mode-switch", children: e("dark_mode") }),
67
- /* @__PURE__ */ r.jsxs(
68
- $e,
69
- {
70
- id: "dark-mode-switch",
71
- checked: o,
72
- onCheckedChange: () => {
73
- s(!o);
74
- },
75
- className: `${o ? "bg-violet-600" : "bg-violet-300"}
76
- 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`,
77
- children: [
78
- /* @__PURE__ */ r.jsx("span", { className: "sr-only", children: e("use_setting") }),
79
- /* @__PURE__ */ r.jsx(
80
- "span",
81
- {
82
- "aria-hidden": "true",
83
- className: `${o ? "translate-x-5" : "translate-x-0"}
84
- 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`
85
- }
86
- )
87
- ]
88
- }
89
- )
90
- ] });
91
- }
92
- const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
93
- "svg",
94
- {
95
- className: o ? "rotate-90" : "",
96
- xmlns: "http://www.w3.org/2000/svg",
97
- viewBox: "0 0 13 13",
98
- xmlSpace: "preserve",
99
- width: 13,
100
- height: 13,
101
- children: [
102
- /* @__PURE__ */ r.jsx("g", { strokeWidth: 0 }),
103
- /* @__PURE__ */ r.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round" }),
104
- /* @__PURE__ */ r.jsx(
105
- "path",
106
- {
107
- 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",
108
- style: {
109
- fill: "#000"
110
- }
111
- }
112
- )
113
- ]
114
- }
115
- ), ns = [
116
- {
117
- title: "mobile_xs_title",
118
- content: "mobile_xs_content",
119
- breakpoint: "xs",
120
- icon: /* @__PURE__ */ r.jsx(ie, {}),
121
- width: 400
122
- },
123
- {
124
- title: "mobile_sm_title",
125
- content: "mobile_sm_content",
126
- breakpoint: "sm",
127
- icon: /* @__PURE__ */ r.jsx(ie, { className: "rotate-90" }),
128
- width: 640
129
- },
130
- {
131
- title: "tablet_md_title",
132
- content: "tablet_md_content",
133
- breakpoint: "md",
134
- icon: /* @__PURE__ */ r.jsx(ce, {}),
135
- width: 800
136
- },
137
- {
138
- title: "tablet_lg_title",
139
- content: "tablet_lg_content",
140
- breakpoint: "lg",
141
- icon: /* @__PURE__ */ r.jsx(ce, { landscape: !0 }),
142
- width: 1024
143
- },
144
- {
145
- title: "desktop_xl_title",
146
- content: "desktop_xl_content",
147
- breakpoint: "xl",
148
- icon: /* @__PURE__ */ r.jsx(Ze, {}),
149
- width: 1420
150
- },
151
- {
152
- title: "large_desktop_2xl_title",
153
- content: "large_desktop_2xl_content",
154
- breakpoint: "2xl",
155
- icon: /* @__PURE__ */ r.jsx(Xe, {}),
156
- width: 1920
157
- }
158
- ], de = ({
159
- title: o,
160
- content: s,
161
- currentBreakpoint: e,
162
- breakpoint: t,
163
- width: n,
164
- icon: d,
165
- onClick: a
166
- }) => {
167
- const { t: i } = q();
168
- return /* @__PURE__ */ r.jsxs(rt, { children: [
169
- /* @__PURE__ */ r.jsx(it, { asChild: !0, children: /* @__PURE__ */ r.jsx(
170
- W,
171
- {
172
- onClick: () => a(n),
173
- size: "sm",
174
- variant: t === e ? "secondary" : "ghost",
175
- children: d
176
- }
177
- ) }),
178
- /* @__PURE__ */ r.jsx(at, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
179
- /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: i(o) }),
180
- /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
181
- ] }) }) })
182
- ] });
183
- }, os = () => {
184
- const [, o, s] = V(), [e, t] = lt(), { t: n } = q(), d = L("breakpoints", ns), a = (i) => {
185
- e.includes(i) ? e.length > 2 && t(e.filter((l) => l !== i)) : t((l) => [...l, i]);
186
- };
187
- return d.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: P(d, (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
188
- P(
189
- d.filter((i) => oe(e, Y(i.breakpoint))),
190
- (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })
191
- ),
192
- /* @__PURE__ */ r.jsxs(ct, { children: [
193
- /* @__PURE__ */ r.jsx(dt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ge, { className: "scale-90 transform" }) }) }),
194
- /* @__PURE__ */ r.jsxs(pt, { className: "w-56 border-border text-xs", children: [
195
- /* @__PURE__ */ r.jsx(ut, { children: n("Breakpoints") }),
196
- /* @__PURE__ */ r.jsx(ht, {}),
197
- P(d, (i) => /* @__PURE__ */ r.jsx(
198
- mt,
199
- {
200
- disabled: i.breakpoint === "xs",
201
- onCheckedChange: () => a(Y(i.breakpoint)),
202
- checked: oe(e, Y(i.breakpoint)),
203
- children: n(i.title)
204
- },
205
- i.breakpoint
206
- ))
207
- ] })
208
- ] })
209
- ] });
210
- }, rs = () => {
211
- const { t: o } = q(), { setNewBlocks: s } = gt(), [, e] = C(), [, t] = N(), n = H(() => {
212
- s([]), e([]), t([]);
213
- }, [s]);
214
- return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(ft, { children: [
215
- /* @__PURE__ */ r.jsx(xt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
216
- /* @__PURE__ */ r.jsx(Ve, {}),
217
- " ",
218
- o("clear")
219
- ] }) }),
220
- /* @__PURE__ */ r.jsxs(vt, { className: "border-border", children: [
221
- /* @__PURE__ */ r.jsxs($t, { children: [
222
- /* @__PURE__ */ r.jsx(yt, { children: o("clear_canvas_title") }),
223
- /* @__PURE__ */ r.jsx(bt, { children: o("clear_canvas_description") })
224
- ] }),
225
- /* @__PURE__ */ r.jsxs(kt, { children: [
226
- /* @__PURE__ */ r.jsx(wt, { children: o("cancel") }),
227
- /* @__PURE__ */ r.jsx(jt, { onClick: n, children: o("yes") })
228
- ] })
229
- ] })
230
- ] }) });
231
- }, is = () => {
232
- const [o, s] = y(Ct);
233
- return L("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
234
- /* @__PURE__ */ r.jsxs(ve, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
235
- /* @__PURE__ */ r.jsx(Ot, { className: "w-4" }),
236
- "AI Assistant"
237
- ] }),
238
- /* @__PURE__ */ r.jsx(
239
- $e,
240
- {
241
- className: "scale-90",
242
- checked: o,
243
- onCheckedChange: (t) => {
244
- s(t);
245
- },
246
- id: "ai-assitantt"
247
- }
248
- )
249
- ] }) : null;
250
- }, as = () => {
251
- const o = L("darkMode", !1), [s] = ye();
252
- return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
253
- /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
254
- o ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
255
- /* @__PURE__ */ r.jsx(ss, {}),
256
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" })
257
- ] }) : null,
258
- /* @__PURE__ */ r.jsx(os, {}),
259
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
260
- /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
261
- /* @__PURE__ */ r.jsx(et, { className: "h-3.5 w-3.5 flex-shrink-0" }),
262
- " ",
263
- /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
264
- Ue(s, 0),
265
- "%"
266
- ] })
267
- ] }),
268
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
269
- /* @__PURE__ */ r.jsx(ts, {})
270
- ] }),
271
- /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
272
- /* @__PURE__ */ r.jsx(rs, {}),
273
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
274
- /* @__PURE__ */ r.jsx(is, {})
275
- ] })
276
- ] });
277
- }, ls = `<!doctype html>
278
- <html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
279
- <head>
280
- <meta charset="UTF-8">
281
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
282
- <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
283
- <style>
284
- html { height: 100%; overflow:auto; }
285
- body { height: 100%; }
286
- .air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
287
- .air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
288
- body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
289
- -moz-user-select: none;-ms-user-select: none; user-select: none; }
290
- html{
291
- -ms-overflow-style: none; /* IE and Edge */
292
- scrollbar-width: none; /* Firefox */
293
- }
294
- /** IMPORTANT: Make fields content editable in SAFARI */
295
- [contenteditable] {-webkit-user-select: text;user-select: text;}
296
-
297
- html::-webkit-scrollbar { width: 0 !important }
298
- .aspect-auto{aspect-ratio: auto;}
299
- .aspect-square{aspect-ratio: 1/1;}
300
- .aspect-video{aspect-ratio: 16/9;}
301
- .dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
302
- .dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
303
- a{ pointer-events: none !important; }
304
- [contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
305
- [contenteditable="true"] {
306
- outline: none;
307
- box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
308
- -webkit-user-select: text;
309
- -moz-user-select: text;
310
- user-select: text;
311
- }
312
- .frame-root .frame-content { height: 100%; }
313
- </style>
314
- <style id="hidden-blocks"></style>
315
- <style id="selected-block"></style>
316
- <style id="selected-styling-block"></style>
317
- <style id="highlighted-block"></style>
318
- <style id="dragged-block"></style>
319
-
320
- </head>
321
- <body class="font-body antialiased h-full">
322
- <div class="frame-root h-full"></div>
323
- <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
324
- </body>
325
- </html>`, cs = (o) => {
326
- const [s] = V(), [, e] = ye(), [t, n] = j({}), d = H(() => {
327
- const { width: a, height: i } = o;
328
- if (a < s) {
329
- const l = parseFloat((a / s).toFixed(2).toString());
330
- let c = {};
331
- const p = i * l;
332
- i && (c = {
333
- // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
334
- height: 100 + (i - p) / p * 100 + "%"
335
- }), n({
336
- position: "relative",
337
- top: 0,
338
- transform: `scale(${l})`,
339
- transformOrigin: "top left",
340
- ...c,
341
- maxWidth: "none"
342
- }), e(l * 100);
343
- } else
344
- n({}), e(100);
345
- }, [s, o, e]);
346
- return k(() => {
347
- d();
348
- }, [s, o, e, d]), t;
349
- };
350
- let Ie, Se;
351
- typeof document < "u" && (Ie = document);
352
- typeof window < "u" && (Se = window);
353
- const _e = A.createContext({ document: Ie, window: Se }), K = () => A.useContext(_e), { Provider: ds, Consumer: Rn } = _e;
354
- class Ae extends ue {
355
- componentDidMount() {
356
- this.props.contentDidMount();
357
- }
358
- componentDidUpdate() {
359
- this.props.contentDidUpdate();
360
- }
361
- render() {
362
- return Oe.only(this.props.children);
363
- }
364
- }
365
- _(Ae, "propTypes", {
366
- children: b.element.isRequired,
367
- contentDidMount: b.func.isRequired,
368
- contentDidUpdate: b.func.isRequired
369
- });
370
- class Z extends ue {
371
- constructor(e, t) {
372
- super(e, t);
373
- _(this, "setRef", (e) => {
374
- this.nodeRef.current = e;
375
- const { forwardedRef: t } = this.props;
376
- typeof t == "function" ? t(e) : t && (t.current = e);
377
- });
378
- _(this, "handleLoad", () => {
379
- clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
380
- });
381
- // In certain situations on a cold cache DOMContentLoaded never gets called
382
- // fallback to an interval to check if that's the case
383
- _(this, "loadCheck", () => setInterval(() => {
384
- this.handleLoad();
385
- }, 500));
386
- this._isMounted = !1, this.nodeRef = A.createRef(), this.state = { iframeLoaded: !1 };
387
- }
388
- componentDidMount() {
389
- this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
390
- }
391
- componentWillUnmount() {
392
- this._isMounted = !1, this.nodeRef.current.removeEventListener("DOMContentLoaded", this.handleLoad);
393
- }
394
- getDoc() {
395
- return this.nodeRef.current ? this.nodeRef.current.contentDocument : null;
396
- }
397
- getMountTarget() {
398
- const e = this.getDoc();
399
- return this.props.mountTarget ? e.querySelector(this.props.mountTarget) : e.body.children[0];
400
- }
401
- renderFrameContents() {
402
- if (!this._isMounted)
403
- return null;
404
- const e = this.getDoc();
405
- if (!e)
406
- return null;
407
- const t = this.props.contentDidMount, n = this.props.contentDidUpdate, d = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(Ae, { contentDidMount: t, contentDidUpdate: n, children: /* @__PURE__ */ r.jsx(ds, { value: { document: e, window: d }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
408
- return [ae.createPortal(this.props.head, this.getDoc().head), ae.createPortal(a, i)];
409
- }
410
- render() {
411
- const e = {
412
- ...this.props,
413
- srcDoc: this.props.initialContent,
414
- children: void 0
415
- // The iframe isn't ready so we drop children from props here. #12, #17
416
- };
417
- return delete e.head, delete e.initialContent, delete e.mountTarget, delete e.contentDidMount, delete e.contentDidUpdate, delete e.forwardedRef, /* @__PURE__ */ r.jsx("iframe", { ...e, ref: this.setRef, onLoad: this.handleLoad, children: this.state.iframeLoaded && this.renderFrameContents() });
418
- }
419
- }
420
- // React warns when you render directly into the body since browser extensions
421
- // also inject into the body and can mess up React. For this reason
422
- // initialContent is expected to have a div inside of the body
423
- // element that we render react into.
424
- _(Z, "propTypes", {
425
- style: b.object,
426
- // eslint-disable-line
427
- head: b.node,
428
- initialContent: b.string,
429
- mountTarget: b.string,
430
- contentDidMount: b.func,
431
- contentDidUpdate: b.func,
432
- children: b.oneOfType([b.element, b.arrayOf(b.element)])
433
- }), _(Z, "defaultProps", {
434
- style: {},
435
- head: null,
436
- children: void 0,
437
- mountTarget: void 0,
438
- contentDidMount: () => {
439
- },
440
- contentDidUpdate: () => {
441
- },
442
- initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
443
- });
444
- const ps = A.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef: s })), us = () => {
445
- const { addCoreBlock: o } = Bt(), s = L("getExternalPredefinedBlock", T);
446
- return H(
447
- async (e) => {
448
- const { block: t, dropTargetId: n, relativeIndex: d } = e;
449
- if (Q(t, "format")) {
450
- const a = await s(t);
451
- return o({ blocks: a }, n === 0 ? null : n, d);
452
- }
453
- return o(t, n === 0 ? null : n, d);
454
- },
455
- [o]
456
- );
457
- };
458
- let B = null, O = [], F = null, Ne = null;
459
- function hs(o) {
460
- const s = window.getComputedStyle(o), e = parseInt(s.paddingLeft, 10), t = parseInt(s.paddingTop, 10), n = parseInt(s.paddingRight, 10), d = parseInt(s.paddingBottom, 10);
461
- return { paddingLeft: e, paddingTop: t, paddingRight: n, paddingBottom: d };
462
- }
463
- const pe = (o, s, e) => {
464
- if (!B)
465
- return;
466
- const t = o.getBoundingClientRect(), n = B == null ? void 0 : B.getElementById("placeholder"), { paddingLeft: d, paddingTop: a, paddingRight: i, paddingBottom: l } = hs(o);
467
- n.style.width = s === "vertical" ? t.width - d - i + "px" : "2px", n.style.height = s === "vertical" ? "2px" : t.height - a - l + "px", n.style.display = "block";
468
- const c = O.reduce(
469
- (p, m) => Math.abs(m - e) < Math.abs(p - e) ? m : p
470
- );
471
- Ne = O.indexOf(c), s === "vertical" ? (n.style.top = o.offsetTop + c + "px", n.style.left = o.offsetLeft + d + "px") : (n.style.top = o.offsetTop + a + "px", n.style.left = o.offsetLeft + c + "px");
472
- }, ms = (o) => {
473
- const s = Me(o), e = window.getComputedStyle(o), t = s === "horizontal", n = parseInt(e.paddingLeft), d = parseInt(e.paddingTop);
474
- let a = t ? n : d;
475
- O = [a], Array.from(o.children).forEach((i) => {
476
- const l = window.getComputedStyle(i), c = parseInt(
477
- t ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
478
- ), p = t ? i.offsetWidth : i.offsetHeight;
479
- O.push(a + p + c), a += p + c;
480
- });
481
- };
482
- function Me(o) {
483
- const s = window.getComputedStyle(o).display, e = window.getComputedStyle(o).flexDirection;
484
- if (s === "flex")
485
- return e === "column" || e === "column-reverse" ? "vertical" : "horizontal";
486
- if (s === "grid") {
487
- const t = window.getComputedStyle(o).gridTemplateRows, n = window.getComputedStyle(o).gridTemplateColumns;
488
- if (t.includes("auto"))
489
- return "vertical";
490
- if (n.includes("auto"))
491
- return "horizontal";
492
- }
493
- return s === "block" ? "vertical" : "horizontal";
494
- }
495
- const gs = me((o) => {
496
- const s = o.target, e = Me(s);
497
- if (e === "vertical") {
498
- const t = o.clientY - s.offsetTop;
499
- pe(s, e, t);
500
- } else {
501
- const t = o.clientX - s.offsetLeft;
502
- pe(s, e, t);
503
- }
504
- }, 200), fs = (o) => {
505
- o.preventDefault(), o.stopPropagation(), gs(o);
506
- };
507
- function J() {
508
- const o = B == null ? void 0 : B.getElementById("placeholder");
509
- o.style.display = "none";
510
- }
511
- const xs = () => {
512
- const { document: o } = K(), [s, e] = y(Dt), t = us(), n = Be("dnd"), [, d] = M(), [, a] = C();
513
- return B = o, {
514
- isDragging: s,
515
- "data-dnd": "branch",
516
- onDragOver: n ? fs : T,
517
- onDrop: n ? (i) => {
518
- F == null || F.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
519
- const l = JSON.parse(i.dataTransfer.getData("text/plain"));
520
- let c = i.target.getAttribute("data-block-id");
521
- c === null && (c = i.target.parentElement.getAttribute("data-block-id")), t({ block: l, dropTargetId: c || null, relativeIndex: Ne }), e(!1), J(), setTimeout(() => {
522
- J();
523
- }, 300);
524
- } : T,
525
- onDragEnter: n ? (i) => {
526
- const l = i;
527
- F = l.target, l.stopPropagation(), l.preventDefault(), O = [];
528
- const c = l.target;
529
- ms(c), c.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), e(!0), d(""), a([]);
530
- } : T,
531
- onDragLeave: n ? (i) => {
532
- const l = i;
533
- F = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
534
- } : T,
535
- onMouseOut: n ? () => {
536
- e(!1), J();
537
- } : T
538
- };
539
- };
540
- function te(o) {
541
- return o.getAttribute("data-block-id") ? o : o.closest("[data-block-id]");
542
- }
543
- function vs(o) {
544
- o.container.innerHTML = "", o.container.parentNode.removeChild(o.container);
545
- var s = document.querySelector(".ql-toolbar");
546
- s && s.parentNode.removeChild(s), o = null;
547
- }
548
- const $s = () => {
549
- const o = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = It(), [, e] = M(), [t, n] = y(R);
550
- return (d) => {
551
- var m;
552
- if (t)
553
- return;
554
- const a = te(d.target), i = a.getAttribute("data-block-type");
555
- if (!i || !o.includes(i))
556
- return;
557
- const l = a.cloneNode(!0);
558
- a.style.display = "none", Array.from(l.attributes).forEach((h) => {
559
- h.name !== "class" && l.removeAttribute(h.name);
560
- }), i === "Text" && (l.style.display = "inline-block"), a.parentNode.insertBefore(l, a.nextSibling);
561
- const c = new zt(l, { placeholder: "Type here..." });
562
- function p() {
563
- const h = c.getText(0, c.getLength());
564
- s([a.getAttribute("data-block-id")], { content: h }), a.removeAttribute("style"), l.removeEventListener("blur", p, !0), vs(c), n(""), e("");
565
- }
566
- l.addEventListener("blur", p, !0), l.addEventListener("keydown", (h) => {
567
- (h.key === "Enter" || h.key === "Escape") && p();
568
- }), c.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), n(a.getAttribute("data-block-id"));
569
- };
570
- }, ys = () => {
571
- const [, o] = N(), [, s] = C(), [, e] = M(), [t] = y(R), [n] = y(St);
572
- return (d) => {
573
- if (t)
574
- return;
575
- n.closeAll(), d.stopPropagation();
576
- const a = te(d.target);
577
- if (a != null && a.getAttribute("data-block-id") && (a == null ? void 0 : a.getAttribute("data-block-id")) === "container") {
578
- s([]), o([]), e("");
579
- return;
580
- }
581
- if (a != null && a.getAttribute("data-block-parent")) {
582
- const i = a.getAttribute("data-style-prop"), l = a.getAttribute("data-style-id"), c = a.getAttribute("data-block-parent");
583
- o([{ id: l, prop: i, blockId: c }]), s([c]);
584
- } else
585
- a != null && a.getAttribute("data-block-id") && s([a.getAttribute("data-block-id")]);
586
- e("");
587
- };
588
- }, bs = me((o, s) => {
589
- const e = te(o.target);
590
- e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
591
- }, 100), ks = () => {
592
- const [, o] = M(), [s] = y(R);
593
- return (e) => {
594
- s || bs(e, o);
595
- };
596
- }, ws = ({ children: o }) => {
597
- const { document: s } = K(), [e] = C(), [t, n] = N();
598
- k(() => {
599
- setTimeout(() => {
600
- if (!D(t))
601
- return;
602
- const c = Ee(s, U(e));
603
- if (c) {
604
- const p = c.getAttribute("data-style-prop");
605
- if (p) {
606
- const m = c.getAttribute("data-style-id"), h = c.getAttribute("data-block-parent");
607
- n([{ id: m, prop: p, blockId: h }]);
608
- }
609
- }
610
- }, 100);
611
- }, [s, e, n, t]);
612
- const d = $s(), a = ys(), i = ks(), l = xs();
613
- return /* @__PURE__ */ r.jsx(
614
- "div",
615
- {
616
- "data-block-id": "container",
617
- id: "canvas",
618
- onClick: a,
619
- onDoubleClick: d,
620
- onMouseMove: i,
621
- ...We(l, "isDragging"),
622
- className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
623
- children: o
624
- }
625
- );
626
- }, Ee = (o, s) => o.querySelector(`[data-block-id="${s}"]`), js = () => {
627
- const { window: o } = K(), [s, e] = C(), [t] = ee(), [, n] = N(), { undo: d, redo: a } = fe(), i = be(), [, l] = ke(), c = we(), { savePage: p } = _t(), [m] = y(R), [, h] = y(At), v = (g) => {
628
- g.key === "Enter" && (g.preventDefault(), s.length === 1 && h(U(s)));
629
- }, w = (g) => {
630
- const u = t.find(($) => $._id === g);
631
- return u ? u._parent : null;
632
- };
633
- return k(() => {
634
- const g = (u) => {
635
- if (u.key === "Escape") {
636
- e([]), n([]);
637
- return;
638
- }
639
- if (v(u), !m && (u.key === "Delete" || u.key === "Backspace") && (u.preventDefault(), c(s)), u.ctrlKey || u.metaKey) {
640
- if (u.key === "ArrowUp") {
641
- u.preventDefault();
642
- const $ = s.length > 0 ? w(s[0]) : null;
643
- $ && e([$]);
644
- }
645
- if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(u.key)) {
646
- if (m && ["x", "z", "v"].includes(u.key))
647
- return !0;
648
- u.preventDefault();
649
- }
650
- u.key === "s" && (u.stopPropagation(), u.preventDefault(), p()), u.key === "z" && d(), u.key === "y" && a(), u.key === "d" && i(s);
651
- }
652
- };
653
- return o.removeEventListener("keydown", g), o.addEventListener("keydown", g), () => {
654
- o.removeEventListener("keydown", g);
655
- };
656
- }, [s, e, d, c, l, a, i, m, p, o]), null;
657
- }, Cs = ({ block: o, label: s }) => {
658
- const [, e] = C(), [, t] = M(), [, n] = y(je), d = Be("dnd");
659
- return /* @__PURE__ */ r.jsxs(
660
- "div",
661
- {
662
- className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
663
- draggable: d ? "true" : "false",
664
- onDragStart: (a) => {
665
- a.dataTransfer.setData("text/plain", JSON.stringify(qe(o, ["_id", "_type"]))), n(o._id), setTimeout(() => {
666
- e([]), t(null);
667
- }, 200);
668
- },
669
- children: [
670
- /* @__PURE__ */ r.jsx(tt, {}),
671
- s
672
- ]
673
- }
674
- );
675
- }, Bs = ({ selectedBlockElement: o, block: s }) => {
676
- const e = we(), t = be(), [, n] = C(), [, d] = N(), [a] = y(R), { floatingStyles: i, refs: l, update: c } = Wt({
677
- placement: "top-start",
678
- middleware: [qt(), Ut()],
679
- elements: {
680
- reference: o
681
- }
682
- });
683
- Kt(o, () => c(), o !== null);
684
- const p = f(s, "_parent", null), m = D(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
685
- return !o || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
686
- "div",
687
- {
688
- role: "button",
689
- tabIndex: 0,
690
- ref: l.setFloating,
691
- style: i,
692
- onClick: (h) => {
693
- h.stopPropagation(), h.preventDefault();
694
- },
695
- onKeyDown: (h) => h.stopPropagation(),
696
- className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
697
- children: [
698
- /* @__PURE__ */ r.jsx(Cs, { label: m, block: s }),
699
- /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
700
- p && /* @__PURE__ */ r.jsx(
701
- st,
702
- {
703
- className: "hover:scale-105",
704
- onClick: () => {
705
- d([]), n([p]);
706
- }
707
- }
708
- ),
709
- Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
710
- Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(ot, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
711
- ] })
712
- ]
713
- }
714
- ) });
715
- }, Ds = ({ addVariant: o, e: s }) => {
716
- o("hs-dropdown-open", [
717
- ({ modifySelectors: e, separator: t }) => {
718
- e(({ className: n }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${n}`)}`);
719
- },
720
- ({ modifySelectors: e, separator: t }) => {
721
- e(({ className: n }) => `.hs-dropdown.open .hs-dropdown-toggle .${s(`hs-dropdown-open${t}${n}`)}`);
722
- },
723
- ({ modifySelectors: e, separator: t }) => {
724
- e(({ className: n }) => `.hs-dropdown.open > .hs-dropdown-menu > .${s(`hs-dropdown-open${t}${n}`)}`);
725
- }
726
- ]), o("hs-removing", ({ modifySelectors: e, separator: t }) => {
727
- e(({ className: n }) => `.hs-removing.${s(`hs-removing${t}${n}`)}`);
728
- }), o("hs-tooltip-shown", ({ modifySelectors: e, separator: t }) => {
729
- e(({ className: n }) => `.hs-tooltip.show .${s(`hs-tooltip-shown${t}${n}`)}`);
730
- }), o("hs-accordion-active", [
731
- ({ modifySelectors: e, separator: t }) => {
732
- e(({ className: n }) => `.hs-accordion.active.${s(`hs-accordion-active${t}${n}`)}`);
733
- },
734
- ({ modifySelectors: e, separator: t }) => {
735
- e(({ className: n }) => `.hs-accordion.active > .${s(`hs-accordion-active${t}${n}`)}`);
736
- },
737
- ({ modifySelectors: e, separator: t }) => {
738
- e(({ className: n }) => `.hs-accordion.active > .hs-accordion-toggle .${s(`hs-accordion-active${t}${n}`)}`);
739
- },
740
- ({ modifySelectors: e, separator: t }) => {
741
- e(({ className: n }) => `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${s(
742
- `hs-accordion-active${t}${n}`
743
- )}`);
744
- },
745
- ({ modifySelectors: e, separator: t }) => {
746
- e(({ className: n }) => `.hs-accordion.active > .hs-accordion-toggle.${s(`hs-accordion-active${t}${n}`)}`);
747
- },
748
- ({ modifySelectors: e, separator: t }) => {
749
- e(({ className: n }) => `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${s(
750
- `hs-accordion-active${t}${n}`
751
- )}`);
752
- }
753
- ]), o("hs-accordion-selected", ({ modifySelectors: e, separator: t }) => {
754
- e(({ className: n }) => `.hs-accordion .selected.${s(`hs-accordion-selected${t}${n}`)}`);
755
- }), o("hs-collapse-open", [
756
- ({ modifySelectors: e, separator: t }) => {
757
- e(({ className: n }) => `.hs-collapse.open .${s(`hs-collapse-open${t}${n}`)}`);
758
- },
759
- ({ modifySelectors: e, separator: t }) => {
760
- e(({ className: n }) => `.hs-collapse.open.${s(`hs-collapse-open${t}${n}`)}`);
761
- },
762
- ({ modifySelectors: e, separator: t }) => {
763
- e(({ className: n }) => `.hs-collapse-toggle.open .${s(`hs-collapse-open${t}${n}`)}`);
764
- },
765
- ({ modifySelectors: e, separator: t }) => {
766
- e(({ className: n }) => `.hs-collapse-toggle.open.${s(`hs-collapse-open${t}${n}`)}`);
767
- }
768
- ]), o("hs-tab-active", [
769
- ({ modifySelectors: e, separator: t }) => {
770
- e(({ className: n }) => `[data-hs-tab].active.${s(`hs-tab-active${t}${n}`)}`);
771
- },
772
- ({ modifySelectors: e, separator: t }) => {
773
- e(({ className: n }) => `[data-hs-tab].active .${s(`hs-tab-active${t}${n}`)}`);
774
- }
775
- ]), o("hs-overlay-open", [
776
- ({ modifySelectors: e, separator: t }) => {
777
- e(({ className: n }) => `.open.${s(`hs-overlay-open${t}${n}`)}`);
778
- },
779
- ({ modifySelectors: e, separator: t }) => {
780
- e(({ className: n }) => `.open .${s(`hs-overlay-open${t}${n}`)}`);
781
- }
782
- ]), o("hs-overlay-layout-open", [
783
- ({ modifySelectors: e, separator: t }) => {
784
- e(({ className: n }) => `.hs-overlay-body-open.${s(`hs-overlay-layout-open${t}${n}`)}`);
785
- },
786
- ({ modifySelectors: e, separator: t }) => {
787
- e(({ className: n }) => `.hs-overlay-body-open .${s(`hs-overlay-layout-open${t}${n}`)}`);
788
- }
789
- ]), o("hs-overlay-backdrop-open", [
790
- ({ modifySelectors: e, separator: t }) => {
791
- e(({ className: n }) => `.hs-overlay-backdrop.${s(`hs-overlay-backdrop-open${t}${n}`)}`);
792
- },
793
- ({ modifySelectors: e, separator: t }) => {
794
- e(({ className: n }) => `.hs-overlay-backdrop .${s(`hs-overlay-backdrop-open${t}${n}`)}`);
795
- }
796
- ]), o("hs-scrollspy-active", ({ modifySelectors: e, separator: t }) => {
797
- e(({ className: n }) => `.active.${s(`hs-scrollspy-active${t}${n}`)}`);
798
- }), o("hs-carousel-active", [
799
- ({ modifySelectors: e, separator: t }) => {
800
- e(({ className: n }) => `.active.${s(`hs-carousel-active${t}${n}`)}`);
801
- },
802
- ({ modifySelectors: e, separator: t }) => {
803
- e(({ className: n }) => `.active .${s(`hs-carousel-active${t}${n}`)}`);
804
- }
805
- ]), o("hs-carousel-disabled", [
806
- ({ modifySelectors: e, separator: t }) => {
807
- e(({ className: n }) => `.disabled.${s(`hs-carousel${t}disabled${t}${n}`)}`);
808
- },
809
- ({ modifySelectors: e, separator: t }) => {
810
- e(({ className: n }) => `.disabled .${s(`hs-carousel${t}disabled${t}${n}`)}`);
811
- }
812
- ]), o("hs-selected", [
813
- ({ modifySelectors: e, separator: t }) => {
814
- e(({ className: n }) => `.selected.${s(`hs-selected${t}${n}`)}`);
815
- },
816
- ({ modifySelectors: e, separator: t }) => {
817
- e(({ className: n }) => `.selected .${s(`hs-selected${t}${n}`)}`);
818
- }
819
- ]), o("hs-select-disabled", [
820
- ({ modifySelectors: e, separator: t }) => {
821
- e(({ className: n }) => `.disabled.${s(`hs-select-disabled${t}${n}`)}`);
822
- },
823
- ({ modifySelectors: e, separator: t }) => {
824
- e(({ className: n }) => `.disabled .${s(`hs-select-disabled${t}${n}`)}`);
825
- }
826
- ]), o("hs-select-active", [
827
- ({ modifySelectors: e, separator: t }) => {
828
- e(({ className: n }) => `.active.${s(`hs-select-active${t}${n}`)}`);
829
- },
830
- ({ modifySelectors: e, separator: t }) => {
831
- e(({ className: n }) => `.active .${s(`hs-select-active${t}${n}`)}`);
832
- }
833
- ]), o("hs-input-number-disabled", [
834
- ({ modifySelectors: e, separator: t }) => {
835
- e(({ className: n }) => `.disabled.${s(`hs-input-number-disabled${t}${n}`)}`);
836
- },
837
- ({ modifySelectors: e, separator: t }) => {
838
- e(({ className: n }) => `.disabled .${s(`hs-input-number-disabled${t}${n}`)}`);
839
- }
840
- ]), o("hs-pin-input-active", [
841
- ({ modifySelectors: e, separator: t }) => {
842
- e(({ className: n }) => `.active.${s(`hs-pin-input-active${t}${n}`)}`);
843
- },
844
- ({ modifySelectors: e, separator: t }) => {
845
- e(({ className: n }) => `.active .${s(`hs-pin-input-active${t}${n}`)}`);
846
- }
847
- ]), o("hs-select-opened", [
848
- ({ modifySelectors: e, separator: t }) => {
849
- e(({ className: n }) => `.opened.${s(`hs-select-opened${t}${n}`)}`);
850
- }
851
- ]), o("hs-password-active", [
852
- ({ modifySelectors: e, separator: t }) => {
853
- e(({ className: n }) => `.active.${s(`hs-password-active${t}${n}`)}`);
854
- },
855
- ({ modifySelectors: e, separator: t }) => {
856
- e(({ className: n }) => `.active .${s(`hs-password-active${t}${n}`)}`);
857
- }
858
- ]), o("hs-stepper-active", [
859
- ({ modifySelectors: e, separator: t }) => {
860
- e(({ className: n }) => `.active.${s(`hs-stepper-active${t}${n}`)}`);
861
- },
862
- ({ modifySelectors: e, separator: t }) => {
863
- e(({ className: n }) => `.active .${s(`hs-stepper-active${t}${n}`)}`);
864
- }
865
- ]), o("hs-stepper-success", [
866
- ({ modifySelectors: e, separator: t }) => {
867
- e(({ className: n }) => `.success.${s(`hs-stepper-success${t}${n}`)}`);
868
- },
869
- ({ modifySelectors: e, separator: t }) => {
870
- e(({ className: n }) => `.success .${s(`hs-stepper-success${t}${n}`)}`);
871
- }
872
- ]), o("hs-stepper-completed", [
873
- ({ modifySelectors: e, separator: t }) => {
874
- e(({ className: n }) => `.completed.${s(`hs-stepper-completed${t}${n}`)}`);
875
- },
876
- ({ modifySelectors: e, separator: t }) => {
877
- e(({ className: n }) => `.completed .${s(`hs-stepper-completed${t}${n}`)}`);
878
- }
879
- ]), o("hs-stepper-error", [
880
- ({ modifySelectors: e, separator: t }) => {
881
- e(({ className: n }) => `.error.${s(`hs-stepper-error${t}${n}`)}`);
882
- },
883
- ({ modifySelectors: e, separator: t }) => {
884
- e(({ className: n }) => `.error .${s(`hs-stepper-error${t}${n}`)}`);
885
- }
886
- ]), o("hs-stepper-processed", [
887
- ({ modifySelectors: e, separator: t }) => {
888
- e(({ className: n }) => `.processed.${s(`hs-stepper-processed${t}${n}`)}`);
889
- },
890
- ({ modifySelectors: e, separator: t }) => {
891
- e(({ className: n }) => `.processed .${s(`hs-stepper-processed${t}${n}`)}`);
892
- }
893
- ]), o("hs-stepper-disabled", [
894
- ({ modifySelectors: e, separator: t }) => {
895
- e(({ className: n }) => `.disabled.${s(`hs-stepper-disabled${t}${n}`)}`);
896
- },
897
- ({ modifySelectors: e, separator: t }) => {
898
- e(({ className: n }) => `.disabled .${s(`hs-stepper-disabled${t}${n}`)}`);
899
- }
900
- ]), o("hs-stepper-skipped", [
901
- ({ modifySelectors: e, separator: t }) => {
902
- e(({ className: n }) => `.skipped.${s(`hs-stepper-skipped${t}${n}`)}`);
903
- },
904
- ({ modifySelectors: e, separator: t }) => {
905
- e(({ className: n }) => `.skipped .${s(`hs-stepper-skipped${t}${n}`)}`);
906
- }
907
- ]), o("hs-strong-password", [
908
- ({ modifySelectors: e, separator: t }) => {
909
- e(({ className: n }) => `.passed.${s(`hs-strong-password${t}${n}`)}`);
910
- },
911
- ({ modifySelectors: e, separator: t }) => {
912
- e(({ className: n }) => `.passed .${s(`hs-strong-password${t}${n}`)}`);
913
- }
914
- ]), o("hs-strong-password-accepted", [
915
- ({ modifySelectors: e, separator: t }) => {
916
- e(({ className: n }) => `.accepted.${s(`hs-strong-password-accepted${t}${n}`)}`);
917
- },
918
- ({ modifySelectors: e, separator: t }) => {
919
- e(({ className: n }) => `.accepted .${s(`hs-strong-password-accepted${t}${n}`)}`);
920
- }
921
- ]), o("hs-strong-password-active", [
922
- ({ modifySelectors: e, separator: t }) => {
923
- e(({ className: n }) => `.active.${s(`hs-strong-password-active${t}${n}`)}`);
924
- }
925
- ]), o("hs-combo-box-active", [
926
- ({ modifySelectors: e, separator: t }) => {
927
- e(({ className: n }) => `.active .${s(`hs-combo-box-active${t}${n}`)}`);
928
- },
929
- ({ modifySelectors: e, separator: t }) => {
930
- e(({ className: n }) => `.active.${s(`hs-combo-box-active${t}${n}`)}`);
931
- }
932
- ]), o("hs-combo-box-selected", [
933
- ({ modifySelectors: e, separator: t }) => {
934
- e(({ className: n }) => `.selected .${s(`hs-combo-box-selected${t}${n}`)}`);
935
- },
936
- ({ modifySelectors: e, separator: t }) => {
937
- e(({ className: n }) => `.selected.${s(`hs-combo-box-selected${t}${n}`)}`);
938
- }
939
- ]), o("hs-combo-box-tab-active", [
940
- ({ modifySelectors: e, separator: t }) => {
941
- e(({ className: n }) => `.active.${s(`hs-combo-box-tab-active${t}${n}`)}`);
942
- }
943
- ]), o("hs-apexcharts-tooltip-dark", [
944
- ({ modifySelectors: e, separator: t }) => {
945
- e(({ className: n }) => `.dark.${s(`hs-apexcharts-tooltip-dark${t}${n}`)}`);
946
- }
947
- ]), o("hs-success", [
948
- ({ modifySelectors: e, separator: t }) => {
949
- e(({ className: n }) => `.success .${s(`hs-success${t}${n}`)}`);
950
- },
951
- ({ modifySelectors: e, separator: t }) => {
952
- e(({ className: n }) => `.success.${s(`hs-success${t}${n}`)}`);
953
- }
954
- ]), o("hs-error", [
955
- ({ modifySelectors: e, separator: t }) => {
956
- e(({ className: n }) => `.error .${s(`hs-error${t}${n}`)}`);
957
- },
958
- ({ modifySelectors: e, separator: t }) => {
959
- e(({ className: n }) => `.error.${s(`hs-error${t}${n}`)}`);
960
- }
961
- ]), o("hs-default-mode-active", ({ modifySelectors: e, separator: t }) => {
962
- e(({ className: n }) => `.default .${s(`hs-default-mode-active${t}${n}`)}`);
963
- }), o("hs-dark-mode-active", ({ modifySelectors: e, separator: t }) => {
964
- e(({ className: n }) => `.dark .${s(`hs-dark-mode-active${t}${n}`)}`);
965
- }), o("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
966
- e(({ className: n }) => `.auto .${s(`hs-auto-mode-active${t}${n}`)}`);
967
- });
968
- }, Is = ({ model: o }) => {
969
- const [s] = Et(), [e] = C(), [t] = xe(), [n] = M(), [d] = N(), [a] = y(je), { document: i, window: l } = K(), [c] = j(i == null ? void 0 : i.getElementById("highlighted-block")), [p] = j(
970
- i == null ? void 0 : i.getElementById("selected-block")
971
- ), [m] = j(
972
- i == null ? void 0 : i.getElementById("selected-styling-block")
973
- ), [h] = j(i == null ? void 0 : i.getElementById("dragged-block"));
974
- k(() => {
975
- t ? i == null || i.documentElement.classList.add("dark") : i == null || i.documentElement.classList.remove("dark");
976
- }, [t, i]);
977
- const v = f(s, "headingFont", "DM Sans"), w = f(s, "bodyFont", "DM Sans");
978
- return k(() => {
979
- const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), $ = Zt([
980
- { color: g, name: "primary" },
981
- { color: u, name: "secondary" }
982
- ]), E = f(s, "roundedCorners", "0");
983
- !l || !l.tailwind || (l.tailwind.config = {
984
- darkMode: "class",
985
- theme: {
986
- extend: {
987
- fontFamily: {
988
- heading: [v],
989
- body: [w]
990
- },
991
- borderRadius: {
992
- global: `${E || "0"}px`
993
- },
994
- colors: $
995
- }
996
- },
997
- plugins: [Yt, Jt, Qt, l.tailwind.plugin.withOptions(() => Ds)]
998
- });
999
- }, [s, l, v, w]), k(() => {
1000
- p && (p.textContent = `${P(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1001
- outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1002
- }`);
1003
- }, [e, p]), k(() => {
1004
- if (!a) {
1005
- h.textContent = "";
1006
- return;
1007
- }
1008
- h.textContent = `[data-block-id="${a}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1009
- }, [a]), k(() => {
1010
- c && (c.textContent = n ? `[data-style-id="${n}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1011
- }, [n, e, c]), k(() => {
1012
- m && (m.textContent = `${P(d, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1013
- outline: 1px solid #42a1fc !important; outline-offset: -1px;
1014
- }`);
1015
- }, [d, m]), k(() => {
1016
- const g = f(s, "bodyTextLightColor", "#64748b"), u = f(s, "bodyTextDarkColor", "#94a3b8"), $ = f(s, "bodyBgLightColor", "#FFFFFF"), E = f(s, "bodyBgDarkColor", "#0f172a");
1017
- i.body.className = `font-body antialiased text-[${g}] bg-[${$}] dark:text-[${u}] dark:bg-[${E}]`;
1018
- }, [s, i, o]), o === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1019
- v && /* @__PURE__ */ r.jsx(
1020
- "link",
1021
- {
1022
- id: "heading-font",
1023
- rel: "stylesheet",
1024
- type: "text/css",
1025
- href: `https://fonts.googleapis.com/css2?family=${v.replace(
1026
- / /g,
1027
- "+"
1028
- )}:wght@300;400;500;600;700;800;900&display=swap`,
1029
- media: "all"
1030
- }
1031
- ),
1032
- w && v !== w && /* @__PURE__ */ r.jsx(
1033
- "link",
1034
- {
1035
- id: "body-font",
1036
- rel: "stylesheet",
1037
- type: "text/css",
1038
- href: `https://fonts.googleapis.com/css2?family=${w.replace(
1039
- / /g,
1040
- "+"
1041
- )}:wght@300;400;500;600;700;800;900&display=swap`,
1042
- media: "all"
1043
- }
1044
- ),
1045
- v && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${v}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}` })
1046
- ] }) : null;
1047
- }, Ss = (o) => {
1048
- const s = {};
1049
- return Object.keys(o).forEach((e) => {
1050
- G(o[e]) && o[e].startsWith(le) && (s[e] = o[e].replace(le, "").split(","));
1051
- }), s;
1052
- }, _s = Ke((o) => {
1053
- const s = o.replace(De, "").split(",");
1054
- return Gt(s[0], s[1]);
1055
- });
1056
- function As(o, s) {
1057
- return f(o, `${s}_attrs`, {});
1058
- }
1059
- function Ns(o) {
1060
- const s = {};
1061
- return Object.keys(o).forEach((e) => {
1062
- if (G(o[e]) && o[e].startsWith(De)) {
1063
- const t = _s(o[e]);
1064
- s[e] = {
1065
- className: t,
1066
- "data-style-prop": e,
1067
- "data-block-parent": o._id,
1068
- "data-style-id": `${e}-${o._id}`,
1069
- ...As(o, e)
1070
- };
1071
- }
1072
- }), s;
1073
- }
1074
- function Ms(o, s) {
1075
- const e = f(o, "_bindings", {});
1076
- return D(e) ? { ...o } : (Ye(e, (t, n) => {
1077
- G(t) && f(s, t, null) && (o[n] = f(s, t, null));
1078
- }), o);
1079
- }
1080
- function X({ blocks: o }) {
1081
- const [s] = ee(), [e] = es(), t = H((i) => Ns(i), []), [n] = Tt(), [d] = y(R), a = H(
1082
- (i) => i.reduce((l, c) => {
1083
- const p = f(e, c, {});
1084
- return { ...l, ...p };
1085
- }, {}),
1086
- [e, s]
1087
- );
1088
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: A.Children.toArray(
1089
- o.map((i, l) => {
1090
- if (d === i._id)
1091
- return null;
1092
- const c = Ss(i), p = {};
1093
- D(c) || Object.keys(c).forEach((u) => {
1094
- p[u] = A.Children.toArray(
1095
- c[u].map(($) => /* @__PURE__ */ r.jsx(X, { blocks: [Je(s, { _id: $ })] }))
1096
- );
1097
- });
1098
- const m = ge(s, { _parent: i._id });
1099
- p.children = m.length ? /* @__PURE__ */ r.jsx(X, { blocks: m }) : null;
1100
- const h = Vt(i._type), v = f(h, "builderComponent", f(h, "component", null));
1101
- if (Qe(v))
1102
- return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` });
1103
- const w = Q(h, "getBlockStateFrom") ? h == null ? void 0 : h.getBlockStateFrom(i, s) : [], g = a(w);
1104
- return /* @__PURE__ */ r.jsx(he, { children: A.createElement(v, {
1105
- blockProps: {
1106
- "data-block-id": i._id,
1107
- "data-block-type": i._type,
1108
- "data-dnd": Q(h, "canAcceptBlock") ? "branch" : "leaf"
1109
- },
1110
- index: l,
1111
- ...Ms(i, n),
1112
- ...t(i),
1113
- ...p,
1114
- inBuilder: !0,
1115
- blockState: g
1116
- }) });
1117
- })
1118
- ) });
1119
- }
1120
- const Es = () => {
1121
- const [o] = ee(), s = D(o) ? null : /* @__PURE__ */ r.jsx(Lt, { children: /* @__PURE__ */ r.jsx(X, { blocks: ge(o, (e) => D(e._parent)) }) });
1122
- return /* @__PURE__ */ r.jsx(Xt, { children: s });
1123
- }, Ts = (o, s) => o.querySelector(`[data-style-id="${s}"]`), Ls = () => {
1124
- const [o] = y(Rt), [s] = ke(), [e] = V(), [, t] = C(), n = Ft(), [, d] = M(), a = ne(null), i = ne(null), [l, c] = j({ width: 0, height: 0 }), p = cs(l), [m, h] = j(0), [v, w] = j([]), [, g] = j([]), [, u] = y(Pt), [$, E] = N(), Te = L("loading", !1), Le = L("htmlDir", "ltr");
1125
- k(() => {
1126
- const { clientWidth: x, clientHeight: I } = i.current;
1127
- c({ width: x, height: I }), m === 0 && h(x);
1128
- }, [i, e, m]);
1129
- const Re = (x, I = 0) => {
1130
- const { top: S } = x.getBoundingClientRect();
1131
- return S + I >= 0 && S - I <= window.innerHeight;
1132
- };
1133
- k(() => {
1134
- var x, I;
1135
- if (n && n.type !== "Multiple" && a.current) {
1136
- const S = Ee(a.current.contentDocument, n._id);
1137
- S && (Re(S) || (I = (x = a.current) == null ? void 0 : x.contentWindow) == null || I.scrollTo({ top: S.offsetTop, behavior: "smooth" }), w([S]));
1138
- }
1139
- }, [n]), k(() => {
1140
- if (!D($) && a.current) {
1141
- const x = Ts(
1142
- a.current.contentDocument,
1143
- U($).id
1144
- );
1145
- g(x ? [x] : [null]);
1146
- } else
1147
- g([null]);
1148
- }, [$]);
1149
- const Fe = ze(() => {
1150
- let x = ls;
1151
- return x = x.replace("__HTML_DIR__", Le), o === "offline" && (x = x.replace(
1152
- "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1153
- "/offline/tailwind.cdn.js"
1154
- ), x = x.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), x = x.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), x;
1155
- }, [o]);
1156
- return /* @__PURE__ */ r.jsx(
1157
- "div",
1158
- {
1159
- onClick: () => {
1160
- t([]), E([]);
1161
- },
1162
- onMouseLeave: () => setTimeout(() => d(""), 300),
1163
- className: "relative mx-auto h-full w-full overflow-hidden",
1164
- style: m > 0 && !D(p) ? { width: s ? "100%" : m } : {},
1165
- ref: i,
1166
- children: /* @__PURE__ */ r.jsxs(
1167
- ps,
1168
- {
1169
- contentDidMount: () => u(a.current),
1170
- ref: a,
1171
- id: "canvas-iframe",
1172
- style: { width: `${e}px`, ...p },
1173
- className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1174
- initialContent: Fe,
1175
- children: [
1176
- /* @__PURE__ */ r.jsx(js, {}),
1177
- /* @__PURE__ */ r.jsx(
1178
- Bs,
1179
- {
1180
- block: n,
1181
- selectedBlockElement: U(v)
1182
- }
1183
- ),
1184
- /* @__PURE__ */ r.jsx(Is, { model: "page" }),
1185
- /* @__PURE__ */ r.jsx(ws, { children: Te ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Es, {}) }),
1186
- /* @__PURE__ */ r.jsx("br", {}),
1187
- /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
1188
- ]
1189
- }
1190
- )
1191
- }
1192
- );
1193
- }, Fn = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1194
- /* @__PURE__ */ r.jsx(as, {}),
1195
- /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(he, { fallback: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Ht, { children: /* @__PURE__ */ r.jsx(Ls, {}) }) }) })
1196
- ] });
1197
- export {
1198
- Fn as default
1199
- };