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