@chaibuilder/sdk 1.2.10 → 1.2.11
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/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-10jJO8mG.js → BrandingOptions-uFTyYJZj.js} +18 -21
- package/dist/{CanvasArea-6O8dMPug.cjs → CanvasArea-5erOZYLy.cjs} +4 -4
- package/dist/{CanvasArea-jgBDM5Qd.js → CanvasArea-iRQqpOak.js} +187 -188
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lakeZviD.js → CurrentPage-RCxTz9Mc.js} +24 -25
- package/dist/{Layers-R7TfREUd.js → Layers-tXB5Pwid.js} +40 -41
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel-4mqxCFHq.js → PagesPanel-Jaz9jvye.js} +14 -15
- package/dist/{ProjectPanel-Wy2nw-1w.js → ProjectPanel--S014Xx3.js} +17 -18
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-_K28Ontt.js → Settings-gjvl5V1k.js} +153 -154
- package/dist/{SidePanels-6slnxdSj.js → SidePanels-Fq3kRwR0.js} +37 -38
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-bwt6HjlL.js → Topbar-m5dbbI1f.js} +14 -15
- package/dist/{UnsplashImages-V29UE-57.js → UnsplashImages-GhBD6owT.js} +28 -29
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-E0mi_qn8.js → UploadImages-S1HgxeGb.js} +23 -24
- package/dist/{add-page-modal-FJEAqfD3.js → add-page-modal-2P5hGXOQ.js} +19 -20
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-5hfE116f.js → confirm-alert-57Xq5foA.js} +12 -13
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -50
- package/dist/core.js +45 -56
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-wH0yLiQI.js → delete-page-modal-ix5IjaFW.js} +14 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-1j01gADS.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-UVHCD9N3.js → form-SYcFyACJ.js} +1 -1
- package/dist/{index-c2VLKuhY.js → index-Fj3ead-J.js} +5 -5
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-xbQL0wpz.cjs → index-cM3eKmlx.cjs} +2 -2
- package/dist/{index-B4sL0YTN.js → index-pNYv0oAF.js} +1427 -1557
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-TcK0I240.js → page-viewer-VxqOevr4.js} +16 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-4ruKl033.js → project-general-setting-nWOjPiin.js} +15 -16
- package/dist/{project-seo-setting-d1EZlacB.js → project-seo-setting-70bWTwsB.js} +14 -15
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-PihQi-dP.js → single-page-detail-3z7TF-Yy.js} +44 -45
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -14
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +138 -139
- package/dist/{useAddBlockByDrop-nLzs79He.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-rcDR-z9_.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +313 -322
- package/package.json +8 -2
- package/dist/AddBlocks-GiMnBMeQ.js +0 -224
- package/dist/AddBlocks-SzURo9Bj.cjs +0 -1
- package/dist/BrandingOptions-yK-54R-c.cjs +0 -1
- package/dist/CurrentPage-1y62Ne77.cjs +0 -1
- package/dist/Layers-Z4nmm9xK.cjs +0 -1
- package/dist/PagesPanel-ouHdxyOH.cjs +0 -1
- package/dist/ProjectPanel-hHolYZjt.cjs +0 -1
- package/dist/Settings-EYOw02iE.cjs +0 -1
- package/dist/SidePanels-U-_O1QN8.cjs +0 -1
- package/dist/Topbar-dQEoY2P8.cjs +0 -1
- package/dist/UnsplashImages-pGgaUPQy.cjs +0 -1
- package/dist/UploadImages-7oLycdSh.cjs +0 -1
- package/dist/add-page-modal-In6XI-vZ.cjs +0 -1
- package/dist/confirm-alert-Vwd3OzL9.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-tl7FLK9J.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-7ogwGh39.cjs +0 -1
- package/dist/page-viewer-SfQUe0SI.cjs +0 -1
- package/dist/project-general-setting-t7E2Y_w9.cjs +0 -1
- package/dist/project-seo-setting-4b_BJZDF.cjs +0 -1
- package/dist/single-page-detail-KuXd9Mur.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -2,30 +2,32 @@ var kt = Object.defineProperty;
|
|
|
2
2
|
var jt = (e, t, n) => t in e ? kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Y = (e, t, n) => (jt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
|
-
import K, { createElement as
|
|
6
|
-
import { map as re, includes as
|
|
7
|
-
import { ResetIcon as
|
|
8
|
-
import { m as
|
|
5
|
+
import K, { createElement as _e, useCallback as ke, useState as $, useEffect as R, Component as Ye, Children as Tt, Suspense as Ke, useRef as Be, useMemo as Ct } from "react";
|
|
6
|
+
import { map as re, includes as Oe, toUpper as pe, round as Et, throttle as Je, noop as te, isEmpty as z, first as ae, omit as It, pick as St, get as D, isString as je, memoize as Dt, each as _t, find as Bt, filter as Ve, isNull as Ot, has as At } from "lodash-es";
|
|
7
|
+
import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as Rt, DesktopIcon as Pt, DotsVerticalIcon as Mt, EraserIcon as Lt, ZoomInIcon as Nt, DragHandleDots2Icon as Ft, ArrowUpIcon as $t, CopyIcon as Wt, TrashIcon as Ht } from "@radix-ui/react-icons";
|
|
8
|
+
import { m as Ge, B as le, R as Qe, ay as Ut, az as qt, aA as zt, aB as Yt, aC as Kt, M as Te, aa as Jt, i as Ce, aD as Vt, aE as Gt, aF as Qt, aG as Zt, aH as Xt, aI as en, aJ as tn, j as W, ab as J, A as nn, z as rn, C as on, D as sn, E as an, F as ln, G as cn, H as dn, ah as un, N as Ze, ax as ie, aK as pn, W as Z, a3 as fn, aL as X, s as Ee, l as Xe, h as et, k as tt, a8 as hn, aM as gn, aN as nt, aO as mn, aP as yn, t as vn, aQ as xn, $ as bn, aR as wn, S as rt } from "./index-pNYv0oAF.js";
|
|
9
9
|
import { useTranslation as de } from "react-i18next";
|
|
10
10
|
import { useAtom as M } from "jotai";
|
|
11
|
-
import
|
|
12
|
-
import { g as
|
|
13
|
-
import { r as ot, u as
|
|
14
|
-
import { Quill as
|
|
15
|
-
import { u as
|
|
11
|
+
import Pe from "react-dom";
|
|
12
|
+
import { g as kn } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
|
+
import { r as ot, u as jn, B as Tn, E as Cn } from "./index-Fj3ead-J.js";
|
|
14
|
+
import { Quill as En } from "react-quill";
|
|
15
|
+
import { u as In } from "./useAddBlockByDrop-tjQ5DgiO.js";
|
|
16
16
|
import { useFeature as st } from "flagged";
|
|
17
|
-
import { flip as
|
|
18
|
-
import { useFloating as
|
|
19
|
-
import { useResizeObserver as
|
|
20
|
-
import { tailwindcssPaletteGenerator as
|
|
21
|
-
import { Provider as
|
|
22
|
-
import { twMerge as
|
|
23
|
-
import { S as
|
|
24
|
-
import { getBlockComponent as
|
|
17
|
+
import { flip as Sn } from "@floating-ui/dom";
|
|
18
|
+
import { useFloating as Dn, shift as _n } from "@floating-ui/react-dom";
|
|
19
|
+
import { useResizeObserver as Bn } from "@react-hookz/web";
|
|
20
|
+
import { tailwindcssPaletteGenerator as On } from "@bobthered/tailwindcss-palette-generator";
|
|
21
|
+
import { Provider as An } from "react-wrap-balancer";
|
|
22
|
+
import { twMerge as Rn } from "tailwind-merge";
|
|
23
|
+
import { S as Me, a as it } from "./MODIFIERS-RiXS5Mn1.js";
|
|
24
|
+
import { getBlockComponent as Pn } from "@chaibuilder/runtime";
|
|
25
|
+
import "./Functions-7jnEwJyw.js";
|
|
26
|
+
import "clsx";
|
|
27
|
+
import "flat-to-nested";
|
|
25
28
|
import "@radix-ui/react-toggle";
|
|
26
29
|
import "class-variance-authority";
|
|
27
|
-
import "./
|
|
28
|
-
import "clsx";
|
|
30
|
+
import "./Class-17XFhL48.js";
|
|
29
31
|
import "@radix-ui/react-switch";
|
|
30
32
|
import "@radix-ui/react-slot";
|
|
31
33
|
import "@radix-ui/react-accordion";
|
|
@@ -45,9 +47,6 @@ import "@radix-ui/react-toast";
|
|
|
45
47
|
import "cmdk";
|
|
46
48
|
import "@radix-ui/react-context-menu";
|
|
47
49
|
import "react-icons-picker";
|
|
48
|
-
import "flat-to-nested";
|
|
49
|
-
import "./Functions-7jnEwJyw.js";
|
|
50
|
-
import "redux-undo";
|
|
51
50
|
import "i18next";
|
|
52
51
|
import "react-textarea-autosize";
|
|
53
52
|
import "react-dnd";
|
|
@@ -58,15 +57,15 @@ import "./html-to-json-57841sEK.js";
|
|
|
58
57
|
import "himalaya";
|
|
59
58
|
import "lucide-react";
|
|
60
59
|
import "./web-blocks.js";
|
|
61
|
-
import "./
|
|
62
|
-
const
|
|
63
|
-
const { hasUndo: e, hasRedo: t, undo: n, redo: s } =
|
|
60
|
+
import "./empty-slot-MWycClTb.js";
|
|
61
|
+
const Mn = () => {
|
|
62
|
+
const { hasUndo: e, hasRedo: t, undo: n, redo: s } = Ge();
|
|
64
63
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
65
|
-
/* @__PURE__ */ r.jsx(le, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(
|
|
66
|
-
/* @__PURE__ */ r.jsx(le, { disabled: !t(), onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(
|
|
64
|
+
/* @__PURE__ */ r.jsx(le, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, {}) }),
|
|
65
|
+
/* @__PURE__ */ r.jsx(le, { disabled: !t(), onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
67
66
|
] });
|
|
68
67
|
};
|
|
69
|
-
function
|
|
68
|
+
function Ln() {
|
|
70
69
|
const [e, t] = Qe(), { t: n } = de();
|
|
71
70
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
72
71
|
/* @__PURE__ */ r.jsx(Ut, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
|
|
@@ -95,7 +94,7 @@ function Nn() {
|
|
|
95
94
|
)
|
|
96
95
|
] });
|
|
97
96
|
}
|
|
98
|
-
const
|
|
97
|
+
const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
99
98
|
"svg",
|
|
100
99
|
{
|
|
101
100
|
className: e ? "rotate-90" : "",
|
|
@@ -118,33 +117,33 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
118
117
|
)
|
|
119
118
|
]
|
|
120
119
|
}
|
|
121
|
-
),
|
|
120
|
+
), Nn = [
|
|
122
121
|
{
|
|
123
122
|
title: "mobile_xs_title",
|
|
124
123
|
content: "mobile_xs_content",
|
|
125
124
|
breakpoint: "xs",
|
|
126
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
125
|
+
icon: /* @__PURE__ */ r.jsx(Re, {}),
|
|
127
126
|
width: 400
|
|
128
127
|
},
|
|
129
128
|
{
|
|
130
129
|
title: "mobile_sm_title",
|
|
131
130
|
content: "mobile_sm_content",
|
|
132
131
|
breakpoint: "sm",
|
|
133
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
132
|
+
icon: /* @__PURE__ */ r.jsx(Re, { className: "rotate-90" }),
|
|
134
133
|
width: 640
|
|
135
134
|
},
|
|
136
135
|
{
|
|
137
136
|
title: "tablet_md_title",
|
|
138
137
|
content: "tablet_md_content",
|
|
139
138
|
breakpoint: "md",
|
|
140
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
139
|
+
icon: /* @__PURE__ */ r.jsx(Le, {}),
|
|
141
140
|
width: 800
|
|
142
141
|
},
|
|
143
142
|
{
|
|
144
143
|
title: "tablet_lg_title",
|
|
145
144
|
content: "tablet_lg_content",
|
|
146
145
|
breakpoint: "lg",
|
|
147
|
-
icon: /* @__PURE__ */ r.jsx(
|
|
146
|
+
icon: /* @__PURE__ */ r.jsx(Le, { landscape: !0 }),
|
|
148
147
|
width: 1024
|
|
149
148
|
},
|
|
150
149
|
{
|
|
@@ -161,7 +160,7 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
161
160
|
icon: /* @__PURE__ */ r.jsx(Pt, {}),
|
|
162
161
|
width: 1920
|
|
163
162
|
}
|
|
164
|
-
],
|
|
163
|
+
], Ne = ({
|
|
165
164
|
title: e,
|
|
166
165
|
content: t,
|
|
167
166
|
currentBreakpoint: n,
|
|
@@ -186,26 +185,26 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
186
185
|
/* @__PURE__ */ r.jsx("p", { className: "text-xs", children: o(t) })
|
|
187
186
|
] }) }) })
|
|
188
187
|
] });
|
|
189
|
-
},
|
|
190
|
-
const [, e, t] = Te(), [n, s] = Jt(), { t: i } = de(), l =
|
|
188
|
+
}, Fn = () => {
|
|
189
|
+
const [, e, t] = Te(), [n, s] = Jt(), { t: i } = de(), l = Ce("breakpoints", Nn), d = (o) => {
|
|
191
190
|
n.includes(o) ? n.length > 2 && s(n.filter((c) => c !== o)) : s((c) => [...c, o]);
|
|
192
191
|
};
|
|
193
|
-
return l.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: re(l, (o) => /* @__PURE__ */
|
|
192
|
+
return l.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: re(l, (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
194
193
|
re(
|
|
195
|
-
l.filter((o) =>
|
|
196
|
-
(o) => /* @__PURE__ */
|
|
194
|
+
l.filter((o) => Oe(n, pe(o.breakpoint))),
|
|
195
|
+
(o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
|
|
197
196
|
),
|
|
198
197
|
/* @__PURE__ */ r.jsxs(Vt, { children: [
|
|
199
|
-
/* @__PURE__ */ r.jsx(
|
|
200
|
-
/* @__PURE__ */ r.jsxs(
|
|
201
|
-
/* @__PURE__ */ r.jsx(
|
|
202
|
-
/* @__PURE__ */ r.jsx(
|
|
198
|
+
/* @__PURE__ */ r.jsx(Gt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Mt, { className: "scale-90 transform" }) }) }),
|
|
199
|
+
/* @__PURE__ */ r.jsxs(Qt, { className: "w-56 border-border text-xs", children: [
|
|
200
|
+
/* @__PURE__ */ r.jsx(Zt, { children: i("Breakpoints") }),
|
|
201
|
+
/* @__PURE__ */ r.jsx(Xt, {}),
|
|
203
202
|
re(l, (o) => /* @__PURE__ */ r.jsx(
|
|
204
203
|
en,
|
|
205
204
|
{
|
|
206
205
|
disabled: o.breakpoint === "xs",
|
|
207
206
|
onCheckedChange: () => d(pe(o.breakpoint)),
|
|
208
|
-
checked:
|
|
207
|
+
checked: Oe(n, pe(o.breakpoint)),
|
|
209
208
|
children: i(o.title)
|
|
210
209
|
},
|
|
211
210
|
o.breakpoint
|
|
@@ -213,7 +212,7 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
213
212
|
] })
|
|
214
213
|
] })
|
|
215
214
|
] });
|
|
216
|
-
},
|
|
215
|
+
}, $n = () => {
|
|
217
216
|
const { t: e } = de(), { setNewBlocks: t } = tn(), [, n] = W(), [, s] = J(), i = ke(() => {
|
|
218
217
|
t([]), n([]), s([]);
|
|
219
218
|
}, [t]);
|
|
@@ -234,15 +233,15 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
234
233
|
] })
|
|
235
234
|
] })
|
|
236
235
|
] }) });
|
|
237
|
-
},
|
|
238
|
-
const e =
|
|
236
|
+
}, Wn = () => {
|
|
237
|
+
const e = Ce("darkMode", !1), [t] = Ze();
|
|
239
238
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
240
239
|
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
241
240
|
e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
242
|
-
/* @__PURE__ */ r.jsx(
|
|
241
|
+
/* @__PURE__ */ r.jsx(Ln, {}),
|
|
243
242
|
/* @__PURE__ */ r.jsx(ie, { orientation: "vertical" })
|
|
244
243
|
] }) : null,
|
|
245
|
-
/* @__PURE__ */ r.jsx(
|
|
244
|
+
/* @__PURE__ */ r.jsx(Fn, {}),
|
|
246
245
|
/* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
|
|
247
246
|
/* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
|
|
248
247
|
/* @__PURE__ */ r.jsx(Nt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
@@ -253,19 +252,19 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
253
252
|
] })
|
|
254
253
|
] }),
|
|
255
254
|
/* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
|
|
256
|
-
/* @__PURE__ */ r.jsx(
|
|
255
|
+
/* @__PURE__ */ r.jsx(Mn, {})
|
|
257
256
|
] }),
|
|
258
257
|
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
259
258
|
/* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
|
|
260
|
-
/* @__PURE__ */ r.jsx(
|
|
259
|
+
/* @__PURE__ */ r.jsx($n, {})
|
|
261
260
|
] })
|
|
262
261
|
] });
|
|
263
|
-
},
|
|
262
|
+
}, Hn = `<!doctype html>
|
|
264
263
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
265
264
|
<head>
|
|
266
265
|
<meta charset="UTF-8">
|
|
267
266
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
268
|
-
<script src="https://
|
|
267
|
+
<script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
|
|
269
268
|
<style>
|
|
270
269
|
html { height: 100%; overflow:auto; }
|
|
271
270
|
body { height: 100%; }
|
|
@@ -308,8 +307,8 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
|
308
307
|
<div class="frame-root h-full"></div>
|
|
309
308
|
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
310
309
|
</body>
|
|
311
|
-
</html>`,
|
|
312
|
-
const [t] = Te(), [, n] =
|
|
310
|
+
</html>`, Un = (e) => {
|
|
311
|
+
const [t] = Te(), [, n] = Ze(), [s, i] = $({}), l = ke(() => {
|
|
313
312
|
const { width: d, height: o } = e;
|
|
314
313
|
if (d < t) {
|
|
315
314
|
const c = parseFloat((d / t).toFixed(2).toString());
|
|
@@ -339,11 +338,11 @@ object-assign
|
|
|
339
338
|
(c) Sindre Sorhus
|
|
340
339
|
@license MIT
|
|
341
340
|
*/
|
|
342
|
-
var fe,
|
|
343
|
-
function
|
|
344
|
-
if (
|
|
341
|
+
var fe, Fe;
|
|
342
|
+
function qn() {
|
|
343
|
+
if (Fe)
|
|
345
344
|
return fe;
|
|
346
|
-
|
|
345
|
+
Fe = 1;
|
|
347
346
|
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
348
347
|
function s(l) {
|
|
349
348
|
if (l == null)
|
|
@@ -386,27 +385,27 @@ function zn() {
|
|
|
386
385
|
return c;
|
|
387
386
|
}, fe;
|
|
388
387
|
}
|
|
389
|
-
var he,
|
|
390
|
-
function
|
|
391
|
-
if (
|
|
388
|
+
var he, $e;
|
|
389
|
+
function Ie() {
|
|
390
|
+
if ($e)
|
|
392
391
|
return he;
|
|
393
|
-
|
|
392
|
+
$e = 1;
|
|
394
393
|
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
395
394
|
return he = e, he;
|
|
396
395
|
}
|
|
397
|
-
var ge,
|
|
396
|
+
var ge, We;
|
|
398
397
|
function at() {
|
|
399
|
-
return
|
|
398
|
+
return We || (We = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
|
|
400
399
|
}
|
|
401
|
-
var me,
|
|
402
|
-
function
|
|
403
|
-
if (
|
|
400
|
+
var me, He;
|
|
401
|
+
function zn() {
|
|
402
|
+
if (He)
|
|
404
403
|
return me;
|
|
405
|
-
|
|
404
|
+
He = 1;
|
|
406
405
|
var e = function() {
|
|
407
406
|
};
|
|
408
407
|
if (process.env.NODE_ENV !== "production") {
|
|
409
|
-
var t =
|
|
408
|
+
var t = Ie(), n = {}, s = at();
|
|
410
409
|
e = function(l) {
|
|
411
410
|
var d = "Warning: " + l;
|
|
412
411
|
typeof console < "u" && console.error(d);
|
|
@@ -448,12 +447,12 @@ function Yn() {
|
|
|
448
447
|
process.env.NODE_ENV !== "production" && (n = {});
|
|
449
448
|
}, me = i, me;
|
|
450
449
|
}
|
|
451
|
-
var ye,
|
|
452
|
-
function
|
|
453
|
-
if (
|
|
450
|
+
var ye, Ue;
|
|
451
|
+
function Yn() {
|
|
452
|
+
if (Ue)
|
|
454
453
|
return ye;
|
|
455
|
-
|
|
456
|
-
var e = ot, t =
|
|
454
|
+
Ue = 1;
|
|
455
|
+
var e = ot, t = qn(), n = Ie(), s = at(), i = zn(), l = function() {
|
|
457
456
|
};
|
|
458
457
|
process.env.NODE_ENV !== "production" && (l = function(o) {
|
|
459
458
|
var c = "Warning: " + o;
|
|
@@ -484,7 +483,7 @@ function Kn() {
|
|
|
484
483
|
symbol: I("symbol"),
|
|
485
484
|
any: H(),
|
|
486
485
|
arrayOf: V,
|
|
487
|
-
element:
|
|
486
|
+
element: G(),
|
|
488
487
|
elementType: L(),
|
|
489
488
|
instanceOf: _,
|
|
490
489
|
node: mt(),
|
|
@@ -512,11 +511,11 @@ function Kn() {
|
|
|
512
511
|
);
|
|
513
512
|
throw B.name = "Invariant Violation", B;
|
|
514
513
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
515
|
-
var
|
|
516
|
-
!u[
|
|
514
|
+
var Q = T + ":" + w;
|
|
515
|
+
!u[Q] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
517
516
|
k < 3 && (l(
|
|
518
517
|
"You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
519
|
-
), u[
|
|
518
|
+
), u[Q] = !0, k++);
|
|
520
519
|
}
|
|
521
520
|
}
|
|
522
521
|
return x[w] == null ? j ? x[w] === null ? new m("The " + E + " `" + C + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new m("The " + E + " `" + C + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : a(x, w, T, E, C);
|
|
@@ -559,7 +558,7 @@ function Kn() {
|
|
|
559
558
|
}
|
|
560
559
|
return g(u);
|
|
561
560
|
}
|
|
562
|
-
function
|
|
561
|
+
function G() {
|
|
563
562
|
function a(u, k, b, y, j) {
|
|
564
563
|
var x = u[k];
|
|
565
564
|
if (!o(x)) {
|
|
@@ -601,8 +600,8 @@ function Kn() {
|
|
|
601
600
|
if (O(w, a[T]))
|
|
602
601
|
return null;
|
|
603
602
|
var E = JSON.stringify(a, function(P, B) {
|
|
604
|
-
var
|
|
605
|
-
return
|
|
603
|
+
var Q = ee(B);
|
|
604
|
+
return Q === "symbol" ? String(B) : B;
|
|
606
605
|
});
|
|
607
606
|
return new m("Invalid " + j + " `" + x + "` of value `" + String(w) + "` " + ("supplied to `" + y + "`, expected one of " + E + "."));
|
|
608
607
|
}
|
|
@@ -642,8 +641,8 @@ function Kn() {
|
|
|
642
641
|
return null;
|
|
643
642
|
B.data && s(B.data, "expectedType") && E.push(B.data.expectedType);
|
|
644
643
|
}
|
|
645
|
-
var
|
|
646
|
-
return new m("Invalid " + w + " `" + T + "` supplied to " + ("`" + x + "`" +
|
|
644
|
+
var Q = E.length > 0 ? ", expected one of type [" + E.join(", ") + "]" : "";
|
|
645
|
+
return new m("Invalid " + w + " `" + T + "` supplied to " + ("`" + x + "`" + Q + "."));
|
|
647
646
|
}
|
|
648
647
|
return g(b);
|
|
649
648
|
}
|
|
@@ -653,7 +652,7 @@ function Kn() {
|
|
|
653
652
|
}
|
|
654
653
|
return g(a);
|
|
655
654
|
}
|
|
656
|
-
function
|
|
655
|
+
function De(a, u, k, b, y) {
|
|
657
656
|
return new m(
|
|
658
657
|
(a || "React class") + ": " + u + " type `" + k + "." + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + y + "`."
|
|
659
658
|
);
|
|
@@ -666,7 +665,7 @@ function Kn() {
|
|
|
666
665
|
for (var E in a) {
|
|
667
666
|
var C = a[E];
|
|
668
667
|
if (typeof C != "function")
|
|
669
|
-
return
|
|
668
|
+
return De(y, j, x, E, ee(C));
|
|
670
669
|
var P = C(w, E, y, j, x + "." + E, n);
|
|
671
670
|
if (P)
|
|
672
671
|
return P;
|
|
@@ -684,7 +683,7 @@ function Kn() {
|
|
|
684
683
|
for (var C in E) {
|
|
685
684
|
var P = a[C];
|
|
686
685
|
if (s(a, C) && typeof P != "function")
|
|
687
|
-
return
|
|
686
|
+
return De(y, j, x, C, ee(P));
|
|
688
687
|
if (!P)
|
|
689
688
|
return new m(
|
|
690
689
|
"Invalid " + j + " `" + x + "` key `" + C + "` supplied to `" + y + "`.\nBad object: " + JSON.stringify(k[b], null, " ") + `
|
|
@@ -770,12 +769,12 @@ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
|
|
|
770
769
|
return S.checkPropTypes = i, S.resetWarningCache = i.resetWarningCache, S.PropTypes = S, S;
|
|
771
770
|
}, ye;
|
|
772
771
|
}
|
|
773
|
-
var ve,
|
|
774
|
-
function
|
|
775
|
-
if (
|
|
772
|
+
var ve, qe;
|
|
773
|
+
function Kn() {
|
|
774
|
+
if (qe)
|
|
776
775
|
return ve;
|
|
777
|
-
|
|
778
|
-
var e =
|
|
776
|
+
qe = 1;
|
|
777
|
+
var e = Ie();
|
|
779
778
|
function t() {
|
|
780
779
|
}
|
|
781
780
|
function n() {
|
|
@@ -819,19 +818,19 @@ function Jn() {
|
|
|
819
818
|
return l.PropTypes = l, l;
|
|
820
819
|
}, ve;
|
|
821
820
|
}
|
|
822
|
-
var
|
|
821
|
+
var Io = ce.exports;
|
|
823
822
|
if (process.env.NODE_ENV !== "production") {
|
|
824
|
-
var
|
|
825
|
-
ce.exports =
|
|
823
|
+
var Jn = ot, Vn = !0;
|
|
824
|
+
ce.exports = Yn()(Jn.isElement, Vn);
|
|
826
825
|
} else
|
|
827
|
-
ce.exports =
|
|
828
|
-
var
|
|
829
|
-
const A = /* @__PURE__ */
|
|
826
|
+
ce.exports = Kn()();
|
|
827
|
+
var Gn = ce.exports;
|
|
828
|
+
const A = /* @__PURE__ */ kn(Gn);
|
|
830
829
|
let lt, ct;
|
|
831
830
|
typeof document < "u" && (lt = document);
|
|
832
831
|
typeof window < "u" && (ct = window);
|
|
833
|
-
const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider:
|
|
834
|
-
class ut extends
|
|
832
|
+
const dt = K.createContext({ document: lt, window: ct }), ue = () => K.useContext(dt), { Provider: Qn, Consumer: So } = dt;
|
|
833
|
+
class ut extends Ye {
|
|
835
834
|
componentDidMount() {
|
|
836
835
|
this.props.contentDidMount();
|
|
837
836
|
}
|
|
@@ -847,7 +846,7 @@ Y(ut, "propTypes", {
|
|
|
847
846
|
contentDidMount: A.func.isRequired,
|
|
848
847
|
contentDidUpdate: A.func.isRequired
|
|
849
848
|
});
|
|
850
|
-
class be extends
|
|
849
|
+
class be extends Ye {
|
|
851
850
|
constructor(n, s) {
|
|
852
851
|
super(n, s);
|
|
853
852
|
Y(this, "setRef", (n) => {
|
|
@@ -884,8 +883,8 @@ class be extends ze {
|
|
|
884
883
|
const n = this.getDoc();
|
|
885
884
|
if (!n)
|
|
886
885
|
return null;
|
|
887
|
-
const s = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(
|
|
888
|
-
return [
|
|
886
|
+
const s = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(Qn, { value: { document: n, window: l }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
|
|
887
|
+
return [Pe.createPortal(this.props.head, this.getDoc().head), Pe.createPortal(d, o)];
|
|
889
888
|
}
|
|
890
889
|
render() {
|
|
891
890
|
const n = {
|
|
@@ -921,22 +920,22 @@ Y(be, "propTypes", {
|
|
|
921
920
|
},
|
|
922
921
|
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
|
|
923
922
|
});
|
|
924
|
-
const
|
|
923
|
+
const Zn = K.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
|
|
925
924
|
let q = null, oe = [], ne = null, pt = null;
|
|
926
|
-
function
|
|
925
|
+
function Xn(e) {
|
|
927
926
|
const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), s = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), l = parseInt(t.paddingBottom, 10);
|
|
928
927
|
return { paddingLeft: n, paddingTop: s, paddingRight: i, paddingBottom: l };
|
|
929
928
|
}
|
|
930
|
-
const
|
|
929
|
+
const ze = (e, t, n) => {
|
|
931
930
|
if (!q)
|
|
932
931
|
return;
|
|
933
|
-
const s = e.getBoundingClientRect(), i = q == null ? void 0 : q.getElementById("placeholder"), { paddingLeft: l, paddingTop: d, paddingRight: o, paddingBottom: c } =
|
|
932
|
+
const s = e.getBoundingClientRect(), i = q == null ? void 0 : q.getElementById("placeholder"), { paddingLeft: l, paddingTop: d, paddingRight: o, paddingBottom: c } = Xn(e);
|
|
934
933
|
i.style.width = t === "vertical" ? s.width - l - o + "px" : "2px", i.style.height = t === "vertical" ? "2px" : s.height - d - c + "px", i.style.display = "block";
|
|
935
934
|
const p = oe.reduce(
|
|
936
935
|
(f, h) => Math.abs(h - n) < Math.abs(f - n) ? h : f
|
|
937
936
|
);
|
|
938
937
|
pt = oe.indexOf(p), t === "vertical" ? (i.style.top = e.offsetTop + p + "px", i.style.left = e.offsetLeft + l + "px") : (i.style.top = e.offsetTop + d + "px", i.style.left = e.offsetLeft + p + "px");
|
|
939
|
-
},
|
|
938
|
+
}, er = (e) => {
|
|
940
939
|
const t = ft(e), n = window.getComputedStyle(e), s = t === "horizontal", i = parseInt(n.paddingLeft), l = parseInt(n.paddingTop);
|
|
941
940
|
let d = s ? i : l;
|
|
942
941
|
oe = [d], Array.from(e.children).forEach((o) => {
|
|
@@ -959,28 +958,28 @@ function ft(e) {
|
|
|
959
958
|
}
|
|
960
959
|
return t === "block" ? "vertical" : "horizontal";
|
|
961
960
|
}
|
|
962
|
-
const
|
|
961
|
+
const tr = Je((e) => {
|
|
963
962
|
const t = e.target, n = ft(t);
|
|
964
963
|
if (n === "vertical") {
|
|
965
964
|
const s = e.clientY - t.offsetTop;
|
|
966
|
-
|
|
965
|
+
ze(t, n, s);
|
|
967
966
|
} else {
|
|
968
967
|
const s = e.clientX - t.offsetLeft;
|
|
969
|
-
|
|
968
|
+
ze(t, n, s);
|
|
970
969
|
}
|
|
971
|
-
}, 200),
|
|
972
|
-
e.preventDefault(), e.stopPropagation(),
|
|
970
|
+
}, 200), nr = (e) => {
|
|
971
|
+
e.preventDefault(), e.stopPropagation(), tr(e);
|
|
973
972
|
};
|
|
974
973
|
function xe() {
|
|
975
974
|
const e = q == null ? void 0 : q.getElementById("placeholder");
|
|
976
975
|
e.style.display = "none";
|
|
977
976
|
}
|
|
978
|
-
const
|
|
979
|
-
const { document: e } = ue(), [t, n] = M(
|
|
977
|
+
const rr = () => {
|
|
978
|
+
const { document: e } = ue(), [t, n] = M(pn), s = In(), i = st("dnd"), [, l] = Z(), [, d] = W();
|
|
980
979
|
return q = e, {
|
|
981
980
|
isDragging: t,
|
|
982
981
|
"data-dnd": "branch",
|
|
983
|
-
onDragOver: i ?
|
|
982
|
+
onDragOver: i ? nr : te,
|
|
984
983
|
onDrop: i ? (o) => {
|
|
985
984
|
ne == null || ne.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
986
985
|
const c = JSON.parse(o.dataTransfer.getData("text/plain"));
|
|
@@ -993,7 +992,7 @@ const or = () => {
|
|
|
993
992
|
const c = o;
|
|
994
993
|
ne = c.target, c.stopPropagation(), c.preventDefault(), oe = [];
|
|
995
994
|
const p = c.target;
|
|
996
|
-
|
|
995
|
+
er(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), l(""), d([]);
|
|
997
996
|
} : te,
|
|
998
997
|
onDragLeave: i ? (o) => {
|
|
999
998
|
const c = o;
|
|
@@ -1004,56 +1003,56 @@ const or = () => {
|
|
|
1004
1003
|
} : te
|
|
1005
1004
|
};
|
|
1006
1005
|
};
|
|
1007
|
-
function
|
|
1006
|
+
function Se(e) {
|
|
1008
1007
|
return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
|
|
1009
1008
|
}
|
|
1010
|
-
function
|
|
1009
|
+
function or(e) {
|
|
1011
1010
|
e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
|
|
1012
1011
|
var t = document.querySelector(".ql-toolbar");
|
|
1013
1012
|
t && t.parentNode.removeChild(t), e = null;
|
|
1014
1013
|
}
|
|
1015
|
-
const
|
|
1016
|
-
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t =
|
|
1014
|
+
const sr = () => {
|
|
1015
|
+
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = Z(), [s, i] = M(X);
|
|
1017
1016
|
return (l) => {
|
|
1018
1017
|
var h;
|
|
1019
1018
|
if (s)
|
|
1020
1019
|
return;
|
|
1021
|
-
const d =
|
|
1020
|
+
const d = Se(l.target), o = d.getAttribute("data-block-type");
|
|
1022
1021
|
if (!o || !e.includes(o))
|
|
1023
1022
|
return;
|
|
1024
1023
|
const c = d.cloneNode(!0);
|
|
1025
1024
|
d.style.display = "none", Array.from(c.attributes).forEach((v) => {
|
|
1026
1025
|
v.name !== "class" && c.removeAttribute(v.name);
|
|
1027
1026
|
}), o === "Text" && (c.style.display = "inline-block"), d.parentNode.insertBefore(c, d.nextSibling);
|
|
1028
|
-
const p = new
|
|
1027
|
+
const p = new En(c, { placeholder: "Type here..." });
|
|
1029
1028
|
function f() {
|
|
1030
1029
|
const v = p.getText(0, p.getLength());
|
|
1031
|
-
t([d.getAttribute("data-block-id")], { content: v }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0),
|
|
1030
|
+
t([d.getAttribute("data-block-id")], { content: v }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0), or(p), i(""), n("");
|
|
1032
1031
|
}
|
|
1033
1032
|
c.addEventListener("blur", f, !0), p.focus(), (h = c.querySelector(".ql-clipboard")) == null || h.remove(), i(d.getAttribute("data-block-id"));
|
|
1034
1033
|
};
|
|
1035
|
-
},
|
|
1036
|
-
const [, e] = J(), [, t] = W(), [n] = M(
|
|
1034
|
+
}, ir = () => {
|
|
1035
|
+
const [, e] = J(), [, t] = W(), [n] = M(X);
|
|
1037
1036
|
return (s) => {
|
|
1038
1037
|
if (n)
|
|
1039
1038
|
return;
|
|
1040
1039
|
s.stopPropagation();
|
|
1041
|
-
const i =
|
|
1040
|
+
const i = Se(s.target);
|
|
1042
1041
|
if (i != null && i.getAttribute("data-block-parent")) {
|
|
1043
1042
|
const l = i.getAttribute("data-style-prop"), d = i.getAttribute("data-style-id"), o = i.getAttribute("data-block-parent");
|
|
1044
1043
|
e([{ id: d, prop: l, blockId: o }]), t([o]);
|
|
1045
1044
|
} else
|
|
1046
1045
|
i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
|
|
1047
1046
|
};
|
|
1048
|
-
},
|
|
1049
|
-
const n =
|
|
1047
|
+
}, ar = Je((e, t) => {
|
|
1048
|
+
const n = Se(e.target);
|
|
1050
1049
|
n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
|
|
1051
|
-
}, 100),
|
|
1052
|
-
const [, e] =
|
|
1050
|
+
}, 100), lr = () => {
|
|
1051
|
+
const [, e] = Z(), [t] = M(X);
|
|
1053
1052
|
return (n) => {
|
|
1054
|
-
t ||
|
|
1053
|
+
t || ar(n, e);
|
|
1055
1054
|
};
|
|
1056
|
-
},
|
|
1055
|
+
}, cr = ({ children: e }) => {
|
|
1057
1056
|
const { document: t } = ue(), [n] = W(), [s, i] = J();
|
|
1058
1057
|
R(() => {
|
|
1059
1058
|
setTimeout(() => {
|
|
@@ -1069,7 +1068,7 @@ const ir = () => {
|
|
|
1069
1068
|
}
|
|
1070
1069
|
}, 100);
|
|
1071
1070
|
}, [t, n, i, s]);
|
|
1072
|
-
const l =
|
|
1071
|
+
const l = sr(), d = ir(), o = lr(), c = rr();
|
|
1073
1072
|
return /* @__PURE__ */ r.jsx(
|
|
1074
1073
|
"div",
|
|
1075
1074
|
{
|
|
@@ -1083,8 +1082,8 @@ const ir = () => {
|
|
|
1083
1082
|
children: e
|
|
1084
1083
|
}
|
|
1085
1084
|
);
|
|
1086
|
-
}, ht = (e, t) => e.querySelector(`[data-block-id="${t}"]`),
|
|
1087
|
-
const { window: e } = ue(), [t, n] = W(), [s] =
|
|
1085
|
+
}, ht = (e, t) => e.querySelector(`[data-block-id="${t}"]`), dr = () => {
|
|
1086
|
+
const { window: e } = ue(), [t, n] = W(), [s] = Ee(), [, i] = J(), { undo: l, redo: d } = Ge(), o = Xe(), [, c] = et(), p = tt(), { savePage: f } = hn(), [h] = M(X), [, v] = M(gn), S = (m) => {
|
|
1088
1087
|
m.key === "Enter" && (m.preventDefault(), t.length === 1 && v(ae(t)));
|
|
1089
1088
|
}, O = (m) => {
|
|
1090
1089
|
const g = s.find((I) => I._id === m);
|
|
@@ -1114,8 +1113,8 @@ const ir = () => {
|
|
|
1114
1113
|
e.removeEventListener("keydown", m);
|
|
1115
1114
|
};
|
|
1116
1115
|
}, [t, n, l, p, c, d, o, h, f, e]), null;
|
|
1117
|
-
},
|
|
1118
|
-
const [, n] = W(), [, s] =
|
|
1116
|
+
}, ur = ({ block: e, label: t }) => {
|
|
1117
|
+
const [, n] = W(), [, s] = Z(), [, i] = M(nt), l = st("dnd");
|
|
1119
1118
|
return /* @__PURE__ */ r.jsxs(
|
|
1120
1119
|
"div",
|
|
1121
1120
|
{
|
|
@@ -1132,15 +1131,15 @@ const ir = () => {
|
|
|
1132
1131
|
]
|
|
1133
1132
|
}
|
|
1134
1133
|
);
|
|
1135
|
-
},
|
|
1136
|
-
const n = tt(), s =
|
|
1134
|
+
}, pr = ({ selectedBlockElement: e, block: t }) => {
|
|
1135
|
+
const n = tt(), s = Xe(), [, i] = W(), [, l] = J(), [d] = M(X), { floatingStyles: o, refs: c, update: p } = Dn({
|
|
1137
1136
|
placement: "top-start",
|
|
1138
|
-
middleware: [
|
|
1137
|
+
middleware: [_n(), Sn()],
|
|
1139
1138
|
elements: {
|
|
1140
1139
|
reference: e
|
|
1141
1140
|
}
|
|
1142
1141
|
});
|
|
1143
|
-
|
|
1142
|
+
Bn(e, () => p(), e !== null);
|
|
1144
1143
|
const f = D(t, "_parent", null), h = z(D(t, "_name", "")) ? D(t, "_type", "") : D(t, "_name", "");
|
|
1145
1144
|
return !e || !t || d ? null : /* @__PURE__ */ r.jsxs(
|
|
1146
1145
|
"div",
|
|
@@ -1153,27 +1152,27 @@ const ir = () => {
|
|
|
1153
1152
|
v.stopPropagation(), v.preventDefault();
|
|
1154
1153
|
},
|
|
1155
1154
|
onKeyDown: (v) => v.stopPropagation(),
|
|
1156
|
-
className: "z-[99999] flex h-6 items-center bg-blue-500
|
|
1155
|
+
className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
1157
1156
|
children: [
|
|
1158
|
-
/* @__PURE__ */ r.jsx(
|
|
1159
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1
|
|
1157
|
+
/* @__PURE__ */ r.jsx(ur, { label: h, block: t }),
|
|
1158
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
|
|
1160
1159
|
f && /* @__PURE__ */ r.jsx(
|
|
1161
1160
|
$t,
|
|
1162
1161
|
{
|
|
1163
|
-
className: "hover:scale-105
|
|
1162
|
+
className: "hover:scale-105",
|
|
1164
1163
|
onClick: () => {
|
|
1165
1164
|
l([]), i([f]);
|
|
1166
1165
|
}
|
|
1167
1166
|
}
|
|
1168
1167
|
),
|
|
1169
|
-
|
|
1170
|
-
|
|
1168
|
+
mn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105", onClick: () => s([t == null ? void 0 : t._id]) }) : null,
|
|
1169
|
+
yn(D(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Ht, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
|
|
1171
1170
|
] })
|
|
1172
1171
|
]
|
|
1173
1172
|
}
|
|
1174
1173
|
);
|
|
1175
|
-
},
|
|
1176
|
-
const [t] =
|
|
1174
|
+
}, fr = ({ model: e }) => {
|
|
1175
|
+
const [t] = vn(), [n] = W(), [s] = Qe(), [i] = Z(), [l] = J(), [d] = M(nt), { document: o, window: c } = ue(), [p] = $(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = $(
|
|
1177
1176
|
o == null ? void 0 : o.getElementById("selected-block")
|
|
1178
1177
|
), [h] = $(
|
|
1179
1178
|
o == null ? void 0 : o.getElementById("selected-styling-block")
|
|
@@ -1183,7 +1182,7 @@ const ir = () => {
|
|
|
1183
1182
|
}, [s, o]);
|
|
1184
1183
|
const S = D(t, "headingFont", "DM Sans"), O = D(t, "bodyFont", "DM Sans");
|
|
1185
1184
|
return R(() => {
|
|
1186
|
-
const m = D(t, "primaryColor", "#000"), g = D(t, "secondaryColor", "#FFF"), I =
|
|
1185
|
+
const m = D(t, "primaryColor", "#000"), g = D(t, "secondaryColor", "#FFF"), I = On({
|
|
1187
1186
|
colors: [m, g],
|
|
1188
1187
|
names: ["primary", "secondary"]
|
|
1189
1188
|
});
|
|
@@ -1205,12 +1204,12 @@ const ir = () => {
|
|
|
1205
1204
|
},
|
|
1206
1205
|
plugins: [
|
|
1207
1206
|
// @ts-ignore
|
|
1208
|
-
c.tailwind.plugin.withOptions(({ prefix: V = "ui" } = {}) => ({ addVariant:
|
|
1207
|
+
c.tailwind.plugin.withOptions(({ prefix: V = "ui" } = {}) => ({ addVariant: G }) => {
|
|
1209
1208
|
for (const L of ["open", "checked", "selected", "active", "disabled"])
|
|
1210
|
-
|
|
1209
|
+
G(`${V}-${L}`, [
|
|
1211
1210
|
`&[data-headlessui-state~="${L}"]`,
|
|
1212
1211
|
`:where([data-headlessui-state~="${L}"]) &`
|
|
1213
|
-
]),
|
|
1212
|
+
]), G(`${V}-not-${L}`, [
|
|
1214
1213
|
`&[data-headlessui-state]:not([data-headlessui-state~="${L}"])`,
|
|
1215
1214
|
`:where([data-headlessui-state]:not([data-headlessui-state~="${L}"])) &:not([data-headlessui-state])`
|
|
1216
1215
|
]);
|
|
@@ -1265,55 +1264,55 @@ const ir = () => {
|
|
|
1265
1264
|
),
|
|
1266
1265
|
S && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${S}",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";}` })
|
|
1267
1266
|
] }) : null;
|
|
1268
|
-
},
|
|
1267
|
+
}, hr = (e) => {
|
|
1269
1268
|
const t = {};
|
|
1270
1269
|
return Object.keys(e).forEach((n) => {
|
|
1271
|
-
je(e[n]) && e[n].startsWith(
|
|
1270
|
+
je(e[n]) && e[n].startsWith(Me) && (t[n] = e[n].replace(Me, "").split(","));
|
|
1272
1271
|
}), t;
|
|
1273
|
-
},
|
|
1272
|
+
}, gr = Dt((e) => {
|
|
1274
1273
|
const t = e.replace(it, "").split(",");
|
|
1275
|
-
return
|
|
1274
|
+
return Rn(t[0], t[1]);
|
|
1276
1275
|
});
|
|
1277
|
-
function
|
|
1276
|
+
function mr(e, t) {
|
|
1278
1277
|
return D(e, `${t}_attrs`, {});
|
|
1279
1278
|
}
|
|
1280
|
-
function
|
|
1279
|
+
function yr(e) {
|
|
1281
1280
|
const t = {};
|
|
1282
1281
|
return Object.keys(e).forEach((n) => {
|
|
1283
1282
|
if (je(e[n]) && e[n].startsWith(it)) {
|
|
1284
|
-
const s =
|
|
1283
|
+
const s = gr(e[n]);
|
|
1285
1284
|
t[n] = {
|
|
1286
1285
|
className: s,
|
|
1287
1286
|
"data-style-prop": n,
|
|
1288
1287
|
"data-block-parent": e._id,
|
|
1289
1288
|
"data-style-id": `${n}-${e._id}`,
|
|
1290
|
-
...
|
|
1289
|
+
...mr(e, n)
|
|
1291
1290
|
};
|
|
1292
1291
|
}
|
|
1293
1292
|
}), t;
|
|
1294
1293
|
}
|
|
1295
|
-
function
|
|
1294
|
+
function vr(e, t) {
|
|
1296
1295
|
const n = D(e, "_bindings", {});
|
|
1297
1296
|
return z(n) ? { ...e } : (_t(n, (s, i) => {
|
|
1298
1297
|
je(s) && D(t, s, null) && (e[i] = D(t, s, null));
|
|
1299
1298
|
}), e);
|
|
1300
1299
|
}
|
|
1301
1300
|
function we({ blocks: e }) {
|
|
1302
|
-
const [t] =
|
|
1301
|
+
const [t] = Ee(), n = ke((l) => yr(l), []), [s] = jn(), [i] = M(X);
|
|
1303
1302
|
return /* @__PURE__ */ r.jsx(r.Fragment, { children: K.Children.toArray(
|
|
1304
1303
|
e.map((l, d) => {
|
|
1305
1304
|
if (i === l._id)
|
|
1306
1305
|
return null;
|
|
1307
|
-
const o =
|
|
1306
|
+
const o = hr(l), c = {};
|
|
1308
1307
|
z(o) || Object.keys(o).forEach((v) => {
|
|
1309
1308
|
c[v] = K.Children.toArray(
|
|
1310
1309
|
o[v].map((S) => /* @__PURE__ */ r.jsx(we, { blocks: [Bt(t, { _id: S })] }))
|
|
1311
1310
|
);
|
|
1312
1311
|
});
|
|
1313
|
-
const p =
|
|
1312
|
+
const p = Ve(t, { _parent: l._id });
|
|
1314
1313
|
c.children = p.length ? /* @__PURE__ */ r.jsx(we, { blocks: p }) : null;
|
|
1315
|
-
const f =
|
|
1316
|
-
return Ot(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` }) : /* @__PURE__ */ r.jsx(
|
|
1314
|
+
const f = Pn(l._type), h = D(f, "builderComponent", D(f, "component", null));
|
|
1315
|
+
return Ot(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ke, { children: K.createElement(h, {
|
|
1317
1316
|
blockProps: {
|
|
1318
1317
|
"data-block-id": l._id,
|
|
1319
1318
|
"data-block-type": l._type,
|
|
@@ -1321,23 +1320,23 @@ function we({ blocks: e }) {
|
|
|
1321
1320
|
},
|
|
1322
1321
|
inBuilder: !0,
|
|
1323
1322
|
index: d,
|
|
1324
|
-
...
|
|
1323
|
+
...vr(l, s),
|
|
1325
1324
|
...n(l),
|
|
1326
1325
|
...c
|
|
1327
1326
|
}) });
|
|
1328
1327
|
})
|
|
1329
1328
|
) });
|
|
1330
1329
|
}
|
|
1331
|
-
const
|
|
1332
|
-
const [e] =
|
|
1333
|
-
return /* @__PURE__ */ r.jsx(
|
|
1334
|
-
},
|
|
1335
|
-
const [e] = M(
|
|
1330
|
+
const xr = () => {
|
|
1331
|
+
const [e] = Ee(), t = z(e) ? null : /* @__PURE__ */ r.jsx(Tn, { children: /* @__PURE__ */ r.jsx(we, { blocks: Ve(e, (n) => z(n._parent)) }) });
|
|
1332
|
+
return /* @__PURE__ */ r.jsx(An, { children: t });
|
|
1333
|
+
}, br = (e, t) => e.querySelector(`[data-style-id="${t}"]`), wr = () => {
|
|
1334
|
+
const [e] = M(xn), [t] = et(), [n] = Te(), [, s] = W(), i = bn(), [, l] = Z(), d = Be(null), o = Be(null), [c, p] = $({ width: 0, height: 0 }), f = Un(c), [h, v] = $(0), [S, O] = $([]), [, m] = $([]), [, g] = M(wn), [I, H] = J(), V = Ce("loadingCanvas", !1);
|
|
1336
1335
|
R(() => {
|
|
1337
1336
|
const { clientWidth: _, clientHeight: N } = o.current;
|
|
1338
1337
|
p({ width: _, height: N }), h === 0 && v(_);
|
|
1339
1338
|
}, [o, n, h]);
|
|
1340
|
-
const
|
|
1339
|
+
const G = (_, N = 0) => {
|
|
1341
1340
|
const { top: F } = _.getBoundingClientRect();
|
|
1342
1341
|
return F + N >= 0 && F - N <= window.innerHeight;
|
|
1343
1342
|
};
|
|
@@ -1345,11 +1344,11 @@ const br = () => {
|
|
|
1345
1344
|
var _, N;
|
|
1346
1345
|
if (i && i.type !== "Multiple" && d.current) {
|
|
1347
1346
|
const F = ht(d.current.contentDocument, i._id);
|
|
1348
|
-
F && (
|
|
1347
|
+
F && (G(F) || (N = (_ = d.current) == null ? void 0 : _.contentWindow) == null || N.scrollTo({ top: F.offsetTop, behavior: "smooth" }), O([F]));
|
|
1349
1348
|
}
|
|
1350
1349
|
}, [i]), R(() => {
|
|
1351
1350
|
if (!z(I) && d.current) {
|
|
1352
|
-
const _ =
|
|
1351
|
+
const _ = br(
|
|
1353
1352
|
d.current.contentDocument,
|
|
1354
1353
|
ae(I).id
|
|
1355
1354
|
);
|
|
@@ -1358,7 +1357,7 @@ const br = () => {
|
|
|
1358
1357
|
m([null]);
|
|
1359
1358
|
}, [I]);
|
|
1360
1359
|
const L = Ct(() => {
|
|
1361
|
-
let _ =
|
|
1360
|
+
let _ = Hn;
|
|
1362
1361
|
return e === "offline" && (_ = _.replace(
|
|
1363
1362
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1364
1363
|
"/offline/tailwind.cdn.js"
|
|
@@ -1375,7 +1374,7 @@ const br = () => {
|
|
|
1375
1374
|
style: h > 0 && !z(f) ? { width: t ? "100%" : h } : {},
|
|
1376
1375
|
ref: o,
|
|
1377
1376
|
children: /* @__PURE__ */ r.jsxs(
|
|
1378
|
-
|
|
1377
|
+
Zn,
|
|
1379
1378
|
{
|
|
1380
1379
|
contentDidMount: () => g(d.current),
|
|
1381
1380
|
ref: d,
|
|
@@ -1384,16 +1383,16 @@ const br = () => {
|
|
|
1384
1383
|
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1385
1384
|
initialContent: L,
|
|
1386
1385
|
children: [
|
|
1387
|
-
/* @__PURE__ */ r.jsx(
|
|
1386
|
+
/* @__PURE__ */ r.jsx(dr, {}),
|
|
1388
1387
|
/* @__PURE__ */ r.jsx(
|
|
1389
|
-
|
|
1388
|
+
pr,
|
|
1390
1389
|
{
|
|
1391
1390
|
block: i,
|
|
1392
1391
|
selectedBlockElement: ae(S)
|
|
1393
1392
|
}
|
|
1394
1393
|
),
|
|
1395
|
-
/* @__PURE__ */ r.jsx(
|
|
1396
|
-
/* @__PURE__ */ r.jsx(
|
|
1394
|
+
/* @__PURE__ */ r.jsx(fr, { model: "page" }),
|
|
1395
|
+
/* @__PURE__ */ r.jsx(cr, { children: V ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(xr, {}) }),
|
|
1397
1396
|
/* @__PURE__ */ r.jsx("br", {}),
|
|
1398
1397
|
/* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
|
|
1399
1398
|
]
|
|
@@ -1401,10 +1400,10 @@ const br = () => {
|
|
|
1401
1400
|
)
|
|
1402
1401
|
}
|
|
1403
1402
|
);
|
|
1404
|
-
},
|
|
1405
|
-
/* @__PURE__ */ r.jsx(
|
|
1406
|
-
/* @__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(
|
|
1403
|
+
}, Do = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1404
|
+
/* @__PURE__ */ r.jsx(Wn, {}),
|
|
1405
|
+
/* @__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(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Cn, { children: /* @__PURE__ */ r.jsx(wr, {}) }) }) })
|
|
1407
1406
|
] });
|
|
1408
1407
|
export {
|
|
1409
|
-
|
|
1408
|
+
Do as default
|
|
1410
1409
|
};
|