@chaibuilder/sdk 1.2.26 → 1.2.27
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-S-4jzdWv.cjs +1 -0
- package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-ksZjjn0k.js} +6 -7
- package/dist/BrandingOptions-EMCT0Wa3.cjs +1 -0
- package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions-T_kbQFQv.js} +5 -6
- package/dist/{CanvasArea-zme1r3Zi.cjs → CanvasArea-SDzbubar.cjs} +2 -2
- package/dist/{CanvasArea-h0W-Tyha.js → CanvasArea-rhOeubmu.js} +7 -8
- package/dist/{Class-lGzsNBOK.js → Class-3k8xjeiM.js} +1 -1
- package/dist/{Class-PoYusiA5.cjs → Class-MmCxz2Ay.cjs} +1 -1
- package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-0eeU1V_c.js} +8 -9
- package/dist/CurrentPage-aTjWjc3o.cjs +1 -0
- package/dist/{ListTree-cZ-Ihlt3.js → ListTree-Muu4rAtp.js} +8 -9
- package/dist/ListTree-SWsqdfcG.cjs +1 -0
- package/dist/MODIFIERS-9EwxLM8V.cjs +1 -0
- package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-WQdaNvb8.js} +8 -4
- package/dist/PagesPanel-n3x-0ozR.cjs +1 -0
- package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-rYN28QpN.js} +8 -9
- package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-ivFOhdcz.js} +13 -14
- package/dist/ProjectPanel-pBePMOta.cjs +1 -0
- package/dist/Settings-JRyJayf5.cjs +1 -0
- package/dist/{Settings-4s2LUVmC.js → Settings-XWmKzRl9.js} +6 -7
- package/dist/SidePanels-BtUeo6M9.cjs +1 -0
- package/dist/{SidePanels-bugFfInz.js → SidePanels-ODktnGbC.js} +16 -17
- package/dist/Topbar-QMeD3hvq.cjs +1 -0
- package/dist/{Topbar-pWzBEOed.js → Topbar-Yunooh00.js} +5 -6
- package/dist/UnsplashImages-05JR8oIu.cjs +1 -0
- package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-QMl0bxix.js} +15 -16
- package/dist/UploadImages-OgSN1HVt.cjs +1 -0
- package/dist/{UploadImages-9NapgXBq.js → UploadImages-Si-A26bc.js} +10 -11
- package/dist/add-page-modal-9pTKItY-.cjs +1 -0
- package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-U7AUUrI1.js} +24 -25
- package/dist/confirm-alert-DhRc-Zcd.cjs +1 -0
- package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-kV5-c70T.js} +5 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +46 -47
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-gunU_Fe5.js} +1 -1
- package/dist/delete-page-modal-4s-6AIy4.cjs +1 -0
- package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal-UCBpdjLe.js} +8 -9
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +6 -7
- package/dist/{form-lBQ_76Uw.cjs → form-Ap63cNec.cjs} +1 -1
- package/dist/{form-STUz-6nE.js → form-zmlTjM9j.js} +1 -1
- package/dist/html-to-json-C_Eobs_d.cjs +1 -0
- package/dist/{html-to-json-ngX9ef2u.js → html-to-json-p__Fgqdg.js} +75 -50
- package/dist/{index-Gk6sASBd.js → index-CFUoB97-.js} +128 -129
- package/dist/index-F4AQQ6qq.cjs +1 -0
- package/dist/{index-mbyqq81O.cjs → index-Qk028f-N.cjs} +1 -1
- package/dist/{index-llTXLDGE.js → index-f0AbmoYY.js} +4 -4
- package/dist/{index-OB199Izc.cjs → index-l19JVVXI.cjs} +2 -2
- package/dist/{index-SkyM3d6Q.js → index-lOJfSheQ.js} +2 -2
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +16 -17
- package/dist/page-viewer-YFrIG3L7.cjs +1 -0
- package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-jOwy--9A.js} +9 -10
- package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-3N8HZ2fe.js} +9 -10
- package/dist/project-general-setting-hK7I7FuN.cjs +1 -0
- package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-bSiNgO_1.js} +6 -7
- package/dist/project-seo-setting-x-FK0pez.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +13 -14
- package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail--AZlZ-pC.js} +10 -11
- package/dist/single-page-detail-9abF2g2R.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +7 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +137 -138
- package/dist/web-blocks.cjs +1 -6
- package/dist/web-blocks.js +385 -486
- package/package.json +1 -1
- package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
- package/dist/BrandingOptions-DkpqGARR.cjs +0 -1
- package/dist/CurrentPage-Hl52iub_.cjs +0 -1
- package/dist/ListTree-WvTjY5rr.cjs +0 -1
- package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
- package/dist/PagesPanel-WzCocl6u.cjs +0 -1
- package/dist/ProjectPanel-o7gdcwPn.cjs +0 -1
- package/dist/STRINGS--j49GZJP.js +0 -7
- package/dist/STRINGS-gPz7CUOk.cjs +0 -1
- package/dist/Settings-AqoKwR92.cjs +0 -1
- package/dist/SidePanels-3o6Okmvu.cjs +0 -1
- package/dist/Topbar-CqW7G360.cjs +0 -1
- package/dist/UnsplashImages-NGskB93R.cjs +0 -1
- package/dist/UploadImages-Oh7Glr9A.cjs +0 -1
- package/dist/add-page-modal--6TTBRYa.cjs +0 -1
- package/dist/confirm-alert-C4M9eF-o.cjs +0 -1
- package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
- package/dist/delete-page-modal-cFoL-wdo.cjs +0 -1
- package/dist/html-to-json-efmv1pCj.cjs +0 -1
- package/dist/index-h-hd6EvN.cjs +0 -1
- package/dist/page-viewer-2kwnKM6v.cjs +0 -1
- package/dist/project-general-setting-CnNL98NM.cjs +0 -1
- package/dist/project-seo-setting-mlxL_e2_.cjs +0 -1
- package/dist/single-page-detail-XfzrGlzA.cjs +0 -1
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { K, a9 as
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { C as z } from "./index-lOJfSheQ.js";
|
|
2
|
+
import { K as J, a9 as K, L as N, aa as Q, M as V, a8 as X, E as Y, F as _, h as $, u as j, N as ss, O as es, P as os, Q as as, R as ts, U as rs, V as is, t as ps, W as ls, X as us, Y as ms, Z as ds, q as cs, J as Bs, s as ks, _ as ns, z as Cs, a1 as Ss, a0 as Ps, $ as gs, r as vs, a7 as ys, ab as As, ac as hs, a2 as Is, a4 as Ms, a3 as Rs, v as Us, a5 as Ds, a6 as bs } from "./index-CFUoB97-.js";
|
|
3
|
+
import { useTranslation as xs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -18,9 +18,8 @@ import "@radix-ui/react-icons";
|
|
|
18
18
|
import "react-hotkeys-hook";
|
|
19
19
|
import "@chaibuilder/runtime";
|
|
20
20
|
import "@react-hookz/web";
|
|
21
|
-
import "./
|
|
22
|
-
import "./
|
|
23
|
-
import "./Class-lGzsNBOK.js";
|
|
21
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
22
|
+
import "./Class-3k8xjeiM.js";
|
|
24
23
|
import "@radix-ui/react-toggle";
|
|
25
24
|
import "class-variance-authority";
|
|
26
25
|
import "@radix-ui/react-switch";
|
|
@@ -43,46 +42,46 @@ import "@radix-ui/react-context-menu";
|
|
|
43
42
|
import "react-icons-picker";
|
|
44
43
|
import "react-quill";
|
|
45
44
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
45
|
+
z as ChaiBuilderEditor,
|
|
46
|
+
J as useActiveModal,
|
|
47
|
+
K as useActivePanel,
|
|
48
|
+
N as useAddBlock,
|
|
49
|
+
Q as useAddBlockParent,
|
|
50
|
+
V as useAddClassesToBlocks,
|
|
51
|
+
X as useAllBlocks,
|
|
52
|
+
Y as useBlocksStore,
|
|
53
|
+
_ as useBrandingOptions,
|
|
54
|
+
$ as useBuilderProp,
|
|
55
|
+
j as useBuilderReset,
|
|
56
|
+
ss as useCanvasWidth,
|
|
57
|
+
es as useCanvasZoom,
|
|
58
|
+
os as useCopyBlockIds,
|
|
59
|
+
as as useCopyToClipboard,
|
|
60
|
+
ts as useCurrentPage,
|
|
61
|
+
rs as useCutBlockIds,
|
|
62
|
+
is as useDarkMode,
|
|
63
|
+
ps as useDuplicateBlocks,
|
|
64
|
+
ls as useGetPageData,
|
|
66
65
|
us as useHiddenBlockIds,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
ms as useHighlightBlockId,
|
|
67
|
+
ds as usePasteBlocks,
|
|
68
|
+
cs as usePreviewMode,
|
|
69
|
+
Bs as useReadOnlyMode,
|
|
70
|
+
ks as useRemoveBlocks,
|
|
71
|
+
ns as useRemoveClassesFromBlocks,
|
|
72
|
+
Cs as useSavePage,
|
|
73
|
+
Ss as useSelectedBlock,
|
|
74
|
+
Ps as useSelectedBlockAllClasses,
|
|
75
|
+
gs as useSelectedBlockCurrentClasses,
|
|
76
|
+
vs as useSelectedBlockIds,
|
|
77
|
+
ys as useSelectedBlocksDisplayChild,
|
|
78
|
+
As as useSelectedBreakpoints,
|
|
79
|
+
hs as useSelectedStylingBlocks,
|
|
80
|
+
Is as useStylingBreakpoint,
|
|
81
|
+
Ms as useStylingState,
|
|
82
|
+
xs as useTranslation,
|
|
83
|
+
Rs as useUILibraryBlocks,
|
|
84
|
+
Us as useUndoManager,
|
|
85
|
+
Ds as useUpdateBlocksProps,
|
|
86
|
+
bs as useUpdateBlocksPropsRealtime
|
|
88
87
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("lodash-es"),m=require("./MODIFIERS-9EwxLM8V.cjs"),d=require("./_commonjsHelpers-wDK0ZLPo.cjs"),x=(e,t="")=>{const r=i.get(e,"bodyTextLightColor","#64748b"),n=i.get(e,"bodyTextDarkColor","#94a3b8"),o=i.get(e,"bodyBgLightColor","#FFFFFF"),a=i.get(e,"bodyBgDarkColor","#0f172a");return`${t}font-body ${t}antialiased ${t}text-[${r}] ${t}bg-[${o}] dark:${t}text-[${n}] dark:${t}bg-[${a}]`},u=(e,t="")=>{const n=e.replace(m.STYLES_KEY,"").split(",").map(o=>o.split(" ").map(s=>{if(s==="")return"";if(s.includes(":")){const l=s.split(":");return l[l.length-1]=t+i.last(l),l.join(":")}return`${t}${s}`}).join(" "));return`${m.STYLES_KEY}${n.join(" , ")}`};var c={},g={};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return t}});function t(r){return Array.isArray(r)?r.map(n=>t(n)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).map(([n,o])=>[n,t(o)])):r}})(g);var f={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridTemplateColumns:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:t})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...t(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=g,r=n(f);function n(a){return a&&a.__esModule?a:{default:a}}const o=(0,t.cloneDeep)(r.default.theme)})(c);let p=c;var b=(p.__esModule?p:{default:p}).default;const h=d.getDefaultExportFromCjs(b);exports.addPrefixToClasses=u;exports.defaultTheme=h;exports.getBrandingClasses=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { get as l, last as x } from "lodash-es";
|
|
2
|
-
import { a as m } from "./
|
|
2
|
+
import { a as m } from "./MODIFIERS-WQdaNvb8.js";
|
|
3
3
|
import { g as d } from "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
const z = (e, t = "") => {
|
|
5
5
|
const r = l(e, "bodyTextLightColor", "#64748b"), n = l(e, "bodyTextDarkColor", "#94a3b8"), o = l(e, "bodyBgLightColor", "#FFFFFF"), a = l(e, "bodyBgDarkColor", "#0f172a");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-F4AQQ6qq.cjs"),l=require("./index-Qk028f-N.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("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.cjs");require("react-i18next");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("./index-l19JVVXI.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");require("sonner");require("./html-to-json-C_Eobs_d.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.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,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-
|
|
3
|
-
import { h } from "./index-
|
|
2
|
+
import { A as p, a as l, b as n, d, e as a, g as c, B as u } from "./index-CFUoB97-.js";
|
|
3
|
+
import { h } from "./index-f0AbmoYY.js";
|
|
4
4
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -10,10 +10,9 @@ import "clsx";
|
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@chaibuilder/runtime";
|
|
12
12
|
import "jotai";
|
|
13
|
-
import "./
|
|
13
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
14
14
|
import "@react-hookz/web";
|
|
15
|
-
import "./
|
|
16
|
-
import "./Class-lGzsNBOK.js";
|
|
15
|
+
import "./Class-3k8xjeiM.js";
|
|
17
16
|
import "react-i18next";
|
|
18
17
|
import "@radix-ui/react-toggle";
|
|
19
18
|
import "class-variance-authority";
|
|
@@ -38,17 +37,17 @@ import "@radix-ui/react-context-menu";
|
|
|
38
37
|
import "react-icons-picker";
|
|
39
38
|
import "react-dom";
|
|
40
39
|
import "react-quill";
|
|
41
|
-
import "./index-
|
|
40
|
+
import "./index-lOJfSheQ.js";
|
|
42
41
|
import "i18next";
|
|
43
42
|
import "@floating-ui/react-dom";
|
|
44
43
|
import "flagged";
|
|
45
44
|
import "react-hotkeys-hook";
|
|
46
45
|
import "sonner";
|
|
47
|
-
import "./html-to-json-
|
|
46
|
+
import "./html-to-json-p__Fgqdg.js";
|
|
48
47
|
import "himalaya";
|
|
49
48
|
import "lucide-react";
|
|
50
49
|
import "./index-YpnaudSM.js";
|
|
51
|
-
const
|
|
50
|
+
const ae = ({ pageData: r, projectData: i }) => {
|
|
52
51
|
const m = {}, t = h(), o = r.uuid === i.homepage, s = () => {
|
|
53
52
|
t.mutate(r, {
|
|
54
53
|
onSuccess: () => {
|
|
@@ -79,5 +78,5 @@ const ce = ({ pageData: r, projectData: i }) => {
|
|
|
79
78
|
] });
|
|
80
79
|
};
|
|
81
80
|
export {
|
|
82
|
-
|
|
81
|
+
ae as default
|
|
83
82
|
};
|
package/dist/email-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-es"),i=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),s=require("@chaibuilder/runtime"),d=require("./empty-slot-nzYOgZuS.cjs"),l=require("./controls-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;
|
|
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:"Email/Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:v,props:{content:l.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
|
@@ -166,7 +166,7 @@ const O = ({ blockProps: e, styles: t, href: l, content: i, target: n, children:
|
|
|
166
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
|
-
type: "Link",
|
|
169
|
+
type: "Email/Link",
|
|
170
170
|
label: "Link",
|
|
171
171
|
group: "basic",
|
|
172
172
|
category: "core",
|
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-l19JVVXI.cjs"),r=require("@radix-ui/react-icons"),o=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("i18next");require("react-i18next");require("./index-F4AQQ6qq.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("./Class-MmCxz2Ay.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,21 +1,20 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as p } from "./index-
|
|
2
|
+
import { C as p } from "./index-lOJfSheQ.js";
|
|
3
3
|
import { MobileIcon as t } from "@radix-ui/react-icons";
|
|
4
4
|
import { includes as e } from "lodash-es";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-CFUoB97-.js";
|
|
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 "./
|
|
15
|
+
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
16
|
import "@react-hookz/web";
|
|
17
|
-
import "./
|
|
18
|
-
import "./Class-lGzsNBOK.js";
|
|
17
|
+
import "./Class-3k8xjeiM.js";
|
|
19
18
|
import "@radix-ui/react-toggle";
|
|
20
19
|
import "class-variance-authority";
|
|
21
20
|
import "@radix-ui/react-switch";
|
|
@@ -57,7 +56,7 @@ const n = [
|
|
|
57
56
|
icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
|
|
58
57
|
width: 700
|
|
59
58
|
}
|
|
60
|
-
],
|
|
59
|
+
], Z = (o) => {
|
|
61
60
|
const r = {
|
|
62
61
|
...o,
|
|
63
62
|
filterChaiBlock: (m) => e(m.type, "Email/"),
|
|
@@ -68,5 +67,5 @@ const n = [
|
|
|
68
67
|
return /* @__PURE__ */ i.jsx(p, { ...r });
|
|
69
68
|
};
|
|
70
69
|
export {
|
|
71
|
-
|
|
70
|
+
Z as ChaiBuilderEmail
|
|
72
71
|
};
|
|
@@ -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-F4AQQ6qq.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-CFUoB97-.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),r=require("lodash-es"),l=require("./MODIFIERS-9EwxLM8V.cjs"),T=t=>{const e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,s=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return e.test(t)||s.test(t)},v=t=>{if(r.isEmpty(t))return t;const e=/<video[^>]+src=['"]([^'">]+)['"]/,s=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(e),o=t.match(s),i=a?a[1]:o?o[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,e)=>t.children.length===1&&r.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],e._type),h=t=>t.map(e=>e.type==="text"?r.get(e,"content",""):r.isEmpty(e.children)?"":h(e.children)).join(""),g=t=>t===null?!0:t,y=t=>{if(t.tagName==="svg")return{};const e={},s=w[t.tagName]||{},a=t.attributes;return r.forEach(a,({key:o,value:i})=>{if(s[o]){if(t.tagName==="img"&&o==="src"&&!i.startsWith("http")){const c=r.find(t.attributes,{key:"width"}),n=r.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"}r.set(e,s[o],g(i))}else r.includes(["style","class","srcset"],o)||r.set(e,`styles_attrs.${o}`,g(i))}),delete e.class,e},S=(t,e="styles")=>{if(!t.attributes)return{[e]:`${l.STYLES_KEY},`};const s=r.find(t.attributes,{key:"class"});if(s){const a=s.value;return{[e]:`${l.STYLES_KEY},${a}`}}return{[e]:`${l.STYLES_KEY},`}},N=t=>{const e={"hs-collapse-toggle":"CollapseToggle","hs-collapse":"Collapse","hs-accordion-group":"AccordionGroup","hs-accordion":"Accordion","hs-accordion-toggle":"AccordionToggle","hs-accordion-content":"AccordionContent","hs-dropdown":"Dropdown","hs-dropdown-toggle":"DropdownToggle","hs-dropdown-menu":"DropdownMenu","hs-overlay":"Overlay","hs-tooltip":"Tooltip","hs-tooltip-toggle":"TooltipToggle","hs-tooltip-content":"TooltipContent"},s=r.find(t.attributes,{key:"class"});if(s){const a=s.value.split(" ");for(const o of a)if(e[o])return e[o]}},L=t=>{const e=N(t);if(e)return{_type:e};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":r.capitalize(t.tagName)}}},d=(t,e=null)=>r.flatMapDeep(t,s=>{var i;if(s.type==="comment")return[];let a={_id:p.generateUUID()};if(e&&(a._parent=e.block._id),s.type==="text")return r.isEmpty(r.get(s,"content",""))?[]:e&&x(e.node,e.block)?(r.set(e,"block.content",r.get(s,"content","")),[]):{...a,_type:"Text",content:r.get(s,"content","")};if(a={...a,...L(s),...y(s),...S(s)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?r.set(a,"_type","Checkbox"):c==="radio"&&r.set(a,"_type","Radio")}else if(s.tagName==="video"||s.tagName==="iframe"){const c=u.stringify([s]);return T(c)&&(r.set(a,"_type","Video"),r.set(a,"url",v(c)),r.set(a,"styles",`${l.STYLES_KEY},absolute top-0 left-0 w-full h-full`),r.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(s.tagName==="svg"){const c=r.find(s.attributes,{key:"height"}),n=r.find(s.attributes,{key:"width"}),m=r.get(c,"value")?`[${r.get(c,"value")}px]`:"24px",f=r.get(n,"value")?`[${r.get(n,"value")}px]`:"24px",b=r.get(r.find(s.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${l.STYLES_KEY}, ${p.cn(`w-${f} h-${m}`,b)}`.trim(),s.attributes=r.filter(s.attributes,_=>!r.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([s]),[a]}else if(s.tagName=="option"&&e&&((i=e.block)==null?void 0:i._type)==="Select")return e.block.options.push({label:h(s.children),...y(s)}),[];const o=d(s.children,{block:a,node:s});return[a,...o]}),k=t=>{const e=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(e&&e.length>0?e[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},E=t=>{const e=u.parse(k(t));return r.isEmpty(t)?[]:r.flatten(d(e))};exports.getBlocksFromHTML=E;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { stringify as
|
|
1
|
+
import { stringify as y, parse as x } from "himalaya";
|
|
2
2
|
import { g as N, c as k } from "./Functions-7jnEwJyw.js";
|
|
3
|
-
import { isEmpty as g, includes as
|
|
4
|
-
import { a as p } from "./
|
|
5
|
-
const
|
|
6
|
-
const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,
|
|
7
|
-
return e.test(t) ||
|
|
8
|
-
},
|
|
3
|
+
import { isEmpty as g, includes as h, get as i, forEach as L, find as u, set as n, capitalize as C, flatMapDeep as A, filter as S, flatten as $ } from "lodash-es";
|
|
4
|
+
import { a as p } from "./MODIFIERS-WQdaNvb8.js";
|
|
5
|
+
const B = (t) => {
|
|
6
|
+
const e = /(?: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/;
|
|
7
|
+
return e.test(t) || r.test(t);
|
|
8
|
+
}, M = (t) => {
|
|
9
9
|
if (g(t))
|
|
10
10
|
return t;
|
|
11
|
-
const e = /<video[^>]+src=['"]([^'">]+)['"]/,
|
|
12
|
-
return c && (
|
|
13
|
-
},
|
|
11
|
+
const e = /<video[^>]+src=['"]([^'">]+)['"]/, r = /<iframe[^>]+src=['"]([^'">]+)['"]/, s = t.match(e), o = t.match(r), c = s ? s[1] : o ? o[1] : null, a = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
12
|
+
return c && (a.test(c) || l.test(c)) ? c : t;
|
|
13
|
+
}, R = {
|
|
14
14
|
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
15
15
|
video: {
|
|
16
16
|
src: "url",
|
|
@@ -43,30 +43,55 @@ const R = (t) => {
|
|
|
43
43
|
multiple: "multiple",
|
|
44
44
|
name: "fieldName"
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, H = (t, e) => t.children.length === 1 && h(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), d = (t) => t.map((e) => e.type === "text" ? i(e, "content", "") : g(e.children) ? "" : d(e.children)).join(""), m = (t) => t === null ? !0 : t, f = (t) => {
|
|
47
47
|
if (t.tagName === "svg")
|
|
48
48
|
return {};
|
|
49
|
-
const e = {},
|
|
50
|
-
return L(
|
|
51
|
-
if (
|
|
52
|
-
if (t.tagName === "img" &&
|
|
53
|
-
const
|
|
54
|
-
|
|
49
|
+
const e = {}, r = R[t.tagName] || {}, s = t.attributes;
|
|
50
|
+
return L(s, ({ key: o, value: c }) => {
|
|
51
|
+
if (r[o]) {
|
|
52
|
+
if (t.tagName === "img" && o === "src" && !c.startsWith("http")) {
|
|
53
|
+
const a = u(t.attributes, { key: "width" }), l = u(t.attributes, { key: "height" });
|
|
54
|
+
a && l ? c = `https://via.placeholder.com/${a == null ? void 0 : a.value}x${l == null ? void 0 : l.value}` : c = "https://via.placeholder.com/150x150";
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
n(e, r[o], m(c));
|
|
57
57
|
} else
|
|
58
|
-
|
|
58
|
+
h(["style", "class", "srcset"], o) || n(e, `styles_attrs.${o}`, m(c));
|
|
59
59
|
}), delete e.class, e;
|
|
60
60
|
}, I = (t, e = "styles") => {
|
|
61
61
|
if (!t.attributes)
|
|
62
62
|
return { [e]: `${p},` };
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
return { [e]: `${p},${
|
|
63
|
+
const r = u(t.attributes, { key: "class" });
|
|
64
|
+
if (r) {
|
|
65
|
+
const s = r.value;
|
|
66
|
+
return { [e]: `${p},${s}` };
|
|
67
67
|
}
|
|
68
68
|
return { [e]: `${p},` };
|
|
69
69
|
}, q = (t) => {
|
|
70
|
+
const e = {
|
|
71
|
+
"hs-collapse-toggle": "CollapseToggle",
|
|
72
|
+
"hs-collapse": "Collapse",
|
|
73
|
+
"hs-accordion-group": "AccordionGroup",
|
|
74
|
+
"hs-accordion": "Accordion",
|
|
75
|
+
"hs-accordion-toggle": "AccordionToggle",
|
|
76
|
+
"hs-accordion-content": "AccordionContent",
|
|
77
|
+
"hs-dropdown": "Dropdown",
|
|
78
|
+
"hs-dropdown-toggle": "DropdownToggle",
|
|
79
|
+
"hs-dropdown-menu": "DropdownMenu",
|
|
80
|
+
"hs-overlay": "Overlay",
|
|
81
|
+
"hs-tooltip": "Tooltip",
|
|
82
|
+
"hs-tooltip-toggle": "TooltipToggle",
|
|
83
|
+
"hs-tooltip-content": "TooltipContent"
|
|
84
|
+
}, r = u(t.attributes, { key: "class" });
|
|
85
|
+
if (r) {
|
|
86
|
+
const s = r.value.split(" ");
|
|
87
|
+
for (const o of s)
|
|
88
|
+
if (e[o])
|
|
89
|
+
return e[o];
|
|
90
|
+
}
|
|
91
|
+
}, D = (t) => {
|
|
92
|
+
const e = q(t);
|
|
93
|
+
if (e)
|
|
94
|
+
return { _type: e };
|
|
70
95
|
switch (t.tagName) {
|
|
71
96
|
case "img":
|
|
72
97
|
return { _type: "Image" };
|
|
@@ -142,43 +167,43 @@ const R = (t) => {
|
|
|
142
167
|
return {
|
|
143
168
|
_type: "Box",
|
|
144
169
|
tag: t.tagName,
|
|
145
|
-
_name: t.tagName === "div" ? "Box" :
|
|
170
|
+
_name: t.tagName === "div" ? "Box" : C(t.tagName)
|
|
146
171
|
};
|
|
147
172
|
}
|
|
148
|
-
},
|
|
173
|
+
}, b = (t, e = null) => A(t, (r) => {
|
|
149
174
|
var c;
|
|
150
|
-
if (
|
|
175
|
+
if (r.type === "comment")
|
|
151
176
|
return [];
|
|
152
|
-
let
|
|
153
|
-
if (e && (
|
|
154
|
-
return g(
|
|
155
|
-
if (
|
|
156
|
-
...
|
|
157
|
-
...
|
|
158
|
-
...f(
|
|
159
|
-
...I(
|
|
160
|
-
},
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
} else if (
|
|
164
|
-
const
|
|
165
|
-
return
|
|
166
|
-
} else if (
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
} else if (
|
|
177
|
+
let s = { _id: N() };
|
|
178
|
+
if (e && (s._parent = e.block._id), r.type === "text")
|
|
179
|
+
return g(i(r, "content", "")) ? [] : e && H(e.node, e.block) ? (n(e, "block.content", i(r, "content", "")), []) : { ...s, _type: "Text", content: i(r, "content", "") };
|
|
180
|
+
if (s = {
|
|
181
|
+
...s,
|
|
182
|
+
...D(r),
|
|
183
|
+
...f(r),
|
|
184
|
+
...I(r)
|
|
185
|
+
}, s._type === "Input") {
|
|
186
|
+
const a = s.inputType || "text";
|
|
187
|
+
a === "checkbox" ? n(s, "_type", "Checkbox") : a === "radio" && n(s, "_type", "Radio");
|
|
188
|
+
} else if (r.tagName === "video" || r.tagName === "iframe") {
|
|
189
|
+
const a = y([r]);
|
|
190
|
+
return B(a) && (n(s, "_type", "Video"), n(s, "url", M(a)), n(s, "styles", `${p},absolute top-0 left-0 w-full h-full`), n(s, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), s.content = a, [s];
|
|
191
|
+
} else if (r.tagName === "svg") {
|
|
192
|
+
const a = u(r.attributes, { key: "height" }), l = u(r.attributes, { key: "width" }), _ = i(a, "value") ? `[${i(a, "value")}px]` : "24px", v = i(l, "value") ? `[${i(l, "value")}px]` : "24px", T = i(u(r.attributes, { key: "class" }), "value", "w-full h-full");
|
|
193
|
+
return s.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), r.attributes = S(r.attributes, (w) => !h(["style", "width", "height", "class"], w.key)), s.icon = y([r]), [s];
|
|
194
|
+
} else if (r.tagName == "option" && e && ((c = e.block) == null ? void 0 : c._type) === "Select")
|
|
170
195
|
return e.block.options.push({
|
|
171
|
-
label:
|
|
172
|
-
...f(
|
|
196
|
+
label: d(r.children),
|
|
197
|
+
...f(r)
|
|
173
198
|
}), [];
|
|
174
|
-
const
|
|
175
|
-
return [
|
|
199
|
+
const o = b(r.children, { block: s, node: r });
|
|
200
|
+
return [s, ...o];
|
|
176
201
|
}), E = (t) => {
|
|
177
202
|
const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
178
203
|
return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
179
204
|
}, V = (t) => {
|
|
180
|
-
const e =
|
|
181
|
-
return g(t) ? [] :
|
|
205
|
+
const e = x(E(t));
|
|
206
|
+
return g(t) ? [] : $(b(e));
|
|
182
207
|
};
|
|
183
208
|
export {
|
|
184
209
|
V as g
|