@chaibuilder/sdk 1.2.64 → 1.2.65

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.
Files changed (78) hide show
  1. package/dist/CanvasArea-fSdH_RiN.cjs +1 -0
  2. package/dist/{CanvasArea-kB6ky_uL.js → CanvasArea-ut5yknzX.js} +58 -54
  3. package/dist/{CodeEditor-37od44Ou.js → CodeEditor-Qff4q7sx.js} +1 -1
  4. package/dist/{CurrentPage-bHq9Uusr.js → CurrentPage-jHSVy3hq.js} +38 -26
  5. package/dist/CurrentPage-p_AM4lrF.cjs +1 -0
  6. package/dist/{PagesPanel-wIPAyjJK.js → PagesPanel-U3InJ9Db.js} +20 -8
  7. package/dist/PagesPanel-wqDb4D-x.cjs +1 -0
  8. package/dist/{ProjectPanel-L-SlDizV.js → ProjectPanel-XODJTO4J.js} +36 -24
  9. package/dist/ProjectPanel-fWESzHr6.cjs +1 -0
  10. package/dist/{SidePanels-UQj0XTnb.js → SidePanels-ijaUKSek.js} +96 -82
  11. package/dist/SidePanels-lrMQqc0h.cjs +1 -0
  12. package/dist/Topbar-RrCDxd0i.cjs +1 -0
  13. package/dist/{Topbar-1O05wogM.js → Topbar-vHlnfxPs.js} +45 -30
  14. package/dist/UILibrariesPanel-7btHgBD0.cjs +1 -0
  15. package/dist/{UILibrariesPanel-vshiYI6G.js → UILibrariesPanel-NVUMUPUj.js} +85 -65
  16. package/dist/{UnsplashImages-Eq7hprBO.js → UnsplashImages-UkHihhA5.js} +18 -18
  17. package/dist/{UploadImages-lco2Tea3.js → UploadImages-HtuJZJlo.js} +1 -1
  18. package/dist/add-page-modal-RwIj1FxH.cjs +1 -0
  19. package/dist/{add-page-modal-qr7rvJzN.js → add-page-modal-TOfMfmPA.js} +33 -24
  20. package/dist/{confirm-alert-P6TAevaP.js → confirm-alert-eIp2cAkc.js} +1 -1
  21. package/dist/core.cjs +1 -1
  22. package/dist/core.d.ts +7 -8
  23. package/dist/core.js +74 -59
  24. package/dist/{delete-page-modal-55oioI9i.js → delete-page-modal-4bxjpVBD.js} +33 -21
  25. package/dist/delete-page-modal-qYDZmpgT.cjs +1 -0
  26. package/dist/email.cjs +1 -1
  27. package/dist/email.js +20 -5
  28. package/dist/{form-5ke_lZv8.js → form-NAzFjGs0.js} +9 -9
  29. package/dist/html-to-json-NqRjgFqp.cjs +1 -0
  30. package/dist/html-to-json-l_mw5y-e.js +243 -0
  31. package/dist/{index-6w-6HYBd.cjs → index--k2M8kzI.cjs} +1 -1
  32. package/dist/{index-audsIPBC.cjs → index-5XyNUAjc.cjs} +81 -22
  33. package/dist/{index-b33n_-zO.js → index-C7mB4XFm.js} +117 -117
  34. package/dist/{index-fnkMn4Pk.js → index-YZhtVcj_.js} +4 -4
  35. package/dist/{index-wRAIA8zZ.js → index-lFgDm1oa.js} +48587 -45055
  36. package/dist/lib.cjs +2 -2
  37. package/dist/lib.js +22 -22
  38. package/dist/page-viewer-4wrnWnK0.js +124 -0
  39. package/dist/page-viewer-ra0GLx1p.cjs +1 -0
  40. package/dist/{project-general-setting-NEkNjf7V.js → project-general-setting-IwZUkYF3.js} +18 -9
  41. package/dist/project-general-setting-lFjTUhHD.cjs +1 -0
  42. package/dist/{project-seo-setting-YmspOYsF.js → project-seo-setting-e1fTqVsd.js} +2 -2
  43. package/dist/{single-page-detail-jHzoDP7B.js → single-page-detail-ZNWFKqLW.js} +64 -55
  44. package/dist/single-page-detail-g55Anu7R.cjs +1 -0
  45. package/dist/studio.cjs +1 -1
  46. package/dist/studio.js +18 -6
  47. package/dist/style.css +2 -2
  48. package/dist/ui.js +67 -67
  49. package/package.json +1 -1
  50. package/dist/AddBlocks-6dJmFSgk.js +0 -142
  51. package/dist/AddBlocks-doCNVVbk.cjs +0 -1
  52. package/dist/CanvasArea-kdnkFfKR.cjs +0 -1
  53. package/dist/CurrentPage-Ekl5Cwbv.cjs +0 -1
  54. package/dist/PagesPanel-SMHrEmCb.cjs +0 -1
  55. package/dist/ProjectPanel-YruLal65.cjs +0 -1
  56. package/dist/Settings-WXkCyhAv.js +0 -2380
  57. package/dist/Settings-_5VHcgFC.cjs +0 -1
  58. package/dist/SidePanels-UeIZB3e1.cjs +0 -1
  59. package/dist/StaticCanvas-7C52tXAv.js +0 -749
  60. package/dist/StaticCanvas-ll9VTXI5.cjs +0 -60
  61. package/dist/ThemeConfigPanel-_86vVxLz.cjs +0 -1
  62. package/dist/ThemeConfigPanel-gw8B2zvx.js +0 -194
  63. package/dist/Topbar-gb17oHdJ.cjs +0 -1
  64. package/dist/UILibrariesPanel-03Y3F3A_.cjs +0 -1
  65. package/dist/add-page-modal-rOKavDFX.cjs +0 -1
  66. package/dist/atoms-KQpaDRnF.cjs +0 -1
  67. package/dist/atoms-Oomqut88.js +0 -6
  68. package/dist/delete-page-modal-wdAiMVnL.cjs +0 -1
  69. package/dist/html-to-json-_01DXd-a.js +0 -192
  70. package/dist/html-to-json-ndxaXRT8.cjs +0 -1
  71. package/dist/index-e0c8PmRQ.js +0 -205
  72. package/dist/index-gi1LIOCw.cjs +0 -1
  73. package/dist/page-viewer-t44DP65U.js +0 -112
  74. package/dist/page-viewer-wU7T0f48.cjs +0 -1
  75. package/dist/plugin-2hf9pCRy.cjs +0 -1
  76. package/dist/plugin-wDnsBVPp.js +0 -54
  77. package/dist/project-general-setting-87cX9vvO.cjs +0 -1
  78. package/dist/single-page-detail-27UjWK8L.cjs +0 -1
