@chaibuilder/sdk 1.2.8 → 1.2.10-7.beta.1

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 (122) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
  3. package/dist/CodeEditor-bUqM7eCa.js +129 -0
  4. package/dist/STRINGS-Xxstm-7I.js +7 -0
  5. package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
  6. package/dist/Topbar-P7-9Rps1.js +124 -0
  7. package/dist/Topbar-xwQ4JUZD.cjs +1 -0
  8. package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
  9. package/dist/UnsplashImages-nQSvWPU0.js +244 -0
  10. package/dist/UploadImages-L9LlI-jl.cjs +1 -0
  11. package/dist/UploadImages-SVnIHigg.js +153 -0
  12. package/dist/context-menu-YGd09SE1.js +979 -0
  13. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  14. package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
  15. package/dist/controls-p9IwFnPx.cjs +1 -0
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-Ief2hJUZ.js +130 -0
  20. package/dist/iconBase-aZzpqff_.cjs +1 -0
  21. package/dist/index-3NV_rst1.js +9051 -0
  22. package/dist/index-qTKBamQ6.cjs +63 -0
  23. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  24. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-UiUFs2fK.js +44 -0
  27. package/dist/plugin-f6SDZ_Or.js +108 -0
  28. package/dist/plugin-jum1MjXp.cjs +1 -0
  29. package/dist/plugin-xOpS-UNV.cjs +1 -0
  30. package/dist/render.cjs +3 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +129 -85
  33. package/dist/runtime.cjs +1 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +2 -2
  37. package/dist/tailwind.cjs +1 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +16 -20
  40. package/dist/ui.cjs +1 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +363 -163
  43. package/dist/web-blocks.cjs +3 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +725 -766
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-EfZgx-gN.js +0 -1425
  52. package/dist/CanvasArea-rIDwPHl5.cjs +0 -60
  53. package/dist/CurrentPage-QNFPD078.cjs +0 -1
  54. package/dist/CurrentPage-ulHTz4MD.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-rehZkz78.js +0 -404
  58. package/dist/Layers-v-7k3W2I.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel-acGVGJf-.js +0 -69
  64. package/dist/PagesPanel-x5ms_LOD.cjs +0 -1
  65. package/dist/ProjectPanel-5BHQ5ANP.cjs +0 -1
  66. package/dist/ProjectPanel-aLFJq49M.js +0 -90
  67. package/dist/Settings-iOjfw5NQ.cjs +0 -1
  68. package/dist/Settings-v-txwlII.js +0 -2193
  69. package/dist/SidePanels-Vdc-J5wK.js +0 -349
  70. package/dist/SidePanels-t0g9ZQFT.cjs +0 -1
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-0YAI9dXr.cjs +0 -1
  80. package/dist/add-page-modal-6DlGzdA4.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/delete-page-modal-T_rlQfNd.js +0 -88
  85. package/dist/delete-page-modal-qXpi_2xR.cjs +0 -1
  86. package/dist/email-blocks.cjs +0 -1
  87. package/dist/email-blocks.d.ts +0 -3
  88. package/dist/email-blocks.js +0 -274
  89. package/dist/form-OVmsLOrc.js +0 -125
  90. package/dist/form-VbouZlAW.cjs +0 -1
  91. package/dist/functions-Ox_svtKm.cjs +0 -1
  92. package/dist/functions-xIebp8Aw.js +0 -23
  93. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  94. package/dist/html-to-json-57841sEK.js +0 -183
  95. package/dist/index-EGUphg4R.js +0 -41620
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-e0c8PmRQ.js +0 -205
  98. package/dist/index-gi1LIOCw.cjs +0 -1
  99. package/dist/index-jw8RxsTv.cjs +0 -206
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  102. package/dist/lib.cjs +0 -4
  103. package/dist/lib.d.ts +0 -78
  104. package/dist/lib.js +0 -1322
  105. package/dist/page-viewer-EoYYnA56.js +0 -115
  106. package/dist/page-viewer-Ou8vDXGV.cjs +0 -1
  107. package/dist/project-general-setting-92q4oEYv.cjs +0 -1
  108. package/dist/project-general-setting-DC_nADG-.js +0 -83
  109. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  110. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  111. package/dist/server.cjs +0 -1
  112. package/dist/server.d.ts +0 -299
  113. package/dist/server.js +0 -216
  114. package/dist/single-page-detail-QmmhR_h2.cjs +0 -1
  115. package/dist/single-page-detail-xtNZ9YxX.js +0 -222
  116. package/dist/studio.cjs +0 -1
  117. package/dist/studio.d.ts +0 -13
  118. package/dist/studio.js +0 -58
  119. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  120. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  121. package/dist/utils-AvyFzbPC.js +0 -1075
  122. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -1,88 +0,0 @@
