@chaibuilder/sdk 1.2.43 → 1.2.45

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 (98) hide show
  1. package/dist/AddBlocks-UjnfO1xM.cjs +1 -0
  2. package/dist/{AddBlocks-9UM7zj57.js → AddBlocks-vkMNQu2M.js} +48 -46
  3. package/dist/CanvasArea-DLg9e6l5.js +1216 -0
  4. package/dist/CanvasArea-tyXurhEm.cjs +57 -0
  5. package/dist/{ChaiBuilderEditor-yf2LRjL1.js → ChaiBuilderEditor-1K-wcF5D.js} +3910 -3933
  6. package/dist/{ChaiBuilderEditor--NV-B5az.cjs → ChaiBuilderEditor-iXQwbYNr.cjs} +44 -44
  7. package/dist/CurrentPage-6t2cmyoQ.cjs +1 -0
  8. package/dist/{CurrentPage-hKtVFDxU.js → CurrentPage-JjZQQ8fp.js} +11 -10
  9. package/dist/{ListTree-ulr_sjdn.js → ListTree-KsggM2ac.js} +4 -3
  10. package/dist/ListTree-OTrtj3iM.cjs +1 -0
  11. package/dist/{PagesPanel-EHLY-cfj.js → PagesPanel-bElLBHNI.js} +6 -5
  12. package/dist/PagesPanel-zm1EC6Iw.cjs +1 -0
  13. package/dist/ProjectPanel-4zPiPARX.cjs +1 -0
  14. package/dist/{ProjectPanel-qiqyRbwH.js → ProjectPanel-o1BnitsI.js} +7 -6
  15. package/dist/Settings-7LXieIrg.cjs +1 -0
  16. package/dist/{Settings-a7j3ihRx.js → Settings-Bj2wI1at.js} +966 -892
  17. package/dist/SidePanels-9DSI8ysE.cjs +1 -0
  18. package/dist/{SidePanels-9XdRZ7rz.js → SidePanels-Q23Yldya.js} +7 -6
  19. package/dist/{ThemeConfiguration-MaGPPza1.js → ThemeConfiguration-GY85_LR8.js} +6 -5
  20. package/dist/ThemeConfiguration-mgyKWvYY.cjs +1 -0
  21. package/dist/Topbar-_7BQ50Y4.cjs +1 -0
  22. package/dist/{Topbar-OpgHjdWn.js → Topbar-_T58hnmh.js} +5 -4
  23. package/dist/UILibrariesPanel-28G5q5uW.cjs +1 -0
  24. package/dist/{UILibrariesPanel-HVpapacm.js → UILibrariesPanel-e9sgXFmR.js} +6 -5
  25. package/dist/{UnsplashImages-Gx7dy6mp.js → UnsplashImages-2Iew1REO.js} +12 -11
  26. package/dist/UnsplashImages-wiV_0gCf.cjs +1 -0
  27. package/dist/{UploadImages-aClrfKqQ.js → UploadImages--batsol9.js} +10 -9
  28. package/dist/UploadImages-XNNW2MnE.cjs +1 -0
  29. package/dist/{add-page-modal-kP7x8GYO.js → add-page-modal-1hTp3XOU.js} +18 -17
  30. package/dist/add-page-modal-AvOI8Zy3.cjs +1 -0
  31. package/dist/atoms-ZOWyNoiC.js +6 -0
  32. package/dist/atoms-a0H_593V.cjs +1 -0
  33. package/dist/confirm-alert-8gHBC9xl.cjs +1 -0
  34. package/dist/{confirm-alert-gemzBTIt.js → confirm-alert-pMcaye-H.js} +5 -4
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.d.ts +1 -1
  37. package/dist/core.js +46 -45
  38. package/dist/delete-page-modal--GqB4-ya.cjs +1 -0
  39. package/dist/{delete-page-modal-ER-TAzRL.js → delete-page-modal-pPp6AAO1.js} +6 -5
  40. package/dist/email-blocks.cjs +1 -1
  41. package/dist/email-blocks.js +30 -30
  42. package/dist/email.cjs +1 -1
  43. package/dist/email.d.ts +1 -1
  44. package/dist/email.js +5 -4
  45. package/dist/empty-slot-Lsxjts7Q.js +6 -0
  46. package/dist/empty-slot-Sy930lX6.cjs +1 -0
  47. package/dist/{form-UruaB3s_.js → form-BbIs9ZUH.js} +5 -5
  48. package/dist/{form-l4PB76nt.cjs → form-svmj4OQd.cjs} +1 -1
  49. package/dist/{index-rKrjj7Vz.js → index-GRkx-GlC.js} +2 -2
  50. package/dist/{index-PXyps6Qc.cjs → index-ssLLO7-s.cjs} +1 -1
  51. package/dist/lib.cjs +1 -1
  52. package/dist/lib.js +3 -3
  53. package/dist/page-viewer-0QMFEzfk.cjs +1 -0
  54. package/dist/{page-viewer-bCH5PPSH.js → page-viewer-3ne7tW8e.js} +7 -6
  55. package/dist/{project-general-setting-rdCQBkQZ.js → project-general-setting-cIjIy8PW.js} +11 -10
  56. package/dist/project-general-setting-oNYVjfNV.cjs +1 -0
  57. package/dist/project-seo-setting-5699qkWN.cjs +1 -0
  58. package/dist/{project-seo-setting-_SGBKl0c.js → project-seo-setting-HLwPjaL2.js} +6 -5
  59. package/dist/{single-page-detail-H3Rb5gkJ.js → single-page-detail-MLxPXKfu.js} +8 -7
  60. package/dist/single-page-detail-amfiKMF_.cjs +1 -0
  61. package/dist/studio.cjs +1 -1
  62. package/dist/studio.d.ts +1 -1
  63. package/dist/studio.js +5 -4
  64. package/dist/style.css +1 -1
  65. package/dist/ui.cjs +1 -1
  66. package/dist/ui.d.ts +3 -3
  67. package/dist/ui.js +130 -129
  68. package/dist/{useCanvasSettings-IalZcnSd.cjs → useCanvasSettings-KDwtap3V.cjs} +1 -1
  69. package/dist/{useCanvasSettings-tkzd9Qrw.js → useCanvasSettings-qs-7bwyA.js} +1 -1
  70. package/dist/utils-K3Zk762G.cjs +1 -0
  71. package/dist/{Class-6Hz2KzYb.js → utils-iMv3T4WT.js} +16 -15
  72. package/dist/web-blocks.cjs +4 -4
  73. package/dist/web-blocks.js +237 -238
  74. package/package.json +3 -2
  75. package/dist/AddBlocks-_6X3bnJZ.cjs +0 -1
  76. package/dist/CanvasArea-HmbcRpgP.cjs +0 -55
  77. package/dist/CanvasArea-a3WMBMi3.js +0 -1199
  78. package/dist/Class-Zc8hpE7f.cjs +0 -1
  79. package/dist/CurrentPage-rgu6shCq.cjs +0 -1
  80. package/dist/ListTree-fwN6Y_EA.cjs +0 -1
  81. package/dist/PagesPanel-v6Nl5KWy.cjs +0 -1
  82. package/dist/ProjectPanel-ck-mOBEg.cjs +0 -1
  83. package/dist/Settings-Rtk4HDKy.cjs +0 -1
  84. package/dist/SidePanels-biCoYtzR.cjs +0 -1
  85. package/dist/ThemeConfiguration-f6AxqpmO.cjs +0 -1
  86. package/dist/Topbar-cDxKWgN6.cjs +0 -1
  87. package/dist/UILibrariesPanel-d08F5Ri0.cjs +0 -1
  88. package/dist/UnsplashImages-uyokFuF-.cjs +0 -1
  89. package/dist/UploadImages-kLPXfW7W.cjs +0 -1
  90. package/dist/add-page-modal-H5MTzKBT.cjs +0 -1
  91. package/dist/confirm-alert-zZAmXzx0.cjs +0 -1
  92. package/dist/delete-page-modal-E8MFNVWF.cjs +0 -1
  93. package/dist/empty-slot-ZBlsQi6m.js +0 -15
  94. package/dist/empty-slot-nzYOgZuS.cjs +0 -1
  95. package/dist/page-viewer-wQq2qD96.cjs +0 -1
  96. package/dist/project-general-setting-A5OelyCo.cjs +0 -1
  97. package/dist/project-seo-setting-Y_q0WJSy.cjs +0 -1
  98. package/dist/single-page-detail-xAO7x8a1.cjs +0 -1
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as J, l as K, U as N, m as Q, W as V, n as X, T as Y, i as Z, F as _, h as $, u as ss, o as es, p as os, q as ts, r as as, s as rs, t as is, v as ps, w as ls, x as ms, y as us, z as ds, D as cs, E as Bs, k as ks, H as ns, I as Cs, V as Ss, M as Ps, K as gs, J as vs, L as ys, S as As, X as Is, Y as hs, N as Ms, P as Rs, O as Ds, j as Us, Q as Ts, R as xs } from "./ChaiBuilderEditor-yf2LRjL1.js";
2
- import { useTranslation as Os } from "react-i18next";
1
+ import { C as K, l as N, U as Q, m as V, W as X, n as Y, T as Z, i as _, F as $, h as ss, u as es, o as os, p as ts, q as as, r as rs, s as is, t as ps, v as ls, w as ms, x as us, y as ds, z as cs, D as Bs, E as ks, k as ns, H as Cs, I as Ss, V as Ps, M as gs, K as vs, J as ys, L as As, S as Is, X as hs, Y as Ms, N as Rs, P as Ds, O as Us, j as Ts, Q as xs, R as Hs } from "./ChaiBuilderEditor-1K-wcF5D.js";
2
+ import { useTranslation as bs } from "react-i18next";
3
3
  import "./jsx-runtime-WbnYoNE9.js";