package/dist/core.js CHANGED
@@ -1,10 +1,10 @@
1
- import { A as Z, g as _, B as N, f as Q, C as V, L as X, T as Y, U as $ } from "./index-wRAIA8zZ.js";
2
- import "react";
3
- import { ap as as, aL as es, aq as os, aM as ts, ar as rs, aK as is, i as ps, aj as ls, h as ms, u as us, J as ds, as as cs, an as Bs, at as ns, au as ks, av as Cs, aw as Ss, ax as gs, n as Ps, ay as vs, az as ys, aA as As, aB as hs, _ as Is, ao as Ms, k as Rs, aC as Us, ad as fs, l as Ds, aE as Ts, aD as xs, j as Es, aJ as Fs, K as Hs, z as Ls, aF as Os, aH as bs, aG as js, F as ws, y as zs, aI as Gs } from "./index-b33n_-zO.js";
4
- import { useTranslation as Ks } from "react-i18next";
1
+ import { A as ps, e as ms, B as ls, S as us, C as ds, L as cs, T as Bs, U as ks } from "./index-lFgDm1oa.js";
2
+ import { bi as Cs, bu as bs, U as Ss, bv as gs, aC as Ps, bt as vs, i as ys, X as As, h as hs, u as Is, J as Rs, R as Us, ak as Ds, bj as Ms, bk as Ts, bl as fs, bm as xs, Y as Hs, n as Os, bn as js, bo as Es, V as Fs, bp as Ls, a2 as qs, bh as ws, k as zs, aD as Gs, b9 as Js, l as Ks, bq as Ns, aH as Vs, j as Ws, aN as Xs, K as Ys, z as Zs, br as Qs, aI as _s, bs as $s, F as so, y as oo, at as eo } from "./index-C7mB4XFm.js";
3
+ import { useTranslation as ao } from "react-i18next";
5
4
  import "i18next";
6
5
  import "./jsx-runtime-WbnYoNE9.js";
7
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
+ import "react";
8
8
  import "jotai";
9
9
  import "@react-hookz/web";
10
10
  import "react-arborist";
@@ -16,15 +16,31 @@ import "@radix-ui/react-icons";
16
16
  import "lucide-react";
17
17
  import "./index-VBXQixVm.js";
18
18
  import "react-dom";
19
- import "@radix-ui/react-scroll-area";
19
+ import "prop-types";
20
+ import "react-quill";
21
+ import "react-hotkeys-hook";
22
+ import "@floating-ui/dom";
20
23
  import "@floating-ui/react-dom";
21
24
  import "flagged";
22
- import "react-hotkeys-hook";
25
+ import "@tailwindcss/typography";
26
+ import "@tailwindcss/forms";
27
+ import "@tailwindcss/aspect-ratio";
28
+ import "tailwindcss-palette-generator";
29
+ import "./html-to-json-l_mw5y-e.js";
30
+ import "himalaya";
31
+ import "./MODIFIERS-fd5XOmum.js";
32
+ import "lodash";
23
33
  import "@chaibuilder/runtime";
34
+ import "react-wrap-balancer";
35
+ import "@rjsf/core";
36
+ import "@rjsf/validator-ajv8";
37
+ import "react-autosuggest";
38
+ import "fuse.js";
39
+ import "./utils-VpVqnC9m.js";
40
+ import "./controls-yjgoZzB6.js";
41
+ import "@radix-ui/react-scroll-area";
24
42
  import "@radix-ui/react-toggle";