1
- import { j as r } from "./jsx-runtime-WbnYoNE9.js";
2
- import { E as s, F as l, G as n, I as d, J as a, L as c, B as u } from "./index-niHREMmR.js";
3
- import { j as x } from "./index-EGUphg4R.js";
4
- import { TrashIcon as h } from "@radix-ui/react-icons";
5
- import "./_commonjsHelpers-UyOWmZb0.js";
6
- import "react";
7
- import "@radix-ui/react-toggle";
8
- import "class-variance-authority";
9
- import "./utils-AvyFzbPC.js";
10
- import "lodash-es";
11
- import "./MODIFIERS-RiXS5Mn1.js";
12
- import "clsx";
13
- import "tailwind-merge";
14
- import "@radix-ui/react-switch";
15
- import "@radix-ui/react-slot";
16
- import "@radix-ui/react-accordion";
17
- import "@radix-ui/react-alert-dialog";
18
- import "@radix-ui/react-dialog";
19
- import "@radix-ui/react-label";
20
- import "@radix-ui/react-scroll-area";
21
- import "@radix-ui/react-tabs";
22
- import "@radix-ui/react-tooltip";
23
- import "@radix-ui/react-popover";
24
- import "@radix-ui/react-menubar";
25
- import "@radix-ui/react-hover-card";
26
- import "@radix-ui/react-select";
27
- import "@radix-ui/react-dropdown-menu";
28
- import "@radix-ui/react-separator";
29
- import "@radix-ui/react-toast";
30
- import "cmdk";
31
- import "@radix-ui/react-context-menu";
32
- import "react-icons-picker";
33
- import "react-dom";
34
- import "react-quill";
35
- import "jotai";
36
- import "flat-to-nested";
37
- import "./Functions-7jnEwJyw.js";
38
- import "redux-undo";
39
- import "@chaibuilder/runtime";
40
- import "lodash";
41
- import "@react-hookz/web";
42
- import "react-i18next";
43
- import "i18next";
44
- import "@floating-ui/react-dom";
45
- import "react-textarea-autosize";
46
- import "flagged";
47
- import "react-dnd";
48
- import "@minoru/react-dnd-treeview";
49
- import "react-hotkeys-hook";
50
- import "sonner";
51
- import "./html-to-json-57841sEK.js";
52
- import "himalaya";
53
- import "lucide-react";
54
- import "./web-blocks.js";
55
- import "./controls-XPXGHKht.js";
56
- const jr = ({ pageData: e, projectData: i }) => {
57
- const m = {}, t = x(), o = e.uuid === i.homepage, p = () => {
58
- t.mutate(e, {
59
- onSuccess: () => {
60
- m({ uuid: i.homepage, slug: "/home" });
61
- }
62
- });
63
- };
64
- return /* @__PURE__ */ r.jsxs(s, { children: [
65
- /* @__PURE__ */ r.jsx(l, { disabled: o, children: /* @__PURE__ */ r.jsx(
66
- "div",
67
- {
68
- 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"}`,
69
- children: /* @__PURE__ */ r.jsx(h, {})
70
- }
71
- ) }),
72
- /* @__PURE__ */ r.jsxs(n, { children: [
73
- /* @__PURE__ */ r.jsxs(d, { children: [
74
- "Are you sure you want to delete ",
75
- /* @__PURE__ */ r.jsx("i", { className: "text-red-500", children: e.name }),
76
- " page?"
77
- ] }),
78
- /* @__PURE__ */ r.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
79
- /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
80
- /* @__PURE__ */ r.jsx(c, { disabled: t.isPending, children: "Cancel" }),
81
- /* @__PURE__ */ r.jsx(u, { variant: "destructive", onClick: p, disabled: t.isPending, children: "Yes, Delete" })
82
- ] })
83
- ] })
84
- ] });
85
- };
86
- export {
87
- jr as default
88
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-H6vIwGfD.cjs"),q=require("./index-jw8RxsTv.cjs"),l=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");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-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");const d=({pageData:i,projectData:t})=>{const n={},u=q.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(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:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-es"),l=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),i=require("@chaibuilder/runtime"),r=require("./controls-Dy1qa8Dc.cjs"),s=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");const p=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:o});i.registerChaiBlock(p,{type:"Container",label:"Container",group:"basic",category:"core",props:{styles:r.S({default:""})},canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1});const x=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});i.registerChaiBlock(x,{type:"Section",label:"Section",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:"w-full"}),align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const g=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});i.registerChaiBlock(g,{type:"Row",label:"Row",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const m=({blockProps:e,styles:t,children:o,align:n})=>l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:o});i.registerChaiBlock(m,{type:"Column",label:"Column",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""}),align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const h=({level:e,blockProps:t,styles:o,content:n})=>l.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:n}),k=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});i.registerChaiBlock(h,{type:"Heading",label:"Heading",group:"basic",category:"core",icon:s.HeadingIcon,builderComponent:k,props:{content:r.u({title:"Content",default:"Enter your heading here..."}),styles:r.S({default:"text-xl"}),level:r.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const b=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),B=({content:e,blockProps:t,styles:o})=>l.jsxRuntimeExports.jsx("p",{...t,...o,children:e});i.registerChaiBlock(b,{type:"Text",label:"Text",group:"basic",category:"core",icon:s.TextIcon,builderComponent:B,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."}),styles:r.S({default:""})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const f=({content:e})=>e,C=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});i.registerChaiBlock(f,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:s.TextIcon,hidden:!0,builderComponent:C,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const j=({blockProps:e,styles:t,link:o,content:n})=>l.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:n}),y=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});i.registerChaiBlock(j,{type:"Button",label:"Button",group:"basic",category:"core",builderComponent:y,props:{content:r.u({title:"Content",default:"Click me"}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const v=({blockProps:e,styles:t,href:o,content:n,target:a})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:a,children:n}),R=({blockProps:e,styles:t,content:o,children:n})=>l.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o});i.registerChaiBlock(v,{type:"Link",label:"Link",group:"basic",category:"core",icon:s.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:R,props:{content:r.u({title:"Content",default:"I am a link."}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const E=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:o});i.registerChaiBlock(E,{type:"Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1});const w=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});i.registerChaiBlock(w,{type:"Markdown",label:"Markdown",group:"basic",category:"core",props:{content:r.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const S=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:a,height:u}),L=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:a,height:u});i.registerChaiBlock(S,{type:"Image",label:"Image",group:"basic",category:"core",icon:s.ImageIcon,builderComponent:L,props:{styles:r.S({default:"w-full"}),image:r.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:r.u({title:"Alt",default:""}),width:r.u({title:"Width",default:""}),height:r.u({title:"Height",default:""})}});const T=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});i.registerChaiBlock(T,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:s.DividerHorizontalIcon,builderComponent:H,props:{styles:r.S({default:"w-full h-2"})}});const q=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:a,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:a,language:u}),A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});i.registerChaiBlock(q,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:s.CodeSandboxLogoIcon,builderComponent:A,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"}),theme:r.u({title:"Theme",default:"dracula"}),lineNumbers:r.r({title:"Line number",default:!1}),language:r.f({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const D=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),M=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});i.registerChaiBlock(D,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:s.CodeSandboxLogoIcon,builderComponent:M,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const _=d.noop;exports.loadEmailBlocks=_;
@@ -1,3 +0,0 @@
1
- export declare const loadEmailBlocks: any;
2
-
3
- export { }
@@ -1,274 +0,0 @@
1
- import { noop as b } from "lodash-es";
2
- import { j as l } from "./jsx-runtime-WbnYoNE9.js";
3
- import { Container as f, Section as k, Row as y, Column as x, Heading as B, Text as C, Button as v, Link as j, Preview as w, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as A } from "@react-email/components";
4
- import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
- import { S as i, f as d, u as a, g as s, q as g, o as R, r as S } from "./controls-XPXGHKht.js";
6
- import { ImageIcon as p, HeadingIcon as D, TextIcon as m, Link1Icon as M, DividerHorizontalIcon as _, CodeSandboxLogoIcon as h } from "@radix-ui/react-icons";
7
- import "./_commonjsHelpers-UyOWmZb0.js";
8
- import "react";
9
- const N = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(f, { ...e, ...t, children: o });
10
- r(N, {
11
- type: "Container",
12
- label: "Container",
13
- group: "basic",
14
- category: "core",
15
- props: { styles: i({ default: "" }) },
16
- canAcceptBlock: () => !0,
17
- canMove: () => !0,
18
- canDelete: () => !1,
19
- canDuplicate: () => !1
20
- });
21
- const P = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: o });
22
- r(P, {
23
- type: "Section",
24
- label: "Section",
25
- group: "basic",
26
- category: "core",
27
- icon: p,
28
- props: {
29
- styles: i({ default: "w-full" }),
30
- align: d({
31
- title: "Align",
32
- default: "",
33
- options: [
34
- { value: "", title: "None" },
35
- { value: "left", title: "left" },
36
- { value: "center", title: "center" },
37
- { value: "right", title: "right" }
38
- ]
39
- })
40
- },
41
- canAcceptBlock: () => !0
42
- });
43
- const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
44
- r($, {
45
- type: "Row",
46
- label: "Row",
47
- group: "basic",
48
- category: "core",
49
- icon: p,
50
- props: {
51
- styles: i({ default: "" })
52
- },
53
- canAcceptBlock: (e) => e === "Column"
54
- });
55
- const E = ({ blockProps: e, styles: t, children: o, align: n }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, align: n, children: o });
56
- r(E, {
57
- type: "Column",
58
- label: "Column",
59
- group: "basic",
60
- category: "core",
61
- icon: p,
62
- props: {
63
- styles: i({ default: "" }),
64
- align: d({
65
- title: "Align",
66
- default: "",
67
- options: [
68
- { value: "", title: "None" },
69
- { value: "left", title: "left" },
70
- { value: "center", title: "center" },
71
- { value: "right", title: "right" }
72
- ]
73
- })
74
- },
75
- canAcceptBlock: () => !0
76
- });
77
- const q = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(B, { as: e, ...t, ...o, children: n }), z = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
78
- r(q, {
79
- type: "Heading",
80
- label: "Heading",
81
- group: "basic",
82
- category: "core",
83
- icon: D,
84
- builderComponent: z,
85
- props: {
86
- content: a({ title: "Content", default: "Enter your heading here..." }),
87
- styles: i({ default: "text-xl" }),
88
- level: d({
89
- title: "Level",
90
- default: "h1",
91
- binding: !1,
92
- options: [
93
- { value: "h1", title: "h1" },
94
- { value: "h2", title: "h2" },
95
- { value: "h3", title: "h3" },
96
- { value: "h4", title: "h4" },
97
- { value: "h5", title: "h5" },
98
- { value: "h6", title: "h6" }
99
- ]
100
- })
101
- },
102
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
103
- });
104
- const J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(C, { ...e, ...t, children: o }), U = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
105
- r(J, {
106
- type: "Text",
107
- label: "Text",
108
- group: "basic",
109
- category: "core",
110
- icon: m,
111
- builderComponent: U,
112
- props: {
113
- content: s({
114
- title: "Content",
115
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor. Ut in nulla enim."
116
- }),
117
- styles: i({ default: "" })
118
- },
119
- canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
120
- });
121
- const V = ({ content: e }) => e, W = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
122
- r(V, {
123
- type: "RawText",
124
- label: "Raw Text",
125
- group: "basic",
126
- category: "core",
127
- icon: m,
128
- hidden: !0,
129
- builderComponent: W,
130
- props: {
131
- content: s({
132
- title: "Content",
133
- default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
134
- })
135
- }
136
- });
137
- const F = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, href: o.href, children: n }), G = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
138
- r(F, {
139
- type: "Button",
140
- label: "Button",
141
- group: "basic",
142
- category: "core",
143
- builderComponent: G,
144
- props: {
145
- content: a({ title: "Content", default: "Click me" }),
146
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
147
- styles: i({ default: "bg-primary text-white px-4 py-2 rounded-md" })
148
- }
149
- });
150
- const K = ({ blockProps: e, styles: t, href: o, content: n, target: c }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o, target: c, children: n }), O = ({ blockProps: e, styles: t, content: o, children: n }) => /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: n || o });
151
- r(K, {
152
- type: "Link",
153
- label: "Link",
154
- group: "basic",
155
- category: "core",
156
- icon: M,
157
- blocks: [
158
- {
159
- _id: "a",
160
- _type: "Link"
161
- },
162
- {
163
- _id: "b",
164
- _parent: "a",
165
- _type: "RawText",
166
- content: "I am a link."
167
- }
168
- ],
169
- builderComponent: O,
170
- props: {
171
- content: a({ title: "Content", default: "I am a link." }),
172
- link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
173
- styles: i({ default: "font-bold text-blue-500" })
174
- },
175
- canAcceptBlock: () => !0
176
- });
177
- const Q = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, children: o }), X = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
178
- r(Q, {
179
- type: "Preview",
180
- label: "Preview",
181
- group: "basic",
182
- category: "core",
183
- builderComponent: X,
184
- canAcceptBlock: () => !0,
185
- canDuplicate: () => !1
186
- });
187
- const Y = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(I, { children: t, ...e });
188
- r(Y, {
189
- type: "Markdown",
190
- label: "Markdown",
191
- group: "basic",
192
- category: "core",
193
- props: {
194
- content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
195
- }
196
- });
197
- const Z = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx(L, { ...e, ...t, src: n, alt: o, width: c, height: u }), ee = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: c, height: u });
198
- r(Z, {
199
- type: "Image",
200
- label: "Image",
201
- group: "basic",
202
- category: "core",
203
- icon: p,
204
- builderComponent: ee,
205
- props: {
206
- styles: i({ default: "w-full" }),
207
- image: R({
208
- title: "Image",
209
- default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
210
- }),
211
- alt: a({ title: "Alt", default: "" }),
212
- width: a({ title: "Width", default: "" }),
213
- height: a({ title: "Height", default: "" })
214
- }
215
- });
216
- const te = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
217
- r(te, {
218
- type: "Divider",
219
- label: "Divider",
220
- group: "basic",
221
- category: "core",
222
- icon: _,
223
- builderComponent: oe,
224
- props: {
225
- styles: i({ default: "w-full h-2" })
226
- }
227
- });
228
- const le = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: c, language: u }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t, code: o, linenumbers: n, theme: c, language: u }), ne = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
229
- r(le, {
230
- type: "CodeBlock",
231
- label: "Code Block",
232
- group: "basic",
233
- category: "core",
234
- hidden: !0,
235
- icon: h,
236
- builderComponent: ne,
237
- props: {
238
- styles: i({ default: "" }),
239
- code: s({ title: "Code", default: "console.log('Hello, world!');" }),
240
- theme: a({ title: "Theme", default: "dracula" }),
241
- lineNumbers: S({
242
- title: "Line number",
243
- default: !1
244
- }),
245
- language: d({
246
- title: "Language",
247
- default: "javascript",
248
- binding: !1,
249
- options: [
250
- { value: "javascript", title: "JavaScript" },
251
- { value: "html", title: "HTML" },
252
- { value: "css", title: "CSS" }
253
- //add more options
254
- ]
255
- })
256
- }
257
- });
258
- const re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(A, { ...e, ...t, children: o }), ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
259
- r(re, {
260
- type: "CodeInline",
261
- label: "Code Inline",
262
- group: "basic",
263
- category: "core",
264
- icon: h,
265
- builderComponent: ie,
266
- props: {
267
- styles: i({ default: "" }),
268
- code: s({ title: "Code", default: "console.log('Hello, world!');" })
269
- }
270
- });
271
- const he = b;
272
- export {
273
- he as loadEmailBlocks
274
- };
@@ -1,125 +0,0 @@
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 { bc as P, bd as E, be as O, bf as S } from "./index-niHREMmR.js";
6
- const d = (i, l = "") => {
7
- switch (i.type) {
8
- case "singular":
9
- return i.uiSchema;
10
- case "model":
11
- const { properties: p } = i, m = {};
12
- return Object.keys(p).forEach((r) => {
13
- const e = p[r];
14
- if (h(["slot", "styles"], e.type))
15
- return;
16
- const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
17
- m[o] = d(e, l);
18
- }), m;
19
- case "list":
20
- const { itemProperties: n } = i, c = {
21
- items: {}
22
- };
23
- return Object.keys(n).forEach((r) => {
24
- const e = n[r];
25
- if (h(["slot", "styles"], e.type))
26
- return;
27
- const o = a(e, "i18n", !1) ? `${r}-${l}` : r;
28
- c.items[o] = d(e, l);
29
- }), c;
30
- default:
31
- return {};
32
- }
33
- }, y = (i, l = "") => {
34
- switch (i.type) {
35
- case "singular":
36
- return i.schema;
37
- case "model":
38
- const { properties: p, title: m } = i, n = {
39
- title: m,
40
- type: "object",
41
- properties: {}
42
- };
43
- return Object.keys(p).forEach((o) => {
44
- const t = p[o];
45
- if (h(["slot", "styles"], t.type))
46
- return;
47
- const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
48
- n.properties[s] = y(t, l);
49
- }), n;
50
- case "list":
51
- const { itemProperties: c, title: r } = i, e = {
52
- title: r,
53
- type: "array",
54
- items: {
55
- type: "object",
56
- properties: {}
57
- }
58
- };
59
- return Object.keys(c).forEach((o) => {
60
- const t = c[o];
61
- if (h(["slot", "styles"], t.type))
62
- return;
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`));
65
- }), e;
66
- default:
67
- return {};
68
- }
69
- }, C = ({
70
- title: i,
71
- properties: l = {},
72
- formData: p,
73
- onChange: m,
74
- disabled: n = !1,
75
- activeLang: c = ""
76
- }) => {
77
- const r = {
78
- type: "object",
79
- properties: {}
80
- }, e = {};
81
- Object.keys(l).forEach((t) => {
82
- const s = l[t];
83
- if (h(["slot", "styles"], s.type))
84
- return;
85
- const f = a(s, "i18n", !1) ? `${t}-${c}` : t;
86
- r.properties[f] = y(s, c), e[f] = d(s, c);
87
- });
88
- const o = ({ ...t }, s) => {
89
- const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
90
- if (!s || !f)
91
- return;
92
- const j = F(f.split("."));
93
- s && j && m({ ...t }, j);
94
- };
95
- return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
96
- i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
97
- /* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
98
- b,
99
- {
100
- widgets: {
101
- richtext: P,
102
- icon: E,
103
- image: O
104
- },
105
- fields: {
106
- link: S
107
- },
108
- idSeparator: ".",
109
- autoComplete: "off",
110
- omitExtraData: !0,
111
- liveOmit: !0,
112
- liveValidate: !0,
113
- uiSchema: e,
114
- schema: r,
115
- formData: p,
116
- validator: x,
117
- onChange: o,
118
- disabled: n
119
- }
120
- ) })
121
- ] });
122
- };
123
- export {
124
- C as F
125
- };
@@ -1 +0,0 @@
1
- "use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-H6vIwGfD.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=$;
@@ -1 +0,0 @@
1
- "use strict";const e=require("lodash-es"),d=require("./MODIFIERS-2FeVfZQ9.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;
@@ -1,23 +0,0 @@
1
- import { get as r, includes as n, last as g } from "lodash-es";
2
- import { a as d } from "./MODIFIERS-RiXS5Mn1.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
- };
@@ -1 +0,0 @@
1
- "use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),e=require("lodash-es"),o=require("./MODIFIERS-2FeVfZQ9.cjs"),T=t=>{const s=/(?: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 s.test(t)||r.test(t)},v=t=>{if(e.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(s),l=t.match(r),i=a?a[1]:l?l[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(c.test(i)||n.test(i))?i:t},w={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"}},x=(t,s)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],s._type),h=t=>t.map(s=>s.type==="text"?e.get(s,"content",""):e.isEmpty(s.children)?"":h(s.children)).join(""),g=t=>t===null?!0:t,y=t=>{const s={},r=w[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:i})=>{if(r[l]){if(t.tagName==="img"&&l==="src"&&!i.startsWith("http")){const c=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});c&&n?i=`https://via.placeholder.com/${c==null?void 0:c.value}x${n==null?void 0:n.value}`:i="https://via.placeholder.com/150x150"}e.set(s,r[l],g(i))}else e.includes(["style","class","srcset"],l)||e.set(s,`styles_attrs.${l}`,g(i))}),delete s.class,s},S=(t,s="styles")=>{if(!t.attributes)return{[s]:`${o.STYLES_KEY},`};const r=e.find(t.attributes,{key:"class"});if(r){const a=r.value;return{[s]:`${o.STYLES_KEY},${a}`}}return{[s]:`${o.STYLES_KEY},`}},L=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:return{_type:"Box",tag:t.tagName,_name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},m=(t,s=null)=>e.flatMapDeep(t,r=>{var i;if(r.type==="comment")return[];let a={_id:p.generateUUID()};if(s&&(a._parent=s.block._id),r.type==="text")return e.isEmpty(e.get(r,"content",""))?[]:s&&x(s.node,s.block)?(e.set(s,"block.content",e.get(r,"content","")),[]):{...a,_type:"Text",content:e.get(r,"content","")};if(a={...a,...L(r),...y(r),...S(r)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?e.set(a,"_type","Checkbox"):c==="radio"&&e.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const c=u.stringify([r]);return T(c)&&(e.set(a,"_type","Video"),e.set(a,"url",v(c)),e.set(a,"styles",`${o.STYLES_KEY},absolute top-0 left-0 w-full h-full`),e.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(r.tagName==="svg"){const c=e.find(r.attributes,{key:"height"}),n=e.find(r.attributes,{key:"width"}),f=e.get(c,"value")?`[${e.get(c,"value")}px]`:"24px",d=e.get(n,"value")?`[${e.get(n,"value")}px]`:"24px",b=e.get(e.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${o.STYLES_KEY}, ${p.cn(`w-${d} h-${f}`,b)}`.trim(),r.attributes=e.filter(r.attributes,_=>!e.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([r]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(r.tagName=="option"&&s&&((i=s.block)==null?void 0:i._type)==="Select")return s.block.options.push({label:h(r.children),...y(r)}),[];const l=m(r.children,{block:a,node:r});return[a,...l]}),N=t=>{const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},k=t=>{const s=u.parse(N(t));return e.isEmpty(t)?[]:e.flatten(m(s))};exports.getBlocksFromHTML=k;