@chaibuilder/sdk 1.2.43 → 1.2.45
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-UjnfO1xM.cjs +1 -0
- package/dist/{AddBlocks-9UM7zj57.js → AddBlocks-vkMNQu2M.js} +48 -46
- package/dist/CanvasArea-DLg9e6l5.js +1216 -0
- package/dist/CanvasArea-tyXurhEm.cjs +57 -0
- package/dist/{ChaiBuilderEditor-yf2LRjL1.js → ChaiBuilderEditor-1K-wcF5D.js} +3910 -3933
- package/dist/{ChaiBuilderEditor--NV-B5az.cjs → ChaiBuilderEditor-iXQwbYNr.cjs} +44 -44
- package/dist/CurrentPage-6t2cmyoQ.cjs +1 -0
- package/dist/{CurrentPage-hKtVFDxU.js → CurrentPage-JjZQQ8fp.js} +11 -10
- package/dist/{ListTree-ulr_sjdn.js → ListTree-KsggM2ac.js} +4 -3
- package/dist/ListTree-OTrtj3iM.cjs +1 -0
- package/dist/{PagesPanel-EHLY-cfj.js → PagesPanel-bElLBHNI.js} +6 -5
- package/dist/PagesPanel-zm1EC6Iw.cjs +1 -0
- package/dist/ProjectPanel-4zPiPARX.cjs +1 -0
- package/dist/{ProjectPanel-qiqyRbwH.js → ProjectPanel-o1BnitsI.js} +7 -6
- package/dist/Settings-7LXieIrg.cjs +1 -0
- package/dist/{Settings-a7j3ihRx.js → Settings-Bj2wI1at.js} +966 -892
- package/dist/SidePanels-9DSI8ysE.cjs +1 -0
- package/dist/{SidePanels-9XdRZ7rz.js → SidePanels-Q23Yldya.js} +7 -6
- package/dist/{ThemeConfiguration-MaGPPza1.js → ThemeConfiguration-GY85_LR8.js} +6 -5
- package/dist/ThemeConfiguration-mgyKWvYY.cjs +1 -0
- package/dist/Topbar-_7BQ50Y4.cjs +1 -0
- package/dist/{Topbar-OpgHjdWn.js → Topbar-_T58hnmh.js} +5 -4
- package/dist/UILibrariesPanel-28G5q5uW.cjs +1 -0
- package/dist/{UILibrariesPanel-HVpapacm.js → UILibrariesPanel-e9sgXFmR.js} +6 -5
- package/dist/{UnsplashImages-Gx7dy6mp.js → UnsplashImages-2Iew1REO.js} +12 -11
- package/dist/UnsplashImages-wiV_0gCf.cjs +1 -0
- package/dist/{UploadImages-aClrfKqQ.js → UploadImages--batsol9.js} +10 -9
- package/dist/UploadImages-XNNW2MnE.cjs +1 -0
- package/dist/{add-page-modal-kP7x8GYO.js → add-page-modal-1hTp3XOU.js} +18 -17
- package/dist/add-page-modal-AvOI8Zy3.cjs +1 -0
- package/dist/atoms-ZOWyNoiC.js +6 -0
- package/dist/atoms-a0H_593V.cjs +1 -0
- package/dist/confirm-alert-8gHBC9xl.cjs +1 -0
- package/dist/{confirm-alert-gemzBTIt.js → confirm-alert-pMcaye-H.js} +5 -4
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +46 -45
- package/dist/delete-page-modal--GqB4-ya.cjs +1 -0
- package/dist/{delete-page-modal-ER-TAzRL.js → delete-page-modal-pPp6AAO1.js} +6 -5
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +30 -30
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -1
- package/dist/email.js +5 -4
- package/dist/empty-slot-Lsxjts7Q.js +6 -0
- package/dist/empty-slot-Sy930lX6.cjs +1 -0
- package/dist/{form-UruaB3s_.js → form-BbIs9ZUH.js} +5 -5
- package/dist/{form-l4PB76nt.cjs → form-svmj4OQd.cjs} +1 -1
- package/dist/{index-rKrjj7Vz.js → index-GRkx-GlC.js} +2 -2
- package/dist/{index-PXyps6Qc.cjs → index-ssLLO7-s.cjs} +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +3 -3
- package/dist/page-viewer-0QMFEzfk.cjs +1 -0
- package/dist/{page-viewer-bCH5PPSH.js → page-viewer-3ne7tW8e.js} +7 -6
- package/dist/{project-general-setting-rdCQBkQZ.js → project-general-setting-cIjIy8PW.js} +11 -10
- package/dist/project-general-setting-oNYVjfNV.cjs +1 -0
- package/dist/project-seo-setting-5699qkWN.cjs +1 -0
- package/dist/{project-seo-setting-_SGBKl0c.js → project-seo-setting-HLwPjaL2.js} +6 -5
- package/dist/{single-page-detail-H3Rb5gkJ.js → single-page-detail-MLxPXKfu.js} +8 -7
- package/dist/single-page-detail-amfiKMF_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -1
- package/dist/studio.js +5 -4
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +130 -129
- package/dist/{useCanvasSettings-IalZcnSd.cjs → useCanvasSettings-KDwtap3V.cjs} +1 -1
- package/dist/{useCanvasSettings-tkzd9Qrw.js → useCanvasSettings-qs-7bwyA.js} +1 -1
- package/dist/utils-K3Zk762G.cjs +1 -0
- package/dist/{Class-6Hz2KzYb.js → utils-iMv3T4WT.js} +16 -15
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +237 -238
- package/package.json +3 -2
- package/dist/AddBlocks-_6X3bnJZ.cjs +0 -1
- package/dist/CanvasArea-HmbcRpgP.cjs +0 -55
- package/dist/CanvasArea-a3WMBMi3.js +0 -1199
- package/dist/Class-Zc8hpE7f.cjs +0 -1
- package/dist/CurrentPage-rgu6shCq.cjs +0 -1
- package/dist/ListTree-fwN6Y_EA.cjs +0 -1
- package/dist/PagesPanel-v6Nl5KWy.cjs +0 -1
- package/dist/ProjectPanel-ck-mOBEg.cjs +0 -1
- package/dist/Settings-Rtk4HDKy.cjs +0 -1
- package/dist/SidePanels-biCoYtzR.cjs +0 -1
- package/dist/ThemeConfiguration-f6AxqpmO.cjs +0 -1
- package/dist/Topbar-cDxKWgN6.cjs +0 -1
- package/dist/UILibrariesPanel-d08F5Ri0.cjs +0 -1
- package/dist/UnsplashImages-uyokFuF-.cjs +0 -1
- package/dist/UploadImages-kLPXfW7W.cjs +0 -1
- package/dist/add-page-modal-H5MTzKBT.cjs +0 -1
- package/dist/confirm-alert-zZAmXzx0.cjs +0 -1
- package/dist/delete-page-modal-E8MFNVWF.cjs +0 -1
- package/dist/empty-slot-ZBlsQi6m.js +0 -15
- package/dist/empty-slot-nzYOgZuS.cjs +0 -1
- package/dist/page-viewer-wQq2qD96.cjs +0 -1
- package/dist/project-general-setting-A5OelyCo.cjs +0 -1
- package/dist/project-seo-setting-Y_q0WJSy.cjs +0 -1
- package/dist/single-page-detail-xAO7x8a1.cjs +0 -1
|
@@ -0,0 +1,1216 @@
|
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var ze = (n, s, e) => s in n ? He(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
3
|
+
var N = (n, s, e) => (ze(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
|
+
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
|
+
import M, { createElement as ne, useCallback as z, useState as C, useEffect as w, Component as me, Children as Oe, Suspense as ge, useRef as re, useMemo as Ue } from "react";
|
|
6
|
+
import { map as R, includes as ie, toUpper as Y, round as We, throttle as fe, has as xe, isEmpty as A, first as O, omit as qe, pick as Ke, get as f, isString as G, memoize as Ye, each as Qe, find as Xe, filter as ve, isNull as Ze } from "lodash-es";
|
|
7
|
+
import { ResetIcon as ae, MobileIcon as le, LaptopIcon as Je, DesktopIcon as Ge, DotsVerticalIcon as Ve, EraserIcon as et, ZoomInIcon as tt, DragHandleDots2Icon as st, ArrowUpIcon as ot, CopyIcon as nt, TrashIcon as rt } from "@radix-ui/react-icons";
|
|
8
|
+
import { j as $e, B as U, v as ye, aq as be, ar as ke, as as it, at, au as lt, o as V, X as ct, h as P, av as dt, aw as pt, ax as ut, ay as ht, az as mt, aA as gt, aB as we, L as B, Y as E, A as ft, a as xt, b as vt, c as $t, d as yt, e as bt, f as kt, g as wt, a3 as jt, aC as Ct, p as je, ap as H, aD as Bt, m as Dt, z as T, aE as Ce, Q as _t, aF as L, aG as At, i as ee, w as Be, E as De, H as _e, V as It, aH as St, aI as Nt, aJ as Mt, F as Et, aK as Tt, aL as Lt, aM as Ft, aN as Rt, M as Pt, aO as Ht, ah as Ae, a2 as zt } from "./ChaiBuilderEditor-1K-wcF5D.js";
|
|
9
|
+
import { useTranslation as W } from "react-i18next";
|
|
10
|
+
import { useAtom as y } from "jotai";
|
|
11
|
+
import { SparklesIcon as Ot } from "lucide-react";
|
|
12
|
+
import ce from "react-dom";
|
|
13
|
+
import k from "prop-types";
|
|
14
|
+
import { Quill as Ut } from "react-quill";
|
|
15
|
+
import { d as te, a as Ie } from "./atoms-ZOWyNoiC.js";
|
|
16
|
+
import { flip as Wt } from "@floating-ui/dom";
|
|
17
|
+
import { useFloating as qt, shift as Kt } from "@floating-ui/react-dom";
|
|
18
|
+
import { useResizeObserver as Yt } from "@react-hookz/web";
|
|
19
|
+
import { useFeature as Qt } from "flagged";
|
|
20
|
+
import Xt from "@tailwindcss/typography";
|
|
21
|
+
import Zt from "@tailwindcss/forms";
|
|
22
|
+
import Jt from "@tailwindcss/aspect-ratio";
|
|
23
|
+
import Gt from "tailwindcss-palette-generator";
|
|
24
|
+
import { twMerge as Vt } from "tailwind-merge";
|
|
25
|
+
import { S as de, a as Se } from "./STRINGS--j49GZJP.js";
|
|
26
|
+
import { getBlockComponent as es } from "@chaibuilder/runtime";
|
|
27
|
+
import { u as ts } from "./useCanvasSettings-qs-7bwyA.js";
|
|
28
|
+
import { Provider as ss } from "react-wrap-balancer";
|
|
29
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
30
|
+
import "clsx";
|
|
31
|
+
import "@radix-ui/react-scroll-area";
|
|
32
|
+
import "i18next";
|
|
33
|
+
import "./Functions-7jnEwJyw.js";
|
|
34
|
+
import "./MODIFIERS-cBT31iqE.js";
|
|
35
|
+
import "tree-model";
|
|
36
|
+
import "./utils-iMv3T4WT.js";
|
|
37
|
+
import "@radix-ui/react-toggle";
|
|
38
|
+
import "class-variance-authority";
|
|
39
|
+
import "@radix-ui/react-switch";
|
|
40
|
+
import "@radix-ui/react-slot";
|
|
41
|
+
import "@radix-ui/react-accordion";
|
|
42
|
+
import "@radix-ui/react-alert-dialog";
|
|
43
|
+
import "@radix-ui/react-dialog";
|
|
44
|
+
import "@radix-ui/react-label";
|
|
45
|
+
import "@radix-ui/react-tabs";
|
|
46
|
+
import "@radix-ui/react-tooltip";
|
|
47
|
+
import "@radix-ui/react-popover";
|
|
48
|
+
import "@radix-ui/react-menubar";
|
|
49
|
+
import "@radix-ui/react-hover-card";
|
|
50
|
+
import "@radix-ui/react-select";
|
|
51
|
+
import "@radix-ui/react-dropdown-menu";
|
|
52
|
+
import "@radix-ui/react-separator";
|
|
53
|
+
import "@radix-ui/react-toast";
|
|
54
|
+
import "cmdk";
|
|
55
|
+
import "@radix-ui/react-context-menu";
|
|
56
|
+
import "react-icons-picker";
|
|
57
|
+
import "react-hotkeys-hook";
|
|
58
|
+
const os = () => {
|
|
59
|
+
const { hasUndo: n, hasRedo: s, undo: e, redo: t } = $e();
|
|
60
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
61
|
+
/* @__PURE__ */ r.jsx(U, { disabled: !n(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ae, {}) }),
|
|
62
|
+
/* @__PURE__ */ r.jsx(U, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ae, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
function ns() {
|
|
66
|
+
const [n, s] = ye(), { t: e } = W();
|
|
67
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
68
|
+
/* @__PURE__ */ r.jsx(be, { htmlFor: "dark-mode-switch", children: e("dark_mode") }),
|
|
69
|
+
/* @__PURE__ */ r.jsxs(
|
|
70
|
+
ke,
|
|
71
|
+
{
|
|
72
|
+
id: "dark-mode-switch",
|
|
73
|
+
checked: n,
|
|
74
|
+
onCheckedChange: () => {
|
|
75
|
+
s(!n);
|
|
76
|
+
},
|
|
77
|
+
className: `${n ? "bg-violet-600" : "bg-violet-300"}
|
|
78
|
+
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`,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ r.jsx("span", { className: "sr-only", children: e("use_setting") }),
|
|
81
|
+
/* @__PURE__ */ r.jsx(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
className: `${n ? "translate-x-5" : "translate-x-0"}
|
|
86
|
+
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`
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
const pe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
|
|
95
|
+
"svg",
|
|
96
|
+
{
|
|
97
|
+
className: n ? "rotate-90" : "",
|
|
98
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
99
|
+
viewBox: "0 0 13 13",
|
|
100
|
+
xmlSpace: "preserve",
|
|
101
|
+
width: 13,
|
|
102
|
+
height: 13,
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ r.jsx("g", { strokeWidth: 0 }),
|
|
105
|
+
/* @__PURE__ */ r.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
106
|
+
/* @__PURE__ */ r.jsx(
|
|
107
|
+
"path",
|
|
108
|
+
{
|
|
109
|
+
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",
|
|
110
|
+
style: {
|
|
111
|
+
fill: "#000"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
), rs = [
|
|
118
|
+
{
|
|
119
|
+
title: "mobile_xs_title",
|
|
120
|
+
content: "mobile_xs_content",
|
|
121
|
+
breakpoint: "xs",
|
|
122
|
+
icon: /* @__PURE__ */ r.jsx(le, {}),
|
|
123
|
+
width: 400
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
title: "mobile_sm_title",
|
|
127
|
+
content: "mobile_sm_content",
|
|
128
|
+
breakpoint: "sm",
|
|
129
|
+
icon: /* @__PURE__ */ r.jsx(le, { className: "rotate-90" }),
|
|
130
|
+
width: 640
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: "tablet_md_title",
|
|
134
|
+
content: "tablet_md_content",
|
|
135
|
+
breakpoint: "md",
|
|
136
|
+
icon: /* @__PURE__ */ r.jsx(pe, {}),
|
|
137
|
+
width: 800
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "tablet_lg_title",
|
|
141
|
+
content: "tablet_lg_content",
|
|
142
|
+
breakpoint: "lg",
|
|
143
|
+
icon: /* @__PURE__ */ r.jsx(pe, { landscape: !0 }),
|
|
144
|
+
width: 1024
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: "desktop_xl_title",
|
|
148
|
+
content: "desktop_xl_content",
|
|
149
|
+
breakpoint: "xl",
|
|
150
|
+
icon: /* @__PURE__ */ r.jsx(Je, {}),
|
|
151
|
+
width: 1420
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: "large_desktop_2xl_title",
|
|
155
|
+
content: "large_desktop_2xl_content",
|
|
156
|
+
breakpoint: "2xl",
|
|
157
|
+
icon: /* @__PURE__ */ r.jsx(Ge, {}),
|
|
158
|
+
width: 1920
|
|
159
|
+
}
|
|
160
|
+
], ue = ({
|
|
161
|
+
title: n,
|
|
162
|
+
content: s,
|
|
163
|
+
currentBreakpoint: e,
|
|
164
|
+
breakpoint: t,
|
|
165
|
+
width: o,
|
|
166
|
+
icon: c,
|
|
167
|
+
onClick: a
|
|
168
|
+
}) => {
|
|
169
|
+
const { t: i } = W();
|
|
170
|
+
return /* @__PURE__ */ r.jsxs(it, { children: [
|
|
171
|
+
/* @__PURE__ */ r.jsx(at, { asChild: !0, children: /* @__PURE__ */ r.jsx(
|
|
172
|
+
U,
|
|
173
|
+
{
|
|
174
|
+
onClick: () => a(o),
|
|
175
|
+
size: "sm",
|
|
176
|
+
variant: t === e ? "secondary" : "ghost",
|
|
177
|
+
children: c
|
|
178
|
+
}
|
|
179
|
+
) }),
|
|
180
|
+
/* @__PURE__ */ r.jsx(lt, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
|
|
181
|
+
/* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: i(n) }),
|
|
182
|
+
/* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
|
|
183
|
+
] }) }) })
|
|
184
|
+
] });
|
|
185
|
+
}, is = () => {
|
|
186
|
+
const [, n, s] = V(), [e, t] = ct(), { t: o } = W(), c = P("breakpoints", rs), a = (i) => {
|
|
187
|
+
e.includes(i) ? e.length > 2 && t(e.filter((d) => d !== i)) : t((d) => [...d, i]);
|
|
188
|
+
};
|
|
189
|
+
return c.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: R(c, (i) => /* @__PURE__ */ ne(ue, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
190
|
+
R(
|
|
191
|
+
c.filter((i) => ie(e, Y(i.breakpoint))),
|
|
192
|
+
(i) => /* @__PURE__ */ ne(ue, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
|
|
193
|
+
),
|
|
194
|
+
/* @__PURE__ */ r.jsxs(dt, { children: [
|
|
195
|
+
/* @__PURE__ */ r.jsx(pt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ve, { className: "scale-90 transform" }) }) }),
|
|
196
|
+
/* @__PURE__ */ r.jsxs(ut, { className: "w-56 border-border text-xs", children: [
|
|
197
|
+
/* @__PURE__ */ r.jsx(ht, { children: o("Breakpoints") }),
|
|
198
|
+
/* @__PURE__ */ r.jsx(mt, {}),
|
|
199
|
+
R(c, (i) => /* @__PURE__ */ r.jsx(
|
|
200
|
+
gt,
|
|
201
|
+
{
|
|
202
|
+
disabled: i.breakpoint === "xs",
|
|
203
|
+
onCheckedChange: () => a(Y(i.breakpoint)),
|
|
204
|
+
checked: ie(e, Y(i.breakpoint)),
|
|
205
|
+
children: o(i.title)
|
|
206
|
+
},
|
|
207
|
+
i.breakpoint
|
|
208
|
+
))
|
|
209
|
+
] })
|
|
210
|
+
] })
|
|
211
|
+
] });
|
|
212
|
+
}, as = () => {
|
|
213
|
+
const { t: n } = W(), { setNewBlocks: s } = we(), [, e] = B(), [, t] = E(), o = z(() => {
|
|
214
|
+
s([]), e([]), t([]);
|
|
215
|
+
}, [s]);
|
|
216
|
+
return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(ft, { children: [
|
|
217
|
+
/* @__PURE__ */ r.jsx(xt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(U, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
218
|
+
/* @__PURE__ */ r.jsx(et, {}),
|
|
219
|
+
" ",
|
|
220
|
+
n("clear")
|
|
221
|
+
] }) }),
|
|
222
|
+
/* @__PURE__ */ r.jsxs(vt, { className: "border-border", children: [
|
|
223
|
+
/* @__PURE__ */ r.jsxs($t, { children: [
|
|
224
|
+
/* @__PURE__ */ r.jsx(yt, { children: n("clear_canvas_title") }),
|
|
225
|
+
/* @__PURE__ */ r.jsx(bt, { children: n("clear_canvas_description") })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ r.jsxs(kt, { children: [
|
|
228
|
+
/* @__PURE__ */ r.jsx(wt, { children: n("cancel") }),
|
|
229
|
+
/* @__PURE__ */ r.jsx(jt, { onClick: o, children: n("yes") })
|
|
230
|
+
] })
|
|
231
|
+
] })
|
|
232
|
+
] }) });
|
|
233
|
+
}, ls = () => {
|
|
234
|
+
const [n, s] = y(Ct);
|
|
235
|
+
return P("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
236
|
+
/* @__PURE__ */ r.jsxs(be, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
|
|
237
|
+
/* @__PURE__ */ r.jsx(Ot, { className: "w-4" }),
|
|
238
|
+
"AI Assistant"
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ r.jsx(
|
|
241
|
+
ke,
|
|
242
|
+
{
|
|
243
|
+
className: "scale-90",
|
|
244
|
+
checked: n,
|
|
245
|
+
onCheckedChange: (t) => {
|
|
246
|
+
s(t);
|
|
247
|
+
},
|
|
248
|
+
id: "ai-assitantt"
|
|
249
|
+
}
|
|
250
|
+
)
|
|
251
|
+
] }) : null;
|
|
252
|
+
}, cs = () => {
|
|
253
|
+
const n = P("darkMode", !1), [s] = je();
|
|
254
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
255
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
256
|
+
n ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
257
|
+
/* @__PURE__ */ r.jsx(ns, {}),
|
|
258
|
+
/* @__PURE__ */ r.jsx(H, { orientation: "vertical" })
|
|
259
|
+
] }) : null,
|
|
260
|
+
/* @__PURE__ */ r.jsx(is, {}),
|
|
261
|
+
/* @__PURE__ */ r.jsx(H, { orientation: "vertical" }),
|
|
262
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
|
|
263
|
+
/* @__PURE__ */ r.jsx(tt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
264
|
+
" ",
|
|
265
|
+
/* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
|
|
266
|
+
We(s, 0),
|
|
267
|
+
"%"
|
|
268
|
+
] })
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ r.jsx(H, { orientation: "vertical" }),
|
|
271
|
+
/* @__PURE__ */ r.jsx(os, {})
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
274
|
+
/* @__PURE__ */ r.jsx(as, {}),
|
|
275
|
+
/* @__PURE__ */ r.jsx(H, { orientation: "vertical" }),
|
|
276
|
+
/* @__PURE__ */ r.jsx(ls, {})
|
|
277
|
+
] })
|
|
278
|
+
] });
|
|
279
|
+
}, ds = `<!doctype html>
|
|
280
|
+
<html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
|
|
281
|
+
<head>
|
|
282
|
+
<meta charset="UTF-8">
|
|
283
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
284
|
+
<script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
|
|
285
|
+
<style>
|
|
286
|
+
html { height: 100%; overflow:auto; }
|
|
287
|
+
body { height: 100%; }
|
|
288
|
+
.air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
|
|
289
|
+
.air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
|
|
290
|
+
body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
|
|
291
|
+
-moz-user-select: none;-ms-user-select: none; user-select: none; }
|
|
292
|
+
html{
|
|
293
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
294
|
+
scrollbar-width: none; /* Firefox */
|
|
295
|
+
}
|
|
296
|
+
/** IMPORTANT: Make fields content editable in SAFARI */
|
|
297
|
+
[contenteditable] {-webkit-user-select: text;user-select: text;}
|
|
298
|
+
|
|
299
|
+
html::-webkit-scrollbar { width: 0 !important }
|
|
300
|
+
.aspect-auto{aspect-ratio: auto;}
|
|
301
|
+
.aspect-square{aspect-ratio: 1/1;}
|
|
302
|
+
.aspect-video{aspect-ratio: 16/9;}
|
|
303
|
+
.dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
|
|
304
|
+
.dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
|
|
305
|
+
a{ pointer-events: none !important; }
|
|
306
|
+
[contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
|
|
307
|
+
[contenteditable="true"] {
|
|
308
|
+
outline: none;
|
|
309
|
+
box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
|
|
310
|
+
-webkit-user-select: text;
|
|
311
|
+
-moz-user-select: text;
|
|
312
|
+
user-select: text;
|
|
313
|
+
}
|
|
314
|
+
.frame-root .frame-content { height: 100%; }
|
|
315
|
+
[data-drop="yes"] { outline: 2px dashed orange !important; outline-offset: -2px }
|
|
316
|
+
[data-dnd="no"] { pointer-events: none !important; }
|
|
317
|
+
</style>
|
|
318
|
+
<style id="hidden-blocks"></style>
|
|
319
|
+
<style id="selected-block"></style>
|
|
320
|
+
<style id="selected-styling-block"></style>
|
|
321
|
+
<style id="highlighted-block"></style>
|
|
322
|
+
<style id="dragged-block"></style>
|
|
323
|
+
|
|
324
|
+
</head>
|
|
325
|
+
<body class="font-body antialiased h-full">
|
|
326
|
+
<div class="frame-root h-full"></div>
|
|
327
|
+
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
328
|
+
</body>
|
|
329
|
+
</html>`, ps = (n) => {
|
|
330
|
+
const [s] = V(), [, e] = je(), [t, o] = C({}), c = z(() => {
|
|
331
|
+
const { width: a, height: i } = n;
|
|
332
|
+
if (a < s) {
|
|
333
|
+
const d = parseFloat((a / s).toFixed(2).toString());
|
|
334
|
+
let l = {};
|
|
335
|
+
const h = i * d;
|
|
336
|
+
i && (l = {
|
|
337
|
+
// Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
|
|
338
|
+
height: 100 + (i - h) / h * 100 + "%"
|
|
339
|
+
}), o({
|
|
340
|
+
position: "relative",
|
|
341
|
+
top: 0,
|
|
342
|
+
transform: `scale(${d})`,
|
|
343
|
+
transformOrigin: "top left",
|
|
344
|
+
...l,
|
|
345
|
+
maxWidth: "none"
|
|
346
|
+
}), e(d * 100);
|
|
347
|
+
} else
|
|
348
|
+
o({}), e(100);
|
|
349
|
+
}, [s, n, e]);
|
|
350
|
+
return w(() => {
|
|
351
|
+
c();
|
|
352
|
+
}, [s, n, e, c]), t;
|
|
353
|
+
};
|
|
354
|
+
let Ne, Me;
|
|
355
|
+
typeof document < "u" && (Ne = document);
|
|
356
|
+
typeof window < "u" && (Me = window);
|
|
357
|
+
const Ee = M.createContext({ document: Ne, window: Me }), q = () => M.useContext(Ee), { Provider: us, Consumer: Ho } = Ee;
|
|
358
|
+
class Te extends me {
|
|
359
|
+
componentDidMount() {
|
|
360
|
+
this.props.contentDidMount();
|
|
361
|
+
}
|
|
362
|
+
componentDidUpdate() {
|
|
363
|
+
this.props.contentDidUpdate();
|
|
364
|
+
}
|
|
365
|
+
render() {
|
|
366
|
+
return Oe.only(this.props.children);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
N(Te, "propTypes", {
|
|
370
|
+
children: k.element.isRequired,
|
|
371
|
+
contentDidMount: k.func.isRequired,
|
|
372
|
+
contentDidUpdate: k.func.isRequired
|
|
373
|
+
});
|
|
374
|
+
class Z extends me {
|
|
375
|
+
constructor(e, t) {
|
|
376
|
+
super(e, t);
|
|
377
|
+
N(this, "setRef", (e) => {
|
|
378
|
+
this.nodeRef.current = e;
|
|
379
|
+
const { forwardedRef: t } = this.props;
|
|
380
|
+
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
381
|
+
});
|
|
382
|
+
N(this, "handleLoad", () => {
|
|
383
|
+
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
384
|
+
});
|
|
385
|
+
// In certain situations on a cold cache DOMContentLoaded never gets called
|
|
386
|
+
// fallback to an interval to check if that's the case
|
|
387
|
+
N(this, "loadCheck", () => setInterval(() => {
|
|
388
|
+
this.handleLoad();
|
|
389
|
+
}, 500));
|
|
390
|
+
this._isMounted = !1, this.nodeRef = M.createRef(), this.state = { iframeLoaded: !1 };
|
|
391
|
+
}
|
|
392
|
+
componentDidMount() {
|
|
393
|
+
this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
|
|
394
|
+
}
|
|
395
|
+
componentWillUnmount() {
|
|
396
|
+
this._isMounted = !1, this.nodeRef.current.removeEventListener("DOMContentLoaded", this.handleLoad);
|
|
397
|
+
}
|
|
398
|
+
getDoc() {
|
|
399
|
+
return this.nodeRef.current ? this.nodeRef.current.contentDocument : null;
|
|
400
|
+
}
|
|
401
|
+
getMountTarget() {
|
|
402
|
+
const e = this.getDoc();
|
|
403
|
+
return this.props.mountTarget ? e.querySelector(this.props.mountTarget) : e.body.children[0];
|
|
404
|
+
}
|
|
405
|
+
renderFrameContents() {
|
|
406
|
+
if (!this._isMounted)
|
|
407
|
+
return null;
|
|
408
|
+
const e = this.getDoc();
|
|
409
|
+
if (!e)
|
|
410
|
+
return null;
|
|
411
|
+
const t = this.props.contentDidMount, o = this.props.contentDidUpdate, c = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(Te, { contentDidMount: t, contentDidUpdate: o, children: /* @__PURE__ */ r.jsx(us, { value: { document: e, window: c }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
|
|
412
|
+
return [ce.createPortal(this.props.head, this.getDoc().head), ce.createPortal(a, i)];
|
|
413
|
+
}
|
|
414
|
+
render() {
|
|
415
|
+
const e = {
|
|
416
|
+
...this.props,
|
|
417
|
+
srcDoc: this.props.initialContent,
|
|
418
|
+
children: void 0
|
|
419
|
+
// The iframe isn't ready so we drop children from props here. #12, #17
|
|
420
|
+
};
|
|
421
|
+
return delete e.head, delete e.initialContent, delete e.mountTarget, delete e.contentDidMount, delete e.contentDidUpdate, delete e.forwardedRef, /* @__PURE__ */ r.jsx("iframe", { ...e, ref: this.setRef, onLoad: this.handleLoad, children: this.state.iframeLoaded && this.renderFrameContents() });
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
// React warns when you render directly into the body since browser extensions
|
|
425
|
+
// also inject into the body and can mess up React. For this reason
|
|
426
|
+
// initialContent is expected to have a div inside of the body
|
|
427
|
+
// element that we render react into.
|
|
428
|
+
N(Z, "propTypes", {
|
|
429
|
+
style: k.object,
|
|
430
|
+
// eslint-disable-line
|
|
431
|
+
head: k.node,
|
|
432
|
+
initialContent: k.string,
|
|
433
|
+
mountTarget: k.string,
|
|
434
|
+
contentDidMount: k.func,
|
|
435
|
+
contentDidUpdate: k.func,
|
|
436
|
+
children: k.oneOfType([k.element, k.arrayOf(k.element)])
|
|
437
|
+
}), N(Z, "defaultProps", {
|
|
438
|
+
style: {},
|
|
439
|
+
head: null,
|
|
440
|
+
children: void 0,
|
|
441
|
+
mountTarget: void 0,
|
|
442
|
+
contentDidMount: () => {
|
|
443
|
+
},
|
|
444
|
+
contentDidUpdate: () => {
|
|
445
|
+
},
|
|
446
|
+
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
|
|
447
|
+
});
|
|
448
|
+
const hs = M.forwardRef((n, s) => /* @__PURE__ */ r.jsx(Z, { ...n, forwardedRef: s }));
|
|
449
|
+
function se(n) {
|
|
450
|
+
const s = window.getComputedStyle(n), e = s.display;
|
|
451
|
+
if (e === "flex") {
|
|
452
|
+
const t = s.flexDirection;
|
|
453
|
+
return t === "column" || t === "column-reverse" ? "vertical" : "horizontal";
|
|
454
|
+
} else if (e === "grid") {
|
|
455
|
+
const t = s.gridAutoFlow, o = s.gridTemplateRows, c = s.gridTemplateColumns;
|
|
456
|
+
return t.includes("column") || o.split(" ").length > c.split(" ").length ? "vertical" : "horizontal";
|
|
457
|
+
} else if (e === "block" || e === "inline-block")
|
|
458
|
+
return "vertical";
|
|
459
|
+
return "horizontal";
|
|
460
|
+
}
|
|
461
|
+
let D = null, _ = [], F = null, Q = null;
|
|
462
|
+
const he = (n, s, e) => {
|
|
463
|
+
if (!D || !n)
|
|
464
|
+
return;
|
|
465
|
+
const t = D == null ? void 0 : D.getElementById("placeholder"), c = _.map(([i]) => i).reduce(
|
|
466
|
+
(i, d) => Math.abs(d - e) < Math.abs(i - e) ? d : i,
|
|
467
|
+
0
|
|
468
|
+
);
|
|
469
|
+
if (!_[c])
|
|
470
|
+
return;
|
|
471
|
+
const a = _[c];
|
|
472
|
+
t.style.width = s === "vertical" ? a[2] + "px" : "2px", t.style.height = s === "vertical" ? "2px" : a[2] + "px", t.style.display = "block", s === "vertical" ? (t.style.top = a[0] + "px", t.style.left = a[1] + "px") : (t.style.top = a[1] + "px", t.style.left = a[0] + "px");
|
|
473
|
+
};
|
|
474
|
+
function ms(n, s) {
|
|
475
|
+
let e = 0, t = 1 / 0;
|
|
476
|
+
return s.forEach((o, c) => {
|
|
477
|
+
const a = Math.abs(o[0] - n);
|
|
478
|
+
a < t && (t = a, e = c);
|
|
479
|
+
}), e;
|
|
480
|
+
}
|
|
481
|
+
const gs = (n) => {
|
|
482
|
+
const e = se(n) === "horizontal";
|
|
483
|
+
_ = [], Array.from(n.children).forEach((t) => {
|
|
484
|
+
if (t.classList.contains("pointer-events-none"))
|
|
485
|
+
return;
|
|
486
|
+
const o = e ? t.offsetLeft : t.offsetTop, c = e ? [t.offsetTop, t.clientHeight] : [t.offsetLeft, t.clientWidth];
|
|
487
|
+
_.push([o, c[0], c[1]]);
|
|
488
|
+
});
|
|
489
|
+
}, fs = fe((n) => {
|
|
490
|
+
const s = n.target, e = se(s);
|
|
491
|
+
if (e === "vertical") {
|
|
492
|
+
const t = n.clientY - s.offsetTop;
|
|
493
|
+
he(s, e, t);
|
|
494
|
+
} else {
|
|
495
|
+
const t = n.clientX - s.offsetLeft;
|
|
496
|
+
he(s, e, t);
|
|
497
|
+
}
|
|
498
|
+
}, 200);
|
|
499
|
+
function X() {
|
|
500
|
+
const n = D == null ? void 0 : D.getElementById("placeholder");
|
|
501
|
+
n.style.display = "none", xs("pointer-none");
|
|
502
|
+
}
|
|
503
|
+
function xs(n) {
|
|
504
|
+
document.querySelectorAll(`.${n}`).forEach((e) => {
|
|
505
|
+
e.classList.remove(n);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
const vs = () => {
|
|
509
|
+
const { document: n } = q(), [s, e] = y(Bt), { addCoreBlock: t } = Dt(), [, o] = T(), [, c] = B(), { moveBlocks: a } = we(), [, i] = y(Ce), [d, l] = y(te), [, h] = y(Ie);
|
|
510
|
+
return D = n, {
|
|
511
|
+
isDragging: s,
|
|
512
|
+
onDragOver: (p) => {
|
|
513
|
+
p.preventDefault(), p.stopPropagation(), fs(p);
|
|
514
|
+
},
|
|
515
|
+
onDrop: (p) => {
|
|
516
|
+
F == null || F.classList.remove("drop-target");
|
|
517
|
+
const u = F, v = se(u) === "vertical" ? p.clientY : p.clientX;
|
|
518
|
+
Q = ms(v, _);
|
|
519
|
+
const g = d, m = u.getAttribute("data-block-id");
|
|
520
|
+
if (!xe(g, "_id")) {
|
|
521
|
+
t(g, m === "canvas" ? null : m, Q), setTimeout(() => {
|
|
522
|
+
X();
|
|
523
|
+
}, 300), _ = [], e(!1), i(""), l(null), h(null);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
let b = u.getAttribute("data-block-id");
|
|
527
|
+
b === null && (b = p.target.parentElement.getAttribute("data-block-id")), a([g._id], b, Q), X(), e(!1), i(""), setTimeout(() => X(), 300);
|
|
528
|
+
},
|
|
529
|
+
onDragEnter: (p) => {
|
|
530
|
+
const u = p, x = u.target;
|
|
531
|
+
F = x;
|
|
532
|
+
const v = x.getAttribute("data-block-id");
|
|
533
|
+
h(v), u.stopPropagation(), u.preventDefault(), _ = [], gs(x), x.classList.add("drop-target"), e(!0), o(""), c([]);
|
|
534
|
+
}
|
|
535
|
+
// onDragLeave: (e: DragEvent) => {
|
|
536
|
+
// const event = e;
|
|
537
|
+
// dropTarget = null;
|
|
538
|
+
// event.stopPropagation();
|
|
539
|
+
// event.preventDefault();
|
|
540
|
+
// const target = event.target as HTMLElement;
|
|
541
|
+
// target.classList.remove("drop-target");
|
|
542
|
+
// },
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
function oe(n) {
|
|
546
|
+
return n.getAttribute("data-block-id") ? n : n.closest("[data-block-id]");
|
|
547
|
+
}
|
|
548
|
+
function $s(n) {
|
|
549
|
+
n.container.innerHTML = "", n.container.parentNode.removeChild(n.container);
|
|
550
|
+
var s = document.querySelector(".ql-toolbar");
|
|
551
|
+
s && s.parentNode.removeChild(s), n = null;
|
|
552
|
+
}
|
|
553
|
+
const ys = () => {
|
|
554
|
+
const n = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = _t(), [, e] = T(), [t, o] = y(L);
|
|
555
|
+
return (c) => {
|
|
556
|
+
var p;
|
|
557
|
+
if (t)
|
|
558
|
+
return;
|
|
559
|
+
const a = oe(c.target), i = a.getAttribute("data-block-type");
|
|
560
|
+
if (!i || !n.includes(i))
|
|
561
|
+
return;
|
|
562
|
+
const d = a.cloneNode(!0);
|
|
563
|
+
a.style.display = "none", Array.from(d.attributes).forEach((u) => {
|
|
564
|
+
u.name !== "class" && d.removeAttribute(u.name);
|
|
565
|
+
}), i === "Text" && (d.style.display = "inline-block"), a.parentNode.insertBefore(d, a.nextSibling);
|
|
566
|
+
const l = new Ut(d, { placeholder: "Type here..." });
|
|
567
|
+
function h() {
|
|
568
|
+
const u = l.getText(0, l.getLength());
|
|
569
|
+
s([a.getAttribute("data-block-id")], { content: u }), a.removeAttribute("style"), d.removeEventListener("blur", h, !0), $s(l), o(""), e("");
|
|
570
|
+
}
|
|
571
|
+
d.addEventListener("blur", h, !0), d.addEventListener("keydown", (u) => {
|
|
572
|
+
(u.key === "Enter" || u.key === "Escape") && h();
|
|
573
|
+
}), l.focus(), (p = d.querySelector(".ql-clipboard")) == null || p.remove(), o(a.getAttribute("data-block-id"));
|
|
574
|
+
};
|
|
575
|
+
}, bs = () => {
|
|
576
|
+
const [, n] = E(), [s, e] = B(), [, t] = T(), [o] = y(L), [c] = y(At);
|
|
577
|
+
return (a) => {
|
|
578
|
+
if (o)
|
|
579
|
+
return;
|
|
580
|
+
a.stopPropagation();
|
|
581
|
+
const i = oe(a.target);
|
|
582
|
+
if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
|
|
583
|
+
e([]), n([]), t("");
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
if (i != null && i.getAttribute("data-block-parent")) {
|
|
587
|
+
const d = i.getAttribute("data-style-prop"), l = i.getAttribute("data-style-id"), h = i.getAttribute("data-block-parent");
|
|
588
|
+
s.includes(h) || c.closeAll(), n([{ id: l, prop: d, blockId: h }]), e([h]);
|
|
589
|
+
} else if (i != null && i.getAttribute("data-block-id")) {
|
|
590
|
+
let d = i.getAttribute("data-block-id");
|
|
591
|
+
s.includes(d) || c.closeAll(), e([d]);
|
|
592
|
+
}
|
|
593
|
+
t("");
|
|
594
|
+
};
|
|
595
|
+
}, ks = fe((n, s) => {
|
|
596
|
+
const e = oe(n.target);
|
|
597
|
+
e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
|
|
598
|
+
}, 100), ws = () => {
|
|
599
|
+
const [, n] = T(), [s] = y(L);
|
|
600
|
+
return (e) => {
|
|
601
|
+
s || ks(e, n);
|
|
602
|
+
};
|
|
603
|
+
}, js = ({ children: n }) => {
|
|
604
|
+
const { document: s } = q(), [e] = B(), [t, o] = E();
|
|
605
|
+
w(() => {
|
|
606
|
+
setTimeout(() => {
|
|
607
|
+
if (!A(t))
|
|
608
|
+
return;
|
|
609
|
+
const l = Le(s, O(e));
|
|
610
|
+
if (l) {
|
|
611
|
+
const h = l.getAttribute("data-style-prop");
|
|
612
|
+
if (h) {
|
|
613
|
+
const p = l.getAttribute("data-style-id"), u = l.getAttribute("data-block-parent");
|
|
614
|
+
o([{ id: p, prop: h, blockId: u }]);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}, 100);
|
|
618
|
+
}, [s, e, o, t]);
|
|
619
|
+
const c = ys(), a = bs(), i = ws(), d = vs();
|
|
620
|
+
return /* @__PURE__ */ r.jsx(
|
|
621
|
+
"div",
|
|
622
|
+
{
|
|
623
|
+
"data-block-id": "canvas",
|
|
624
|
+
id: "canvas",
|
|
625
|
+
onClick: a,
|
|
626
|
+
onDoubleClick: c,
|
|
627
|
+
onMouseMove: i,
|
|
628
|
+
...qe(d, "isDragging"),
|
|
629
|
+
className: "relative mb-5 h-full max-w-full " + (d.isDragging ? "dragging" : ""),
|
|
630
|
+
children: n
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
}, Le = (n, s) => n.querySelector(`[data-block-id="${s}"]`), Cs = () => {
|
|
634
|
+
const { window: n } = q(), [s, e] = B(), [t] = ee(), [, o] = E(), { undo: c, redo: a } = $e(), i = Be(), [, d] = De(), l = _e(), { savePage: h } = It(), [p] = y(L), [, u] = y(St), x = (g) => {
|
|
635
|
+
g.key === "Enter" && (g.preventDefault(), s.length === 1 && u(O(s)));
|
|
636
|
+
}, v = (g) => {
|
|
637
|
+
const m = t.find((b) => b._id === g);
|
|
638
|
+
return m ? m._parent : null;
|
|
639
|
+
};
|
|
640
|
+
return w(() => {
|
|
641
|
+
const g = (m) => {
|
|
642
|
+
if (m.key === "Escape") {
|
|
643
|
+
e([]), o([]);
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (x(m), !p && (m.key === "Delete" || m.key === "Backspace") && (m.preventDefault(), l(s)), m.ctrlKey || m.metaKey) {
|
|
647
|
+
if (m.key === "ArrowUp") {
|
|
648
|
+
m.preventDefault();
|
|
649
|
+
const b = s.length > 0 ? v(s[0]) : null;
|
|
650
|
+
b && e([b]);
|
|
651
|
+
}
|
|
652
|
+
if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(m.key)) {
|
|
653
|
+
if (p && ["x", "z", "v"].includes(m.key))
|
|
654
|
+
return !0;
|
|
655
|
+
m.preventDefault();
|
|
656
|
+
}
|
|
657
|
+
m.key === "s" && (m.stopPropagation(), m.preventDefault(), h()), m.key === "z" && c(), m.key === "y" && a(), m.key === "d" && i(s);
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
return n.removeEventListener("keydown", g), n.addEventListener("keydown", g), () => {
|
|
661
|
+
n.removeEventListener("keydown", g);
|
|
662
|
+
};
|
|
663
|
+
}, [s, e, c, l, d, a, i, p, h, n]), null;
|
|
664
|
+
}, Bs = ({ block: n, label: s }) => {
|
|
665
|
+
const [, e] = B(), [, t] = T(), [, o] = y(te), c = Qt("dnd");
|
|
666
|
+
return /* @__PURE__ */ r.jsxs(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
|
|
670
|
+
draggable: c ? "true" : "false",
|
|
671
|
+
onDragStart: (a) => {
|
|
672
|
+
a.dataTransfer.setData("text/plain", JSON.stringify(Ke(n, ["_id", "_type", "_name"]))), o(n), setTimeout(() => {
|
|
673
|
+
e([]), t(null);
|
|
674
|
+
}, 200);
|
|
675
|
+
},
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ r.jsx(st, {}),
|
|
678
|
+
s
|
|
679
|
+
]
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
}, Ds = ({ selectedBlockElement: n, block: s }) => {
|
|
683
|
+
const e = _e(), t = Be(), [, o] = B(), [, c] = E(), [a] = y(L), { floatingStyles: i, refs: d, update: l } = qt({
|
|
684
|
+
placement: "top-start",
|
|
685
|
+
middleware: [Kt(), Wt()],
|
|
686
|
+
elements: {
|
|
687
|
+
reference: n
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
Yt(n, () => l(), n !== null);
|
|
691
|
+
const h = f(s, "_parent", null), p = A(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
|
|
692
|
+
return !n || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
|
|
693
|
+
"div",
|
|
694
|
+
{
|
|
695
|
+
role: "button",
|
|
696
|
+
tabIndex: 0,
|
|
697
|
+
ref: d.setFloating,
|
|
698
|
+
style: i,
|
|
699
|
+
onClick: (u) => {
|
|
700
|
+
u.stopPropagation(), u.preventDefault();
|
|
701
|
+
},
|
|
702
|
+
onKeyDown: (u) => u.stopPropagation(),
|
|
703
|
+
className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
704
|
+
children: [
|
|
705
|
+
/* @__PURE__ */ r.jsx(Bs, { label: p, block: s }),
|
|
706
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
|
|
707
|
+
h && /* @__PURE__ */ r.jsx(
|
|
708
|
+
ot,
|
|
709
|
+
{
|
|
710
|
+
className: "hover:scale-105",
|
|
711
|
+
onClick: () => {
|
|
712
|
+
c([]), o([h]);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
|
|
717
|
+
Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
|
|
718
|
+
] })
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
) });
|
|
722
|
+
}, _s = ({ addVariant: n, e: s }) => {
|
|
723
|
+
n("hs-dropdown-open", [
|
|
724
|
+
({ modifySelectors: e, separator: t }) => {
|
|
725
|
+
e(({ className: o }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${o}`)}`);
|
|
726
|
+
},
|
|
727
|
+
({ modifySelectors: e, separator: t }) => {
|
|
728
|
+
e(({ className: o }) => `.hs-dropdown.open .hs-dropdown-toggle .${s(`hs-dropdown-open${t}${o}`)}`);
|
|
729
|
+
},
|
|
730
|
+
({ modifySelectors: e, separator: t }) => {
|
|
731
|
+
e(({ className: o }) => `.hs-dropdown.open > .hs-dropdown-menu > .${s(`hs-dropdown-open${t}${o}`)}`);
|
|
732
|
+
}
|
|
733
|
+
]), n("hs-removing", ({ modifySelectors: e, separator: t }) => {
|
|
734
|
+
e(({ className: o }) => `.hs-removing.${s(`hs-removing${t}${o}`)}`);
|
|
735
|
+
}), n("hs-tooltip-shown", ({ modifySelectors: e, separator: t }) => {
|
|
736
|
+
e(({ className: o }) => `.hs-tooltip.show .${s(`hs-tooltip-shown${t}${o}`)}`);
|
|
737
|
+
}), n("hs-accordion-active", [
|
|
738
|
+
({ modifySelectors: e, separator: t }) => {
|
|
739
|
+
e(({ className: o }) => `.hs-accordion.active.${s(`hs-accordion-active${t}${o}`)}`);
|
|
740
|
+
},
|
|
741
|
+
({ modifySelectors: e, separator: t }) => {
|
|
742
|
+
e(({ className: o }) => `.hs-accordion.active > .${s(`hs-accordion-active${t}${o}`)}`);
|
|
743
|
+
},
|
|
744
|
+
({ modifySelectors: e, separator: t }) => {
|
|
745
|
+
e(({ className: o }) => `.hs-accordion.active > .hs-accordion-toggle .${s(`hs-accordion-active${t}${o}`)}`);
|
|
746
|
+
},
|
|
747
|
+
({ modifySelectors: e, separator: t }) => {
|
|
748
|
+
e(({ className: o }) => `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${s(
|
|
749
|
+
`hs-accordion-active${t}${o}`
|
|
750
|
+
)}`);
|
|
751
|
+
},
|
|
752
|
+
({ modifySelectors: e, separator: t }) => {
|
|
753
|
+
e(({ className: o }) => `.hs-accordion.active > .hs-accordion-toggle.${s(`hs-accordion-active${t}${o}`)}`);
|
|
754
|
+
},
|
|
755
|
+
({ modifySelectors: e, separator: t }) => {
|
|
756
|
+
e(({ className: o }) => `.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${s(
|
|
757
|
+
`hs-accordion-active${t}${o}`
|
|
758
|
+
)}`);
|
|
759
|
+
}
|
|
760
|
+
]), n("hs-accordion-selected", ({ modifySelectors: e, separator: t }) => {
|
|
761
|
+
e(({ className: o }) => `.hs-accordion .selected.${s(`hs-accordion-selected${t}${o}`)}`);
|
|
762
|
+
}), n("hs-collapse-open", [
|
|
763
|
+
({ modifySelectors: e, separator: t }) => {
|
|
764
|
+
e(({ className: o }) => `.hs-collapse.open .${s(`hs-collapse-open${t}${o}`)}`);
|
|
765
|
+
},
|
|
766
|
+
({ modifySelectors: e, separator: t }) => {
|
|
767
|
+
e(({ className: o }) => `.hs-collapse.open.${s(`hs-collapse-open${t}${o}`)}`);
|
|
768
|
+
},
|
|
769
|
+
({ modifySelectors: e, separator: t }) => {
|
|
770
|
+
e(({ className: o }) => `.hs-collapse-toggle.open .${s(`hs-collapse-open${t}${o}`)}`);
|
|
771
|
+
},
|
|
772
|
+
({ modifySelectors: e, separator: t }) => {
|
|
773
|
+
e(({ className: o }) => `.hs-collapse-toggle.open.${s(`hs-collapse-open${t}${o}`)}`);
|
|
774
|
+
}
|
|
775
|
+
]), n("hs-tab-active", [
|
|
776
|
+
({ modifySelectors: e, separator: t }) => {
|
|
777
|
+
e(({ className: o }) => `[data-hs-tab].active.${s(`hs-tab-active${t}${o}`)}`);
|
|
778
|
+
},
|
|
779
|
+
({ modifySelectors: e, separator: t }) => {
|
|
780
|
+
e(({ className: o }) => `[data-hs-tab].active .${s(`hs-tab-active${t}${o}`)}`);
|
|
781
|
+
}
|
|
782
|
+
]), n("hs-overlay-open", [
|
|
783
|
+
({ modifySelectors: e, separator: t }) => {
|
|
784
|
+
e(({ className: o }) => `.open.${s(`hs-overlay-open${t}${o}`)}`);
|
|
785
|
+
},
|
|
786
|
+
({ modifySelectors: e, separator: t }) => {
|
|
787
|
+
e(({ className: o }) => `.open .${s(`hs-overlay-open${t}${o}`)}`);
|
|
788
|
+
}
|
|
789
|
+
]), n("hs-overlay-layout-open", [
|
|
790
|
+
({ modifySelectors: e, separator: t }) => {
|
|
791
|
+
e(({ className: o }) => `.hs-overlay-body-open.${s(`hs-overlay-layout-open${t}${o}`)}`);
|
|
792
|
+
},
|
|
793
|
+
({ modifySelectors: e, separator: t }) => {
|
|
794
|
+
e(({ className: o }) => `.hs-overlay-body-open .${s(`hs-overlay-layout-open${t}${o}`)}`);
|
|
795
|
+
}
|
|
796
|
+
]), n("hs-overlay-backdrop-open", [
|
|
797
|
+
({ modifySelectors: e, separator: t }) => {
|
|
798
|
+
e(({ className: o }) => `.hs-overlay-backdrop.${s(`hs-overlay-backdrop-open${t}${o}`)}`);
|
|
799
|
+
},
|
|
800
|
+
({ modifySelectors: e, separator: t }) => {
|
|
801
|
+
e(({ className: o }) => `.hs-overlay-backdrop .${s(`hs-overlay-backdrop-open${t}${o}`)}`);
|
|
802
|
+
}
|
|
803
|
+
]), n("hs-scrollspy-active", ({ modifySelectors: e, separator: t }) => {
|
|
804
|
+
e(({ className: o }) => `.active.${s(`hs-scrollspy-active${t}${o}`)}`);
|
|
805
|
+
}), n("hs-carousel-active", [
|
|
806
|
+
({ modifySelectors: e, separator: t }) => {
|
|
807
|
+
e(({ className: o }) => `.active.${s(`hs-carousel-active${t}${o}`)}`);
|
|
808
|
+
},
|
|
809
|
+
({ modifySelectors: e, separator: t }) => {
|
|
810
|
+
e(({ className: o }) => `.active .${s(`hs-carousel-active${t}${o}`)}`);
|
|
811
|
+
}
|
|
812
|
+
]), n("hs-carousel-disabled", [
|
|
813
|
+
({ modifySelectors: e, separator: t }) => {
|
|
814
|
+
e(({ className: o }) => `.disabled.${s(`hs-carousel${t}disabled${t}${o}`)}`);
|
|
815
|
+
},
|
|
816
|
+
({ modifySelectors: e, separator: t }) => {
|
|
817
|
+
e(({ className: o }) => `.disabled .${s(`hs-carousel${t}disabled${t}${o}`)}`);
|
|
818
|
+
}
|
|
819
|
+
]), n("hs-selected", [
|
|
820
|
+
({ modifySelectors: e, separator: t }) => {
|
|
821
|
+
e(({ className: o }) => `.selected.${s(`hs-selected${t}${o}`)}`);
|
|
822
|
+
},
|
|
823
|
+
({ modifySelectors: e, separator: t }) => {
|
|
824
|
+
e(({ className: o }) => `.selected .${s(`hs-selected${t}${o}`)}`);
|
|
825
|
+
}
|
|
826
|
+
]), n("hs-select-disabled", [
|
|
827
|
+
({ modifySelectors: e, separator: t }) => {
|
|
828
|
+
e(({ className: o }) => `.disabled.${s(`hs-select-disabled${t}${o}`)}`);
|
|
829
|
+
},
|
|
830
|
+
({ modifySelectors: e, separator: t }) => {
|
|
831
|
+
e(({ className: o }) => `.disabled .${s(`hs-select-disabled${t}${o}`)}`);
|
|
832
|
+
}
|
|
833
|
+
]), n("hs-select-active", [
|
|
834
|
+
({ modifySelectors: e, separator: t }) => {
|
|
835
|
+
e(({ className: o }) => `.active.${s(`hs-select-active${t}${o}`)}`);
|
|
836
|
+
},
|
|
837
|
+
({ modifySelectors: e, separator: t }) => {
|
|
838
|
+
e(({ className: o }) => `.active .${s(`hs-select-active${t}${o}`)}`);
|
|
839
|
+
}
|
|
840
|
+
]), n("hs-input-number-disabled", [
|
|
841
|
+
({ modifySelectors: e, separator: t }) => {
|
|
842
|
+
e(({ className: o }) => `.disabled.${s(`hs-input-number-disabled${t}${o}`)}`);
|
|
843
|
+
},
|
|
844
|
+
({ modifySelectors: e, separator: t }) => {
|
|
845
|
+
e(({ className: o }) => `.disabled .${s(`hs-input-number-disabled${t}${o}`)}`);
|
|
846
|
+
}
|
|
847
|
+
]), n("hs-pin-input-active", [
|
|
848
|
+
({ modifySelectors: e, separator: t }) => {
|
|
849
|
+
e(({ className: o }) => `.active.${s(`hs-pin-input-active${t}${o}`)}`);
|
|
850
|
+
},
|
|
851
|
+
({ modifySelectors: e, separator: t }) => {
|
|
852
|
+
e(({ className: o }) => `.active .${s(`hs-pin-input-active${t}${o}`)}`);
|
|
853
|
+
}
|
|
854
|
+
]), n("hs-select-opened", [
|
|
855
|
+
({ modifySelectors: e, separator: t }) => {
|
|
856
|
+
e(({ className: o }) => `.opened.${s(`hs-select-opened${t}${o}`)}`);
|
|
857
|
+
}
|
|
858
|
+
]), n("hs-password-active", [
|
|
859
|
+
({ modifySelectors: e, separator: t }) => {
|
|
860
|
+
e(({ className: o }) => `.active.${s(`hs-password-active${t}${o}`)}`);
|
|
861
|
+
},
|
|
862
|
+
({ modifySelectors: e, separator: t }) => {
|
|
863
|
+
e(({ className: o }) => `.active .${s(`hs-password-active${t}${o}`)}`);
|
|
864
|
+
}
|
|
865
|
+
]), n("hs-stepper-active", [
|
|
866
|
+
({ modifySelectors: e, separator: t }) => {
|
|
867
|
+
e(({ className: o }) => `.active.${s(`hs-stepper-active${t}${o}`)}`);
|
|
868
|
+
},
|
|
869
|
+
({ modifySelectors: e, separator: t }) => {
|
|
870
|
+
e(({ className: o }) => `.active .${s(`hs-stepper-active${t}${o}`)}`);
|
|
871
|
+
}
|
|
872
|
+
]), n("hs-stepper-success", [
|
|
873
|
+
({ modifySelectors: e, separator: t }) => {
|
|
874
|
+
e(({ className: o }) => `.success.${s(`hs-stepper-success${t}${o}`)}`);
|
|
875
|
+
},
|
|
876
|
+
({ modifySelectors: e, separator: t }) => {
|
|
877
|
+
e(({ className: o }) => `.success .${s(`hs-stepper-success${t}${o}`)}`);
|
|
878
|
+
}
|
|
879
|
+
]), n("hs-stepper-completed", [
|
|
880
|
+
({ modifySelectors: e, separator: t }) => {
|
|
881
|
+
e(({ className: o }) => `.completed.${s(`hs-stepper-completed${t}${o}`)}`);
|
|
882
|
+
},
|
|
883
|
+
({ modifySelectors: e, separator: t }) => {
|
|
884
|
+
e(({ className: o }) => `.completed .${s(`hs-stepper-completed${t}${o}`)}`);
|
|
885
|
+
}
|
|
886
|
+
]), n("hs-stepper-error", [
|
|
887
|
+
({ modifySelectors: e, separator: t }) => {
|
|
888
|
+
e(({ className: o }) => `.error.${s(`hs-stepper-error${t}${o}`)}`);
|
|
889
|
+
},
|
|
890
|
+
({ modifySelectors: e, separator: t }) => {
|
|
891
|
+
e(({ className: o }) => `.error .${s(`hs-stepper-error${t}${o}`)}`);
|
|
892
|
+
}
|
|
893
|
+
]), n("hs-stepper-processed", [
|
|
894
|
+
({ modifySelectors: e, separator: t }) => {
|
|
895
|
+
e(({ className: o }) => `.processed.${s(`hs-stepper-processed${t}${o}`)}`);
|
|
896
|
+
},
|
|
897
|
+
({ modifySelectors: e, separator: t }) => {
|
|
898
|
+
e(({ className: o }) => `.processed .${s(`hs-stepper-processed${t}${o}`)}`);
|
|
899
|
+
}
|
|
900
|
+
]), n("hs-stepper-disabled", [
|
|
901
|
+
({ modifySelectors: e, separator: t }) => {
|
|
902
|
+
e(({ className: o }) => `.disabled.${s(`hs-stepper-disabled${t}${o}`)}`);
|
|
903
|
+
},
|
|
904
|
+
({ modifySelectors: e, separator: t }) => {
|
|
905
|
+
e(({ className: o }) => `.disabled .${s(`hs-stepper-disabled${t}${o}`)}`);
|
|
906
|
+
}
|
|
907
|
+
]), n("hs-stepper-skipped", [
|
|
908
|
+
({ modifySelectors: e, separator: t }) => {
|
|
909
|
+
e(({ className: o }) => `.skipped.${s(`hs-stepper-skipped${t}${o}`)}`);
|
|
910
|
+
},
|
|
911
|
+
({ modifySelectors: e, separator: t }) => {
|
|
912
|
+
e(({ className: o }) => `.skipped .${s(`hs-stepper-skipped${t}${o}`)}`);
|
|
913
|
+
}
|
|
914
|
+
]), n("hs-strong-password", [
|
|
915
|
+
({ modifySelectors: e, separator: t }) => {
|
|
916
|
+
e(({ className: o }) => `.passed.${s(`hs-strong-password${t}${o}`)}`);
|
|
917
|
+
},
|
|
918
|
+
({ modifySelectors: e, separator: t }) => {
|
|
919
|
+
e(({ className: o }) => `.passed .${s(`hs-strong-password${t}${o}`)}`);
|
|
920
|
+
}
|
|
921
|
+
]), n("hs-strong-password-accepted", [
|
|
922
|
+
({ modifySelectors: e, separator: t }) => {
|
|
923
|
+
e(({ className: o }) => `.accepted.${s(`hs-strong-password-accepted${t}${o}`)}`);
|
|
924
|
+
},
|
|
925
|
+
({ modifySelectors: e, separator: t }) => {
|
|
926
|
+
e(({ className: o }) => `.accepted .${s(`hs-strong-password-accepted${t}${o}`)}`);
|
|
927
|
+
}
|
|
928
|
+
]), n("hs-strong-password-active", [
|
|
929
|
+
({ modifySelectors: e, separator: t }) => {
|
|
930
|
+
e(({ className: o }) => `.active.${s(`hs-strong-password-active${t}${o}`)}`);
|
|
931
|
+
}
|
|
932
|
+
]), n("hs-combo-box-active", [
|
|
933
|
+
({ modifySelectors: e, separator: t }) => {
|
|
934
|
+
e(({ className: o }) => `.active .${s(`hs-combo-box-active${t}${o}`)}`);
|
|
935
|
+
},
|
|
936
|
+
({ modifySelectors: e, separator: t }) => {
|
|
937
|
+
e(({ className: o }) => `.active.${s(`hs-combo-box-active${t}${o}`)}`);
|
|
938
|
+
}
|
|
939
|
+
]), n("hs-combo-box-selected", [
|
|
940
|
+
({ modifySelectors: e, separator: t }) => {
|
|
941
|
+
e(({ className: o }) => `.selected .${s(`hs-combo-box-selected${t}${o}`)}`);
|
|
942
|
+
},
|
|
943
|
+
({ modifySelectors: e, separator: t }) => {
|
|
944
|
+
e(({ className: o }) => `.selected.${s(`hs-combo-box-selected${t}${o}`)}`);
|
|
945
|
+
}
|
|
946
|
+
]), n("hs-combo-box-tab-active", [
|
|
947
|
+
({ modifySelectors: e, separator: t }) => {
|
|
948
|
+
e(({ className: o }) => `.active.${s(`hs-combo-box-tab-active${t}${o}`)}`);
|
|
949
|
+
}
|
|
950
|
+
]), n("hs-apexcharts-tooltip-dark", [
|
|
951
|
+
({ modifySelectors: e, separator: t }) => {
|
|
952
|
+
e(({ className: o }) => `.dark.${s(`hs-apexcharts-tooltip-dark${t}${o}`)}`);
|
|
953
|
+
}
|
|
954
|
+
]), n("hs-success", [
|
|
955
|
+
({ modifySelectors: e, separator: t }) => {
|
|
956
|
+
e(({ className: o }) => `.success .${s(`hs-success${t}${o}`)}`);
|
|
957
|
+
},
|
|
958
|
+
({ modifySelectors: e, separator: t }) => {
|
|
959
|
+
e(({ className: o }) => `.success.${s(`hs-success${t}${o}`)}`);
|
|
960
|
+
}
|
|
961
|
+
]), n("hs-error", [
|
|
962
|
+
({ modifySelectors: e, separator: t }) => {
|
|
963
|
+
e(({ className: o }) => `.error .${s(`hs-error${t}${o}`)}`);
|
|
964
|
+
},
|
|
965
|
+
({ modifySelectors: e, separator: t }) => {
|
|
966
|
+
e(({ className: o }) => `.error.${s(`hs-error${t}${o}`)}`);
|
|
967
|
+
}
|
|
968
|
+
]), n("hs-default-mode-active", ({ modifySelectors: e, separator: t }) => {
|
|
969
|
+
e(({ className: o }) => `.default .${s(`hs-default-mode-active${t}${o}`)}`);
|
|
970
|
+
}), n("hs-dark-mode-active", ({ modifySelectors: e, separator: t }) => {
|
|
971
|
+
e(({ className: o }) => `.dark .${s(`hs-dark-mode-active${t}${o}`)}`);
|
|
972
|
+
}), n("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
|
|
973
|
+
e(({ className: o }) => `.auto .${s(`hs-auto-mode-active${t}${o}`)}`);
|
|
974
|
+
});
|
|
975
|
+
}, As = ({ model: n }) => {
|
|
976
|
+
const [s] = Et(), [e] = B(), [t] = ye(), [o] = T(), [c] = E(), [a] = y(Ce), { document: i, window: d } = q(), [l] = C(i == null ? void 0 : i.getElementById("highlighted-block")), [h] = C(
|
|
977
|
+
i == null ? void 0 : i.getElementById("selected-block")
|
|
978
|
+
), [p] = C(
|
|
979
|
+
i == null ? void 0 : i.getElementById("selected-styling-block")
|
|
980
|
+
), [u] = C(i == null ? void 0 : i.getElementById("dragged-block"));
|
|
981
|
+
w(() => {
|
|
982
|
+
t ? i == null || i.documentElement.classList.add("dark") : i == null || i.documentElement.classList.remove("dark");
|
|
983
|
+
}, [t, i]);
|
|
984
|
+
const x = f(s, "headingFont", "DM Sans"), v = f(s, "bodyFont", "DM Sans");
|
|
985
|
+
return w(() => {
|
|
986
|
+
const g = f(s, "primaryColor", "#000"), m = f(s, "secondaryColor", "#FFF"), b = Gt([
|
|
987
|
+
{ color: g, name: "primary" },
|
|
988
|
+
{ color: m, name: "secondary" }
|
|
989
|
+
]), j = f(s, "roundedCorners", "0");
|
|
990
|
+
!d || !d.tailwind || (d.tailwind.config = {
|
|
991
|
+
darkMode: "class",
|
|
992
|
+
theme: {
|
|
993
|
+
extend: {
|
|
994
|
+
fontFamily: {
|
|
995
|
+
heading: [x],
|
|
996
|
+
body: [v]
|
|
997
|
+
},
|
|
998
|
+
borderRadius: {
|
|
999
|
+
global: `${j || "0"}px`
|
|
1000
|
+
},
|
|
1001
|
+
colors: b
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
plugins: [Xt, Zt, Jt, d.tailwind.plugin.withOptions(() => _s)]
|
|
1005
|
+
});
|
|
1006
|
+
}, [s, d, x, v]), w(() => {
|
|
1007
|
+
h && (h.textContent = `${R(e, (g) => `[data-block-id="${g}"]`).join(",")}{
|
|
1008
|
+
outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
1009
|
+
}`);
|
|
1010
|
+
}, [e, h]), w(() => {
|
|
1011
|
+
if (!a) {
|
|
1012
|
+
u.textContent = "";
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
u.textContent = `[data-block-id="${a}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
|
|
1016
|
+
}, [a]), w(() => {
|
|
1017
|
+
l && (l.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
|
|
1018
|
+
}, [o, e, l]), w(() => {
|
|
1019
|
+
p && (p.textContent = `${R(c, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
|
|
1020
|
+
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
1021
|
+
}`);
|
|
1022
|
+
}, [c, p]), w(() => {
|
|
1023
|
+
const g = f(s, "bodyTextLightColor", "#64748b"), m = f(s, "bodyTextDarkColor", "#94a3b8"), b = f(s, "bodyBgLightColor", "#FFFFFF"), j = f(s, "bodyBgDarkColor", "#0f172a");
|
|
1024
|
+
i.body.className = `font-body antialiased text-[${g}] bg-[${b}] dark:text-[${m}] dark:bg-[${j}]`;
|
|
1025
|
+
}, [s, i, n]), n === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1026
|
+
x && /* @__PURE__ */ r.jsx(
|
|
1027
|
+
"link",
|
|
1028
|
+
{
|
|
1029
|
+
id: "heading-font",
|
|
1030
|
+
rel: "stylesheet",
|
|
1031
|
+
type: "text/css",
|
|
1032
|
+
href: `https://fonts.googleapis.com/css2?family=${x.replace(
|
|
1033
|
+
/ /g,
|
|
1034
|
+
"+"
|
|
1035
|
+
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1036
|
+
media: "all"
|
|
1037
|
+
}
|
|
1038
|
+
),
|
|
1039
|
+
v && x !== v && /* @__PURE__ */ r.jsx(
|
|
1040
|
+
"link",
|
|
1041
|
+
{
|
|
1042
|
+
id: "body-font",
|
|
1043
|
+
rel: "stylesheet",
|
|
1044
|
+
type: "text/css",
|
|
1045
|
+
href: `https://fonts.googleapis.com/css2?family=${v.replace(
|
|
1046
|
+
/ /g,
|
|
1047
|
+
"+"
|
|
1048
|
+
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
1049
|
+
media: "all"
|
|
1050
|
+
}
|
|
1051
|
+
),
|
|
1052
|
+
x && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${x}",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";}` })
|
|
1053
|
+
] }) : null;
|
|
1054
|
+
}, Is = (n) => {
|
|
1055
|
+
const s = {};
|
|
1056
|
+
return Object.keys(n).forEach((e) => {
|
|
1057
|
+
G(n[e]) && n[e].startsWith(de) && (s[e] = n[e].replace(de, "").split(","));
|
|
1058
|
+
}), s;
|
|
1059
|
+
}, Ss = Ye((n) => {
|
|
1060
|
+
const s = n.replace(Se, "").split(",");
|
|
1061
|
+
return Vt(s[0], s[1]);
|
|
1062
|
+
});
|
|
1063
|
+
function Ns(n, s) {
|
|
1064
|
+
return f(n, `${s}_attrs`, {});
|
|
1065
|
+
}
|
|
1066
|
+
function Ms(n) {
|
|
1067
|
+
const s = {};
|
|
1068
|
+
return Object.keys(n).forEach((e) => {
|
|
1069
|
+
if (G(n[e]) && n[e].startsWith(Se)) {
|
|
1070
|
+
const t = Ss(n[e]);
|
|
1071
|
+
s[e] = {
|
|
1072
|
+
className: t,
|
|
1073
|
+
"data-style-prop": e,
|
|
1074
|
+
"data-block-parent": n._id,
|
|
1075
|
+
"data-style-id": `${e}-${n._id}`,
|
|
1076
|
+
...Ns(n, e)
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
}), s;
|
|
1080
|
+
}
|
|
1081
|
+
function Es(n, s) {
|
|
1082
|
+
const e = f(n, "_bindings", {});
|
|
1083
|
+
return A(e) ? { ...n } : (Qe(e, (t, o) => {
|
|
1084
|
+
G(t) && f(s, t, null) && (n[o] = f(s, t, null));
|
|
1085
|
+
}), n);
|
|
1086
|
+
}
|
|
1087
|
+
function J({ blocks: n }) {
|
|
1088
|
+
const [s] = ee(), [e] = y(te), [t] = y(Ie), [o] = ts(), c = z((l) => Ms(l), []), [a] = Tt(), [i] = y(L), d = z(
|
|
1089
|
+
(l) => l.reduce((h, p) => {
|
|
1090
|
+
const u = f(o, p, {});
|
|
1091
|
+
return { ...h, ...u };
|
|
1092
|
+
}, {}),
|
|
1093
|
+
[o, s]
|
|
1094
|
+
);
|
|
1095
|
+
return /* @__PURE__ */ r.jsx(r.Fragment, { children: M.Children.toArray(
|
|
1096
|
+
n.map((l, h) => {
|
|
1097
|
+
if (i === l._id)
|
|
1098
|
+
return null;
|
|
1099
|
+
const p = Is(l), u = {};
|
|
1100
|
+
A(p) || Object.keys(p).forEach((j) => {
|
|
1101
|
+
u[j] = M.Children.toArray(
|
|
1102
|
+
p[j].map((K) => /* @__PURE__ */ r.jsx(J, { blocks: [Xe(s, { _id: K })] }))
|
|
1103
|
+
);
|
|
1104
|
+
});
|
|
1105
|
+
const x = ve(s, { _parent: l._id });
|
|
1106
|
+
u.children = x.length ? /* @__PURE__ */ r.jsx(J, { blocks: x }) : null;
|
|
1107
|
+
const v = es(l._type), g = f(v, "builderComponent", f(v, "component", null));
|
|
1108
|
+
if (Ze(g))
|
|
1109
|
+
return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` });
|
|
1110
|
+
const m = xe(v, "getBlockStateFrom") ? v == null ? void 0 : v.getBlockStateFrom(l, s) : [], b = d(m);
|
|
1111
|
+
return /* @__PURE__ */ r.jsx(ge, { children: M.createElement(g, {
|
|
1112
|
+
blockProps: {
|
|
1113
|
+
"data-block-id": l._id,
|
|
1114
|
+
"data-block-type": l._type,
|
|
1115
|
+
...e ? (
|
|
1116
|
+
// @ts-ignore
|
|
1117
|
+
{ "data-dnd": Lt(l._type, e == null ? void 0 : e._type) ? "yes" : "no" }
|
|
1118
|
+
) : {},
|
|
1119
|
+
...t === l._id ? { "data-drop": "yes" } : {}
|
|
1120
|
+
},
|
|
1121
|
+
index: h,
|
|
1122
|
+
...Es(l, a),
|
|
1123
|
+
...c(l),
|
|
1124
|
+
...u,
|
|
1125
|
+
inBuilder: !0,
|
|
1126
|
+
blockState: b
|
|
1127
|
+
}) });
|
|
1128
|
+
})
|
|
1129
|
+
) });
|
|
1130
|
+
}
|
|
1131
|
+
const Ts = () => {
|
|
1132
|
+
const [n] = ee(), s = A(n) ? null : /* @__PURE__ */ r.jsx(Ft, { children: /* @__PURE__ */ r.jsx(J, { blocks: ve(n, (e) => A(e._parent)) }) });
|
|
1133
|
+
return /* @__PURE__ */ r.jsx(r.Fragment, { children: s });
|
|
1134
|
+
}, Ls = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Fs = () => {
|
|
1135
|
+
const [n] = y(Rt), [s] = De(), [e] = V(), [, t] = B(), o = Pt(), [, c] = T(), a = re(null), i = re(null), [d, l] = C({ width: 0, height: 0 }), h = ps(d), [p, u] = C(0), [x, v] = C([]), [, g] = C([]), [, m] = y(Ht), [b, j] = E(), K = P("loading", !1), Fe = P("htmlDir", "ltr");
|
|
1136
|
+
w(() => {
|
|
1137
|
+
const { clientWidth: $, clientHeight: I } = i.current;
|
|
1138
|
+
l({ width: $, height: I }), p === 0 && u($);
|
|
1139
|
+
}, [i, e, p]);
|
|
1140
|
+
const Re = ($, I = 0) => {
|
|
1141
|
+
const { top: S } = $.getBoundingClientRect();
|
|
1142
|
+
return S + I >= 0 && S - I <= window.innerHeight;
|
|
1143
|
+
};
|
|
1144
|
+
w(() => {
|
|
1145
|
+
var $, I;
|
|
1146
|
+
if (o && o.type !== "Multiple" && a.current) {
|
|
1147
|
+
const S = Le(a.current.contentDocument, o._id);
|
|
1148
|
+
S && (Re(S) || (I = ($ = a.current) == null ? void 0 : $.contentWindow) == null || I.scrollTo({ top: S.offsetTop, behavior: "smooth" }), v([S]));
|
|
1149
|
+
}
|
|
1150
|
+
}, [o]), w(() => {
|
|
1151
|
+
if (!A(b) && a.current) {
|
|
1152
|
+
const $ = Ls(
|
|
1153
|
+
a.current.contentDocument,
|
|
1154
|
+
O(b).id
|
|
1155
|
+
);
|
|
1156
|
+
g($ ? [$] : [null]);
|
|
1157
|
+
} else
|
|
1158
|
+
g([null]);
|
|
1159
|
+
}, [b]);
|
|
1160
|
+
const Pe = Ue(() => {
|
|
1161
|
+
let $ = ds;
|
|
1162
|
+
return $ = $.replace("__HTML_DIR__", Fe), n === "offline" && ($ = $.replace(
|
|
1163
|
+
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
1164
|
+
"/offline/tailwind.cdn.js"
|
|
1165
|
+
), $ = $.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), $ = $.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), $;
|
|
1166
|
+
}, [n]);
|
|
1167
|
+
return /* @__PURE__ */ r.jsx(
|
|
1168
|
+
"div",
|
|
1169
|
+
{
|
|
1170
|
+
onClick: () => {
|
|
1171
|
+
t([]), j([]);
|
|
1172
|
+
},
|
|
1173
|
+
onMouseLeave: () => setTimeout(() => c(""), 300),
|
|
1174
|
+
className: "relative mx-auto h-full w-full overflow-hidden",
|
|
1175
|
+
style: p > 0 && !A(h) ? { width: s ? "100%" : p } : {},
|
|
1176
|
+
ref: i,
|
|
1177
|
+
children: /* @__PURE__ */ r.jsxs(
|
|
1178
|
+
hs,
|
|
1179
|
+
{
|
|
1180
|
+
contentDidMount: () => m(a.current),
|
|
1181
|
+
ref: a,
|
|
1182
|
+
id: "canvas-iframe",
|
|
1183
|
+
style: { width: `${e}px`, ...h },
|
|
1184
|
+
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
1185
|
+
initialContent: Pe,
|
|
1186
|
+
children: [
|
|
1187
|
+
/* @__PURE__ */ r.jsx(Cs, {}),
|
|
1188
|
+
/* @__PURE__ */ r.jsx(
|
|
1189
|
+
Ds,
|
|
1190
|
+
{
|
|
1191
|
+
block: o,
|
|
1192
|
+
selectedBlockElement: O(x)
|
|
1193
|
+
}
|
|
1194
|
+
),
|
|
1195
|
+
/* @__PURE__ */ r.jsx(As, { model: "page" }),
|
|
1196
|
+
/* @__PURE__ */ r.jsx(ss, { children: /* @__PURE__ */ r.jsx(js, { children: K ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(Ae, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ts, {}) }) }),
|
|
1197
|
+
/* @__PURE__ */ r.jsx("br", {}),
|
|
1198
|
+
/* @__PURE__ */ r.jsx(
|
|
1199
|
+
"div",
|
|
1200
|
+
{
|
|
1201
|
+
id: "placeholder",
|
|
1202
|
+
className: "pointer-events-none absolute z-[99999] max-w-full bg-green-500 transition-transform"
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
]
|
|
1206
|
+
}
|
|
1207
|
+
)
|
|
1208
|
+
}
|
|
1209
|
+
);
|
|
1210
|
+
}, zo = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
1211
|
+
/* @__PURE__ */ r.jsx(cs, {}),
|
|
1212
|
+
/* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 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] px-2", children: /* @__PURE__ */ r.jsx(ge, { fallback: /* @__PURE__ */ r.jsx(Ae, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(zt, { children: /* @__PURE__ */ r.jsx(Fs, {}) }) }) })
|
|
1213
|
+
] });
|
|
1214
|
+
export {
|
|
1215
|
+
zo as default
|
|
1216
|
+
};
|