25
43
  import "class-variance-authority";
26
- import "./utils-VpVqnC9m.js";
27
- import "./MODIFIERS-fd5XOmum.js";
28
44
  import "@radix-ui/react-switch";
29
45
  import "@radix-ui/react-slot";
30
46
  import "@radix-ui/react-accordion";
@@ -43,57 +59,56 @@ import "@radix-ui/react-toast";
43
59
  import "cmdk";
44
60
  import "@radix-ui/react-context-menu";
45
61
  import "react-icons-picker";
46
- import "react-quill";
47
62
  import "tree-model";
48
63
  export {
49
- Z as AddBlocksPanel,
50
- _ as BlockSettings,
51
- N as Breakpoints,
52
- Q as BuilderCanvas,
53
- V as ChaiBuilderEditor,
54
- X as Outline,
55
- Y as ThemeConfigPanel,
56
- $ as UndoRedo,
57
- as as useActiveModal,
58
- es as useActivePanel,
59
- os as useAddBlock,
60
- ts as useAddBlockParent,
61
- rs as useAddClassesToBlocks,
62
- is as useAllBlocks,
63
- ps as useBlocksStore,
64
- ls as useBrandingOptions,
65
- ms as useBuilderProp,
66
- us as useBuilderReset,
67
- ds as useCanvasWidth,
68
- cs as useCanvasZoom,
69
- Bs as useCodeEditor,
70
- ns as useCopyBlockIds,
71
- ks as useCopyToClipboard,
72
- Cs as useCurrentPage,
73
- Ss as useCutBlockIds,
74
- gs as useDarkMode,
75
- Ps as useDuplicateBlocks,
76
- vs as useGetPageData,
77
- ys as useHiddenBlockIds,
78
- As as useHighlightBlockId,
79
- hs as usePasteBlocks,
80
- Is as usePreviewMode,
81
- Ms as useReadOnlyMode,
82
- Rs as useRemoveBlocks,
83
- Us as useRemoveClassesFromBlocks,
84
- fs as useSavePage,
85
- Ds as useSelectedBlock,
86
- Ts as useSelectedBlockAllClasses,
87
- xs as useSelectedBlockCurrentClasses,
88
- Es as useSelectedBlockIds,
89
- Fs as useSelectedBlocksDisplayChild,
90
- Hs as useSelectedBreakpoints,
91
- Ls as useSelectedStylingBlocks,
92
- Os as useStylingBreakpoint,
93
- bs as useStylingState,
94
- Ks as useTranslation,
95
- js as useUILibraryBlocks,
96
- ws as useUndoManager,
97
- zs as useUpdateBlocksProps,
98
- Gs as useUpdateBlocksPropsRealtime
64
+ ps as AddBlocksPanel,
65
+ ms as BlockSettings,
66
+ ls as Breakpoints,
67
+ us as BuilderCanvas,
68
+ ds as ChaiBuilderEditor,
69
+ cs as Outline,
70
+ Bs as ThemeConfigPanel,
71
+ ks as UndoRedo,
72
+ Cs as useActiveModal,
73
+ bs as useActivePanel,
74
+ Ss as useAddBlock,
75
+ gs as useAddBlockParent,
76
+ Ps as useAddClassesToBlocks,
77
+ vs as useAllBlocks,
78
+ ys as useBlocksStore,
79
+ As as useBrandingOptions,
80
+ hs as useBuilderProp,
81
+ Is as useBuilderReset,
82
+ Rs as useCanvasWidth,
83
+ Us as useCanvasZoom,
84
+ Ds as useCodeEditor,
85
+ Ms as useCopyBlockIds,
86
+ Ts as useCopyToClipboard,
87
+ fs as useCurrentPage,
88
+ xs as useCutBlockIds,
89
+ Hs as useDarkMode,
90
+ Os as useDuplicateBlocks,
91
+ js as useGetPageData,
92
+ Es as useHiddenBlockIds,
93
+ Fs as useHighlightBlockId,
94
+ Ls as usePasteBlocks,
95
+ qs as usePreviewMode,
96
+ ws as useReadOnlyMode,
97
+ zs as useRemoveBlocks,
98
+ Gs as useRemoveClassesFromBlocks,
99
+ Js as useSavePage,
100
+ Ks as useSelectedBlock,
101
+ Ns as useSelectedBlockAllClasses,
102
+ Vs as useSelectedBlockCurrentClasses,
103
+ Ws as useSelectedBlockIds,
104
+ Xs as useSelectedBlocksDisplayChild,
105
+ Ys as useSelectedBreakpoints,
106
+ Zs as useSelectedStylingBlocks,
107
+ Qs as useStylingBreakpoint,
108
+ _s as useStylingState,
109
+ ao as useTranslation,
110
+ $s as useUILibraryBlocks,
111
+ so as useUndoManager,
112
+ oo as useUpdateBlocksProps,
113
+ eo as useUpdateBlocksPropsRealtime
99
114
  };
