@chaibuilder/sdk 1.2.18 → 1.2.19
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/dist/AddBlocks-KeHVFaIr.cjs +1 -0
- package/dist/{AddBlocks-uCdu9Xpr.js → AddBlocks-gcTaEIKO.js} +5 -4
- package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
- package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-bfiFY0VR.js} +5 -4
- package/dist/{CanvasArea-oUIvLfdq.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
- package/dist/{CanvasArea-aWzbzB9p.js → CanvasArea-xvMCbQDL.js} +8 -7
- package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-0Ap2N0uc.js} +13 -12
- package/dist/CurrentPage-vj52UxMA.cjs +1 -0
- package/dist/ListTree-Vq0_s1wC.cjs +1 -0
- package/dist/ListTree-k-QMO740.js +96 -0
- package/dist/{Outline-oGoAdnBw.js → Outline-HI6-c9nf.js} +96 -92
- package/dist/Outline-fAflJ_lN.cjs +1 -0
- package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-Pk-C1956.js} +7 -6
- package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
- package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-_KQBhuPO.js} +8 -7
- package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
- package/dist/Settings-Cc9eV4VG.cjs +1 -0
- package/dist/{Settings-IhWI1ice.js → Settings-XtAatoiu.js} +5 -4
- package/dist/{SidePanels-lMCXrchR.js → SidePanels-O52zKXbH.js} +134 -133
- package/dist/SidePanels-ugRobm34.cjs +1 -0
- package/dist/Topbar-e5MGWX9n.cjs +1 -0
- package/dist/{Topbar-DYiisBtw.js → Topbar-oTx7a12r.js} +5 -4
- package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-5A21uzMK.js} +5 -4
- package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
- package/dist/UploadImages-V42YSRVO.cjs +1 -0
- package/dist/{UploadImages-06m6vjbL.js → UploadImages-V_54lCAO.js} +5 -4
- package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-dKQLw7RQ.js} +17 -16
- package/dist/add-page-modal-xMedOdsp.cjs +1 -0
- package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-8GP3bKH_.js} +5 -4
- package/dist/{confirm-alert-ZpEIxh3X.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +47 -46
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-Zb5ld6O-.js} +7 -6
- package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +79 -79
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +6 -5
- package/dist/{form-Y0Vb4m04.cjs → form-o6_55v8F.cjs} +1 -1
- package/dist/{form-2xJcQs_Y.js → form-yyU2x7So.js} +1 -1
- package/dist/{index-3TQsdso6.cjs → index-BMZLAJUV.cjs} +1 -1
- package/dist/{index-ZwpjuB-N.cjs → index-JdnF6lYP.cjs} +42 -42
- package/dist/{index-ZBqiaKhx.js → index-WP7IRkij.js} +739 -739
- package/dist/{index-627XtO9e.js → index-lFcrvDFC.js} +3 -3
- package/dist/index-thKfFhmr.cjs +1 -0
- package/dist/{index-LF3KXx4u.js → index-yILWlilS.js} +3142 -3132
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-7u0SWWmO.js → page-viewer-3QXwPGpg.js} +11 -10
- package/dist/page-viewer-DTIblLiz.cjs +1 -0
- package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-UalRmyHm.js} +8 -7
- package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
- package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-8FsvPSPl.js} +6 -5
- package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-GaB85dNv.js} +9 -8
- package/dist/single-page-detail-XdBysrE_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +6 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +140 -139
- package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
- package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
- package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
- package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
- package/dist/Outline-uMUTwN-R.cjs +0 -1
- package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
- package/dist/ProjectPanel-UIEFhref.cjs +0 -1
- package/dist/Settings-8qUW0Iow.cjs +0 -1
- package/dist/SidePanels-cOHgPE9y.cjs +0 -1
- package/dist/Topbar-vLD-rWl5.cjs +0 -1
- package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
- package/dist/UploadImages-T4MYMOhW.cjs +0 -1
- package/dist/add-page-modal-niwhffYL.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
- package/dist/index-T3wfa1kz.cjs +0 -1
- package/dist/page-viewer-6UDraUKW.cjs +0 -1
- package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
- package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
- package/dist/single-page-detail-kJUW6FE9.cjs +0 -1
package/dist/email-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),
|
|
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-Dy1qa8Dc.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.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})=>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.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==="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.u({title:"Content",default:"Enter your heading here..."}),styles:l.S({default:"text-xl"}),level:l.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=>["Email/Link","Email/RawText"].includes(e)});const B=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),C=({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: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,f=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(j,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:f,props:{content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const y=({blockProps:e,styles:t,link:o,content:r})=>i.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:r}),E=({blockProps:e,styles:t,content:o})=>i.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});s.registerChaiBlock(y,{type:"Email/Button",label:"Button",group:"basic",category:"core",builderComponent:E,props:{content:l.u({title:"Content",default:"Click me"}),link:l.q({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:"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.u({title:"Content",default:"I am a link."}),link:l.q({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 L=({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}),T=({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(L,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:T,props:{styles:l.S({default:"w-full"}),image:l.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.u({title:"Alt",default:""}),width:l.u({title:"Width",default:""}),height:l.u({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.u({title:"Theme",default:"dracula"}),lineNumbers:l.r({title:"Line number",default:!1}),language:l.f({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;
|
package/dist/email-blocks.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { noop as f } from "lodash-es";
|
|
2
|
-
import { j as
|
|
3
|
-
import { Container as k, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as
|
|
4
|
-
import { registerChaiBlock as
|
|
2
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
3
|
+
import { Container as k, 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";
|
|
4
|
+
import { registerChaiBlock as r } from "@chaibuilder/runtime";
|
|
5
5
|
import { E as m } from "./empty-slot-ZBlsQi6m.js";
|
|
6
|
-
import { f as d, S as
|
|
7
|
-
import { ImageIcon as p, HeadingIcon as
|
|
6
|
+
import { f as d, S as a, u as s, g as u, q as g, o as _, r as A } from "./controls-XPXGHKht.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";
|
|
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
|
|
14
|
-
let
|
|
15
|
-
return
|
|
13
|
+
const M = ({ blockProps: e, styles: t, children: l, inBuilder: i }) => {
|
|
14
|
+
let n = l;
|
|
15
|
+
return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {}, inBuilder: i })), /* @__PURE__ */ o.jsx(k, { ...e, ...t, children: n });
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
type: "Container",
|
|
17
|
+
r(M, {
|
|
18
|
+
type: "Email/Container",
|
|
19
19
|
label: "Container",
|
|
20
20
|
group: "basic",
|
|
21
21
|
category: "core",
|
|
@@ -25,9 +25,9 @@ i(N, {
|
|
|
25
25
|
canDuplicate: () => !1,
|
|
26
26
|
canBeNested: (e) => !e
|
|
27
27
|
});
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
type: "Section",
|
|
28
|
+
const N = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(y, { ...e, ...t, children: l });
|
|
29
|
+
r(N, {
|
|
30
|
+
type: "Email/Section",
|
|
31
31
|
label: "Section",
|
|
32
32
|
group: "basic",
|
|
33
33
|
category: "core",
|
|
@@ -46,34 +46,34 @@ i(E, {
|
|
|
46
46
|
},
|
|
47
47
|
canAcceptBlock: () => !0
|
|
48
48
|
});
|
|
49
|
-
const $ = ({ blockProps: e, styles: t, children:
|
|
50
|
-
|
|
51
|
-
type: "Row",
|
|
49
|
+
const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
|
|
50
|
+
r($, {
|
|
51
|
+
type: "Email/Row",
|
|
52
52
|
label: "Row",
|
|
53
53
|
group: "basic",
|
|
54
54
|
category: "core",
|
|
55
55
|
icon: p,
|
|
56
56
|
blocks: [
|
|
57
|
-
{ _type: "Row", _id: "a" },
|
|
58
|
-
{ _type: "Column", _id: "b", _parent: "a" }
|
|
57
|
+
{ _type: "Email/Row", _id: "a" },
|
|
58
|
+
{ _type: "Email/Column", _id: "b", _parent: "a" }
|
|
59
59
|
],
|
|
60
60
|
props: {
|
|
61
|
-
styles:
|
|
61
|
+
styles: a({ default: "" })
|
|
62
62
|
},
|
|
63
|
-
canAcceptBlock: (e) => e === "Column"
|
|
63
|
+
canAcceptBlock: (e) => e === "Email/Column"
|
|
64
64
|
});
|
|
65
|
-
const q = ({ blockProps: e, styles: t, children:
|
|
66
|
-
let
|
|
67
|
-
return
|
|
65
|
+
const q = ({ blockProps: e, styles: t, children: l, align: i }) => {
|
|
66
|
+
let n = l;
|
|
67
|
+
return l || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx(B, { ...e, ...t, align: i, children: n });
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
type: "Column",
|
|
69
|
+
r(q, {
|
|
70
|
+
type: "Email/Column",
|
|
71
71
|
label: "Column",
|
|
72
72
|
group: "basic",
|
|
73
73
|
category: "core",
|
|
74
74
|
icon: p,
|
|
75
75
|
props: {
|
|
76
|
-
styles:
|
|
76
|
+
styles: a({ default: "" }),
|
|
77
77
|
align: d({
|
|
78
78
|
title: "Align",
|
|
79
79
|
default: "",
|
|
@@ -86,19 +86,19 @@ i(q, {
|
|
|
86
86
|
})
|
|
87
87
|
},
|
|
88
88
|
canAcceptBlock: () => !0,
|
|
89
|
-
canBeNested: (e) => e === "Row"
|
|
89
|
+
canBeNested: (e) => e === "Email/Row"
|
|
90
90
|
});
|
|
91
|
-
const z = ({ level: e, blockProps: t, styles:
|
|
92
|
-
|
|
93
|
-
type: "Heading",
|
|
91
|
+
const z = ({ level: e, blockProps: t, styles: l, content: i }) => /* @__PURE__ */ o.jsx(C, { as: e, ...t, ...l, children: i }), J = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("h1", { ...e, ...t, children: l });
|
|
92
|
+
r(z, {
|
|
93
|
+
type: "Email/Heading",
|
|
94
94
|
label: "Heading",
|
|
95
95
|
group: "basic",
|
|
96
96
|
category: "core",
|
|
97
|
-
icon:
|
|
97
|
+
icon: S,
|
|
98
98
|
builderComponent: J,
|
|
99
99
|
props: {
|
|
100
100
|
content: s({ title: "Content", default: "Enter your heading here..." }),
|
|
101
|
-
styles:
|
|
101
|
+
styles: a({ default: "text-xl" }),
|
|
102
102
|
level: d({
|
|
103
103
|
title: "Level",
|
|
104
104
|
default: "h1",
|
|
@@ -113,11 +113,11 @@ i(z, {
|
|
|
113
113
|
]
|
|
114
114
|
})
|
|
115
115
|
},
|
|
116
|
-
canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
|
|
116
|
+
canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
|
|
117
117
|
});
|
|
118
|
-
const U = ({ blockProps: e, styles: t, content:
|
|
119
|
-
|
|
120
|
-
type: "Text",
|
|
118
|
+
const U = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx(v, { ...e, ...t, children: l }), V = ({ content: e, blockProps: t, styles: l }) => /* @__PURE__ */ o.jsx("p", { ...t, ...l, children: e });
|
|
119
|
+
r(U, {
|
|
120
|
+
type: "Email/Text",
|
|
121
121
|
label: "Text",
|
|
122
122
|
group: "basic",
|
|
123
123
|
category: "core",
|
|
@@ -128,13 +128,13 @@ i(U, {
|
|
|
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
|
}),
|
|
131
|
-
styles:
|
|
131
|
+
styles: a({ default: "" })
|
|
132
132
|
},
|
|
133
|
-
canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
|
|
133
|
+
canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
|
|
134
134
|
});
|
|
135
|
-
const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
type: "RawText",
|
|
135
|
+
const W = ({ content: e }) => e, F = ({ content: e, blockProps: t }) => /* @__PURE__ */ o.jsx("span", { ...t, children: e });
|
|
136
|
+
r(W, {
|
|
137
|
+
type: "Email/RawText",
|
|
138
138
|
label: "Raw Text",
|
|
139
139
|
group: "basic",
|
|
140
140
|
category: "core",
|
|
@@ -148,9 +148,9 @@ i(W, {
|
|
|
148
148
|
})
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
-
const G = ({ blockProps: e, styles: t, link:
|
|
152
|
-
|
|
153
|
-
type: "Button",
|
|
151
|
+
const G = ({ blockProps: e, styles: t, link: l, content: i }) => /* @__PURE__ */ o.jsx(j, { ...e, ...t, href: l.href, children: i }), K = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("button", { type: "button", ...e, ...t, children: l });
|
|
152
|
+
r(G, {
|
|
153
|
+
type: "Email/Button",
|
|
154
154
|
label: "Button",
|
|
155
155
|
group: "basic",
|
|
156
156
|
category: "core",
|
|
@@ -158,19 +158,19 @@ i(G, {
|
|
|
158
158
|
props: {
|
|
159
159
|
content: s({ title: "Content", default: "Click me" }),
|
|
160
160
|
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
161
|
-
styles:
|
|
161
|
+
styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
const O = ({ blockProps: e, styles: t, href:
|
|
165
|
-
let
|
|
166
|
-
return
|
|
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
|
+
let n = i;
|
|
166
|
+
return i || (n = /* @__PURE__ */ o.jsx(m, { blockProps: {}, styles: {} })), /* @__PURE__ */ o.jsx("span", { ...e, ...t, children: n || l });
|
|
167
167
|
};
|
|
168
|
-
|
|
168
|
+
r(O, {
|
|
169
169
|
type: "Link",
|
|
170
170
|
label: "Link",
|
|
171
171
|
group: "basic",
|
|
172
172
|
category: "core",
|
|
173
|
-
icon:
|
|
173
|
+
icon: P,
|
|
174
174
|
blocks: [
|
|
175
175
|
{
|
|
176
176
|
_id: "a",
|
|
@@ -187,13 +187,13 @@ i(O, {
|
|
|
187
187
|
props: {
|
|
188
188
|
content: s({ title: "Content", default: "I am a link." }),
|
|
189
189
|
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
190
|
-
styles:
|
|
190
|
+
styles: a({ default: "font-bold text-blue-500" })
|
|
191
191
|
},
|
|
192
192
|
canAcceptBlock: () => !0
|
|
193
193
|
});
|
|
194
|
-
const X = ({ blockProps: e, styles: t, children:
|
|
195
|
-
|
|
196
|
-
type: "Preview",
|
|
194
|
+
const X = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(E, { ...e, ...t, children: l }), Y = ({ blockProps: e, styles: t, content: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: l });
|
|
195
|
+
r(X, {
|
|
196
|
+
type: "Email/Preview",
|
|
197
197
|
label: "Preview",
|
|
198
198
|
group: "basic",
|
|
199
199
|
category: "core",
|
|
@@ -204,9 +204,9 @@ i(X, {
|
|
|
204
204
|
content: u({ default: "Preview content", title: "Content" })
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
-
const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */
|
|
208
|
-
|
|
209
|
-
type: "Markdown",
|
|
207
|
+
const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
|
|
208
|
+
r(Z, {
|
|
209
|
+
type: "Email/Markdown",
|
|
210
210
|
label: "Markdown",
|
|
211
211
|
group: "basic",
|
|
212
212
|
category: "core",
|
|
@@ -214,17 +214,17 @@ i(Z, {
|
|
|
214
214
|
content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
|
-
const ee = ({ blockProps: e, styles: t, alt:
|
|
218
|
-
|
|
219
|
-
type: "Image",
|
|
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 });
|
|
218
|
+
r(ee, {
|
|
219
|
+
type: "Email/Image",
|
|
220
220
|
label: "Image",
|
|
221
221
|
group: "basic",
|
|
222
222
|
category: "core",
|
|
223
223
|
icon: p,
|
|
224
224
|
builderComponent: te,
|
|
225
225
|
props: {
|
|
226
|
-
styles:
|
|
227
|
-
image:
|
|
226
|
+
styles: a({ default: "w-full" }),
|
|
227
|
+
image: _({
|
|
228
228
|
title: "Image",
|
|
229
229
|
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
230
230
|
}),
|
|
@@ -233,32 +233,32 @@ i(ee, {
|
|
|
233
233
|
height: s({ title: "Height", default: "" })
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
type: "Divider",
|
|
236
|
+
const le = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ o.jsx("hr", { ...e, ...t });
|
|
237
|
+
r(le, {
|
|
238
|
+
type: "Email/Divider",
|
|
239
239
|
label: "Divider",
|
|
240
240
|
group: "basic",
|
|
241
241
|
category: "core",
|
|
242
|
-
icon:
|
|
243
|
-
builderComponent:
|
|
242
|
+
icon: D,
|
|
243
|
+
builderComponent: oe,
|
|
244
244
|
props: {
|
|
245
|
-
styles:
|
|
245
|
+
styles: a({ default: "w-full h-2" })
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
type: "CodeBlock",
|
|
248
|
+
const ie = ({ blockProps: e, styles: t, code: l, lineNumbers: i, theme: n, language: c }) => /* @__PURE__ */ o.jsx(H, { ...e, ...t, code: l, linenumbers: i, theme: n, language: c }), ne = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("div", { ...e, ...t, children: /* @__PURE__ */ o.jsx("code", { children: l }) });
|
|
249
|
+
r(ie, {
|
|
250
|
+
type: "Email/CodeBlock",
|
|
251
251
|
label: "Code Block",
|
|
252
252
|
group: "basic",
|
|
253
253
|
category: "core",
|
|
254
254
|
hidden: !0,
|
|
255
255
|
icon: b,
|
|
256
|
-
builderComponent:
|
|
256
|
+
builderComponent: ne,
|
|
257
257
|
props: {
|
|
258
|
-
styles:
|
|
258
|
+
styles: a({ default: "" }),
|
|
259
259
|
code: u({ title: "Code", default: "console.log('Hello, world!');" }),
|
|
260
260
|
theme: s({ title: "Theme", default: "dracula" }),
|
|
261
|
-
lineNumbers:
|
|
261
|
+
lineNumbers: A({
|
|
262
262
|
title: "Line number",
|
|
263
263
|
default: !1
|
|
264
264
|
}),
|
|
@@ -275,16 +275,16 @@ i(ne, {
|
|
|
275
275
|
})
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
type: "CodeInline",
|
|
278
|
+
const re = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx(R, { ...e, ...t, children: l }), ae = ({ blockProps: e, styles: t, code: l }) => /* @__PURE__ */ o.jsx("code", { ...e, ...t, children: l });
|
|
279
|
+
r(re, {
|
|
280
|
+
type: "Email/CodeInline",
|
|
281
281
|
label: "Code Inline",
|
|
282
282
|
group: "basic",
|
|
283
283
|
category: "core",
|
|
284
284
|
icon: b,
|
|
285
|
-
builderComponent:
|
|
285
|
+
builderComponent: ae,
|
|
286
286
|
props: {
|
|
287
|
-
styles:
|
|
287
|
+
styles: a({ default: "" }),
|
|
288
288
|
code: u({ title: "Code", default: "console.log('Hello, world!');" })
|
|
289
289
|
}
|
|
290
290
|
});
|
package/dist/email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-JdnF6lYP.cjs"),r=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-thKfFhmr.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("lodash");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");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:700}],n=i=>{const u={...i,importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:t};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=n;
|
package/dist/email.d.ts
CHANGED
package/dist/email.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as m } from "./index-
|
|
2
|
+
import { C as m } from "./index-yILWlilS.js";
|
|
3
3
|
import { MobileIcon as i } from "@radix-ui/react-icons";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "i18next";
|
|
7
7
|
import "react-i18next";
|
|
8
|
-
import "./index-
|
|
8
|
+
import "./index-WP7IRkij.js";
|
|
9
9
|
import "lodash-es";
|
|
10
10
|
import "./Functions-7jnEwJyw.js";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
13
13
|
import "@chaibuilder/runtime";
|
|
14
14
|
import "jotai";
|
|
15
|
-
import "flat-to-nested";
|
|
16
15
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
17
16
|
import "@react-hookz/web";
|
|
17
|
+
import "flat-to-nested";
|
|
18
18
|
import "@radix-ui/react-toggle";
|
|
19
19
|
import "class-variance-authority";
|
|
20
20
|
import "./Class-3k8xjeiM.js";
|
|
@@ -39,6 +39,7 @@ import "@radix-ui/react-context-menu";
|
|
|
39
39
|
import "react-icons-picker";
|
|
40
40
|
import "react-dom";
|
|
41
41
|
import "react-quill";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "@floating-ui/react-dom";
|
|
43
44
|
import "react-textarea-autosize";
|
|
44
45
|
import "flagged";
|
|
@@ -60,7 +61,7 @@ const p = [
|
|
|
60
61
|
icon: /* @__PURE__ */ t.jsx(i, { className: "rotate-90" }),
|
|
61
62
|
width: 700
|
|
62
63
|
}
|
|
63
|
-
],
|
|
64
|
+
], tt = (o) => {
|
|
64
65
|
const r = {
|
|
65
66
|
...o,
|
|
66
67
|
importHTMLSupport: !1,
|
|
@@ -70,5 +71,5 @@ const p = [
|
|
|
70
71
|
return /* @__PURE__ */ t.jsx(m, { ...r });
|
|
71
72
|
};
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
tt as ChaiBuilderEmail
|
|
74
75
|
};
|
|
@@ -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("./index-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-thKfFhmr.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=$;
|
|
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import b from "@rjsf/core";
|
|
3
3
|
import x from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
-
import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-
|
|
5
|
+
import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-WP7IRkij.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|