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