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