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