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