@@ -1,6 +1,6 @@
1
- import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-b33n_-zO.js";
3
- import { h } from "./index-fnkMn4Pk.js";
1
+ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { A as s, a as l, b as n, d, e as a, g as c, B as u } from "./index-C7mB4XFm.js";
3
+ import { h } from "./index-YZhtVcj_.js";
4
4
  import { TrashIcon as x } from "@radix-ui/react-icons";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "react";
@@ -38,48 +38,60 @@ import "jotai";
38
38
  import "@react-hookz/web";
39
39
  import "tree-model";
40
40
  import "react-i18next";
41
- import "./index-wRAIA8zZ.js";
41
+ import "./index-lFgDm1oa.js";
42
42
  import "i18next";
43
43
  import "react-arborist";
44
44
  import "lucide-react";
45
45
  import "./index-VBXQixVm.js";
46
+ import "prop-types";
47
+ import "react-hotkeys-hook";
48
+ import "@floating-ui/dom";
46
49
  import "@floating-ui/react-dom";
47
50
  import "flagged";
48
- import "react-hotkeys-hook";
49
- import "sonner";
50
- import "./html-to-json-_01DXd-a.js";
51
+ import "@tailwindcss/typography";
52
+ import "@tailwindcss/forms";
53
+ import "@tailwindcss/aspect-ratio";
54
+ import "tailwindcss-palette-generator";
55
+ import "./html-to-json-l_mw5y-e.js";
51
56
  import "himalaya";
52
57
  import "lodash";
