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