@chaibuilder/sdk 1.2.25 → 1.2.26
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-l1JENNvq.js +206 -0
- package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
- package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
- package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
- package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
- package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
- package/dist/Class-PoYusiA5.cjs +1 -0
- package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
- package/dist/CurrentPage-Hl52iub_.cjs +1 -0
- package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/ListTree-WvTjY5rr.cjs +1 -0
- package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
- package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
- package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
- package/dist/PagesPanel-6rrLXEO-.js +64 -0
- package/dist/PagesPanel-WzCocl6u.cjs +1 -0
- package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
- package/dist/ProjectPanel-tz3bjdXy.js +85 -0
- package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
- package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
- package/dist/Settings-AqoKwR92.cjs +1 -0
- package/dist/SidePanels-3o6Okmvu.cjs +1 -0
- package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
- package/dist/Topbar-CqW7G360.cjs +1 -0
- package/dist/Topbar-pWzBEOed.js +132 -0
- package/dist/UnsplashImages-NGskB93R.cjs +1 -0
- package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
- package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
- package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/add-page-modal--6TTBRYa.cjs +1 -0
- package/dist/add-page-modal-k2Kb92HS.js +104 -0
- package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
- package/dist/confirm-alert-GUhZ_G8w.js +60 -0
- package/dist/controls-KK2oLIa8.cjs +1 -0
- package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
- package/dist/core.cjs +1 -1
- package/dist/core.js +75 -150
- package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
- package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
- package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
- package/dist/delete-page-modal-zONvdebd.js +83 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +292 -3
- package/dist/email.cjs +1 -1
- package/dist/email.js +37 -18
- package/dist/empty-slot-ZBlsQi6m.js +15 -0
- package/dist/empty-slot-nzYOgZuS.cjs +1 -0
- package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
- package/dist/form-lBQ_76Uw.cjs +1 -0
- package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
- package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
- package/dist/index-Gk6sASBd.js +3080 -0
- package/dist/index-OB199Izc.cjs +206 -0
- package/dist/index-SkyM3d6Q.js +39503 -0
- package/dist/index-YpnaudSM.js +63 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-ecnGWzh9.cjs +1 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/index-h-hd6EvN.cjs +1 -0
- package/dist/index-llTXLDGE.js +2201 -0
- package/dist/index-mbyqq81O.cjs +1 -0
- package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
- package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.js +66 -62
- package/dist/page-viewer-2kwnKM6v.cjs +1 -0
- package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
- package/dist/project-general-setting-CnNL98NM.cjs +1 -0
- package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
- package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
- package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
- package/dist/render.cjs +1 -1
- package/dist/render.js +14 -13
- package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
- package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +40 -24
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +160 -365
- package/dist/web-blocks.cjs +6 -1
- package/dist/web-blocks.js +1153 -3
- package/package.json +1 -1
- package/dist/AddBlocks-Ol3iIVKa.js +0 -207
- package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
- package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
- package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
- package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
- package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
- package/dist/Class-eieto7e-.cjs +0 -1
- package/dist/Controls-3Cc1XYXg.js +0 -105
- package/dist/Controls-ky25Ebo3.cjs +0 -1
- package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
- package/dist/Functions-Hvon6AMZ.cjs +0 -1
- package/dist/Functions-NzT2Six_.js +0 -15
- package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
- package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
- package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
- package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
- package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
- package/dist/PagesPanel-u1IB-nRr.js +0 -48
- package/dist/ProjectPanel-EydGZmMW.js +0 -71
- package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
- package/dist/Settings-8ilCSH8b.cjs +0 -1
- package/dist/SidePanels-T36C6Lhc.cjs +0 -1
- package/dist/Topbar-CvWQuspR.cjs +0 -1
- package/dist/Topbar-pbIDUE_B.js +0 -122
- package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
- package/dist/UploadImages-GkkJVAgG.cjs +0 -1
- package/dist/accordion-oPUeqPCZ.js +0 -42
- package/dist/accordion-ynvFtV_p.cjs +0 -1
- package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
- package/dist/add-page-modal-JCDXZIPW.js +0 -95
- package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
- package/dist/alert-dialog-rypfO5ly.js +0 -64
- package/dist/badge-E-S7CqUt.cjs +0 -1
- package/dist/badge-tEwO7C51.js +0 -23
- package/dist/block-helpers-OKHmRRol.cjs +0 -1
- package/dist/block-helpers-oSFpSsGz.js +0 -23
- package/dist/command-BxR6jaCI.cjs +0 -1
- package/dist/command-Pn3HKDuV.js +0 -97
- package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
- package/dist/confirm-alert-wR5_VJ1l.js +0 -36
- package/dist/context-menu-8dC9uGXj.js +0 -122
- package/dist/context-menu-IgLbIuth.cjs +0 -1
- package/dist/controls-L7DPvB0m.cjs +0 -1
- package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
- package/dist/delete-page-modal-7KmP1elv.js +0 -67
- package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
- package/dist/dropdown-menu-El86_9Uo.js +0 -124
- package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
- package/dist/form-W58AVUdf.cjs +0 -1
- package/dist/hover-card-KUwpDkW8.cjs +0 -1
- package/dist/hover-card-q138xxXR.js +0 -45
- package/dist/iconBase-gbUAAO2L.cjs +0 -1
- package/dist/iconBase-h4DuR_XT.js +0 -63
- package/dist/index-9MmykVSc.cjs +0 -1
- package/dist/index-hElOGcFr.js +0 -2200
- package/dist/index-lDTsQp7h.js +0 -188
- package/dist/index-rq5Y9ZDy.cjs +0 -1
- package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
- package/dist/label-KaP7MRrs.js +0 -10
- package/dist/label-tFm8HZdb.cjs +0 -1
- package/dist/link-WbcKdQ9k.cjs +0 -1
- package/dist/link-xuhP-4dN.js +0 -196
- package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
- package/dist/popover-a84pbVhQ.js +0 -23
- package/dist/popover-fKjgcRUx.cjs +0 -1
- package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
- package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
- package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
- package/dist/scroll-area-ewXbxc3n.js +0 -30
- package/dist/select-7bjg-rr9.cjs +0 -1
- package/dist/select-POGdEDHT.js +0 -75
- package/dist/separator-3Civ-6hb.cjs +0 -1
- package/dist/separator-SctTn0Qi.js +0 -18
- package/dist/single-page-detail-beY0MT1b.cjs +0 -1
- package/dist/skeleton-STeL9VrJ.cjs +0 -1
- package/dist/skeleton-lu8e7q2y.js +0 -239
- package/dist/tabs-_4WbA1cc.cjs +0 -1
- package/dist/tabs-yQ3oGziM.js +0 -106
- package/dist/textarea-1kZEh7ki.cjs +0 -1
- package/dist/textarea-b2QvVhrK.js +0 -73
- package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
- package/dist/useAddBlock-FEKFJNwQ.js +0 -69
- package/dist/useChaiExternalData-fkFgoS80.js +0 -6
- package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
- package/dist/useDarkMode-7i57segK.cjs +0 -1
- package/dist/useDarkMode-8VHJlYyE.js +0 -23
- package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
- package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
- package/dist/useStylingState-Iuj84yvc.js +0 -186
- package/dist/useStylingState-OIvJMV6p.cjs +0 -1
- package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
- package/dist/useUiLibraries-psyWFbNc.js +0 -12
- package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
- package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
- package/dist/utils-dze1SGvB.js +0 -6
- package/dist/utils-qK_SjzzV.cjs +0 -1
package/dist/email-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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-KK2oLIa8.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.s({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.s({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.s({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,y=({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: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(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.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.s({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,5 +1,294 @@
|
|
|
1
|
-
import { noop as
|
|
2
|
-
|
|
1
|
+
import { noop as k } from "lodash-es";
|
|
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";
|
|
4
|
+
import { registerChaiBlock as r } from "@chaibuilder/runtime";
|
|
5
|
+
import { E as m } from "./empty-slot-ZBlsQi6m.js";
|
|
6
|
+
import { s as d, S as a, u as s, g as u, q as g, o as _, r as A } from "./controls-OfJWSEqC.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
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "./Functions-7jnEwJyw.js";
|
|
11
|
+
import "clsx";
|
|
12
|
+
import "tailwind-merge";
|
|
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(f, { ...e, ...t, children: n });
|
|
16
|
+
};
|
|
17
|
+
r(M, {
|
|
18
|
+
type: "Email/Container",
|
|
19
|
+
label: "Container",
|
|
20
|
+
group: "basic",
|
|
21
|
+
category: "core",
|
|
22
|
+
canAcceptBlock: () => !0,
|
|
23
|
+
canMove: () => !0,
|
|
24
|
+
canDelete: () => !1,
|
|
25
|
+
canDuplicate: () => !1,
|
|
26
|
+
canBeNested: (e) => !e
|
|
27
|
+
});
|
|
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
|
+
label: "Section",
|
|
32
|
+
group: "basic",
|
|
33
|
+
category: "core",
|
|
34
|
+
icon: p,
|
|
35
|
+
props: {
|
|
36
|
+
align: d({
|
|
37
|
+
title: "Align",
|
|
38
|
+
default: "",
|
|
39
|
+
options: [
|
|
40
|
+
{ value: "", title: "None" },
|
|
41
|
+
{ value: "left", title: "left" },
|
|
42
|
+
{ value: "center", title: "center" },
|
|
43
|
+
{ value: "right", title: "right" }
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
canAcceptBlock: () => !0
|
|
48
|
+
});
|
|
49
|
+
const $ = ({ blockProps: e, styles: t, children: l }) => /* @__PURE__ */ o.jsx(x, { ...e, ...t, children: l });
|
|
50
|
+
r($, {
|
|
51
|
+
type: "Email/Row",
|
|
52
|
+
label: "Row",
|
|
53
|
+
group: "basic",
|
|
54
|
+
category: "core",
|
|
55
|
+
icon: p,
|
|
56
|
+
blocks: [
|
|
57
|
+
{ _type: "Email/Row", _id: "a" },
|
|
58
|
+
{ _type: "Email/Column", _id: "b", _parent: "a" }
|
|
59
|
+
],
|
|
60
|
+
props: {
|
|
61
|
+
styles: a({ default: "" })
|
|
62
|
+
},
|
|
63
|
+
canAcceptBlock: (e) => e === "Email/Column"
|
|
64
|
+
});
|
|
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
|
+
};
|
|
69
|
+
r(q, {
|
|
70
|
+
type: "Email/Column",
|
|
71
|
+
label: "Column",
|
|
72
|
+
group: "basic",
|
|
73
|
+
category: "core",
|
|
74
|
+
icon: p,
|
|
75
|
+
props: {
|
|
76
|
+
styles: a({ default: "" }),
|
|
77
|
+
align: d({
|
|
78
|
+
title: "Align",
|
|
79
|
+
default: "",
|
|
80
|
+
options: [
|
|
81
|
+
{ value: "", title: "None" },
|
|
82
|
+
{ value: "left", title: "left" },
|
|
83
|
+
{ value: "center", title: "center" },
|
|
84
|
+
{ value: "right", title: "right" }
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
canAcceptBlock: () => !0,
|
|
89
|
+
canBeNested: (e) => e === "Email/Row"
|
|
90
|
+
});
|
|
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
|
+
label: "Heading",
|
|
95
|
+
group: "basic",
|
|
96
|
+
category: "core",
|
|
97
|
+
icon: S,
|
|
98
|
+
builderComponent: J,
|
|
99
|
+
props: {
|
|
100
|
+
content: s({ title: "Content", default: "Enter your heading here..." }),
|
|
101
|
+
styles: a({ default: "text-xl" }),
|
|
102
|
+
level: d({
|
|
103
|
+
title: "Level",
|
|
104
|
+
default: "h1",
|
|
105
|
+
binding: !1,
|
|
106
|
+
options: [
|
|
107
|
+
{ value: "h1", title: "h1" },
|
|
108
|
+
{ value: "h2", title: "h2" },
|
|
109
|
+
{ value: "h3", title: "h3" },
|
|
110
|
+
{ value: "h4", title: "h4" },
|
|
111
|
+
{ value: "h5", title: "h5" },
|
|
112
|
+
{ value: "h6", title: "h6" }
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
},
|
|
116
|
+
canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
|
|
117
|
+
});
|
|
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
|
+
label: "Text",
|
|
122
|
+
group: "basic",
|
|
123
|
+
category: "core",
|
|
124
|
+
icon: h,
|
|
125
|
+
builderComponent: V,
|
|
126
|
+
props: {
|
|
127
|
+
content: u({
|
|
128
|
+
title: "Content",
|
|
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
|
+
}),
|
|
131
|
+
styles: a({ default: "" })
|
|
132
|
+
},
|
|
133
|
+
canAcceptBlock: (e) => ["Email/Link", "Email/RawText"].includes(e)
|
|
134
|
+
});
|
|
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
|
+
label: "Raw Text",
|
|
139
|
+
group: "basic",
|
|
140
|
+
category: "core",
|
|
141
|
+
icon: h,
|
|
142
|
+
hidden: !0,
|
|
143
|
+
builderComponent: F,
|
|
144
|
+
props: {
|
|
145
|
+
content: u({
|
|
146
|
+
title: "Content",
|
|
147
|
+
default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
});
|
|
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
|
+
label: "Button",
|
|
155
|
+
group: "basic",
|
|
156
|
+
category: "core",
|
|
157
|
+
builderComponent: K,
|
|
158
|
+
props: {
|
|
159
|
+
content: s({ title: "Content", default: "Click me" }),
|
|
160
|
+
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
161
|
+
styles: a({ default: "bg-primary text-white px-4 py-2 rounded-md" })
|
|
162
|
+
}
|
|
163
|
+
});
|
|
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
|
+
};
|
|
168
|
+
r(O, {
|
|
169
|
+
type: "Link",
|
|
170
|
+
label: "Link",
|
|
171
|
+
group: "basic",
|
|
172
|
+
category: "core",
|
|
173
|
+
icon: P,
|
|
174
|
+
blocks: [
|
|
175
|
+
{
|
|
176
|
+
_id: "a",
|
|
177
|
+
_type: "Link"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
_id: "b",
|
|
181
|
+
_parent: "a",
|
|
182
|
+
_type: "RawText",
|
|
183
|
+
content: "I am a link."
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
builderComponent: Q,
|
|
187
|
+
props: {
|
|
188
|
+
content: s({ title: "Content", default: "I am a link." }),
|
|
189
|
+
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
190
|
+
styles: a({ default: "font-bold text-blue-500" })
|
|
191
|
+
},
|
|
192
|
+
canAcceptBlock: () => !0
|
|
193
|
+
});
|
|
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
|
+
label: "Preview",
|
|
198
|
+
group: "basic",
|
|
199
|
+
category: "core",
|
|
200
|
+
builderComponent: Y,
|
|
201
|
+
canAcceptBlock: () => !0,
|
|
202
|
+
canDuplicate: () => !1,
|
|
203
|
+
props: {
|
|
204
|
+
content: u({ default: "Preview content", title: "Content" })
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const Z = ({ blockProps: e, content: t }) => /* @__PURE__ */ o.jsx(I, { children: t, ...e });
|
|
208
|
+
r(Z, {
|
|
209
|
+
type: "Email/Markdown",
|
|
210
|
+
label: "Markdown",
|
|
211
|
+
group: "basic",
|
|
212
|
+
category: "core",
|
|
213
|
+
props: {
|
|
214
|
+
content: u({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
|
|
215
|
+
}
|
|
216
|
+
});
|
|
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
|
+
label: "Image",
|
|
221
|
+
group: "basic",
|
|
222
|
+
category: "core",
|
|
223
|
+
icon: p,
|
|
224
|
+
builderComponent: te,
|
|
225
|
+
props: {
|
|
226
|
+
styles: a({ default: "w-full" }),
|
|
227
|
+
image: _({
|
|
228
|
+
title: "Image",
|
|
229
|
+
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
230
|
+
}),
|
|
231
|
+
alt: s({ title: "Alt", default: "" }),
|
|
232
|
+
width: s({ title: "Width", default: "" }),
|
|
233
|
+
height: s({ title: "Height", default: "" })
|
|
234
|
+
}
|
|
235
|
+
});
|
|
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
|
+
label: "Divider",
|
|
240
|
+
group: "basic",
|
|
241
|
+
category: "core",
|
|
242
|
+
icon: D,
|
|
243
|
+
builderComponent: oe,
|
|
244
|
+
props: {
|
|
245
|
+
styles: a({ default: "w-full h-2" })
|
|
246
|
+
}
|
|
247
|
+
});
|
|
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
|
+
label: "Code Block",
|
|
252
|
+
group: "basic",
|
|
253
|
+
category: "core",
|
|
254
|
+
hidden: !0,
|
|
255
|
+
icon: b,
|
|
256
|
+
builderComponent: ne,
|
|
257
|
+
props: {
|
|
258
|
+
styles: a({ default: "" }),
|
|
259
|
+
code: u({ title: "Code", default: "console.log('Hello, world!');" }),
|
|
260
|
+
theme: s({ title: "Theme", default: "dracula" }),
|
|
261
|
+
lineNumbers: A({
|
|
262
|
+
title: "Line number",
|
|
263
|
+
default: !1
|
|
264
|
+
}),
|
|
265
|
+
language: d({
|
|
266
|
+
title: "Language",
|
|
267
|
+
default: "javascript",
|
|
268
|
+
binding: !1,
|
|
269
|
+
options: [
|
|
270
|
+
{ value: "javascript", title: "JavaScript" },
|
|
271
|
+
{ value: "html", title: "HTML" },
|
|
272
|
+
{ value: "css", title: "CSS" }
|
|
273
|
+
//add more options
|
|
274
|
+
]
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
});
|
|
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
|
+
label: "Code Inline",
|
|
282
|
+
group: "basic",
|
|
283
|
+
category: "core",
|
|
284
|
+
icon: b,
|
|
285
|
+
builderComponent: ae,
|
|
286
|
+
props: {
|
|
287
|
+
styles: a({ default: "" }),
|
|
288
|
+
code: u({ title: "Code", default: "console.log('Hello, world!');" })
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
const xe = k;
|
|
3
292
|
export {
|
|
4
|
-
|
|
293
|
+
xe as loadEmailBlocks
|
|
5
294
|
};
|
package/dist/email.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),q=require("./index-OB199Izc.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-h-hd6EvN.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-0g14w5RS.cjs");require("./Class-PoYusiA5.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-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("flagged");require("react-hotkeys-hook");const n=[{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=>o.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:n};return e.jsxRuntimeExports.jsx(q.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
|
package/dist/email.js
CHANGED
|
@@ -1,28 +1,47 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-
|
|
2
|
-
import { C as p } from "./
|
|
1
|
+
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { C as p } from "./index-SkyM3d6Q.js";
|
|
3
3
|
import { MobileIcon as t } from "@radix-ui/react-icons";
|
|
4
4
|
import { includes as e } from "lodash-es";
|
|
5
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import "./MODIFIERS-CNqNUapY.js";
|
|
7
|
-
import "clsx";
|
|
8
|
-
import "@radix-ui/react-scroll-area";
|
|
9
|
-
import "react-dom";
|
|
10
|
-
import "@floating-ui/react-dom";
|
|
11
|
-
import "jotai";
|
|
12
7
|
import "i18next";
|
|
13
8
|
import "react-i18next";
|
|
14
|
-
import "
|
|
15
|
-
import "./
|
|
16
|
-
import "
|
|
17
|
-
import "class-variance-authority";
|
|
18
|
-
import "./utils-dze1SGvB.js";
|
|
9
|
+
import "./index-Gk6sASBd.js";
|
|
10
|
+
import "./Functions-7jnEwJyw.js";
|
|
11
|
+
import "clsx";
|
|
19
12
|
import "tailwind-merge";
|
|
13
|
+
import "@chaibuilder/runtime";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "./STRINGS--j49GZJP.js";
|
|
16
|
+
import "@react-hookz/web";
|
|
17
|
+
import "./MODIFIERS-dytZ-osO.js";
|
|
18
|
+
import "./Class-lGzsNBOK.js";
|
|
19
|
+
import "@radix-ui/react-toggle";
|
|
20
|
+
import "class-variance-authority";
|
|
21
|
+
import "@radix-ui/react-switch";
|
|
22
|
+
import "@radix-ui/react-slot";
|
|
23
|
+
import "@radix-ui/react-accordion";
|
|
24
|
+
import "@radix-ui/react-alert-dialog";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "@radix-ui/react-label";
|
|
27
|
+
import "@radix-ui/react-scroll-area";
|
|
28
|
+
import "@radix-ui/react-tabs";
|
|
20
29
|
import "@radix-ui/react-tooltip";
|
|
30
|
+
import "@radix-ui/react-popover";
|
|
31
|
+
import "@radix-ui/react-menubar";
|
|
32
|
+
import "@radix-ui/react-hover-card";
|
|
33
|
+
import "@radix-ui/react-select";
|
|
34
|
+
import "@radix-ui/react-dropdown-menu";
|
|
35
|
+
import "@radix-ui/react-separator";
|
|
21
36
|
import "@radix-ui/react-toast";
|
|
22
|
-
import "
|
|
37
|
+
import "cmdk";
|
|
38
|
+
import "@radix-ui/react-context-menu";
|
|
39
|
+
import "react-icons-picker";
|
|
40
|
+
import "react-dom";
|
|
41
|
+
import "react-quill";
|
|
42
|
+
import "@floating-ui/react-dom";
|
|
43
|
+
import "flagged";
|
|
23
44
|
import "react-hotkeys-hook";
|
|
24
|
-
import "@react-hookz/web";
|
|
25
|
-
import "@chaibuilder/runtime";
|
|
26
45
|
const n = [
|
|
27
46
|
{
|
|
28
47
|
title: "Mobile",
|
|
@@ -38,7 +57,7 @@ const n = [
|
|
|
38
57
|
icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
|
|
39
58
|
width: 700
|
|
40
59
|
}
|
|
41
|
-
],
|
|
60
|
+
], _ = (o) => {
|
|
42
61
|
const r = {
|
|
43
62
|
...o,
|
|
44
63
|
filterChaiBlock: (m) => e(m.type, "Email/"),
|
|
@@ -49,5 +68,5 @@ const n = [
|
|
|
49
68
|
return /* @__PURE__ */ i.jsx(p, { ...r });
|
|
50
69
|
};
|
|
51
70
|
export {
|
|
52
|
-
|
|
71
|
+
_ as ChaiBuilderEmail
|
|
53
72
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { omit as r } from "lodash-es";
|
|
3
|
+
import { c as o } from "./Functions-7jnEwJyw.js";
|
|
4
|
+
const c = ({ blockProps: t, className: s = "", styles: l = {}, inBuilder: i }) => i ? /* @__PURE__ */ e.jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
...t,
|
|
8
|
+
className: o("flex h-20 flex-col items-center justify-center", s),
|
|
9
|
+
...r(l, ["className"]),
|
|
10
|
+
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", children: /* @__PURE__ */ e.jsx("span", { className: "opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400" }) })
|
|
11
|
+
}
|
|
12
|
+
) : null;
|
|
13
|
+
export {
|
|
14
|
+
c as E
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-Z_BpKhVy.cjs"),l=require("lodash-es"),r=require("./Functions-N3yhPYKY.cjs"),o=({blockProps:t,className:s="",styles:n={},inBuilder:i})=>i?e.jsxRuntimeExports.jsx("div",{...t,className:r.cn("flex h-20 flex-col items-center justify-center",s),...l.omit(n,["className"]),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",children:e.jsxRuntimeExports.jsx("span",{className:"opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400"})})}):null;exports.EmptySlot=o;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as u } from "./jsx-runtime-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { includes as h, get as a, set as
|
|
5
|
-
import {
|
|
1
|
+
import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import b from "@rjsf/core";
|
|
3
|
+
import x from "@rjsf/validator-ajv8";
|
|
4
|
+
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
+
import { b5 as P, b6 as E, b7 as O, b8 as S } from "./index-Gk6sASBd.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -61,12 +61,12 @@ 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),
|
|
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 {};
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, C = ({
|
|
70
70
|
title: i,
|
|
71
71
|
properties: l = {},
|
|
72
72
|
formData: c,
|
|
@@ -89,16 +89,16 @@ const d = (i, l = "") => {
|
|
|
89
89
|
const f = s == null ? void 0 : s.replace("root.", "").split("/").pop();
|
|
90
90
|
if (!s || !f)
|
|
91
91
|
return;
|
|
92
|
-
const j =
|
|
92
|
+
const j = F(f.split("."));
|
|
93
93
|
s && j && m({ ...t }, j);
|
|
94
94
|
};
|
|
95
95
|
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
96
96
|
i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
|
|
97
97
|
/* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
|
|
98
|
-
|
|
98
|
+
b,
|
|
99
99
|
{
|
|
100
100
|
widgets: {
|
|
101
|
-
richtext:
|
|
101
|
+
richtext: P,
|
|
102
102
|
icon: E,
|
|
103
103
|
image: O
|
|
104
104
|
},
|
|
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
|
|
|
113
113
|
uiSchema: e,
|
|
114
114
|
schema: r,
|
|
115
115
|
formData: c,
|
|
116
|
-
validator:
|
|
116
|
+
validator: x,
|
|
117
117
|
onChange: o,
|
|
118
118
|
disabled: n
|
|
119
119
|
}
|
|
@@ -121,5 +121,5 @@ const d = (i, l = "") => {
|
|
|
121
121
|
] });
|
|
122
122
|
};
|
|
123
123
|
export {
|
|
124
|
-
|
|
124
|
+
C as F
|
|
125
125
|
};
|
|
@@ -0,0 +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-h-hd6EvN.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 +1 @@
|
|
|
1
|
-
"use strict";const u=require("himalaya"),p=require("./Functions-
|
|
1
|
+
"use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),e=require("lodash-es"),o=require("./STRINGS-gPz7CUOk.cjs"),T=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,r=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||r.test(t)},v=t=>{if(e.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(s),l=t.match(r),i=a?a[1]:l?l[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(c.test(i)||n.test(i))?i:t},w={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},x=(t,s)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],s._type),m=t=>t.map(s=>s.type==="text"?e.get(s,"content",""):e.isEmpty(s.children)?"":m(s.children)).join(""),g=t=>t===null?!0:t,y=t=>{if(t.tagName==="svg")return{};const s={},r=w[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:i})=>{if(r[l]){if(t.tagName==="img"&&l==="src"&&!i.startsWith("http")){const c=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});c&&n?i=`https://via.placeholder.com/${c==null?void 0:c.value}x${n==null?void 0:n.value}`:i="https://via.placeholder.com/150x150"}e.set(s,r[l],g(i))}else e.includes(["style","class","srcset"],l)||e.set(s,`styles_attrs.${l}`,g(i))}),delete s.class,s},S=(t,s="styles")=>{if(!t.attributes)return{[s]:`${o.STYLES_KEY},`};const r=e.find(t.attributes,{key:"class"});if(r){const a=r.value;return{[s]:`${o.STYLES_KEY},${a}`}}return{[s]:`${o.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,_name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},h=(t,s=null)=>e.flatMapDeep(t,r=>{var i;if(r.type==="comment")return[];let a={_id:p.generateUUID()};if(s&&(a._parent=s.block._id),r.type==="text")return e.isEmpty(e.get(r,"content",""))?[]:s&&x(s.node,s.block)?(e.set(s,"block.content",e.get(r,"content","")),[]):{...a,_type:"Text",content:e.get(r,"content","")};if(a={...a,...L(r),...y(r),...S(r)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?e.set(a,"_type","Checkbox"):c==="radio"&&e.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const c=u.stringify([r]);return T(c)&&(e.set(a,"_type","Video"),e.set(a,"url",v(c)),e.set(a,"styles",`${o.STYLES_KEY},absolute top-0 left-0 w-full h-full`),e.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(r.tagName==="svg"){const c=e.find(r.attributes,{key:"height"}),n=e.find(r.attributes,{key:"width"}),f=e.get(c,"value")?`[${e.get(c,"value")}px]`:"24px",d=e.get(n,"value")?`[${e.get(n,"value")}px]`:"24px",b=e.get(e.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${o.STYLES_KEY}, ${p.cn(`w-${d} h-${f}`,b)}`.trim(),r.attributes=e.filter(r.attributes,_=>!e.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([r]),[a]}else if(r.tagName=="option"&&s&&((i=s.block)==null?void 0:i._type)==="Select")return s.block.options.push({label:m(r.children),...y(r)}),[];const l=h(r.children,{block:a,node:r});return[a,...l]}),N=t=>{const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},k=t=>{const s=u.parse(N(t));return e.isEmpty(t)?[]:e.flatten(h(s))};exports.getBlocksFromHTML=k;
|