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