@chaibuilder/sdk 1.1.11 → 1.1.13
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-Rd2EpNMr.js → AddBlocks-A7WofxHV.js} +29 -37
- package/dist/AddBlocks-Yuc4t0Z_.cjs +1 -0
- package/dist/{BrandingOptions-rTaSfm0M.cjs → BrandingOptions-KkPF1OGn.cjs} +1 -1
- package/dist/{BrandingOptions-OVjd8R6I.js → BrandingOptions-wkFrLFI_.js} +2 -2
- package/dist/{CanvasArea-zAT94LPr.js → CanvasArea-chEYQhH8.js} +52 -53
- package/dist/{CanvasArea-_eT3OREW.cjs → CanvasArea-kF46NWZK.cjs} +3 -3
- package/dist/{CurrentPage-awyWzrD1.js → CurrentPage-Wd7F9Egg.js} +15 -23
- package/dist/CurrentPage-p9MaXTOB.cjs +1 -0
- package/dist/{Layers-Iu48BWko.js → Layers-qMOMP2Mi.js} +9 -17
- package/dist/Layers-wQ0Fv9Xc.cjs +1 -0
- package/dist/{MarkAsGlobalBlock--GjBOKA4.js → MarkAsGlobalBlock-Czq45Amf.js} +2 -2
- package/dist/{MarkAsGlobalBlock-GV1kflbN.cjs → MarkAsGlobalBlock-sb3hMXLq.cjs} +1 -1
- package/dist/PagesPanel--maZxwX5.cjs +1 -0
- package/dist/{PagesPanel-FiGBY1m8.js → PagesPanel-ay4uk4mg.js} +7 -15
- package/dist/ProjectPanel-KhIpO7m3.cjs +1 -0
- package/dist/{ProjectPanel-c5QlZgrp.js → ProjectPanel-eLlbfAtj.js} +19 -27
- package/dist/{Settings-FuvoLEbx.js → Settings-lpoxaMDu.js} +8 -16
- package/dist/Settings-n2DpS5Ta.cjs +1 -0
- package/dist/SidePanels-Dud5Xh9L.cjs +1 -0
- package/dist/{SidePanels-2FjCLw9X.js → SidePanels-iRXV69vh.js} +10 -18
- package/dist/{Topbar-qloDpVn7.js → Topbar-dQYhW4iv.js} +2 -2
- package/dist/{Topbar-P3sqe-wG.cjs → Topbar-vqzjB75a.cjs} +1 -1
- package/dist/{UnsplashImages-8p0Vu9j_.cjs → UnsplashImages-3Sh4UZ-7.cjs} +1 -1
- package/dist/{UnsplashImages-aVlfl8Rj.js → UnsplashImages-AL1ASAoD.js} +2 -2
- package/dist/{UploadImages-7xgCWSqx.js → UploadImages-09wuhk2O.js} +2 -2
- package/dist/{UploadImages-PjW68B7L.cjs → UploadImages-mPzLhMiH.cjs} +1 -1
- package/dist/add-page-modal-FPnIWwqA.cjs +1 -0
- package/dist/{add-page-modal-o4WyfyUe.js → add-page-modal-TXREEFPZ.js} +20 -28
- package/dist/{confirm-alert-OQrR9mLj.js → confirm-alert-GkfW9chS.js} +2 -2
- package/dist/{confirm-alert-Wvv7pPyF.cjs → confirm-alert-YNyc3WEo.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +55 -63
- package/dist/{delete-page-modal-pWTbYmMV.js → delete-page-modal-LNME2FwD.js} +20 -28
- package/dist/delete-page-modal-sTbqZPvk.cjs +1 -0
- package/dist/{form-W_17vJvn.js → form-Fk4CaX1A.js} +1 -1
- package/dist/{form-1HQKf4Lc.cjs → form-OhgCJlVA.cjs} +1 -1
- package/dist/functions-ZWGlwlQY.cjs +1 -0
- package/dist/functions-slns6ONz.js +23 -0
- package/dist/html-to-json-kGgp07Hv.js +177 -0
- package/dist/html-to-json-po8on2ju.cjs +1 -0
- package/dist/{index-kVugkp77.cjs → index-61c5wSJn.cjs} +2 -2
- package/dist/{index-D15K4BZT.js → index-89A3jPHh.js} +2 -2
- package/dist/{index-MIe2pKhn.cjs → index-GNmGzavZ.cjs} +1 -1
- package/dist/{index-RYlMCgpN.js → index-Q5q5Y_8a.js} +16 -16
- package/dist/lib.cjs +2 -1
- package/dist/lib.d.ts +2 -65
- package/dist/lib.js +1140 -230
- package/dist/page-viewer-LPx-OTCC.js +110 -0
- package/dist/page-viewer-wQO9oV9h.cjs +1 -0
- package/dist/project-general-setting-8EwuN5lN.cjs +1 -0
- package/dist/{project-general-setting-rHyDn0aW.js → project-general-setting-sSpFUD_Y.js} +8 -16
- package/dist/{project-seo-setting-bW4cNODi.js → project-seo-setting-CGVegBtM.js} +3 -3
- package/dist/{project-seo-setting-uEYqfVt6.cjs → project-seo-setting-R77SKM1I.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +44 -50
- package/dist/{single-page-detail-UUVe4WYc.js → single-page-detail-32H1_IG4.js} +54 -62
- package/dist/single-page-detail-nyBEHLtT.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +6 -14
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +65 -7
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/dist/{useAddBlockByDrop-8i3iNtPF.cjs → useAddBlockByDrop-4VH-SMj7.cjs} +1 -1
- package/dist/{useAddBlockByDrop-wiagwec5.js → useAddBlockByDrop-_kyR0iI4.js} +1 -1
- package/dist/utils-tx6hqsHY.cjs +1 -0
- package/dist/{utils-PPBbw5bk.js → utils-zWMk4dB2.js} +18 -17
- package/package.json +1 -1
- package/dist/AddBlocks-YS5XlqpG.cjs +0 -1
- package/dist/CurrentPage-J3WuljO3.cjs +0 -1
- package/dist/Layers-SkyPSf1R.cjs +0 -1
- package/dist/PagesPanel-dzL5sq6p.cjs +0 -1
- package/dist/ProjectPanel-uOP0fGfw.cjs +0 -1
- package/dist/Settings-QxjYc9wt.cjs +0 -1
- package/dist/SidePanels-9tKSnDxd.cjs +0 -1
- package/dist/add-page-modal-1ied5RTu.cjs +0 -1
- package/dist/delete-page-modal-fKBafNSA.cjs +0 -1
- package/dist/functions-JFP-oMsY.js +0 -1109
- package/dist/functions-KMQYiBHf.cjs +0 -2
- package/dist/page-viewer-CijLLu6R.js +0 -118
- package/dist/page-viewer-_mpbB5Lr.cjs +0 -1
- package/dist/project-general-setting-gwcHJ-ow.cjs +0 -1
- package/dist/single-page-detail-aNLmbldV.cjs +0 -1
- package/dist/tailwind-config-OxLD7oFU.cjs +0 -1
- package/dist/tailwind-config-d1VL1lzE.js +0 -62
- package/dist/utils-It2K33fU.cjs +0 -1
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-61c5wSJn.cjs"),e=require("./index-GNmGzavZ.cjs"),u=require("react-i18next");require("i18next");require("./jsx-runtime-WUGKV8jN.cjs");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./utils-tx6hqsHY.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("./html-to-json-po8on2ju.cjs");require("himalaya");require("lucide-react");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("flat-to-nested");require("redux-undo");require("@react-hookz/web");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useProject=e.useProject;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { N as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { k as $ } from "./index-Q5q5Y_8a.js";
|
|
2
|
+
import { N as z, af as J, O as K, ah as ss, P as es, ae as as, x as os, i as ts, y as rs, Q as is, p as ps, R as ls, U as us, k as ms, V as cs, n as ds, W as Bs, X as ks, m as ns, L as Ss, Y as Cs, Z as Ps, _ as vs, $ as gs, a0 as ys, o as As, h as Ms, a1 as hs, M as Ds, l as Is, a3 as Rs, ag as fs, a6 as xs, a5 as Ts, a4 as Us, j as bs, ad as js, ai as ws, aj as Hs, w as Os, a7 as Fs, a9 as Gs, a2 as Ls, aa as Ws, a8 as Zs, ab as Es, ac as Ns } from "./index-89A3jPHh.js";
|
|
3
|
+
import { useTranslation as Vs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-NV737rRe.js";
|
|
6
6
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
@@ -15,22 +15,14 @@ import "flagged";
|
|
|
15
15
|
import "react-dnd";
|
|
16
16
|
import "lodash";
|
|
17
17
|
import "@minoru/react-dnd-treeview";
|
|
18
|
-
import "./
|
|
19
|
-
import "./utils-PPBbw5bk.js";
|
|
18
|
+
import "./utils-zWMk4dB2.js";
|
|
20
19
|
import "tailwind-merge";
|
|
21
|
-
import "himalaya";
|
|
22
|
-
import "./functions-JFP-oMsY.js";
|
|
23
|
-
import "@mhsdesign/jit-browser-tailwindcss";
|
|
24
|
-
import "@bobthered/tailwindcss-palette-generator";
|
|
25
|
-
import "@tailwindcss/forms";
|
|
26
|
-
import "@tailwindcss/typography";
|
|
27
|
-
import "@tailwindcss/aspect-ratio";
|
|
28
|
-
import "@tailwindcss/line-clamp";
|
|
29
|
-
import "./tailwind-config-d1VL1lzE.js";
|
|
30
20
|
import "react-hotkeys-hook";
|
|
31
21
|
import "@chaibuilder/runtime";
|
|
32
22
|
import "@radix-ui/react-icons";
|
|
33
23
|
import "sonner";
|
|
24
|
+
import "./html-to-json-kGgp07Hv.js";
|
|
25
|
+
import "himalaya";
|
|
34
26
|
import "lucide-react";
|
|
35
27
|
import "@radix-ui/react-toggle";
|
|
36
28
|
import "class-variance-authority";
|
|
@@ -57,53 +49,53 @@ import "flat-to-nested";
|
|
|
57
49
|
import "redux-undo";
|
|
58
50
|
import "@react-hookz/web";
|
|
59
51
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
52
|
+
$ as ChaiBuilderEditor,
|
|
53
|
+
z as useActiveModal,
|
|
54
|
+
J as useActivePanel,
|
|
55
|
+
K as useAddBlock,
|
|
56
|
+
ss as useAddBlockParent,
|
|
57
|
+
es as useAddClassesToBlocks,
|
|
58
|
+
as as useAllBlocks,
|
|
59
|
+
os as useBrandingOptions,
|
|
60
|
+
ts as useBuilderProp,
|
|
61
|
+
rs as useBuilderReset,
|
|
62
|
+
is as useBuildingBlocks,
|
|
63
|
+
ps as useCanvasHistory,
|
|
64
|
+
ls as useCanvasWidth,
|
|
65
|
+
us as useCanvasZoom,
|
|
66
|
+
ms as useCopyBlockIds,
|
|
67
|
+
cs as useCurrentPage,
|
|
68
|
+
ds as useCutBlockIds,
|
|
69
|
+
Bs as useDarkMode,
|
|
70
|
+
ks as useDeveloperPreviewMode,
|
|
71
|
+
ns as useDuplicateBlocks,
|
|
72
|
+
Ss as useFeatureSupport,
|
|
73
|
+
Cs as useGetPageData,
|
|
74
|
+
Ps as useHiddenBlockIds,
|
|
75
|
+
vs as useHighlightBlockId,
|
|
76
|
+
gs as useMarkAsGlobalBlock,
|
|
77
|
+
ys as useMoveBlocks,
|
|
78
|
+
As as usePasteBlocks,
|
|
79
|
+
Ms as usePreviewMode,
|
|
80
|
+
hs as useProject,
|
|
81
|
+
Ds as useReadOnlyMode,
|
|
82
|
+
Is as useRemoveBlocks,
|
|
83
|
+
Rs as useRemoveClassesFromBlocks,
|
|
84
|
+
fs as useSavePage,
|
|
85
|
+
xs as useSelectedBlock,
|
|
86
|
+
Ts as useSelectedBlockAllClasses,
|
|
87
|
+
Us as useSelectedBlockCurrentClasses,
|
|
88
|
+
bs as useSelectedBlockIds,
|
|
89
|
+
js as useSelectedBlocksDisplayChild,
|
|
90
|
+
ws as useSelectedBreakpoints,
|
|
91
|
+
Hs as useSelectedStylingBlocks,
|
|
92
|
+
Os as useSetAllBlocks,
|
|
93
|
+
Fs as useStylingBreakpoint,
|
|
94
|
+
Gs as useStylingState,
|
|
95
|
+
Vs as useTranslation,
|
|
96
|
+
Ls as useTranslations,
|
|
97
|
+
Ws as useTreeData,
|
|
98
|
+
Zs as useUILibraryBlocks,
|
|
99
|
+
Es as useUpdateBlocksProps,
|
|
100
|
+
Ns as useUpdateBlocksPropsRealtime
|
|
109
101
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { D as
|
|
3
|
-
import { j as x } from "./index-
|
|
1
|
+
import { j as e } from "./jsx-runtime-NV737rRe.js";
|
|
2
|
+
import { D as p, E as l, F as n, H as d, I as a, K as c, B as u } from "./index-89A3jPHh.js";
|
|
3
|
+
import { j as x } from "./index-Q5q5Y_8a.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
5
|
import "./MODIFIERS-MLfpKQY1.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@radix-ui/react-toggle";
|
|
8
8
|
import "class-variance-authority";
|
|
9
|
-
import "./utils-
|
|
9
|
+
import "./utils-zWMk4dB2.js";
|
|
10
10
|
import "lodash";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
@@ -43,49 +43,41 @@ import "react-textarea-autosize";
|
|
|
43
43
|
import "flagged";
|
|
44
44
|
import "react-dnd";
|
|
45
45
|
import "@minoru/react-dnd-treeview";
|
|
46
|
-
import "./lib.js";
|
|
47
|
-
import "himalaya";
|
|
48
|
-
import "./functions-JFP-oMsY.js";
|
|
49
|
-
import "@mhsdesign/jit-browser-tailwindcss";
|
|
50
|
-
import "@bobthered/tailwindcss-palette-generator";
|
|
51
|
-
import "@tailwindcss/forms";
|
|
52
|
-
import "@tailwindcss/typography";
|
|
53
|
-
import "@tailwindcss/aspect-ratio";
|
|
54
|
-
import "@tailwindcss/line-clamp";
|
|
55
|
-
import "./tailwind-config-d1VL1lzE.js";
|
|
56
46
|
import "react-hotkeys-hook";
|
|
57
47
|
import "sonner";
|
|
48
|
+
import "./html-to-json-kGgp07Hv.js";
|
|
49
|
+
import "himalaya";
|
|
58
50
|
import "lucide-react";
|
|
59
|
-
const
|
|
60
|
-
const m = {},
|
|
61
|
-
|
|
51
|
+
const ce = ({ pageData: r, projectData: i }) => {
|
|
52
|
+
const m = {}, t = x(), o = r.uuid === i.homepage, s = () => {
|
|
53
|
+
t.mutate(r, {
|
|
62
54
|
onSuccess: () => {
|
|
63
55
|
m({ uuid: i.homepage, slug: "/home" });
|
|
64
56
|
}
|
|
65
57
|
});
|
|
66
58
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ e.jsxs(p, { children: [
|
|
60
|
+
/* @__PURE__ */ e.jsx(l, { disabled: o, children: /* @__PURE__ */ e.jsx(
|
|
69
61
|
"div",
|
|
70
62
|
{
|
|
71
63
|
className: `flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${o ? "cursor-not-allowed border-red-200 text-red-200" : "cursor-pointer border-red-400 text-red-400"}`,
|
|
72
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ e.jsx(h, {})
|
|
73
65
|
}
|
|
74
66
|
) }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ e.jsxs(n, { children: [
|
|
68
|
+
/* @__PURE__ */ e.jsxs(d, { children: [
|
|
77
69
|
"Are you sure you want to delete ",
|
|
78
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
|
|
79
71
|
" page?"
|
|
80
72
|
] }),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ e.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
|
|
74
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
|
|
75
|
+
/* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
|
|
76
|
+
/* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: s, disabled: t.isPending, children: "Yes, Delete" })
|
|
85
77
|
] })
|
|
86
78
|
] })
|
|
87
79
|
] });
|
|
88
80
|
};
|
|
89
81
|
export {
|
|
90
|
-
|
|
82
|
+
ce as default
|
|
91
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-WUGKV8jN.cjs"),r=require("./index-GNmGzavZ.cjs"),l=require("./index-61c5wSJn.cjs"),q=require("@radix-ui/react-icons");require("./MODIFIERS-WFzDQfiT.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-tx6hqsHY.cjs");require("lodash");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-po8on2ju.cjs");require("himalaya");require("lucide-react");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
|
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-NV737rRe.js";
|
|
|
2
2
|
import b from "@rjsf/core";
|
|
3
3
|
import x from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as $, first as F } from "lodash";
|
|
5
|
-
import { bd as P, be as E, bf as O, bg as S } from "./index-
|
|
5
|
+
import { bd as P, be as E, bf as O, bg as S } from "./index-89A3jPHh.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-WUGKV8jN.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash"),d=require("./index-GNmGzavZ.cjs"),h=(c,n="")=>{switch(c.type){case"singular":return c.uiSchema;case"model":const{properties:p}=c,u={};return Object.keys(p).forEach(r=>{const e=p[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;u[o]=h(e,n)}),u;case"list":const{itemProperties:m}=c,l={items:{}};return Object.keys(m).forEach(r=>{const e=m[r];if(i.includes(["slot","styles"],e.type))return;const o=i.get(e,"i18n",!1)?`${r}-${n}`:r;l.items[o]=h(e,n)}),l;default:return{}}},x=(c,n="")=>{switch(c.type){case"singular":return c.schema;case"model":const{properties:p,title:u}=c,m={title:u,type:"object",properties:{}};return Object.keys(p).forEach(o=>{const t=p[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;m.properties[s]=x(t,n)}),m;case"list":const{itemProperties:l,title:r}=c,e={title:r,type:"array",items:{type:"object",properties:{}}};return Object.keys(l).forEach(o=>{const t=l[o];if(i.includes(["slot","styles"],t.type))return;const s=i.get(t,"i18n",!1)?`${o}-${n}`:o;e.items.properties[s]=x(t,n),i.set(e.items,"title",i.get(t,"itemTitle",`${r} item`))}),e;default:return{}}},$=({title:c,properties:n={},formData:p,onChange:u,disabled:m=!1,activeLang:l=""})=>{const r={type:"object",properties:{}},e={};Object.keys(n).forEach(t=>{const s=n[t];if(i.includes(["slot","styles"],s.type))return;const a=i.get(s,"i18n",!1)?`${t}-${l}`:t;r.properties[a]=x(s,l),e[a]=h(s,l)});const o=({...t},s)=>{const a=s==null?void 0:s.replace("root.","").split("/").pop();if(!s||!a)return;const j=i.first(a.split("."));s&&j&&u({...t},j)};return f.jsxRuntimeExports.jsxs(f.jsxRuntimeExports.Fragment,{children:[c&&f.jsxRuntimeExports.jsx("h1",{className:"px-1 text-sm font-semibold underline",children:c}),f.jsxRuntimeExports.jsx("div",{className:"-mx-3",children:f.jsxRuntimeExports.jsx(y,{widgets:{richtext:d.RichTextEditorField,icon:d.IconPickerField,image:d.ImagePickerField},fields:{link:d.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:e,schema:r,formData:p,validator:E,onChange:o,disabled:m})})]})};exports.Form=$;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("lodash"),d=require("./MODIFIERS-WFzDQfiT.cjs"),g=(a,s="c-")=>{const n=e.get(a,"bodyTextLightColor","#64748b"),o=e.get(a,"bodyTextDarkColor","#94a3b8"),l=e.get(a,"bodyBgLightColor","#FFFFFF"),c=e.get(a,"bodyBgDarkColor","#0f172a");return`${s}font-body ${s}antialiased ${s}text-[${n}] ${s}bg-[${l}] dark:${s}text-[${o}] dark:${s}bg-[${c}]`},u=(a,s="c-")=>{const o=a.replace(d.STYLES_KEY,"").split(",").map(l=>l.split(" ").map(t=>{if(t==="")return"";if(e.includes(t,"hs-")||e.includes(t,"[--")||e.includes(t,"paddle"))return t;if(t.includes(":")){const r=t.split(":");return r[r.length-1]=s+e.last(r),r.join(":")}return`${s}${t}`}).join(" "));return`${d.STYLES_KEY}${o.join(" , ")}`};exports.addPrefixToClasses=u;exports.getBrandingClasses=g;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { get as r, includes as n, last as g } from "lodash";
|
|
2
|
+
import { a as d } from "./MODIFIERS-MLfpKQY1.js";
|
|
3
|
+
const C = (a, s = "c-") => {
|
|
4
|
+
const c = r(a, "bodyTextLightColor", "#64748b"), l = r(a, "bodyTextDarkColor", "#94a3b8"), e = r(a, "bodyBgLightColor", "#FFFFFF"), $ = r(a, "bodyBgDarkColor", "#0f172a");
|
|
5
|
+
return `${s}font-body ${s}antialiased ${s}text-[${c}] ${s}bg-[${e}] dark:${s}text-[${l}] dark:${s}bg-[${$}]`;
|
|
6
|
+
}, h = (a, s = "c-") => {
|
|
7
|
+
const l = a.replace(d, "").split(",").map((e) => e.split(" ").map((t) => {
|
|
8
|
+
if (t === "")
|
|
9
|
+
return "";
|
|
10
|
+
if (n(t, "hs-") || n(t, "[--") || n(t, "paddle"))
|
|
11
|
+
return t;
|
|
12
|
+
if (t.includes(":")) {
|
|
13
|
+
const o = t.split(":");
|
|
14
|
+
return o[o.length - 1] = s + g(o), o.join(":");
|
|
15
|
+
}
|
|
16
|
+
return `${s}${t}`;
|
|
17
|
+
}).join(" "));
|
|
18
|
+
return `${d}${l.join(" , ")}`;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
h as a,
|
|
22
|
+
C as g
|
|
23
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { stringify as h, parse as k } from "himalaya";
|
|
2
|
+
import { g as x, d as L } from "./utils-zWMk4dB2.js";
|
|
3
|
+
import { includes as y, get as c, isEmpty as g, forEach as $, find as o, set as u, capitalize as w, flatMapDeep as C, filter as S, omit as B, flatten as I } from "lodash";
|
|
4
|
+
import { a as p } from "./MODIFIERS-MLfpKQY1.js";
|
|
5
|
+
const A = {
|
|
6
|
+
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
7
|
+
video: {
|
|
8
|
+
src: "url",
|
|
9
|
+
autoplay: "controls.autoPlay",
|
|
10
|
+
muted: "controls.muted",
|
|
11
|
+
loop: "controls.loop",
|
|
12
|
+
controls: "controls.widgets"
|
|
13
|
+
},
|
|
14
|
+
a: {
|
|
15
|
+
href: "link.href",
|
|
16
|
+
target: "link.target",
|
|
17
|
+
type: ""
|
|
18
|
+
// @TODO: Detect here what to url, email, phone, elementId
|
|
19
|
+
},
|
|
20
|
+
input: {
|
|
21
|
+
placeholder: "placeholder",
|
|
22
|
+
required: "required",
|
|
23
|
+
type: "inputType",
|
|
24
|
+
name: "fieldName"
|
|
25
|
+
},
|
|
26
|
+
textarea: {
|
|
27
|
+
placeholder: "placeholder",
|
|
28
|
+
required: "required",
|
|
29
|
+
type: "inputType",
|
|
30
|
+
name: "fieldName"
|
|
31
|
+
},
|
|
32
|
+
select: {
|
|
33
|
+
placeholder: "placeholder",
|
|
34
|
+
required: "required",
|
|
35
|
+
multiple: "multiple",
|
|
36
|
+
name: "fieldName"
|
|
37
|
+
}
|
|
38
|
+
}, H = (t, e) => t.children.length === 1 && y(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), _ = (t) => t.map((e) => e.type === "text" ? c(e, "content", "") : g(e.children) ? "" : _(e.children)).join(""), m = (t) => t === null ? !0 : t, f = (t) => {
|
|
39
|
+
const e = {}, r = A[t.tagName] || {}, a = t.attributes;
|
|
40
|
+
return $(a, ({ key: i, value: l }) => {
|
|
41
|
+
if (r[i]) {
|
|
42
|
+
if (t.tagName === "img" && i === "src" && !l.startsWith("http")) {
|
|
43
|
+
const s = o(t.attributes, { key: "width" }), n = o(t.attributes, { key: "height" });
|
|
44
|
+
s && n ? l = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${n == null ? void 0 : n.value}` : l = "https://via.placeholder.com/150x150";
|
|
45
|
+
}
|
|
46
|
+
u(e, r[i], m(l));
|
|
47
|
+
} else
|
|
48
|
+
y(["style", "class", "srcset"], i) || u(e, `styles_attrs.${i}`, m(l));
|
|
49
|
+
}), delete e.class, e;
|
|
50
|
+
}, q = (t, e = "styles") => {
|
|
51
|
+
if (!t.attributes)
|
|
52
|
+
return { [e]: `${p},` };
|
|
53
|
+
const r = o(t.attributes, { key: "class" });
|
|
54
|
+
if (r) {
|
|
55
|
+
const a = r.value;
|
|
56
|
+
return { [e]: `${p},${a}` };
|
|
57
|
+
}
|
|
58
|
+
return { [e]: `${p},` };
|
|
59
|
+
}, E = (t) => {
|
|
60
|
+
switch (t.tagName) {
|
|
61
|
+
case "img":
|
|
62
|
+
return { _type: "Image" };
|
|
63
|
+
case "input":
|
|
64
|
+
return { _type: "Input", showLabel: !1 };
|
|
65
|
+
case "hr":
|
|
66
|
+
return { _type: "Divider" };
|
|
67
|
+
case "br":
|
|
68
|
+
return { _type: "LineBreak" };
|
|
69
|
+
case "textarea":
|
|
70
|
+
return { _type: "TextArea", showLabel: !1 };
|
|
71
|
+
case "audio":
|
|
72
|
+
return { _type: "Audio" };
|
|
73
|
+
case "iframe":
|
|
74
|
+
return { _type: "Iframe" };
|
|
75
|
+
case "canvas":
|
|
76
|
+
return { _type: "Canvas" };
|
|
77
|
+
case "video":
|
|
78
|
+
return { _type: "CustomHTML" };
|
|
79
|
+
case "svg":
|
|
80
|
+
return { _type: "Icon" };
|
|
81
|
+
case "select":
|
|
82
|
+
return { _type: "Select", options: [] };
|
|
83
|
+
case "option":
|
|
84
|
+
return { _type: "Option" };
|
|
85
|
+
case "ul":
|
|
86
|
+
case "ol":
|
|
87
|
+
case "dl":
|
|
88
|
+
return {
|
|
89
|
+
_type: "List",
|
|
90
|
+
tag: t.tagName,
|
|
91
|
+
_listType: t.tagName === "ol" ? "list-decimal" : "list-none"
|
|
92
|
+
};
|
|
93
|
+
case "li":
|
|
94
|
+
case "dt":
|
|
95
|
+
return { _type: "ListItem", tag: t.tagName };
|
|
96
|
+
case "span":
|
|
97
|
+
case "figcaption":
|
|
98
|
+
case "legend":
|
|
99
|
+
return { _type: "Span", tag: t.tagName };
|
|
100
|
+
case "p":
|
|
101
|
+
return { _type: "Paragraph", content: "" };
|
|
102
|
+
case "a":
|
|
103
|
+
return { _type: "Link" };
|
|
104
|
+
case "form":
|
|
105
|
+
return { _type: "Form" };
|
|
106
|
+
case "label":
|
|
107
|
+
return { _type: "Label" };
|
|
108
|
+
case "button":
|
|
109
|
+
return { _type: "Button" };
|
|
110
|
+
case "code":
|
|
111
|
+
return { _type: "Code" };
|
|
112
|
+
case "h1":
|
|
113
|
+
case "h2":
|
|
114
|
+
case "h3":
|
|
115
|
+
case "h4":
|
|
116
|
+
case "h5":
|
|
117
|
+
case "h6":
|
|
118
|
+
return { _type: "Heading", tag: t.tagName };
|
|
119
|
+
case "table":
|
|
120
|
+
return { _type: "Table" };
|
|
121
|
+
case "tr":
|
|
122
|
+
return { _type: "TableRow" };
|
|
123
|
+
case "td":
|
|
124
|
+
case "th":
|
|
125
|
+
return { _type: "TableCell", tag: t.tagName };
|
|
126
|
+
case "thead":
|
|
127
|
+
return { _type: "TableHead" };
|
|
128
|
+
case "tbody":
|
|
129
|
+
return { _type: "TableBody" };
|
|
130
|
+
case "tfoot":
|
|
131
|
+
return { _type: "TableFooter" };
|
|
132
|
+
default:
|
|
133
|
+
return {
|
|
134
|
+
_type: "Box",
|
|
135
|
+
tag: t.tagName,
|
|
136
|
+
name: t.tagName === "div" ? "Box" : w(t.tagName)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}, b = (t, e = null) => C(t, (r) => {
|
|
140
|
+
var l;
|
|
141
|
+
if (r.type === "comment")
|
|
142
|
+
return [];
|
|
143
|
+
let a = { _id: x() };
|
|
144
|
+
if (e && (a._parent = e.block._id), r.type === "text")
|
|
145
|
+
return g(c(r, "content", "")) ? [] : e && H(e.node, e.block) ? (u(e, "block.content", c(r, "content", "")), []) : { ...a, _type: "Text", content: c(r, "content", "") };
|
|
146
|
+
if (a = {
|
|
147
|
+
...a,
|
|
148
|
+
...E(r),
|
|
149
|
+
...f(r),
|
|
150
|
+
...q(r)
|
|
151
|
+
}, a._type === "Input") {
|
|
152
|
+
const s = a.inputType || "text";
|
|
153
|
+
s === "checkbox" ? u(a, "_type", "Checkbox") : s === "radio" && u(a, "_type", "Radio");
|
|
154
|
+
} else {
|
|
155
|
+
if (r.tagName === "video")
|
|
156
|
+
return a.content = h([r]), [a];
|
|
157
|
+
if (r.tagName === "svg") {
|
|
158
|
+
const s = o(r.attributes, { key: "height" }), n = o(r.attributes, { key: "width" }), d = c(s, "value") ? `[${c(s, "value")}px]` : "full", T = c(n, "value") ? `[${c(n, "value")}px]` : "full", v = c(o(r.attributes, { key: "class" }), "value");
|
|
159
|
+
return a.styles = `${p}, ${L(`w-${T} h-${d}`, v)}`.trim(), r.attributes = S(r.attributes, (N) => !y(["style", "width", "height", "class"], N.key)), a.icon = h([r]), u(a, "styles_attrs", B(c(a, "styles_attrs") || {}, ["height", "width", "style", "class"])), [a];
|
|
160
|
+
} else if (r.tagName == "option" && e && ((l = e.block) == null ? void 0 : l._type) === "Select")
|
|
161
|
+
return e.block.options.push({
|
|
162
|
+
label: _(r.children),
|
|
163
|
+
...f(r)
|
|
164
|
+
}), [];
|
|
165
|
+
}
|
|
166
|
+
const i = b(r.children, { block: a, node: r });
|
|
167
|
+
return [a, ...i];
|
|
168
|
+
}), M = (t) => {
|
|
169
|
+
const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
170
|
+
return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
171
|
+
}, R = (t) => {
|
|
172
|
+
const e = k(M(t));
|
|
173
|
+
return g(t) ? [] : I(b(e));
|
|
174
|
+
};
|
|
175
|
+
export {
|
|
176
|
+
R as g
|
|
177
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("himalaya"),p=require("./utils-tx6hqsHY.cjs"),e=require("lodash"),u=require("./MODIFIERS-WFzDQfiT.cjs"),T={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},v=(t,r)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],r._type),h=t=>t.map(r=>r.type==="text"?e.get(r,"content",""):e.isEmpty(r.children)?"":h(r.children)).join(""),g=t=>t===null?!0:t,y=t=>{const r={},s=T[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:c})=>{if(s[l]){if(t.tagName==="img"&&l==="src"&&!c.startsWith("http")){const i=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});i&&n?c=`https://via.placeholder.com/${i==null?void 0:i.value}x${n==null?void 0:n.value}`:c="https://via.placeholder.com/150x150"}e.set(r,s[l],g(c))}else e.includes(["style","class","srcset"],l)||e.set(r,`styles_attrs.${l}`,g(c))}),delete r.class,r},k=(t,r="styles")=>{if(!t.attributes)return{[r]:`${u.STYLES_KEY},`};const s=e.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[r]:`${u.STYLES_KEY},${a}`}}return{[r]:`${u.STYLES_KEY},`}},N=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"iframe":return{_type:"Iframe"};case"canvas":return{_type:"Canvas"};case"video":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},m=(t,r=null)=>e.flatMapDeep(t,s=>{var c;if(s.type==="comment")return[];let a={_id:p.generateUUID()};if(r&&(a._parent=r.block._id),s.type==="text")return e.isEmpty(e.get(s,"content",""))?[]:r&&v(r.node,r.block)?(e.set(r,"block.content",e.get(s,"content","")),[]):{...a,_type:"Text",content:e.get(s,"content","")};if(a={...a,...N(s),...y(s),...k(s)},a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?e.set(a,"_type","Checkbox"):i==="radio"&&e.set(a,"_type","Radio")}else{if(s.tagName==="video")return a.content=o.stringify([s]),[a];if(s.tagName==="svg"){const i=e.find(s.attributes,{key:"height"}),n=e.find(s.attributes,{key:"width"}),f=e.get(i,"value")?`[${e.get(i,"value")}px]`:"full",_=e.get(n,"value")?`[${e.get(n,"value")}px]`:"full",d=e.get(e.find(s.attributes,{key:"class"}),"value");return a.styles=`${u.STYLES_KEY}, ${p.cn$1(`w-${_} h-${f}`,d)}`.trim(),s.attributes=e.filter(s.attributes,b=>!e.includes(["style","width","height","class"],b.key)),a.icon=o.stringify([s]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(s.tagName=="option"&&r&&((c=r.block)==null?void 0:c._type)==="Select")return r.block.options.push({label:h(s.children),...y(s)}),[]}const l=m(s.children,{block:a,node:s});return[a,...l]}),L=t=>{const r=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(r&&r.length>0?r[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},S=t=>{const r=o.parse(L(t));return e.isEmpty(t)?[]:e.flatten(m(r))};exports.getBlocksFromHTML=S;
|