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