@chaibuilder/sdk 1.2.38 → 1.2.39
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-2_dpKDpp.js +144 -0
- package/dist/AddBlocks-p4Hrxjdf.cjs +1 -0
- package/dist/{CanvasArea-WJYJtUFt.js → CanvasArea-iN0LxF74.js} +183 -184
- package/dist/{CanvasArea-MuuWWyW0.cjs → CanvasArea-sbec3R-f.cjs} +5 -5
- package/dist/{ChaiBuilderEditor-vzyVasJe.js → ChaiBuilderEditor-JnZFji5_.js} +8191 -8073
- package/dist/{ChaiBuilderEditor-PLQ8Sq34.cjs → ChaiBuilderEditor-qxbkVVLu.cjs} +49 -49
- package/dist/{CurrentPage-j6xVMVFH.js → CurrentPage-Lr3ztuMx.js} +9 -10
- package/dist/CurrentPage-m7_GkZ8a.cjs +1 -0
- package/dist/ListTree-piETqoz9.cjs +1 -0
- package/dist/{ListTree-1oWz6vwo.js → ListTree-uJFhqUk9.js} +1 -2
- package/dist/{PagesPanel-PKnqTla9.js → PagesPanel-R8FWg5Xg.js} +4 -5
- package/dist/PagesPanel-lShO3SmJ.cjs +1 -0
- package/dist/{ProjectPanel-hx21JHK8.js → ProjectPanel-2dX4bM5q.js} +5 -6
- package/dist/ProjectPanel-_4546hym.cjs +1 -0
- package/dist/{Settings-3omes6Yj.js → Settings-J785mqWv.js} +4 -5
- package/dist/Settings-e2AZkjqY.cjs +1 -0
- package/dist/SidePanels-Vfw9Ir6p.cjs +1 -0
- package/dist/{SidePanels-vNc0pvVt.js → SidePanels-cN9er64h.js} +165 -146
- package/dist/{BrandingOptions-z7hXgff2.js → ThemeConfiguration-m_jkR2zi.js} +42 -41
- package/dist/ThemeConfiguration-nler1cz3.cjs +1 -0
- package/dist/Topbar-DmIPkF8D.cjs +1 -0
- package/dist/{Topbar-c3HIPa_q.js → Topbar-gaBycI3a.js} +3 -4
- package/dist/UILibrariesPanel-Igx0R4zc.js +138 -0
- package/dist/UILibrariesPanel-N144UO0E.cjs +1 -0
- package/dist/{UnsplashImages-IQo081nF.js → UnsplashImages-6HmGnetM.js} +3 -4
- package/dist/UnsplashImages-mC2ewX9D.cjs +1 -0
- package/dist/UploadImages-fo9ufcCE.cjs +1 -0
- package/dist/{UploadImages-BAy3wsRT.js → UploadImages-qRW8zhKj.js} +3 -4
- package/dist/{add-page-modal-WWRdRyDM.js → add-page-modal-0OuVNgx3.js} +16 -17
- package/dist/add-page-modal-mP9aTfG9.cjs +1 -0
- package/dist/{confirm-alert-LvvLsCWh.cjs → confirm-alert-3cDnni4v.cjs} +1 -1
- package/dist/{confirm-alert-h4RiwjkJ.js → confirm-alert-Mv-Iofef.js} +3 -4
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +44 -45
- package/dist/{delete-page-modal-XymJxo7r.js → delete-page-modal-BVz9nreM.js} +4 -5
- package/dist/delete-page-modal-PTwcrTET.cjs +1 -0
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +3 -0
- package/dist/email.js +3 -4
- package/dist/{form-P0nEC3WH.js → form-e8l4xtI9.js} +1 -1
- package/dist/{form-I4uC5vkq.cjs → form-o7e6NNTk.cjs} +1 -1
- package/dist/{index-mVQVs_cP.cjs → index--XTVdy1h.cjs} +1 -1
- package/dist/{index-SP6aKHPH.js → index-CdnwVCXv.js} +2 -2
- package/dist/{page-viewer-OSlqdbEV.js → page-viewer-OopsJHBE.js} +5 -6
- package/dist/page-viewer-cjvx3lg7.cjs +1 -0
- package/dist/{project-general-setting-JR9L7fMQ.cjs → project-general-setting-3sdmeYrS.cjs} +1 -1
- package/dist/{project-general-setting-LXfl5i5Z.js → project-general-setting-n8KKf8qD.js} +5 -6
- package/dist/{project-seo-setting-cVDCPjBD.cjs → project-seo-setting-E554FQ3V.cjs} +1 -1
- package/dist/{project-seo-setting-lyzUUxe2.js → project-seo-setting-pu3qUSE0.js} +4 -5
- package/dist/single-page-detail-KdxEu4WS.cjs +1 -0
- package/dist/{single-page-detail-GeG-SXWn.js → single-page-detail-hcTkta3X.js} +6 -7
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +3 -0
- package/dist/studio.js +3 -4
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +138 -139
- package/dist/{useCanvasSettings-_EzUaA9P.js → useCanvasSettings-6lwRwexD.js} +1 -1
- package/dist/{useCanvasSettings-bP_V0UR2.cjs → useCanvasSettings-oERGzYXb.cjs} +1 -1
- package/package.json +2 -2
- package/dist/AddBlocks-G9pjsIyq.cjs +0 -1
- package/dist/AddBlocks-dljjAE5r.js +0 -210
- package/dist/BrandingOptions-N7iDaMgM.cjs +0 -1
- package/dist/CurrentPage-LaeYQ-Ke.cjs +0 -1
- package/dist/ListTree-_7e5p_e3.cjs +0 -1
- package/dist/PagesPanel-BsELxMie.cjs +0 -1
- package/dist/ProjectPanel-1aAFwguw.cjs +0 -1
- package/dist/Settings-tYjuuUgX.cjs +0 -1
- package/dist/SidePanels-7WG6SXw0.cjs +0 -1
- package/dist/Topbar-1zU6Ljsn.cjs +0 -1
- package/dist/UnsplashImages-zCQkmow-.cjs +0 -1
- package/dist/UploadImages-6K3GdM-b.cjs +0 -1
- package/dist/add-page-modal-8FJnOckX.cjs +0 -1
- package/dist/delete-page-modal-IRX0oKZJ.cjs +0 -1
- package/dist/page-viewer-fonOyiuT.cjs +0 -1
- package/dist/single-page-detail-LL8m0Va7.cjs +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var He = (o, s, e) => s in o ? Pe(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e;
|
|
3
|
+
var _ = (o, s, e) => (He(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
4
|
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
|
-
import
|
|
6
|
-
import { map as
|
|
7
|
-
import { ResetIcon as re, MobileIcon as ie, LaptopIcon as
|
|
8
|
-
import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as
|
|
5
|
+
import A, { createElement as se, useCallback as H, useState as j, useEffect as k, Component as ue, Children as Oe, Suspense as he, useRef as ne, useMemo as ze } from "react";
|
|
6
|
+
import { map as P, includes as oe, toUpper as Y, round as Ue, noop as T, has as Q, throttle as me, isEmpty as D, first as U, omit as We, pick as qe, get as f, isString as G, memoize as Ke, each as Ye, find as Je, filter as ge, isNull as Qe } from "lodash-es";
|
|
7
|
+
import { ResetIcon as re, MobileIcon as ie, LaptopIcon as Ze, DesktopIcon as Xe, DotsVerticalIcon as Ge, EraserIcon as Ve, ZoomInIcon as et, DragHandleDots2Icon as tt, ArrowUpIcon as st, CopyIcon as nt, TrashIcon as ot } from "@radix-ui/react-icons";
|
|
8
|
+
import { j as fe, B as W, v as xe, aq as ve, ar as $e, as as rt, at as it, au as at, o as V, X as lt, h as L, av as ct, aw as dt, ax as pt, ay as ut, az as ht, aA as mt, aB as gt, L as C, Y as N, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as ye, ap as z, m as Bt, aD as Dt, z as M, Q as It, aE as R, aF as St, i as ee, w as be, E as ke, H as we, V as _t, aG as At, aH as je, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Rt, M as Ft, aN as Pt, ah as Ce, a2 as Ht } from "./ChaiBuilderEditor-JnZFji5_.js";
|
|
9
9
|
import { useTranslation as q } from "react-i18next";
|
|
10
10
|
import { useAtom as y } from "jotai";
|
|
11
|
-
import { SparklesIcon as
|
|
11
|
+
import { SparklesIcon as Ot } from "lucide-react";
|
|
12
12
|
import ae from "react-dom";
|
|
13
13
|
import b from "prop-types";
|
|
14
|
-
import { Quill as
|
|
14
|
+
import { Quill as zt } from "react-quill";
|
|
15
15
|
import { useFeature as Be } from "flagged";
|
|
16
|
-
import { flip as
|
|
17
|
-
import { useFloating as
|
|
18
|
-
import { useResizeObserver as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { Provider as
|
|
24
|
-
import { twMerge as
|
|
25
|
-
import { S as le, a as
|
|
26
|
-
import { getBlockComponent as
|
|
27
|
-
import { u as
|
|
16
|
+
import { flip as Ut } from "@floating-ui/dom";
|
|
17
|
+
import { useFloating as Wt, shift as qt } from "@floating-ui/react-dom";
|
|
18
|
+
import { useResizeObserver as Kt } from "@react-hookz/web";
|
|
19
|
+
import Yt from "@tailwindcss/typography";
|
|
20
|
+
import Jt from "@tailwindcss/forms";
|
|
21
|
+
import Qt from "@tailwindcss/aspect-ratio";
|
|
22
|
+
import Zt from "tailwindcss-palette-generator";
|
|
23
|
+
import { Provider as Xt } from "react-wrap-balancer";
|
|
24
|
+
import { twMerge as Gt } from "tailwind-merge";
|
|
25
|
+
import { S as le, a as De } from "./STRINGS--j49GZJP.js";
|
|
26
|
+
import { getBlockComponent as Vt } from "@chaibuilder/runtime";
|
|
27
|
+
import { u as es } from "./useCanvasSettings-6lwRwexD.js";
|
|
28
28
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
29
29
|
import "clsx";
|
|
30
30
|
import "@radix-ui/react-scroll-area";
|
|
@@ -53,15 +53,14 @@ import "cmdk";
|
|
|
53
53
|
import "@radix-ui/react-context-menu";
|
|
54
54
|
import "react-icons-picker";
|
|
55
55
|
import "react-hotkeys-hook";
|
|
56
|
-
|
|
57
|
-
const es = () => {
|
|
56
|
+
const ts = () => {
|
|
58
57
|
const { hasUndo: o, hasRedo: s, undo: e, redo: t } = fe();
|
|
59
58
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
60
59
|
/* @__PURE__ */ r.jsx(W, { disabled: !o(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, {}) }),
|
|
61
60
|
/* @__PURE__ */ r.jsx(W, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(re, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
62
61
|
] });
|
|
63
62
|
};
|
|
64
|
-
function
|
|
63
|
+
function ss() {
|
|
65
64
|
const [o, s] = xe(), { t: e } = q();
|
|
66
65
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
67
66
|
/* @__PURE__ */ r.jsx(ve, { htmlFor: "dark-mode-switch", children: e("dark_mode") }),
|
|
@@ -113,7 +112,7 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
113
112
|
)
|
|
114
113
|
]
|
|
115
114
|
}
|
|
116
|
-
),
|
|
115
|
+
), ns = [
|
|
117
116
|
{
|
|
118
117
|
title: "mobile_xs_title",
|
|
119
118
|
content: "mobile_xs_content",
|
|
@@ -146,14 +145,14 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
146
145
|
title: "desktop_xl_title",
|
|
147
146
|
content: "desktop_xl_content",
|
|
148
147
|
breakpoint: "xl",
|
|
149
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
148
|
+
icon: /* @__PURE__ */ r.jsx(Ze, {}),
|
|
150
149
|
width: 1420
|
|
151
150
|
},
|
|
152
151
|
{
|
|
153
152
|
title: "large_desktop_2xl_title",
|
|
154
153
|
content: "large_desktop_2xl_content",
|
|
155
154
|
breakpoint: "2xl",
|
|
156
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
155
|
+
icon: /* @__PURE__ */ r.jsx(Xe, {}),
|
|
157
156
|
width: 1920
|
|
158
157
|
}
|
|
159
158
|
], de = ({
|
|
@@ -166,8 +165,8 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
166
165
|
onClick: a
|
|
167
166
|
}) => {
|
|
168
167
|
const { t: i } = q();
|
|
169
|
-
return /* @__PURE__ */ r.jsxs(
|
|
170
|
-
/* @__PURE__ */ r.jsx(
|
|
168
|
+
return /* @__PURE__ */ r.jsxs(rt, { children: [
|
|
169
|
+
/* @__PURE__ */ r.jsx(it, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
171
170
|
W,
|
|
172
171
|
{
|
|
173
172
|
onClick: () => a(n),
|
|
@@ -176,27 +175,27 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
176
175
|
children: d
|
|
177
176
|
}
|
|
178
177
|
) }),
|
|
179
|
-
/* @__PURE__ */ r.jsx(
|
|
178
|
+
/* @__PURE__ */ r.jsx(at, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
|
|
180
179
|
/* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: i(o) }),
|
|
181
180
|
/* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
|
|
182
181
|
] }) }) })
|
|
183
182
|
] });
|
|
184
|
-
},
|
|
185
|
-
const [, o, s] = V(), [e, t] =
|
|
183
|
+
}, os = () => {
|
|
184
|
+
const [, o, s] = V(), [e, t] = lt(), { t: n } = q(), d = L("breakpoints", ns), a = (i) => {
|
|
186
185
|
e.includes(i) ? e.length > 2 && t(e.filter((l) => l !== i)) : t((l) => [...l, i]);
|
|
187
186
|
};
|
|
188
|
-
return d.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children:
|
|
189
|
-
|
|
187
|
+
return d.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: P(d, (i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
188
|
+
P(
|
|
190
189
|
d.filter((i) => oe(e, Y(i.breakpoint))),
|
|
191
190
|
(i) => /* @__PURE__ */ se(de, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: o })
|
|
192
191
|
),
|
|
193
|
-
/* @__PURE__ */ r.jsxs(
|
|
194
|
-
/* @__PURE__ */ r.jsx(
|
|
195
|
-
/* @__PURE__ */ r.jsxs(
|
|
196
|
-
/* @__PURE__ */ r.jsx(
|
|
197
|
-
/* @__PURE__ */ r.jsx(
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
/* @__PURE__ */ r.jsxs(ct, { children: [
|
|
193
|
+
/* @__PURE__ */ r.jsx(dt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ge, { className: "scale-90 transform" }) }) }),
|
|
194
|
+
/* @__PURE__ */ r.jsxs(pt, { className: "w-56 border-border text-xs", children: [
|
|
195
|
+
/* @__PURE__ */ r.jsx(ut, { children: n("Breakpoints") }),
|
|
196
|
+
/* @__PURE__ */ r.jsx(ht, {}),
|
|
197
|
+
P(d, (i) => /* @__PURE__ */ r.jsx(
|
|
198
|
+
mt,
|
|
200
199
|
{
|
|
201
200
|
disabled: i.breakpoint === "xs",
|
|
202
201
|
onCheckedChange: () => a(Y(i.breakpoint)),
|
|
@@ -208,32 +207,32 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
208
207
|
] })
|
|
209
208
|
] })
|
|
210
209
|
] });
|
|
211
|
-
},
|
|
212
|
-
const { t: o } = q(), { setNewBlocks: s } =
|
|
210
|
+
}, rs = () => {
|
|
211
|
+
const { t: o } = q(), { setNewBlocks: s } = gt(), [, e] = C(), [, t] = N(), n = H(() => {
|
|
213
212
|
s([]), e([]), t([]);
|
|
214
213
|
}, [s]);
|
|
215
|
-
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(
|
|
216
|
-
/* @__PURE__ */ r.jsx(
|
|
217
|
-
/* @__PURE__ */ r.jsx(
|
|
214
|
+
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(ft, { children: [
|
|
215
|
+
/* @__PURE__ */ r.jsx(xt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
216
|
+
/* @__PURE__ */ r.jsx(Ve, {}),
|
|
218
217
|
" ",
|
|
219
218
|
o("clear")
|
|
220
219
|
] }) }),
|
|
221
|
-
/* @__PURE__ */ r.jsxs(
|
|
222
|
-
/* @__PURE__ */ r.jsxs(
|
|
223
|
-
/* @__PURE__ */ r.jsx(
|
|
224
|
-
/* @__PURE__ */ r.jsx(
|
|
220
|
+
/* @__PURE__ */ r.jsxs(vt, { className: "border-border", children: [
|
|
221
|
+
/* @__PURE__ */ r.jsxs($t, { children: [
|
|
222
|
+
/* @__PURE__ */ r.jsx(yt, { children: o("clear_canvas_title") }),
|
|
223
|
+
/* @__PURE__ */ r.jsx(bt, { children: o("clear_canvas_description") })
|
|
225
224
|
] }),
|
|
226
|
-
/* @__PURE__ */ r.jsxs(
|
|
227
|
-
/* @__PURE__ */ r.jsx(
|
|
228
|
-
/* @__PURE__ */ r.jsx(
|
|
225
|
+
/* @__PURE__ */ r.jsxs(kt, { children: [
|
|
226
|
+
/* @__PURE__ */ r.jsx(wt, { children: o("cancel") }),
|
|
227
|
+
/* @__PURE__ */ r.jsx(jt, { onClick: n, children: o("yes") })
|
|
229
228
|
] })
|
|
230
229
|
] })
|
|
231
230
|
] }) });
|
|
232
|
-
},
|
|
233
|
-
const [o, s] = y(
|
|
234
|
-
return
|
|
231
|
+
}, is = () => {
|
|
232
|
+
const [o, s] = y(Ct);
|
|
233
|
+
return L("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
235
234
|
/* @__PURE__ */ r.jsxs(ve, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
|
|
236
|
-
/* @__PURE__ */ r.jsx(
|
|
235
|
+
/* @__PURE__ */ r.jsx(Ot, { className: "w-4" }),
|
|
237
236
|
"AI Assistant"
|
|
238
237
|
] }),
|
|
239
238
|
/* @__PURE__ */ r.jsx(
|
|
@@ -248,35 +247,35 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
248
247
|
}
|
|
249
248
|
)
|
|
250
249
|
] }) : null;
|
|
251
|
-
},
|
|
252
|
-
const o =
|
|
250
|
+
}, as = () => {
|
|
251
|
+
const o = L("darkMode", !1), [s] = ye();
|
|
253
252
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
254
253
|
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
255
254
|
o ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
256
|
-
/* @__PURE__ */ r.jsx(
|
|
255
|
+
/* @__PURE__ */ r.jsx(ss, {}),
|
|
257
256
|
/* @__PURE__ */ r.jsx(z, { orientation: "vertical" })
|
|
258
257
|
] }) : null,
|
|
259
|
-
/* @__PURE__ */ r.jsx(
|
|
258
|
+
/* @__PURE__ */ r.jsx(os, {}),
|
|
260
259
|
/* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
|
|
261
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
|
|
262
|
-
/* @__PURE__ */ r.jsx(
|
|
260
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
|
|
261
|
+
/* @__PURE__ */ r.jsx(et, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
263
262
|
" ",
|
|
264
263
|
/* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
|
|
265
|
-
|
|
264
|
+
Ue(s, 0),
|
|
266
265
|
"%"
|
|
267
266
|
] })
|
|
268
267
|
] }),
|
|
269
268
|
/* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
|
|
270
|
-
/* @__PURE__ */ r.jsx(
|
|
269
|
+
/* @__PURE__ */ r.jsx(ts, {})
|
|
271
270
|
] }),
|
|
272
271
|
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
273
|
-
/* @__PURE__ */ r.jsx(
|
|
272
|
+
/* @__PURE__ */ r.jsx(rs, {}),
|
|
274
273
|
/* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
|
|
275
|
-
/* @__PURE__ */ r.jsx(
|
|
274
|
+
/* @__PURE__ */ r.jsx(is, {})
|
|
276
275
|
] })
|
|
277
276
|
] });
|
|
278
|
-
},
|
|
279
|
-
<html lang="en" class="scroll-smooth h-full overflow-y-auto">
|
|
277
|
+
}, ls = `<!doctype html>
|
|
278
|
+
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
280
279
|
<head>
|
|
281
280
|
<meta charset="UTF-8">
|
|
282
281
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -323,8 +322,8 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
323
322
|
<div class="frame-root h-full"></div>
|
|
324
323
|
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
325
324
|
</body>
|
|
326
|
-
</html>`,
|
|
327
|
-
const [s] = V(), [, e] = ye(), [t, n] = j({}), d =
|
|
325
|
+
</html>`, cs = (o) => {
|
|
326
|
+
const [s] = V(), [, e] = ye(), [t, n] = j({}), d = H(() => {
|
|
328
327
|
const { width: a, height: i } = o;
|
|
329
328
|
if (a < s) {
|
|
330
329
|
const l = parseFloat((a / s).toFixed(2).toString());
|
|
@@ -348,11 +347,11 @@ const ce = ({ landscape: o = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
348
347
|
d();
|
|
349
348
|
}, [s, o, e, d]), t;
|
|
350
349
|
};
|
|
351
|
-
let Ie,
|
|
350
|
+
let Ie, Se;
|
|
352
351
|
typeof document < "u" && (Ie = document);
|
|
353
|
-
typeof window < "u" && (
|
|
354
|
-
const
|
|
355
|
-
class
|
|
352
|
+
typeof window < "u" && (Se = window);
|
|
353
|
+
const _e = A.createContext({ document: Ie, window: Se }), K = () => A.useContext(_e), { Provider: ds, Consumer: Rn } = _e;
|
|
354
|
+
class Ae extends ue {
|
|
356
355
|
componentDidMount() {
|
|
357
356
|
this.props.contentDidMount();
|
|
358
357
|
}
|
|
@@ -360,10 +359,10 @@ class _e extends ue {
|
|
|
360
359
|
this.props.contentDidUpdate();
|
|
361
360
|
}
|
|
362
361
|
render() {
|
|
363
|
-
return
|
|
362
|
+
return Oe.only(this.props.children);
|
|
364
363
|
}
|
|
365
364
|
}
|
|
366
|
-
|
|
365
|
+
_(Ae, "propTypes", {
|
|
367
366
|
children: b.element.isRequired,
|
|
368
367
|
contentDidMount: b.func.isRequired,
|
|
369
368
|
contentDidUpdate: b.func.isRequired
|
|
@@ -371,20 +370,20 @@ A(_e, "propTypes", {
|
|
|
371
370
|
class Z extends ue {
|
|
372
371
|
constructor(e, t) {
|
|
373
372
|
super(e, t);
|
|
374
|
-
|
|
373
|
+
_(this, "setRef", (e) => {
|
|
375
374
|
this.nodeRef.current = e;
|
|
376
375
|
const { forwardedRef: t } = this.props;
|
|
377
376
|
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
378
377
|
});
|
|
379
|
-
|
|
378
|
+
_(this, "handleLoad", () => {
|
|
380
379
|
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
381
380
|
});
|
|
382
381
|
// In certain situations on a cold cache DOMContentLoaded never gets called
|
|
383
382
|
// fallback to an interval to check if that's the case
|
|
384
|
-
|
|
383
|
+
_(this, "loadCheck", () => setInterval(() => {
|
|
385
384
|
this.handleLoad();
|
|
386
385
|
}, 500));
|
|
387
|
-
this._isMounted = !1, this.nodeRef =
|
|
386
|
+
this._isMounted = !1, this.nodeRef = A.createRef(), this.state = { iframeLoaded: !1 };
|
|
388
387
|
}
|
|
389
388
|
componentDidMount() {
|
|
390
389
|
this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
|
|
@@ -405,7 +404,7 @@ class Z extends ue {
|
|
|
405
404
|
const e = this.getDoc();
|
|
406
405
|
if (!e)
|
|
407
406
|
return null;
|
|
408
|
-
const t = this.props.contentDidMount, n = this.props.contentDidUpdate, d = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(
|
|
407
|
+
const t = this.props.contentDidMount, n = this.props.contentDidUpdate, d = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(Ae, { contentDidMount: t, contentDidUpdate: n, children: /* @__PURE__ */ r.jsx(ds, { value: { document: e, window: d }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
|
|
409
408
|
return [ae.createPortal(this.props.head, this.getDoc().head), ae.createPortal(a, i)];
|
|
410
409
|
}
|
|
411
410
|
render() {
|
|
@@ -422,7 +421,7 @@ class Z extends ue {
|
|
|
422
421
|
// also inject into the body and can mess up React. For this reason
|
|
423
422
|
// initialContent is expected to have a div inside of the body
|
|
424
423
|
// element that we render react into.
|
|
425
|
-
|
|
424
|
+
_(Z, "propTypes", {
|
|
426
425
|
style: b.object,
|
|
427
426
|
// eslint-disable-line
|
|
428
427
|
head: b.node,
|
|
@@ -431,7 +430,7 @@ A(Z, "propTypes", {
|
|
|
431
430
|
contentDidMount: b.func,
|
|
432
431
|
contentDidUpdate: b.func,
|
|
433
432
|
children: b.oneOfType([b.element, b.arrayOf(b.element)])
|
|
434
|
-
}),
|
|
433
|
+
}), _(Z, "defaultProps", {
|
|
435
434
|
style: {},
|
|
436
435
|
head: null,
|
|
437
436
|
children: void 0,
|
|
@@ -442,9 +441,9 @@ A(Z, "propTypes", {
|
|
|
442
441
|
},
|
|
443
442
|
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
|
|
444
443
|
});
|
|
445
|
-
const
|
|
446
|
-
const { addCoreBlock: o } =
|
|
447
|
-
return
|
|
444
|
+
const ps = A.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef: s })), us = () => {
|
|
445
|
+
const { addCoreBlock: o } = Bt(), s = L("getExternalPredefinedBlock", T);
|
|
446
|
+
return H(
|
|
448
447
|
async (e) => {
|
|
449
448
|
const { block: t, dropTargetId: n, relativeIndex: d } = e;
|
|
450
449
|
if (Q(t, "format")) {
|
|
@@ -456,28 +455,28 @@ const ds = _.forwardRef((o, s) => /* @__PURE__ */ r.jsx(Z, { ...o, forwardedRef:
|
|
|
456
455
|
[o]
|
|
457
456
|
);
|
|
458
457
|
};
|
|
459
|
-
let B = null,
|
|
460
|
-
function
|
|
458
|
+
let B = null, O = [], F = null, Ne = null;
|
|
459
|
+
function hs(o) {
|
|
461
460
|
const s = window.getComputedStyle(o), e = parseInt(s.paddingLeft, 10), t = parseInt(s.paddingTop, 10), n = parseInt(s.paddingRight, 10), d = parseInt(s.paddingBottom, 10);
|
|
462
461
|
return { paddingLeft: e, paddingTop: t, paddingRight: n, paddingBottom: d };
|
|
463
462
|
}
|
|
464
463
|
const pe = (o, s, e) => {
|
|
465
464
|
if (!B)
|
|
466
465
|
return;
|
|
467
|
-
const t = o.getBoundingClientRect(), n = B == null ? void 0 : B.getElementById("placeholder"), { paddingLeft: d, paddingTop: a, paddingRight: i, paddingBottom: l } =
|
|
466
|
+
const t = o.getBoundingClientRect(), n = B == null ? void 0 : B.getElementById("placeholder"), { paddingLeft: d, paddingTop: a, paddingRight: i, paddingBottom: l } = hs(o);
|
|
468
467
|
n.style.width = s === "vertical" ? t.width - d - i + "px" : "2px", n.style.height = s === "vertical" ? "2px" : t.height - a - l + "px", n.style.display = "block";
|
|
469
|
-
const c =
|
|
468
|
+
const c = O.reduce(
|
|
470
469
|
(p, m) => Math.abs(m - e) < Math.abs(p - e) ? m : p
|
|
471
470
|
);
|
|
472
|
-
Ne =
|
|
473
|
-
},
|
|
471
|
+
Ne = O.indexOf(c), s === "vertical" ? (n.style.top = o.offsetTop + c + "px", n.style.left = o.offsetLeft + d + "px") : (n.style.top = o.offsetTop + a + "px", n.style.left = o.offsetLeft + c + "px");
|
|
472
|
+
}, ms = (o) => {
|
|
474
473
|
const s = Me(o), e = window.getComputedStyle(o), t = s === "horizontal", n = parseInt(e.paddingLeft), d = parseInt(e.paddingTop);
|
|
475
474
|
let a = t ? n : d;
|
|
476
|
-
|
|
475
|
+
O = [a], Array.from(o.children).forEach((i) => {
|
|
477
476
|
const l = window.getComputedStyle(i), c = parseInt(
|
|
478
477
|
t ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
|
|
479
478
|
), p = t ? i.offsetWidth : i.offsetHeight;
|
|
480
|
-
|
|
479
|
+
O.push(a + p + c), a += p + c;
|
|
481
480
|
});
|
|
482
481
|
};
|
|
483
482
|
function Me(o) {
|
|
@@ -493,7 +492,7 @@ function Me(o) {
|
|
|
493
492
|
}
|
|
494
493
|
return s === "block" ? "vertical" : "horizontal";
|
|
495
494
|
}
|
|
496
|
-
const
|
|
495
|
+
const gs = me((o) => {
|
|
497
496
|
const s = o.target, e = Me(s);
|
|
498
497
|
if (e === "vertical") {
|
|
499
498
|
const t = o.clientY - s.offsetTop;
|
|
@@ -502,21 +501,21 @@ const ms = me((o) => {
|
|
|
502
501
|
const t = o.clientX - s.offsetLeft;
|
|
503
502
|
pe(s, e, t);
|
|
504
503
|
}
|
|
505
|
-
}, 200),
|
|
506
|
-
o.preventDefault(), o.stopPropagation(),
|
|
504
|
+
}, 200), fs = (o) => {
|
|
505
|
+
o.preventDefault(), o.stopPropagation(), gs(o);
|
|
507
506
|
};
|
|
508
507
|
function J() {
|
|
509
508
|
const o = B == null ? void 0 : B.getElementById("placeholder");
|
|
510
509
|
o.style.display = "none";
|
|
511
510
|
}
|
|
512
|
-
const
|
|
513
|
-
const { document: o } = K(), [s, e] = y(
|
|
511
|
+
const xs = () => {
|
|
512
|
+
const { document: o } = K(), [s, e] = y(Dt), t = us(), n = Be("dnd"), [, d] = M(), [, a] = C();
|
|
514
513
|
return B = o, {
|
|
515
514
|
isDragging: s,
|
|
516
515
|
"data-dnd": "branch",
|
|
517
|
-
onDragOver: n ?
|
|
516
|
+
onDragOver: n ? fs : T,
|
|
518
517
|
onDrop: n ? (i) => {
|
|
519
|
-
|
|
518
|
+
F == null || F.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
520
519
|
const l = JSON.parse(i.dataTransfer.getData("text/plain"));
|
|
521
520
|
let c = i.target.getAttribute("data-block-id");
|
|
522
521
|
c === null && (c = i.target.parentElement.getAttribute("data-block-id")), t({ block: l, dropTargetId: c || null, relativeIndex: Ne }), e(!1), J(), setTimeout(() => {
|
|
@@ -525,13 +524,13 @@ const fs = () => {
|
|
|
525
524
|
} : T,
|
|
526
525
|
onDragEnter: n ? (i) => {
|
|
527
526
|
const l = i;
|
|
528
|
-
|
|
527
|
+
F = l.target, l.stopPropagation(), l.preventDefault(), O = [];
|
|
529
528
|
const c = l.target;
|
|
530
|
-
|
|
529
|
+
ms(c), c.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), e(!0), d(""), a([]);
|
|
531
530
|
} : T,
|
|
532
531
|
onDragLeave: n ? (i) => {
|
|
533
532
|
const l = i;
|
|
534
|
-
|
|
533
|
+
F = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
535
534
|
} : T,
|
|
536
535
|
onMouseOut: n ? () => {
|
|
537
536
|
e(!1), J();
|
|
@@ -541,13 +540,13 @@ const fs = () => {
|
|
|
541
540
|
function te(o) {
|
|
542
541
|
return o.getAttribute("data-block-id") ? o : o.closest("[data-block-id]");
|
|
543
542
|
}
|
|
544
|
-
function
|
|
543
|
+
function vs(o) {
|
|
545
544
|
o.container.innerHTML = "", o.container.parentNode.removeChild(o.container);
|
|
546
545
|
var s = document.querySelector(".ql-toolbar");
|
|
547
546
|
s && s.parentNode.removeChild(s), o = null;
|
|
548
547
|
}
|
|
549
|
-
const
|
|
550
|
-
const o = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s =
|
|
548
|
+
const $s = () => {
|
|
549
|
+
const o = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = It(), [, e] = M(), [t, n] = y(R);
|
|
551
550
|
return (d) => {
|
|
552
551
|
var m;
|
|
553
552
|
if (t)
|
|
@@ -559,17 +558,17 @@ const vs = () => {
|
|
|
559
558
|
a.style.display = "none", Array.from(l.attributes).forEach((h) => {
|
|
560
559
|
h.name !== "class" && l.removeAttribute(h.name);
|
|
561
560
|
}), i === "Text" && (l.style.display = "inline-block"), a.parentNode.insertBefore(l, a.nextSibling);
|
|
562
|
-
const c = new
|
|
561
|
+
const c = new zt(l, { placeholder: "Type here..." });
|
|
563
562
|
function p() {
|
|
564
563
|
const h = c.getText(0, c.getLength());
|
|
565
|
-
s([a.getAttribute("data-block-id")], { content: h }), a.removeAttribute("style"), l.removeEventListener("blur", p, !0),
|
|
564
|
+
s([a.getAttribute("data-block-id")], { content: h }), a.removeAttribute("style"), l.removeEventListener("blur", p, !0), vs(c), n(""), e("");
|
|
566
565
|
}
|
|
567
566
|
l.addEventListener("blur", p, !0), l.addEventListener("keydown", (h) => {
|
|
568
567
|
(h.key === "Enter" || h.key === "Escape") && p();
|
|
569
568
|
}), c.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), n(a.getAttribute("data-block-id"));
|
|
570
569
|
};
|
|
571
|
-
},
|
|
572
|
-
const [, o] = N(), [, s] = C(), [, e] = M(), [t] = y(
|
|
570
|
+
}, ys = () => {
|
|
571
|
+
const [, o] = N(), [, s] = C(), [, e] = M(), [t] = y(R), [n] = y(St);
|
|
573
572
|
return (d) => {
|
|
574
573
|
if (t)
|
|
575
574
|
return;
|
|
@@ -586,19 +585,19 @@ const vs = () => {
|
|
|
586
585
|
a != null && a.getAttribute("data-block-id") && s([a.getAttribute("data-block-id")]);
|
|
587
586
|
e("");
|
|
588
587
|
};
|
|
589
|
-
},
|
|
588
|
+
}, bs = me((o, s) => {
|
|
590
589
|
const e = te(o.target);
|
|
591
590
|
e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
|
|
592
|
-
}, 100),
|
|
593
|
-
const [, o] = M(), [s] = y(
|
|
591
|
+
}, 100), ks = () => {
|
|
592
|
+
const [, o] = M(), [s] = y(R);
|
|
594
593
|
return (e) => {
|
|
595
|
-
s ||
|
|
594
|
+
s || bs(e, o);
|
|
596
595
|
};
|
|
597
|
-
},
|
|
596
|
+
}, ws = ({ children: o }) => {
|
|
598
597
|
const { document: s } = K(), [e] = C(), [t, n] = N();
|
|
599
598
|
k(() => {
|
|
600
599
|
setTimeout(() => {
|
|
601
|
-
if (!
|
|
600
|
+
if (!D(t))
|
|
602
601
|
return;
|
|
603
602
|
const c = Ee(s, U(e));
|
|
604
603
|
if (c) {
|
|
@@ -610,7 +609,7 @@ const vs = () => {
|
|
|
610
609
|
}
|
|
611
610
|
}, 100);
|
|
612
611
|
}, [s, e, n, t]);
|
|
613
|
-
const d =
|
|
612
|
+
const d = $s(), a = ys(), i = ks(), l = xs();
|
|
614
613
|
return /* @__PURE__ */ r.jsx(
|
|
615
614
|
"div",
|
|
616
615
|
{
|
|
@@ -619,13 +618,13 @@ const vs = () => {
|
|
|
619
618
|
onClick: a,
|
|
620
619
|
onDoubleClick: d,
|
|
621
620
|
onMouseMove: i,
|
|
622
|
-
...
|
|
621
|
+
...We(l, "isDragging"),
|
|
623
622
|
className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
|
|
624
623
|
children: o
|
|
625
624
|
}
|
|
626
625
|
);
|
|
627
|
-
}, Ee = (o, s) => o.querySelector(`[data-block-id="${s}"]`),
|
|
628
|
-
const { window: o } = K(), [s, e] = C(), [t] = ee(), [, n] = N(), { undo: d, redo: a } = fe(), i = be(), [, l] = ke(), c = we(), { savePage: p } =
|
|
626
|
+
}, Ee = (o, s) => o.querySelector(`[data-block-id="${s}"]`), js = () => {
|
|
627
|
+
const { window: o } = K(), [s, e] = C(), [t] = ee(), [, n] = N(), { undo: d, redo: a } = fe(), i = be(), [, l] = ke(), c = we(), { savePage: p } = _t(), [m] = y(R), [, h] = y(At), v = (g) => {
|
|
629
628
|
g.key === "Enter" && (g.preventDefault(), s.length === 1 && h(U(s)));
|
|
630
629
|
}, w = (g) => {
|
|
631
630
|
const u = t.find(($) => $._id === g);
|
|
@@ -655,7 +654,7 @@ const vs = () => {
|
|
|
655
654
|
o.removeEventListener("keydown", g);
|
|
656
655
|
};
|
|
657
656
|
}, [s, e, d, c, l, a, i, m, p, o]), null;
|
|
658
|
-
},
|
|
657
|
+
}, Cs = ({ block: o, label: s }) => {
|
|
659
658
|
const [, e] = C(), [, t] = M(), [, n] = y(je), d = Be("dnd");
|
|
660
659
|
return /* @__PURE__ */ r.jsxs(
|
|
661
660
|
"div",
|
|
@@ -663,26 +662,26 @@ const vs = () => {
|
|
|
663
662
|
className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
|
|
664
663
|
draggable: d ? "true" : "false",
|
|
665
664
|
onDragStart: (a) => {
|
|
666
|
-
a.dataTransfer.setData("text/plain", JSON.stringify(
|
|
665
|
+
a.dataTransfer.setData("text/plain", JSON.stringify(qe(o, ["_id", "_type"]))), n(o._id), setTimeout(() => {
|
|
667
666
|
e([]), t(null);
|
|
668
667
|
}, 200);
|
|
669
668
|
},
|
|
670
669
|
children: [
|
|
671
|
-
/* @__PURE__ */ r.jsx(
|
|
670
|
+
/* @__PURE__ */ r.jsx(tt, {}),
|
|
672
671
|
s
|
|
673
672
|
]
|
|
674
673
|
}
|
|
675
674
|
);
|
|
676
|
-
},
|
|
677
|
-
const e = we(), t = be(), [, n] = C(), [, d] = N(), [a] = y(
|
|
675
|
+
}, Bs = ({ selectedBlockElement: o, block: s }) => {
|
|
676
|
+
const e = we(), t = be(), [, n] = C(), [, d] = N(), [a] = y(R), { floatingStyles: i, refs: l, update: c } = Wt({
|
|
678
677
|
placement: "top-start",
|
|
679
|
-
middleware: [
|
|
678
|
+
middleware: [qt(), Ut()],
|
|
680
679
|
elements: {
|
|
681
680
|
reference: o
|
|
682
681
|
}
|
|
683
682
|
});
|
|
684
|
-
|
|
685
|
-
const p = f(s, "_parent", null), m =
|
|
683
|
+
Kt(o, () => c(), o !== null);
|
|
684
|
+
const p = f(s, "_parent", null), m = D(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
|
|
686
685
|
return !o || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
|
|
687
686
|
"div",
|
|
688
687
|
{
|
|
@@ -696,10 +695,10 @@ const vs = () => {
|
|
|
696
695
|
onKeyDown: (h) => h.stopPropagation(),
|
|
697
696
|
className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
698
697
|
children: [
|
|
699
|
-
/* @__PURE__ */ r.jsx(
|
|
698
|
+
/* @__PURE__ */ r.jsx(Cs, { label: m, block: s }),
|
|
700
699
|
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
|
|
701
700
|
p && /* @__PURE__ */ r.jsx(
|
|
702
|
-
|
|
701
|
+
st,
|
|
703
702
|
{
|
|
704
703
|
className: "hover:scale-105",
|
|
705
704
|
onClick: () => {
|
|
@@ -707,13 +706,13 @@ const vs = () => {
|
|
|
707
706
|
}
|
|
708
707
|
}
|
|
709
708
|
),
|
|
710
|
-
|
|
711
|
-
|
|
709
|
+
Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
|
|
710
|
+
Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(ot, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
|
|
712
711
|
] })
|
|
713
712
|
]
|
|
714
713
|
}
|
|
715
714
|
) });
|
|
716
|
-
},
|
|
715
|
+
}, Ds = ({ addVariant: o, e: s }) => {
|
|
717
716
|
o("hs-dropdown-open", [
|
|
718
717
|
({ modifySelectors: e, separator: t }) => {
|
|
719
718
|
e(({ className: n }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${n}`)}`);
|
|
@@ -966,8 +965,8 @@ const vs = () => {
|
|
|
966
965
|
}), o("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
|
|
967
966
|
e(({ className: n }) => `.auto .${s(`hs-auto-mode-active${t}${n}`)}`);
|
|
968
967
|
});
|
|
969
|
-
},
|
|
970
|
-
const [s] =
|
|
968
|
+
}, Is = ({ model: o }) => {
|
|
969
|
+
const [s] = Et(), [e] = C(), [t] = xe(), [n] = M(), [d] = N(), [a] = y(je), { document: i, window: l } = K(), [c] = j(i == null ? void 0 : i.getElementById("highlighted-block")), [p] = j(
|
|
971
970
|
i == null ? void 0 : i.getElementById("selected-block")
|
|
972
971
|
), [m] = j(
|
|
973
972
|
i == null ? void 0 : i.getElementById("selected-styling-block")
|
|
@@ -977,7 +976,7 @@ const vs = () => {
|
|
|
977
976
|
}, [t, i]);
|
|
978
977
|
const v = f(s, "headingFont", "DM Sans"), w = f(s, "bodyFont", "DM Sans");
|
|
979
978
|
return k(() => {
|
|
980
|
-
const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), $ =
|
|
979
|
+
const g = f(s, "primaryColor", "#000"), u = f(s, "secondaryColor", "#FFF"), $ = Zt([
|
|
981
980
|
{ color: g, name: "primary" },
|
|
982
981
|
{ color: u, name: "secondary" }
|
|
983
982
|
]), E = f(s, "roundedCorners", "0");
|
|
@@ -995,10 +994,10 @@ const vs = () => {
|
|
|
995
994
|
colors: $
|
|
996
995
|
}
|
|
997
996
|
},
|
|
998
|
-
plugins: [
|
|
997
|
+
plugins: [Yt, Jt, Qt, l.tailwind.plugin.withOptions(() => Ds)]
|
|
999
998
|
});
|
|
1000
999
|
}, [s, l, v, w]), k(() => {
|
|
1001
|
-
p && (p.textContent = `${
|
|
1000
|
+
p && (p.textContent = `${P(e, (g) => `[data-block-id="${g}"]`).join(",")}{
|
|
1002
1001
|
outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
1003
1002
|
}`);
|
|
1004
1003
|
}, [e, p]), k(() => {
|
|
@@ -1010,7 +1009,7 @@ const vs = () => {
|
|
|
1010
1009
|
}, [a]), k(() => {
|
|
1011
1010
|
c && (c.textContent = n ? `[data-style-id="${n}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
|
|
1012
1011
|
}, [n, e, c]), k(() => {
|
|
1013
|
-
m && (m.textContent = `${
|
|
1012
|
+
m && (m.textContent = `${P(d, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
|
|
1014
1013
|
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
1015
1014
|
}`);
|
|
1016
1015
|
}, [d, m]), k(() => {
|
|
@@ -1045,23 +1044,23 @@ const vs = () => {
|
|
|
1045
1044
|
),
|
|
1046
1045
|
v && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${v}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}` })
|
|
1047
1046
|
] }) : null;
|
|
1048
|
-
},
|
|
1047
|
+
}, Ss = (o) => {
|
|
1049
1048
|
const s = {};
|
|
1050
1049
|
return Object.keys(o).forEach((e) => {
|
|
1051
1050
|
G(o[e]) && o[e].startsWith(le) && (s[e] = o[e].replace(le, "").split(","));
|
|
1052
1051
|
}), s;
|
|
1053
|
-
},
|
|
1054
|
-
const s = o.replace(
|
|
1055
|
-
return
|
|
1052
|
+
}, _s = Ke((o) => {
|
|
1053
|
+
const s = o.replace(De, "").split(",");
|
|
1054
|
+
return Gt(s[0], s[1]);
|
|
1056
1055
|
});
|
|
1057
1056
|
function As(o, s) {
|
|
1058
1057
|
return f(o, `${s}_attrs`, {});
|
|
1059
1058
|
}
|
|
1060
|
-
function
|
|
1059
|
+
function Ns(o) {
|
|
1061
1060
|
const s = {};
|
|
1062
1061
|
return Object.keys(o).forEach((e) => {
|
|
1063
|
-
if (G(o[e]) && o[e].startsWith(
|
|
1064
|
-
const t =
|
|
1062
|
+
if (G(o[e]) && o[e].startsWith(De)) {
|
|
1063
|
+
const t = _s(o[e]);
|
|
1065
1064
|
s[e] = {
|
|
1066
1065
|
className: t,
|
|
1067
1066
|
"data-style-prop": e,
|
|
@@ -1072,44 +1071,44 @@ function _s(o) {
|
|
|
1072
1071
|
}
|
|
1073
1072
|
}), s;
|
|
1074
1073
|
}
|
|
1075
|
-
function
|
|
1074
|
+
function Ms(o, s) {
|
|
1076
1075
|
const e = f(o, "_bindings", {});
|
|
1077
|
-
return
|
|
1076
|
+
return D(e) ? { ...o } : (Ye(e, (t, n) => {
|
|
1078
1077
|
G(t) && f(s, t, null) && (o[n] = f(s, t, null));
|
|
1079
1078
|
}), o);
|
|
1080
1079
|
}
|
|
1081
1080
|
function X({ blocks: o }) {
|
|
1082
|
-
const [s] = ee(), [e] =
|
|
1081
|
+
const [s] = ee(), [e] = es(), t = H((i) => Ns(i), []), [n] = Tt(), [d] = y(R), a = H(
|
|
1083
1082
|
(i) => i.reduce((l, c) => {
|
|
1084
1083
|
const p = f(e, c, {});
|
|
1085
1084
|
return { ...l, ...p };
|
|
1086
1085
|
}, {}),
|
|
1087
1086
|
[e, s]
|
|
1088
1087
|
);
|
|
1089
|
-
return /* @__PURE__ */ r.jsx(r.Fragment, { children:
|
|
1088
|
+
return /* @__PURE__ */ r.jsx(r.Fragment, { children: A.Children.toArray(
|
|
1090
1089
|
o.map((i, l) => {
|
|
1091
1090
|
if (d === i._id)
|
|
1092
1091
|
return null;
|
|
1093
|
-
const c =
|
|
1094
|
-
|
|
1095
|
-
p[u] =
|
|
1096
|
-
c[u].map(($) => /* @__PURE__ */ r.jsx(X, { blocks: [
|
|
1092
|
+
const c = Ss(i), p = {};
|
|
1093
|
+
D(c) || Object.keys(c).forEach((u) => {
|
|
1094
|
+
p[u] = A.Children.toArray(
|
|
1095
|
+
c[u].map(($) => /* @__PURE__ */ r.jsx(X, { blocks: [Je(s, { _id: $ })] }))
|
|
1097
1096
|
);
|
|
1098
1097
|
});
|
|
1099
1098
|
const m = ge(s, { _parent: i._id });
|
|
1100
1099
|
p.children = m.length ? /* @__PURE__ */ r.jsx(X, { blocks: m }) : null;
|
|
1101
|
-
const h =
|
|
1102
|
-
if (
|
|
1100
|
+
const h = Vt(i._type), v = f(h, "builderComponent", f(h, "component", null));
|
|
1101
|
+
if (Qe(v))
|
|
1103
1102
|
return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` });
|
|
1104
1103
|
const w = Q(h, "getBlockStateFrom") ? h == null ? void 0 : h.getBlockStateFrom(i, s) : [], g = a(w);
|
|
1105
|
-
return /* @__PURE__ */ r.jsx(he, { children:
|
|
1104
|
+
return /* @__PURE__ */ r.jsx(he, { children: A.createElement(v, {
|
|
1106
1105
|
blockProps: {
|
|
1107
1106
|
"data-block-id": i._id,
|
|
1108
1107
|
"data-block-type": i._type,
|
|
1109
1108
|
"data-dnd": Q(h, "canAcceptBlock") ? "branch" : "leaf"
|
|
1110
1109
|
},
|
|
1111
1110
|
index: l,
|
|
1112
|
-
...
|
|
1111
|
+
...Ms(i, n),
|
|
1113
1112
|
...t(i),
|
|
1114
1113
|
...p,
|
|
1115
1114
|
inBuilder: !0,
|
|
@@ -1118,28 +1117,28 @@ function X({ blocks: o }) {
|
|
|
1118
1117
|
})
|
|
1119
1118
|
) });
|
|
1120
1119
|
}
|
|
1121
|
-
const
|
|
1122
|
-
const [o] = ee(), s =
|
|
1123
|
-
return /* @__PURE__ */ r.jsx(
|
|
1124
|
-
},
|
|
1125
|
-
const [o] = y(
|
|
1120
|
+
const Es = () => {
|
|
1121
|
+
const [o] = ee(), s = D(o) ? null : /* @__PURE__ */ r.jsx(Lt, { children: /* @__PURE__ */ r.jsx(X, { blocks: ge(o, (e) => D(e._parent)) }) });
|
|
1122
|
+
return /* @__PURE__ */ r.jsx(Xt, { children: s });
|
|
1123
|
+
}, Ts = (o, s) => o.querySelector(`[data-style-id="${s}"]`), Ls = () => {
|
|
1124
|
+
const [o] = y(Rt), [s] = ke(), [e] = V(), [, t] = C(), n = Ft(), [, d] = M(), a = ne(null), i = ne(null), [l, c] = j({ width: 0, height: 0 }), p = cs(l), [m, h] = j(0), [v, w] = j([]), [, g] = j([]), [, u] = y(Pt), [$, E] = N(), Te = L("loading", !1), Le = L("htmlDir", "ltr");
|
|
1126
1125
|
k(() => {
|
|
1127
1126
|
const { clientWidth: x, clientHeight: I } = i.current;
|
|
1128
1127
|
c({ width: x, height: I }), m === 0 && h(x);
|
|
1129
1128
|
}, [i, e, m]);
|
|
1130
|
-
const
|
|
1131
|
-
const { top:
|
|
1132
|
-
return
|
|
1129
|
+
const Re = (x, I = 0) => {
|
|
1130
|
+
const { top: S } = x.getBoundingClientRect();
|
|
1131
|
+
return S + I >= 0 && S - I <= window.innerHeight;
|
|
1133
1132
|
};
|
|
1134
1133
|
k(() => {
|
|
1135
1134
|
var x, I;
|
|
1136
1135
|
if (n && n.type !== "Multiple" && a.current) {
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1136
|
+
const S = Ee(a.current.contentDocument, n._id);
|
|
1137
|
+
S && (Re(S) || (I = (x = a.current) == null ? void 0 : x.contentWindow) == null || I.scrollTo({ top: S.offsetTop, behavior: "smooth" }), w([S]));
|
|
1139
1138
|
}
|
|
1140
1139
|
}, [n]), k(() => {
|
|
1141
|
-
if (!
|
|
1142
|
-
const x =
|
|
1140
|
+
if (!D($) && a.current) {
|
|
1141
|
+
const x = Ts(
|
|
1143
1142
|
a.current.contentDocument,
|
|
1144
1143
|
U($).id
|
|
1145
1144
|
);
|
|
@@ -1147,9 +1146,9 @@ const Ms = () => {
|
|
|
1147
1146
|
} else
|
|
1148
1147
|
g([null]);
|
|
1149
1148
|
}, [$]);
|
|
1150
|
-
const
|
|
1151
|
-
let x =
|
|
1152
|
-
return o === "offline" && (x = x.replace(
|
|
1149
|
+
const Fe = ze(() => {
|
|
1150
|
+
let x = ls;
|
|
1151
|
+
return x = x.replace("__HTML_DIR__", Le), o === "offline" && (x = x.replace(
|
|
1153
1152
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1154
1153
|
"/offline/tailwind.cdn.js"
|
|
1155
1154
|
), x = x.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), x = x.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), x;
|
|
@@ -1162,28 +1161,28 @@ const Ms = () => {
|
|
|
1162
1161
|
},
|
|
1163
1162
|
onMouseLeave: () => setTimeout(() => d(""), 300),
|
|
1164
1163
|
className: "relative mx-auto h-full w-full overflow-hidden",
|
|
1165
|
-
style: m > 0 && !
|
|
1164
|
+
style: m > 0 && !D(p) ? { width: s ? "100%" : m } : {},
|
|
1166
1165
|
ref: i,
|
|
1167
1166
|
children: /* @__PURE__ */ r.jsxs(
|
|
1168
|
-
|
|
1167
|
+
ps,
|
|
1169
1168
|
{
|
|
1170
1169
|
contentDidMount: () => u(a.current),
|
|
1171
1170
|
ref: a,
|
|
1172
1171
|
id: "canvas-iframe",
|
|
1173
1172
|
style: { width: `${e}px`, ...p },
|
|
1174
1173
|
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1175
|
-
initialContent:
|
|
1174
|
+
initialContent: Fe,
|
|
1176
1175
|
children: [
|
|
1177
|
-
/* @__PURE__ */ r.jsx(
|
|
1176
|
+
/* @__PURE__ */ r.jsx(js, {}),
|
|
1178
1177
|
/* @__PURE__ */ r.jsx(
|
|
1179
|
-
|
|
1178
|
+
Bs,
|
|
1180
1179
|
{
|
|
1181
1180
|
block: n,
|
|
1182
1181
|
selectedBlockElement: U(v)
|
|
1183
1182
|
}
|
|
1184
1183
|
),
|
|
1185
|
-
/* @__PURE__ */ r.jsx(
|
|
1186
|
-
/* @__PURE__ */ r.jsx(
|
|
1184
|
+
/* @__PURE__ */ r.jsx(Is, { model: "page" }),
|
|
1185
|
+
/* @__PURE__ */ r.jsx(ws, { children: Te ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Es, {}) }),
|
|
1187
1186
|
/* @__PURE__ */ r.jsx("br", {}),
|
|
1188
1187
|
/* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
|
|
1189
1188
|
]
|
|
@@ -1192,8 +1191,8 @@ const Ms = () => {
|
|
|
1192
1191
|
}
|
|
1193
1192
|
);
|
|
1194
1193
|
}, Fn = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1195
|
-
/* @__PURE__ */ r.jsx(
|
|
1196
|
-
/* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(he, { fallback: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(
|
|
1194
|
+
/* @__PURE__ */ r.jsx(as, {}),
|
|
1195
|
+
/* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ r.jsx(he, { fallback: /* @__PURE__ */ r.jsx(Ce, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Ht, { children: /* @__PURE__ */ r.jsx(Ls, {}) }) }) })
|
|
1197
1196
|
] });
|
|
1198
1197
|
export {
|
|
1199
1198
|
Fn as default
|