@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.
- package/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- 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
|
|
2
|
-
import {
|
|
3
|
-
import { j as x } from "./index-
|
|
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 "./
|
|
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 "./
|
|
56
|
-
const
|
|
57
|
-
const m = {}, t = x(), o =
|
|
58
|
-
t.mutate(
|
|
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__ */
|
|
65
|
-
/* @__PURE__ */
|
|
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__ */
|
|
67
|
+
children: /* @__PURE__ */ e.jsx(h, {})
|
|
70
68
|
}
|
|
71
69
|
) }),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ e.jsxs(n, { children: [
|
|
71
|
+
/* @__PURE__ */ e.jsxs(d, { children: [
|
|
74
72
|
"Are you sure you want to delete ",
|
|
75
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ e.jsx("i", { className: "text-red-500", children: r.name }),
|
|
76
74
|
" page?"
|
|
77
75
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
85
|
+
he as default
|
|
88
86
|
};
|
package/dist/email-blocks.cjs
CHANGED
|
@@ -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("./
|
|
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;
|
package/dist/email-blocks.js
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import { noop as
|
|
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
|
|
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 {
|
|
6
|
-
import { ImageIcon as p, HeadingIcon as
|
|
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
|
-
|
|
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
|
|
22
|
-
r(
|
|
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(
|
|
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:
|
|
60
|
+
styles: c({ default: "" })
|
|
52
61
|
},
|
|
53
62
|
canAcceptBlock: (e) => e === "Column"
|
|
54
63
|
});
|
|
55
|
-
const
|
|
56
|
-
|
|
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:
|
|
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
|
|
78
|
-
r(
|
|
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:
|
|
84
|
-
builderComponent:
|
|
96
|
+
icon: P,
|
|
97
|
+
builderComponent: J,
|
|
85
98
|
props: {
|
|
86
|
-
content:
|
|
87
|
-
styles:
|
|
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
|
|
105
|
-
r(
|
|
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:
|
|
111
|
-
builderComponent:
|
|
123
|
+
icon: h,
|
|
124
|
+
builderComponent: V,
|
|
112
125
|
props: {
|
|
113
|
-
content:
|
|
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:
|
|
130
|
+
styles: c({ default: "" })
|
|
118
131
|
},
|
|
119
132
|
canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
|
|
120
133
|
});
|
|
121
|
-
const
|
|
122
|
-
r(
|
|
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:
|
|
140
|
+
icon: h,
|
|
128
141
|
hidden: !0,
|
|
129
|
-
builderComponent:
|
|
142
|
+
builderComponent: F,
|
|
130
143
|
props: {
|
|
131
|
-
content:
|
|
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
|
|
138
|
-
r(
|
|
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:
|
|
156
|
+
builderComponent: K,
|
|
144
157
|
props: {
|
|
145
|
-
content:
|
|
146
|
-
link:
|
|
147
|
-
styles:
|
|
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
|
|
151
|
-
|
|
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:
|
|
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:
|
|
185
|
+
builderComponent: Q,
|
|
170
186
|
props: {
|
|
171
|
-
content:
|
|
172
|
-
link:
|
|
173
|
-
styles:
|
|
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
|
|
178
|
-
r(
|
|
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:
|
|
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
|
|
188
|
-
r(
|
|
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:
|
|
213
|
+
content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
|
|
195
214
|
}
|
|
196
215
|
});
|
|
197
|
-
const
|
|
198
|
-
r(
|
|
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:
|
|
223
|
+
builderComponent: te,
|
|
205
224
|
props: {
|
|
206
|
-
styles:
|
|
207
|
-
image:
|
|
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:
|
|
212
|
-
width:
|
|
213
|
-
height:
|
|
230
|
+
alt: s({ title: "Alt", default: "" }),
|
|
231
|
+
width: s({ title: "Width", default: "" }),
|
|
232
|
+
height: s({ title: "Height", default: "" })
|
|
214
233
|
}
|
|
215
234
|
});
|
|
216
|
-
const
|
|
217
|
-
r(
|
|
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:
|
|
241
|
+
icon: M,
|
|
242
|
+
builderComponent: le,
|
|
224
243
|
props: {
|
|
225
|
-
styles:
|
|
244
|
+
styles: c({ default: "w-full h-2" })
|
|
226
245
|
}
|
|
227
246
|
});
|
|
228
|
-
const
|
|
229
|
-
r(
|
|
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:
|
|
236
|
-
builderComponent:
|
|
254
|
+
icon: b,
|
|
255
|
+
builderComponent: re,
|
|
237
256
|
props: {
|
|
238
|
-
styles:
|
|
239
|
-
code:
|
|
240
|
-
theme:
|
|
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
|
|
259
|
-
r(
|
|
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:
|
|
265
|
-
builderComponent:
|
|
283
|
+
icon: b,
|
|
284
|
+
builderComponent: ce,
|
|
266
285
|
props: {
|
|
267
|
-
styles:
|
|
268
|
-
code:
|
|
286
|
+
styles: c({ default: "" }),
|
|
287
|
+
code: u({ title: "Code", default: "console.log('Hello, world!');" })
|
|
269
288
|
}
|
|
270
289
|
});
|
|
271
|
-
const
|
|
290
|
+
const ye = k;
|
|
272
291
|
export {
|
|
273
|
-
|
|
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;
|
package/dist/email.d.ts
ADDED
|
@@ -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 { }
|