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