@chaibuilder/sdk 1.2.56 → 1.2.58
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/{AddBlocks-HeYXoex4.js → AddBlocks-05ZH2Suu.js} +46 -50
- package/dist/AddBlocks-MH_fqSRf.cjs +1 -0
- package/dist/CanvasArea-7nhpzTI-.cjs +59 -0
- package/dist/{CanvasArea-CqILE5PR.js → CanvasArea-kMGTLtCw.js} +409 -394
- package/dist/CodeEditor-vECReGwz.cjs +1 -0
- package/dist/{CodeEditor-kxV5RCpd.js → CodeEditor-zYBqhBv3.js} +33 -39
- package/dist/{CurrentPage-IrFGAb7n.js → CurrentPage-VksVpchp.js} +26 -25
- package/dist/CurrentPage-caSpOhR9.cjs +1 -0
- package/dist/{ListTree-0n_G8NJx.js → ListTree-0iy8aBgI.js} +82 -65
- package/dist/ListTree-Njsk1AzL.cjs +1 -0
- package/dist/{PagesPanel-RYBf0Yct.js → PagesPanel-2AEsdqhe.js} +20 -19
- package/dist/PagesPanel-tb0qtxz4.cjs +1 -0
- package/dist/{ProjectPanel-Zagx6l3Q.js → ProjectPanel-IHFBvE5H.js} +25 -24
- package/dist/ProjectPanel-gmBUq2NI.cjs +1 -0
- package/dist/{Settings-RLDTFFf8.js → Settings-r9IvIq0G.js} +405 -396
- package/dist/Settings-uVLt1oiz.cjs +1 -0
- package/dist/{SidePanels-ao969pMV.js → SidePanels-2fD5UfH5.js} +89 -88
- package/dist/SidePanels-rhTLiLy6.cjs +1 -0
- package/dist/ThemeConfiguration-PvMN3j6h.cjs +1 -0
- package/dist/{ThemeConfiguration-S7yArRMp.js → ThemeConfiguration-ab7lbA2y.js} +18 -24
- package/dist/Topbar-1JTIu0uN.cjs +1 -0
- package/dist/{Topbar-B8u0whpc.js → Topbar-x4gslZ4T.js} +39 -38
- package/dist/UILibrariesPanel-CaGLzB9c.cjs +1 -0
- package/dist/UILibrariesPanel-raxCToMd.js +216 -0
- package/dist/{UnsplashImages-wWRifkCp.js → UnsplashImages-alt_doTy.js} +42 -47
- package/dist/UnsplashImages-cah1BRL_.cjs +1 -0
- package/dist/UploadImages-5dRETWCo.cjs +1 -0
- package/dist/{UploadImages-lUvZhW_j.js → UploadImages-JqVL_aQd.js} +32 -38
- package/dist/add-page-modal-9e6JkoxV.cjs +1 -0
- package/dist/{add-page-modal-04b4l2zu.js → add-page-modal-DbmbwG7V.js} +29 -28
- package/dist/{confirm-alert-FX5030eR.js → confirm-alert-m85JJlQi.js} +15 -21
- package/dist/confirm-alert-rYsxlfR4.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +44 -43
- package/dist/delete-page-modal-YtRcj7eK.cjs +1 -0
- package/dist/{delete-page-modal-1u9CyAIP.js → delete-page-modal-nIBA3zCg.js} +22 -21
- package/dist/email.cjs +1 -1
- package/dist/email.js +19 -19
- package/dist/form-G3PqS2Gc.cjs +1 -0
- package/dist/{form-HRdEJjVq.js → form-MSL4CDff.js} +3 -3
- package/dist/{html-to-json-OnIZDDXw.js → html-to-json-_01DXd-a.js} +37 -36
- package/dist/html-to-json-ndxaXRT8.cjs +1 -0
- package/dist/index-0FIxW0gR.cjs +1 -0
- package/dist/index-5IJnVFyU.cjs +206 -0
- package/dist/index-7zSzDmAA.cjs +1 -0
- package/dist/{index-vfmO3y2d.js → index-b4Wjumon.js} +19 -19
- package/dist/{ChaiBuilderEditor-tkzS851D.js → index-grcmKbfu.js} +14660 -17763
- package/dist/index-uLn8W3eR.js +3145 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +17 -16
- package/dist/mockServiceWorker.js +18 -10
- package/dist/page-viewer-JySaivSD.cjs +1 -0
- package/dist/{page-viewer-dcb3u4OV.js → page-viewer-QxHe6m6V.js} +27 -26
- package/dist/project-general-setting-FqXwffxC.cjs +1 -0
- package/dist/{project-general-setting--sS34seu.js → project-general-setting-nSzmnyIU.js} +23 -22
- package/dist/{project-seo-setting-8tc3I-0M.js → project-seo-setting-3kFJ77jY.js} +20 -26
- package/dist/project-seo-setting-C3ilIIeM.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +104 -102
- package/dist/single-page-detail-F5J53NCW.cjs +1 -0
- package/dist/{single-page-detail-tP2pfgBp.js → single-page-detail-uSK1ExCH.js} +26 -25
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +19 -18
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +144 -150
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +164 -107
- package/package.json +1 -1
- package/dist/AddBlocks-VHoZezjj.cjs +0 -1
- package/dist/CanvasArea-137WY3Wx.cjs +0 -56
- package/dist/ChaiBuilderEditor-aY8flOgX.cjs +0 -206
- package/dist/CodeEditor-R2jKe97T.cjs +0 -1
- package/dist/CurrentPage-PjrVzHXR.cjs +0 -1
- package/dist/ListTree-C6oCXZDV.cjs +0 -1
- package/dist/PagesPanel-lIC3kYmS.cjs +0 -1
- package/dist/ProjectPanel-0Siyi5YS.cjs +0 -1
- package/dist/Settings-6QRVcl16.cjs +0 -1
- package/dist/SidePanels-j1EFsBlK.cjs +0 -1
- package/dist/ThemeConfiguration-q1471P7b.cjs +0 -1
- package/dist/Topbar-ogFKKDbx.cjs +0 -1
- package/dist/UILibrariesPanel-cm9CFWxc.cjs +0 -1
- package/dist/UILibrariesPanel-tcfz2ELp.js +0 -196
- package/dist/UnsplashImages-E2L3YDJI.cjs +0 -1
- package/dist/UploadImages-s-eeaGiS.cjs +0 -1
- package/dist/add-page-modal-eroF20lO.cjs +0 -1
- package/dist/confirm-alert-XuxEzG-V.cjs +0 -1
- package/dist/delete-page-modal-pgh7sdfg.cjs +0 -1
- package/dist/form-Z4IRWj0o.cjs +0 -1
- package/dist/html-to-json-rauxDBi6.cjs +0 -1
- package/dist/index-bt7EhwLh.cjs +0 -1
- package/dist/page-viewer-O960kM2x.cjs +0 -1
- package/dist/project-general-setting-lIvNs-Vq.cjs +0 -1
- package/dist/project-seo-setting-MIlAuqcc.cjs +0 -1
- package/dist/single-page-detail-0Z_hvd_j.cjs +0 -1
- package/dist/useCanvasSettings-R0h03UfD.cjs +0 -1
- package/dist/useCanvasSettings-rEZHbw3s.js +0 -6
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
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
|
|
6
|
-
import { map as
|
|
7
|
-
import { ResetIcon as ue, SunIcon as
|
|
8
|
-
import {
|
|
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-grcmKbfu.js";
|
|
9
10
|
import { useTranslation as re } from "react-i18next";
|
|
10
11
|
import { useAtom as b } from "jotai";
|
|
11
|
-
import { SparklesIcon as
|
|
12
|
+
import { SparklesIcon as Xt } from "lucide-react";
|
|
12
13
|
import me from "react-dom";
|
|
13
14
|
import w from "prop-types";
|
|
14
|
-
import { Quill as
|
|
15
|
-
import { d as ie, a as
|
|
16
|
-
import { flip as
|
|
17
|
-
import { useFloating as
|
|
18
|
-
import { useResizeObserver as
|
|
19
|
-
import { useFeature as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { twMerge as
|
|
25
|
-
import { S as ge, a as
|
|
26
|
-
import { getBlockComponent as
|
|
27
|
-
import {
|
|
28
|
-
import { Provider as
|
|
29
|
-
import { Resizable as
|
|
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
|
-
import "clsx";
|
|
32
|
-
import "@radix-ui/react-scroll-area";
|
|
33
|
-
import "i18next";
|
|
34
|
-
import "./Functions-7jnEwJyw.js";
|
|
35
|
-
import "tree-model";
|
|
36
|
-
import "./utils-VpVqnC9m.js";
|
|
37
32
|
import "@radix-ui/react-toggle";
|
|
38
33
|
import "class-variance-authority";
|
|
34
|
+
import "./utils-VpVqnC9m.js";
|
|
35
|
+
import "clsx";
|
|
39
36
|
import "@radix-ui/react-switch";
|
|
40
37
|
import "@radix-ui/react-slot";
|
|
41
38
|
import "@radix-ui/react-accordion";
|
|
42
39
|
import "@radix-ui/react-alert-dialog";
|
|
43
40
|
import "@radix-ui/react-dialog";
|
|
44
41
|
import "@radix-ui/react-label";
|
|
42
|
+
import "@radix-ui/react-scroll-area";
|
|
45
43
|
import "@radix-ui/react-tabs";
|
|
46
44
|
import "@radix-ui/react-tooltip";
|
|
47
45
|
import "@radix-ui/react-popover";
|
|
@@ -54,21 +52,24 @@ import "@radix-ui/react-toast";
|
|
|
54
52
|
import "cmdk";
|
|
55
53
|
import "@radix-ui/react-context-menu";
|
|
56
54
|
import "react-icons-picker";
|
|
55
|
+
import "./Functions-7jnEwJyw.js";
|
|
56
|
+
import "tree-model";
|
|
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,10 +86,10 @@ function ls() {
|
|
|
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
|
-
const
|
|
92
|
+
const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
92
93
|
"svg",
|
|
93
94
|
{
|
|
94
95
|
className: n ? "rotate-90" : "",
|
|
@@ -111,7 +112,7 @@ const fe = ({ 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",
|
|
@@ -130,48 +131,48 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
130
131
|
title: "tablet_md_title",
|
|
131
132
|
content: "tablet_md_content",
|
|
132
133
|
breakpoint: "md",
|
|
133
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
134
|
+
icon: /* @__PURE__ */ r.jsx(xe, {}),
|
|
134
135
|
width: 800
|
|
135
136
|
},
|
|
136
137
|
{
|
|
137
138
|
title: "tablet_lg_title",
|
|
138
139
|
content: "tablet_lg_content",
|
|
139
140
|
breakpoint: "lg",
|
|
140
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
141
|
+
icon: /* @__PURE__ */ r.jsx(xe, { landscape: !0 }),
|
|
141
142
|
width: 1024
|
|
142
143
|
},
|
|
143
144
|
{
|
|
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 = ({
|
|
158
159
|
title: n,
|
|
159
160
|
content: s,
|
|
160
161
|
currentBreakpoint: e,
|
|
161
162
|
breakpoint: t,
|
|
162
163
|
width: o,
|
|
163
|
-
icon:
|
|
164
|
-
onClick:
|
|
164
|
+
icon: a,
|
|
165
|
+
onClick: l
|
|
165
166
|
}) => {
|
|
166
167
|
const { t: i } = re();
|
|
167
|
-
return /* @__PURE__ */ r.jsxs(
|
|
168
|
-
/* @__PURE__ */ r.jsx(
|
|
169
|
-
|
|
168
|
+
return /* @__PURE__ */ r.jsxs(lt, { children: [
|
|
169
|
+
/* @__PURE__ */ r.jsx(at, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
170
|
+
X,
|
|
170
171
|
{
|
|
171
|
-
onClick: () =>
|
|
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
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: [
|
|
@@ -179,26 +180,26 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
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__ */ ce(
|
|
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
192
|
/* @__PURE__ */ r.jsxs(pt, { children: [
|
|
192
|
-
/* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(
|
|
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" }) }) }),
|
|
193
194
|
/* @__PURE__ */ r.jsxs(ht, { className: "w-56 border-border text-xs", children: [
|
|
194
195
|
/* @__PURE__ */ r.jsx(mt, { children: o("Breakpoints") }),
|
|
195
196
|
/* @__PURE__ */ r.jsx(gt, {}),
|
|
196
|
-
|
|
197
|
+
z(a, (i) => /* @__PURE__ */ r.jsx(
|
|
197
198
|
ft,
|
|
198
199
|
{
|
|
199
200
|
disabled: i.breakpoint === "xs",
|
|
200
|
-
onCheckedChange: () =>
|
|
201
|
-
checked: pe(e,
|
|
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,19 +207,19 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
206
207
|
] })
|
|
207
208
|
] })
|
|
208
209
|
] });
|
|
209
|
-
},
|
|
210
|
-
const { t: n } = re(), { setNewBlocks: s } =
|
|
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
214
|
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(xt, { children: [
|
|
214
|
-
/* @__PURE__ */ r.jsx(vt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
|
|
215
|
-
/* @__PURE__ */ r.jsx(
|
|
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
220
|
/* @__PURE__ */ r.jsxs($t, { className: "border-border", children: [
|
|
220
|
-
/* @__PURE__ */ r.jsxs(
|
|
221
|
-
/* @__PURE__ */ r.jsx(
|
|
221
|
+
/* @__PURE__ */ r.jsxs(bt, { children: [
|
|
222
|
+
/* @__PURE__ */ r.jsx(yt, { children: n("clear_canvas_title") }),
|
|
222
223
|
/* @__PURE__ */ r.jsx(kt, { children: n("clear_canvas_description") })
|
|
223
224
|
] }),
|
|
224
225
|
/* @__PURE__ */ r.jsxs(wt, { children: [
|
|
@@ -227,15 +228,15 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
227
228
|
] })
|
|
228
229
|
] })
|
|
229
230
|
] }) });
|
|
230
|
-
},
|
|
231
|
+
}, ms = () => {
|
|
231
232
|
const [n, s] = b(_t);
|
|
232
|
-
return
|
|
233
|
+
return U("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
233
234
|
/* @__PURE__ */ r.jsxs(Bt, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
|
|
234
|
-
/* @__PURE__ */ r.jsx(
|
|
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 fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
246
247
|
}
|
|
247
248
|
)
|
|
248
249
|
] }) : null;
|
|
249
|
-
},
|
|
250
|
-
const n =
|
|
250
|
+
}, gs = () => {
|
|
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(
|
|
254
|
+
/* @__PURE__ */ r.jsx(us, {}),
|
|
255
|
+
/* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
|
|
255
256
|
n ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
256
|
-
/* @__PURE__ */ r.jsx(
|
|
257
|
-
/* @__PURE__ */ r.jsx(
|
|
257
|
+
/* @__PURE__ */ r.jsx(ds, {}),
|
|
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
|
-
/* @__PURE__ */ r.jsx(
|
|
268
|
-
/* @__PURE__ */ r.jsx(
|
|
268
|
+
/* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
|
|
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(
|
|
273
|
-
/* @__PURE__ */ r.jsx(
|
|
272
|
+
/* @__PURE__ */ r.jsx(hs, {}),
|
|
273
|
+
/* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
|
|
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 fe = ({ 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 fe = ({ 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] =
|
|
329
|
-
const { width:
|
|
330
|
-
if (
|
|
331
|
-
const
|
|
332
|
-
let
|
|
333
|
-
const
|
|
334
|
-
i && (
|
|
331
|
+
</html>`, xs = (n) => {
|
|
332
|
+
const [s] = G(), [, e] = De(), [t, o] = _({}), a = q(() => {
|
|
333
|
+
const { width: l, height: i } = n;
|
|
334
|
+
if (l < s) {
|
|
335
|
+
const c = parseFloat((l / s).toFixed(2).toString());
|
|
336
|
+
let u = {};
|
|
337
|
+
const m = i * c;
|
|
338
|
+
i && (u = {
|
|
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
|
+
...u,
|
|
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,31 +365,31 @@ class Fe extends $e {
|
|
|
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
|
-
this._isMounted = !1, this.nodeRef =
|
|
392
|
+
this._isMounted = !1, this.nodeRef = S.createRef(), this.state = { iframeLoaded: !1 };
|
|
389
393
|
}
|
|
390
394
|
componentDidMount() {
|
|
391
395
|
this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
|
|
@@ -406,8 +410,8 @@ class ee extends $e {
|
|
|
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 [me.createPortal(this.props.head, this.getDoc().head), me.createPortal(
|
|
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 ee extends $e {
|
|
|
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 @@ N(ee, "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,289 +447,280 @@ N(ee, "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
|
|
460
|
-
const
|
|
461
|
-
if (!
|
|
463
|
+
let y = null, B = [], H = null, J = null;
|
|
464
|
+
const $e = (n, s, e) => {
|
|
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, u) => Math.abs(u - e) < Math.abs(c - e) ? u : c,
|
|
465
469
|
0
|
|
466
|
-
),
|
|
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,
|
|
475
|
-
const
|
|
476
|
-
|
|
478
|
+
return s.forEach((o, a) => {
|
|
479
|
+
const l = Math.abs(o[0] - n);
|
|
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 =
|
|
493
|
-
e === "vertical" ?
|
|
496
|
+
const s = n.target, e = le(s), t = (o = y == null ? void 0 : y.defaultView) == null ? void 0 : o.scrollY;
|
|
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, u] = b(ie), [, m] = b(Ne), d = () => {
|
|
514
|
+
be(), e(!1), i(""), u(null), m(null), B = [];
|
|
515
|
+
};
|
|
516
|
+
return y = n, {
|
|
511
517
|
isDragging: s,
|
|
512
|
-
onDragOver: (
|
|
513
|
-
|
|
518
|
+
onDragOver: (h) => {
|
|
519
|
+
h.preventDefault(), h.stopPropagation(), ks(h);
|
|
514
520
|
},
|
|
515
|
-
onDrop: (
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
if (
|
|
522
|
-
|
|
523
|
-
Z();
|
|
524
|
-
}, 300), _ = [], e(!1), i(""), l(null), h(null);
|
|
521
|
+
onDrop: (h) => {
|
|
522
|
+
var D;
|
|
523
|
+
H == null || H.classList.remove("drop-target");
|
|
524
|
+
const x = H, g = le(x) === "vertical" ? h.clientY + ((D = y == null ? void 0 : y.defaultView) == null ? void 0 : D.scrollY) : h.clientX;
|
|
525
|
+
J = bs(g, B);
|
|
526
|
+
const p = c, k = x.getAttribute("data-block-id");
|
|
527
|
+
if (p === H) {
|
|
528
|
+
d();
|
|
525
529
|
return;
|
|
526
530
|
}
|
|
527
|
-
|
|
528
|
-
|
|
531
|
+
if (!K(p, "_id")) {
|
|
532
|
+
t(p, k === "canvas" ? null : k, J), setTimeout(d, 300);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
let C = x.getAttribute("data-block-id");
|
|
536
|
+
C === null && (C = h.target.parentElement.getAttribute("data-block-id")), l([p._id], C, J), d(), setTimeout(be, 300);
|
|
529
537
|
},
|
|
530
|
-
onDragEnter: (
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
538
|
+
onDragEnter: (h) => {
|
|
539
|
+
const x = h, $ = 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
|
|
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
|
-
|
|
570
|
-
|
|
571
|
-
}), i === "Text" && (
|
|
572
|
-
const
|
|
573
|
-
function
|
|
574
|
-
const
|
|
575
|
-
s([
|
|
563
|
+
const c = l.cloneNode(!0);
|
|
564
|
+
l.style.display = "none", Array.from(c.attributes).forEach((h) => {
|
|
565
|
+
h.name !== "class" && c.removeAttribute(h.name);
|
|
566
|
+
}), i === "Text" && (c.style.display = "inline-block"), l.parentNode.insertBefore(c, l.nextSibling);
|
|
567
|
+
const u = new Gt(c, { placeholder: "Type here..." });
|
|
568
|
+
function m() {
|
|
569
|
+
const h = u.getText(0, u.getLength());
|
|
570
|
+
s([l.getAttribute("data-block-id")], { content: h }), l.removeAttribute("style"), c.removeEventListener("blur", m, !0), _s(u), o(""), e("");
|
|
576
571
|
}
|
|
577
|
-
|
|
578
|
-
(
|
|
579
|
-
}),
|
|
572
|
+
c.addEventListener("blur", m, !0), c.addEventListener("keydown", (h) => {
|
|
573
|
+
(h.key === "Enter" || h.key === "Escape") && m();
|
|
574
|
+
}), u.focus(), (d = c.querySelector(".ql-clipboard")) == null || d.remove(), o(l.getAttribute("data-block-id"));
|
|
580
575
|
};
|
|
581
|
-
},
|
|
582
|
-
const [, n] =
|
|
583
|
-
return (
|
|
576
|
+
}, As = () => {
|
|
577
|
+
const [, n] = L(), [s, e] = A(), [, t] = F(), [o] = b(P), [a] = b(It);
|
|
578
|
+
return (l) => {
|
|
584
579
|
if (o)
|
|
585
580
|
return;
|
|
586
|
-
|
|
587
|
-
const i =
|
|
581
|
+
l.stopPropagation();
|
|
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"), u = i.getAttribute("data-style-id"), m = i.getAttribute("data-block-parent");
|
|
589
|
+
s.includes(m) || a == null || a.closeAll(), n([{ id: u, 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
|
-
},
|
|
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
|
-
s ||
|
|
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 u = Pe(s, Y(e));
|
|
611
|
+
if (u) {
|
|
612
|
+
const m = u.getAttribute("data-style-prop");
|
|
613
|
+
if (m) {
|
|
614
|
+
const d = u.getAttribute("data-style-id"), h = u.getAttribute("data-block-parent");
|
|
615
|
+
o([{ id: d, prop: m, blockId: h }]);
|
|
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
|
-
onClick:
|
|
632
|
-
onDoubleClick:
|
|
626
|
+
onClick: l,
|
|
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
|
-
},
|
|
640
|
-
const { window: n } =
|
|
641
|
-
g.key === "Enter" && (g.preventDefault(), s.length === 1 &&
|
|
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(), u = Te(), { savePage: m } = Et(), [d] = b(P), [, h] = b(Tt), x = (g) => {
|
|
636
|
+
g.key === "Enter" && (g.preventDefault(), s.length === 1 && h(Y(s)));
|
|
637
|
+
}, $ = (g) => {
|
|
638
|
+
const p = t.find((k) => k._id === g);
|
|
639
|
+
return p ? p._parent : null;
|
|
645
640
|
};
|
|
646
641
|
return j(() => {
|
|
647
|
-
const g = (
|
|
648
|
-
if (
|
|
642
|
+
const g = (p) => {
|
|
643
|
+
if (p.key === "Escape") {
|
|
649
644
|
e([]), o([]);
|
|
650
645
|
return;
|
|
651
646
|
}
|
|
652
|
-
if (
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
const k = s.length > 0 ?
|
|
647
|
+
if (x(p), !d && (p.key === "Delete" || p.key === "Backspace") && (p.preventDefault(), u(s)), p.ctrlKey || p.metaKey) {
|
|
648
|
+
if (p.key === "ArrowUp") {
|
|
649
|
+
p.preventDefault();
|
|
650
|
+
const k = s.length > 0 ? $(s[0]) : null;
|
|
656
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(p.key)) {
|
|
654
|
+
if (d && ["x", "z", "v"].includes(p.key))
|
|
660
655
|
return !0;
|
|
661
|
-
|
|
656
|
+
p.preventDefault();
|
|
662
657
|
}
|
|
663
|
-
|
|
658
|
+
p.key === "s" && (p.stopPropagation(), p.preventDefault(), m()), p.key === "z" && a(), p.key === "y" && l(), p.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, u, 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:
|
|
677
|
-
onDragStart: (
|
|
678
|
-
|
|
671
|
+
draggable: a ? "true" : "false",
|
|
672
|
+
onDragStart: (l) => {
|
|
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
|
-
},
|
|
689
|
-
const e =
|
|
683
|
+
}, Ns = ({ selectedBlockElement: n, block: s }) => {
|
|
684
|
+
const e = Te(), t = Ie(), [, o] = A(), [, a] = L(), [l] = b(P), { floatingStyles: i, refs: c, update: u } = 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
|
|
698
|
-
return !n || !s ||
|
|
691
|
+
Vt(n, () => u(), n !== null);
|
|
692
|
+
const m = f(s, "_parent", null), d = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
|
|
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
|
-
onClick: (
|
|
706
|
-
|
|
700
|
+
onClick: (h) => {
|
|
701
|
+
h.stopPropagation(), h.preventDefault();
|
|
707
702
|
},
|
|
708
|
-
onKeyDown: (
|
|
703
|
+
onKeyDown: (h) => h.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
|
-
|
|
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 Cs = () => {
|
|
|
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] = Lt(), [e] =
|
|
976
|
+
}, Ls = ({ model: n }) => {
|
|
977
|
+
const [s] = Lt(), [e] = A(), [t] = _e(), [o] = F(), [a] = L(), [l] = b(Se), { document: i, window: c } = Q(), [u] = _(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
|
-
), [
|
|
981
|
+
), [h] = _(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
|
|
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"), p = 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
|
-
]),
|
|
989
|
+
{ color: p, name: "secondary" }
|
|
990
|
+
]), O = {
|
|
996
991
|
"bg-light": k,
|
|
997
992
|
"bg-dark": C,
|
|
998
|
-
"text-dark":
|
|
999
|
-
"text-light":
|
|
1000
|
-
},
|
|
1001
|
-
!
|
|
993
|
+
"text-dark": D,
|
|
994
|
+
"text-light": E
|
|
995
|
+
}, v = f(s, "roundedCorners", "0");
|
|
996
|
+
!c || !c.tailwind || (c.tailwind.config = {
|
|
1002
997
|
darkMode: "class",
|
|
1003
998
|
theme: {
|
|
1004
999
|
extend: {
|
|
@@ -1010,177 +1005,197 @@ const Cs = () => {
|
|
|
1010
1005
|
}
|
|
1011
1006
|
},
|
|
1012
1007
|
fontFamily: {
|
|
1013
|
-
heading: [
|
|
1014
|
-
body: [
|
|
1008
|
+
heading: [x],
|
|
1009
|
+
body: [$]
|
|
1015
1010
|
},
|
|
1016
1011
|
borderRadius: {
|
|
1017
|
-
DEFAULT: `${
|
|
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,
|
|
1029
|
-
if (!
|
|
1030
|
-
|
|
1023
|
+
}, [e, m]), j(() => {
|
|
1024
|
+
if (!l) {
|
|
1025
|
+
h.textContent = "";
|
|
1031
1026
|
return;
|
|
1032
1027
|
}
|
|
1033
|
-
|
|
1034
|
-
}, [
|
|
1035
|
-
|
|
1036
|
-
}, [o, e,
|
|
1037
|
-
|
|
1028
|
+
h.textContent = `[data-block-id="${l}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
|
|
1029
|
+
}, [l]), j(() => {
|
|
1030
|
+
u && (u.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
|
|
1031
|
+
}, [o, e, u]), 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-[${k}] dark:text-[${
|
|
1035
|
+
}, [a, d]), j(() => {
|
|
1036
|
+
const g = f(s, "bodyTextLightColor", "#64748b"), p = 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-[${p}] 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",
|
|
1046
1041
|
{
|
|
1047
1042
|
id: "heading-font",
|
|
1048
1043
|
rel: "stylesheet",
|
|
1049
1044
|
type: "text/css",
|
|
1050
|
-
href: `https://fonts.googleapis.com/css2?family=${
|
|
1045
|
+
href: `https://fonts.googleapis.com/css2?family=${x.replace(
|
|
1051
1046
|
/ /g,
|
|
1052
1047
|
"+"
|
|
1053
1048
|
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
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`,
|
|
1067
1062
|
media: "all"
|
|
1068
1063
|
}
|
|
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 u = e.indexOf(i);
|
|
1074
|
+
if (u <= t) {
|
|
1075
|
+
const m = ["block", "flex", "inline", "inline-block", "inline-flex", "grid", "table"].includes(c);
|
|
1076
|
+
for (let d = u; d < e.length; d++)
|
|
1077
|
+
a[d] = m;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return a[t];
|
|
1081
|
+
}, Hs = (n) => {
|
|
1073
1082
|
const s = {};
|
|
1074
1083
|
return Object.keys(n).forEach((e) => {
|
|
1075
|
-
|
|
1084
|
+
oe(n[e]) && n[e].startsWith(ge) && (s[e] = n[e].replace(ge, "").split(","));
|
|
1076
1085
|
}), s;
|
|
1077
|
-
},
|
|
1078
|
-
const s = n.replace(
|
|
1079
|
-
return
|
|
1086
|
+
}, Ps = Ye((n) => {
|
|
1087
|
+
const s = n.replace(Me, "").split(",");
|
|
1088
|
+
return rs(s[0], s[1]);
|
|
1080
1089
|
});
|
|
1081
|
-
function
|
|
1090
|
+
function Os(n, s) {
|
|
1082
1091
|
return f(n, `${s}_attrs`, {});
|
|
1083
1092
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const
|
|
1086
|
-
return Object.keys(n).forEach((
|
|
1087
|
-
if (
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
className:
|
|
1091
|
-
"data-style-prop":
|
|
1093
|
+
function zs(n, s) {
|
|
1094
|
+
const e = {};
|
|
1095
|
+
return Object.keys(n).forEach((t) => {
|
|
1096
|
+
if (oe(n[t]) && n[t].startsWith(Me)) {
|
|
1097
|
+
const o = Ps(n[t]), a = Os(n, t);
|
|
1098
|
+
e[t] = {
|
|
1099
|
+
className: o,
|
|
1100
|
+
"data-style-prop": t,
|
|
1092
1101
|
"data-block-parent": n._id,
|
|
1093
|
-
"data-style-id": `${
|
|
1094
|
-
...
|
|
1102
|
+
"data-style-id": `${t}-${n._id}`,
|
|
1103
|
+
...a
|
|
1095
1104
|
};
|
|
1105
|
+
const l = K(a, "x-show") || K(a, "x-if");
|
|
1106
|
+
l && (e.__isHidden = l && !Rs(o, s));
|
|
1096
1107
|
}
|
|
1097
|
-
}),
|
|
1108
|
+
}), e;
|
|
1098
1109
|
}
|
|
1099
|
-
function
|
|
1110
|
+
function Us(n, s) {
|
|
1100
1111
|
const e = f(n, "_bindings", {});
|
|
1101
|
-
return I(e) ? { ...n } : (
|
|
1102
|
-
|
|
1112
|
+
return I(e) ? { ...n } : (Xe(e, (t, o) => {
|
|
1113
|
+
oe(t) && f(s, t, null) && (n[o] = f(s, t, null));
|
|
1103
1114
|
}), n);
|
|
1104
1115
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const [s] = ne(), [e] = b(
|
|
1107
|
-
(
|
|
1108
|
-
const
|
|
1109
|
-
return { ...h,
|
|
1116
|
+
function se({ blocks: n }) {
|
|
1117
|
+
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(), [u] = b(P), m = q(
|
|
1118
|
+
(d) => d.reduce((h, x) => {
|
|
1119
|
+
const $ = f(l, x, {});
|
|
1120
|
+
return { ...h, ...$ };
|
|
1110
1121
|
}, {}),
|
|
1111
|
-
[
|
|
1122
|
+
[l, s]
|
|
1112
1123
|
);
|
|
1113
|
-
return /* @__PURE__ */ r.jsx(r.Fragment, { children:
|
|
1114
|
-
n.map((
|
|
1115
|
-
if (
|
|
1124
|
+
return /* @__PURE__ */ r.jsx(r.Fragment, { children: S.Children.toArray(
|
|
1125
|
+
n.map((d, h) => {
|
|
1126
|
+
if (u === d._id)
|
|
1116
1127
|
return null;
|
|
1117
|
-
const
|
|
1118
|
-
I(
|
|
1119
|
-
|
|
1120
|
-
|
|
1128
|
+
const x = Hs(d), $ = {};
|
|
1129
|
+
I(x) || Object.keys(x).forEach((R) => {
|
|
1130
|
+
$[R] = S.Children.toArray(
|
|
1131
|
+
x[R].map((O) => /* @__PURE__ */ r.jsx(se, { blocks: [Ge(s, { _id: O })] }))
|
|
1121
1132
|
);
|
|
1122
1133
|
});
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1127
|
-
return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${
|
|
1128
|
-
const
|
|
1129
|
-
return /* @__PURE__ */ r.jsx(
|
|
1134
|
+
const g = je(s, { _parent: d._id });
|
|
1135
|
+
$.children = g.length ? /* @__PURE__ */ r.jsx(se, { blocks: g }) : null;
|
|
1136
|
+
const p = is(d._type), k = f(p, "builderComponent", f(p, "component", null));
|
|
1137
|
+
if (Qe(k))
|
|
1138
|
+
return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${d == null ? void 0 : d._type} not registered -->` });
|
|
1139
|
+
const C = K(p, "getBlockStateFrom") ? p == null ? void 0 : p.getBlockStateFrom(d, s) : [], D = m(C), E = i(d);
|
|
1140
|
+
return f(E, "__isHidden", !1) && !fe(e, d._id) ? null : /* @__PURE__ */ r.jsx(V, { children: S.createElement(k, {
|
|
1130
1141
|
blockProps: {
|
|
1131
|
-
"
|
|
1132
|
-
"data-block-
|
|
1133
|
-
|
|
1142
|
+
...fe(e, d._id) ? { "force-show": "" } : {},
|
|
1143
|
+
"data-block-id": d._id,
|
|
1144
|
+
"data-block-type": d._type,
|
|
1145
|
+
...t ? (
|
|
1134
1146
|
// @ts-ignore
|
|
1135
|
-
{
|
|
1147
|
+
{
|
|
1148
|
+
"data-dnd": Ht(d._type, t == null ? void 0 : t._type) ? "yes" : "no",
|
|
1149
|
+
"data-dnd-dragged": t._id === d._id ? "yes" : "no"
|
|
1150
|
+
}
|
|
1136
1151
|
) : {},
|
|
1137
|
-
...
|
|
1152
|
+
...o === d._id ? { "data-drop": "yes" } : {}
|
|
1138
1153
|
},
|
|
1139
1154
|
index: h,
|
|
1140
|
-
...
|
|
1141
|
-
...
|
|
1142
|
-
|
|
1155
|
+
...Us(d, c),
|
|
1156
|
+
...we(E, ["__isHidden"]),
|
|
1157
|
+
...$,
|
|
1143
1158
|
inBuilder: !0,
|
|
1144
|
-
blockState:
|
|
1159
|
+
blockState: D
|
|
1145
1160
|
}) });
|
|
1146
1161
|
})
|
|
1147
1162
|
) });
|
|
1148
1163
|
}
|
|
1149
|
-
const
|
|
1150
|
-
const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(
|
|
1164
|
+
const Ws = () => {
|
|
1165
|
+
const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsx(se, { blocks: je(n, (e) => I(e._parent)) }) });
|
|
1151
1166
|
return /* @__PURE__ */ r.jsx(r.Fragment, { children: s });
|
|
1152
|
-
},
|
|
1153
|
-
const [n] = b(Pt), [s] =
|
|
1167
|
+
}, qs = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Ks = () => {
|
|
1168
|
+
const [n] = b(Pt), [s] = Ee(), [e] = G(), [, t] = A(), o = Ot(), [, a] = F(), l = de(null), i = de(null), [c, u] = _({ width: 0, height: 0 }), m = xs(c), [d, h] = _(0), [x, $] = _([]), [, g] = _([]), [, p] = b(zt), [k, C] = L(), D = U("loading", !1), E = U("htmlDir", "ltr");
|
|
1154
1169
|
j(() => {
|
|
1155
|
-
const { clientWidth:
|
|
1156
|
-
|
|
1157
|
-
}, [i, e,
|
|
1158
|
-
const
|
|
1159
|
-
const { top:
|
|
1160
|
-
return
|
|
1170
|
+
const { clientWidth: v, clientHeight: T } = i.current;
|
|
1171
|
+
u({ width: v, height: T }), d === 0 && h(v);
|
|
1172
|
+
}, [i, e, d]);
|
|
1173
|
+
const R = (v, T = 0) => {
|
|
1174
|
+
const { top: N } = v.getBoundingClientRect();
|
|
1175
|
+
return N + T >= 0 && N - T <= window.innerHeight;
|
|
1161
1176
|
};
|
|
1162
1177
|
j(() => {
|
|
1163
|
-
var
|
|
1164
|
-
if (o && o.type !== "Multiple" &&
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1178
|
+
var v, T;
|
|
1179
|
+
if (o && o.type !== "Multiple" && l.current) {
|
|
1180
|
+
const N = Pe(l.current.contentDocument, o._id);
|
|
1181
|
+
N && (R(N) || (T = (v = l.current) == null ? void 0 : v.contentWindow) == null || T.scrollTo({ top: N.offsetTop, behavior: "smooth" }), $([N]));
|
|
1167
1182
|
}
|
|
1168
1183
|
}, [o]), j(() => {
|
|
1169
|
-
if (!I(k) &&
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1172
|
-
|
|
1184
|
+
if (!I(k) && l.current) {
|
|
1185
|
+
const v = qs(
|
|
1186
|
+
l.current.contentDocument,
|
|
1187
|
+
Y(k).id
|
|
1173
1188
|
);
|
|
1174
|
-
g(
|
|
1189
|
+
g(v ? [v] : [null]);
|
|
1175
1190
|
} else
|
|
1176
1191
|
g([null]);
|
|
1177
1192
|
}, [k]);
|
|
1178
|
-
const
|
|
1179
|
-
let
|
|
1180
|
-
return
|
|
1193
|
+
const O = We(() => {
|
|
1194
|
+
let v = fs;
|
|
1195
|
+
return v = v.replace("__HTML_DIR__", E), n === "offline" && (v = v.replace(
|
|
1181
1196
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1182
1197
|
"/offline/tailwind.cdn.js"
|
|
1183
|
-
),
|
|
1198
|
+
), v = v.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), v = v.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), v;
|
|
1184
1199
|
}, [n]);
|
|
1185
1200
|
return /* @__PURE__ */ r.jsx(
|
|
1186
1201
|
"div",
|
|
@@ -1188,30 +1203,30 @@ const Ps = () => {
|
|
|
1188
1203
|
onClick: () => {
|
|
1189
1204
|
t([]), C([]);
|
|
1190
1205
|
},
|
|
1191
|
-
onMouseLeave: () => setTimeout(() =>
|
|
1206
|
+
onMouseLeave: () => setTimeout(() => a(""), 300),
|
|
1192
1207
|
className: "relative mx-auto h-full w-full overflow-hidden",
|
|
1193
|
-
style:
|
|
1208
|
+
style: d > 0 && !I(m) ? { width: s ? "100%" : d } : {},
|
|
1194
1209
|
ref: i,
|
|
1195
1210
|
children: /* @__PURE__ */ r.jsxs(
|
|
1196
|
-
|
|
1211
|
+
$s,
|
|
1197
1212
|
{
|
|
1198
|
-
contentDidMount: () =>
|
|
1199
|
-
ref:
|
|
1213
|
+
contentDidMount: () => p(l.current),
|
|
1214
|
+
ref: l,
|
|
1200
1215
|
id: "canvas-iframe",
|
|
1201
|
-
style: { width: `${e}px`, ...
|
|
1216
|
+
style: { width: `${e}px`, ...m },
|
|
1202
1217
|
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1203
|
-
initialContent:
|
|
1218
|
+
initialContent: O,
|
|
1204
1219
|
children: [
|
|
1205
|
-
/* @__PURE__ */ r.jsx(
|
|
1220
|
+
/* @__PURE__ */ r.jsx(Es, {}),
|
|
1206
1221
|
/* @__PURE__ */ r.jsx(
|
|
1207
|
-
|
|
1222
|
+
Ns,
|
|
1208
1223
|
{
|
|
1209
1224
|
block: o,
|
|
1210
|
-
selectedBlockElement:
|
|
1225
|
+
selectedBlockElement: Y(x)
|
|
1211
1226
|
}
|
|
1212
1227
|
),
|
|
1213
|
-
/* @__PURE__ */ r.jsx(
|
|
1214
|
-
/* @__PURE__ */ r.jsx(
|
|
1228
|
+
/* @__PURE__ */ r.jsx(Ls, { model: "page" }),
|
|
1229
|
+
/* @__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
1230
|
/* @__PURE__ */ r.jsx("br", {}),
|
|
1216
1231
|
/* @__PURE__ */ r.jsx(
|
|
1217
1232
|
"div",
|
|
@@ -1225,16 +1240,16 @@ const Ps = () => {
|
|
|
1225
1240
|
)
|
|
1226
1241
|
}
|
|
1227
1242
|
);
|
|
1228
|
-
},
|
|
1243
|
+
}, Ys = S.lazy(() => import("./CodeEditor-zYBqhBv3.js")), Vo = () => {
|
|
1229
1244
|
const [n] = Ut();
|
|
1230
1245
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1231
|
-
/* @__PURE__ */ r.jsx(
|
|
1246
|
+
/* @__PURE__ */ r.jsx(gs, {}),
|
|
1232
1247
|
/* @__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(
|
|
1248
|
+
/* @__PURE__ */ r.jsx(V, { fallback: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Yt, { children: /* @__PURE__ */ r.jsx(Ks, {}) }) }),
|
|
1249
|
+
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
1250
|
] })
|
|
1236
1251
|
] });
|
|
1237
1252
|
};
|
|
1238
1253
|
export {
|
|
1239
|
-
|
|
1254
|
+
Vo as default
|
|
1240
1255
|
};
|