@chaibuilder/sdk 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddBlocks-KeHVFaIr.cjs +1 -0
- package/dist/{AddBlocks-uCdu9Xpr.js → AddBlocks-gcTaEIKO.js} +5 -4
- package/dist/BrandingOptions-I2I8w6E9.cjs +1 -0
- package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-bfiFY0VR.js} +5 -4
- package/dist/{CanvasArea-oUIvLfdq.cjs → CanvasArea-JfHkTnQD.cjs} +1 -1
- package/dist/{CanvasArea-aWzbzB9p.js → CanvasArea-xvMCbQDL.js} +8 -7
- package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-0Ap2N0uc.js} +13 -12
- package/dist/CurrentPage-vj52UxMA.cjs +1 -0
- package/dist/ListTree-Vq0_s1wC.cjs +1 -0
- package/dist/ListTree-k-QMO740.js +96 -0
- package/dist/{Outline-oGoAdnBw.js → Outline-HI6-c9nf.js} +96 -92
- package/dist/Outline-fAflJ_lN.cjs +1 -0
- package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-Pk-C1956.js} +7 -6
- package/dist/PagesPanel-ug8Tmva6.cjs +1 -0
- package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-_KQBhuPO.js} +8 -7
- package/dist/ProjectPanel-o8-6cPX-.cjs +1 -0
- package/dist/Settings-Cc9eV4VG.cjs +1 -0
- package/dist/{Settings-IhWI1ice.js → Settings-XtAatoiu.js} +5 -4
- package/dist/{SidePanels-lMCXrchR.js → SidePanels-O52zKXbH.js} +134 -133
- package/dist/SidePanels-ugRobm34.cjs +1 -0
- package/dist/Topbar-e5MGWX9n.cjs +1 -0
- package/dist/{Topbar-DYiisBtw.js → Topbar-oTx7a12r.js} +5 -4
- package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-5A21uzMK.js} +5 -4
- package/dist/UnsplashImages-KSbKGs91.cjs +1 -0
- package/dist/UploadImages-V42YSRVO.cjs +1 -0
- package/dist/{UploadImages-06m6vjbL.js → UploadImages-V_54lCAO.js} +5 -4
- package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-dKQLw7RQ.js} +17 -16
- package/dist/add-page-modal-xMedOdsp.cjs +1 -0
- package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-8GP3bKH_.js} +5 -4
- package/dist/{confirm-alert-ZpEIxh3X.cjs → confirm-alert-KtW-4OjG.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +47 -46
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-Zb5ld6O-.js} +7 -6
- package/dist/delete-page-modal-lebJCBBe.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +79 -79
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +1 -0
- package/dist/email.js +6 -5
- package/dist/{form-Y0Vb4m04.cjs → form-o6_55v8F.cjs} +1 -1
- package/dist/{form-2xJcQs_Y.js → form-yyU2x7So.js} +1 -1
- package/dist/{index-3TQsdso6.cjs → index-BMZLAJUV.cjs} +1 -1
- package/dist/{index-ZwpjuB-N.cjs → index-JdnF6lYP.cjs} +42 -42
- package/dist/{index-ZBqiaKhx.js → index-WP7IRkij.js} +739 -739
- package/dist/{index-627XtO9e.js → index-lFcrvDFC.js} +3 -3
- package/dist/index-thKfFhmr.cjs +1 -0
- package/dist/{index-LF3KXx4u.js → index-yILWlilS.js} +3142 -3132
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/{page-viewer-7u0SWWmO.js → page-viewer-3QXwPGpg.js} +11 -10
- package/dist/page-viewer-DTIblLiz.cjs +1 -0
- package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-UalRmyHm.js} +8 -7
- package/dist/project-general-setting-g7WhM3hc.cjs +1 -0
- package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-8FsvPSPl.js} +6 -5
- package/dist/project-seo-setting-xoeLQVj3.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-GaB85dNv.js} +9 -8
- package/dist/single-page-detail-XdBysrE_.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/studio.js +6 -5
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +140 -139
- package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-6EbioQV4.cjs} +1 -1
- package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-BIK2fdgj.js} +1 -1
- package/package.json +2 -1
- package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
- package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
- package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
- package/dist/Outline-uMUTwN-R.cjs +0 -1
- package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
- package/dist/ProjectPanel-UIEFhref.cjs +0 -1
- package/dist/Settings-8qUW0Iow.cjs +0 -1
- package/dist/SidePanels-cOHgPE9y.cjs +0 -1
- package/dist/Topbar-vLD-rWl5.cjs +0 -1
- package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
- package/dist/UploadImages-T4MYMOhW.cjs +0 -1
- package/dist/add-page-modal-niwhffYL.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
- package/dist/index-T3wfa1kz.cjs +0 -1
- package/dist/page-viewer-6UDraUKW.cjs +0 -1
- package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
- package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
- package/dist/single-page-detail-kJUW6FE9.cjs +0 -1
package/dist/lib.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Class-MmCxz2Ay.cjs"),w=require("./Functions-N3yhPYKY.cjs"),S=require("./html-to-json-FGufPv9R.cjs"),t=require("lodash-es"),p=require("./defaultTheme-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Class-MmCxz2Ay.cjs"),w=require("./Functions-N3yhPYKY.cjs"),S=require("./html-to-json-FGufPv9R.cjs"),t=require("lodash-es"),p=require("./defaultTheme-7Lk2zq60.cjs"),k=require("@bobthered/tailwindcss-palette-generator"),F=require("@mhsdesign/jit-browser-tailwindcss"),_=require("@tailwindcss/forms"),C=require("@tailwindcss/typography"),O=require("@tailwindcss/aspect-ratio"),$=require("./MODIFIERS-9EwxLM8V.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./_commonjsHelpers-wDK0ZLPo.cjs");const T={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},I={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"};const P=16,B=4;function E(s){return s.indexOf("rem")!==-1&&(s=`${parseFloat(s.replace("rem",""))*P}px`),s}const V=s=>{const r=s.match(/\[.*\]/);if(r===null)return s;const n=y.constructClassObject(s);if(n===null)return s;const{property:c}=n;let e=t.first(r).replace(/\]/i,"").replace(/\[/i,"");const i=s.replace(/\[.*\]/i,"");e=E(e);let a=s;switch(c){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(e.indexOf("px")!==-1){const o=t.map(t.keys(I),l=>`${l}px`);if(t.includes(o,e)){const l=t.parseInt(e.replace("px",""),10);l===1?a=`${i}px`:a=i+l/B}}if(e.indexOf("%")!==-1){const o=t.map(t.keys(T),l=>`${l}%`);if(t.includes(o,e)){const l=parseFloat(e.replace("%",""));a=i+t.get(T,l)}}e.indexOf("vw")!==-1&&parseFloat(e.replace("vw",""))===100&&(a=`${i}screen`),e.indexOf("vh")!==-1&&parseFloat(e.replace("vh",""))===100&&(a=`${i}screen`);break;case"minWidth":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${i}full`),e==="0px"&&(a="min-w-0");break;case"maxWidth":e==="0px"&&(a="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};t.includes(t.keys(x),e)&&(a=`max-w-${x[e]}`);break;case"minHeight":e.indexOf("%")!==-1&&parseFloat(e.replace("%",""))===100&&(a=`${i}full`),e==="0px"&&(a="min-h-0"),e==="100vh"&&(a="min-h-screen");break;case"fontSize":const u={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};t.includes(t.keys(u),e)&&(a=i+u[e]);break;case"lineHeight":const d={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};t.includes(t.keys(d),e)&&(a=i+d[e]);break;case"zIndex":a=["0","10","20","30","40","50"].indexOf(e)!==-1?`${i}${e}`:s;break;case"opacity":const h=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],g=parseFloat(e)*100;t.includes(h,g.toString())&&(a=`opacity-${g}`);break;default:break}return a};async function b(s,r,n=[],c="c-",e=!1){const i=t.get(s,"primaryColor","#000"),a=t.get(s,"secondaryColor","#ccc"),x=t.get(s,"headingFont","Inter"),u=t.get(s,"bodyFont","Inter"),d=t.get(s,"roundedCorners","0"),m=k.tailwindcssPaletteGenerator({colors:[i,a],names:["primary","secondary"]});return t.set(m,"primary.DEFAULT",i),t.set(m,"secondary.DEFAULT",a),`${await F.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:n,theme:{fontFamily:{heading:[x,...p.defaultTheme.fontFamily.sans],body:[u,...p.defaultTheme.fontFamily.sans]},extend:{borderRadius:{global:`${d||"0"}px`},colors:m}},plugins:[_,C,O],corePlugins:{preflight:e},...c?{prefix:`${c}`}:{}}}).generateStylesFromContent(` ${e?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,r)}
|
|
4
4
|
.${c}bg-clip-text{background-clip: text;-webkit-background-clip: text;} h1,h2,h3,h4,h5,h6{font-family: "${x}",${p.defaultTheme.fontFamily.sans.join(", ")};}`}const q=(s,r)=>s.map(n=>{const c={};return Object.keys(n).forEach(e=>{t.startsWith(n[e],$.STYLES_KEY)&&(c[e]=p.addPrefixToClasses(n[e],r))}),c}),f=(s,r,n="c-",c=!1)=>{const e=p.getBrandingClasses(r,n);return b(r,[t.replace(JSON.stringify(q(s,n)),/#styles:/g,"")],e.split(" ").concat(`${n}inline-block`,`${n}w-full`,`${n}h-full`),n,c)},A=async(s,r="c-",n=!1)=>{const c=s.page.blocks;return await f(c,s.project.brandingOptions,r,n)},L=async(s,r,n="c-",c=!1)=>await f(s,r,n,c);exports.cn=y.cn;exports.generateUUID=w.generateUUID;exports.getBreakpointValue=w.getBreakpointValue;exports.getBlocksFromHTML=S.getBlocksFromHTML;exports.addPrefixToClasses=p.addPrefixToClasses;exports.getBrandingClasses=p.getBrandingClasses;exports.convertArbitraryToTailwindClass=V;exports.getBlocksTailwindCSS=f;exports.getStylesForBlocks=L;exports.getStylesForPageData=A;exports.getTailwindCSS=b;
|
package/dist/lib.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as ce } from "./Class-3k8xjeiM.js";
|
|
|
3
3
|
import { g as oe, a as le } from "./Functions-7jnEwJyw.js";
|
|
4
4
|
import { g as xe } from "./html-to-json-C5sExaSD.js";
|
|
5
5
|
import { first as F, includes as l, keys as d, map as T, parseInt as $, get as p, set as b, startsWith as k, replace as O } from "lodash-es";
|
|
6
|
-
import { d as h, a as C, g as I } from "./defaultTheme-
|
|
6
|
+
import { d as h, a as C, g as I } from "./defaultTheme-gunU_Fe5.js";
|
|
7
7
|
import { tailwindcssPaletteGenerator as E } from "@bobthered/tailwindcss-palette-generator";
|
|
8
8
|
import { createTailwindcss as V } from "@mhsdesign/jit-browser-tailwindcss";
|
|
9
9
|
import A from "@tailwindcss/forms";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import s, { useState as n, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import { aV as g, aW as h, aX as f } from "./index-
|
|
5
|
-
import { d as j, a as N, c as b } from "./index-
|
|
4
|
+
import { aV as g, aW as h, aX as f } from "./index-WP7IRkij.js";
|
|
5
|
+
import { d as j, a as N, c as b } from "./index-lFcrvDFC.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -10,9 +10,9 @@ import "clsx";
|
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@chaibuilder/runtime";
|
|
12
12
|
import "jotai";
|
|
13
|
-
import "flat-to-nested";
|
|
14
13
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
15
14
|
import "@react-hookz/web";
|
|
15
|
+
import "flat-to-nested";
|
|
16
16
|
import "@radix-ui/react-toggle";
|
|
17
17
|
import "class-variance-authority";
|
|
18
18
|
import "./Class-3k8xjeiM.js";
|
|
@@ -37,8 +37,9 @@ import "@radix-ui/react-context-menu";
|
|
|
37
37
|
import "react-icons-picker";
|
|
38
38
|
import "react-dom";
|
|
39
39
|
import "react-quill";
|
|
40
|
+
import "lodash";
|
|
40
41
|
import "react-i18next";
|
|
41
|
-
import "./index-
|
|
42
|
+
import "./index-yILWlilS.js";
|
|
42
43
|
import "i18next";
|
|
43
44
|
import "@floating-ui/react-dom";
|
|
44
45
|
import "react-textarea-autosize";
|
|
@@ -51,7 +52,7 @@ import "./html-to-json-C5sExaSD.js";
|
|
|
51
52
|
import "himalaya";
|
|
52
53
|
import "lucide-react";
|
|
53
54
|
import "./index-YpnaudSM.js";
|
|
54
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
55
|
+
const v = s.lazy(() => import("./single-page-detail-GaB85dNv.js")), P = ({ pageData: r }) => {
|
|
55
56
|
const [t, i] = n("CLOSE");
|
|
56
57
|
return /* @__PURE__ */ e.jsxs(
|
|
57
58
|
g,
|
|
@@ -86,16 +87,16 @@ const v = s.lazy(() => import("./single-page-detail-ClZYIdSO.js")), P = ({ pageD
|
|
|
86
87
|
}
|
|
87
88
|
);
|
|
88
89
|
}, E = (r) => {
|
|
89
|
-
const [t] = j(), { data: i } = N(), o = b(),
|
|
90
|
+
const [t] = j(), { data: i } = N(), o = b(), m = (i == null ? void 0 : i.homepage) === r.uuid, a = t === r.uuid, p = () => o(r);
|
|
90
91
|
return i ? /* @__PURE__ */ e.jsxs(
|
|
91
92
|
"button",
|
|
92
93
|
{
|
|
93
|
-
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${
|
|
94
|
+
className: `group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a ? "bg-blue-200 " : ""}`,
|
|
94
95
|
onClick: p,
|
|
95
96
|
type: "button",
|
|
96
97
|
children: [
|
|
97
98
|
/* @__PURE__ */ e.jsxs("div", { className: "flex text-sm items-center gap-x-1.5", children: [
|
|
98
|
-
|
|
99
|
+
m ? /* @__PURE__ */ e.jsx(d, {}) : /* @__PURE__ */ e.jsx(x, {}),
|
|
99
100
|
" ",
|
|
100
101
|
r.name
|
|
101
102
|
] }),
|
|
@@ -103,11 +104,11 @@ const v = s.lazy(() => import("./single-page-detail-ClZYIdSO.js")), P = ({ pageD
|
|
|
103
104
|
]
|
|
104
105
|
}
|
|
105
106
|
) : null;
|
|
106
|
-
},
|
|
107
|
+
}, we = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
107
108
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
108
109
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
109
110
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
110
111
|
] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ e.jsx(E, { ...i }))) });
|
|
111
112
|
export {
|
|
112
|
-
|
|
113
|
+
we as default
|
|
113
114
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-thKfFhmr.cjs"),x=require("./index-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");require("./index-JdnF6lYP.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-XdBysrE_.cjs"))),q=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},j=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(q,{pageData:s})]}):null},p=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(j,{...i})))});exports.default=p;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { bg as n } from "./index-
|
|
3
|
+
import { bg as n } from "./index-WP7IRkij.js";
|
|
4
4
|
import { u as c, o as u } from "./controls-XPXGHKht.js";
|
|
5
|
-
import { F as d } from "./form-
|
|
6
|
-
import { a as x } from "./index-
|
|
5
|
+
import { F as d } from "./form-yyU2x7So.js";
|
|
6
|
+
import { a as x } from "./index-lFcrvDFC.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -11,9 +11,9 @@ import "clsx";
|
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
15
|
import "@react-hookz/web";
|
|
16
|
+
import "flat-to-nested";
|
|
17
17
|
import "@radix-ui/react-toggle";
|
|
18
18
|
import "class-variance-authority";
|
|
19
19
|
import "./Class-3k8xjeiM.js";
|
|
@@ -39,10 +39,11 @@ import "@radix-ui/react-context-menu";
|
|
|
39
39
|
import "react-icons-picker";
|
|
40
40
|
import "react-dom";
|
|
41
41
|
import "react-quill";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "react-i18next";
|
|
43
44
|
import "@rjsf/core";
|
|
44
45
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index-
|
|
46
|
+
import "./index-yILWlilS.js";
|
|
46
47
|
import "i18next";
|
|
47
48
|
import "@floating-ui/react-dom";
|
|
48
49
|
import "react-textarea-autosize";
|
|
@@ -55,7 +56,7 @@ import "./html-to-json-C5sExaSD.js";
|
|
|
55
56
|
import "himalaya";
|
|
56
57
|
import "lucide-react";
|
|
57
58
|
import "./index-YpnaudSM.js";
|
|
58
|
-
const
|
|
59
|
+
const vo = ({
|
|
59
60
|
_projectData: m,
|
|
60
61
|
seany: t
|
|
61
62
|
}) => {
|
|
@@ -78,5 +79,5 @@ const ho = ({
|
|
|
78
79
|
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
79
80
|
};
|
|
80
81
|
export {
|
|
81
|
-
|
|
82
|
+
vo as default
|
|
82
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-thKfFhmr.cjs"),o=require("./controls-Dy1qa8Dc.cjs"),d=require("./form-o6_55v8F.cjs"),m=require("./index-BMZLAJUV.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-JdnF6lYP.cjs");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { b as D, u as c, g, o as x } from "./controls-XPXGHKht.js";
|
|
3
|
-
import { F as v } from "./form-
|
|
3
|
+
import { F as v } from "./form-yyU2x7So.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "@rjsf/core";
|
|
8
8
|
import "@rjsf/validator-ajv8";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-WP7IRkij.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 "flat-to-nested";
|
|
16
15
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
17
16
|
import "@react-hookz/web";
|
|
17
|
+
import "flat-to-nested";
|
|
18
18
|
import "@radix-ui/react-toggle";
|
|
19
19
|
import "class-variance-authority";
|
|
20
20
|
import "./Class-3k8xjeiM.js";
|
|
@@ -40,8 +40,9 @@ import "@radix-ui/react-context-menu";
|
|
|
40
40
|
import "react-icons-picker";
|
|
41
41
|
import "react-dom";
|
|
42
42
|
import "react-quill";
|
|
43
|
+
import "lodash";
|
|
43
44
|
import "react-i18next";
|
|
44
|
-
const
|
|
45
|
+
const lt = ({
|
|
45
46
|
_projectData: t,
|
|
46
47
|
seany: l
|
|
47
48
|
}) => {
|
|
@@ -79,5 +80,5 @@ const st = ({
|
|
|
79
80
|
return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
lt as default
|
|
83
84
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./controls-Dy1qa8Dc.cjs"),g=require("./form-o6_55v8F.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-thKfFhmr.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("flat-to-nested");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("lodash");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,q,s,a;const d=({formData:f})=>{const r={...f};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(m=>({...m,...r}))},c={seoData:i.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((u=e.seoData)==null?void 0:u.description)||"",image:((o=e.seoData)==null?void 0:o.image)||""},properties:{title:i.u({title:"Default Title",default:((q=e.seoData)==null?void 0:q.title)||""}),description:i.g({title:"Default Description",default:((s=e.seoData)==null?void 0:s.description)||""}),image:i.o({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
|
package/dist/render.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 o=require("./jsx-runtime-Z_BpKhVy.cjs"),E=require("react"),n=require("lodash-es"),C=require("tailwind-merge"),c=require("./MODIFIERS-9EwxLM8V.cjs"),S=require("./defaultTheme-7Lk2zq60.cjs"),Y=require("@chaibuilder/runtime"),F=require("react-wrap-balancer"),B=require("@react-email/render"),y=require("@react-email/components"),L=require("@bobthered/tailwindcss-palette-generator");require("./_commonjsHelpers-wDK0ZLPo.cjs");const O=t=>{const s={};return Object.keys(t).forEach(e=>{n.isString(t[e])&&t[e].startsWith(c.SLOT_KEY)&&(s[e]=t[e].replace(c.SLOT_KEY,"").split(","))}),s},A=n.memoize((t,s)=>{const e=t.replace(c.STYLES_KEY,"").split(","),r=C.twMerge(e[0],e[1]);return s?S.addPrefixToClasses(r,s).replace(c.STYLES_KEY,"").trim():r.replace(c.STYLES_KEY,"").trim()});function q(t,s){return n.get(t,`${s}_attrs`,{})}function K(t,s){const e={};return Object.keys(t).forEach(r=>{if(n.isString(t[r])&&t[r].startsWith(c.STYLES_KEY)){const i=A(t[r],s);e[r]={className:i,...q(t,r)}}}),e}function w(t,s){const e=n.get(t,"_bindings",{});return n.isEmpty(e)?{...t}:(n.each(e,(r,i)=>{n.isString(r)&&n.get(s,r,null)&&(t[i]=n.get(s,r,null))}),t)}function T(t){const{components:s,blocks:e,parent:r,classPrefix:i="",externalData:m={}}=t,p=e,l=a=>K(a,i),_=r?n.filter(e,{_parent:r}):n.filter(e,a=>n.isEmpty(a._parent));return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:E.Children.toArray(_.map((a,x)=>{const f=O(a),d={};n.isEmpty(f)||Object.keys(f).forEach(j=>{d[j]=E.Children.toArray(f[j].map(R=>o.jsxRuntimeExports.jsx(T,{externalData:m,classPrefix:i,blocks:p,parent:R,components:s})))});const u=n.filter(p,{_parent:a._id});d.children=u.length>0?o.jsxRuntimeExports.jsx(T,{externalData:m,classPrefix:i,parent:a._id,blocks:p,components:s}):null;const g=n.get(s,a._type,null);if(g!==null){let j=a;const R=g;return E.createElement(R,n.omit({...j,index:x,...w(a,m),...l(j),...d},["_parent"]))}return o.jsxRuntimeExports.jsxs("noscript",{children:[a._type," not found"]})}))})}const $=t=>{const s={};return Object.keys(t).forEach(e=>{n.isString(t[e])&&t[e].startsWith(c.SLOT_KEY)&&(s[e]=t[e].replace(c.SLOT_KEY,"").split(","))}),s},N=n.memoize((t,s)=>{const e=t.replace(c.STYLES_KEY,"").split(","),r=C.twMerge(e[0],e[1]);return s===""?r.replace(c.STYLES_KEY,"").trim():S.addPrefixToClasses(r,s).replace(c.STYLES_KEY,"").trim()});function W(t,s){return n.get(t,`${s}_attrs`,{})}function I(t,s){const e={};return Object.keys(t).forEach(r=>{if(n.isString(t[r])&&t[r].startsWith(c.STYLES_KEY)){const i=N(t[r],s);e[r]={className:i,...W(t,r)}}}),e}function M(t,s){const e=n.get(t,"_bindings",{});return n.isEmpty(e)?{...t}:(n.each(e,(r,i)=>{n.isString(r)&&n.get(s,r,null)&&(t[i]=n.get(s,r,null))}),t)}function h({blocks:t,parent:s,classPrefix:e="",externalData:r={}}){const i=t,m=l=>I(l,e),p=s?n.filter(t,{_parent:s}):n.filter(t,l=>n.isEmpty(l._parent));return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:E.Children.toArray(p.map((l,_)=>{const a=$(l),x={};n.isEmpty(a)||Object.keys(a).forEach(u=>{x[u]=E.Children.toArray(a[u].map(g=>o.jsxRuntimeExports.jsx(h,{externalData:r,classPrefix:e,blocks:i,parent:g})))});const f=n.filter(i,{_parent:l._id});x.children=f.length>0?o.jsxRuntimeExports.jsx(h,{externalData:r,classPrefix:e,parent:l._id,blocks:i}):null;const d=Y.getBlockComponent(l._type);if(d!==null){let u=l;const g=d.component;return u={...d.defaults,...l},E.createElement(g,n.omit({blockProps:{},inBuilder:!1,...u,index:_,...M(l,r),...m(u),...x},["_parent"]))}return o.jsxRuntimeExports.jsxs("noscript",{children:[l._type," not found"]})}))})}const P=({pageData:t,externalData:s={},before:e=null,after:r=null,classPrefix:i="c-"})=>{const m=n.get(t.project,"brandingOptions",c.BRANDING_OPTIONS_DEFAULTS);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e,o.jsxRuntimeExports.jsx("div",{className:i.replace("-","")+" "+S.getBrandingClasses(m,i)+" min-h-screen",children:o.jsxRuntimeExports.jsx(F.Provider,{children:o.jsxRuntimeExports.jsx(h,{externalData:s,blocks:t.page.blocks||[],classPrefix:i})})}),r]})},U=(t,s="c-")=>{const e=n.get(t,"primaryColor","#000"),r=n.get(t,"secondaryColor","#ccc"),i=n.get(t,"bodyFont","Inter"),m=n.get(t,"roundedCorners","0"),p=L.tailwindcssPaletteGenerator({colors:[e,r],names:["primary","secondary"]});return n.set(p,"primary.DEFAULT",e),n.set(p,"secondary.DEFAULT",r),{theme:{fontFamily:{body:[i,...S.defaultTheme.fontFamily.sans]},extend:{borderRadius:{global:`${m||"0"}px`},colors:p}},...s?{prefix:s}:{}}},G=t=>({fontFamily:t,fallbackFontFamily:"Verdana",webFont:{url:`https://fonts.googleapis.com/css2?family=${t}&display=swap`,format:"woff"},fontWeight:400,fontStyle:"normal"}),z=(t,s,e="html")=>{const r=U(s);return B.render(o.jsxRuntimeExports.jsx(y.Tailwind,{config:r,children:o.jsxRuntimeExports.jsxs(y.Html,{lang:"en",dir:"ltr",children:[o.jsxRuntimeExports.jsx(y.Head,{children:o.jsxRuntimeExports.jsx(y.Font,{...G(n.get(s,"bodyFont","Verdana"))})}),o.jsxRuntimeExports.jsx("body",{children:o.jsxRuntimeExports.jsx(h,{blocks:t})})]})}),e==="html"?{pretty:!0}:{plainText:!0})};exports.RenderChaiBlocks=h;exports.RenderChaiPage=P;exports.RenderUnregisteredComponents=T;exports.generateEmailTemplate=z;
|
package/dist/render.d.ts
CHANGED
|
@@ -58,4 +58,14 @@ export declare function RenderChaiBlocks({ blocks, parent, classPrefix, external
|
|
|
58
58
|
|
|
59
59
|
export declare const RenderChaiPage: ({ pageData, externalData, before, after, classPrefix, }: ChaiPageProps) => JSX_2.Element;
|
|
60
60
|
|
|
61
|
+
export declare function RenderUnregisteredComponents(props: UnregisteredCompoentProps): JSX_2.Element;
|
|
62
|
+
|
|
63
|
+
declare type UnregisteredCompoentProps = {
|
|
64
|
+
components: Record<string, React_2.ComponentType<any>>;
|
|
65
|
+
blocks: Record<string, any>[];
|
|
66
|
+
parent?: string;
|
|
67
|
+
classPrefix?: string;
|
|
68
|
+
externalData?: Record<string, any>;
|
|
69
|
+
};
|
|
70
|
+
|
|
61
71
|
export { }
|
package/dist/render.js
CHANGED
|
@@ -1,144 +1,229 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { isString as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { S as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Provider as
|
|
9
|
-
import { render as
|
|
10
|
-
import { Tailwind as
|
|
11
|
-
import { tailwindcssPaletteGenerator as
|
|
1
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { isString as j, memoize as O, get as a, isEmpty as y, each as $, filter as h, omit as w, set as S } from "lodash-es";
|
|
4
|
+
import { twMerge as N } from "tailwind-merge";
|
|
5
|
+
import { S as x, a as p, B as L } from "./MODIFIERS-WQdaNvb8.js";
|
|
6
|
+
import { a as R, g as W, d as U } from "./defaultTheme-gunU_Fe5.js";
|
|
7
|
+
import { getBlockComponent as I } from "@chaibuilder/runtime";
|
|
8
|
+
import { Provider as Y } from "react-wrap-balancer";
|
|
9
|
+
import { render as G } from "@react-email/render";
|
|
10
|
+
import { Tailwind as H, Html as K, Head as V, Font as z } from "@react-email/components";
|
|
11
|
+
import { tailwindcssPaletteGenerator as D } from "@bobthered/tailwindcss-palette-generator";
|
|
12
12
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
13
|
-
const
|
|
13
|
+
const M = (t) => {
|
|
14
14
|
const r = {};
|
|
15
15
|
return Object.keys(t).forEach((n) => {
|
|
16
|
-
|
|
16
|
+
j(t[n]) && t[n].startsWith(x) && (r[n] = t[n].replace(x, "").split(","));
|
|
17
17
|
}), r;
|
|
18
|
-
}, P =
|
|
19
|
-
const n = t.replace(
|
|
20
|
-
return
|
|
18
|
+
}, P = O((t, r) => {
|
|
19
|
+
const n = t.replace(p, "").split(","), e = N(n[0], n[1]);
|
|
20
|
+
return r ? R(e, r).replace(p, "").trim() : e.replace(p, "").trim();
|
|
21
21
|
});
|
|
22
|
-
function
|
|
22
|
+
function q(t, r) {
|
|
23
23
|
return a(t, `${r}_attrs`, {});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function J(t, r) {
|
|
26
26
|
const n = {};
|
|
27
27
|
return Object.keys(t).forEach((e) => {
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
28
|
+
if (j(t[e]) && t[e].startsWith(p)) {
|
|
29
|
+
const s = P(t[e], r);
|
|
30
30
|
n[e] = {
|
|
31
|
-
className:
|
|
32
|
-
...
|
|
31
|
+
className: s,
|
|
32
|
+
...q(t, e)
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
}), n;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Q(t, r) {
|
|
38
38
|
const n = a(t, "_bindings", {});
|
|
39
|
-
return
|
|
40
|
-
|
|
39
|
+
return y(n) ? { ...t } : ($(n, (e, s) => {
|
|
40
|
+
j(e) && a(r, e, null) && (t[s] = a(r, e, null));
|
|
41
41
|
}), t);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function T(t) {
|
|
44
|
+
const { components: r, blocks: n, parent: e, classPrefix: s = "", externalData: c = {} } = t, m = n, l = (i) => J(i, s), A = e ? h(n, { _parent: e }) : h(n, (i) => y(i._parent));
|
|
45
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: g.Children.toArray(
|
|
46
|
+
A.map((i, _) => {
|
|
47
|
+
const C = M(i), f = {};
|
|
48
|
+
y(C) || Object.keys(C).forEach((E) => {
|
|
49
|
+
f[E] = g.Children.toArray(
|
|
50
|
+
C[E].map((B) => /* @__PURE__ */ o.jsx(
|
|
51
|
+
T,
|
|
52
|
+
{
|
|
53
|
+
externalData: c,
|
|
54
|
+
classPrefix: s,
|
|
55
|
+
blocks: m,
|
|
56
|
+
parent: B,
|
|
57
|
+
components: r
|
|
58
|
+
}
|
|
59
|
+
))
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
const d = h(m, { _parent: i._id });
|
|
63
|
+
f.children = d.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
64
|
+
T,
|
|
65
|
+
{
|
|
66
|
+
externalData: c,
|
|
67
|
+
classPrefix: s,
|
|
68
|
+
parent: i._id,
|
|
69
|
+
blocks: m,
|
|
70
|
+
components: r
|
|
71
|
+
}
|
|
72
|
+
) : null;
|
|
73
|
+
const u = a(r, i._type, null);
|
|
74
|
+
if (u !== null) {
|
|
75
|
+
let E = i;
|
|
76
|
+
const B = u;
|
|
77
|
+
return g.createElement(
|
|
78
|
+
B,
|
|
79
|
+
w(
|
|
80
|
+
{
|
|
81
|
+
...E,
|
|
82
|
+
index: _,
|
|
83
|
+
...Q(i, c),
|
|
84
|
+
...l(E),
|
|
85
|
+
...f
|
|
86
|
+
},
|
|
87
|
+
["_parent"]
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return /* @__PURE__ */ o.jsxs("noscript", { children: [
|
|
92
|
+
i._type,
|
|
93
|
+
" not found"
|
|
94
|
+
] });
|
|
95
|
+
})
|
|
96
|
+
) });
|
|
97
|
+
}
|
|
98
|
+
const X = (t) => {
|
|
99
|
+
const r = {};
|
|
100
|
+
return Object.keys(t).forEach((n) => {
|
|
101
|
+
j(t[n]) && t[n].startsWith(x) && (r[n] = t[n].replace(x, "").split(","));
|
|
102
|
+
}), r;
|
|
103
|
+
}, Z = O((t, r) => {
|
|
104
|
+
const n = t.replace(p, "").split(","), e = N(n[0], n[1]);
|
|
105
|
+
return r === "" ? e.replace(p, "").trim() : R(e, r).replace(p, "").trim();
|
|
106
|
+
});
|
|
107
|
+
function b(t, r) {
|
|
108
|
+
return a(t, `${r}_attrs`, {});
|
|
109
|
+
}
|
|
110
|
+
function v(t, r) {
|
|
111
|
+
const n = {};
|
|
112
|
+
return Object.keys(t).forEach((e) => {
|
|
113
|
+
if (j(t[e]) && t[e].startsWith(p)) {
|
|
114
|
+
const s = Z(t[e], r);
|
|
115
|
+
n[e] = {
|
|
116
|
+
className: s,
|
|
117
|
+
...b(t, e)
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}), n;
|
|
121
|
+
}
|
|
122
|
+
function k(t, r) {
|
|
123
|
+
const n = a(t, "_bindings", {});
|
|
124
|
+
return y(n) ? { ...t } : ($(n, (e, s) => {
|
|
125
|
+
j(e) && a(r, e, null) && (t[s] = a(r, e, null));
|
|
126
|
+
}), t);
|
|
127
|
+
}
|
|
128
|
+
function F({
|
|
44
129
|
blocks: t,
|
|
45
130
|
parent: r,
|
|
46
|
-
classPrefix: n = "
|
|
131
|
+
classPrefix: n = "",
|
|
47
132
|
externalData: e = {}
|
|
48
133
|
}) {
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
m.map((
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
134
|
+
const s = t, c = (l) => v(l, n), m = r ? h(t, { _parent: r }) : h(t, (l) => y(l._parent));
|
|
135
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: g.Children.toArray(
|
|
136
|
+
m.map((l, A) => {
|
|
137
|
+
const i = X(l), _ = {};
|
|
138
|
+
y(i) || Object.keys(i).forEach((d) => {
|
|
139
|
+
_[d] = g.Children.toArray(
|
|
140
|
+
i[d].map((u) => /* @__PURE__ */ o.jsx(
|
|
141
|
+
F,
|
|
57
142
|
{
|
|
58
143
|
externalData: e,
|
|
59
144
|
classPrefix: n,
|
|
60
|
-
blocks:
|
|
61
|
-
parent:
|
|
145
|
+
blocks: s,
|
|
146
|
+
parent: u
|
|
62
147
|
}
|
|
63
148
|
))
|
|
64
149
|
);
|
|
65
150
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
151
|
+
const C = h(s, { _parent: l._id });
|
|
152
|
+
_.children = C.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
153
|
+
F,
|
|
69
154
|
{
|
|
70
155
|
externalData: e,
|
|
71
156
|
classPrefix: n,
|
|
72
|
-
parent:
|
|
73
|
-
blocks:
|
|
157
|
+
parent: l._id,
|
|
158
|
+
blocks: s
|
|
74
159
|
}
|
|
75
160
|
) : null;
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
let
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
161
|
+
const f = I(l._type);
|
|
162
|
+
if (f !== null) {
|
|
163
|
+
let d = l;
|
|
164
|
+
const u = f.component;
|
|
165
|
+
return d = { ...f.defaults, ...l }, g.createElement(
|
|
166
|
+
u,
|
|
167
|
+
w(
|
|
83
168
|
{
|
|
84
169
|
blockProps: {},
|
|
85
170
|
inBuilder: !1,
|
|
86
|
-
...
|
|
87
|
-
index:
|
|
88
|
-
...
|
|
89
|
-
...
|
|
90
|
-
...
|
|
171
|
+
...d,
|
|
172
|
+
index: A,
|
|
173
|
+
...k(l, e),
|
|
174
|
+
...c(d),
|
|
175
|
+
..._
|
|
91
176
|
},
|
|
92
177
|
["_parent"]
|
|
93
178
|
)
|
|
94
179
|
);
|
|
95
180
|
}
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
181
|
+
return /* @__PURE__ */ o.jsxs("noscript", { children: [
|
|
182
|
+
l._type,
|
|
98
183
|
" not found"
|
|
99
184
|
] });
|
|
100
185
|
})
|
|
101
186
|
) });
|
|
102
187
|
}
|
|
103
|
-
const
|
|
188
|
+
const ut = ({
|
|
104
189
|
pageData: t,
|
|
105
190
|
externalData: r = {},
|
|
106
191
|
before: n = null,
|
|
107
192
|
after: e = null,
|
|
108
|
-
classPrefix:
|
|
193
|
+
classPrefix: s = "c-"
|
|
109
194
|
}) => {
|
|
110
|
-
const
|
|
111
|
-
return /* @__PURE__ */
|
|
195
|
+
const c = a(t.project, "brandingOptions", L);
|
|
196
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
112
197
|
n,
|
|
113
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ o.jsx(
|
|
114
199
|
"div",
|
|
115
200
|
{
|
|
116
|
-
className:
|
|
117
|
-
children: /* @__PURE__ */
|
|
201
|
+
className: s.replace("-", "") + " " + W(c, s) + " min-h-screen",
|
|
202
|
+
children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(F, { externalData: r, blocks: t.page.blocks || [], classPrefix: s }) })
|
|
118
203
|
}
|
|
119
204
|
),
|
|
120
205
|
e
|
|
121
206
|
] });
|
|
122
|
-
},
|
|
123
|
-
const n = a(t, "primaryColor", "#000"), e = a(t, "secondaryColor", "#ccc"),
|
|
207
|
+
}, tt = (t, r = "c-") => {
|
|
208
|
+
const n = a(t, "primaryColor", "#000"), e = a(t, "secondaryColor", "#ccc"), s = a(t, "bodyFont", "Inter"), c = a(t, "roundedCorners", "0"), m = D({
|
|
124
209
|
colors: [n, e],
|
|
125
210
|
names: ["primary", "secondary"]
|
|
126
211
|
});
|
|
127
|
-
return
|
|
212
|
+
return S(m, "primary.DEFAULT", n), S(m, "secondary.DEFAULT", e), {
|
|
128
213
|
theme: {
|
|
129
214
|
fontFamily: {
|
|
130
|
-
body: [
|
|
215
|
+
body: [s, ...U.fontFamily.sans]
|
|
131
216
|
},
|
|
132
217
|
extend: {
|
|
133
218
|
borderRadius: {
|
|
134
|
-
global: `${
|
|
219
|
+
global: `${c || "0"}px`
|
|
135
220
|
},
|
|
136
221
|
colors: m
|
|
137
222
|
}
|
|
138
223
|
},
|
|
139
224
|
...r ? { prefix: r } : {}
|
|
140
225
|
};
|
|
141
|
-
},
|
|
226
|
+
}, nt = (t) => ({
|
|
142
227
|
fontFamily: t,
|
|
143
228
|
fallbackFontFamily: "Verdana",
|
|
144
229
|
webFont: {
|
|
@@ -147,18 +232,19 @@ const it = ({
|
|
|
147
232
|
},
|
|
148
233
|
fontWeight: 400,
|
|
149
234
|
fontStyle: "normal"
|
|
150
|
-
}),
|
|
151
|
-
const e =
|
|
152
|
-
return
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
235
|
+
}), gt = (t, r, n = "html") => {
|
|
236
|
+
const e = tt(r);
|
|
237
|
+
return G(
|
|
238
|
+
/* @__PURE__ */ o.jsx(H, { config: e, children: /* @__PURE__ */ o.jsxs(K, { lang: "en", dir: "ltr", children: [
|
|
239
|
+
/* @__PURE__ */ o.jsx(V, { children: /* @__PURE__ */ o.jsx(z, { ...nt(a(r, "bodyFont", "Verdana")) }) }),
|
|
240
|
+
/* @__PURE__ */ o.jsx("body", { children: /* @__PURE__ */ o.jsx(F, { blocks: t }) })
|
|
156
241
|
] }) }),
|
|
157
242
|
n === "html" ? { pretty: !0 } : { plainText: !0 }
|
|
158
243
|
);
|
|
159
244
|
};
|
|
160
245
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
246
|
+
F as RenderChaiBlocks,
|
|
247
|
+
ut as RenderChaiPage,
|
|
248
|
+
T as RenderUnregisteredComponents,
|
|
249
|
+
gt as generateEmailTemplate
|
|
164
250
|
};
|