53
- const he = ({ pageData: r, projectData: i }) => {
54
- const m = {}, t = h(), o = r.uuid === i.homepage, s = () => {
55
- t.mutate(r, {
58
+ import "react-wrap-balancer";
59
+ import "@rjsf/core";
60
+ import "@rjsf/validator-ajv8";
61
+ import "react-autosuggest";
62
+ import "fuse.js";
63
+ import "./controls-yjgoZzB6.js";
64
+ import "sonner";
65
+ const Tr = ({ pageData: t, projectData: i }) => {
66
+ const m = {}, e = h(), o = t.uuid === i.homepage, p = () => {
67
+ e.mutate(t, {
56
68
  onSuccess: () => {
57
69
  m({ uuid: i.homepage, slug: "/home" });
58
70
  }
59
71
  });
60
72
  };
61
- return /* @__PURE__ */ e.jsxs(p, { children: [
62
- /* @__PURE__ */ e.jsx(l, { disabled: o, children: /* @__PURE__ */ e.jsx(
73
+ return /* @__PURE__ */ r.jsxs(s, { children: [
74
+ /* @__PURE__ */ r.jsx(l, { disabled: o, children: /* @__PURE__ */ r.jsx(
63
75
  "div",
64
76
  {
65
77
  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"}`,
66
- children: /* @__PURE__ */ e.jsx(x, {})
78
+ children: /* @__PURE__ */ r.jsx(x, {})
67
79
  }
68
80
  ) }),
69
- /* @__PURE__ */ e.jsxs(n, { children: [
70
- /* @__PURE__ */ e.jsxs(d, { children: [
81
+ /* @__PURE__ */ r.jsxs(n, { children: [
82
+ /* @__PURE__ */ r.jsxs(d, { children: [
71
83
  "Are you sure you want to delete ",
72
- /* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
84
+ /* @__PURE__ */ r.jsx("i", { className: "text-red-500", children: t.name }),
73
85
  " page?"
74
86
  ] }),
75
- /* @__PURE__ */ e.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
76
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
77
- /* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
78
- /* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: s, disabled: t.isPending, children: "Yes, Delete" })
87
+ /* @__PURE__ */ r.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
88
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
89
+ /* @__PURE__ */ r.jsx(c, { disabled: e.isPending, children: "Cancel" }),
90
+ /* @__PURE__ */ r.jsx(u, { variant: "destructive", onClick: p, disabled: e.isPending, children: "Yes, Delete" })
79
91
  ] })
80
92
  ] })
81
93
  ] });
82
94
  };
83
95
  export {
84
- he as default
96
+ Tr as default
85
97
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-aeDphKpP.cjs"),o=require("./index--k2M8kzI.cjs"),l=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("jotai");require("@react-hookz/web");require("tree-model");require("react-i18next");require("./index-5XyNUAjc.cjs");require("i18next");require("react-arborist");require("lucide-react");require("./index--mLLy7QQ.cjs");require("prop-types");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./html-to-json-NqRjgFqp.cjs");require("himalaya");require("lodash");require("react-wrap-balancer");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-autosuggest");require("fuse.js");require("./controls-rRZhz0vu.cjs");require("sonner");const d=({pageData:i,projectData:t})=>{const n={},u=o.useDeletePage(),s=i.uuid===t.homepage,q=()=>{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(l.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:q,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
package/dist/email.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-audsIPBC.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("jotai");require("@react-hookz/web");require("react-arborist");require("./index-aeDphKpP.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("tree-model");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");const n=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),t=require("./index-5XyNUAjc.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("jotai");require("@react-hookz/web");require("react-arborist");require("./index-aeDphKpP.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-D_vtk3zK.cjs");require("./MODIFIERS-mVmfEGgo.cjs");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("./Functions-N3yhPYKY.cjs");require("@chaibuilder/runtime");require("tree-model");require("lucide-react");require("./index--mLLy7QQ.cjs");require("prop-types");require("react-hotkeys-hook");require("@floating-ui/dom");require("@floating-ui/react-dom");require("flagged");require("@tailwindcss/typography");require("@tailwindcss/forms");require("@tailwindcss/aspect-ratio");require("tailwindcss-palette-generator");require("./html-to-json-NqRjgFqp.cjs");require("himalaya");require("lodash");require("react-wrap-balancer");require("@rjsf/core");require("@rjsf/validator-ajv8");require("react-autosuggest");require("fuse.js");require("./controls-rRZhz0vu.cjs");const n=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:q=>o.includes(q.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(t.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
package/dist/email.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
- import { C as p } from "./index-wRAIA8zZ.js";
2
+ import { C as p } from "./index-lFgDm1oa.js";
3
3
  import { MobileIcon as t } from "@radix-ui/react-icons";
4
4
  import { includes as e } from "lodash-es";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
@@ -9,7 +9,7 @@ import "react-i18next";
9
9
  import "jotai";
10
10
  import "@react-hookz/web";
11
11
  import "react-arborist";
12
- import "./index-b33n_-zO.js";
12
+ import "./index-C7mB4XFm.js";
13
13
  import "@radix-ui/react-toggle";
14
14
  import "class-variance-authority";
15
15
  import "./utils-VpVqnC9m.js";
@@ -42,9 +42,24 @@ import "@chaibuilder/runtime";
42
42
  import "tree-model";
43
43
  import "lucide-react";
44
44
  import "./index-VBXQixVm.js";
45
+ import "prop-types";
46
+ import "react-hotkeys-hook";
47
+ import "@floating-ui/dom";
45
48
  import "@floating-ui/react-dom";
46
49
  import "flagged";
47
- import "react-hotkeys-hook";
50
+ import "@tailwindcss/typography";
51
+ import "@tailwindcss/forms";
52
+ import "@tailwindcss/aspect-ratio";
53
+ import "tailwindcss-palette-generator";
54
+ import "./html-to-json-l_mw5y-e.js";
55
+ import "himalaya";
56
+ import "lodash";
57
+ import "react-wrap-balancer";
58
+ import "@rjsf/core";
59
+ import "@rjsf/validator-ajv8";
60
+ import "react-autosuggest";
61
+ import "fuse.js";
62
+ import "./controls-yjgoZzB6.js";
48
63
  const n = [
49
64
  {
50
65
  title: "Mobile",
@@ -60,7 +75,7 @@ const n = [
60
75
  icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
61
76
  width: 700
62
77
  }
63
- ], ti = (o) => {
78
+ ], bi = (o) => {
64
79
  const r = {
65
80
  ...o,
66
81
  filterChaiBlock: (m) => e(m.type, "Email/"),
@@ -71,5 +86,5 @@ const n = [
71
86
  return /* @__PURE__ */ i.jsx(p, { ...r });
72
87
  };
73
88
  export {
74
- ti as ChaiBuilderEmail
89
+ bi as ChaiBuilderEmail
75
90
  };
@@ -1,8 +1,8 @@
1
1
  import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
- import b from "@rjsf/core";
3
- import x from "@rjsf/validator-ajv8";
4
- import { includes as h, get as a, set as $, first as F } from "lodash-es";
5
- import { b3 as P, b4 as E, b5 as O, b6 as S } from "./index-b33n_-zO.js";
2
+ import x from "@rjsf/core";
3
+ import $ from "@rjsf/validator-ajv8";
4
+ import { includes as h, get as a, set as F, first as P } from "lodash-es";
5
+ import { an as b, ao as E, ap as O, aq as S } from "./index-C7mB4XFm.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -61,7 +61,7 @@ const d = (i, l = "") => {
61
61
  if (h(["slot", "styles"], t.type))
62
62
  return;
63
63
  const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
64
- e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
64
+ e.items.properties[s] = y(t, l), F(e.items, "title", a(t, "itemTitle", `${r} item`));
65
65
  }), e;
66
66
  default:
67
67
  return {};
@@ -89,16 +89,16 @@ const d = (i, l = "") => {
89
89
  const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
90
90
  if (!s || !f)
91
91
  return;
92
- const j = F(f.split("."));
92
+ const j = P(f.split("."));
93
93
  s && j && m({ ...t }, j);
94
94
  };
95
95
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
96
96
  i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
97
97
  /* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
98
- b,
98
+ x,
99
99
  {
100
100
  widgets: {
101
- richtext: P,
101
+ richtext: b,
102
102
  icon: E,
103
103
  image: O
104
104
  },
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
113
113
  uiSchema: e,
114
114
  schema: r,
115
115
  formData: c,
116
- validator: x,
116
+ validator: $,
117
117
  onChange: o,
118
118
  disabled: n
119
119
  }
@@ -0,0 +1 @@
1
+ "use strict";const S=require("./_commonjsHelpers-wDK0ZLPo.cjs"),p=require("himalaya"),g=require("./Functions-N3yhPYKY.cjs"),s=require("lodash-es"),u=require("./MODIFIERS-mVmfEGgo.cjs"),f=require("lodash");var h={},_={};(function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});function e(a,n){return{handler:a,config:n}}e.withOptions=function(a,n=()=>({})){const c=function(i){return{__options:i,handler:a(i),config:n(i)}};return c.__isOptionsFunction=!0,c.__pluginFunction=a,c.__configFunction=n,c};const r=e})(_);(function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const e=r(_);function r(n){return n&&n.__esModule?n:{default:n}}const a=e.default})(h);let o=h;var N=(o.__esModule?o:{default:o}).default;const L=S.getDefaultExportFromCjs(N),$=t=>{const e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,r=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return e.test(t)||r.test(t)},P=t=>{if(s.isEmpty(t))return t;const e=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(e),n=t.match(r),c=a?a[1]:n?n[1]:null,i=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,l=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return c&&(i.test(c)||l.test(c))?c:t},d="$name",k={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"}},M=(t,e)=>t.children.length===1&&s.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],e._type),b=t=>t.map(e=>e.type==="text"?s.get(e,"content",""):s.isEmpty(e.children)?"":b(e.children)).join(""),y=t=>t===null?"":t,m=t=>{if(t.tagName==="svg")return{};const e={},r=k[t.tagName]||{},a=t.attributes;return s.forEach(a,({key:n,value:c})=>{if(n!==d)if(r[n]){if(t.tagName==="img"&&n==="src"&&!c.startsWith("http")){const i=s.find(t.attributes,{key:"width"}),l=s.find(t.attributes,{key:"height"});i&&l?c=`https://via.placeholder.com/${i==null?void 0:i.value}x${l==null?void 0:l.value}`:c="https://via.placeholder.com/150x150"}s.set(e,r[n],y(c))}else s.includes(["style","class","srcset"],n)||(f.has(e,"styles_attrs")||(e.styles_attrs={}),f.startsWith(n,"@")&&(n=n.replace("@","x-on:")),e.styles_attrs[`${n}`]=y(c))}),delete e.class,e},C=(t,e="styles")=>{if(!t.attributes)return{[e]:`${u.STYLES_KEY},`};const r=s.find(t.attributes,{key:"class"});if(r){const a=r.value;return{[e]:`${u.STYLES_KEY},${a}`}}return{[e]:`${u.STYLES_KEY},`}},q=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"canvas":return{_type:"Canvas"};case"video":case"iframe":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:const e=s.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:e,tag:t.tagName,_name:e=="EmptyBox"||t.tagName==="div"?e:s.capitalize(t.tagName)}}},v=(t,e=null)=>s.flatMapDeep(t,r=>{var c;if(r.type==="comment")return[];let a={_id:g.generateUUID()};if(e&&(a._parent=e.block._id),r.type==="text")return s.isEmpty(s.get(r,"content",""))?[]:e&&M(e.node,e.block)?(s.set(e,"block.content",s.get(r,"content","")),[]):{...a,_type:"Text",content:s.get(r,"content","")};if(a={...a,...q(r),...m(r),...C(r)},r.attributes){const i=r.attributes.find(l=>l.key===d);i&&(a._name=i.value)}if(a._type==="Input"){const i=a.inputType||"text";i==="checkbox"?s.set(a,"_type","Checkbox"):i==="radio"&&s.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const i=p.stringify([r]);return $(i)&&(s.set(a,"_type","Video"),s.set(a,"url",P(i)),s.set(a,"styles",`${u.STYLES_KEY},absolute top-0 left-0 w-full h-full`),s.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=i,[a]}else if(r.tagName==="svg"){const i=s.find(r.attributes,{key:"height"}),l=s.find(r.attributes,{key:"width"}),T=s.get(i,"value")?`[${s.get(i,"value")}px]`:"24px",x=s.get(l,"value")?`[${s.get(l,"value")}px]`:"24px",w=s.get(s.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${u.STYLES_KEY}, ${g.cn(`w-${x} h-${T}`,w)}`.trim(),r.attributes=s.filter(r.attributes,E=>!s.includes(["style","width","height","class"],E.key)),a.icon=p.stringify([r]),[a]}else if(r.tagName=="option"&&e&&((c=e.block)==null?void 0:c._type)==="Select")return e.block.options.push({label:b(r.children),...m(r)}),[];const n=v(r.children,{block:a,node:r});return[a,...n]}),A=t=>{const e=t.match(/<body[^>]*>[\s\S]*?<\/body>/);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()},B=t=>{const e=p.parse(A(t));return s.isEmpty(t)?[]:s.flatten(v(e))};exports.getBlocksFromHTML=B;exports.plugin=L;
@@ -0,0 +1,243 @@
1
+ import { g as P } from "./_commonjsHelpers-UyOWmZb0.js";
2
+ import { stringify as y, parse as k } from "himalaya";
3
+ import { g as S, c as M } from "./Functions-7jnEwJyw.js";
4
+ import { isEmpty as g, includes as m, get as l, forEach as A, find as o, set as u, capitalize as C, flatMapDeep as B, filter as E, flatten as R } from "lodash-es";
5
+ import { a as p } from "./MODIFIERS-fd5XOmum.js";
6
+ import { has as H, startsWith as I } from "lodash";
7
+ var d = {}, b = {};
8
+ (function(t) {
9
+ "use strict";
10
+ Object.defineProperty(t, "__esModule", {
11
+ value: !0
12
+ }), Object.defineProperty(t, "default", {
13
+ enumerable: !0,
14
+ get: function() {
15
+ return r;
16
+ }
17
+ });
18
+ function e(a, s) {
19
+ return {
20
+ handler: a,
21
+ config: s
22
+ };
23
+ }
24
+ e.withOptions = function(a, s = () => ({})) {
25
+ const c = function(n) {
26
+ return {
27
+ __options: n,
28
+ handler: a(n),
29
+ config: s(n)
30
+ };
31
+ };
32
+ return c.__isOptionsFunction = !0, c.__pluginFunction = a, c.__configFunction = s, c;
33
+ };
34
+ const r = e;
35
+ })(b);
36
+ (function(t) {
37
+ "use strict";
38
+ Object.defineProperty(t, "__esModule", {
39
+ value: !0
40
+ }), Object.defineProperty(t, "default", {
41
+ enumerable: !0,
42
+ get: function() {
43
+ return a;
44
+ }
45
+ });
46
+ const e = /* @__PURE__ */ r(b);
47
+ function r(s) {
48
+ return s && s.__esModule ? s : {
49
+ default: s
50
+ };
51
+ }
52
+ const a = e.default;
53
+ })(d);
54
+ let f = d;
55
+ var q = (f.__esModule ? f : { default: f }).default;
56
+ const X = /* @__PURE__ */ P(q), F = (t) => {
57
+ const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, r = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
58
+ return e.test(t) || r.test(t);
59
+ }, O = (t) => {
60
+ if (g(t))
61
+ return t;
62
+ const e = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/, a = t.match(e), s = t.match(r), c = a ? a[1] : s ? s[1] : null, n = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, i = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
63
+ return c && (n.test(c) || i.test(c)) ? c : t;
64
+ }, v = "$name", U = {
65
+ img: { alt: "alt", width: "width", height: "height", src: "image" },
66
+ video: {
67
+ src: "url",
68
+ autoplay: "controls.autoPlay",
69
+ muted: "controls.muted",
70
+ loop: "controls.loop",
71
+ controls: "controls.widgets"
72
+ },
73
+ a: {
74
+ href: "link.href",
75
+ target: "link.target",
76
+ type: ""
77
+ // @TODO: Detect here what to url, email, phone, elementId
78
+ },
79
+ input: {
80
+ placeholder: "placeholder",
81
+ required: "required",
82
+ type: "inputType",
83
+ name: "fieldName"
84
+ },
85
+ textarea: {
86
+ placeholder: "placeholder",
87
+ required: "required",
88
+ type: "inputType",
89
+ name: "fieldName"
90
+ },
91
+ select: {
92
+ placeholder: "placeholder",
93
+ required: "required",
94
+ multiple: "multiple",
95
+ name: "fieldName"
96
+ }
97
+ }, z = (t, e) => t.children.length === 1 && m(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), T = (t) => t.map((e) => e.type === "text" ? l(e, "content", "") : g(e.children) ? "" : T(e.children)).join(""), h = (t) => t === null ? "" : t, _ = (t) => {
98
+ if (t.tagName === "svg")
99
+ return {};
100
+ const e = {}, r = U[t.tagName] || {}, a = t.attributes;
101
+ return A(a, ({ key: s, value: c }) => {
102
+ if (s !== v)
103
+ if (r[s]) {
104
+ if (t.tagName === "img" && s === "src" && !c.startsWith("http")) {
105
+ const n = o(t.attributes, { key: "width" }), i = o(t.attributes, { key: "height" });
106
+ n && i ? c = `https://via.placeholder.com/${n == null ? void 0 : n.value}x${i == null ? void 0 : i.value}` : c = "https://via.placeholder.com/150x150";
107
+ }
108
+ u(e, r[s], h(c));
109
+ } else
110
+ m(["style", "class", "srcset"], s) || (H(e, "styles_attrs") || (e.styles_attrs = {}), I(s, "@") && (s = s.replace("@", "x-on:")), e.styles_attrs[`${s}`] = h(c));
111
+ }), delete e.class, e;
112
+ }, D = (t, e = "styles") => {
113
+ if (!t.attributes)
114
+ return { [e]: `${p},` };
115
+ const r = o(t.attributes, { key: "class" });
116
+ if (r) {
117
+ const a = r.value;
118
+ return { [e]: `${p},${a}` };
119
+ }
120
+ return { [e]: `${p},` };
121
+ }, V = (t) => {
122
+ switch (t.tagName) {
123
+ case "img":
124
+ return { _type: "Image" };
125
+ case "input":
126
+ return { _type: "Input", showLabel: !1 };
127
+ case "hr":
128
+ return { _type: "Divider" };
129
+ case "br":
130
+ return { _type: "LineBreak" };
131
+ case "textarea":
132
+ return { _type: "TextArea", showLabel: !1 };
133
+ case "audio":
134
+ return { _type: "Audio" };
135
+ case "canvas":
136
+ return { _type: "Canvas" };
137
+ case "video":
138
+ case "iframe":
139
+ return { _type: "CustomHTML" };
140
+ case "svg":
141
+ return { _type: "Icon" };
142
+ case "select":
143
+ return { _type: "Select", options: [] };
144
+ case "option":
145
+ return { _type: "Option" };
146
+ case "ul":
147
+ case "ol":
148
+ case "dl":
149
+ return {
150
+ _type: "List",
151
+ tag: t.tagName,
152
+ _listType: t.tagName === "ol" ? "list-decimal" : "list-none"
153
+ };
154
+ case "li":
155
+ case "dt":
156
+ return { _type: "ListItem", tag: t.tagName };
157
+ case "span":
158
+ case "figcaption":
159
+ case "legend":
160
+ return { _type: "Span", tag: t.tagName };
161
+ case "p":
162
+ return { _type: "Paragraph", content: "" };
163
+ case "a":
164
+ return { _type: "Link" };
165
+ case "form":
166
+ return { _type: "Form" };
167
+ case "label":
168
+ return { _type: "Label" };
169
+ case "button":
170
+ return { _type: "Button" };
171
+ case "code":
172
+ return { _type: "Code" };
173
+ case "h1":
174
+ case "h2":
175
+ case "h3":
176
+ case "h4":
177
+ case "h5":
178
+ case "h6":
179
+ return { _type: "Heading", tag: t.tagName };
180
+ case "table":
181
+ return { _type: "Table" };
182
+ case "tr":
183
+ return { _type: "TableRow" };
184
+ case "td":
185
+ case "th":
186
+ return { _type: "TableCell", tag: t.tagName };
187
+ case "thead":
188
+ return { _type: "TableHead" };
189
+ case "tbody":
190
+ return { _type: "TableBody" };
191
+ case "tfoot":
192
+ return { _type: "TableFooter" };
193
+ default:
194
+ const e = l(t, "children", []).length > 0 ? "Box" : "EmptyBox";
195
+ return {
196
+ _type: e,
197
+ tag: t.tagName,
198
+ _name: e == "EmptyBox" || t.tagName === "div" ? e : C(t.tagName)
199
+ };
200
+ }
201
+ }, x = (t, e = null) => B(t, (r) => {
202
+ var c;
203
+ if (r.type === "comment")
204
+ return [];
205
+ let a = { _id: S() };
206
+ if (e && (a._parent = e.block._id), r.type === "text")
207
+ return g(l(r, "content", "")) ? [] : e && z(e.node, e.block) ? (u(e, "block.content", l(r, "content", "")), []) : { ...a, _type: "Text", content: l(r, "content", "") };
208
+ if (a = {
209
+ ...a,
210
+ ...V(r),
211
+ ..._(r),
212
+ ...D(r)
213
+ }, r.attributes) {
214
+ const n = r.attributes.find((i) => i.key === v);
215
+ n && (a._name = n.value);
216
+ }
217
+ if (a._type === "Input") {
218
+ const n = a.inputType || "text";
219
+ n === "checkbox" ? u(a, "_type", "Checkbox") : n === "radio" && u(a, "_type", "Radio");
220
+ } else if (r.tagName === "video" || r.tagName === "iframe") {
221
+ const n = y([r]);
222
+ return F(n) && (u(a, "_type", "Video"), u(a, "url", O(n)), u(a, "styles", `${p},absolute top-0 left-0 w-full h-full`), u(a, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), a.content = n, [a];
223
+ } else if (r.tagName === "svg") {
224
+ const n = o(r.attributes, { key: "height" }), i = o(r.attributes, { key: "width" }), w = l(n, "value") ? `[${l(n, "value")}px]` : "24px", N = l(i, "value") ? `[${l(i, "value")}px]` : "24px", $ = l(o(r.attributes, { key: "class" }), "value", "w-full h-full");
225
+ return a.styles = `${p}, ${M(`w-${N} h-${w}`, $)}`.trim(), r.attributes = E(r.attributes, (L) => !m(["style", "width", "height", "class"], L.key)), a.icon = y([r]), [a];
226
+ } else if (r.tagName == "option" && e && ((c = e.block) == null ? void 0 : c._type) === "Select")
227
+ return e.block.options.push({
228
+ label: T(r.children),
229
+ ..._(r)
230
+ }), [];
231
+ const s = x(r.children, { block: a, node: r });
232
+ return [a, ...s];
233
+ }), j = (t) => {
234
+ const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
235
+ 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();
236
+ }, K = (t) => {
237
+ const e = k(j(t));
238
+ return g(t) ? [] : R(x(e));
239
+ };
240
+ export {
241
+ K as g,
242
+ X as p
243
+ };