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