@chaibuilder/sdk 1.2.25 → 1.2.26
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-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
- package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
- package/dist/Class-PoYusiA5.cjs +1 -0
- package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
- package/dist/CurrentPage-Hl52iub_.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/ListTree-WvTjY5rr.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
- package/dist/PagesPanel-6rrLXEO-.js +64 -0
- package/dist/PagesPanel-WzCocl6u.cjs +1 -0
- package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
- package/dist/ProjectPanel-tz3bjdXy.js +85 -0
- package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
- package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
- package/dist/Settings-AqoKwR92.cjs +1 -0
- package/dist/SidePanels-3o6Okmvu.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/Topbar-pWzBEOed.js +132 -0
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal--6TTBRYa.cjs +1 -0
- package/dist/add-page-modal-k2Kb92HS.js +104 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/confirm-alert-GUhZ_G8w.js +60 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +75 -150
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
- package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
- package/dist/delete-page-modal-zONvdebd.js +83 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +37 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
- package/dist/form-lBQ_76Uw.cjs +1 -0
- package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
- package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
- package/dist/index-Gk6sASBd.js +3080 -0
- package/dist/index-OB199Izc.cjs +206 -0
- package/dist/index-SkyM3d6Q.js +39503 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-llTXLDGE.js +2201 -0
- package/dist/index-mbyqq81O.cjs +1 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +66 -62
- package/dist/page-viewer-2kwnKM6v.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
- package/dist/project-general-setting-CnNL98NM.cjs +1 -0
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +40 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +160 -365
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +1153 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/PagesPanel-u1IB-nRr.js +0 -48
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
|
@@ -1,86 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var E = (e, t, n) => (
|
|
4
|
-
import { j as o } from "./jsx-runtime-
|
|
5
|
-
import M, {
|
|
6
|
-
import {
|
|
7
|
-
import { ResetIcon as
|
|
8
|
-
import { B as
|
|
9
|
-
import { o as ot, b as je, t as st, j as S, n as T, v as it, f as L, w as F, a as ne, u as Ce, g as Be, i as De, m as rt, x as at, y as Ie, h as lt, z as ct, k as dt, A as pt, E as ut } from "./ChaiBuilderEditor-vP4at00I.js";
|
|
10
|
-
import { S as U } from "./separator-SctTn0Qi.js";
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var $e = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var E = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
5
|
+
import M, { createElement as se, useCallback as K, useState as I, useEffect as j, Component as me, Children as Fe, Suspense as ge, useRef as ie, useMemo as Pe } from "react";
|
|
6
|
+
import { map as O, includes as re, toUpper as Q, round as Oe, noop as $, has as fe, throttle as xe, isEmpty as N, first as W, omit as He, pick as ze, get as y, isString as ee, memoize as Ue, each as We, find as qe, filter as ye, isNull as Ke } from "lodash-es";
|
|
7
|
+
import { ResetIcon as ae, MobileIcon as le, LaptopIcon as Ve, DesktopIcon as Ye, DotsVerticalIcon as Je, EraserIcon as Qe, ZoomInIcon as Ze, DragHandleDots2Icon as Ge, ArrowUpIcon as Xe, CopyIcon as et, TrashIcon as tt } from "@radix-ui/react-icons";
|
|
8
|
+
import { v as ve, B as q, V as be, aB as nt, aC as ot, aD as st, aE as it, aF as rt, N as te, ab as at, h as V, aG as lt, aH as ct, aI as dt, aJ as pt, aK as ut, aL as ht, aM as mt, r as S, ac as T, A as gt, a as ft, b as xt, c as yt, d as vt, e as bt, f as kt, g as wt, ai as jt, O as ke, aA as U, L as Ct, aN as Bt, Y as L, a5 as Dt, aO as F, E as ne, t as we, q as je, s as Ce, z as It, aP as St, aQ as Be, aR as _t, aS as Nt, F as At, aT as Et, a1 as Mt, aU as Tt, S as De } from "./index-Gk6sASBd.js";
|
|
11
9
|
import { useTranslation as Y } from "react-i18next";
|
|
12
|
-
import { a as Se, u as oe } from "./useDarkMode-8VHJlYyE.js";
|
|
13
|
-
import { S as ht, H as mt, a as gt, b as ft } from "./hover-card-q138xxXR.js";
|
|
14
|
-
import { L as xt } from "./label-KaP7MRrs.js";
|
|
15
|
-
import { D as yt, a as vt, b as bt, f as kt, g as wt, d as jt } from "./dropdown-menu-El86_9Uo.js";
|
|
16
|
-
import { a as Ct, u as _e } from "./useSelectedBreakpoints-6NK5qd7T.js";
|
|
17
|
-
import { A as Bt, a as Dt, b as It, c as St, e as _t, f as At, d as Nt, h as Et, g as Mt } from "./alert-dialog-rypfO5ly.js";
|
|
18
10
|
import { useAtom as C } from "jotai";
|
|
19
|
-
import
|
|
11
|
+
import ce from "react-dom";
|
|
12
|
+
import w from "prop-types";
|
|
20
13
|
import { Quill as Lt } from "react-quill";
|
|
21
|
-
import {
|
|
22
|
-
import { useFeature as Ae } from "flagged";
|
|
14
|
+
import { useFeature as Ie } from "flagged";
|
|
23
15
|
import { flip as Rt } from "@floating-ui/dom";
|
|
24
|
-
import { useFloating as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import j from "prop-types";
|
|
38
|
-
import "@radix-ui/react-slot";
|
|
39
|
-
import "class-variance-authority";
|
|
40
|
-
import "./utils-dze1SGvB.js";
|
|
16
|
+
import { useFloating as $t, shift as Ft } from "@floating-ui/react-dom";
|
|
17
|
+
import { useResizeObserver as Pt } from "@react-hookz/web";
|
|
18
|
+
import { tailwindcssPaletteGenerator as Ot } from "@bobthered/tailwindcss-palette-generator";
|
|
19
|
+
import Ht from "@tailwindcss/typography";
|
|
20
|
+
import zt from "@tailwindcss/forms";
|
|
21
|
+
import Ut from "@tailwindcss/aspect-ratio";
|
|
22
|
+
import { Provider as Wt } from "react-wrap-balancer";
|
|
23
|
+
import { twMerge as qt } from "tailwind-merge";
|
|
24
|
+
import { S as de, a as Se } from "./STRINGS--j49GZJP.js";
|
|
25
|
+
import { getBlockComponent as Kt } from "@chaibuilder/runtime";
|
|
26
|
+
import { u as Vt, B as Yt, E as Jt } from "./index-SkyM3d6Q.js";
|
|
27
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
28
|
+
import "./Functions-7jnEwJyw.js";
|
|
41
29
|
import "clsx";
|
|
30
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
31
|
+
import "./Class-lGzsNBOK.js";
|
|
32
|
+
import "@radix-ui/react-toggle";
|
|
33
|
+
import "class-variance-authority";
|
|
34
|
+
import "@radix-ui/react-switch";
|
|
35
|
+
import "@radix-ui/react-slot";
|
|
36
|
+
import "@radix-ui/react-accordion";
|
|
37
|
+
import "@radix-ui/react-alert-dialog";
|
|
38
|
+
import "@radix-ui/react-dialog";
|
|
39
|
+
import "@radix-ui/react-label";
|
|
40
|
+
import "@radix-ui/react-scroll-area";
|
|
41
|
+
import "@radix-ui/react-tabs";
|
|
42
42
|
import "@radix-ui/react-tooltip";
|
|
43
|
+
import "@radix-ui/react-popover";
|
|
44
|
+
import "@radix-ui/react-menubar";
|
|
45
|
+
import "@radix-ui/react-hover-card";
|
|
46
|
+
import "@radix-ui/react-select";
|
|
47
|
+
import "@radix-ui/react-dropdown-menu";
|
|
48
|
+
import "@radix-ui/react-separator";
|
|
43
49
|
import "@radix-ui/react-toast";
|
|
44
|
-
import "
|
|
45
|
-
import "@radix-ui/react-
|
|
50
|
+
import "cmdk";
|
|
51
|
+
import "@radix-ui/react-context-menu";
|
|
52
|
+
import "react-icons-picker";
|
|
46
53
|
import "i18next";
|
|
47
|
-
import "./Functions-NzT2Six_.js";
|
|
48
54
|
import "react-hotkeys-hook";
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
import "@radix-ui/react-hover-card";
|
|
52
|
-
import "@radix-ui/react-label";
|
|
53
|
-
import "@radix-ui/react-dropdown-menu";
|
|
54
|
-
import "@radix-ui/react-alert-dialog";
|
|
55
|
-
import "./Controls-3Cc1XYXg.js";
|
|
56
|
-
const Qt = () => ge(() => Zt(), []), Gt = ({ children: e }) => {
|
|
57
|
-
const [, t] = Ee(), [n] = ot(), a = Qt();
|
|
58
|
-
return k(() => (t({}), G(n, (r) => {
|
|
59
|
-
const i = ye(a, { providerKey: r.providerKey });
|
|
60
|
-
if (i) {
|
|
61
|
-
const c = (i == null ? void 0 : i.mockFn) || (i == null ? void 0 : i.dataFn);
|
|
62
|
-
c && c(r.args).then(
|
|
63
|
-
(s) => t((l) => ({ ...l, [r.providerKey]: s }))
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
}), () => {
|
|
67
|
-
G(n, (r) => {
|
|
68
|
-
t((i) => (delete i[r.providerKey], i));
|
|
69
|
-
});
|
|
70
|
-
}), [a, n, t]), /* @__PURE__ */ o.jsx(o.Fragment, { children: e });
|
|
71
|
-
}, Xt = () => {
|
|
72
|
-
const { hasUndo: e, hasRedo: t, undo: n, redo: a } = je();
|
|
55
|
+
const Qt = () => {
|
|
56
|
+
const { hasUndo: e, hasRedo: t, undo: n, redo: r } = ve();
|
|
73
57
|
return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
|
|
74
|
-
/* @__PURE__ */ o.jsx(
|
|
75
|
-
/* @__PURE__ */ o.jsx(
|
|
58
|
+
/* @__PURE__ */ o.jsx(q, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, {}) }),
|
|
59
|
+
/* @__PURE__ */ o.jsx(q, { disabled: !t(), onClick: r, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, { className: "rotate-180 scale-y-[-1] transform" }) })
|
|
76
60
|
] });
|
|
77
61
|
};
|
|
78
|
-
function
|
|
79
|
-
const [e, t] =
|
|
62
|
+
function Zt() {
|
|
63
|
+
const [e, t] = be(), { t: n } = Y();
|
|
80
64
|
return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
|
|
81
|
-
/* @__PURE__ */ o.jsx(
|
|
65
|
+
/* @__PURE__ */ o.jsx(nt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
|
|
82
66
|
/* @__PURE__ */ o.jsxs(
|
|
83
|
-
|
|
67
|
+
ot,
|
|
84
68
|
{
|
|
85
69
|
id: "dark-mode-switch",
|
|
86
70
|
checked: e,
|
|
@@ -104,7 +88,7 @@ function en() {
|
|
|
104
88
|
)
|
|
105
89
|
] });
|
|
106
90
|
}
|
|
107
|
-
const
|
|
91
|
+
const pe = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
|
|
108
92
|
"svg",
|
|
109
93
|
{
|
|
110
94
|
className: e ? "rotate-90" : "",
|
|
@@ -127,149 +111,149 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
|
|
|
127
111
|
)
|
|
128
112
|
]
|
|
129
113
|
}
|
|
130
|
-
),
|
|
114
|
+
), Gt = [
|
|
131
115
|
{
|
|
132
116
|
title: "mobile_xs_title",
|
|
133
117
|
content: "mobile_xs_content",
|
|
134
118
|
breakpoint: "xs",
|
|
135
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
119
|
+
icon: /* @__PURE__ */ o.jsx(le, {}),
|
|
136
120
|
width: 400
|
|
137
121
|
},
|
|
138
122
|
{
|
|
139
123
|
title: "mobile_sm_title",
|
|
140
124
|
content: "mobile_sm_content",
|
|
141
125
|
breakpoint: "sm",
|
|
142
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
126
|
+
icon: /* @__PURE__ */ o.jsx(le, { className: "rotate-90" }),
|
|
143
127
|
width: 640
|
|
144
128
|
},
|
|
145
129
|
{
|
|
146
130
|
title: "tablet_md_title",
|
|
147
131
|
content: "tablet_md_content",
|
|
148
132
|
breakpoint: "md",
|
|
149
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
133
|
+
icon: /* @__PURE__ */ o.jsx(pe, {}),
|
|
150
134
|
width: 800
|
|
151
135
|
},
|
|
152
136
|
{
|
|
153
137
|
title: "tablet_lg_title",
|
|
154
138
|
content: "tablet_lg_content",
|
|
155
139
|
breakpoint: "lg",
|
|
156
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
140
|
+
icon: /* @__PURE__ */ o.jsx(pe, { landscape: !0 }),
|
|
157
141
|
width: 1024
|
|
158
142
|
},
|
|
159
143
|
{
|
|
160
144
|
title: "desktop_xl_title",
|
|
161
145
|
content: "desktop_xl_content",
|
|
162
146
|
breakpoint: "xl",
|
|
163
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
147
|
+
icon: /* @__PURE__ */ o.jsx(Ve, {}),
|
|
164
148
|
width: 1420
|
|
165
149
|
},
|
|
166
150
|
{
|
|
167
151
|
title: "large_desktop_2xl_title",
|
|
168
152
|
content: "large_desktop_2xl_content",
|
|
169
153
|
breakpoint: "2xl",
|
|
170
|
-
icon: /* @__PURE__ */ o.jsx(
|
|
154
|
+
icon: /* @__PURE__ */ o.jsx(Ye, {}),
|
|
171
155
|
width: 1920
|
|
172
156
|
}
|
|
173
|
-
],
|
|
157
|
+
], ue = ({
|
|
174
158
|
title: e,
|
|
175
159
|
content: t,
|
|
176
160
|
currentBreakpoint: n,
|
|
177
|
-
breakpoint:
|
|
178
|
-
width:
|
|
161
|
+
breakpoint: r,
|
|
162
|
+
width: a,
|
|
179
163
|
icon: i,
|
|
180
164
|
onClick: c
|
|
181
165
|
}) => {
|
|
182
166
|
const { t: s } = Y();
|
|
183
|
-
return /* @__PURE__ */ o.jsxs(
|
|
184
|
-
/* @__PURE__ */ o.jsx(
|
|
185
|
-
|
|
167
|
+
return /* @__PURE__ */ o.jsxs(st, { children: [
|
|
168
|
+
/* @__PURE__ */ o.jsx(it, { asChild: !0, children: /* @__PURE__ */ o.jsx(
|
|
169
|
+
q,
|
|
186
170
|
{
|
|
187
|
-
onClick: () => c(
|
|
171
|
+
onClick: () => c(a),
|
|
188
172
|
size: "sm",
|
|
189
|
-
variant:
|
|
173
|
+
variant: r === n ? "secondary" : "ghost",
|
|
190
174
|
children: i
|
|
191
175
|
}
|
|
192
176
|
) }),
|
|
193
|
-
/* @__PURE__ */ o.jsx(
|
|
177
|
+
/* @__PURE__ */ o.jsx(rt, { className: "w-52 border-border", children: /* @__PURE__ */ o.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ o.jsxs("div", { className: "space-y-1", children: [
|
|
194
178
|
/* @__PURE__ */ o.jsx("h4", { className: "text-sm font-semibold", children: s(e) }),
|
|
195
179
|
/* @__PURE__ */ o.jsx("p", { className: "text-xs", children: s(t) })
|
|
196
180
|
] }) }) })
|
|
197
181
|
] });
|
|
198
|
-
},
|
|
199
|
-
const [, e, t] =
|
|
200
|
-
n.includes(s) ? n.length > 2 &&
|
|
182
|
+
}, Xt = () => {
|
|
183
|
+
const [, e, t] = te(), [n, r] = at(), { t: a } = Y(), i = V("breakpoints", Gt), c = (s) => {
|
|
184
|
+
n.includes(s) ? n.length > 2 && r(n.filter((l) => l !== s)) : r((l) => [...l, s]);
|
|
201
185
|
};
|
|
202
|
-
return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children:
|
|
203
|
-
|
|
204
|
-
i.filter((s) =>
|
|
205
|
-
(s) => /* @__PURE__ */
|
|
186
|
+
return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children: O(i, (s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center rounded-md", children: [
|
|
187
|
+
O(
|
|
188
|
+
i.filter((s) => re(n, Q(s.breakpoint))),
|
|
189
|
+
(s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
|
|
206
190
|
),
|
|
207
|
-
/* @__PURE__ */ o.jsxs(
|
|
208
|
-
/* @__PURE__ */ o.jsx(
|
|
209
|
-
/* @__PURE__ */ o.jsxs(
|
|
210
|
-
/* @__PURE__ */ o.jsx(
|
|
211
|
-
/* @__PURE__ */ o.jsx(
|
|
212
|
-
|
|
213
|
-
|
|
191
|
+
/* @__PURE__ */ o.jsxs(lt, { children: [
|
|
192
|
+
/* @__PURE__ */ o.jsx(ct, { asChild: !0, children: /* @__PURE__ */ o.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ o.jsx(Je, { className: "scale-90 transform" }) }) }),
|
|
193
|
+
/* @__PURE__ */ o.jsxs(dt, { className: "w-56 border-border text-xs", children: [
|
|
194
|
+
/* @__PURE__ */ o.jsx(pt, { children: a("Breakpoints") }),
|
|
195
|
+
/* @__PURE__ */ o.jsx(ut, {}),
|
|
196
|
+
O(i, (s) => /* @__PURE__ */ o.jsx(
|
|
197
|
+
ht,
|
|
214
198
|
{
|
|
215
199
|
disabled: s.breakpoint === "xs",
|
|
216
|
-
onCheckedChange: () => c(
|
|
217
|
-
checked:
|
|
218
|
-
children:
|
|
200
|
+
onCheckedChange: () => c(Q(s.breakpoint)),
|
|
201
|
+
checked: re(n, Q(s.breakpoint)),
|
|
202
|
+
children: a(s.title)
|
|
219
203
|
},
|
|
220
204
|
s.breakpoint
|
|
221
205
|
))
|
|
222
206
|
] })
|
|
223
207
|
] })
|
|
224
208
|
] });
|
|
225
|
-
},
|
|
226
|
-
const { t: e } = Y(), { setNewBlocks: t } =
|
|
227
|
-
t([]), n([]),
|
|
209
|
+
}, en = () => {
|
|
210
|
+
const { t: e } = Y(), { setNewBlocks: t } = mt(), [, n] = S(), [, r] = T(), a = K(() => {
|
|
211
|
+
t([]), n([]), r([]);
|
|
228
212
|
}, [t]);
|
|
229
|
-
return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(
|
|
230
|
-
/* @__PURE__ */ o.jsx(
|
|
213
|
+
return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(gt, { children: [
|
|
214
|
+
/* @__PURE__ */ o.jsx(ft, { asChild: !0, children: /* @__PURE__ */ o.jsxs(q, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
|
|
231
215
|
/* @__PURE__ */ o.jsx(Qe, {}),
|
|
232
216
|
" ",
|
|
233
217
|
e("clear")
|
|
234
218
|
] }) }),
|
|
235
|
-
/* @__PURE__ */ o.jsxs(
|
|
236
|
-
/* @__PURE__ */ o.jsxs(
|
|
237
|
-
/* @__PURE__ */ o.jsx(
|
|
238
|
-
/* @__PURE__ */ o.jsx(
|
|
219
|
+
/* @__PURE__ */ o.jsxs(xt, { className: "border-border", children: [
|
|
220
|
+
/* @__PURE__ */ o.jsxs(yt, { children: [
|
|
221
|
+
/* @__PURE__ */ o.jsx(vt, { children: e("clear_canvas_title") }),
|
|
222
|
+
/* @__PURE__ */ o.jsx(bt, { children: e("clear_canvas_description") })
|
|
239
223
|
] }),
|
|
240
|
-
/* @__PURE__ */ o.jsxs(
|
|
241
|
-
/* @__PURE__ */ o.jsx(
|
|
242
|
-
/* @__PURE__ */ o.jsx(
|
|
224
|
+
/* @__PURE__ */ o.jsxs(kt, { children: [
|
|
225
|
+
/* @__PURE__ */ o.jsx(wt, { children: e("cancel") }),
|
|
226
|
+
/* @__PURE__ */ o.jsx(jt, { onClick: a, children: e("yes") })
|
|
243
227
|
] })
|
|
244
228
|
] })
|
|
245
229
|
] }) });
|
|
246
|
-
},
|
|
247
|
-
const e = V("darkMode", !1), [t] =
|
|
230
|
+
}, tn = () => {
|
|
231
|
+
const e = V("darkMode", !1), [t] = ke();
|
|
248
232
|
return /* @__PURE__ */ o.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
|
|
249
233
|
/* @__PURE__ */ o.jsxs("div", { className: "flex h-full space-x-2", children: [
|
|
250
234
|
e ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
251
|
-
/* @__PURE__ */ o.jsx(
|
|
235
|
+
/* @__PURE__ */ o.jsx(Zt, {}),
|
|
252
236
|
/* @__PURE__ */ o.jsx(U, { orientation: "vertical" })
|
|
253
237
|
] }) : null,
|
|
254
|
-
/* @__PURE__ */ o.jsx(
|
|
238
|
+
/* @__PURE__ */ o.jsx(Xt, {}),
|
|
255
239
|
/* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
|
|
256
240
|
/* @__PURE__ */ o.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
|
|
257
|
-
/* @__PURE__ */ o.jsx(
|
|
241
|
+
/* @__PURE__ */ o.jsx(Ze, { className: "h-3.5 w-3.5 flex-shrink-0" }),
|
|
258
242
|
" ",
|
|
259
243
|
/* @__PURE__ */ o.jsxs("div", { className: "text-xs leading-3", children: [
|
|
260
|
-
|
|
244
|
+
Oe(t, 0),
|
|
261
245
|
"%"
|
|
262
246
|
] })
|
|
263
247
|
] }),
|
|
264
248
|
/* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
|
|
265
|
-
/* @__PURE__ */ o.jsx(
|
|
249
|
+
/* @__PURE__ */ o.jsx(Qt, {})
|
|
266
250
|
] }),
|
|
267
251
|
/* @__PURE__ */ o.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
|
|
268
252
|
/* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
|
|
269
|
-
/* @__PURE__ */ o.jsx(
|
|
253
|
+
/* @__PURE__ */ o.jsx(en, {})
|
|
270
254
|
] })
|
|
271
255
|
] });
|
|
272
|
-
},
|
|
256
|
+
}, nn = `<!doctype html>
|
|
273
257
|
<html class="scroll-smooth h-full overflow-y-auto">
|
|
274
258
|
<head>
|
|
275
259
|
<meta charset="UTF-8">
|
|
@@ -317,8 +301,8 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
|
|
|
317
301
|
<div class="frame-root h-full"></div>
|
|
318
302
|
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
|
|
319
303
|
</body>
|
|
320
|
-
</html>`,
|
|
321
|
-
const [t] =
|
|
304
|
+
</html>`, on = (e) => {
|
|
305
|
+
const [t] = te(), [, n] = ke(), [r, a] = I({}), i = K(() => {
|
|
322
306
|
const { width: c, height: s } = e;
|
|
323
307
|
if (c < t) {
|
|
324
308
|
const l = parseFloat((c / t).toFixed(2).toString());
|
|
@@ -327,7 +311,7 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
|
|
|
327
311
|
s && (d = {
|
|
328
312
|
// Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
|
|
329
313
|
height: 100 + (s - p) / p * 100 + "%"
|
|
330
|
-
}),
|
|
314
|
+
}), a({
|
|
331
315
|
position: "relative",
|
|
332
316
|
top: 0,
|
|
333
317
|
transform: `scale(${l})`,
|
|
@@ -336,17 +320,17 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
|
|
|
336
320
|
maxWidth: "none"
|
|
337
321
|
}), n(l * 100);
|
|
338
322
|
} else
|
|
339
|
-
|
|
323
|
+
a({}), n(100);
|
|
340
324
|
}, [t, e, n]);
|
|
341
|
-
return
|
|
325
|
+
return j(() => {
|
|
342
326
|
i();
|
|
343
|
-
}, [t, e, n, i]),
|
|
327
|
+
}, [t, e, n, i]), r;
|
|
344
328
|
};
|
|
345
|
-
let
|
|
346
|
-
typeof document < "u" && (
|
|
347
|
-
typeof window < "u" && (
|
|
348
|
-
const
|
|
349
|
-
class
|
|
329
|
+
let _e, Ne;
|
|
330
|
+
typeof document < "u" && (_e = document);
|
|
331
|
+
typeof window < "u" && (Ne = window);
|
|
332
|
+
const Ae = M.createContext({ document: _e, window: Ne }), J = () => M.useContext(Ae), { Provider: sn, Consumer: No } = Ae;
|
|
333
|
+
class Ee extends me {
|
|
350
334
|
componentDidMount() {
|
|
351
335
|
this.props.contentDidMount();
|
|
352
336
|
}
|
|
@@ -354,21 +338,21 @@ class $e extends fe {
|
|
|
354
338
|
this.props.contentDidUpdate();
|
|
355
339
|
}
|
|
356
340
|
render() {
|
|
357
|
-
return
|
|
341
|
+
return Fe.only(this.props.children);
|
|
358
342
|
}
|
|
359
343
|
}
|
|
360
|
-
E(
|
|
361
|
-
children:
|
|
362
|
-
contentDidMount:
|
|
363
|
-
contentDidUpdate:
|
|
344
|
+
E(Ee, "propTypes", {
|
|
345
|
+
children: w.element.isRequired,
|
|
346
|
+
contentDidMount: w.func.isRequired,
|
|
347
|
+
contentDidUpdate: w.func.isRequired
|
|
364
348
|
});
|
|
365
|
-
class
|
|
366
|
-
constructor(n,
|
|
367
|
-
super(n,
|
|
349
|
+
class G extends me {
|
|
350
|
+
constructor(n, r) {
|
|
351
|
+
super(n, r);
|
|
368
352
|
E(this, "setRef", (n) => {
|
|
369
353
|
this.nodeRef.current = n;
|
|
370
|
-
const { forwardedRef:
|
|
371
|
-
typeof
|
|
354
|
+
const { forwardedRef: r } = this.props;
|
|
355
|
+
typeof r == "function" ? r(n) : r && (r.current = n);
|
|
372
356
|
});
|
|
373
357
|
E(this, "handleLoad", () => {
|
|
374
358
|
clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
|
|
@@ -399,8 +383,8 @@ class X extends fe {
|
|
|
399
383
|
const n = this.getDoc();
|
|
400
384
|
if (!n)
|
|
401
385
|
return null;
|
|
402
|
-
const
|
|
403
|
-
return [
|
|
386
|
+
const r = this.props.contentDidMount, a = this.props.contentDidUpdate, i = n.defaultView || n.parentView, c = /* @__PURE__ */ o.jsx(Ee, { contentDidMount: r, contentDidUpdate: a, children: /* @__PURE__ */ o.jsx(sn, { value: { document: n, window: i }, children: /* @__PURE__ */ o.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
|
|
387
|
+
return [ce.createPortal(this.props.head, this.getDoc().head), ce.createPortal(c, s)];
|
|
404
388
|
}
|
|
405
389
|
render() {
|
|
406
390
|
const n = {
|
|
@@ -416,16 +400,16 @@ class X extends fe {
|
|
|
416
400
|
// also inject into the body and can mess up React. For this reason
|
|
417
401
|
// initialContent is expected to have a div inside of the body
|
|
418
402
|
// element that we render react into.
|
|
419
|
-
E(
|
|
420
|
-
style:
|
|
403
|
+
E(G, "propTypes", {
|
|
404
|
+
style: w.object,
|
|
421
405
|
// eslint-disable-line
|
|
422
|
-
head:
|
|
423
|
-
initialContent:
|
|
424
|
-
mountTarget:
|
|
425
|
-
contentDidMount:
|
|
426
|
-
contentDidUpdate:
|
|
427
|
-
children:
|
|
428
|
-
}), E(
|
|
406
|
+
head: w.node,
|
|
407
|
+
initialContent: w.string,
|
|
408
|
+
mountTarget: w.string,
|
|
409
|
+
contentDidMount: w.func,
|
|
410
|
+
contentDidUpdate: w.func,
|
|
411
|
+
children: w.oneOfType([w.element, w.arrayOf(w.element)])
|
|
412
|
+
}), E(G, "defaultProps", {
|
|
429
413
|
style: {},
|
|
430
414
|
head: null,
|
|
431
415
|
children: void 0,
|
|
@@ -436,117 +420,117 @@ E(X, "propTypes", {
|
|
|
436
420
|
},
|
|
437
421
|
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
|
|
438
422
|
});
|
|
439
|
-
const
|
|
440
|
-
const { addCoreBlock: e } =
|
|
441
|
-
return
|
|
423
|
+
const rn = M.forwardRef((e, t) => /* @__PURE__ */ o.jsx(G, { ...e, forwardedRef: t })), an = () => {
|
|
424
|
+
const { addCoreBlock: e } = Ct(), t = V("getExternalPredefinedBlock", $);
|
|
425
|
+
return K(
|
|
442
426
|
async (n) => {
|
|
443
|
-
const { block:
|
|
444
|
-
if (
|
|
445
|
-
const c = await t(
|
|
446
|
-
return e({ blocks: c },
|
|
427
|
+
const { block: r, dropTargetId: a, relativeIndex: i } = n;
|
|
428
|
+
if (fe(r, "format")) {
|
|
429
|
+
const c = await t(r);
|
|
430
|
+
return e({ blocks: c }, a === 0 ? null : a, i);
|
|
447
431
|
}
|
|
448
|
-
return e(
|
|
432
|
+
return e(r, a === 0 ? null : a, i);
|
|
449
433
|
},
|
|
450
434
|
[e]
|
|
451
435
|
);
|
|
452
436
|
};
|
|
453
|
-
let _ = null,
|
|
454
|
-
function
|
|
455
|
-
const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10),
|
|
456
|
-
return { paddingLeft: n, paddingTop:
|
|
437
|
+
let _ = null, H = [], P = null, Me = null;
|
|
438
|
+
function ln(e) {
|
|
439
|
+
const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), r = parseInt(t.paddingTop, 10), a = parseInt(t.paddingRight, 10), i = parseInt(t.paddingBottom, 10);
|
|
440
|
+
return { paddingLeft: n, paddingTop: r, paddingRight: a, paddingBottom: i };
|
|
457
441
|
}
|
|
458
|
-
const
|
|
442
|
+
const he = (e, t, n) => {
|
|
459
443
|
if (!_)
|
|
460
444
|
return;
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
const d =
|
|
445
|
+
const r = e.getBoundingClientRect(), a = _ == null ? void 0 : _.getElementById("placeholder"), { paddingLeft: i, paddingTop: c, paddingRight: s, paddingBottom: l } = ln(e);
|
|
446
|
+
a.style.width = t === "vertical" ? r.width - i - s + "px" : "2px", a.style.height = t === "vertical" ? "2px" : r.height - c - l + "px", a.style.display = "block";
|
|
447
|
+
const d = H.reduce(
|
|
464
448
|
(p, m) => Math.abs(m - n) < Math.abs(p - n) ? m : p
|
|
465
449
|
);
|
|
466
|
-
|
|
467
|
-
},
|
|
468
|
-
const t =
|
|
469
|
-
let c =
|
|
470
|
-
|
|
450
|
+
Me = H.indexOf(d), t === "vertical" ? (a.style.top = e.offsetTop + d + "px", a.style.left = e.offsetLeft + i + "px") : (a.style.top = e.offsetTop + c + "px", a.style.left = e.offsetLeft + d + "px");
|
|
451
|
+
}, cn = (e) => {
|
|
452
|
+
const t = Te(e), n = window.getComputedStyle(e), r = t === "horizontal", a = parseInt(n.paddingLeft), i = parseInt(n.paddingTop);
|
|
453
|
+
let c = r ? a : i;
|
|
454
|
+
H = [c], Array.from(e.children).forEach((s) => {
|
|
471
455
|
const l = window.getComputedStyle(s), d = parseInt(
|
|
472
|
-
|
|
473
|
-
), p =
|
|
474
|
-
|
|
456
|
+
r ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
|
|
457
|
+
), p = r ? s.offsetWidth : s.offsetHeight;
|
|
458
|
+
H.push(c + p + d), c += p + d;
|
|
475
459
|
});
|
|
476
460
|
};
|
|
477
|
-
function
|
|
461
|
+
function Te(e) {
|
|
478
462
|
const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
|
|
479
463
|
if (t === "flex")
|
|
480
464
|
return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
|
|
481
465
|
if (t === "grid") {
|
|
482
|
-
const
|
|
483
|
-
if (a.includes("auto"))
|
|
484
|
-
return "vertical";
|
|
466
|
+
const r = window.getComputedStyle(e).gridTemplateRows, a = window.getComputedStyle(e).gridTemplateColumns;
|
|
485
467
|
if (r.includes("auto"))
|
|
468
|
+
return "vertical";
|
|
469
|
+
if (a.includes("auto"))
|
|
486
470
|
return "horizontal";
|
|
487
471
|
}
|
|
488
472
|
return t === "block" ? "vertical" : "horizontal";
|
|
489
473
|
}
|
|
490
|
-
const
|
|
491
|
-
const t = e.target, n =
|
|
474
|
+
const dn = xe((e) => {
|
|
475
|
+
const t = e.target, n = Te(t);
|
|
492
476
|
if (n === "vertical") {
|
|
493
|
-
const
|
|
494
|
-
|
|
477
|
+
const r = e.clientY - t.offsetTop;
|
|
478
|
+
he(t, n, r);
|
|
495
479
|
} else {
|
|
496
|
-
const
|
|
497
|
-
|
|
480
|
+
const r = e.clientX - t.offsetLeft;
|
|
481
|
+
he(t, n, r);
|
|
498
482
|
}
|
|
499
|
-
}, 200),
|
|
500
|
-
e.preventDefault(), e.stopPropagation(),
|
|
483
|
+
}, 200), pn = (e) => {
|
|
484
|
+
e.preventDefault(), e.stopPropagation(), dn(e);
|
|
501
485
|
};
|
|
502
|
-
function
|
|
486
|
+
function Z() {
|
|
503
487
|
const e = _ == null ? void 0 : _.getElementById("placeholder");
|
|
504
488
|
e.style.display = "none";
|
|
505
489
|
}
|
|
506
|
-
const
|
|
507
|
-
const { document: e } =
|
|
490
|
+
const un = () => {
|
|
491
|
+
const { document: e } = J(), [t, n] = C(Bt), r = an(), a = Ie("dnd"), [, i] = L(), [, c] = S();
|
|
508
492
|
return _ = e, {
|
|
509
493
|
isDragging: t,
|
|
510
494
|
"data-dnd": "branch",
|
|
511
|
-
onDragOver:
|
|
512
|
-
onDrop:
|
|
495
|
+
onDragOver: a ? pn : $,
|
|
496
|
+
onDrop: a ? (s) => {
|
|
513
497
|
P == null || P.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
514
498
|
const l = JSON.parse(s.dataTransfer.getData("text/plain"));
|
|
515
499
|
let d = s.target.getAttribute("data-block-id");
|
|
516
|
-
d === null && (d = s.target.parentElement.getAttribute("data-block-id")),
|
|
517
|
-
|
|
500
|
+
d === null && (d = s.target.parentElement.getAttribute("data-block-id")), r({ block: l, dropTargetId: d || null, relativeIndex: Me }), n(!1), Z(), setTimeout(() => {
|
|
501
|
+
Z();
|
|
518
502
|
}, 300);
|
|
519
|
-
} :
|
|
520
|
-
onDragEnter:
|
|
503
|
+
} : $,
|
|
504
|
+
onDragEnter: a ? (s) => {
|
|
521
505
|
const l = s;
|
|
522
|
-
P = l.target, l.stopPropagation(), l.preventDefault(),
|
|
506
|
+
P = l.target, l.stopPropagation(), l.preventDefault(), H = [];
|
|
523
507
|
const d = l.target;
|
|
524
|
-
|
|
525
|
-
} :
|
|
526
|
-
onDragLeave:
|
|
508
|
+
cn(d), d.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), i(""), c([]);
|
|
509
|
+
} : $,
|
|
510
|
+
onDragLeave: a ? (s) => {
|
|
527
511
|
const l = s;
|
|
528
512
|
P = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
|
|
529
|
-
} :
|
|
530
|
-
onMouseOut:
|
|
531
|
-
n(!1),
|
|
532
|
-
} :
|
|
513
|
+
} : $,
|
|
514
|
+
onMouseOut: a ? () => {
|
|
515
|
+
n(!1), Z();
|
|
516
|
+
} : $
|
|
533
517
|
};
|
|
534
518
|
};
|
|
535
|
-
function
|
|
519
|
+
function oe(e) {
|
|
536
520
|
return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
|
|
537
521
|
}
|
|
538
|
-
function
|
|
522
|
+
function hn(e) {
|
|
539
523
|
e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
|
|
540
524
|
var t = document.querySelector(".ql-toolbar");
|
|
541
525
|
t && t.parentNode.removeChild(t), e = null;
|
|
542
526
|
}
|
|
543
|
-
const
|
|
544
|
-
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t =
|
|
527
|
+
const mn = () => {
|
|
528
|
+
const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = Dt(), [, n] = L(), [r, a] = C(F);
|
|
545
529
|
return (i) => {
|
|
546
530
|
var m;
|
|
547
|
-
if (
|
|
531
|
+
if (r)
|
|
548
532
|
return;
|
|
549
|
-
const c =
|
|
533
|
+
const c = oe(i.target), s = c.getAttribute("data-block-type");
|
|
550
534
|
if (!s || !e.includes(s))
|
|
551
535
|
return;
|
|
552
536
|
const l = c.cloneNode(!0);
|
|
@@ -556,17 +540,17 @@ const xn = () => {
|
|
|
556
540
|
const d = new Lt(l, { placeholder: "Type here..." });
|
|
557
541
|
function p() {
|
|
558
542
|
const g = d.getText(0, d.getLength());
|
|
559
|
-
t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0),
|
|
543
|
+
t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0), hn(d), a(""), n("");
|
|
560
544
|
}
|
|
561
|
-
l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(),
|
|
545
|
+
l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), a(c.getAttribute("data-block-id"));
|
|
562
546
|
};
|
|
563
|
-
},
|
|
564
|
-
const [, e] = T(), [, t] = S(), [, n] = L(), [
|
|
565
|
-
return (
|
|
566
|
-
if (
|
|
547
|
+
}, gn = () => {
|
|
548
|
+
const [, e] = T(), [, t] = S(), [, n] = L(), [r] = C(F);
|
|
549
|
+
return (a) => {
|
|
550
|
+
if (r)
|
|
567
551
|
return;
|
|
568
|
-
|
|
569
|
-
const i =
|
|
552
|
+
a.stopPropagation();
|
|
553
|
+
const i = oe(a.target);
|
|
570
554
|
if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
|
|
571
555
|
t([]), e([]), n("");
|
|
572
556
|
return;
|
|
@@ -578,31 +562,31 @@ const xn = () => {
|
|
|
578
562
|
i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
|
|
579
563
|
n("");
|
|
580
564
|
};
|
|
581
|
-
},
|
|
582
|
-
const n =
|
|
565
|
+
}, fn = xe((e, t) => {
|
|
566
|
+
const n = oe(e.target);
|
|
583
567
|
n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
|
|
584
|
-
}, 100),
|
|
568
|
+
}, 100), xn = () => {
|
|
585
569
|
const [, e] = L(), [t] = C(F);
|
|
586
570
|
return (n) => {
|
|
587
|
-
t ||
|
|
571
|
+
t || fn(n, e);
|
|
588
572
|
};
|
|
589
|
-
},
|
|
590
|
-
const { document: t } =
|
|
591
|
-
|
|
573
|
+
}, yn = ({ children: e }) => {
|
|
574
|
+
const { document: t } = J(), [n] = S(), [r, a] = T();
|
|
575
|
+
j(() => {
|
|
592
576
|
setTimeout(() => {
|
|
593
|
-
if (!
|
|
577
|
+
if (!N(r))
|
|
594
578
|
return;
|
|
595
|
-
const d =
|
|
579
|
+
const d = Le(t, W(n));
|
|
596
580
|
if (d) {
|
|
597
581
|
const p = d.getAttribute("data-style-prop");
|
|
598
582
|
if (p) {
|
|
599
583
|
const m = d.getAttribute("data-style-id"), g = d.getAttribute("data-block-parent");
|
|
600
|
-
|
|
584
|
+
a([{ id: m, prop: p, blockId: g }]);
|
|
601
585
|
}
|
|
602
586
|
}
|
|
603
587
|
}, 100);
|
|
604
|
-
}, [t, n,
|
|
605
|
-
const i =
|
|
588
|
+
}, [t, n, a, r]);
|
|
589
|
+
const i = mn(), c = gn(), s = xn(), l = un();
|
|
606
590
|
return /* @__PURE__ */ o.jsx(
|
|
607
591
|
"div",
|
|
608
592
|
{
|
|
@@ -611,25 +595,25 @@ const xn = () => {
|
|
|
611
595
|
onClick: c,
|
|
612
596
|
onDoubleClick: i,
|
|
613
597
|
onMouseMove: s,
|
|
614
|
-
...
|
|
598
|
+
...He(l, "isDragging"),
|
|
615
599
|
className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
|
|
616
600
|
children: e
|
|
617
601
|
}
|
|
618
602
|
);
|
|
619
|
-
},
|
|
620
|
-
const { window: e } =
|
|
603
|
+
}, Le = (e, t) => e.querySelector(`[data-block-id="${t}"]`), vn = () => {
|
|
604
|
+
const { window: e } = J(), [t, n] = S(), [r] = ne(), [, a] = T(), { undo: i, redo: c } = ve(), s = we(), [, l] = je(), d = Ce(), { savePage: p } = It(), [m] = C(F), [, g] = C(St), k = (f) => {
|
|
621
605
|
f.key === "Enter" && (f.preventDefault(), t.length === 1 && g(W(t)));
|
|
622
606
|
}, B = (f) => {
|
|
623
|
-
const h =
|
|
607
|
+
const h = r.find((b) => b._id === f);
|
|
624
608
|
return h ? h._parent : null;
|
|
625
609
|
};
|
|
626
|
-
return
|
|
610
|
+
return j(() => {
|
|
627
611
|
const f = (h) => {
|
|
628
612
|
if (h.key === "Escape") {
|
|
629
|
-
n([]),
|
|
613
|
+
n([]), a([]);
|
|
630
614
|
return;
|
|
631
615
|
}
|
|
632
|
-
if (
|
|
616
|
+
if (k(h), !m && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), d(t)), h.ctrlKey || h.metaKey) {
|
|
633
617
|
if (h.key === "ArrowUp") {
|
|
634
618
|
h.preventDefault();
|
|
635
619
|
const b = t.length > 0 ? B(t[0]) : null;
|
|
@@ -647,34 +631,34 @@ const xn = () => {
|
|
|
647
631
|
e.removeEventListener("keydown", f);
|
|
648
632
|
};
|
|
649
633
|
}, [t, n, i, d, l, c, s, m, p, e]), null;
|
|
650
|
-
},
|
|
651
|
-
const [, n] = S(), [,
|
|
634
|
+
}, bn = ({ block: e, label: t }) => {
|
|
635
|
+
const [, n] = S(), [, r] = L(), [, a] = C(Be), i = Ie("dnd");
|
|
652
636
|
return /* @__PURE__ */ o.jsxs(
|
|
653
637
|
"div",
|
|
654
638
|
{
|
|
655
639
|
className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
|
|
656
640
|
draggable: i ? "true" : "false",
|
|
657
641
|
onDragStart: (c) => {
|
|
658
|
-
c.dataTransfer.setData("text/plain", JSON.stringify(
|
|
659
|
-
n([]),
|
|
642
|
+
c.dataTransfer.setData("text/plain", JSON.stringify(ze(e, ["_id", "_type"]))), a(e._id), setTimeout(() => {
|
|
643
|
+
n([]), r(null);
|
|
660
644
|
}, 200);
|
|
661
645
|
},
|
|
662
646
|
children: [
|
|
663
|
-
/* @__PURE__ */ o.jsx(
|
|
647
|
+
/* @__PURE__ */ o.jsx(Ge, {}),
|
|
664
648
|
t
|
|
665
649
|
]
|
|
666
650
|
}
|
|
667
651
|
);
|
|
668
|
-
},
|
|
669
|
-
const n =
|
|
652
|
+
}, kn = ({ selectedBlockElement: e, block: t }) => {
|
|
653
|
+
const n = Ce(), r = we(), [, a] = S(), [, i] = T(), [c] = C(F), { floatingStyles: s, refs: l, update: d } = $t({
|
|
670
654
|
placement: "top-start",
|
|
671
|
-
middleware: [
|
|
655
|
+
middleware: [Ft(), Rt()],
|
|
672
656
|
elements: {
|
|
673
657
|
reference: e
|
|
674
658
|
}
|
|
675
659
|
});
|
|
676
|
-
|
|
677
|
-
const p = y(t, "_parent", null), m =
|
|
660
|
+
Pt(e, () => d(), e !== null);
|
|
661
|
+
const p = y(t, "_parent", null), m = N(y(t, "_name", "")) ? y(t, "_type", "") : y(t, "_name", "");
|
|
678
662
|
return !e || !t || c ? null : /* @__PURE__ */ o.jsxs(
|
|
679
663
|
"div",
|
|
680
664
|
{
|
|
@@ -688,58 +672,58 @@ const xn = () => {
|
|
|
688
672
|
onKeyDown: (g) => g.stopPropagation(),
|
|
689
673
|
className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
|
|
690
674
|
children: [
|
|
691
|
-
/* @__PURE__ */ o.jsx(
|
|
675
|
+
/* @__PURE__ */ o.jsx(bn, { label: m, block: t }),
|
|
692
676
|
/* @__PURE__ */ o.jsxs("div", { className: "flex gap-2 px-1", children: [
|
|
693
677
|
p && /* @__PURE__ */ o.jsx(
|
|
694
678
|
Xe,
|
|
695
679
|
{
|
|
696
680
|
className: "hover:scale-105",
|
|
697
681
|
onClick: () => {
|
|
698
|
-
i([]),
|
|
682
|
+
i([]), a([p]);
|
|
699
683
|
}
|
|
700
684
|
}
|
|
701
685
|
),
|
|
702
|
-
|
|
703
|
-
|
|
686
|
+
_t(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(et, { className: "hover:scale-105", onClick: () => r([t == null ? void 0 : t._id]) }) : null,
|
|
687
|
+
Nt(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(tt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
|
|
704
688
|
] })
|
|
705
689
|
]
|
|
706
690
|
}
|
|
707
691
|
);
|
|
708
|
-
},
|
|
709
|
-
const [t] =
|
|
692
|
+
}, wn = ({ model: e }) => {
|
|
693
|
+
const [t] = At(), [n] = S(), [r] = be(), [a] = L(), [i] = T(), [c] = C(Be), { document: s, window: l } = J(), [d] = I(s == null ? void 0 : s.getElementById("highlighted-block")), [p] = I(
|
|
710
694
|
s == null ? void 0 : s.getElementById("selected-block")
|
|
711
695
|
), [m] = I(
|
|
712
696
|
s == null ? void 0 : s.getElementById("selected-styling-block")
|
|
713
697
|
), [g] = I(s == null ? void 0 : s.getElementById("dragged-block"));
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}, [
|
|
717
|
-
const
|
|
718
|
-
return
|
|
719
|
-
const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b =
|
|
698
|
+
j(() => {
|
|
699
|
+
r ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
|
|
700
|
+
}, [r, s]);
|
|
701
|
+
const k = y(t, "headingFont", "DM Sans"), B = y(t, "bodyFont", "DM Sans");
|
|
702
|
+
return j(() => {
|
|
703
|
+
const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b = Ot({
|
|
720
704
|
colors: [f, h],
|
|
721
705
|
names: ["primary", "secondary"]
|
|
722
706
|
});
|
|
723
707
|
b.primary.DEFAULT = f, b.secondary.DEFAULT = h;
|
|
724
|
-
const
|
|
708
|
+
const R = y(t, "roundedCorners", "0");
|
|
725
709
|
!l || !l.tailwind || (l.tailwind.config = {
|
|
726
710
|
darkMode: "class",
|
|
727
711
|
theme: {
|
|
728
712
|
fontFamily: {
|
|
729
|
-
heading: [
|
|
713
|
+
heading: [k],
|
|
730
714
|
body: [B]
|
|
731
715
|
},
|
|
732
716
|
extend: {
|
|
733
717
|
borderRadius: {
|
|
734
|
-
global: `${
|
|
718
|
+
global: `${R || "0"}px`
|
|
735
719
|
},
|
|
736
720
|
colors: b
|
|
737
721
|
}
|
|
738
722
|
},
|
|
739
723
|
plugins: [
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
724
|
+
Ht,
|
|
725
|
+
zt,
|
|
726
|
+
Ut,
|
|
743
727
|
l.tailwind.plugin.withOptions(() => ({ addVariant: z, e: D }) => {
|
|
744
728
|
z("hs-accordion-active", [
|
|
745
729
|
({ modifySelectors: v, separator: u }) => {
|
|
@@ -774,40 +758,40 @@ const xn = () => {
|
|
|
774
758
|
})
|
|
775
759
|
]
|
|
776
760
|
});
|
|
777
|
-
}, [t, l,
|
|
778
|
-
p && (p.textContent = `${
|
|
761
|
+
}, [t, l, k, B]), j(() => {
|
|
762
|
+
p && (p.textContent = `${O(n, (f) => `[data-block-id="${f}"]`).join(",")}{
|
|
779
763
|
outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
|
|
780
764
|
}`);
|
|
781
|
-
}, [n, p]),
|
|
765
|
+
}, [n, p]), j(() => {
|
|
782
766
|
if (!c) {
|
|
783
767
|
g.textContent = "";
|
|
784
768
|
return;
|
|
785
769
|
}
|
|
786
770
|
g.textContent = `[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
|
|
787
|
-
}, [c]),
|
|
788
|
-
d && (d.textContent =
|
|
789
|
-
}, [
|
|
790
|
-
m && (m.textContent = `${
|
|
771
|
+
}, [c]), j(() => {
|
|
772
|
+
d && (d.textContent = a ? `[data-style-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
|
|
773
|
+
}, [a, n, d]), j(() => {
|
|
774
|
+
m && (m.textContent = `${O(i, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
|
|
791
775
|
outline: 1px solid #42a1fc !important; outline-offset: -1px;
|
|
792
776
|
}`);
|
|
793
|
-
}, [i, m]),
|
|
794
|
-
const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"),
|
|
795
|
-
s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${
|
|
777
|
+
}, [i, m]), j(() => {
|
|
778
|
+
const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"), R = y(t, "bodyBgDarkColor", "#0f172a");
|
|
779
|
+
s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${R}]`;
|
|
796
780
|
}, [t, s, e]), e === "page" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
797
|
-
|
|
781
|
+
k && /* @__PURE__ */ o.jsx(
|
|
798
782
|
"link",
|
|
799
783
|
{
|
|
800
784
|
id: "heading-font",
|
|
801
785
|
rel: "stylesheet",
|
|
802
786
|
type: "text/css",
|
|
803
|
-
href: `https://fonts.googleapis.com/css2?family=${
|
|
787
|
+
href: `https://fonts.googleapis.com/css2?family=${k.replace(
|
|
804
788
|
/ /g,
|
|
805
789
|
"+"
|
|
806
790
|
)}:wght@300;400;500;600;700;800;900&display=swap`,
|
|
807
791
|
media: "all"
|
|
808
792
|
}
|
|
809
793
|
),
|
|
810
|
-
B &&
|
|
794
|
+
B && k !== B && /* @__PURE__ */ o.jsx(
|
|
811
795
|
"link",
|
|
812
796
|
{
|
|
813
797
|
id: "body-font",
|
|
@@ -820,93 +804,93 @@ const xn = () => {
|
|
|
820
804
|
media: "all"
|
|
821
805
|
}
|
|
822
806
|
),
|
|
823
|
-
|
|
807
|
+
k && /* @__PURE__ */ o.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${k}",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";}` })
|
|
824
808
|
] }) : null;
|
|
825
|
-
},
|
|
809
|
+
}, jn = (e) => {
|
|
826
810
|
const t = {};
|
|
827
811
|
return Object.keys(e).forEach((n) => {
|
|
828
|
-
|
|
812
|
+
ee(e[n]) && e[n].startsWith(de) && (t[n] = e[n].replace(de, "").split(","));
|
|
829
813
|
}), t;
|
|
830
|
-
},
|
|
831
|
-
const t = e.replace(
|
|
832
|
-
return
|
|
814
|
+
}, Cn = Ue((e) => {
|
|
815
|
+
const t = e.replace(Se, "").split(",");
|
|
816
|
+
return qt(t[0], t[1]);
|
|
833
817
|
});
|
|
834
|
-
function
|
|
818
|
+
function Bn(e, t) {
|
|
835
819
|
return y(e, `${t}_attrs`, {});
|
|
836
820
|
}
|
|
837
|
-
function
|
|
821
|
+
function Dn(e) {
|
|
838
822
|
const t = {};
|
|
839
823
|
return Object.keys(e).forEach((n) => {
|
|
840
|
-
if (
|
|
841
|
-
const
|
|
824
|
+
if (ee(e[n]) && e[n].startsWith(Se)) {
|
|
825
|
+
const r = Cn(e[n]);
|
|
842
826
|
t[n] = {
|
|
843
|
-
className:
|
|
827
|
+
className: r,
|
|
844
828
|
"data-style-prop": n,
|
|
845
829
|
"data-block-parent": e._id,
|
|
846
830
|
"data-style-id": `${n}-${e._id}`,
|
|
847
|
-
...
|
|
831
|
+
...Bn(e, n)
|
|
848
832
|
};
|
|
849
833
|
}
|
|
850
834
|
}), t;
|
|
851
835
|
}
|
|
852
|
-
function
|
|
836
|
+
function In(e, t) {
|
|
853
837
|
const n = y(e, "_bindings", {});
|
|
854
|
-
return
|
|
855
|
-
|
|
838
|
+
return N(n) ? { ...e } : (We(n, (r, a) => {
|
|
839
|
+
ee(r) && y(t, r, null) && (e[a] = y(t, r, null));
|
|
856
840
|
}), e);
|
|
857
841
|
}
|
|
858
|
-
function
|
|
859
|
-
const [t] = ne(), n =
|
|
842
|
+
function X({ blocks: e }) {
|
|
843
|
+
const [t] = ne(), n = K((i) => Dn(i), []), [r] = Vt(), [a] = C(F);
|
|
860
844
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: M.Children.toArray(
|
|
861
845
|
e.map((i, c) => {
|
|
862
|
-
if (
|
|
846
|
+
if (a === i._id)
|
|
863
847
|
return null;
|
|
864
|
-
const s =
|
|
865
|
-
|
|
848
|
+
const s = jn(i), l = {};
|
|
849
|
+
N(s) || Object.keys(s).forEach((g) => {
|
|
866
850
|
l[g] = M.Children.toArray(
|
|
867
|
-
s[g].map((
|
|
851
|
+
s[g].map((k) => /* @__PURE__ */ o.jsx(X, { blocks: [qe(t, { _id: k })] }))
|
|
868
852
|
);
|
|
869
853
|
});
|
|
870
|
-
const d =
|
|
871
|
-
l.children = d.length ? /* @__PURE__ */ o.jsx(
|
|
872
|
-
const p =
|
|
873
|
-
return
|
|
854
|
+
const d = ye(t, { _parent: i._id });
|
|
855
|
+
l.children = d.length ? /* @__PURE__ */ o.jsx(X, { blocks: d }) : null;
|
|
856
|
+
const p = Kt(i._type), m = y(p, "builderComponent", y(p, "component", null));
|
|
857
|
+
return Ke(m) ? /* @__PURE__ */ o.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` }) : /* @__PURE__ */ o.jsx(ge, { children: M.createElement(m, {
|
|
874
858
|
blockProps: {
|
|
875
859
|
"data-block-id": i._id,
|
|
876
860
|
"data-block-type": i._type,
|
|
877
|
-
"data-dnd":
|
|
861
|
+
"data-dnd": fe(p, "canAcceptBlock") ? "branch" : "leaf"
|
|
878
862
|
},
|
|
879
863
|
inBuilder: !0,
|
|
880
864
|
index: c,
|
|
881
|
-
...
|
|
865
|
+
...In(i, r),
|
|
882
866
|
...n(i),
|
|
883
867
|
...l
|
|
884
868
|
}) });
|
|
885
869
|
})
|
|
886
870
|
) });
|
|
887
871
|
}
|
|
888
|
-
const
|
|
889
|
-
const [e] = ne(), t =
|
|
890
|
-
return /* @__PURE__ */ o.jsx(
|
|
891
|
-
},
|
|
892
|
-
const [e] = C(
|
|
893
|
-
|
|
872
|
+
const Sn = () => {
|
|
873
|
+
const [e] = ne(), t = N(e) ? null : /* @__PURE__ */ o.jsx(Yt, { children: /* @__PURE__ */ o.jsx(X, { blocks: ye(e, (n) => N(n._parent)) }) });
|
|
874
|
+
return /* @__PURE__ */ o.jsx(Wt, { children: t });
|
|
875
|
+
}, _n = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Nn = () => {
|
|
876
|
+
const [e] = C(Et), [t] = je(), [n] = te(), [, r] = S(), a = Mt(), [, i] = L(), c = ie(null), s = ie(null), [l, d] = I({ width: 0, height: 0 }), p = on(l), [m, g] = I(0), [k, B] = I([]), [, f] = I([]), [, h] = C(Tt), [b, R] = T(), z = V("loading", !1);
|
|
877
|
+
j(() => {
|
|
894
878
|
const { clientWidth: u, clientHeight: x } = s.current;
|
|
895
879
|
d({ width: u, height: x }), m === 0 && g(u);
|
|
896
880
|
}, [s, n, m]);
|
|
897
881
|
const D = (u, x = 0) => {
|
|
898
|
-
const { top:
|
|
899
|
-
return
|
|
882
|
+
const { top: A } = u.getBoundingClientRect();
|
|
883
|
+
return A + x >= 0 && A - x <= window.innerHeight;
|
|
900
884
|
};
|
|
901
|
-
|
|
885
|
+
j(() => {
|
|
902
886
|
var u, x;
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
|
|
887
|
+
if (a && a.type !== "Multiple" && c.current) {
|
|
888
|
+
const A = Le(c.current.contentDocument, a._id);
|
|
889
|
+
A && (D(A) || (x = (u = c.current) == null ? void 0 : u.contentWindow) == null || x.scrollTo({ top: A.offsetTop, behavior: "smooth" }), B([A]));
|
|
906
890
|
}
|
|
907
|
-
}, [
|
|
908
|
-
if (!
|
|
909
|
-
const u =
|
|
891
|
+
}, [a]), j(() => {
|
|
892
|
+
if (!N(b) && c.current) {
|
|
893
|
+
const u = _n(
|
|
910
894
|
c.current.contentDocument,
|
|
911
895
|
W(b).id
|
|
912
896
|
);
|
|
@@ -914,8 +898,8 @@ const Nn = () => {
|
|
|
914
898
|
} else
|
|
915
899
|
f([null]);
|
|
916
900
|
}, [b]);
|
|
917
|
-
const v =
|
|
918
|
-
let u =
|
|
901
|
+
const v = Pe(() => {
|
|
902
|
+
let u = nn;
|
|
919
903
|
return e === "offline" && (u = u.replace(
|
|
920
904
|
"https://old.chaibuilder.com/offline/tailwind.cdn.js",
|
|
921
905
|
"/offline/tailwind.cdn.js"
|
|
@@ -925,14 +909,14 @@ const Nn = () => {
|
|
|
925
909
|
"div",
|
|
926
910
|
{
|
|
927
911
|
onClick: () => {
|
|
928
|
-
|
|
912
|
+
r([]), R([]);
|
|
929
913
|
},
|
|
930
914
|
onMouseLeave: () => setTimeout(() => i(""), 300),
|
|
931
915
|
className: "relative mx-auto h-full w-full overflow-hidden",
|
|
932
|
-
style: m > 0 && !
|
|
916
|
+
style: m > 0 && !N(p) ? { width: t ? "100%" : m } : {},
|
|
933
917
|
ref: s,
|
|
934
918
|
children: /* @__PURE__ */ o.jsxs(
|
|
935
|
-
|
|
919
|
+
rn,
|
|
936
920
|
{
|
|
937
921
|
contentDidMount: () => h(c.current),
|
|
938
922
|
ref: c,
|
|
@@ -941,16 +925,16 @@ const Nn = () => {
|
|
|
941
925
|
className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
|
|
942
926
|
initialContent: v,
|
|
943
927
|
children: [
|
|
944
|
-
/* @__PURE__ */ o.jsx(
|
|
928
|
+
/* @__PURE__ */ o.jsx(vn, {}),
|
|
945
929
|
/* @__PURE__ */ o.jsx(
|
|
946
|
-
|
|
930
|
+
kn,
|
|
947
931
|
{
|
|
948
|
-
block:
|
|
949
|
-
selectedBlockElement: W(
|
|
932
|
+
block: a,
|
|
933
|
+
selectedBlockElement: W(k)
|
|
950
934
|
}
|
|
951
935
|
),
|
|
952
|
-
/* @__PURE__ */ o.jsx(
|
|
953
|
-
/* @__PURE__ */ o.jsx(
|
|
936
|
+
/* @__PURE__ */ o.jsx(wn, { model: "page" }),
|
|
937
|
+
/* @__PURE__ */ o.jsx(yn, { children: z ? /* @__PURE__ */ o.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ o.jsx(De, { className: "h-full" }) }) : /* @__PURE__ */ o.jsx(Sn, {}) }),
|
|
954
938
|
/* @__PURE__ */ o.jsx("br", {}),
|
|
955
939
|
/* @__PURE__ */ o.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
|
|
956
940
|
]
|
|
@@ -958,10 +942,10 @@ const Nn = () => {
|
|
|
958
942
|
)
|
|
959
943
|
}
|
|
960
944
|
);
|
|
961
|
-
},
|
|
962
|
-
/* @__PURE__ */ o.jsx(
|
|
963
|
-
/* @__PURE__ */ o.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__ */ o.jsx(
|
|
945
|
+
}, Ao = () => /* @__PURE__ */ o.jsxs("div", { className: "flex h-full w-full flex-col", children: [
|
|
946
|
+
/* @__PURE__ */ o.jsx(tn, {}),
|
|
947
|
+
/* @__PURE__ */ o.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__ */ o.jsx(ge, { fallback: /* @__PURE__ */ o.jsx(De, { className: "h-full" }), children: /* @__PURE__ */ o.jsx(Jt, { children: /* @__PURE__ */ o.jsx(Nn, {}) }) }) })
|
|
964
948
|
] });
|
|
965
949
|
export {
|
|
966
|
-
|
|
950
|
+
Ao as default
|
|
967
951
|
};
|