@chaibuilder/sdk 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CanvasArea-UtFK5IS6.cjs +58 -0
- package/dist/CanvasArea-dkwSFbQA.js +1412 -0
- package/dist/{CurrentPage-_Em0U2gh.cjs → CurrentPage-hHwsHam-.cjs} +1 -1
- package/dist/{CurrentPage-pSsaLyEf.js → CurrentPage-uRwS0DQC.js} +1 -1
- package/dist/{Layers-RyVRzaUa.cjs → Layers--5nyqOjK.cjs} +1 -1
- package/dist/{Layers-wp2Uc2Y5.js → Layers-eXMT1ncm.js} +1 -1
- package/dist/{PagesPanel-ZuXc2610.cjs → PagesPanel-WZgw7xVs.cjs} +1 -1
- package/dist/{PagesPanel-L2VS8RyZ.js → PagesPanel-xRUnAMIb.js} +2 -2
- package/dist/{ProjectPanel-T3AXGe7O.js → ProjectPanel-8l4Bi3Kh.js} +2 -2
- package/dist/{ProjectPanel-SErKorHi.cjs → ProjectPanel-FC03TiyG.cjs} +1 -1
- package/dist/{Settings-xkL3U3Y-.js → Settings-4v3M1bRS.js} +507 -501
- package/dist/Settings-kcmKFymH.cjs +1 -0
- package/dist/{SidePanels-pd7HYv8I.js → SidePanels-0xaw3Td6.js} +45 -39
- package/dist/{SidePanels-5FNROZe7.cjs → SidePanels-5e5q3c7J.cjs} +1 -1
- package/dist/{add-page-modal-U8EH-GIa.cjs → add-page-modal-JRSQ_N56.cjs} +1 -1
- package/dist/{add-page-modal-Njd5M7E2.js → add-page-modal-K5isTZOT.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-0LQiM0fX.cjs → delete-page-modal-c8nB2y7w.cjs} +1 -1
- package/dist/{delete-page-modal-NT7df4pk.js → delete-page-modal-x81Ed4jF.js} +1 -1
- package/dist/{index-pYZXf7hY.cjs → index-7NRFGya_.cjs} +10 -10
- package/dist/{index-N3mTbV2j.js → index-HjvZqhVh.js} +163 -160
- package/dist/{page-viewer-e3lOBAH3.js → page-viewer-fFaDQOOI.js} +2 -2
- package/dist/{page-viewer-UxwOwHCO.cjs → page-viewer-huD5B1om.cjs} +1 -1
- package/dist/{project-general-setting-el86II8N.js → project-general-setting-rH_1r38b.js} +1 -1
- package/dist/{project-general-setting-DrLwWE-6.cjs → project-general-setting-rNNI-K6l.cjs} +1 -1
- package/dist/{single-page-detail-fUh22jZE.cjs → single-page-detail-52_cuxNe.cjs} +1 -1
- package/dist/{single-page-detail-UFEXRI81.js → single-page-detail-CrgTQFUX.js} +2 -2
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +1 -1
- package/dist/CanvasArea-TzIgm_vh.cjs +0 -58
- package/dist/CanvasArea-dS2B20gv.js +0 -1421
- package/dist/Settings-GJHtwQaa.cjs +0 -1
|
@@ -0,0 +1,1412 @@
|
|
|
1
|
+
var yt = Object.defineProperty;
|
|
2
|
+
var vt = (t, e, n) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var z = (t, e, n) => (vt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { j as r } from "./jsx-runtime-NV737rRe.js";
|
|
5
|
+
import Y, { createElement as xt, useCallback as xe, useState as W, useEffect as M, Component as qe, Children as bt, Suspense as Ue, useRef as Se, useMemo as kt, lazy as wt } from "react";
|
|
6
|
+
import { map as ne, includes as Ee, toUpper as de, round as jt, throttle as He, noop as G, isEmpty as U, first as re, omit as Ct, get as B, isString as be, memoize as Tt, each as St, find as Et, filter as ze, isNull as It } from "lodash";
|
|
7
|
+
import { ResetIcon as Ie, MobileIcon as De, LaptopIcon as Dt, DesktopIcon as Bt, DotsVerticalIcon as Ot, EraserIcon as At, ZoomInIcon as Rt, DragHandleDots2Icon as Pt, ArrowUpIcon as Mt, CopyIcon as _t, TrashIcon as Lt } from "@radix-ui/react-icons";
|
|
8
|
+
import { p as ke, B as se, W as Ye, aM as Nt, aN as Ft, aO as $t, aP as Wt, aQ as qt, R as we, ai as Ut, aR as Ht, aS as zt, aT as Yt, aU as Kt, aV as Vt, aW as Xt, w as Jt, j as H, aj as K, D as Zt, E as Gt, F as Qt, G as en, H as tn, I as nn, J as rn, K as sn, at as on, L as an, U as Ke, aL as te, aX as ln, ab as cn, _ as ie, aY as Q, m as Ve, n as dn, k as un, o as pn, h as Xe, l as Je, ag as fn, aZ as hn, a_ as gn, a$ as mn, x as yn, ae as Ze, a as vn, b0 as xn, b1 as bn, a6 as kn, b2 as wn, i as jn, S as Ge, aA as Cn } from "./index-ORFlyrBx.js";
|
|
9
|
+
import { useTranslation as Tn } from "react-i18next";
|
|
10
|
+
import { useAtom as F } from "jotai";
|
|
11
|
+
import Be from "react-dom";
|
|
12
|
+
import { g as Sn, S as Oe, a as Qe } from "./MODIFIERS-MLfpKQY1.js";
|
|
13
|
+
import { r as et, u as En, B as In, E as Dn } from "./index-HjvZqhVh.js";
|
|
14
|
+
import { Quill as Bn } from "react-quill";
|
|
15
|
+
import { u as On } from "./useAddBlockByDrop-UA_Iw_4l.js";
|
|
16
|
+
import { useFeature as An } from "flagged";
|
|
17
|
+
import { flip as Rn } from "@floating-ui/dom";
|
|
18
|
+
import { useFloating as Pn, shift as Mn } from "@floating-ui/react-dom";
|
|
19
|
+
import { useDrag as _n } from "react-dnd";
|
|
20
|
+
import { useResizeObserver as Ln } from "@react-hookz/web";
|
|
21
|
+
import { tailwindcssPaletteGenerator as Nn } from "@bobthered/tailwindcss-palette-generator";
|
|
22
|
+
import { Provider as Fn } from "react-wrap-balancer";
|
|
23
|
+
import { twMerge as $n } from "tailwind-merge";
|
|
24
|
+
import { getBlockComponent as Wn } from "@chaibuilder/runtime";
|
|
25
|
+
import "@radix-ui/react-toggle";
|
|
26
|
+
import "class-variance-authority";
|
|
27
|
+
import "./utils-PPBbw5bk.js";
|
|
28
|
+
import "clsx";
|
|
29
|
+
import "@radix-ui/react-switch";
|
|
30
|
+
import "@radix-ui/react-slot";
|
|
31
|
+
import "@radix-ui/react-accordion";
|
|
32
|
+
import "@radix-ui/react-alert-dialog";
|
|
33
|
+
import "@radix-ui/react-dialog";
|
|
34
|
+
import "@radix-ui/react-label";
|
|
35
|
+
import "@radix-ui/react-scroll-area";
|
|
36
|
+
import "@radix-ui/react-tabs";
|
|
37
|
+
import "@radix-ui/react-tooltip";
|
|
38
|
+
import "@radix-ui/react-popover";
|
|
39
|
+
import "@radix-ui/react-menubar";
|
|
40
|
+
import "@radix-ui/react-hover-card";
|
|
41
|
+
import "@radix-ui/react-select";
|
|
42
|
+
import "@radix-ui/react-dropdown-menu";
|
|
43
|
+
import "@radix-ui/react-separator";
|
|
44
|
+
import "@radix-ui/react-toast";
|
|
45
|
+
import "cmdk";
|
|
46
|
+
import "@radix-ui/react-context-menu";
|
|
47
|
+
import "react-icons-picker";
|
|
48
|
+
import "flat-to-nested";
|
|
49
|
+
import "redux-undo";
|
|
50
|
+
import "i18next";
|
|
51
|
+
import "react-textarea-autosize";
|
|
52
|
+
import "@minoru/react-dnd-treeview";
|
|
53
|
+
import "./lib.js";
|
|
54
|
+
import "himalaya";
|
|
55
|
+
import "./functions-JFP-oMsY.js";
|
|
56
|
+
import "@mhsdesign/jit-browser-tailwindcss";
|
|
57
|
+
import "@tailwindcss/forms";
|
|
58
|
+
import "@tailwindcss/typography";
|
|
59
|
+
import "@tailwindcss/aspect-ratio";
|
|
60
|
+
import "@tailwindcss/line-clamp";
|
|
61
|
+
import "./tailwind-config-d1VL1lzE.js";
|
|
62
|
+
import "react-hotkeys-hook";
|
|
63
|
+
import "sonner";
|
|
64
|
+
import "lucide-react";
|
|
65
|
+
const qn = () => {
|
|
66
|
+
const { undoCount: t, redoCount: e, undo: n, redo: i } = ke();
|
|
67
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
68
|
+
/* @__PURE__ */ r.jsx(se, { disabled: !t, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ie, {}) }),
|
|
69
|
+
/* @__PURE__ */ r.jsx(se, { disabled: !e, onClick: i, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ie, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
70
|
+
] });
|
|
71
|
+
};
|
|
72
|
+
function Un() {
|
|
73
|
+
const [t, e] = Ye(), { t: n } = Tn();
|
|
74
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
75
|
+
/* @__PURE__ */ r.jsx(Nt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
|
|
76
|
+
/* @__PURE__ */ r.jsxs(
|
|
77
|
+
Ft,
|
|
78
|
+
{
|
|
79
|
+
id: "dark-mode-switch",
|
|
80
|
+
checked: t,
|
|
81
|
+
onCheckedChange: () => {
|
|
82
|
+
e(!t);
|
|
83
|
+
},
|
|
84
|
+
className: `${t ? "bg-violet-600" : "bg-violet-300"}
|
|
85
|
+
relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ r.jsx("span", { className: "sr-only", children: "Use setting" }),
|
|
88
|
+
/* @__PURE__ */ r.jsx(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className: `${t ? "translate-x-5" : "translate-x-0"}
|
|
93
|
+
pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
const Ae = ({ landscape: t = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
102
|
+
"svg",
|
|
103
|
+
{
|
|
104
|
+
className: t ? "rotate-90" : "",
|
|
105
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
106
|
+
viewBox: "0 0 13 13",
|
|
107
|
+
xmlSpace: "preserve",
|
|
108
|
+
width: 13,
|
|
109
|
+
height: 13,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ r.jsx("g", { strokeWidth: 0 }),
|
|
112
|
+
/* @__PURE__ */ r.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
113
|
+
/* @__PURE__ */ r.jsx(
|
|
114
|
+
"path",
|
|
115
|
+
{
|
|
116
|
+
d: "M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",
|
|
117
|
+
style: {
|
|
118
|
+
fill: "#000"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
), Re = [
|
|
125
|
+
{
|
|
126
|
+
title: "Mobile (XS)",
|
|
127
|
+
content: "Styles set here are applied to all screen unless edited at higher breakpoint",
|
|
128
|
+
breakpoint: "xs",
|
|
129
|
+
icon: /* @__PURE__ */ r.jsx(De, {}),
|
|
130
|
+
width: 400
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: "Mobile landscape (SM)",
|
|
134
|
+
content: "Styles set here are applied at 640px and up unless edited at higher breakpoint",
|
|
135
|
+
breakpoint: "sm",
|
|
136
|
+
icon: /* @__PURE__ */ r.jsx(De, { className: "rotate-90" }),
|
|
137
|
+
width: 640
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "Tablet (MD)",
|
|
141
|
+
content: "Styles set here are applied at 768px and up",
|
|
142
|
+
breakpoint: "md",
|
|
143
|
+
icon: /* @__PURE__ */ r.jsx(Ae, {}),
|
|
144
|
+
width: 800
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: "Tablet Landscape (LG)",
|
|
148
|
+
content: "Styles set here are applied at 1024px and up unless edited at higher breakpoint",
|
|
149
|
+
breakpoint: "lg",
|
|
150
|
+
icon: /* @__PURE__ */ r.jsx(Ae, { landscape: !0 }),
|
|
151
|
+
width: 1024
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: "Desktop (XL)",
|
|
155
|
+
content: "Styles set here are applied at 1280px and up unless edited at higher breakpoint",
|
|
156
|
+
breakpoint: "xl",
|
|
157
|
+
icon: /* @__PURE__ */ r.jsx(Dt, {}),
|
|
158
|
+
width: 1420
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
title: "Large Desktop (2XL)",
|
|
162
|
+
content: "Styles set here are applied at 1536px and up",
|
|
163
|
+
breakpoint: "2xl",
|
|
164
|
+
icon: /* @__PURE__ */ r.jsx(Bt, {}),
|
|
165
|
+
width: 1920
|
|
166
|
+
}
|
|
167
|
+
], Hn = ({
|
|
168
|
+
title: t,
|
|
169
|
+
content: e,
|
|
170
|
+
currentBreakpoint: n,
|
|
171
|
+
breakpoint: i,
|
|
172
|
+
width: c,
|
|
173
|
+
icon: s,
|
|
174
|
+
onClick: a
|
|
175
|
+
}) => /* @__PURE__ */ r.jsxs($t, { children: [
|
|
176
|
+
/* @__PURE__ */ r.jsx(Wt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
177
|
+
se,
|
|
178
|
+
{
|
|
179
|
+
onClick: () => a(c),
|
|
180
|
+
size: "sm",
|
|
181
|
+
variant: i === n ? "secondary" : "ghost",
|
|
182
|
+
children: s
|
|
183
|
+
}
|
|
184
|
+
) }),
|
|
185
|
+
/* @__PURE__ */ r.jsx(qt, { 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: [
|
|
186
|
+
/* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: t }),
|
|
187
|
+
/* @__PURE__ */ r.jsx("p", { className: "text-xs", children: e })
|
|
188
|
+
] }) }) })
|
|
189
|
+
] }), zn = () => {
|
|
190
|
+
const [, t, e] = we(), [n, i] = Ut(), c = (s) => {
|
|
191
|
+
n.includes(s) ? n.length > 2 && i(n.filter((a) => a !== s)) : i((a) => [...a, s]);
|
|
192
|
+
};
|
|
193
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
194
|
+
ne(
|
|
195
|
+
Re.filter((s) => Ee(n, de(s.breakpoint))),
|
|
196
|
+
(s) => /* @__PURE__ */ xt(Hn, { ...s, onClick: e, key: s.breakpoint, currentBreakpoint: t })
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ r.jsxs(Ht, { children: [
|
|
199
|
+
/* @__PURE__ */ r.jsx(zt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ot, { className: "scale-90 transform" }) }) }),
|
|
200
|
+
/* @__PURE__ */ r.jsxs(Yt, { className: "w-56 border-border text-xs", children: [
|
|
201
|
+
/* @__PURE__ */ r.jsx(Kt, { children: "Breakpoints" }),
|
|
202
|
+
/* @__PURE__ */ r.jsx(Vt, {}),
|
|
203
|
+
ne(Re, (s) => /* @__PURE__ */ r.jsx(
|
|
204
|
+
Xt,
|
|
205
|
+
{
|
|
206
|
+
disabled: s.breakpoint === "xs",
|
|
207
|
+
onCheckedChange: () => c(de(s.breakpoint)),
|
|
208
|
+
checked: Ee(n, de(s.breakpoint)),
|
|
209
|
+
children: s.title
|
|
210
|
+
},
|
|
211
|
+
s.breakpoint
|
|
212
|
+
))
|
|
213
|
+
] })
|
|
214
|
+
] })
|
|
215
|
+
] });
|
|
216
|
+
}, Yn = () => {
|
|
217
|
+
const [t] = Jt(), { createSnapshot: e } = ke(), [, n] = H(), [, i] = K(), c = xe(() => {
|
|
218
|
+
t([]), n([]), i([]), e();
|
|
219
|
+
}, [t, e]);
|
|
220
|
+
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(Zt, { children: [
|
|
221
|
+
/* @__PURE__ */ r.jsx(Gt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(se, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
222
|
+
/* @__PURE__ */ r.jsx(At, {}),
|
|
223
|
+
" Clear"
|
|
224
|
+
] }) }),
|
|
225
|
+
/* @__PURE__ */ r.jsxs(Qt, { className: "border-border", children: [
|
|
226
|
+
/* @__PURE__ */ r.jsxs(en, { children: [
|
|
227
|
+
/* @__PURE__ */ r.jsx(tn, { children: "Clear whole canvas?" }),
|
|
228
|
+
/* @__PURE__ */ r.jsx(nn, { children: "Are you sure you want to clear the whole canvas?" })
|
|
229
|
+
] }),
|
|
230
|
+
/* @__PURE__ */ r.jsxs(rn, { children: [
|
|
231
|
+
/* @__PURE__ */ r.jsx(sn, { children: "Cancel" }),
|
|
232
|
+
/* @__PURE__ */ r.jsx(on, { onClick: c, children: "Yes" })
|
|
233
|
+
] })
|
|
234
|
+
] })
|
|
235
|
+
] }) });
|
|
236
|
+
}, Kn = () => {
|
|
237
|
+
const t = an("darkMode", !1), [e] = Ke();
|
|
238
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
239
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
240
|
+
t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
241
|
+
/* @__PURE__ */ r.jsx(Un, {}),
|
|
242
|
+
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" })
|
|
243
|
+
] }) : null,
|
|
244
|
+
/* @__PURE__ */ r.jsx(zn, {}),
|
|
245
|
+
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" }),
|
|
246
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
|
|
247
|
+
/* @__PURE__ */ r.jsx(Rt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
248
|
+
" ",
|
|
249
|
+
/* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
|
|
250
|
+
jt(e, 0),
|
|
251
|
+
"%"
|
|
252
|
+
] })
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" }),
|
|
255
|
+
/* @__PURE__ */ r.jsx(qn, {})
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
258
|
+
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" }),
|
|
259
|
+
/* @__PURE__ */ r.jsx(Yn, {})
|
|
260
|
+
] })
|
|
261
|
+
] });
|
|
262
|
+
}, Vn = `<!doctype html>
|
|
263
|
+
<html class="scroll-smooth h-full overflow-y-auto">
|
|
264
|
+
<head>
|
|
265
|
+
<meta charset="UTF-8">
|
|
266
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
267
|
+
<script src="https://old.chaibuilder.com/offline/tailwind.cdn.js"><\/script>
|
|
268
|
+
<style>
|
|
269
|
+
html { height: 100%; overflow:auto; }
|
|
270
|
+
body { height: 100%; }
|
|
271
|
+
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
272
|
+
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
273
|
+
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
274
|
+
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
275
|
+
html{
|
|
276
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
277
|
+
scrollbar-width: none; /* Firefox */
|
|
278
|
+
}
|
|
279
|
+
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
280
|
+
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
281
|
+
|
|
282
|
+
html::-webkit-scrollbar { width: 0 !important }
|
|
283
|
+
.aspect-auto{aspect-ratio: auto;}
|
|
284
|
+
.aspect-square{aspect-ratio: 1/1;}
|
|
285
|
+
.aspect-video{aspect-ratio: 16/9;}
|
|
286
|
+
.dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
|
|
287
|
+
.dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
|
|
288
|
+
a{ pointer-events: none !important; }
|
|
289
|
+
[contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
|
|
290
|
+
[contenteditable="true"] {
|
|
291
|
+
outline: none;
|
|
292
|
+
box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
|
|
293
|
+
-webkit-user-select: text;
|
|
294
|
+
-moz-user-select: text;
|
|
295
|
+
user-select: text;
|
|
296
|
+
}
|
|
297
|
+
</style>
|
|
298
|
+
<style id="hidden-blocks"></style>
|
|
299
|
+
<style id="selected-block"></style>
|
|
300
|
+
<style id="selected-styling-block"></style>
|
|
301
|
+
<style id="highlighted-block"></style>
|
|
302
|
+
|
|
303
|
+
</head>
|
|
304
|
+
<body class="font-body antialiased h-full">
|
|
305
|
+
<div class="frame-root"></div>
|
|
306
|
+
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
307
|
+
</body>
|
|
308
|
+
</html>`, Xn = (t) => {
|
|
309
|
+
const [e] = we(), [, n] = Ke(), [i, c] = W({}), s = xe(() => {
|
|
310
|
+
const { width: a, height: l } = t;
|
|
311
|
+
if (a < e) {
|
|
312
|
+
const f = parseFloat((a / e).toString());
|
|
313
|
+
let u = {};
|
|
314
|
+
l && (u = { height: l + 2 * l * (1 - f) }), c({
|
|
315
|
+
transform: `scale(${f})`,
|
|
316
|
+
transformOrigin: "top left",
|
|
317
|
+
...u,
|
|
318
|
+
maxWidth: "none"
|
|
319
|
+
}), n(f * 100);
|
|
320
|
+
} else
|
|
321
|
+
c({}), n(100);
|
|
322
|
+
}, [e, t, n]);
|
|
323
|
+
return M(() => {
|
|
324
|
+
s();
|
|
325
|
+
}, [e, t, n, s]), i;
|
|
326
|
+
};
|
|
327
|
+
var oe = { exports: {} };
|
|
328
|
+
/*
|
|
329
|
+
object-assign
|
|
330
|
+
(c) Sindre Sorhus
|
|
331
|
+
@license MIT
|
|
332
|
+
*/
|
|
333
|
+
var ue, Pe;
|
|
334
|
+
function Jn() {
|
|
335
|
+
if (Pe)
|
|
336
|
+
return ue;
|
|
337
|
+
Pe = 1;
|
|
338
|
+
var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
339
|
+
function i(s) {
|
|
340
|
+
if (s == null)
|
|
341
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
342
|
+
return Object(s);
|
|
343
|
+
}
|
|
344
|
+
function c() {
|
|
345
|
+
try {
|
|
346
|
+
if (!Object.assign)
|
|
347
|
+
return !1;
|
|
348
|
+
var s = new String("abc");
|
|
349
|
+
if (s[5] = "de", Object.getOwnPropertyNames(s)[0] === "5")
|
|
350
|
+
return !1;
|
|
351
|
+
for (var a = {}, l = 0; l < 10; l++)
|
|
352
|
+
a["_" + String.fromCharCode(l)] = l;
|
|
353
|
+
var f = Object.getOwnPropertyNames(a).map(function(h) {
|
|
354
|
+
return a[h];
|
|
355
|
+
});
|
|
356
|
+
if (f.join("") !== "0123456789")
|
|
357
|
+
return !1;
|
|
358
|
+
var u = {};
|
|
359
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(h) {
|
|
360
|
+
u[h] = h;
|
|
361
|
+
}), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst";
|
|
362
|
+
} catch {
|
|
363
|
+
return !1;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return ue = c() ? Object.assign : function(s, a) {
|
|
367
|
+
for (var l, f = i(s), u, h = 1; h < arguments.length; h++) {
|
|
368
|
+
l = Object(arguments[h]);
|
|
369
|
+
for (var p in l)
|
|
370
|
+
e.call(l, p) && (f[p] = l[p]);
|
|
371
|
+
if (t) {
|
|
372
|
+
u = t(l);
|
|
373
|
+
for (var v = 0; v < u.length; v++)
|
|
374
|
+
n.call(l, u[v]) && (f[u[v]] = l[u[v]]);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return f;
|
|
378
|
+
}, ue;
|
|
379
|
+
}
|
|
380
|
+
var pe, Me;
|
|
381
|
+
function je() {
|
|
382
|
+
if (Me)
|
|
383
|
+
return pe;
|
|
384
|
+
Me = 1;
|
|
385
|
+
var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
386
|
+
return pe = t, pe;
|
|
387
|
+
}
|
|
388
|
+
var fe, _e;
|
|
389
|
+
function tt() {
|
|
390
|
+
return _e || (_e = 1, fe = Function.call.bind(Object.prototype.hasOwnProperty)), fe;
|
|
391
|
+
}
|
|
392
|
+
var he, Le;
|
|
393
|
+
function Zn() {
|
|
394
|
+
if (Le)
|
|
395
|
+
return he;
|
|
396
|
+
Le = 1;
|
|
397
|
+
var t = function() {
|
|
398
|
+
};
|
|
399
|
+
if (process.env.NODE_ENV !== "production") {
|
|
400
|
+
var e = je(), n = {}, i = tt();
|
|
401
|
+
t = function(s) {
|
|
402
|
+
var a = "Warning: " + s;
|
|
403
|
+
typeof console < "u" && console.error(a);
|
|
404
|
+
try {
|
|
405
|
+
throw new Error(a);
|
|
406
|
+
} catch {
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function c(s, a, l, f, u) {
|
|
411
|
+
if (process.env.NODE_ENV !== "production") {
|
|
412
|
+
for (var h in s)
|
|
413
|
+
if (i(s, h)) {
|
|
414
|
+
var p;
|
|
415
|
+
try {
|
|
416
|
+
if (typeof s[h] != "function") {
|
|
417
|
+
var v = Error(
|
|
418
|
+
(f || "React class") + ": " + l + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
419
|
+
);
|
|
420
|
+
throw v.name = "Invariant Violation", v;
|
|
421
|
+
}
|
|
422
|
+
p = s[h](a, h, f, l, null, e);
|
|
423
|
+
} catch (R) {
|
|
424
|
+
p = R;
|
|
425
|
+
}
|
|
426
|
+
if (p && !(p instanceof Error) && t(
|
|
427
|
+
(f || "React class") + ": type specification of " + l + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof p + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
428
|
+
), p instanceof Error && !(p.message in n)) {
|
|
429
|
+
n[p.message] = !0;
|
|
430
|
+
var w = u ? u() : "";
|
|
431
|
+
t(
|
|
432
|
+
"Failed " + l + " type: " + p.message + (w ?? "")
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return c.resetWarningCache = function() {
|
|
439
|
+
process.env.NODE_ENV !== "production" && (n = {});
|
|
440
|
+
}, he = c, he;
|
|
441
|
+
}
|
|
442
|
+
var ge, Ne;
|
|
443
|
+
function Gn() {
|
|
444
|
+
if (Ne)
|
|
445
|
+
return ge;
|
|
446
|
+
Ne = 1;
|
|
447
|
+
var t = et, e = Jn(), n = je(), i = tt(), c = Zn(), s = function() {
|
|
448
|
+
};
|
|
449
|
+
process.env.NODE_ENV !== "production" && (s = function(l) {
|
|
450
|
+
var f = "Warning: " + l;
|
|
451
|
+
typeof console < "u" && console.error(f);
|
|
452
|
+
try {
|
|
453
|
+
throw new Error(f);
|
|
454
|
+
} catch {
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
function a() {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
return ge = function(l, f) {
|
|
461
|
+
var u = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
|
|
462
|
+
function p(o) {
|
|
463
|
+
var d = o && (u && o[u] || o[h]);
|
|
464
|
+
if (typeof d == "function")
|
|
465
|
+
return d;
|
|
466
|
+
}
|
|
467
|
+
var v = "<<anonymous>>", w = {
|
|
468
|
+
array: m("array"),
|
|
469
|
+
bigint: m("bigint"),
|
|
470
|
+
bool: m("boolean"),
|
|
471
|
+
func: m("function"),
|
|
472
|
+
number: m("number"),
|
|
473
|
+
object: m("object"),
|
|
474
|
+
string: m("string"),
|
|
475
|
+
symbol: m("symbol"),
|
|
476
|
+
any: V(),
|
|
477
|
+
arrayOf: _,
|
|
478
|
+
element: le(),
|
|
479
|
+
elementType: ce(),
|
|
480
|
+
instanceOf: D,
|
|
481
|
+
node: ut(),
|
|
482
|
+
objectOf: N,
|
|
483
|
+
oneOf: L,
|
|
484
|
+
oneOfType: dt,
|
|
485
|
+
shape: pt,
|
|
486
|
+
exact: ft
|
|
487
|
+
};
|
|
488
|
+
function R(o, d) {
|
|
489
|
+
return o === d ? o !== 0 || 1 / o === 1 / d : o !== o && d !== d;
|
|
490
|
+
}
|
|
491
|
+
function j(o, d) {
|
|
492
|
+
this.message = o, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
|
|
493
|
+
}
|
|
494
|
+
j.prototype = Error.prototype;
|
|
495
|
+
function I(o) {
|
|
496
|
+
if (process.env.NODE_ENV !== "production")
|
|
497
|
+
var d = {}, k = 0;
|
|
498
|
+
function x(C, y, b, T, E, S, P) {
|
|
499
|
+
if (T = T || v, S = S || b, P !== n) {
|
|
500
|
+
if (f) {
|
|
501
|
+
var O = new Error(
|
|
502
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
503
|
+
);
|
|
504
|
+
throw O.name = "Invariant Violation", O;
|
|
505
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
506
|
+
var X = T + ":" + b;
|
|
507
|
+
!d[X] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
508
|
+
k < 3 && (s(
|
|
509
|
+
"You are manually calling a React.PropTypes validation function for the `" + S + "` 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."
|
|
510
|
+
), d[X] = !0, k++);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return y[b] == null ? C ? y[b] === null ? new j("The " + E + " `" + S + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new j("The " + E + " `" + S + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : o(y, b, T, E, S);
|
|
514
|
+
}
|
|
515
|
+
var g = x.bind(null, !1);
|
|
516
|
+
return g.isRequired = x.bind(null, !0), g;
|
|
517
|
+
}
|
|
518
|
+
function m(o) {
|
|
519
|
+
function d(k, x, g, C, y, b) {
|
|
520
|
+
var T = k[x], E = $(T);
|
|
521
|
+
if (E !== o) {
|
|
522
|
+
var S = Z(T);
|
|
523
|
+
return new j(
|
|
524
|
+
"Invalid " + C + " `" + y + "` of type " + ("`" + S + "` supplied to `" + g + "`, expected ") + ("`" + o + "`."),
|
|
525
|
+
{ expectedType: o }
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
return I(d);
|
|
531
|
+
}
|
|
532
|
+
function V() {
|
|
533
|
+
return I(a);
|
|
534
|
+
}
|
|
535
|
+
function _(o) {
|
|
536
|
+
function d(k, x, g, C, y) {
|
|
537
|
+
if (typeof o != "function")
|
|
538
|
+
return new j("Property `" + y + "` of component `" + g + "` has invalid PropType notation inside arrayOf.");
|
|
539
|
+
var b = k[x];
|
|
540
|
+
if (!Array.isArray(b)) {
|
|
541
|
+
var T = $(b);
|
|
542
|
+
return new j("Invalid " + C + " `" + y + "` of type " + ("`" + T + "` supplied to `" + g + "`, expected an array."));
|
|
543
|
+
}
|
|
544
|
+
for (var E = 0; E < b.length; E++) {
|
|
545
|
+
var S = o(b, E, g, C, y + "[" + E + "]", n);
|
|
546
|
+
if (S instanceof Error)
|
|
547
|
+
return S;
|
|
548
|
+
}
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
return I(d);
|
|
552
|
+
}
|
|
553
|
+
function le() {
|
|
554
|
+
function o(d, k, x, g, C) {
|
|
555
|
+
var y = d[k];
|
|
556
|
+
if (!l(y)) {
|
|
557
|
+
var b = $(y);
|
|
558
|
+
return new j("Invalid " + g + " `" + C + "` of type " + ("`" + b + "` supplied to `" + x + "`, expected a single ReactElement."));
|
|
559
|
+
}
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
return I(o);
|
|
563
|
+
}
|
|
564
|
+
function ce() {
|
|
565
|
+
function o(d, k, x, g, C) {
|
|
566
|
+
var y = d[k];
|
|
567
|
+
if (!t.isValidElementType(y)) {
|
|
568
|
+
var b = $(y);
|
|
569
|
+
return new j("Invalid " + g + " `" + C + "` of type " + ("`" + b + "` supplied to `" + x + "`, expected a single ReactElement type."));
|
|
570
|
+
}
|
|
571
|
+
return null;
|
|
572
|
+
}
|
|
573
|
+
return I(o);
|
|
574
|
+
}
|
|
575
|
+
function D(o) {
|
|
576
|
+
function d(k, x, g, C, y) {
|
|
577
|
+
if (!(k[x] instanceof o)) {
|
|
578
|
+
var b = o.name || v, T = mt(k[x]);
|
|
579
|
+
return new j("Invalid " + C + " `" + y + "` of type " + ("`" + T + "` supplied to `" + g + "`, expected ") + ("instance of `" + b + "`."));
|
|
580
|
+
}
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
return I(d);
|
|
584
|
+
}
|
|
585
|
+
function L(o) {
|
|
586
|
+
if (!Array.isArray(o))
|
|
587
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
|
|
588
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
589
|
+
) : s("Invalid argument supplied to oneOf, expected an array.")), a;
|
|
590
|
+
function d(k, x, g, C, y) {
|
|
591
|
+
for (var b = k[x], T = 0; T < o.length; T++)
|
|
592
|
+
if (R(b, o[T]))
|
|
593
|
+
return null;
|
|
594
|
+
var E = JSON.stringify(o, function(P, O) {
|
|
595
|
+
var X = Z(O);
|
|
596
|
+
return X === "symbol" ? String(O) : O;
|
|
597
|
+
});
|
|
598
|
+
return new j("Invalid " + C + " `" + y + "` of value `" + String(b) + "` " + ("supplied to `" + g + "`, expected one of " + E + "."));
|
|
599
|
+
}
|
|
600
|
+
return I(d);
|
|
601
|
+
}
|
|
602
|
+
function N(o) {
|
|
603
|
+
function d(k, x, g, C, y) {
|
|
604
|
+
if (typeof o != "function")
|
|
605
|
+
return new j("Property `" + y + "` of component `" + g + "` has invalid PropType notation inside objectOf.");
|
|
606
|
+
var b = k[x], T = $(b);
|
|
607
|
+
if (T !== "object")
|
|
608
|
+
return new j("Invalid " + C + " `" + y + "` of type " + ("`" + T + "` supplied to `" + g + "`, expected an object."));
|
|
609
|
+
for (var E in b)
|
|
610
|
+
if (i(b, E)) {
|
|
611
|
+
var S = o(b, E, g, C, y + "." + E, n);
|
|
612
|
+
if (S instanceof Error)
|
|
613
|
+
return S;
|
|
614
|
+
}
|
|
615
|
+
return null;
|
|
616
|
+
}
|
|
617
|
+
return I(d);
|
|
618
|
+
}
|
|
619
|
+
function dt(o) {
|
|
620
|
+
if (!Array.isArray(o))
|
|
621
|
+
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), a;
|
|
622
|
+
for (var d = 0; d < o.length; d++) {
|
|
623
|
+
var k = o[d];
|
|
624
|
+
if (typeof k != "function")
|
|
625
|
+
return s(
|
|
626
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + gt(k) + " at index " + d + "."
|
|
627
|
+
), a;
|
|
628
|
+
}
|
|
629
|
+
function x(g, C, y, b, T) {
|
|
630
|
+
for (var E = [], S = 0; S < o.length; S++) {
|
|
631
|
+
var P = o[S], O = P(g, C, y, b, T, n);
|
|
632
|
+
if (O == null)
|
|
633
|
+
return null;
|
|
634
|
+
O.data && i(O.data, "expectedType") && E.push(O.data.expectedType);
|
|
635
|
+
}
|
|
636
|
+
var X = E.length > 0 ? ", expected one of type [" + E.join(", ") + "]" : "";
|
|
637
|
+
return new j("Invalid " + b + " `" + T + "` supplied to " + ("`" + y + "`" + X + "."));
|
|
638
|
+
}
|
|
639
|
+
return I(x);
|
|
640
|
+
}
|
|
641
|
+
function ut() {
|
|
642
|
+
function o(d, k, x, g, C) {
|
|
643
|
+
return ee(d[k]) ? null : new j("Invalid " + g + " `" + C + "` supplied to " + ("`" + x + "`, expected a ReactNode."));
|
|
644
|
+
}
|
|
645
|
+
return I(o);
|
|
646
|
+
}
|
|
647
|
+
function Te(o, d, k, x, g) {
|
|
648
|
+
return new j(
|
|
649
|
+
(o || "React class") + ": " + d + " type `" + k + "." + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + g + "`."
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
function pt(o) {
|
|
653
|
+
function d(k, x, g, C, y) {
|
|
654
|
+
var b = k[x], T = $(b);
|
|
655
|
+
if (T !== "object")
|
|
656
|
+
return new j("Invalid " + C + " `" + y + "` of type `" + T + "` " + ("supplied to `" + g + "`, expected `object`."));
|
|
657
|
+
for (var E in o) {
|
|
658
|
+
var S = o[E];
|
|
659
|
+
if (typeof S != "function")
|
|
660
|
+
return Te(g, C, y, E, Z(S));
|
|
661
|
+
var P = S(b, E, g, C, y + "." + E, n);
|
|
662
|
+
if (P)
|
|
663
|
+
return P;
|
|
664
|
+
}
|
|
665
|
+
return null;
|
|
666
|
+
}
|
|
667
|
+
return I(d);
|
|
668
|
+
}
|
|
669
|
+
function ft(o) {
|
|
670
|
+
function d(k, x, g, C, y) {
|
|
671
|
+
var b = k[x], T = $(b);
|
|
672
|
+
if (T !== "object")
|
|
673
|
+
return new j("Invalid " + C + " `" + y + "` of type `" + T + "` " + ("supplied to `" + g + "`, expected `object`."));
|
|
674
|
+
var E = e({}, k[x], o);
|
|
675
|
+
for (var S in E) {
|
|
676
|
+
var P = o[S];
|
|
677
|
+
if (i(o, S) && typeof P != "function")
|
|
678
|
+
return Te(g, C, y, S, Z(P));
|
|
679
|
+
if (!P)
|
|
680
|
+
return new j(
|
|
681
|
+
"Invalid " + C + " `" + y + "` key `" + S + "` supplied to `" + g + "`.\nBad object: " + JSON.stringify(k[x], null, " ") + `
|
|
682
|
+
Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
|
|
683
|
+
);
|
|
684
|
+
var O = P(b, S, g, C, y + "." + S, n);
|
|
685
|
+
if (O)
|
|
686
|
+
return O;
|
|
687
|
+
}
|
|
688
|
+
return null;
|
|
689
|
+
}
|
|
690
|
+
return I(d);
|
|
691
|
+
}
|
|
692
|
+
function ee(o) {
|
|
693
|
+
switch (typeof o) {
|
|
694
|
+
case "number":
|
|
695
|
+
case "string":
|
|
696
|
+
case "undefined":
|
|
697
|
+
return !0;
|
|
698
|
+
case "boolean":
|
|
699
|
+
return !o;
|
|
700
|
+
case "object":
|
|
701
|
+
if (Array.isArray(o))
|
|
702
|
+
return o.every(ee);
|
|
703
|
+
if (o === null || l(o))
|
|
704
|
+
return !0;
|
|
705
|
+
var d = p(o);
|
|
706
|
+
if (d) {
|
|
707
|
+
var k = d.call(o), x;
|
|
708
|
+
if (d !== o.entries) {
|
|
709
|
+
for (; !(x = k.next()).done; )
|
|
710
|
+
if (!ee(x.value))
|
|
711
|
+
return !1;
|
|
712
|
+
} else
|
|
713
|
+
for (; !(x = k.next()).done; ) {
|
|
714
|
+
var g = x.value;
|
|
715
|
+
if (g && !ee(g[1]))
|
|
716
|
+
return !1;
|
|
717
|
+
}
|
|
718
|
+
} else
|
|
719
|
+
return !1;
|
|
720
|
+
return !0;
|
|
721
|
+
default:
|
|
722
|
+
return !1;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
function ht(o, d) {
|
|
726
|
+
return o === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
|
|
727
|
+
}
|
|
728
|
+
function $(o) {
|
|
729
|
+
var d = typeof o;
|
|
730
|
+
return Array.isArray(o) ? "array" : o instanceof RegExp ? "object" : ht(d, o) ? "symbol" : d;
|
|
731
|
+
}
|
|
732
|
+
function Z(o) {
|
|
733
|
+
if (typeof o > "u" || o === null)
|
|
734
|
+
return "" + o;
|
|
735
|
+
var d = $(o);
|
|
736
|
+
if (d === "object") {
|
|
737
|
+
if (o instanceof Date)
|
|
738
|
+
return "date";
|
|
739
|
+
if (o instanceof RegExp)
|
|
740
|
+
return "regexp";
|
|
741
|
+
}
|
|
742
|
+
return d;
|
|
743
|
+
}
|
|
744
|
+
function gt(o) {
|
|
745
|
+
var d = Z(o);
|
|
746
|
+
switch (d) {
|
|
747
|
+
case "array":
|
|
748
|
+
case "object":
|
|
749
|
+
return "an " + d;
|
|
750
|
+
case "boolean":
|
|
751
|
+
case "date":
|
|
752
|
+
case "regexp":
|
|
753
|
+
return "a " + d;
|
|
754
|
+
default:
|
|
755
|
+
return d;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
function mt(o) {
|
|
759
|
+
return !o.constructor || !o.constructor.name ? v : o.constructor.name;
|
|
760
|
+
}
|
|
761
|
+
return w.checkPropTypes = c, w.resetWarningCache = c.resetWarningCache, w.PropTypes = w, w;
|
|
762
|
+
}, ge;
|
|
763
|
+
}
|
|
764
|
+
var me, Fe;
|
|
765
|
+
function Qn() {
|
|
766
|
+
if (Fe)
|
|
767
|
+
return me;
|
|
768
|
+
Fe = 1;
|
|
769
|
+
var t = je();
|
|
770
|
+
function e() {
|
|
771
|
+
}
|
|
772
|
+
function n() {
|
|
773
|
+
}
|
|
774
|
+
return n.resetWarningCache = e, me = function() {
|
|
775
|
+
function i(a, l, f, u, h, p) {
|
|
776
|
+
if (p !== t) {
|
|
777
|
+
var v = new Error(
|
|
778
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
779
|
+
);
|
|
780
|
+
throw v.name = "Invariant Violation", v;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
i.isRequired = i;
|
|
784
|
+
function c() {
|
|
785
|
+
return i;
|
|
786
|
+
}
|
|
787
|
+
var s = {
|
|
788
|
+
array: i,
|
|
789
|
+
bigint: i,
|
|
790
|
+
bool: i,
|
|
791
|
+
func: i,
|
|
792
|
+
number: i,
|
|
793
|
+
object: i,
|
|
794
|
+
string: i,
|
|
795
|
+
symbol: i,
|
|
796
|
+
any: i,
|
|
797
|
+
arrayOf: c,
|
|
798
|
+
element: i,
|
|
799
|
+
elementType: i,
|
|
800
|
+
instanceOf: c,
|
|
801
|
+
node: i,
|
|
802
|
+
objectOf: c,
|
|
803
|
+
oneOf: c,
|
|
804
|
+
oneOfType: c,
|
|
805
|
+
shape: c,
|
|
806
|
+
exact: c,
|
|
807
|
+
checkPropTypes: n,
|
|
808
|
+
resetWarningCache: e
|
|
809
|
+
};
|
|
810
|
+
return s.PropTypes = s, s;
|
|
811
|
+
}, me;
|
|
812
|
+
}
|
|
813
|
+
var _s = oe.exports;
|
|
814
|
+
if (process.env.NODE_ENV !== "production") {
|
|
815
|
+
var er = et, tr = !0;
|
|
816
|
+
oe.exports = Gn()(er.isElement, tr);
|
|
817
|
+
} else
|
|
818
|
+
oe.exports = Qn()();
|
|
819
|
+
var nr = oe.exports;
|
|
820
|
+
const A = /* @__PURE__ */ Sn(nr);
|
|
821
|
+
let nt, rt;
|
|
822
|
+
typeof document < "u" && (nt = document);
|
|
823
|
+
typeof window < "u" && (rt = window);
|
|
824
|
+
const st = Y.createContext({ document: nt, window: rt }), ae = () => Y.useContext(st), { Provider: rr, Consumer: Ls } = st;
|
|
825
|
+
class ot extends qe {
|
|
826
|
+
componentDidMount() {
|
|
827
|
+
this.props.contentDidMount();
|
|
828
|
+
}
|
|
829
|
+
componentDidUpdate() {
|
|
830
|
+
this.props.contentDidUpdate();
|
|
831
|
+
}
|
|
832
|
+
render() {
|
|
833
|
+
return bt.only(this.props.children);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
z(ot, "propTypes", {
|
|
837
|
+
children: A.element.isRequired,
|
|
838
|
+
contentDidMount: A.func.isRequired,
|
|
839
|
+
contentDidUpdate: A.func.isRequired
|
|
840
|
+
});
|
|
841
|
+
class ye extends qe {
|
|
842
|
+
constructor(n, i) {
|
|
843
|
+
super(n, i);
|
|
844
|
+
z(this, "setRef", (n) => {
|
|
845
|
+
this.nodeRef.current = n;
|
|
846
|
+
const { forwardedRef: i } = this.props;
|
|
847
|
+
typeof i == "function" ? i(n) : i && (i.current = n);
|
|
848
|
+
});
|
|
849
|
+
z(this, "handleLoad", () => {
|
|
850
|
+
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
851
|
+
});
|
|
852
|
+
// In certain situations on a cold cache DOMContentLoaded never gets called
|
|
853
|
+
// fallback to an interval to check if that's the case
|
|
854
|
+
z(this, "loadCheck", () => setInterval(() => {
|
|
855
|
+
this.handleLoad();
|
|
856
|
+
}, 500));
|
|
857
|
+
this._isMounted = !1, this.nodeRef = Y.createRef(), this.state = { iframeLoaded: !1 };
|
|
858
|
+
}
|
|
859
|
+
componentDidMount() {
|
|
860
|
+
this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
|
|
861
|
+
}
|
|
862
|
+
componentWillUnmount() {
|
|
863
|
+
this._isMounted = !1, this.nodeRef.current.removeEventListener("DOMContentLoaded", this.handleLoad);
|
|
864
|
+
}
|
|
865
|
+
getDoc() {
|
|
866
|
+
return this.nodeRef.current ? this.nodeRef.current.contentDocument : null;
|
|
867
|
+
}
|
|
868
|
+
getMountTarget() {
|
|
869
|
+
const n = this.getDoc();
|
|
870
|
+
return this.props.mountTarget ? n.querySelector(this.props.mountTarget) : n.body.children[0];
|
|
871
|
+
}
|
|
872
|
+
renderFrameContents() {
|
|
873
|
+
if (!this._isMounted)
|
|
874
|
+
return null;
|
|
875
|
+
const n = this.getDoc();
|
|
876
|
+
if (!n)
|
|
877
|
+
return null;
|
|
878
|
+
const i = this.props.contentDidMount, c = this.props.contentDidUpdate, s = n.defaultView || n.parentView, a = /* @__PURE__ */ r.jsx(ot, { contentDidMount: i, contentDidUpdate: c, children: /* @__PURE__ */ r.jsx(rr, { value: { document: n, window: s }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), l = this.getMountTarget();
|
|
879
|
+
return [Be.createPortal(this.props.head, this.getDoc().head), Be.createPortal(a, l)];
|
|
880
|
+
}
|
|
881
|
+
render() {
|
|
882
|
+
const n = {
|
|
883
|
+
...this.props,
|
|
884
|
+
srcDoc: this.props.initialContent,
|
|
885
|
+
children: void 0
|
|
886
|
+
// The iframe isn't ready so we drop children from props here. #12, #17
|
|
887
|
+
};
|
|
888
|
+
return delete n.head, delete n.initialContent, delete n.mountTarget, delete n.contentDidMount, delete n.contentDidUpdate, delete n.forwardedRef, /* @__PURE__ */ r.jsx("iframe", { ...n, ref: this.setRef, onLoad: this.handleLoad, children: this.state.iframeLoaded && this.renderFrameContents() });
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
// React warns when you render directly into the body since browser extensions
|
|
892
|
+
// also inject into the body and can mess up React. For this reason
|
|
893
|
+
// initialContent is expected to have a div inside of the body
|
|
894
|
+
// element that we render react into.
|
|
895
|
+
z(ye, "propTypes", {
|
|
896
|
+
style: A.object,
|
|
897
|
+
// eslint-disable-line
|
|
898
|
+
head: A.node,
|
|
899
|
+
initialContent: A.string,
|
|
900
|
+
mountTarget: A.string,
|
|
901
|
+
contentDidMount: A.func,
|
|
902
|
+
contentDidUpdate: A.func,
|
|
903
|
+
children: A.oneOfType([A.element, A.arrayOf(A.element)])
|
|
904
|
+
}), z(ye, "defaultProps", {
|
|
905
|
+
style: {},
|
|
906
|
+
head: null,
|
|
907
|
+
children: void 0,
|
|
908
|
+
mountTarget: void 0,
|
|
909
|
+
contentDidMount: () => {
|
|
910
|
+
},
|
|
911
|
+
contentDidUpdate: () => {
|
|
912
|
+
},
|
|
913
|
+
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
|
|
914
|
+
});
|
|
915
|
+
const sr = Y.forwardRef((t, e) => /* @__PURE__ */ r.jsx(ye, { ...t, forwardedRef: e }));
|
|
916
|
+
let q = null, J = [], it = null;
|
|
917
|
+
function at(t) {
|
|
918
|
+
const e = window.getComputedStyle(t), n = parseInt(e.paddingLeft, 10), i = parseInt(e.paddingTop, 10), c = parseInt(e.paddingRight, 10), s = parseInt(e.paddingBottom, 10);
|
|
919
|
+
return { paddingLeft: n, paddingTop: i, paddingRight: c, paddingBottom: s };
|
|
920
|
+
}
|
|
921
|
+
const $e = (t, e, n) => {
|
|
922
|
+
if (!q)
|
|
923
|
+
return;
|
|
924
|
+
const i = t.getBoundingClientRect(), c = q == null ? void 0 : q.getElementById("placeholder"), { paddingLeft: s, paddingTop: a, paddingRight: l, paddingBottom: f } = at(t);
|
|
925
|
+
c.style.width = e === "vertical" ? i.width - s - l + "px" : "2px", c.style.height = e === "vertical" ? "5px" : i.height - a - f + "px", c.style.display = "block";
|
|
926
|
+
const u = J.reduce(
|
|
927
|
+
(h, p) => Math.abs(p - n) < Math.abs(h - n) ? p : h
|
|
928
|
+
);
|
|
929
|
+
it = J.indexOf(u), c.style.top = t.offsetTop + (e === "vertical" ? u : 0) + "px", c.style.left = t.offsetLeft + (e === "horizontal" ? u : 0) + "px";
|
|
930
|
+
}, or = (t) => {
|
|
931
|
+
const e = lt(t), n = t.getBoundingClientRect(), i = Array.from(t.children);
|
|
932
|
+
i.filter((a) => a.getAttribute("data-dnd") !== "ignore");
|
|
933
|
+
const { paddingLeft: c, paddingTop: s } = at(t);
|
|
934
|
+
J = [e === "vertical" ? c : s], J = [
|
|
935
|
+
...J,
|
|
936
|
+
...i.map((a) => {
|
|
937
|
+
const l = a.getBoundingClientRect();
|
|
938
|
+
return e === "vertical" ? l.top - n.top + l.height : l.left - n.left + l.width;
|
|
939
|
+
})
|
|
940
|
+
];
|
|
941
|
+
};
|
|
942
|
+
function lt(t) {
|
|
943
|
+
const e = window.getComputedStyle(t).display, n = e === "block" ? "vertical" : "horizontal";
|
|
944
|
+
return e === "flex" && t.style.flexDirection === "column" ? "vertical" : n;
|
|
945
|
+
}
|
|
946
|
+
const ir = He((t) => {
|
|
947
|
+
const e = t.target, n = lt(e);
|
|
948
|
+
if (n === "vertical") {
|
|
949
|
+
const i = t.clientY - e.offsetTop;
|
|
950
|
+
$e(e, n, i);
|
|
951
|
+
} else {
|
|
952
|
+
const i = t.clientX - e.offsetLeft;
|
|
953
|
+
$e(e, n, i);
|
|
954
|
+
}
|
|
955
|
+
}, 200), ar = (t) => {
|
|
956
|
+
t.preventDefault(), t.stopPropagation(), ir(t);
|
|
957
|
+
};
|
|
958
|
+
function We() {
|
|
959
|
+
const t = q == null ? void 0 : q.getElementById("placeholder");
|
|
960
|
+
t.style.display = "none";
|
|
961
|
+
}
|
|
962
|
+
const lr = () => {
|
|
963
|
+
const { document: t } = ae(), [e, n] = F(ln), i = On(), c = An("dnd");
|
|
964
|
+
return q = t, {
|
|
965
|
+
isDragging: e,
|
|
966
|
+
"data-dnd": "branch",
|
|
967
|
+
onDragOver: c ? ar : G,
|
|
968
|
+
onDrop: c ? (s) => {
|
|
969
|
+
const a = JSON.parse(s.dataTransfer.getData("text/plain"));
|
|
970
|
+
let l = s.target.getAttribute("data-block-id");
|
|
971
|
+
l === null && (l = s.target.parentElement.getAttribute("data-block-id")), i({ block: a, dropTargetId: l || null, relativeIndex: it }), n(!1), setTimeout(() => We(), 300);
|
|
972
|
+
} : G,
|
|
973
|
+
onDragEnter: c ? (s) => {
|
|
974
|
+
const a = s;
|
|
975
|
+
a.stopPropagation(), a.preventDefault(), J = [];
|
|
976
|
+
const l = a.target;
|
|
977
|
+
or(l), l.classList.add("outline", "outline-blue-500", "outline-4", "-outline-offset-4"), n(!0);
|
|
978
|
+
} : G,
|
|
979
|
+
onDragLeave: c ? (s) => {
|
|
980
|
+
const a = s;
|
|
981
|
+
a.stopPropagation(), a.preventDefault(), a.target.classList.remove("outline", "outline-blue-500", "outline-4", "-outline-offset-4");
|
|
982
|
+
} : G,
|
|
983
|
+
onMouseOut: c ? () => {
|
|
984
|
+
n(!1), We();
|
|
985
|
+
} : G
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
function Ce(t) {
|
|
989
|
+
return t.getAttribute("data-block-id") ? t : t.closest("[data-block-id]");
|
|
990
|
+
}
|
|
991
|
+
function cr(t) {
|
|
992
|
+
t.container.innerHTML = "", t.container.parentNode.removeChild(t.container);
|
|
993
|
+
var e = document.querySelector(".ql-toolbar");
|
|
994
|
+
e && e.parentNode.removeChild(e), t = null;
|
|
995
|
+
}
|
|
996
|
+
const dr = () => {
|
|
997
|
+
const t = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], e = cn(), [, n] = H(), [, i] = ie(), [c, s] = F(Q);
|
|
998
|
+
return (a) => {
|
|
999
|
+
var v;
|
|
1000
|
+
if (c)
|
|
1001
|
+
return;
|
|
1002
|
+
const l = Ce(a.target), f = l.getAttribute("data-block-type");
|
|
1003
|
+
if (!f || !t.includes(f))
|
|
1004
|
+
return;
|
|
1005
|
+
const u = l.cloneNode(!0);
|
|
1006
|
+
l.style.display = "none", Array.from(u.attributes).forEach((w) => {
|
|
1007
|
+
w.name !== "class" && u.removeAttribute(w.name);
|
|
1008
|
+
}), f === "Text" && (u.style.display = "inline-block"), l.parentNode.insertBefore(u, l.nextSibling);
|
|
1009
|
+
const h = new Bn(u, { placeholder: "Type here..." });
|
|
1010
|
+
function p() {
|
|
1011
|
+
const w = h.getText(0, h.getLength());
|
|
1012
|
+
e([l.getAttribute("data-block-id")], { content: w }), l.removeAttribute("style"), u.removeEventListener("blur", p, !0), cr(h), s(""), i("");
|
|
1013
|
+
}
|
|
1014
|
+
u.addEventListener("blur", p, !0), h.focus(), (v = u.querySelector(".ql-clipboard")) == null || v.remove(), n([]), s(l.getAttribute("data-block-id"));
|
|
1015
|
+
};
|
|
1016
|
+
}, ur = () => {
|
|
1017
|
+
const [, t] = K(), [, e] = H(), [n] = F(Q);
|
|
1018
|
+
return (i) => {
|
|
1019
|
+
if (n)
|
|
1020
|
+
return;
|
|
1021
|
+
i.stopPropagation();
|
|
1022
|
+
const c = Ce(i.target);
|
|
1023
|
+
if (c.getAttribute("data-block-parent")) {
|
|
1024
|
+
const s = c.getAttribute("data-style-prop"), a = c.getAttribute("data-style-id"), l = c.getAttribute("data-block-parent");
|
|
1025
|
+
t([{ id: a, prop: s, blockId: l }]), e([l]);
|
|
1026
|
+
} else
|
|
1027
|
+
c.getAttribute("data-block-id") && e([c.getAttribute("data-block-id")]);
|
|
1028
|
+
};
|
|
1029
|
+
}, pr = He((t, e) => {
|
|
1030
|
+
const n = Ce(t.target);
|
|
1031
|
+
n.getAttribute("data-style-id") && e(n.getAttribute("data-style-id"));
|
|
1032
|
+
}, 100), fr = () => {
|
|
1033
|
+
const [, t] = ie(), [e] = F(Q);
|
|
1034
|
+
return (n) => {
|
|
1035
|
+
e || pr(n, t);
|
|
1036
|
+
};
|
|
1037
|
+
}, hr = ({ children: t }) => {
|
|
1038
|
+
const { document: e } = ae(), [n] = H(), [i, c] = K();
|
|
1039
|
+
M(() => {
|
|
1040
|
+
setTimeout(() => {
|
|
1041
|
+
if (!U(i))
|
|
1042
|
+
return;
|
|
1043
|
+
const u = ct(e, re(n));
|
|
1044
|
+
if (u) {
|
|
1045
|
+
const h = u.getAttribute("data-style-prop");
|
|
1046
|
+
if (h) {
|
|
1047
|
+
const p = u.getAttribute("data-style-id"), v = u.getAttribute("data-block-parent");
|
|
1048
|
+
c([{ id: p, prop: h, blockId: v }]);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}, 100);
|
|
1052
|
+
}, [e, n, c, i]);
|
|
1053
|
+
const s = dr(), a = ur(), l = fr(), f = lr();
|
|
1054
|
+
return /* @__PURE__ */ r.jsx(
|
|
1055
|
+
"div",
|
|
1056
|
+
{
|
|
1057
|
+
id: "canvas",
|
|
1058
|
+
onClick: a,
|
|
1059
|
+
onDoubleClick: s,
|
|
1060
|
+
onMouseMove: l,
|
|
1061
|
+
...Ct(f, "isDragging"),
|
|
1062
|
+
className: "relative h-screen max-w-full " + (f.isDragging ? "dragging" : ""),
|
|
1063
|
+
children: t
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
}, ct = (t, e) => t.querySelector(`[data-block-id="${e}"]`), gr = () => {
|
|
1067
|
+
const { window: t } = ae(), [e, n] = H(), [, i] = K(), { undo: c, redo: s } = ke(), a = Ve(), [, l] = dn(), [, f] = un(), { pasteBlocks: u } = pn(), [, h] = Xe(), p = Je(), { savePage: v } = fn(), [w] = F(Q), [, R] = F(hn), j = (I) => {
|
|
1068
|
+
I.key === "Enter" && (I.preventDefault(), e.length === 1 && R(re(e)));
|
|
1069
|
+
};
|
|
1070
|
+
return M(() => {
|
|
1071
|
+
const I = (m) => {
|
|
1072
|
+
if (m.key === "Escape") {
|
|
1073
|
+
n([]), i([]);
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
if (j(m), !w && (m.key === "Delete" || m.key === "Backspace") && (m.preventDefault(), p(e)), m.ctrlKey || m.metaKey) {
|
|
1077
|
+
if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(m.key)) {
|
|
1078
|
+
if (w && ["x", "z", "v"].includes(m.key))
|
|
1079
|
+
return !0;
|
|
1080
|
+
m.preventDefault();
|
|
1081
|
+
}
|
|
1082
|
+
m.key === "s" && (m.stopPropagation(), m.preventDefault(), v()), m.key === "z" && c(), m.key === "y" && s(), m.key === "d" && a(e), m.key === "x" && l(e), m.key === "c" && f(e), m.key === "v" && e.length > 0 && u(e[0]);
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
return t.removeEventListener("keydown", I), t.addEventListener("keydown", I), () => {
|
|
1086
|
+
t.removeEventListener("keydown", I);
|
|
1087
|
+
};
|
|
1088
|
+
}, [
|
|
1089
|
+
e,
|
|
1090
|
+
n,
|
|
1091
|
+
c,
|
|
1092
|
+
p,
|
|
1093
|
+
h,
|
|
1094
|
+
s,
|
|
1095
|
+
a,
|
|
1096
|
+
l,
|
|
1097
|
+
f,
|
|
1098
|
+
u,
|
|
1099
|
+
w,
|
|
1100
|
+
v,
|
|
1101
|
+
t
|
|
1102
|
+
]), null;
|
|
1103
|
+
}, mr = ({ block: t, label: e }) => {
|
|
1104
|
+
const [, n] = _n(() => ({
|
|
1105
|
+
type: "CANVAS_BLOCK",
|
|
1106
|
+
item: t
|
|
1107
|
+
}));
|
|
1108
|
+
return /* @__PURE__ */ r.jsxs(
|
|
1109
|
+
"div",
|
|
1110
|
+
{
|
|
1111
|
+
className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
|
|
1112
|
+
ref: n,
|
|
1113
|
+
onDragStart: () => {
|
|
1114
|
+
console.log("drag start");
|
|
1115
|
+
},
|
|
1116
|
+
children: [
|
|
1117
|
+
/* @__PURE__ */ r.jsx(Pt, {}),
|
|
1118
|
+
e
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
);
|
|
1122
|
+
}, yr = ({ selectedBlockElement: t, block: e }) => {
|
|
1123
|
+
const n = Je(), i = Ve(), [, c] = H(), [, s] = K(), { floatingStyles: a, refs: l, update: f } = Pn({
|
|
1124
|
+
placement: "top-start",
|
|
1125
|
+
middleware: [Mn(), Rn()],
|
|
1126
|
+
elements: {
|
|
1127
|
+
reference: t
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
Ln(t, () => f(), t !== null);
|
|
1131
|
+
const u = B(e, "_parent", null), h = U(B(e, "_name", "")) ? B(e, "_type", "") : B(e, "_name", "");
|
|
1132
|
+
return !t || !e ? null : /* @__PURE__ */ r.jsxs(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
role: "button",
|
|
1136
|
+
tabIndex: 0,
|
|
1137
|
+
ref: l.setFloating,
|
|
1138
|
+
style: a,
|
|
1139
|
+
onClick: (p) => {
|
|
1140
|
+
p.stopPropagation(), p.preventDefault();
|
|
1141
|
+
},
|
|
1142
|
+
onKeyDown: (p) => p.stopPropagation(),
|
|
1143
|
+
className: "z-50 flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
1144
|
+
children: [
|
|
1145
|
+
/* @__PURE__ */ r.jsx(mr, { label: h, block: e }),
|
|
1146
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1 ", children: [
|
|
1147
|
+
u && /* @__PURE__ */ r.jsx(
|
|
1148
|
+
Mt,
|
|
1149
|
+
{
|
|
1150
|
+
className: "hover:scale-105 ",
|
|
1151
|
+
onClick: () => {
|
|
1152
|
+
s([]), c([u]);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
gn(B(e, "_type", "")) ? /* @__PURE__ */ r.jsx(_t, { className: "hover:scale-105 ", onClick: () => i([e == null ? void 0 : e._id]) }) : null,
|
|
1157
|
+
mn(B(e, "_type", "")) ? /* @__PURE__ */ r.jsx(Lt, { className: "hover:scale-105 ", onClick: () => n([e == null ? void 0 : e._id]) }) : null
|
|
1158
|
+
] })
|
|
1159
|
+
]
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
}, vr = ({ model: t }) => {
|
|
1163
|
+
const [e] = yn(), [n] = H(), [i] = Ye(), [c] = ie(), [s] = K(), { document: a, window: l } = ae(), [f] = W(a == null ? void 0 : a.getElementById("highlighted-block")), [u] = W(
|
|
1164
|
+
a == null ? void 0 : a.getElementById("selected-block")
|
|
1165
|
+
), [h] = W(
|
|
1166
|
+
a == null ? void 0 : a.getElementById("selected-styling-block")
|
|
1167
|
+
);
|
|
1168
|
+
M(() => {
|
|
1169
|
+
i ? a == null || a.documentElement.classList.add("dark") : a == null || a.documentElement.classList.remove("dark");
|
|
1170
|
+
}, [i, a]);
|
|
1171
|
+
const p = B(e, "headingFont", "DM Sans"), v = B(e, "bodyFont", "DM Sans");
|
|
1172
|
+
return M(() => {
|
|
1173
|
+
const w = B(e, "primaryColor", "#000"), R = B(e, "secondaryColor", "#FFF"), j = Nn({
|
|
1174
|
+
colors: [w, R],
|
|
1175
|
+
names: ["primary", "secondary"]
|
|
1176
|
+
});
|
|
1177
|
+
j.primary.DEFAULT = w, j.secondary.DEFAULT = R;
|
|
1178
|
+
const I = B(e, "roundedCorners", "0");
|
|
1179
|
+
!l || !l.tailwind || (l.tailwind.config = {
|
|
1180
|
+
darkMode: "class",
|
|
1181
|
+
theme: {
|
|
1182
|
+
fontFamily: {
|
|
1183
|
+
heading: [p],
|
|
1184
|
+
body: [v]
|
|
1185
|
+
},
|
|
1186
|
+
extend: {
|
|
1187
|
+
borderRadius: {
|
|
1188
|
+
global: `${I || "0"}px`
|
|
1189
|
+
},
|
|
1190
|
+
colors: j
|
|
1191
|
+
}
|
|
1192
|
+
},
|
|
1193
|
+
plugins: [
|
|
1194
|
+
// @ts-ignore
|
|
1195
|
+
l.tailwind.plugin.withOptions(({ prefix: m = "ui" } = {}) => ({ addVariant: V }) => {
|
|
1196
|
+
for (const _ of ["open", "checked", "selected", "active", "disabled"])
|
|
1197
|
+
V(`${m}-${_}`, [
|
|
1198
|
+
`&[data-headlessui-state~="${_}"]`,
|
|
1199
|
+
`:where([data-headlessui-state~="${_}"]) &`
|
|
1200
|
+
]), V(`${m}-not-${_}`, [
|
|
1201
|
+
`&[data-headlessui-state]:not([data-headlessui-state~="${_}"])`,
|
|
1202
|
+
`:where([data-headlessui-state]:not([data-headlessui-state~="${_}"])) &:not([data-headlessui-state])`
|
|
1203
|
+
]);
|
|
1204
|
+
})
|
|
1205
|
+
]
|
|
1206
|
+
});
|
|
1207
|
+
}, [e, l, p, v]), M(() => {
|
|
1208
|
+
u && (u.textContent = `${ne(n, (w) => `[data-block-id="${w}"]`).join(",")}{
|
|
1209
|
+
outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
1210
|
+
}`);
|
|
1211
|
+
}, [n, u]), M(() => {
|
|
1212
|
+
f && (f.textContent = c ? `[data-style-id="${c}"]{ outline: 1px solid orange !important; outline-offset: -1px;}` : "");
|
|
1213
|
+
}, [c, n, f]), M(() => {
|
|
1214
|
+
h && (h.textContent = `${ne(s, ({ id: w }) => `[data-style-id="${w}"]`).join(",")}{
|
|
1215
|
+
outline: 1px solid orange !important; outline-offset: -1px;
|
|
1216
|
+
}`);
|
|
1217
|
+
}, [s, h]), M(() => {
|
|
1218
|
+
if (t === "section")
|
|
1219
|
+
return;
|
|
1220
|
+
const w = B(e, "bodyTextLightColor", "#64748b"), R = B(e, "bodyTextDarkColor", "#94a3b8"), j = B(e, "bodyBgLightColor", "#FFFFFF"), I = B(e, "bodyBgDarkColor", "#0f172a");
|
|
1221
|
+
a.body.className = `font-body antialiased text-[${w}] bg-[${j}] dark:text-[${R}] dark:bg-[${I}]`;
|
|
1222
|
+
}, [e, a, t]), t === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1223
|
+
p && /* @__PURE__ */ r.jsx(
|
|
1224
|
+
"link",
|
|
1225
|
+
{
|
|
1226
|
+
id: "heading-font",
|
|
1227
|
+
rel: "stylesheet",
|
|
1228
|
+
type: "text/css",
|
|
1229
|
+
href: `https://fonts.googleapis.com/css2?family=${p.replace(
|
|
1230
|
+
/ /g,
|
|
1231
|
+
"+"
|
|
1232
|
+
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1233
|
+
media: "all"
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
v && p !== v && /* @__PURE__ */ r.jsx(
|
|
1237
|
+
"link",
|
|
1238
|
+
{
|
|
1239
|
+
id: "body-font",
|
|
1240
|
+
rel: "stylesheet",
|
|
1241
|
+
type: "text/css",
|
|
1242
|
+
href: `https://fonts.googleapis.com/css2?family=${v.replace(
|
|
1243
|
+
/ /g,
|
|
1244
|
+
"+"
|
|
1245
|
+
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1246
|
+
media: "all"
|
|
1247
|
+
}
|
|
1248
|
+
),
|
|
1249
|
+
p && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${p}",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";}` })
|
|
1250
|
+
] }) : null;
|
|
1251
|
+
}, xr = (t) => {
|
|
1252
|
+
const e = {};
|
|
1253
|
+
return Object.keys(t).forEach((n) => {
|
|
1254
|
+
be(t[n]) && t[n].startsWith(Oe) && (e[n] = t[n].replace(Oe, "").split(","));
|
|
1255
|
+
}), e;
|
|
1256
|
+
}, br = Tt((t) => {
|
|
1257
|
+
const e = t.replace(Qe, "").split(",");
|
|
1258
|
+
return $n(e[0], e[1]);
|
|
1259
|
+
});
|
|
1260
|
+
function kr(t, e) {
|
|
1261
|
+
return B(t, `${e}_attrs`, {});
|
|
1262
|
+
}
|
|
1263
|
+
function wr(t) {
|
|
1264
|
+
const e = {};
|
|
1265
|
+
return Object.keys(t).forEach((n) => {
|
|
1266
|
+
if (be(t[n]) && t[n].startsWith(Qe)) {
|
|
1267
|
+
const i = br(t[n]);
|
|
1268
|
+
e[n] = {
|
|
1269
|
+
className: i,
|
|
1270
|
+
"data-style-prop": n,
|
|
1271
|
+
"data-block-parent": t._id,
|
|
1272
|
+
"data-style-id": `${n}-${t._id}`,
|
|
1273
|
+
...kr(t, n)
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
}), e;
|
|
1277
|
+
}
|
|
1278
|
+
function jr(t, e) {
|
|
1279
|
+
const n = B(t, "_bindings", {});
|
|
1280
|
+
return U(n) ? { ...t } : (St(n, (i, c) => {
|
|
1281
|
+
be(i) && B(e, i, null) && (t[c] = B(e, i, null));
|
|
1282
|
+
}), t);
|
|
1283
|
+
}
|
|
1284
|
+
function ve({ blocks: t }) {
|
|
1285
|
+
const e = Ze(), n = xe((s) => wr(s), []), [i] = En(), [c] = vn(Q);
|
|
1286
|
+
return /* @__PURE__ */ r.jsx(r.Fragment, { children: Y.Children.toArray(
|
|
1287
|
+
t.map((s, a) => {
|
|
1288
|
+
if (c === s._id)
|
|
1289
|
+
return null;
|
|
1290
|
+
const l = xr(s), f = {};
|
|
1291
|
+
U(l) || Object.keys(l).forEach((v) => {
|
|
1292
|
+
f[v] = Y.Children.toArray(
|
|
1293
|
+
l[v].map((w) => /* @__PURE__ */ r.jsx(ve, { blocks: [Et(e, { _id: w })] }))
|
|
1294
|
+
);
|
|
1295
|
+
});
|
|
1296
|
+
const u = ze(e, { _parent: s._id });
|
|
1297
|
+
f.children = u.length ? /* @__PURE__ */ r.jsx(ve, { blocks: u }) : null;
|
|
1298
|
+
const h = Wn(s._type), p = B(h, "component", null);
|
|
1299
|
+
return It(p) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${s == null ? void 0 : s._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ue, { children: Y.createElement(p, {
|
|
1300
|
+
blockProps: {
|
|
1301
|
+
"data-block-id": s._id,
|
|
1302
|
+
"data-block-type": s._type,
|
|
1303
|
+
"data-dnd": xn(s._type) ? "branch" : "leaf"
|
|
1304
|
+
},
|
|
1305
|
+
inBuilder: !0,
|
|
1306
|
+
index: a,
|
|
1307
|
+
...jr(s, i),
|
|
1308
|
+
...n(s),
|
|
1309
|
+
...f
|
|
1310
|
+
}) });
|
|
1311
|
+
})
|
|
1312
|
+
) });
|
|
1313
|
+
}
|
|
1314
|
+
const Cr = () => {
|
|
1315
|
+
const t = Ze();
|
|
1316
|
+
return /* @__PURE__ */ r.jsx(Fn, { children: U(t) ? null : /* @__PURE__ */ r.jsx(In, { children: /* @__PURE__ */ r.jsx(ve, { blocks: ze(t, (e) => U(e._parent)) }) }) });
|
|
1317
|
+
}, Tr = (t, e) => t.querySelector(`[data-style-id="${e}"]`), Sr = () => {
|
|
1318
|
+
const [t] = F(bn), [e] = Xe(), [n] = we(), [, i] = H(), c = kn(), [, s] = ie(), a = Se(null), l = Se(null), [f, u] = W({ width: 0, height: 0 }), h = Xn(f), [p, v] = W(0), [w, R] = W([]), [, j] = W([]), [, I] = F(wn), [m, V] = K(), _ = jn("loadingCanvas", !1);
|
|
1319
|
+
M(() => {
|
|
1320
|
+
const { clientWidth: D, clientHeight: L } = l.current;
|
|
1321
|
+
u({ width: D, height: L }), p === 0 && v(D);
|
|
1322
|
+
}, [l, n, p]);
|
|
1323
|
+
const le = (D, L = 0) => {
|
|
1324
|
+
const { top: N } = D.getBoundingClientRect();
|
|
1325
|
+
return N + L >= 0 && N - L <= window.innerHeight;
|
|
1326
|
+
};
|
|
1327
|
+
M(() => {
|
|
1328
|
+
var D, L;
|
|
1329
|
+
if (c && c.type !== "Multiple" && a.current) {
|
|
1330
|
+
const N = ct(a.current.contentDocument, c._id);
|
|
1331
|
+
N && (le(N) || (L = (D = a.current) == null ? void 0 : D.contentWindow) == null || L.scrollTo({ top: N.offsetTop, behavior: "smooth" }), R([N]));
|
|
1332
|
+
}
|
|
1333
|
+
}, [c]), M(() => {
|
|
1334
|
+
if (!U(m) && a.current) {
|
|
1335
|
+
const D = Tr(
|
|
1336
|
+
a.current.contentDocument,
|
|
1337
|
+
re(m).id
|
|
1338
|
+
);
|
|
1339
|
+
j(D ? [D] : [null]);
|
|
1340
|
+
} else
|
|
1341
|
+
j([null]);
|
|
1342
|
+
}, [m]);
|
|
1343
|
+
const ce = kt(() => {
|
|
1344
|
+
let D = Vn;
|
|
1345
|
+
return t === "offline" && (D = D.replace(
|
|
1346
|
+
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1347
|
+
"/offline/tailwind.cdn.js"
|
|
1348
|
+
), D = D.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), D = D.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), D;
|
|
1349
|
+
}, [t]);
|
|
1350
|
+
return /* @__PURE__ */ r.jsx(
|
|
1351
|
+
"div",
|
|
1352
|
+
{
|
|
1353
|
+
onClick: () => {
|
|
1354
|
+
i([]), V([]);
|
|
1355
|
+
},
|
|
1356
|
+
onMouseLeave: () => setTimeout(() => s(""), 300),
|
|
1357
|
+
className: "relative mx-auto h-full w-full",
|
|
1358
|
+
style: p > 0 && !U(h) ? { width: e ? "100%" : p } : {},
|
|
1359
|
+
ref: l,
|
|
1360
|
+
children: /* @__PURE__ */ r.jsxs(
|
|
1361
|
+
sr,
|
|
1362
|
+
{
|
|
1363
|
+
contentDidMount: () => I(a.current),
|
|
1364
|
+
ref: a,
|
|
1365
|
+
id: "canvas-iframe",
|
|
1366
|
+
style: { width: `${n}px`, ...h },
|
|
1367
|
+
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1368
|
+
initialContent: ce,
|
|
1369
|
+
children: [
|
|
1370
|
+
/* @__PURE__ */ r.jsx(gr, {}),
|
|
1371
|
+
/* @__PURE__ */ r.jsx(
|
|
1372
|
+
yr,
|
|
1373
|
+
{
|
|
1374
|
+
block: c,
|
|
1375
|
+
selectedBlockElement: re(w)
|
|
1376
|
+
}
|
|
1377
|
+
),
|
|
1378
|
+
/* @__PURE__ */ r.jsx(vr, { model: "page" }),
|
|
1379
|
+
/* @__PURE__ */ r.jsx(hr, { children: _ ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ge, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Cr, {}) }),
|
|
1380
|
+
/* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
|
|
1381
|
+
]
|
|
1382
|
+
}
|
|
1383
|
+
)
|
|
1384
|
+
}
|
|
1385
|
+
);
|
|
1386
|
+
}, Er = wt(() => import("./AddBlocks-imyQSCbI.js")), Ns = () => {
|
|
1387
|
+
const [t, e] = F(Cn);
|
|
1388
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1389
|
+
/* @__PURE__ */ r.jsx(Kn, {}),
|
|
1390
|
+
/* @__PURE__ */ r.jsxs("div", { className: "relative flex-1 overflow-hidden bg-slate-800/90 px-2 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]", children: [
|
|
1391
|
+
/* @__PURE__ */ r.jsx(Ue, { fallback: /* @__PURE__ */ r.jsx(Ge, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Dn, { children: /* @__PURE__ */ r.jsx(Sr, {}) }) }),
|
|
1392
|
+
t ? /* @__PURE__ */ r.jsx(
|
|
1393
|
+
"div",
|
|
1394
|
+
{
|
|
1395
|
+
onClick: () => e(!1),
|
|
1396
|
+
className: "absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",
|
|
1397
|
+
children: /* @__PURE__ */ r.jsx(
|
|
1398
|
+
"div",
|
|
1399
|
+
{
|
|
1400
|
+
onClick: (n) => n.stopPropagation(),
|
|
1401
|
+
className: "mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",
|
|
1402
|
+
children: /* @__PURE__ */ r.jsx(Er, {})
|
|
1403
|
+
}
|
|
1404
|
+
)
|
|
1405
|
+
}
|
|
1406
|
+
) : null
|
|
1407
|
+
] })
|
|
1408
|
+
] });
|
|
1409
|
+
};
|
|
1410
|
+
export {
|
|
1411
|
+
Ns as default
|
|
1412
|
+
};
|