4
4
  import "./_commonjsHelpers-UyOWmZb0.js";
5
5
  import "react";
@@ -17,9 +17,10 @@ import "tailwind-merge";
17
17
  import "@chaibuilder/runtime";
18
18
  import "@react-hookz/web";
19
19
  import "./MODIFIERS-cBT31iqE.js";
20
+ import "tree-model";
21
+ import "./utils-iMv3T4WT.js";
20
22
  import "@radix-ui/react-toggle";
21
23
  import "class-variance-authority";
22
- import "./Class-6Hz2KzYb.js";
23
24
  import "@radix-ui/react-switch";
24
25
  import "@radix-ui/react-slot";
25
26
  import "@radix-ui/react-accordion";
@@ -43,46 +44,46 @@ import "react-quill";
43
44
  import "react-hotkeys-hook";
44
45
  import "lucide-react";
45
46
  export {
46
- J as ChaiBuilderEditor,
47
- K as useActiveModal,
48
- N as useActivePanel,
49
- Q as useAddBlock,
50
- V as useAddBlockParent,
51
- X as useAddClassesToBlocks,
52
- Y as useAllBlocks,
53
- Z as useBlocksStore,
54
- _ as useBrandingOptions,
55
- $ as useBuilderProp,
56
- ss as useBuilderReset,
57
- es as useCanvasWidth,
58
- os as useCanvasZoom,
59
- ts as useCopyBlockIds,
60
- as as useCopyToClipboard,
61
- rs as useCurrentPage,
62
- is as useCutBlockIds,
63
- ps as useDarkMode,
64
- ls as useDuplicateBlocks,
65
- ms as useGetPageData,
66
- us as useHiddenBlockIds,
67
- ds as useHighlightBlockId,
68
- cs as usePasteBlocks,
69
- Bs as usePreviewMode,
70
- ks as useReadOnlyMode,
71
- ns as useRemoveBlocks,
72
- Cs as useRemoveClassesFromBlocks,
73
- Ss as useSavePage,
74
- Ps as useSelectedBlock,
75
- gs as useSelectedBlockAllClasses,
76
- vs as useSelectedBlockCurrentClasses,
77
- ys as useSelectedBlockIds,
78
- As as useSelectedBlocksDisplayChild,
79
- Is as useSelectedBreakpoints,
80
- hs as useSelectedStylingBlocks,
81
- Ms as useStylingBreakpoint,
82
- Rs as useStylingState,
83
- Os as useTranslation,
84
- Ds as useUILibraryBlocks,
85
- Us as useUndoManager,
86
- Ts as useUpdateBlocksProps,
87
- xs as useUpdateBlocksPropsRealtime
47
+ K as ChaiBuilderEditor,
48
+ N as useActiveModal,
49
+ Q as useActivePanel,
50
+ V as useAddBlock,
51
+ X as useAddBlockParent,
52
+ Y as useAddClassesToBlocks,
53
+ Z as useAllBlocks,
54
+ _ as useBlocksStore,
55
+ $ as useBrandingOptions,
56
+ ss as useBuilderProp,
57
+ es as useBuilderReset,
58
+ os as useCanvasWidth,
59
+ ts as useCanvasZoom,
60
+ as as useCopyBlockIds,
61
+ rs as useCopyToClipboard,
62
+ is as useCurrentPage,
63
+ ps as useCutBlockIds,
64
+ ls as useDarkMode,
65
+ ms as useDuplicateBlocks,
66
+ us as useGetPageData,
67
+ ds as useHiddenBlockIds,
68
+ cs as useHighlightBlockId,
69
+ Bs as usePasteBlocks,
70
+ ks as usePreviewMode,
71
+ ns as useReadOnlyMode,
72
+ Cs as useRemoveBlocks,
73
+ Ss as useRemoveClassesFromBlocks,
74
+ Ps as useSavePage,
75
+ gs as useSelectedBlock,
76
+ vs as useSelectedBlockAllClasses,
77
+ ys as useSelectedBlockCurrentClasses,
78
+ As as useSelectedBlockIds,
79
+ Is as useSelectedBlocksDisplayChild,
80
+ hs as useSelectedBreakpoints,
81
+ Ms as useSelectedStylingBlocks,
82
+ Rs as useStylingBreakpoint,
83
+ Ds as useStylingState,
84
+ bs as useTranslation,
85
+ Us as useUILibraryBlocks,
86
+ Ts as useUndoManager,
87
+ xs as useUpdateBlocksProps,
88
+ Hs as useUpdateBlocksPropsRealtime
88
89
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-iXQwbYNr.cjs"),l=require("./index-ssLLO7-s.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./core.cjs");require("sonner");require("./html-to-json-VPWiWWGH.cjs");require("himalaya");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,6 +1,6 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
- import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./ChaiBuilderEditor-yf2LRjL1.js";
3
- import { h } from "./index-rKrjj7Vz.js";
2
+ import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./ChaiBuilderEditor-1K-wcF5D.js";
3
+ import { h } from "./index-GRkx-GlC.js";
4
4
  import { TrashIcon as x } from "@radix-ui/react-icons";
5
5
  import "./_commonjsHelpers-UyOWmZb0.js";
6
6
  import "react";
@@ -19,9 +19,10 @@ import "tailwind-merge";
19
19
  import "@chaibuilder/runtime";
20
20
  import "@react-hookz/web";
21
21
  import "./MODIFIERS-cBT31iqE.js";
22
+ import "tree-model";
23
+ import "./utils-iMv3T4WT.js";
22
24
  import "@radix-ui/react-toggle";
23
25
  import "class-variance-authority";
24
- import "./Class-6Hz2KzYb.js";
25
26
  import "@radix-ui/react-switch";
26
27
  import "@radix-ui/react-slot";
27
28
  import "@radix-ui/react-accordion";
@@ -47,7 +48,7 @@ import "./core.js";
47
48
  import "sonner";
48
49
  import "./html-to-json-Z6R2o_fA.js";
49
50
  import "himalaya";
50
- const ae = ({ pageData: r, projectData: i }) => {
51
+ const ce = ({ pageData: r, projectData: i }) => {
51
52
  const m = {}, t = h(), o = r.uuid === i.homepage, s = () => {
52
53
  t.mutate(r, {
53
54
  onSuccess: () => {
@@ -78,5 +79,5 @@ const ae = ({ pageData: r, projectData: i }) => {
78
79
  ] });
79
80
  };
80
81
  export {
81
- ae as default
82
+ ce as default
82
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),i=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),s=require("@chaibuilder/runtime"),d=require("./empty-slot-nzYOgZuS.cjs"),l=require("./controls-jWJDao88.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const m=({blockProps:e,styles:t,children:o,inBuilder:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{},inBuilder:r})),i.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:n})};s.registerChaiBlock(m,{type:"Email/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})=>i.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});s.registerChaiBlock(x,{type:"Email/Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{align:l.y({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})=>i.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});s.registerChaiBlock(g,{type:"Email/Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Email/Row",_id:"a"},{_type:"Email/Column",_id:"b",_parent:"a"}],props:{styles:l.S({default:""})},canAcceptBlock:e=>e==="Email/Column"});const h=({blockProps:e,styles:t,children:o,align:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),i.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:r,children:n})};s.registerChaiBlock(h,{type:"Email/Column",label:"Column",group:"basic",category:"core",icon:a.ImageIcon,props:{styles:l.S({default:""}),align:l.y({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0,canBeNested:e=>e==="Email/Row"});const k=({level:e,blockProps:t,styles:o,content:r})=>i.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:r}),b=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});s.registerChaiBlock(k,{type:"Email/Heading",label:"Heading",group:"basic",category:"core",icon:a.HeadingIcon,builderComponent:b,props:{content:l.l({title:"Content",default:"Enter your heading here..."}),styles:l.S({default:"text-xl"}),level:l.y({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=>["Email/Link","Email/RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),y=({content:e,blockProps:t,styles:o})=>i.jsxRuntimeExports.jsx("p",{...t,...o,children:e});s.registerChaiBlock(B,{type:"Email/Text",label:"Text",group:"basic",category:"core",icon:a.TextIcon,builderComponent:y,props:{content:l.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:l.S({default:""})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const C=({content:e})=>e,j=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(C,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:j,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const E=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:r}),f=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});s.registerChaiBlock(E,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:f,props:{content:l.l({title:"Content",default:"Click me"}),link:l.T({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const R=({blockProps:e,styles:t,href:o,content:r,target:n,children:u})=>i.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:n,children:u||r}),v=({blockProps:e,styles:t,content:o,children:r})=>{let n=r;return r||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{blockProps:{},styles:{}})),i.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o})};s.registerChaiBlock(R,{type:"Email/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:l.l({title:"Content",default:"I am a link."}),link:l.T({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const w=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:o});s.registerChaiBlock(w,{type:"Email/Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:l.g({default:"Preview content",title:"Content"})}});const S=({blockProps:e,content:t})=>i.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});s.registerChaiBlock(S,{type:"Email/Markdown",label:"Markdown",group:"basic",category:"core",props:{content:l.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const T=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:r,alt:o,width:n,height:u}),L=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx("img",{...e,...t,src:r,alt:o,width:n,height:u});s.registerChaiBlock(T,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:L,props:{styles:l.S({default:"w-full"}),image:l.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.l({title:"Alt",default:""}),width:l.l({title:"Width",default:""}),height:l.l({title:"Height",default:""})}});const q=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx("hr",{...e,...t});s.registerChaiBlock(q,{type:"Email/Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:H,props:{styles:l.S({default:"w-full h-2"})}});const _=({blockProps:e,styles:t,code:o,lineNumbers:r,theme:n,language:u})=>i.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:r,theme:n,language:u}),A=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:i.jsxRuntimeExports.jsx("code",{children:o})});s.registerChaiBlock(_,{type:"Email/CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:A,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"}),theme:l.l({title:"Theme",default:"dracula"}),lineNumbers:l.r({title:"Line number",default:!1}),language:l.y({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const P=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),D=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("code",{...e,...t,children:o});s.registerChaiBlock(P,{type:"Email/CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:D,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"})}});const M=p.noop;exports.loadEmailBlocks=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),i=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("@react-email/components"),c=require("@chaibuilder/runtime"),d=require("./empty-slot-Sy930lX6.cjs"),l=require("./controls-jWJDao88.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const m=({blockProps:e,styles:t,children:o,inBuilder:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{inBuilder:r})),i.jsxRuntimeExports.jsx(s.Container,{...e,...t,children:n})};c.registerChaiBlock(m,{type:"Email/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})=>i.jsxRuntimeExports.jsx(s.Section,{...e,...t,children:o});c.registerChaiBlock(x,{type:"Email/Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{align:l.y({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})=>i.jsxRuntimeExports.jsx(s.Row,{...e,...t,children:o});c.registerChaiBlock(g,{type:"Email/Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Email/Row",_id:"a"},{_type:"Email/Column",_id:"b",_parent:"a"}],props:{styles:l.S({default:""})},canAcceptBlock:e=>e==="Email/Column"});const h=({blockProps:e,styles:t,children:o,align:r})=>{let n=o;return o||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{})),i.jsxRuntimeExports.jsx(s.Column,{...e,...t,align:r,children:n})};c.registerChaiBlock(h,{type:"Email/Column",label:"Column",group:"basic",category:"core",icon:a.ImageIcon,props:{styles:l.S({default:""}),align:l.y({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0,canBeNested:e=>e==="Email/Row"});const k=({level:e,blockProps:t,styles:o,content:r})=>i.jsxRuntimeExports.jsx(s.Heading,{as:e,...t,...o,children:r}),b=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});c.registerChaiBlock(k,{type:"Email/Heading",label:"Heading",group:"basic",category:"core",icon:a.HeadingIcon,builderComponent:b,props:{content:l.l({title:"Content",default:"Enter your heading here..."}),styles:l.S({default:"text-xl"}),level:l.y({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=>["Email/Link","Email/RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx(s.Text,{...e,...t,children:o}),C=({content:e,blockProps:t,styles:o})=>i.jsxRuntimeExports.jsx("p",{...t,...o,children:e});c.registerChaiBlock(B,{type:"Email/Text",label:"Text",group:"basic",category:"core",icon:a.TextIcon,builderComponent:C,props:{content:l.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:l.S({default:""})},canAcceptBlock:e=>["Email/Link","Email/RawText"].includes(e)});const j=({content:e})=>e,y=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});c.registerChaiBlock(j,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:y,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const E=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(s.Button,{...e,...t,href:o.href,children:r}),f=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});c.registerChaiBlock(E,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:f,props:{content:l.l({title:"Content",default:"Click me"}),link:l.T({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const R=({blockProps:e,styles:t,href:o,content:r,target:n,children:u})=>i.jsxRuntimeExports.jsx(s.Link,{...e,...t,href:o,target:n,children:u||r}),v=({blockProps:e,styles:t,content:o,children:r})=>{let n=r;return r||(n=i.jsxRuntimeExports.jsx(d.EmptySlot,{})),i.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o})};c.registerChaiBlock(R,{type:"Email/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:l.l({title:"Content",default:"I am a link."}),link:l.T({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:l.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const w=({blockProps:e,styles:t,children:o})=>i.jsxRuntimeExports.jsx(s.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:o});c.registerChaiBlock(w,{type:"Email/Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:l.g({default:"Preview content",title:"Content"})}});const S=({blockProps:e,content:t})=>i.jsxRuntimeExports.jsx(s.Markdown,{children:t,...e});c.registerChaiBlock(S,{type:"Email/Markdown",label:"Markdown",group:"basic",category:"core",props:{content:l.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const T=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx(s.Img,{...e,...t,src:r,alt:o,width:n,height:u}),L=({blockProps:e,styles:t,alt:o,image:r,width:n,height:u})=>i.jsxRuntimeExports.jsx("img",{...e,...t,src:r,alt:o,width:n,height:u});c.registerChaiBlock(T,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:L,props:{styles:l.S({default:"w-full"}),image:l.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.l({title:"Alt",default:""}),width:l.l({title:"Width",default:""}),height:l.l({title:"Height",default:""})}});const q=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx(s.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>i.jsxRuntimeExports.jsx("hr",{...e,...t});c.registerChaiBlock(q,{type:"Email/Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:H,props:{styles:l.S({default:"w-full h-2"})}});const _=({blockProps:e,styles:t,code:o,lineNumbers:r,theme:n,language:u})=>i.jsxRuntimeExports.jsx(s.CodeBlock,{...e,...t,code:o,linenumbers:r,theme:n,language:u}),A=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("div",{...e,...t,children:i.jsxRuntimeExports.jsx("code",{children:o})});c.registerChaiBlock(_,{type:"Email/CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:A,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"}),theme:l.l({title:"Theme",default:"dracula"}),lineNumbers:l.r({title:"Line number",default:!1}),language:l.y({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})=>i.jsxRuntimeExports.jsx(s.CodeInline,{...e,...t,children:o}),M=({blockProps:e,styles:t,code:o})=>i.jsxRuntimeExports.jsx("code",{...e,...t,children:o});c.registerChaiBlock(D,{type:"Email/CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:M,props:{styles:l.S({default:""}),code:l.g({title:"Code",default:"console.log('Hello, world!');"})}});const N=p.noop;exports.loadEmailBlocks=N;
@@ -1,20 +1,20 @@
1
- import { noop as k } from "lodash-es";
1
+ import { noop as f } from "lodash-es";
2
2
  import { j as o } from "./jsx-runtime-WbnYoNE9.js";
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 E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
3
+ import { Container as k, Section as x, Row as y, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
4
4
  import { registerChaiBlock as r } from "@chaibuilder/runtime";
5
- import { E as m } from "./empty-slot-ZBlsQi6m.js";
6
- import { y as d, S as a, l as s, g as u, T as g, q as _, r as A } from "./controls-VTdJhdSz.js";
7
- import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as P, DividerHorizontalIcon as D, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
5
+ import { E as m } from "./empty-slot-Lsxjts7Q.js";
6
+ import { y as d, S as a, l as u, g as s, T as g, q as _, r as A } from "./controls-VTdJhdSz.js";
7
+ import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as D, DividerHorizontalIcon as M, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
9
9
  import "react";
10
10
  import "./Functions-7jnEwJyw.js";
11
11
  import "clsx";
12
12
  import "tailwind-merge";
13
- const M = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
13
+ const N = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
14
14
  let n = l;
15
- return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {}, inBuilder: i })), /* @__PURE__ */ o.jsx(f, { ...e, ...t, children: n });
15
+ return l || (n = /* @__PURE__ */ o.jsx(m, { inBuilder: i })), /* @__PURE__ */ o.jsx(k, { ...e, ...t, children: n });
16
16
  };
17
- r(M, {
17
+ r(N, {
18
18
  type: "Email/Container",
19
19
  label: "Container",
20
20
  group: "basic",
@@ -25,8 +25,8 @@ r(M, {
25
25
  canDuplicate: () => !1,
26
26
  canBeNested: (e) => !e
27
27
  });
28
- const N = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
29
- r(N, {
28
+ const P = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
29
+ r(P, {
30
30
  type: "Email/Section",
31
31
  label: "Section",
32
32
  group: "basic",
@@ -46,7 +46,7 @@ r(N, {
46
46
  },
47
47
  canAcceptBlock: () => !0
48
48
  });
49
- const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
49
+ const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
50
50
  r($, {
51
51
  type: "Email/Row",
52
52
  label: "Row",
@@ -64,7 +64,7 @@ r($, {
64
64
  });
65
65
  const q = ({ blockProps: e, styles: t, children: l, align: i }) => {
66
66
  let n = l;
67
- return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
67
+ return l || (n = /* @__PURE__ */ o.jsx(m, {})), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
68
68
  };
69
69
  r(q, {
70
70
  type: "Email/Column",
@@ -97,7 +97,7 @@ r(z, {
97
97
  icon: S,
98
98
  builderComponent: J,
99
99
  props: {
100
- content: s({ title: "Content", default: "Enter your heading here..." }),
100
+ content: u({ title: "Content", default: "Enter your heading here..." }),
101
101
  styles: a({ default: "text-xl" }),
102
102
  level: d({
103
103
  title: "Level",
@@ -124,7 +124,7 @@ r(U, {
124
124
  icon: h,
125
125
  builderComponent: V,
126
126
  props: {
127
- content: u({
127
+ content: s({
128
128
  title: "Content",
129
129
  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."
130
130
  }),
@@ -142,7 +142,7 @@ r(W, {
142
142
  hidden: !0,
143
143
  builderComponent: F,
144
144
  props: {
145
- content: u({
145
+ content: s({
146
146
  title: "Content",
147
147
  default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
148
148
  })
@@ -156,21 +156,21 @@ r(G, {
156
156
  category: "core",
157
157
  builderComponent: K,
158
158
  props: {
159
- content: s({ title: "Content", default: "Click me" }),
159
+ content: u({ title: "Content", default: "Click me" }),
160
160
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
161
161
  styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
162
162
  }
163
163
  });
164
164
  const O = ({ blockProps: e, styles: t, href: l, content: i, target: n, children: c }) => /* @__PURE__ */ o.jsx(w, { ...e, ...t, href: l, target: n, children: c || i }), Q = ({ blockProps: e, styles: t, content: l, children: i }) => {
165
165
  let n = i;
166
- return i || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
166
+ return i || (n = /* @__PURE__ */ o.jsx(m, {})), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
167
167
  };
168
168
  r(O, {
169
169
  type: "Email/Link",
170
170
  label: "Link",
171
171
  group: "basic",
172
172
  category: "core",
173
- icon: P,
173
+ icon: D,
174
174
  blocks: [
175
175
  {
176
176
  _id: "a",
@@ -185,7 +185,7 @@ r(O, {
185
185
  ],
186
186
  builderComponent: Q,
187
187
  props: {
188
- content: s({ title: "Content", default: "I am a link." }),
188
+ content: u({ title: "Content", default: "I am a link." }),
189
189
  link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
190
190
  styles: a({ default: "font-bold text-blue-500" })
191
191
  },
@@ -201,7 +201,7 @@ r(X, {
201
201
  canAcceptBlock: () => !0,
202
202
  canDuplicate: () => !1,
203
203
  props: {
204
- content: u({ default: "Preview content", title: "Content" })
204
+ content: s({ default: "Preview content", title: "Content" })
205
205
  }
206
206
  });
207
207
  const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
@@ -211,7 +211,7 @@ r(Z, {
211
211
  group: "basic",
212
212
  category: "core",
213
213
  props: {
214
- content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
214
+ content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
215
215
  }
216
216
  });
217
217
  const ee = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx(L, { ...e, ...t, src: i, alt: l, width: n, height: c }), te = ({ blockProps: e, styles: t, alt: l, image: i, width: n, height: c }) => /* @__PURE__ */ o.jsx("img", { ...e, ...t, src: i, alt: l, width: n, height: c });
@@ -228,9 +228,9 @@ r(ee, {
228
228
  title: "Image",
229
229
  default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
230
230
  }),
231
- alt: s({ title: "Alt", default: "" }),
232
- width: s({ title: "Width", default: "" }),
233
- height: s({ title: "Height", default: "" })
231
+ alt: u({ title: "Alt", default: "" }),
232
+ width: u({ title: "Width", default: "" }),
233
+ height: u({ title: "Height", default: "" })
234
234
  }
235
235
  });
236
236
  const le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx("hr", { ...e, ...t });
@@ -239,7 +239,7 @@ r(le, {
239
239
  label: "Divider",
240
240
  group: "basic",
241
241
  category: "core",
242
- icon: D,
242
+ icon: M,
243
243
  builderComponent: oe,
244
244
  props: {
245
245
  styles: a({ default: "w-full h-2" })
@@ -256,8 +256,8 @@ r(ie, {
256
256
  builderComponent: ne,
257
257
  props: {
258
258
  styles: a({ default: "" }),
259
- code: u({ title: "Code", default: "console.log('Hello, world!');" }),
260
- theme: s({ title: "Theme", default: "dracula" }),
259
+ code: s({ title: "Code", default: "console.log('Hello, world!');" }),
260
+ theme: u({ title: "Theme", default: "dracula" }),
261
261
  lineNumbers: A({
262
262
  title: "Line number",
263
263
  default: !1
@@ -285,10 +285,10 @@ r(re, {
285
285
  builderComponent: ae,
286
286
  props: {
287
287
  styles: a({ default: "" }),
288
- code: u({ title: "Code", default: "console.log('Hello, world!');" })
288
+ code: s({ title: "Code", default: "console.log('Hello, world!');" })
289
289
  }
290
290
  });
291
- const xe = k;
291
+ const ye = f;
292
292
  export {
293
- xe as loadEmailBlocks
293
+ ye as loadEmailBlocks
294
294
  };
package/dist/email.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs");require("./core.cjs");const r=require("@radix-ui/react-icons"),q=require("lodash-es"),n=require("./ChaiBuilderEditor--NV-B5az.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("react-i18next");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.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-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");const o=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>q.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:o};return e.jsxRuntimeExports.jsx(n.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs");require("./core.cjs");const r=require("@radix-ui/react-icons"),q=require("lodash-es"),n=require("./ChaiBuilderEditor-iXQwbYNr.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("react-i18next");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("tree-model");require("./utils-K3Zk762G.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");const o=[{title:"Mobile",content:"Mobile email client",breakpoint:"xs",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{}),width:400},{title:"Email Client",content:"Content as seen inside an email client",breakpoint:"sm",icon:e.jsxRuntimeExports.jsx(r.MobileIcon,{className:"rotate-90"}),width:700}],s=i=>{const u={...i,filterChaiBlock:t=>q.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:o};return e.jsxRuntimeExports.jsx(n.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
package/dist/email.d.ts CHANGED
@@ -57,7 +57,7 @@ declare interface ChaiBuilderEditorProps {
57
57
  uploadMediaCallback?: (file: File) => Promise<{
58
58
  url: string;
59
59
  }>;
60
- askAiCallBack?: (prompt: string, blocks: ChaiBlock[]) => Promise<AskAiResponse>;
60
+ askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[]) => Promise<AskAiResponse>;
61
61
  saveAiContextCallback?: (content: string) => Promise<true | Error>;
62
62
  aiContext?: string;
63
63
  getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
package/dist/email.js CHANGED
@@ -2,7 +2,7 @@ import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import "./core.js";
3
3
  import { MobileIcon as t } from "@radix-ui/react-icons";
4
4
  import { includes as p } from "lodash-es";
5
- import { C as e } from "./ChaiBuilderEditor-yf2LRjL1.js";
5
+ import { C as e } from "./ChaiBuilderEditor-1K-wcF5D.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "react";
8
8
  import "react-i18next";
@@ -19,9 +19,10 @@ import "tailwind-merge";
19
19
  import "@chaibuilder/runtime";
20
20
  import "@react-hookz/web";
21
21
  import "./MODIFIERS-cBT31iqE.js";
22
+ import "tree-model";
23
+ import "./utils-iMv3T4WT.js";
22
24
  import "@radix-ui/react-toggle";
23
25
  import "class-variance-authority";
24
- import "./Class-6Hz2KzYb.js";
25
26
  import "@radix-ui/react-switch";
26
27
  import "@radix-ui/react-slot";
27
28
  import "@radix-ui/react-accordion";
@@ -58,7 +59,7 @@ const n = [
58
59
  icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
59
60
  width: 700
60
61
  }
61
- ], $ = (o) => {
62
+ ], ii = (o) => {
62
63
  const r = {
63
64
  ...o,
64
65
  filterChaiBlock: (m) => p(m.type, "Email/"),
@@ -69,5 +70,5 @@ const n = [
69
70
  return /* @__PURE__ */ i.jsx(e, { ...r });
70
71
  };
71
72
  export {
72
- $ as ChaiBuilderEmail
73
+ ii as ChaiBuilderEmail
73
74
  };
@@ -0,0 +1,6 @@
1
+ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
+ import { c as n } from "./Functions-7jnEwJyw.js";
3
+ const i = ({ className: t = "", inBuilder: l }) => l ? /* @__PURE__ */ e.jsx("div", { className: n("pointer-events-none flex h-20 flex-col items-center justify-center p-2", t), children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2", children: /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300" }) }) }) : null;
4
+ export {
5
+ i as E
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("./Functions-N3yhPYKY.cjs"),l=({className:t="",inBuilder:n})=>n?e.jsxRuntimeExports.jsx("div",{className:s.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",t),children:e.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300"})})}):null;exports.EmptySlot=l;
@@ -1,8 +1,8 @@
1
1
  import { j as u } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import x from "@rjsf/core";
3
- import $ from "@rjsf/validator-ajv8";
4
- import { includes as h, get as a, set as b, first as F } from "lodash-es";
5
- import { a_ as P, a$ as E, b0 as O, b1 as S } from "./ChaiBuilderEditor-yf2LRjL1.js";
3
+ import b from "@rjsf/validator-ajv8";
4
+ import { includes as h, get as a, set as $, first as F } from "lodash-es";
5
+ import { a$ as P, b0 as E, b1 as O, b2 as S } from "./ChaiBuilderEditor-1K-wcF5D.js";
6
6
  const d = (i, l = "") => {
7
7
  switch (i.type) {
8
8
  case "singular":
@@ -61,7 +61,7 @@ const d = (i, l = "") => {
61
61
  if (h(["slot", "styles"], t.type))
62
62
  return;
63
63
  const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
64
- e.items.properties[s] = y(t, l), b(e.items, "title", a(t, "itemTitle", `${r} item`));
64
+ e.items.properties[s] = y(t, l), $(e.items, "title", a(t, "itemTitle", `${r} item`));
65
65
  }), e;
66
66
  default:
67
67
  return {};
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
113
113
  uiSchema: e,
114
114
  schema: r,
115
115
  formData: c,
116
- validator: $,
116
+ validator: b,
117
117
  onChange: o,
118
118
  disabled: n
119
119
  }
@@ -1 +1 @@
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("./ChaiBuilderEditor--NV-B5az.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
+ "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("./ChaiBuilderEditor-iXQwbYNr.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=$;
@@ -20,7 +20,7 @@ import * as b from "react";
20
20
  import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
21
21
  import "./core.js";
22
22
  import { FileTextIcon as p0, GearIcon as V0, EyeClosedIcon as f0, EyeOpenIcon as m0 } from "@radix-ui/react-icons";
23
- import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-yf2LRjL1.js";
23
+ import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-1K-wcF5D.js";
24
24
  import { toast as h1, Toaster as F0 } from "sonner";
25
25
  import { useTranslation as D0 } from "react-i18next";
26
26
  import { sortBy as R0, filter as k0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
@@ -2043,7 +2043,7 @@ const k4 = () => {
2043
2043
  ] })
2044
2044
  ] })
2045
2045
  ] });
2046
- }, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-EHLY-cfj.js")), j4 = A2(() => import("./ProjectPanel-qiqyRbwH.js")), Q4 = A2(() => import("./CurrentPage-hKtVFDxU.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
2046
+ }, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-bElLBHNI.js")), j4 = A2(() => import("./ProjectPanel-o1BnitsI.js")), Q4 = A2(() => import("./CurrentPage-JjZQQ8fp.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
2047
2047
  const { mutate: a } = y4();
2048
2048
  return b0("editable", !0) ? /* @__PURE__ */ i.jsx(X2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
2049
2049
  }, q4 = (a) => {