@chaibuilder/sdk 1.2.9 → 1.2.11

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 (102) hide show
  1. package/README.md +10 -12
  2. package/dist/AddBlocks-TSt8uJY4.js +218 -0
  3. package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
  4. package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
  5. package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
  6. package/dist/CanvasArea-5erOZYLy.cjs +60 -0
  7. package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
  8. package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
  9. package/dist/Class-5ARpH_Tu.cjs +1 -0
  10. package/dist/CurrentPage-NzmJloN7.cjs +1 -0
  11. package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
  12. package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
  13. package/dist/Layers-xDG7oltg.cjs +1 -0
  14. package/dist/PagesPanel-72nzYB1k.cjs +1 -0
  15. package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
  16. package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
  17. package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
  18. package/dist/Settings-5EuwaVb3.cjs +1 -0
  19. package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
  20. package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
  21. package/dist/SidePanels-uNCxnGte.cjs +1 -0
  22. package/dist/Topbar-JqW89xI5.cjs +1 -0
  23. package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
  24. package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
  25. package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
  26. package/dist/UploadImages-PzHdEKHT.cjs +1 -0
  27. package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
  28. package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
  29. package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
  30. package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
  31. package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
  32. package/dist/core.cjs +1 -1
  33. package/dist/core.d.ts +13 -58
  34. package/dist/core.js +47 -58
  35. package/dist/defaultTheme-IH19g4fv.cjs +1 -0
  36. package/dist/defaultTheme-YY8mlQS3.js +1055 -0
  37. package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
  38. package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
  39. package/dist/email-blocks.cjs +1 -1
  40. package/dist/email-blocks.js +100 -81
  41. package/dist/email.cjs +1 -0
  42. package/dist/email.d.ts +116 -0
  43. package/dist/email.js +79 -0
  44. package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
  45. package/dist/empty-slot-TF2kd-0X.cjs +1 -0
  46. package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
  47. package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
  48. package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
  49. package/dist/index-aiHDvS5v.cjs +1 -0
  50. package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
  51. package/dist/index-pNYv0oAF.js +2994 -0
  52. package/dist/lib.cjs +3 -3
  53. package/dist/lib.js +95 -1125
  54. package/dist/page-viewer-Sh99FGYk.cjs +1 -0
  55. package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
  56. package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
  57. package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
  58. package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
  59. package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
  60. package/dist/render.cjs +1 -1
  61. package/dist/render.d.ts +2 -0
  62. package/dist/render.js +111 -70
  63. package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
  64. package/dist/single-page-detail-6L38HJC4.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +13 -15
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.d.ts +4 -4
  69. package/dist/ui.js +149 -151
  70. package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
  71. package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
  72. package/dist/web-blocks.cjs +1 -9
  73. package/dist/web-blocks.js +431 -442
  74. package/package.json +8 -2
  75. package/dist/AddBlocks-tMxKPoen.js +0 -225
  76. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  77. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  78. package/dist/CanvasArea-xs4wM64L.cjs +0 -60
  79. package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
  80. package/dist/Layers-eaHy5PK9.cjs +0 -1
  81. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  82. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  83. package/dist/PagesPanel-gGKCV394.cjs +0 -1
  84. package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
  85. package/dist/Settings-7wlLcvoh.cjs +0 -1
  86. package/dist/SidePanels-5H4j0mIs.cjs +0 -1
  87. package/dist/Topbar-V8xCetWF.cjs +0 -1
  88. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  89. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  90. package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
  91. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  92. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  93. package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
  94. package/dist/functions-Ox_svtKm.cjs +0 -1
  95. package/dist/functions-xIebp8Aw.js +0 -23
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-niHREMmR.js +0 -2938
  98. package/dist/page-viewer-SLt8XgYv.cjs +0 -1
  99. package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
  100. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  101. package/dist/single-page-detail-IPod1o5P.cjs +0 -1
  102. package/dist/utils-PTxFk6qT.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-aiHDvS5v.cjs"),l=require("./index-cM3eKmlx.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("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("./empty-slot-TF2kd-0X.cjs");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;
@@ -1,16 +1,21 @@
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-pZhGT8uT.js";
1
+ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { A as s, z as l, C as n, E as d, F as a, H as c, B as u } from "./index-pNYv0oAF.js";
3
+ import { j as x } from "./index-Fj3ead-J.js";
4
4
  import { TrashIcon as h } from "@radix-ui/react-icons";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "react";
7
- import "@radix-ui/react-toggle";
8
- import "class-variance-authority";
9
- import "./utils-AvyFzbPC.js";
10
7
  import "lodash-es";
11
- import "./MODIFIERS-RiXS5Mn1.js";
8
+ import "./Functions-7jnEwJyw.js";
12
9
  import "clsx";
13
10
  import "tailwind-merge";
11
+ import "@chaibuilder/runtime";
12
+ import "jotai";
13
+ import "flat-to-nested";
14
+ import "./MODIFIERS-RiXS5Mn1.js";
15
+ import "@react-hookz/web";
16
+ import "@radix-ui/react-toggle";
17
+ import "class-variance-authority";
18
+ import "./Class-17XFhL48.js";
14
19
  import "@radix-ui/react-switch";
15
20
  import "@radix-ui/react-slot";
16
21
  import "@radix-ui/react-accordion";
@@ -32,13 +37,6 @@ import "@radix-ui/react-context-menu";
32
37
  import "react-icons-picker";
33
38
  import "react-dom";
34
39
  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
40
  import "react-i18next";
43
41
  import "i18next";
44
42
  import "@floating-ui/react-dom";
@@ -52,37 +50,37 @@ import "./html-to-json-57841sEK.js";
52
50
  import "himalaya";
53
51
  import "lucide-react";
54
52
  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, {
53
+ import "./empty-slot-MWycClTb.js";
54
+ const he = ({ pageData: r, projectData: i }) => {
55
+ const m = {}, t = x(), o = r.uuid === i.homepage, p = () => {
56
+ t.mutate(r, {
59
57
  onSuccess: () => {
60
58
  m({ uuid: i.homepage, slug: "/home" });
61
59
  }
62
60
  });
63
61
  };
64
- return /* @__PURE__ */ r.jsxs(s, { children: [
65
- /* @__PURE__ */ r.jsx(l, { disabled: o, children: /* @__PURE__ */ r.jsx(
62
+ return /* @__PURE__ */ e.jsxs(s, { children: [
63
+ /* @__PURE__ */ e.jsx(l, { disabled: o, children: /* @__PURE__ */ e.jsx(
66
64
  "div",
67
65
  {
68
66
  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, {})
67
+ children: /* @__PURE__ */ e.jsx(h, {})
70
68
  }
71
69
  ) }),
72
- /* @__PURE__ */ r.jsxs(n, { children: [
73
- /* @__PURE__ */ r.jsxs(d, { children: [
70
+ /* @__PURE__ */ e.jsxs(n, { children: [
71
+ /* @__PURE__ */ e.jsxs(d, { children: [
74
72
  "Are you sure you want to delete ",
75
- /* @__PURE__ */ r.jsx("i", { className: "text-red-500", children: e.name }),
73
+ /* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
76
74
  " page?"
77
75
  ] }),
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" })
76
+ /* @__PURE__ */ e.jsx(a, { children: "This action cannot be undone. This will permanently delete your page." }),
77
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-3", children: [
78
+ /* @__PURE__ */ e.jsx(c, { disabled: t.isPending, children: "Cancel" }),
79
+ /* @__PURE__ */ e.jsx(u, { variant: "destructive", onClick: p, disabled: t.isPending, children: "Yes, Delete" })
82
80
  ] })
83
81
  ] })
84
82
  ] });
85
83
  };
86
84
  export {
87
- jr as default
85
+ he as default
88
86
  };
@@ -1 +1 @@
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
+ "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("./empty-slot-TF2kd-0X.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const p=({blockProps:e,styles:t,children:o})=>{let n=o;return o||(n=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:n})};i.registerChaiBlock(p,{type:"Container",label:"Container",group:"basic",category:"core",canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1,canBeNested:e=>!e});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:a.ImageIcon,props:{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:a.ImageIcon,blocks:[{_type:"Row",_id:"a"},{_type:"Column",_id:"b",_parent:"a"}],props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const m=({blockProps:e,styles:t,children:o,align:n})=>{let s=o;return o||(s=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:s})};i.registerChaiBlock(m,{type:"Column",label:"Column",group:"basic",category:"core",icon:a.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,canBeNested:e=>e==="Row"});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:a.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:a.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 C=({content:e})=>e,j=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});i.registerChaiBlock(C,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:j,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const f=({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(f,{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 R=({blockProps:e,styles:t,href:o,content:n,target:s,children:u})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:s,children:u||n}),v=({blockProps:e,styles:t,content:o,children:n})=>{let s=n;return n||(s=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx("span",{...e,...t,children:s||o})};i.registerChaiBlock(R,{type:"Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:v,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}),w=({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:w,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:r.g({default:"Preview content",title:"Content"})}});const I=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});i.registerChaiBlock(I,{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:s,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:s,height:u}),L=({blockProps:e,styles:t,alt:o,image:n,width:s,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:s,height:u});i.registerChaiBlock(S,{type:"Image",label:"Image",group:"basic",category:"core",icon:a.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}),q=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});i.registerChaiBlock(T,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:q,props:{styles:r.S({default:"w-full h-2"})}});const H=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:s,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:s,language:u}),_=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});i.registerChaiBlock(H,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:_,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 A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),P=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});i.registerChaiBlock(A,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:P,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const D=d.noop;exports.loadEmailBlocks=D;
@@ -1,32 +1,37 @@
1
- import { noop as b } from "lodash-es";
1
+ import { noop as k } from "lodash-es";
2
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";
3
+ import { Container as f, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as I, Markdown as L, Img as T, Hr as H, CodeBlock as R, CodeInline as _ } from "@react-email/components";
4
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";
5
+ import { E as g, f as d, S as c, u as s, g as u, q as m, o as A, r as S } from "./empty-slot-MWycClTb.js";
6
+ import { ImageIcon as p, HeadingIcon as P, TextIcon as h, Link1Icon as D, DividerHorizontalIcon as M, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
7
7
  import "./_commonjsHelpers-UyOWmZb0.js";
8
8
  import "react";
9
- const N = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(f, { ...e, ...t, children: o });
9
+ import "./Functions-7jnEwJyw.js";
10
+ import "clsx";
11
+ import "tailwind-merge";
12
+ const N = ({ blockProps: e, styles: t, children: o }) => {
13
+ let n = o;
14
+ return o || (n = /* @__PURE__ */ l.jsx(g, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx(f, { ...e, ...t, children: n });
15
+ };
10
16
  r(N, {
11
17
  type: "Container",
12
18
  label: "Container",
13
19
  group: "basic",
14
20
  category: "core",
15
- props: { styles: i({ default: "" }) },
16
21
  canAcceptBlock: () => !0,
17
22
  canMove: () => !0,
18
23
  canDelete: () => !1,
19
- canDuplicate: () => !1
24
+ canDuplicate: () => !1,
25
+ canBeNested: (e) => !e
20
26
  });
21
- const P = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: o });
22
- r(P, {
27
+ const E = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
28
+ r(E, {
23
29
  type: "Section",
24
30
  label: "Section",
25
31
  group: "basic",
26
32
  category: "core",
27
33
  icon: p,
28
34
  props: {
29
- styles: i({ default: "w-full" }),
30
35
  align: d({
31
36
  title: "Align",
32
37
  default: "",
@@ -40,27 +45,34 @@ r(P, {
40
45
  },
41
46
  canAcceptBlock: () => !0
42
47
  });
43
- const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
48
+ const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, children: o });
44
49
  r($, {
45
50
  type: "Row",
46
51
  label: "Row",
47
52
  group: "basic",
48
53
  category: "core",
49
54
  icon: p,
55
+ blocks: [
56
+ { _type: "Row", _id: "a" },
57
+ { _type: "Column", _id: "b", _parent: "a" }
58
+ ],
50
59
  props: {
51
- styles: i({ default: "" })
60
+ styles: c({ default: "" })
52
61
  },
53
62
  canAcceptBlock: (e) => e === "Column"
54
63
  });
55
- const E = ({ blockProps: e, styles: t, children: o, align: n }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, align: n, children: o });
56
- r(E, {
64
+ const q = ({ blockProps: e, styles: t, children: o, align: n }) => {
65
+ let i = o;
66
+ return o || (i = /* @__PURE__ */ l.jsx(g, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx(B, { ...e, ...t, align: n, children: i });
67
+ };
68
+ r(q, {
57
69
  type: "Column",
58
70
  label: "Column",
59
71
  group: "basic",
60
72
  category: "core",
61
73
  icon: p,
62
74
  props: {
63
- styles: i({ default: "" }),
75
+ styles: c({ default: "" }),
64
76
  align: d({
65
77
  title: "Align",
66
78
  default: "",
@@ -72,19 +84,20 @@ r(E, {
72
84
  ]
73
85
  })
74
86
  },
75
- canAcceptBlock: () => !0
87
+ canAcceptBlock: () => !0,
88
+ canBeNested: (e) => e === "Row"
76
89
  });
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, {
90
+ const z = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(C, { as: e, ...t, ...o, children: n }), J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
91
+ r(z, {
79
92
  type: "Heading",
80
93
  label: "Heading",
81
94
  group: "basic",
82
95
  category: "core",
83
- icon: D,
84
- builderComponent: z,
96
+ icon: P,
97
+ builderComponent: J,
85
98
  props: {
86
- content: a({ title: "Content", default: "Enter your heading here..." }),
87
- styles: i({ default: "text-xl" }),
99
+ content: s({ title: "Content", default: "Enter your heading here..." }),
100
+ styles: c({ default: "text-xl" }),
88
101
  level: d({
89
102
  title: "Level",
90
103
  default: "h1",
@@ -101,59 +114,62 @@ r(q, {
101
114
  },
102
115
  canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
103
116
  });
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, {
117
+ const U = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, children: o }), V = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
118
+ r(U, {
106
119
  type: "Text",
107
120
  label: "Text",
108
121
  group: "basic",
109
122
  category: "core",
110
- icon: m,
111
- builderComponent: U,
123
+ icon: h,
124
+ builderComponent: V,
112
125
  props: {
113
- content: s({
126
+ content: u({
114
127
  title: "Content",
115
128
  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
129
  }),
117
- styles: i({ default: "" })
130
+ styles: c({ default: "" })
118
131
  },
119
132
  canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
120
133
  });
121
- const V = ({ content: e }) => e, W = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
122
- r(V, {
134
+ const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
135
+ r(W, {
123
136
  type: "RawText",
124
137
  label: "Raw Text",
125
138
  group: "basic",
126
139
  category: "core",
127
- icon: m,
140
+ icon: h,
128
141
  hidden: !0,
129
- builderComponent: W,
142
+ builderComponent: F,
130
143
  props: {
131
- content: s({
144
+ content: u({
132
145
  title: "Content",
133
146
  default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
134
147
  })
135
148
  }
136
149
  });
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, {
150
+ const G = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o.href, children: n }), K = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
151
+ r(G, {
139
152
  type: "Button",
140
153
  label: "Button",
141
154
  group: "basic",
142
155
  category: "core",
143
- builderComponent: G,
156
+ builderComponent: K,
144
157
  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" })
158
+ content: s({ title: "Content", default: "Click me" }),
159
+ link: m({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
160
+ styles: c({ default: "bg-primary text-white px-4 py-2 rounded-md" })
148
161
  }
149
162
  });
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, {
163
+ const O = ({ blockProps: e, styles: t, href: o, content: n, target: i, children: a }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, href: o, target: i, children: a || n }), Q = ({ blockProps: e, styles: t, content: o, children: n }) => {
164
+ let i = n;
165
+ return n || (i = /* @__PURE__ */ l.jsx(g, { blockProps: {}, styles: {} })), /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: i || o });
166
+ };
167
+ r(O, {
152
168
  type: "Link",
153
169
  label: "Link",
154
170
  group: "basic",
155
171
  category: "core",
156
- icon: M,
172
+ icon: D,
157
173
  blocks: [
158
174
  {
159
175
  _id: "a",
@@ -166,78 +182,81 @@ r(K, {
166
182
  content: "I am a link."
167
183
  }
168
184
  ],
169
- builderComponent: O,
185
+ builderComponent: Q,
170
186
  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" })
187
+ content: s({ title: "Content", default: "I am a link." }),
188
+ link: m({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
189
+ styles: c({ default: "font-bold text-blue-500" })
174
190
  },
175
191
  canAcceptBlock: () => !0
176
192
  });
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, {
193
+ const X = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(I, { ...e, ...t, children: o }), Y = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
194
+ r(X, {
179
195
  type: "Preview",
180
196
  label: "Preview",
181
197
  group: "basic",
182
198
  category: "core",
183
- builderComponent: X,
199
+ builderComponent: Y,
184
200
  canAcceptBlock: () => !0,
185
- canDuplicate: () => !1
201
+ canDuplicate: () => !1,
202
+ props: {
203
+ content: u({ default: "Preview content", title: "Content" })
204
+ }
186
205
  });
187
- const Y = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(I, { children: t, ...e });
188
- r(Y, {
206
+ const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(L, { children: t, ...e });
207
+ r(Z, {
189
208
  type: "Markdown",
190
209
  label: "Markdown",
191
210
  group: "basic",
192
211
  category: "core",
193
212
  props: {
194
- content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
213
+ content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
195
214
  }
196
215
  });
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, {
216
+ const ee = ({ blockProps: e, styles: t, alt: o, image: n, width: i, height: a }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t, src: n, alt: o, width: i, height: a }), te = ({ blockProps: e, styles: t, alt: o, image: n, width: i, height: a }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: i, height: a });
217
+ r(ee, {
199
218
  type: "Image",
200
219
  label: "Image",
201
220
  group: "basic",
202
221
  category: "core",
203
222
  icon: p,
204
- builderComponent: ee,
223
+ builderComponent: te,
205
224
  props: {
206
- styles: i({ default: "w-full" }),
207
- image: R({
225
+ styles: c({ default: "w-full" }),
226
+ image: A({
208
227
  title: "Image",
209
228
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
210
229
  }),
211
- alt: a({ title: "Alt", default: "" }),
212
- width: a({ title: "Width", default: "" }),
213
- height: a({ title: "Height", default: "" })
230
+ alt: s({ title: "Alt", default: "" }),
231
+ width: s({ title: "Width", default: "" }),
232
+ height: s({ title: "Height", default: "" })
214
233
  }
215
234
  });
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, {
235
+ const oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t }), le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
236
+ r(oe, {
218
237
  type: "Divider",
219
238
  label: "Divider",
220
239
  group: "basic",
221
240
  category: "core",
222
- icon: _,
223
- builderComponent: oe,
241
+ icon: M,
242
+ builderComponent: le,
224
243
  props: {
225
- styles: i({ default: "w-full h-2" })
244
+ styles: c({ default: "w-full h-2" })
226
245
  }
227
246
  });
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, {
247
+ const ne = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: i, language: a }) => /* @__PURE__ */ l.jsx(R, { ...e, ...t, code: o, linenumbers: n, theme: i, language: a }), re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
248
+ r(ne, {
230
249
  type: "CodeBlock",
231
250
  label: "Code Block",
232
251
  group: "basic",
233
252
  category: "core",
234
253
  hidden: !0,
235
- icon: h,
236
- builderComponent: ne,
254
+ icon: b,
255
+ builderComponent: re,
237
256
  props: {
238
- styles: i({ default: "" }),
239
- code: s({ title: "Code", default: "console.log('Hello, world!');" }),
240
- theme: a({ title: "Theme", default: "dracula" }),
257
+ styles: c({ default: "" }),
258
+ code: u({ title: "Code", default: "console.log('Hello, world!');" }),
259
+ theme: s({ title: "Theme", default: "dracula" }),
241
260
  lineNumbers: S({
242
261
  title: "Line number",
243
262
  default: !1
@@ -255,20 +274,20 @@ r(le, {
255
274
  })
256
275
  }
257
276
  });
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, {
277
+ const ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(_, { ...e, ...t, children: o }), ce = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
278
+ r(ie, {
260
279
  type: "CodeInline",
261
280
  label: "Code Inline",
262
281
  group: "basic",
263
282
  category: "core",
264
- icon: h,
265
- builderComponent: ie,
283
+ icon: b,
284
+ builderComponent: ce,
266
285
  props: {
267
- styles: i({ default: "" }),
268
- code: s({ title: "Code", default: "console.log('Hello, world!');" })
286
+ styles: c({ default: "" }),
287
+ code: u({ title: "Code", default: "console.log('Hello, world!');" })
269
288
  }
270
289
  });
271
- const he = b;
290
+ const ye = k;
272
291
  export {
273
- he as loadEmailBlocks
292
+ ye as loadEmailBlocks
274
293
  };
package/dist/email.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-cM3eKmlx.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-aiHDvS5v.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");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("@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("./empty-slot-TF2kd-0X.cjs");const t=[{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:800}],o=i=>{const u={...i,importHTMLSupport:!1,breakpoints:t};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=o;
@@ -0,0 +1,116 @@
1
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
+ import { default as React_2 } from 'react';
3
+
4
+ declare interface Block {
5
+ type: string;
6
+ [key: string]: any;
7
+ }
8
+
9
+ declare type Breakpoint = {
10
+ title: string;
11
+ content: string;
12
+ breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
13
+ icon: React_2.ReactNode | Element;
14
+ width: number;
15
+ };
16
+
17
+ declare type ChaiBlock = {
18
+ _id: string;
19
+ _type: string;
20
+ _name?: string;
21
+ _parent?: string | null | undefined;
22
+ _bindings?: Record<string, string>;
23
+ } & Record<string, any>;
24
+
25
+ declare interface ChaiBuilderEditorProps {
26
+ breakpoints?: Breakpoint[];
27
+ editable?: boolean;
28
+ loading?: boolean;
29
+ locale?: string;
30
+ nonEditableComponent?: ReactComponentType;
31
+ canvas?: React_2.FC<any>;
32
+ canvasTopBarComponents?: {
33
+ right?: ReactComponentType[];
34
+ };
35
+ previewLink?: string;
36
+ dataBindingSupport?: boolean;
37
+ dataProviders?: DataProvider[];
38
+ darkMode?: boolean;
39
+ dndOptions?: any;
40
+ importHTMLSupport?: boolean;
41
+ fetchMediaCallback?: (limit?: number, offset?: number) => Promise<any[]>;
42
+ uploadMediaCallback?: (file: File) => Promise<{
43
+ url: string;
44
+ }>;
45
+ getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
46
+ blocks: ChaiBlock[];
47
+ html: string;
48
+ }>;
49
+ getUILibraryBlocks?: (libraryUuid: string) => Promise<PredefinedBlock[]>;
50
+ uiLibraries?: UILibrary[];
51
+ subPages?: Block[];
52
+ subPagesSupport?: boolean;
53
+ blocks?: ChaiBlock[];
54
+ onSaveBlocks?: ({ blocks, providers }: any) => Promise<any>;
55
+ onSavePage?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
56
+ brandingOptions?: Record<string, string>;
57
+ onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
58
+ container?: ChaiBlock | "Body" | "Container";
59
+ onSaveContainer?: (container: ChaiBlock) => Promise<boolean | Error>;
60
+ onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
61
+ previewComponent?: ReactComponentType;
62
+ sideBarComponents?: {
63
+ bottom?: ReactComponentType[];
64
+ top?: {
65
+ icon: ReactComponentType | string;
66
+ name: string;
67
+ panel: ReactComponentType;
68
+ }[];
69
+ };
70
+ topBarComponents?: {
71
+ center?: ReactComponentType[];
72
+ left?: ReactComponentType[];
73
+ right?: ReactComponentType[];
74
+ };
75
+ getPages?: () => Promise<ChaiPage[]>;
76
+ unsplashAccessKey?: string;
77
+ }
78
+
79
+ export declare const ChaiBuilderEmail: (props: ChaiBuilderEditorProps) => JSX_2.Element;
80
+
81
+ declare type ChaiPage = {
82
+ uuid?: string;
83
+ page_name?: string;
84
+ blocks: ChaiBlock[];
85
+ custom_code: string;
86
+ seo_data: Record<string, string>;
87
+ slug: string;
88
+ translations: Record<string, Record<string, string>>;
89
+ };
90
+
91
+ declare type DataProvider = {
92
+ providerKey: string;
93
+ args: Record<string, any>;
94
+ };
95
+
96
+ declare type PredefinedBlock = {
97
+ uuid: string;
98
+ name: string;
99
+ preview: string;
100
+ blocks?: ChaiBlock[];
101
+ html?: string;
102
+ };
103
+
104
+ declare type ReactComponentType = React_2.ComponentType<any>;
105
+
106
+ declare type SavePageData = {
107
+ blocks: ChaiBlock[];
108
+ providers?: DataProvider[];
109
+ };
110
+
111
+ declare interface UILibrary {
112
+ name: string;
113
+ uuid: string;
114
+ }
115
+
116
+ export { }