@chaibuilder/sdk 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-P3qHuE5J.cjs → AddBlocks-EBCXennD.cjs} +1 -1
- package/dist/{AddBlocks-imyQSCbI.js → AddBlocks-a2VUDT5t.js} +20 -20
- package/dist/{BrandingOptions-_2XBEPab.cjs → BrandingOptions-kjj0QNch.cjs} +1 -1
- package/dist/{BrandingOptions-tSNtQ1Kv.js → BrandingOptions-uU1nNRzP.js} +1 -1
- package/dist/CanvasArea-4ZhFTrfG.js +1426 -0
- package/dist/CanvasArea-_xT5Zr6U.cjs +59 -0
- package/dist/{CurrentPage--5VHTFmg.cjs → CurrentPage-NYsAabGv.cjs} +1 -1
- package/dist/{CurrentPage-ZjBcAU3o.js → CurrentPage-UcUSZ81g.js} +5 -5
- package/dist/{Layers-Qv1k4eqT.cjs → Layers-4Qo1Flcd.cjs} +1 -1
- package/dist/{Layers-RfOxPx_V.js → Layers-gtpXghW3.js} +15 -15
- package/dist/{MarkAsGlobalBlock-p_wvHkQZ.cjs → MarkAsGlobalBlock-E_w2sPGA.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-aqik3ouc.js → MarkAsGlobalBlock-vWOYzFKX.js} +1 -1
- package/dist/{PagesPanel-pQjl_qzS.cjs → PagesPanel-ebglMsO0.cjs} +1 -1
- package/dist/{PagesPanel-yOrHqpUR.js → PagesPanel-wkwMGcgn.js} +3 -3
- package/dist/{ProjectPanel-64NTjmau.js → ProjectPanel-HMY5d4po.js} +5 -5
- package/dist/{ProjectPanel-U4uQPSn8.cjs → ProjectPanel-PTTgh8uA.cjs} +1 -1
- package/dist/{Settings-2b17z_GV.js → Settings-Qxq1frcT.js} +294 -303
- package/dist/Settings-WK2g5ehT.cjs +1 -0
- package/dist/{SidePanels-gNBjhSWG.js → SidePanels-E-K69HnO.js} +9 -9
- package/dist/{SidePanels-auE-bKNc.cjs → SidePanels-fXTJlJLG.cjs} +1 -1
- package/dist/{Topbar-ZjAs5fDc.cjs → Topbar-b9Vt5SLF.cjs} +1 -1
- package/dist/{Topbar-Jc74a6oE.js → Topbar-oZ167R8x.js} +5 -5
- package/dist/UnsplashImages-dMdYJI8B.cjs +1 -0
- package/dist/{UnsplashImages-_PxEYx5c.js → UnsplashImages-yN_5vrmM.js} +5 -5
- package/dist/UploadImages-2h2MuCU2.cjs +1 -0
- package/dist/{UploadImages-zzSgKmP9.js → UploadImages-yVZs49iB.js} +29 -29
- package/dist/{add-page-modal-OukBwf5E.js → add-page-modal-f-4vS_9F.js} +3 -3
- package/dist/{add-page-modal-BREwIMPz.cjs → add-page-modal-vheD0KJZ.cjs} +1 -1
- package/dist/{confirm-alert-mzlwOW9w.cjs → confirm-alert-4bi7bxtP.cjs} +1 -1
- package/dist/{confirm-alert-2JxcNf3T.js → confirm-alert-iNzeta1I.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +0 -25
- package/dist/core.js +51 -55
- package/dist/{delete-page-modal-UWn_sHLC.cjs → delete-page-modal-Ex2OsWt4.cjs} +1 -1
- package/dist/{delete-page-modal-RZXdqvje.js → delete-page-modal-TmPs3b_D.js} +2 -2
- package/dist/{form-TQ7vwDYO.js → form-dmyeQkyn.js} +1 -1
- package/dist/{form-bSW-Pkw9.cjs → form-wY4tsyip.cjs} +1 -1
- package/dist/index-U_pW4Tkc.cjs +1 -0
- package/dist/{index-ORFlyrBx.js → index-bKgIzodL.js} +874 -878
- package/dist/{index-yo8mH0u8.cjs → index-ghpTTOME.cjs} +2 -2
- package/dist/{index-CMHxUxre.js → index-rz6hkGcq.js} +4 -4
- package/dist/{page-viewer-rPTxX-Lu.cjs → page-viewer-nVNwY5Ht.cjs} +1 -1
- package/dist/{page-viewer-PZRWwKP6.js → page-viewer-xLhBfvgr.js} +3 -3
- package/dist/{project-general-setting-FVlRHFpF.cjs → project-general-setting-8wv-2jG9.cjs} +1 -1
- package/dist/{project-general-setting-UzPhnhWp.js → project-general-setting-uCeWGv95.js} +3 -3
- package/dist/{project-seo-setting-cERASO9j.cjs → project-seo-setting-57XXrUTn.cjs} +1 -1
- package/dist/{project-seo-setting-k0HlefUD.js → project-seo-setting-dRUW-Zmp.js} +2 -2
- package/dist/{single-page-detail-Ftozh79X.cjs → single-page-detail-bGBYvzQx.cjs} +1 -1
- package/dist/{single-page-detail-Jb-S30JL.js → single-page-detail-kNdE5nsi.js} +4 -4
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +41 -41
- package/dist/{useAddBlockByDrop-UA_Iw_4l.js → useAddBlockByDrop-LM3owe-j.js} +1 -1
- package/dist/{useAddBlockByDrop-DPV32UHP.cjs → useAddBlockByDrop-qOKe8QVt.cjs} +1 -1
- package/package.json +1 -1
- package/dist/CanvasArea-E0Mu1Cwe.cjs +0 -58
- package/dist/CanvasArea-K9fOlyJl.js +0 -1419
- package/dist/Settings-4XckYyzK.cjs +0 -1
- package/dist/UnsplashImages-nXceZLmd.cjs +0 -1
- package/dist/UploadImages-tcQb5NZu.cjs +0 -1
- package/dist/index-zkc4SQCu.cjs +0 -1
|
@@ -1,1419 +0,0 @@
|
|
|
1
|
-
var mt = Object.defineProperty;
|
|
2
|
-
var yt = (e, t, n) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var z = (e, t, n) => (yt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
import { j as r } from "./jsx-runtime-NV737rRe.js";
|
|
5
|
-
import Y, { createElement as vt, useCallback as xe, useState as $, useEffect as M, Component as qe, Children as xt, Suspense as Ue, useRef as Se, useMemo as bt, lazy as wt } from "react";
|
|
6
|
-
import { map as ne, includes as Ee, toUpper as de, round as kt, throttle as He, noop as Z, isEmpty as U, first as re, omit as jt, get as B, isString as be, memoize as Ct, each as Tt, find as St, filter as ze, isNull as Et } from "lodash";
|
|
7
|
-
import { ResetIcon as Ie, MobileIcon as De, LaptopIcon as It, DesktopIcon as Dt, DotsVerticalIcon as Bt, EraserIcon as Ot, ZoomInIcon as At, DragHandleDots2Icon as Pt, ArrowUpIcon as Rt, CopyIcon as Mt, TrashIcon as Lt } from "@radix-ui/react-icons";
|
|
8
|
-
import { p as we, B as se, W as Ye, aM as _t, aN as Nt, aO as Ft, aP as Wt, aQ as $t, R as ke, ai as qt, aR as Ut, aS as Ht, aT as zt, aU as Yt, aV as Kt, aW as Vt, w as Xt, j as H, aj as K, D as Jt, E as Zt, F as Gt, G as Qt, H as en, I as tn, J as nn, K as rn, at as sn, L as on, U as Ke, aL as te, aX as an, ab as ln, _ as ie, aY as Q, m as Ve, n as cn, k as dn, o as un, h as Xe, l as Je, ag as pn, aZ as fn, a_ as hn, a$ as gn, x as mn, ae as Ze, a as yn, b0 as vn, b1 as xn, a6 as bn, b2 as wn, i as kn, S as Ge, aA as jn } from "./index-ORFlyrBx.js";
|
|
9
|
-
import { useTranslation as Cn } from "react-i18next";
|
|
10
|
-
import { useAtom as F } from "jotai";
|
|
11
|
-
import Be from "react-dom";
|
|
12
|
-
import { g as Tn, S as Oe, a as Qe } from "./MODIFIERS-MLfpKQY1.js";
|
|
13
|
-
import { r as et, u as Sn, B as En, E as In } from "./index-CMHxUxre.js";
|
|
14
|
-
import { Quill as Dn } from "react-quill";
|
|
15
|
-
import { u as Bn } from "./useAddBlockByDrop-UA_Iw_4l.js";
|
|
16
|
-
import { useFeature as On } from "flagged";
|
|
17
|
-
import { flip as An } from "@floating-ui/dom";
|
|
18
|
-
import { useFloating as Pn, shift as Rn } from "@floating-ui/react-dom";
|
|
19
|
-
import { useDrag as Mn } from "react-dnd";
|
|
20
|
-
import { useResizeObserver as Ln } from "@react-hookz/web";
|
|
21
|
-
import { tailwindcssPaletteGenerator as _n } from "@bobthered/tailwindcss-palette-generator";
|
|
22
|
-
import { Provider as Nn } from "react-wrap-balancer";
|
|
23
|
-
import { twMerge as Fn } 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 $n = () => {
|
|
66
|
-
const { undoCount: e, redoCount: t, undo: n, redo: o } = we();
|
|
67
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
68
|
-
/* @__PURE__ */ r.jsx(se, { disabled: !e, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ie, {}) }),
|
|
69
|
-
/* @__PURE__ */ r.jsx(se, { disabled: !t, onClick: o, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ie, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
70
|
-
] });
|
|
71
|
-
};
|
|
72
|
-
function qn() {
|
|
73
|
-
const [e, t] = Ye(), { t: n } = Cn();
|
|
74
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
75
|
-
/* @__PURE__ */ r.jsx(_t, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
|
|
76
|
-
/* @__PURE__ */ r.jsxs(
|
|
77
|
-
Nt,
|
|
78
|
-
{
|
|
79
|
-
id: "dark-mode-switch",
|
|
80
|
-
checked: e,
|
|
81
|
-
onCheckedChange: () => {
|
|
82
|
-
t(!e);
|
|
83
|
-
},
|
|
84
|
-
className: `${e ? "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: `${e ? "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: e = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
102
|
-
"svg",
|
|
103
|
-
{
|
|
104
|
-
className: e ? "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
|
-
), Pe = [
|
|
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(It, {}),
|
|
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(Dt, {}),
|
|
165
|
-
width: 1920
|
|
166
|
-
}
|
|
167
|
-
], Un = ({
|
|
168
|
-
title: e,
|
|
169
|
-
content: t,
|
|
170
|
-
currentBreakpoint: n,
|
|
171
|
-
breakpoint: o,
|
|
172
|
-
width: l,
|
|
173
|
-
icon: s,
|
|
174
|
-
onClick: i
|
|
175
|
-
}) => /* @__PURE__ */ r.jsxs(Ft, { children: [
|
|
176
|
-
/* @__PURE__ */ r.jsx(Wt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
177
|
-
se,
|
|
178
|
-
{
|
|
179
|
-
onClick: () => i(l),
|
|
180
|
-
size: "sm",
|
|
181
|
-
variant: o === n ? "secondary" : "ghost",
|
|
182
|
-
children: s
|
|
183
|
-
}
|
|
184
|
-
) }),
|
|
185
|
-
/* @__PURE__ */ r.jsx($t, { 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: e }),
|
|
187
|
-
/* @__PURE__ */ r.jsx("p", { className: "text-xs", children: t })
|
|
188
|
-
] }) }) })
|
|
189
|
-
] }), Hn = () => {
|
|
190
|
-
const [, e, t] = ke(), [n, o] = qt(), l = (s) => {
|
|
191
|
-
n.includes(s) ? n.length > 2 && o(n.filter((i) => i !== s)) : o((i) => [...i, s]);
|
|
192
|
-
};
|
|
193
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
194
|
-
ne(
|
|
195
|
-
Pe.filter((s) => Ee(n, de(s.breakpoint))),
|
|
196
|
-
(s) => /* @__PURE__ */ vt(Un, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
|
|
197
|
-
),
|
|
198
|
-
/* @__PURE__ */ r.jsxs(Ut, { children: [
|
|
199
|
-
/* @__PURE__ */ r.jsx(Ht, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Bt, { className: "scale-90 transform" }) }) }),
|
|
200
|
-
/* @__PURE__ */ r.jsxs(zt, { className: "w-56 border-border text-xs", children: [
|
|
201
|
-
/* @__PURE__ */ r.jsx(Yt, { children: "Breakpoints" }),
|
|
202
|
-
/* @__PURE__ */ r.jsx(Kt, {}),
|
|
203
|
-
ne(Pe, (s) => /* @__PURE__ */ r.jsx(
|
|
204
|
-
Vt,
|
|
205
|
-
{
|
|
206
|
-
disabled: s.breakpoint === "xs",
|
|
207
|
-
onCheckedChange: () => l(de(s.breakpoint)),
|
|
208
|
-
checked: Ee(n, de(s.breakpoint)),
|
|
209
|
-
children: s.title
|
|
210
|
-
},
|
|
211
|
-
s.breakpoint
|
|
212
|
-
))
|
|
213
|
-
] })
|
|
214
|
-
] })
|
|
215
|
-
] });
|
|
216
|
-
}, zn = () => {
|
|
217
|
-
const [e] = Xt(), { createSnapshot: t } = we(), [, n] = H(), [, o] = K(), l = xe(() => {
|
|
218
|
-
e([]), n([]), o([]), t();
|
|
219
|
-
}, [e, t]);
|
|
220
|
-
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(Jt, { children: [
|
|
221
|
-
/* @__PURE__ */ r.jsx(Zt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(se, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
222
|
-
/* @__PURE__ */ r.jsx(Ot, {}),
|
|
223
|
-
" Clear"
|
|
224
|
-
] }) }),
|
|
225
|
-
/* @__PURE__ */ r.jsxs(Gt, { className: "border-border", children: [
|
|
226
|
-
/* @__PURE__ */ r.jsxs(Qt, { children: [
|
|
227
|
-
/* @__PURE__ */ r.jsx(en, { children: "Clear whole canvas?" }),
|
|
228
|
-
/* @__PURE__ */ r.jsx(tn, { children: "Are you sure you want to clear the whole canvas?" })
|
|
229
|
-
] }),
|
|
230
|
-
/* @__PURE__ */ r.jsxs(nn, { children: [
|
|
231
|
-
/* @__PURE__ */ r.jsx(rn, { children: "Cancel" }),
|
|
232
|
-
/* @__PURE__ */ r.jsx(sn, { onClick: l, children: "Yes" })
|
|
233
|
-
] })
|
|
234
|
-
] })
|
|
235
|
-
] }) });
|
|
236
|
-
}, Yn = () => {
|
|
237
|
-
const e = on("darkMode", !1), [t] = 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
|
-
e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
241
|
-
/* @__PURE__ */ r.jsx(qn, {}),
|
|
242
|
-
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" })
|
|
243
|
-
] }) : null,
|
|
244
|
-
/* @__PURE__ */ r.jsx(Hn, {}),
|
|
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(At, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
248
|
-
" ",
|
|
249
|
-
/* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
|
|
250
|
-
kt(t, 0),
|
|
251
|
-
"%"
|
|
252
|
-
] })
|
|
253
|
-
] }),
|
|
254
|
-
/* @__PURE__ */ r.jsx(te, { orientation: "vertical" }),
|
|
255
|
-
/* @__PURE__ */ r.jsx($n, {})
|
|
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(zn, {})
|
|
260
|
-
] })
|
|
261
|
-
] });
|
|
262
|
-
}, Kn = `<!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>`, Vn = (e) => {
|
|
309
|
-
const [t] = ke(), [, n] = Ke(), [o, l] = $({}), s = xe(() => {
|
|
310
|
-
const { width: i, height: c } = e;
|
|
311
|
-
if (i < t) {
|
|
312
|
-
const p = parseFloat((i / t).toString());
|
|
313
|
-
let u = {};
|
|
314
|
-
c && (u = { height: c + 2 * c * (1 - p) }), l({
|
|
315
|
-
transform: `scale(${p})`,
|
|
316
|
-
transformOrigin: "top left",
|
|
317
|
-
...u,
|
|
318
|
-
maxWidth: "none"
|
|
319
|
-
}), n(p * 100);
|
|
320
|
-
} else
|
|
321
|
-
l({}), n(100);
|
|
322
|
-
}, [t, e, n]);
|
|
323
|
-
return M(() => {
|
|
324
|
-
s();
|
|
325
|
-
}, [t, e, n, s]), o;
|
|
326
|
-
};
|
|
327
|
-
var oe = { exports: {} };
|
|
328
|
-
/*
|
|
329
|
-
object-assign
|
|
330
|
-
(c) Sindre Sorhus
|
|
331
|
-
@license MIT
|
|
332
|
-
*/
|
|
333
|
-
var ue, Re;
|
|
334
|
-
function Xn() {
|
|
335
|
-
if (Re)
|
|
336
|
-
return ue;
|
|
337
|
-
Re = 1;
|
|
338
|
-
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
339
|
-
function o(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 l() {
|
|
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 i = {}, c = 0; c < 10; c++)
|
|
352
|
-
i["_" + String.fromCharCode(c)] = c;
|
|
353
|
-
var p = Object.getOwnPropertyNames(i).map(function(h) {
|
|
354
|
-
return i[h];
|
|
355
|
-
});
|
|
356
|
-
if (p.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 = l() ? Object.assign : function(s, i) {
|
|
367
|
-
for (var c, p = o(s), u, h = 1; h < arguments.length; h++) {
|
|
368
|
-
c = Object(arguments[h]);
|
|
369
|
-
for (var f in c)
|
|
370
|
-
t.call(c, f) && (p[f] = c[f]);
|
|
371
|
-
if (e) {
|
|
372
|
-
u = e(c);
|
|
373
|
-
for (var v = 0; v < u.length; v++)
|
|
374
|
-
n.call(c, u[v]) && (p[u[v]] = c[u[v]]);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
return p;
|
|
378
|
-
}, ue;
|
|
379
|
-
}
|
|
380
|
-
var pe, Me;
|
|
381
|
-
function je() {
|
|
382
|
-
if (Me)
|
|
383
|
-
return pe;
|
|
384
|
-
Me = 1;
|
|
385
|
-
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
386
|
-
return pe = e, pe;
|
|
387
|
-
}
|
|
388
|
-
var fe, Le;
|
|
389
|
-
function tt() {
|
|
390
|
-
return Le || (Le = 1, fe = Function.call.bind(Object.prototype.hasOwnProperty)), fe;
|
|
391
|
-
}
|
|
392
|
-
var he, _e;
|
|
393
|
-
function Jn() {
|
|
394
|
-
if (_e)
|
|
395
|
-
return he;
|
|
396
|
-
_e = 1;
|
|
397
|
-
var e = function() {
|
|
398
|
-
};
|
|
399
|
-
if (process.env.NODE_ENV !== "production") {
|
|
400
|
-
var t = je(), n = {}, o = tt();
|
|
401
|
-
e = function(s) {
|
|
402
|
-
var i = "Warning: " + s;
|
|
403
|
-
typeof console < "u" && console.error(i);
|
|
404
|
-
try {
|
|
405
|
-
throw new Error(i);
|
|
406
|
-
} catch {
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
function l(s, i, c, p, u) {
|
|
411
|
-
if (process.env.NODE_ENV !== "production") {
|
|
412
|
-
for (var h in s)
|
|
413
|
-
if (o(s, h)) {
|
|
414
|
-
var f;
|
|
415
|
-
try {
|
|
416
|
-
if (typeof s[h] != "function") {
|
|
417
|
-
var v = Error(
|
|
418
|
-
(p || "React class") + ": " + c + " 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
|
-
f = s[h](i, h, p, c, null, t);
|
|
423
|
-
} catch (P) {
|
|
424
|
-
f = P;
|
|
425
|
-
}
|
|
426
|
-
if (f && !(f instanceof Error) && e(
|
|
427
|
-
(p || "React class") + ": type specification of " + c + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". 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
|
-
), f instanceof Error && !(f.message in n)) {
|
|
429
|
-
n[f.message] = !0;
|
|
430
|
-
var k = u ? u() : "";
|
|
431
|
-
e(
|
|
432
|
-
"Failed " + c + " type: " + f.message + (k ?? "")
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
return l.resetWarningCache = function() {
|
|
439
|
-
process.env.NODE_ENV !== "production" && (n = {});
|
|
440
|
-
}, he = l, he;
|
|
441
|
-
}
|
|
442
|
-
var ge, Ne;
|
|
443
|
-
function Zn() {
|
|
444
|
-
if (Ne)
|
|
445
|
-
return ge;
|
|
446
|
-
Ne = 1;
|
|
447
|
-
var e = et, t = Xn(), n = je(), o = tt(), l = Jn(), s = function() {
|
|
448
|
-
};
|
|
449
|
-
process.env.NODE_ENV !== "production" && (s = function(c) {
|
|
450
|
-
var p = "Warning: " + c;
|
|
451
|
-
typeof console < "u" && console.error(p);
|
|
452
|
-
try {
|
|
453
|
-
throw new Error(p);
|
|
454
|
-
} catch {
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
function i() {
|
|
458
|
-
return null;
|
|
459
|
-
}
|
|
460
|
-
return ge = function(c, p) {
|
|
461
|
-
var u = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
|
|
462
|
-
function f(a) {
|
|
463
|
-
var d = a && (u && a[u] || a[h]);
|
|
464
|
-
if (typeof d == "function")
|
|
465
|
-
return d;
|
|
466
|
-
}
|
|
467
|
-
var v = "<<anonymous>>", k = {
|
|
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: L,
|
|
478
|
-
element: le(),
|
|
479
|
-
elementType: ce(),
|
|
480
|
-
instanceOf: D,
|
|
481
|
-
node: dt(),
|
|
482
|
-
objectOf: N,
|
|
483
|
-
oneOf: _,
|
|
484
|
-
oneOfType: ct,
|
|
485
|
-
shape: ut,
|
|
486
|
-
exact: pt
|
|
487
|
-
};
|
|
488
|
-
function P(a, d) {
|
|
489
|
-
return a === d ? a !== 0 || 1 / a === 1 / d : a !== a && d !== d;
|
|
490
|
-
}
|
|
491
|
-
function j(a, d) {
|
|
492
|
-
this.message = a, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
|
|
493
|
-
}
|
|
494
|
-
j.prototype = Error.prototype;
|
|
495
|
-
function I(a) {
|
|
496
|
-
if (process.env.NODE_ENV !== "production")
|
|
497
|
-
var d = {}, w = 0;
|
|
498
|
-
function x(C, y, b, T, E, S, R) {
|
|
499
|
-
if (T = T || v, S = S || b, R !== n) {
|
|
500
|
-
if (p) {
|
|
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
|
-
w < 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, w++);
|
|
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 : a(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(a) {
|
|
519
|
-
function d(w, x, g, C, y, b) {
|
|
520
|
-
var T = w[x], E = W(T);
|
|
521
|
-
if (E !== a) {
|
|
522
|
-
var S = J(T);
|
|
523
|
-
return new j(
|
|
524
|
-
"Invalid " + C + " `" + y + "` of type " + ("`" + S + "` supplied to `" + g + "`, expected ") + ("`" + a + "`."),
|
|
525
|
-
{ expectedType: a }
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
return null;
|
|
529
|
-
}
|
|
530
|
-
return I(d);
|
|
531
|
-
}
|
|
532
|
-
function V() {
|
|
533
|
-
return I(i);
|
|
534
|
-
}
|
|
535
|
-
function L(a) {
|
|
536
|
-
function d(w, x, g, C, y) {
|
|
537
|
-
if (typeof a != "function")
|
|
538
|
-
return new j("Property `" + y + "` of component `" + g + "` has invalid PropType notation inside arrayOf.");
|
|
539
|
-
var b = w[x];
|
|
540
|
-
if (!Array.isArray(b)) {
|
|
541
|
-
var T = W(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 = a(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 a(d, w, x, g, C) {
|
|
555
|
-
var y = d[w];
|
|
556
|
-
if (!c(y)) {
|
|
557
|
-
var b = W(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(a);
|
|
563
|
-
}
|
|
564
|
-
function ce() {
|
|
565
|
-
function a(d, w, x, g, C) {
|
|
566
|
-
var y = d[w];
|
|
567
|
-
if (!e.isValidElementType(y)) {
|
|
568
|
-
var b = W(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(a);
|
|
574
|
-
}
|
|
575
|
-
function D(a) {
|
|
576
|
-
function d(w, x, g, C, y) {
|
|
577
|
-
if (!(w[x] instanceof a)) {
|
|
578
|
-
var b = a.name || v, T = gt(w[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 _(a) {
|
|
586
|
-
if (!Array.isArray(a))
|
|
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.")), i;
|
|
590
|
-
function d(w, x, g, C, y) {
|
|
591
|
-
for (var b = w[x], T = 0; T < a.length; T++)
|
|
592
|
-
if (P(b, a[T]))
|
|
593
|
-
return null;
|
|
594
|
-
var E = JSON.stringify(a, function(R, O) {
|
|
595
|
-
var X = J(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(a) {
|
|
603
|
-
function d(w, x, g, C, y) {
|
|
604
|
-
if (typeof a != "function")
|
|
605
|
-
return new j("Property `" + y + "` of component `" + g + "` has invalid PropType notation inside objectOf.");
|
|
606
|
-
var b = w[x], T = W(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 (o(b, E)) {
|
|
611
|
-
var S = a(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 ct(a) {
|
|
620
|
-
if (!Array.isArray(a))
|
|
621
|
-
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), i;
|
|
622
|
-
for (var d = 0; d < a.length; d++) {
|
|
623
|
-
var w = a[d];
|
|
624
|
-
if (typeof w != "function")
|
|
625
|
-
return s(
|
|
626
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ht(w) + " at index " + d + "."
|
|
627
|
-
), i;
|
|
628
|
-
}
|
|
629
|
-
function x(g, C, y, b, T) {
|
|
630
|
-
for (var E = [], S = 0; S < a.length; S++) {
|
|
631
|
-
var R = a[S], O = R(g, C, y, b, T, n);
|
|
632
|
-
if (O == null)
|
|
633
|
-
return null;
|
|
634
|
-
O.data && o(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 dt() {
|
|
642
|
-
function a(d, w, x, g, C) {
|
|
643
|
-
return ee(d[w]) ? null : new j("Invalid " + g + " `" + C + "` supplied to " + ("`" + x + "`, expected a ReactNode."));
|
|
644
|
-
}
|
|
645
|
-
return I(a);
|
|
646
|
-
}
|
|
647
|
-
function Te(a, d, w, x, g) {
|
|
648
|
-
return new j(
|
|
649
|
-
(a || "React class") + ": " + d + " type `" + w + "." + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + g + "`."
|
|
650
|
-
);
|
|
651
|
-
}
|
|
652
|
-
function ut(a) {
|
|
653
|
-
function d(w, x, g, C, y) {
|
|
654
|
-
var b = w[x], T = W(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 a) {
|
|
658
|
-
var S = a[E];
|
|
659
|
-
if (typeof S != "function")
|
|
660
|
-
return Te(g, C, y, E, J(S));
|
|
661
|
-
var R = S(b, E, g, C, y + "." + E, n);
|
|
662
|
-
if (R)
|
|
663
|
-
return R;
|
|
664
|
-
}
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
667
|
-
return I(d);
|
|
668
|
-
}
|
|
669
|
-
function pt(a) {
|
|
670
|
-
function d(w, x, g, C, y) {
|
|
671
|
-
var b = w[x], T = W(b);
|
|
672
|
-
if (T !== "object")
|
|
673
|
-
return new j("Invalid " + C + " `" + y + "` of type `" + T + "` " + ("supplied to `" + g + "`, expected `object`."));
|
|
674
|
-
var E = t({}, w[x], a);
|
|
675
|
-
for (var S in E) {
|
|
676
|
-
var R = a[S];
|
|
677
|
-
if (o(a, S) && typeof R != "function")
|
|
678
|
-
return Te(g, C, y, S, J(R));
|
|
679
|
-
if (!R)
|
|
680
|
-
return new j(
|
|
681
|
-
"Invalid " + C + " `" + y + "` key `" + S + "` supplied to `" + g + "`.\nBad object: " + JSON.stringify(w[x], null, " ") + `
|
|
682
|
-
Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
|
|
683
|
-
);
|
|
684
|
-
var O = R(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(a) {
|
|
693
|
-
switch (typeof a) {
|
|
694
|
-
case "number":
|
|
695
|
-
case "string":
|
|
696
|
-
case "undefined":
|
|
697
|
-
return !0;
|
|
698
|
-
case "boolean":
|
|
699
|
-
return !a;
|
|
700
|
-
case "object":
|
|
701
|
-
if (Array.isArray(a))
|
|
702
|
-
return a.every(ee);
|
|
703
|
-
if (a === null || c(a))
|
|
704
|
-
return !0;
|
|
705
|
-
var d = f(a);
|
|
706
|
-
if (d) {
|
|
707
|
-
var w = d.call(a), x;
|
|
708
|
-
if (d !== a.entries) {
|
|
709
|
-
for (; !(x = w.next()).done; )
|
|
710
|
-
if (!ee(x.value))
|
|
711
|
-
return !1;
|
|
712
|
-
} else
|
|
713
|
-
for (; !(x = w.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 ft(a, d) {
|
|
726
|
-
return a === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
|
|
727
|
-
}
|
|
728
|
-
function W(a) {
|
|
729
|
-
var d = typeof a;
|
|
730
|
-
return Array.isArray(a) ? "array" : a instanceof RegExp ? "object" : ft(d, a) ? "symbol" : d;
|
|
731
|
-
}
|
|
732
|
-
function J(a) {
|
|
733
|
-
if (typeof a > "u" || a === null)
|
|
734
|
-
return "" + a;
|
|
735
|
-
var d = W(a);
|
|
736
|
-
if (d === "object") {
|
|
737
|
-
if (a instanceof Date)
|
|
738
|
-
return "date";
|
|
739
|
-
if (a instanceof RegExp)
|
|
740
|
-
return "regexp";
|
|
741
|
-
}
|
|
742
|
-
return d;
|
|
743
|
-
}
|
|
744
|
-
function ht(a) {
|
|
745
|
-
var d = J(a);
|
|
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 gt(a) {
|
|
759
|
-
return !a.constructor || !a.constructor.name ? v : a.constructor.name;
|
|
760
|
-
}
|
|
761
|
-
return k.checkPropTypes = l, k.resetWarningCache = l.resetWarningCache, k.PropTypes = k, k;
|
|
762
|
-
}, ge;
|
|
763
|
-
}
|
|
764
|
-
var me, Fe;
|
|
765
|
-
function Gn() {
|
|
766
|
-
if (Fe)
|
|
767
|
-
return me;
|
|
768
|
-
Fe = 1;
|
|
769
|
-
var e = je();
|
|
770
|
-
function t() {
|
|
771
|
-
}
|
|
772
|
-
function n() {
|
|
773
|
-
}
|
|
774
|
-
return n.resetWarningCache = t, me = function() {
|
|
775
|
-
function o(i, c, p, u, h, f) {
|
|
776
|
-
if (f !== e) {
|
|
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
|
-
o.isRequired = o;
|
|
784
|
-
function l() {
|
|
785
|
-
return o;
|
|
786
|
-
}
|
|
787
|
-
var s = {
|
|
788
|
-
array: o,
|
|
789
|
-
bigint: o,
|
|
790
|
-
bool: o,
|
|
791
|
-
func: o,
|
|
792
|
-
number: o,
|
|
793
|
-
object: o,
|
|
794
|
-
string: o,
|
|
795
|
-
symbol: o,
|
|
796
|
-
any: o,
|
|
797
|
-
arrayOf: l,
|
|
798
|
-
element: o,
|
|
799
|
-
elementType: o,
|
|
800
|
-
instanceOf: l,
|
|
801
|
-
node: o,
|
|
802
|
-
objectOf: l,
|
|
803
|
-
oneOf: l,
|
|
804
|
-
oneOfType: l,
|
|
805
|
-
shape: l,
|
|
806
|
-
exact: l,
|
|
807
|
-
checkPropTypes: n,
|
|
808
|
-
resetWarningCache: t
|
|
809
|
-
};
|
|
810
|
-
return s.PropTypes = s, s;
|
|
811
|
-
}, me;
|
|
812
|
-
}
|
|
813
|
-
var Ls = oe.exports;
|
|
814
|
-
if (process.env.NODE_ENV !== "production") {
|
|
815
|
-
var Qn = et, er = !0;
|
|
816
|
-
oe.exports = Zn()(Qn.isElement, er);
|
|
817
|
-
} else
|
|
818
|
-
oe.exports = Gn()();
|
|
819
|
-
var tr = oe.exports;
|
|
820
|
-
const A = /* @__PURE__ */ Tn(tr);
|
|
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: nr, Consumer: _s } = st;
|
|
825
|
-
class ot extends qe {
|
|
826
|
-
componentDidMount() {
|
|
827
|
-
this.props.contentDidMount();
|
|
828
|
-
}
|
|
829
|
-
componentDidUpdate() {
|
|
830
|
-
this.props.contentDidUpdate();
|
|
831
|
-
}
|
|
832
|
-
render() {
|
|
833
|
-
return xt.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, o) {
|
|
843
|
-
super(n, o);
|
|
844
|
-
z(this, "setRef", (n) => {
|
|
845
|
-
this.nodeRef.current = n;
|
|
846
|
-
const { forwardedRef: o } = this.props;
|
|
847
|
-
typeof o == "function" ? o(n) : o && (o.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 o = this.props.contentDidMount, l = this.props.contentDidUpdate, s = n.defaultView || n.parentView, i = /* @__PURE__ */ r.jsx(ot, { contentDidMount: o, contentDidUpdate: l, children: /* @__PURE__ */ r.jsx(nr, { value: { document: n, window: s }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), c = this.getMountTarget();
|
|
879
|
-
return [Be.createPortal(this.props.head, this.getDoc().head), Be.createPortal(i, c)];
|
|
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 rr = Y.forwardRef((e, t) => /* @__PURE__ */ r.jsx(ye, { ...e, forwardedRef: t }));
|
|
916
|
-
let q = null, G = [], it = null;
|
|
917
|
-
function sr(e) {
|
|
918
|
-
const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), o = parseInt(t.paddingTop, 10), l = parseInt(t.paddingRight, 10), s = parseInt(t.paddingBottom, 10);
|
|
919
|
-
return { paddingLeft: n, paddingTop: o, paddingRight: l, paddingBottom: s };
|
|
920
|
-
}
|
|
921
|
-
const We = (e, t, n) => {
|
|
922
|
-
if (!q)
|
|
923
|
-
return;
|
|
924
|
-
const o = e.getBoundingClientRect(), l = q == null ? void 0 : q.getElementById("placeholder"), { paddingLeft: s, paddingTop: i, paddingRight: c, paddingBottom: p } = sr(e);
|
|
925
|
-
l.style.width = t === "vertical" ? o.width - s - c + "px" : "2px", l.style.height = t === "vertical" ? "2px" : o.height - i - p + "px", l.style.display = "block";
|
|
926
|
-
const u = G.reduce(
|
|
927
|
-
(h, f) => Math.abs(f - n) < Math.abs(h - n) ? f : h
|
|
928
|
-
);
|
|
929
|
-
it = G.indexOf(u), t === "vertical" ? (l.style.top = e.offsetTop + u + "px", l.style.left = e.offsetLeft + s + "px") : (l.style.top = e.offsetTop + i + "px", l.style.left = e.offsetLeft + u + "px");
|
|
930
|
-
}, or = (e) => {
|
|
931
|
-
const t = at(e), n = window.getComputedStyle(e), o = t === "horizontal", l = parseInt(n.paddingLeft), s = parseInt(n.paddingTop);
|
|
932
|
-
let i = o ? l : s;
|
|
933
|
-
G = [i], Array.from(e.children).forEach((c) => {
|
|
934
|
-
const p = window.getComputedStyle(c), u = parseInt(
|
|
935
|
-
o ? p.marginLeft + p.marginRight : p.marginTop + p.marginBottom
|
|
936
|
-
), h = o ? c.offsetWidth : c.offsetHeight;
|
|
937
|
-
G.push(i + h + u), i += h + u;
|
|
938
|
-
});
|
|
939
|
-
};
|
|
940
|
-
function at(e) {
|
|
941
|
-
const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
|
|
942
|
-
if (t === "flex")
|
|
943
|
-
return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
|
|
944
|
-
if (t === "grid") {
|
|
945
|
-
const o = window.getComputedStyle(e).gridTemplateRows, l = window.getComputedStyle(e).gridTemplateColumns;
|
|
946
|
-
if (o.includes("auto"))
|
|
947
|
-
return "vertical";
|
|
948
|
-
if (l.includes("auto"))
|
|
949
|
-
return "horizontal";
|
|
950
|
-
}
|
|
951
|
-
return t === "block" ? "vertical" : "horizontal";
|
|
952
|
-
}
|
|
953
|
-
const ir = He((e) => {
|
|
954
|
-
const t = e.target, n = at(t);
|
|
955
|
-
if (n === "vertical") {
|
|
956
|
-
const o = e.clientY - t.offsetTop;
|
|
957
|
-
We(t, n, o);
|
|
958
|
-
} else {
|
|
959
|
-
const o = e.clientX - t.offsetLeft;
|
|
960
|
-
We(t, n, o);
|
|
961
|
-
}
|
|
962
|
-
}, 200), ar = (e) => {
|
|
963
|
-
e.preventDefault(), e.stopPropagation(), ir(e);
|
|
964
|
-
};
|
|
965
|
-
function $e() {
|
|
966
|
-
const e = q == null ? void 0 : q.getElementById("placeholder");
|
|
967
|
-
e.style.display = "none";
|
|
968
|
-
}
|
|
969
|
-
const lr = () => {
|
|
970
|
-
const { document: e } = ae(), [t, n] = F(an), o = Bn(), l = On("dnd");
|
|
971
|
-
return q = e, {
|
|
972
|
-
isDragging: t,
|
|
973
|
-
"data-dnd": "branch",
|
|
974
|
-
onDragOver: l ? ar : Z,
|
|
975
|
-
onDrop: l ? (s) => {
|
|
976
|
-
const i = JSON.parse(s.dataTransfer.getData("text/plain"));
|
|
977
|
-
let c = s.target.getAttribute("data-block-id");
|
|
978
|
-
c === null && (c = s.target.parentElement.getAttribute("data-block-id")), o({ block: i, dropTargetId: c || null, relativeIndex: it }), n(!1), setTimeout(() => $e(), 300);
|
|
979
|
-
} : Z,
|
|
980
|
-
onDragEnter: l ? (s) => {
|
|
981
|
-
const i = s;
|
|
982
|
-
i.stopPropagation(), i.preventDefault(), G = [];
|
|
983
|
-
const c = i.target;
|
|
984
|
-
or(c), c.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0);
|
|
985
|
-
} : Z,
|
|
986
|
-
onDragLeave: l ? (s) => {
|
|
987
|
-
const i = s;
|
|
988
|
-
i.stopPropagation(), i.preventDefault(), i.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
989
|
-
} : Z,
|
|
990
|
-
onMouseOut: l ? () => {
|
|
991
|
-
n(!1), $e();
|
|
992
|
-
} : Z
|
|
993
|
-
};
|
|
994
|
-
};
|
|
995
|
-
function Ce(e) {
|
|
996
|
-
return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
|
|
997
|
-
}
|
|
998
|
-
function cr(e) {
|
|
999
|
-
e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
|
|
1000
|
-
var t = document.querySelector(".ql-toolbar");
|
|
1001
|
-
t && t.parentNode.removeChild(t), e = null;
|
|
1002
|
-
}
|
|
1003
|
-
const dr = () => {
|
|
1004
|
-
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = ln(), [, n] = H(), [, o] = ie(), [l, s] = F(Q);
|
|
1005
|
-
return (i) => {
|
|
1006
|
-
var v;
|
|
1007
|
-
if (l)
|
|
1008
|
-
return;
|
|
1009
|
-
const c = Ce(i.target), p = c.getAttribute("data-block-type");
|
|
1010
|
-
if (!p || !e.includes(p))
|
|
1011
|
-
return;
|
|
1012
|
-
const u = c.cloneNode(!0);
|
|
1013
|
-
c.style.display = "none", Array.from(u.attributes).forEach((k) => {
|
|
1014
|
-
k.name !== "class" && u.removeAttribute(k.name);
|
|
1015
|
-
}), p === "Text" && (u.style.display = "inline-block"), c.parentNode.insertBefore(u, c.nextSibling);
|
|
1016
|
-
const h = new Dn(u, { placeholder: "Type here..." });
|
|
1017
|
-
function f() {
|
|
1018
|
-
const k = h.getText(0, h.getLength());
|
|
1019
|
-
t([c.getAttribute("data-block-id")], { content: k }), c.removeAttribute("style"), u.removeEventListener("blur", f, !0), cr(h), s(""), o("");
|
|
1020
|
-
}
|
|
1021
|
-
u.addEventListener("blur", f, !0), h.focus(), (v = u.querySelector(".ql-clipboard")) == null || v.remove(), n([]), s(c.getAttribute("data-block-id"));
|
|
1022
|
-
};
|
|
1023
|
-
}, ur = () => {
|
|
1024
|
-
const [, e] = K(), [, t] = H(), [n] = F(Q);
|
|
1025
|
-
return (o) => {
|
|
1026
|
-
if (n)
|
|
1027
|
-
return;
|
|
1028
|
-
o.stopPropagation();
|
|
1029
|
-
const l = Ce(o.target);
|
|
1030
|
-
if (l.getAttribute("data-block-parent")) {
|
|
1031
|
-
const s = l.getAttribute("data-style-prop"), i = l.getAttribute("data-style-id"), c = l.getAttribute("data-block-parent");
|
|
1032
|
-
e([{ id: i, prop: s, blockId: c }]), t([c]);
|
|
1033
|
-
} else
|
|
1034
|
-
l.getAttribute("data-block-id") && t([l.getAttribute("data-block-id")]);
|
|
1035
|
-
};
|
|
1036
|
-
}, pr = He((e, t) => {
|
|
1037
|
-
const n = Ce(e.target);
|
|
1038
|
-
n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
|
|
1039
|
-
}, 100), fr = () => {
|
|
1040
|
-
const [, e] = ie(), [t] = F(Q);
|
|
1041
|
-
return (n) => {
|
|
1042
|
-
t || pr(n, e);
|
|
1043
|
-
};
|
|
1044
|
-
}, hr = ({ children: e }) => {
|
|
1045
|
-
const { document: t } = ae(), [n] = H(), [o, l] = K();
|
|
1046
|
-
M(() => {
|
|
1047
|
-
setTimeout(() => {
|
|
1048
|
-
if (!U(o))
|
|
1049
|
-
return;
|
|
1050
|
-
const u = lt(t, re(n));
|
|
1051
|
-
if (u) {
|
|
1052
|
-
const h = u.getAttribute("data-style-prop");
|
|
1053
|
-
if (h) {
|
|
1054
|
-
const f = u.getAttribute("data-style-id"), v = u.getAttribute("data-block-parent");
|
|
1055
|
-
l([{ id: f, prop: h, blockId: v }]);
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}, 100);
|
|
1059
|
-
}, [t, n, l, o]);
|
|
1060
|
-
const s = dr(), i = ur(), c = fr(), p = lr();
|
|
1061
|
-
return /* @__PURE__ */ r.jsx(
|
|
1062
|
-
"div",
|
|
1063
|
-
{
|
|
1064
|
-
id: "canvas",
|
|
1065
|
-
onClick: i,
|
|
1066
|
-
onDoubleClick: s,
|
|
1067
|
-
onMouseMove: c,
|
|
1068
|
-
...jt(p, "isDragging"),
|
|
1069
|
-
className: "relative h-screen max-w-full " + (p.isDragging ? "dragging" : ""),
|
|
1070
|
-
children: e
|
|
1071
|
-
}
|
|
1072
|
-
);
|
|
1073
|
-
}, lt = (e, t) => e.querySelector(`[data-block-id="${t}"]`), gr = () => {
|
|
1074
|
-
const { window: e } = ae(), [t, n] = H(), [, o] = K(), { undo: l, redo: s } = we(), i = Ve(), [, c] = cn(), [, p] = dn(), { pasteBlocks: u } = un(), [, h] = Xe(), f = Je(), { savePage: v } = pn(), [k] = F(Q), [, P] = F(fn), j = (I) => {
|
|
1075
|
-
I.key === "Enter" && (I.preventDefault(), t.length === 1 && P(re(t)));
|
|
1076
|
-
};
|
|
1077
|
-
return M(() => {
|
|
1078
|
-
const I = (m) => {
|
|
1079
|
-
if (m.key === "Escape") {
|
|
1080
|
-
n([]), o([]);
|
|
1081
|
-
return;
|
|
1082
|
-
}
|
|
1083
|
-
if (j(m), !k && (m.key === "Delete" || m.key === "Backspace") && (m.preventDefault(), f(t)), m.ctrlKey || m.metaKey) {
|
|
1084
|
-
if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(m.key)) {
|
|
1085
|
-
if (k && ["x", "z", "v"].includes(m.key))
|
|
1086
|
-
return !0;
|
|
1087
|
-
m.preventDefault();
|
|
1088
|
-
}
|
|
1089
|
-
m.key === "s" && (m.stopPropagation(), m.preventDefault(), v()), m.key === "z" && l(), m.key === "y" && s(), m.key === "d" && i(t), m.key === "x" && c(t), m.key === "c" && p(t), m.key === "v" && t.length > 0 && u(t[0]);
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
1092
|
-
return e.removeEventListener("keydown", I), e.addEventListener("keydown", I), () => {
|
|
1093
|
-
e.removeEventListener("keydown", I);
|
|
1094
|
-
};
|
|
1095
|
-
}, [
|
|
1096
|
-
t,
|
|
1097
|
-
n,
|
|
1098
|
-
l,
|
|
1099
|
-
f,
|
|
1100
|
-
h,
|
|
1101
|
-
s,
|
|
1102
|
-
i,
|
|
1103
|
-
c,
|
|
1104
|
-
p,
|
|
1105
|
-
u,
|
|
1106
|
-
k,
|
|
1107
|
-
v,
|
|
1108
|
-
e
|
|
1109
|
-
]), null;
|
|
1110
|
-
}, mr = ({ block: e, label: t }) => {
|
|
1111
|
-
const [, n] = Mn(() => ({
|
|
1112
|
-
type: "CANVAS_BLOCK",
|
|
1113
|
-
item: e
|
|
1114
|
-
}));
|
|
1115
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1116
|
-
"div",
|
|
1117
|
-
{
|
|
1118
|
-
className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
|
|
1119
|
-
ref: n,
|
|
1120
|
-
onDragStart: () => {
|
|
1121
|
-
console.log("drag start");
|
|
1122
|
-
},
|
|
1123
|
-
children: [
|
|
1124
|
-
/* @__PURE__ */ r.jsx(Pt, {}),
|
|
1125
|
-
t
|
|
1126
|
-
]
|
|
1127
|
-
}
|
|
1128
|
-
);
|
|
1129
|
-
}, yr = ({ selectedBlockElement: e, block: t }) => {
|
|
1130
|
-
const n = Je(), o = Ve(), [, l] = H(), [, s] = K(), { floatingStyles: i, refs: c, update: p } = Pn({
|
|
1131
|
-
placement: "top-start",
|
|
1132
|
-
middleware: [Rn(), An()],
|
|
1133
|
-
elements: {
|
|
1134
|
-
reference: e
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
Ln(e, () => p(), e !== null);
|
|
1138
|
-
const u = B(t, "_parent", null), h = U(B(t, "_name", "")) ? B(t, "_type", "") : B(t, "_name", "");
|
|
1139
|
-
return !e || !t ? null : /* @__PURE__ */ r.jsxs(
|
|
1140
|
-
"div",
|
|
1141
|
-
{
|
|
1142
|
-
role: "button",
|
|
1143
|
-
tabIndex: 0,
|
|
1144
|
-
ref: c.setFloating,
|
|
1145
|
-
style: i,
|
|
1146
|
-
onClick: (f) => {
|
|
1147
|
-
f.stopPropagation(), f.preventDefault();
|
|
1148
|
-
},
|
|
1149
|
-
onKeyDown: (f) => f.stopPropagation(),
|
|
1150
|
-
className: "z-50 flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
1151
|
-
children: [
|
|
1152
|
-
/* @__PURE__ */ r.jsx(mr, { label: h, block: t }),
|
|
1153
|
-
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1 ", children: [
|
|
1154
|
-
u && /* @__PURE__ */ r.jsx(
|
|
1155
|
-
Rt,
|
|
1156
|
-
{
|
|
1157
|
-
className: "hover:scale-105 ",
|
|
1158
|
-
onClick: () => {
|
|
1159
|
-
s([]), l([u]);
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
),
|
|
1163
|
-
hn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Mt, { className: "hover:scale-105 ", onClick: () => o([t == null ? void 0 : t._id]) }) : null,
|
|
1164
|
-
gn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Lt, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
|
|
1165
|
-
] })
|
|
1166
|
-
]
|
|
1167
|
-
}
|
|
1168
|
-
);
|
|
1169
|
-
}, vr = ({ model: e }) => {
|
|
1170
|
-
const [t] = mn(), [n] = H(), [o] = Ye(), [l] = ie(), [s] = K(), { document: i, window: c } = ae(), [p] = $(i == null ? void 0 : i.getElementById("highlighted-block")), [u] = $(
|
|
1171
|
-
i == null ? void 0 : i.getElementById("selected-block")
|
|
1172
|
-
), [h] = $(
|
|
1173
|
-
i == null ? void 0 : i.getElementById("selected-styling-block")
|
|
1174
|
-
);
|
|
1175
|
-
M(() => {
|
|
1176
|
-
o ? i == null || i.documentElement.classList.add("dark") : i == null || i.documentElement.classList.remove("dark");
|
|
1177
|
-
}, [o, i]);
|
|
1178
|
-
const f = B(t, "headingFont", "DM Sans"), v = B(t, "bodyFont", "DM Sans");
|
|
1179
|
-
return M(() => {
|
|
1180
|
-
const k = B(t, "primaryColor", "#000"), P = B(t, "secondaryColor", "#FFF"), j = _n({
|
|
1181
|
-
colors: [k, P],
|
|
1182
|
-
names: ["primary", "secondary"]
|
|
1183
|
-
});
|
|
1184
|
-
j.primary.DEFAULT = k, j.secondary.DEFAULT = P;
|
|
1185
|
-
const I = B(t, "roundedCorners", "0");
|
|
1186
|
-
!c || !c.tailwind || (c.tailwind.config = {
|
|
1187
|
-
darkMode: "class",
|
|
1188
|
-
theme: {
|
|
1189
|
-
fontFamily: {
|
|
1190
|
-
heading: [f],
|
|
1191
|
-
body: [v]
|
|
1192
|
-
},
|
|
1193
|
-
extend: {
|
|
1194
|
-
borderRadius: {
|
|
1195
|
-
global: `${I || "0"}px`
|
|
1196
|
-
},
|
|
1197
|
-
colors: j
|
|
1198
|
-
}
|
|
1199
|
-
},
|
|
1200
|
-
plugins: [
|
|
1201
|
-
// @ts-ignore
|
|
1202
|
-
c.tailwind.plugin.withOptions(({ prefix: m = "ui" } = {}) => ({ addVariant: V }) => {
|
|
1203
|
-
for (const L of ["open", "checked", "selected", "active", "disabled"])
|
|
1204
|
-
V(`${m}-${L}`, [
|
|
1205
|
-
`&[data-headlessui-state~="${L}"]`,
|
|
1206
|
-
`:where([data-headlessui-state~="${L}"]) &`
|
|
1207
|
-
]), V(`${m}-not-${L}`, [
|
|
1208
|
-
`&[data-headlessui-state]:not([data-headlessui-state~="${L}"])`,
|
|
1209
|
-
`:where([data-headlessui-state]:not([data-headlessui-state~="${L}"])) &:not([data-headlessui-state])`
|
|
1210
|
-
]);
|
|
1211
|
-
})
|
|
1212
|
-
]
|
|
1213
|
-
});
|
|
1214
|
-
}, [t, c, f, v]), M(() => {
|
|
1215
|
-
u && (u.textContent = `${ne(n, (k) => `[data-block-id="${k}"]`).join(",")}{
|
|
1216
|
-
outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
1217
|
-
}`);
|
|
1218
|
-
}, [n, u]), M(() => {
|
|
1219
|
-
p && (p.textContent = l ? `[data-style-id="${l}"]{ outline: 1px solid orange !important; outline-offset: -1px;}` : "");
|
|
1220
|
-
}, [l, n, p]), M(() => {
|
|
1221
|
-
h && (h.textContent = `${ne(s, ({ id: k }) => `[data-style-id="${k}"]`).join(",")}{
|
|
1222
|
-
outline: 1px solid orange !important; outline-offset: -1px;
|
|
1223
|
-
}`);
|
|
1224
|
-
}, [s, h]), M(() => {
|
|
1225
|
-
if (e === "section")
|
|
1226
|
-
return;
|
|
1227
|
-
const k = B(t, "bodyTextLightColor", "#64748b"), P = B(t, "bodyTextDarkColor", "#94a3b8"), j = B(t, "bodyBgLightColor", "#FFFFFF"), I = B(t, "bodyBgDarkColor", "#0f172a");
|
|
1228
|
-
i.body.className = `font-body antialiased text-[${k}] bg-[${j}] dark:text-[${P}] dark:bg-[${I}]`;
|
|
1229
|
-
}, [t, i, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1230
|
-
f && /* @__PURE__ */ r.jsx(
|
|
1231
|
-
"link",
|
|
1232
|
-
{
|
|
1233
|
-
id: "heading-font",
|
|
1234
|
-
rel: "stylesheet",
|
|
1235
|
-
type: "text/css",
|
|
1236
|
-
href: `https://fonts.googleapis.com/css2?family=${f.replace(
|
|
1237
|
-
/ /g,
|
|
1238
|
-
"+"
|
|
1239
|
-
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1240
|
-
media: "all"
|
|
1241
|
-
}
|
|
1242
|
-
),
|
|
1243
|
-
v && f !== v && /* @__PURE__ */ r.jsx(
|
|
1244
|
-
"link",
|
|
1245
|
-
{
|
|
1246
|
-
id: "body-font",
|
|
1247
|
-
rel: "stylesheet",
|
|
1248
|
-
type: "text/css",
|
|
1249
|
-
href: `https://fonts.googleapis.com/css2?family=${v.replace(
|
|
1250
|
-
/ /g,
|
|
1251
|
-
"+"
|
|
1252
|
-
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1253
|
-
media: "all"
|
|
1254
|
-
}
|
|
1255
|
-
),
|
|
1256
|
-
f && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${f}",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";}` })
|
|
1257
|
-
] }) : null;
|
|
1258
|
-
}, xr = (e) => {
|
|
1259
|
-
const t = {};
|
|
1260
|
-
return Object.keys(e).forEach((n) => {
|
|
1261
|
-
be(e[n]) && e[n].startsWith(Oe) && (t[n] = e[n].replace(Oe, "").split(","));
|
|
1262
|
-
}), t;
|
|
1263
|
-
}, br = Ct((e) => {
|
|
1264
|
-
const t = e.replace(Qe, "").split(",");
|
|
1265
|
-
return Fn(t[0], t[1]);
|
|
1266
|
-
});
|
|
1267
|
-
function wr(e, t) {
|
|
1268
|
-
return B(e, `${t}_attrs`, {});
|
|
1269
|
-
}
|
|
1270
|
-
function kr(e) {
|
|
1271
|
-
const t = {};
|
|
1272
|
-
return Object.keys(e).forEach((n) => {
|
|
1273
|
-
if (be(e[n]) && e[n].startsWith(Qe)) {
|
|
1274
|
-
const o = br(e[n]);
|
|
1275
|
-
t[n] = {
|
|
1276
|
-
className: o,
|
|
1277
|
-
"data-style-prop": n,
|
|
1278
|
-
"data-block-parent": e._id,
|
|
1279
|
-
"data-style-id": `${n}-${e._id}`,
|
|
1280
|
-
...wr(e, n)
|
|
1281
|
-
};
|
|
1282
|
-
}
|
|
1283
|
-
}), t;
|
|
1284
|
-
}
|
|
1285
|
-
function jr(e, t) {
|
|
1286
|
-
const n = B(e, "_bindings", {});
|
|
1287
|
-
return U(n) ? { ...e } : (Tt(n, (o, l) => {
|
|
1288
|
-
be(o) && B(t, o, null) && (e[l] = B(t, o, null));
|
|
1289
|
-
}), e);
|
|
1290
|
-
}
|
|
1291
|
-
function ve({ blocks: e }) {
|
|
1292
|
-
const t = Ze(), n = xe((s) => kr(s), []), [o] = Sn(), [l] = yn(Q);
|
|
1293
|
-
return /* @__PURE__ */ r.jsx(r.Fragment, { children: Y.Children.toArray(
|
|
1294
|
-
e.map((s, i) => {
|
|
1295
|
-
if (l === s._id)
|
|
1296
|
-
return null;
|
|
1297
|
-
const c = xr(s), p = {};
|
|
1298
|
-
U(c) || Object.keys(c).forEach((v) => {
|
|
1299
|
-
p[v] = Y.Children.toArray(
|
|
1300
|
-
c[v].map((k) => /* @__PURE__ */ r.jsx(ve, { blocks: [St(t, { _id: k })] }))
|
|
1301
|
-
);
|
|
1302
|
-
});
|
|
1303
|
-
const u = ze(t, { _parent: s._id });
|
|
1304
|
-
p.children = u.length ? /* @__PURE__ */ r.jsx(ve, { blocks: u }) : null;
|
|
1305
|
-
const h = Wn(s._type), f = B(h, "component", null);
|
|
1306
|
-
return Et(f) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${s == null ? void 0 : s._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ue, { children: Y.createElement(f, {
|
|
1307
|
-
blockProps: {
|
|
1308
|
-
"data-block-id": s._id,
|
|
1309
|
-
"data-block-type": s._type,
|
|
1310
|
-
"data-dnd": vn(s._type) ? "branch" : "leaf"
|
|
1311
|
-
},
|
|
1312
|
-
inBuilder: !0,
|
|
1313
|
-
index: i,
|
|
1314
|
-
...jr(s, o),
|
|
1315
|
-
...n(s),
|
|
1316
|
-
...p
|
|
1317
|
-
}) });
|
|
1318
|
-
})
|
|
1319
|
-
) });
|
|
1320
|
-
}
|
|
1321
|
-
const Cr = () => {
|
|
1322
|
-
const e = Ze();
|
|
1323
|
-
return /* @__PURE__ */ r.jsx(Nn, { children: U(e) ? null : /* @__PURE__ */ r.jsx(En, { children: /* @__PURE__ */ r.jsx(ve, { blocks: ze(e, (t) => U(t._parent)) }) }) });
|
|
1324
|
-
}, Tr = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Sr = () => {
|
|
1325
|
-
const [e] = F(xn), [t] = Xe(), [n] = ke(), [, o] = H(), l = bn(), [, s] = ie(), i = Se(null), c = Se(null), [p, u] = $({ width: 0, height: 0 }), h = Vn(p), [f, v] = $(0), [k, P] = $([]), [, j] = $([]), [, I] = F(wn), [m, V] = K(), L = kn("loadingCanvas", !1);
|
|
1326
|
-
M(() => {
|
|
1327
|
-
const { clientWidth: D, clientHeight: _ } = c.current;
|
|
1328
|
-
u({ width: D, height: _ }), f === 0 && v(D);
|
|
1329
|
-
}, [c, n, f]);
|
|
1330
|
-
const le = (D, _ = 0) => {
|
|
1331
|
-
const { top: N } = D.getBoundingClientRect();
|
|
1332
|
-
return N + _ >= 0 && N - _ <= window.innerHeight;
|
|
1333
|
-
};
|
|
1334
|
-
M(() => {
|
|
1335
|
-
var D, _;
|
|
1336
|
-
if (l && l.type !== "Multiple" && i.current) {
|
|
1337
|
-
const N = lt(i.current.contentDocument, l._id);
|
|
1338
|
-
N && (le(N) || (_ = (D = i.current) == null ? void 0 : D.contentWindow) == null || _.scrollTo({ top: N.offsetTop, behavior: "smooth" }), P([N]));
|
|
1339
|
-
}
|
|
1340
|
-
}, [l]), M(() => {
|
|
1341
|
-
if (!U(m) && i.current) {
|
|
1342
|
-
const D = Tr(
|
|
1343
|
-
i.current.contentDocument,
|
|
1344
|
-
re(m).id
|
|
1345
|
-
);
|
|
1346
|
-
j(D ? [D] : [null]);
|
|
1347
|
-
} else
|
|
1348
|
-
j([null]);
|
|
1349
|
-
}, [m]);
|
|
1350
|
-
const ce = bt(() => {
|
|
1351
|
-
let D = Kn;
|
|
1352
|
-
return e === "offline" && (D = D.replace(
|
|
1353
|
-
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1354
|
-
"/offline/tailwind.cdn.js"
|
|
1355
|
-
), 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;
|
|
1356
|
-
}, [e]);
|
|
1357
|
-
return /* @__PURE__ */ r.jsx(
|
|
1358
|
-
"div",
|
|
1359
|
-
{
|
|
1360
|
-
onClick: () => {
|
|
1361
|
-
o([]), V([]);
|
|
1362
|
-
},
|
|
1363
|
-
onMouseLeave: () => setTimeout(() => s(""), 300),
|
|
1364
|
-
className: "relative mx-auto h-full w-full",
|
|
1365
|
-
style: f > 0 && !U(h) ? { width: t ? "100%" : f } : {},
|
|
1366
|
-
ref: c,
|
|
1367
|
-
children: /* @__PURE__ */ r.jsxs(
|
|
1368
|
-
rr,
|
|
1369
|
-
{
|
|
1370
|
-
contentDidMount: () => I(i.current),
|
|
1371
|
-
ref: i,
|
|
1372
|
-
id: "canvas-iframe",
|
|
1373
|
-
style: { width: `${n}px`, ...h },
|
|
1374
|
-
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1375
|
-
initialContent: ce,
|
|
1376
|
-
children: [
|
|
1377
|
-
/* @__PURE__ */ r.jsx(gr, {}),
|
|
1378
|
-
/* @__PURE__ */ r.jsx(
|
|
1379
|
-
yr,
|
|
1380
|
-
{
|
|
1381
|
-
block: l,
|
|
1382
|
-
selectedBlockElement: re(k)
|
|
1383
|
-
}
|
|
1384
|
-
),
|
|
1385
|
-
/* @__PURE__ */ r.jsx(vr, { model: "page" }),
|
|
1386
|
-
/* @__PURE__ */ r.jsx(hr, { children: L ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ge, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Cr, {}) }),
|
|
1387
|
-
/* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
|
|
1388
|
-
]
|
|
1389
|
-
}
|
|
1390
|
-
)
|
|
1391
|
-
}
|
|
1392
|
-
);
|
|
1393
|
-
}, Er = wt(() => import("./AddBlocks-imyQSCbI.js")), Ns = () => {
|
|
1394
|
-
const [e, t] = F(jn);
|
|
1395
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1396
|
-
/* @__PURE__ */ r.jsx(Yn, {}),
|
|
1397
|
-
/* @__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: [
|
|
1398
|
-
/* @__PURE__ */ r.jsx(Ue, { fallback: /* @__PURE__ */ r.jsx(Ge, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(In, { children: /* @__PURE__ */ r.jsx(Sr, {}) }) }),
|
|
1399
|
-
e ? /* @__PURE__ */ r.jsx(
|
|
1400
|
-
"div",
|
|
1401
|
-
{
|
|
1402
|
-
onClick: () => t(!1),
|
|
1403
|
-
className: "absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",
|
|
1404
|
-
children: /* @__PURE__ */ r.jsx(
|
|
1405
|
-
"div",
|
|
1406
|
-
{
|
|
1407
|
-
onClick: (n) => n.stopPropagation(),
|
|
1408
|
-
className: "mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",
|
|
1409
|
-
children: /* @__PURE__ */ r.jsx(Er, {})
|
|
1410
|
-
}
|
|
1411
|
-
)
|
|
1412
|
-
}
|
|
1413
|
-
) : null
|
|
1414
|
-
] })
|
|
1415
|
-
] });
|
|
1416
|
-
};
|
|
1417
|
-
export {
|
|
1418
|
-
Ns as default
|
|
1419
|
-
};
|