@chaibuilder/sdk 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-QJJ1y5ez.js → BrandingOptions-uFTyYJZj.js} +18 -22
- package/dist/CanvasArea-5erOZYLy.cjs +60 -0
- package/dist/{CanvasArea-mlNKmCOh.js → CanvasArea-iRQqpOak.js} +465 -481
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lBy25sZn.js → CurrentPage-RCxTz9Mc.js} +24 -26
- package/dist/{Layers-3Xs4A5i8.js → Layers-tXB5Pwid.js} +124 -158
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel--BZhafnt.js → PagesPanel-Jaz9jvye.js} +14 -16
- package/dist/{ProjectPanel-YcLkM-DW.js → ProjectPanel--S014Xx3.js} +22 -24
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-TAgX4hov.js → Settings-gjvl5V1k.js} +556 -579
- package/dist/{SidePanels-btVQQkVK.js → SidePanels-Fq3kRwR0.js} +54 -51
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-j4t4AgCq.js → Topbar-m5dbbI1f.js} +15 -17
- package/dist/{UnsplashImages-41Y3q5_Q.js → UnsplashImages-GhBD6owT.js} +24 -26
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-xBg-kbKv.js → UploadImages-S1HgxeGb.js} +23 -25
- package/dist/{add-page-modal-cm8damU2.js → add-page-modal-2P5hGXOQ.js} +15 -17
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-i4pM3mOt.js → confirm-alert-57Xq5foA.js} +12 -14
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +13 -58
- package/dist/core.js +47 -58
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-YrIBvfFA.js → delete-page-modal-ix5IjaFW.js} +27 -29
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-VbouZlAW.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-OVmsLOrc.js → form-SYcFyACJ.js} +18 -18
- package/dist/{index-pZhGT8uT.js → index-Fj3ead-J.js} +4886 -4884
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-N50dZnlC.cjs → index-cM3eKmlx.cjs} +25 -25
- package/dist/index-pNYv0oAF.js +2994 -0
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-feqJr1QI.js → page-viewer-VxqOevr4.js} +15 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-SgagORzW.js → project-general-setting-nWOjPiin.js} +15 -17
- package/dist/{project-seo-setting-wxAGEkd_.js → project-seo-setting-70bWTwsB.js} +17 -19
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-dnWMyg6P.js → single-page-detail-3z7TF-Yy.js} +44 -46
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -15
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +149 -151
- package/dist/{useAddBlockByDrop-inkD7Lck.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-_nwI4W3q.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -9
- package/dist/web-blocks.js +431 -442
- package/package.json +8 -2
- package/dist/AddBlocks-tMxKPoen.js +0 -225
- package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
- package/dist/CanvasArea-xs4wM64L.cjs +0 -60
- package/dist/CurrentPage-aaU4F7wi.cjs +0 -1
- package/dist/Layers-eaHy5PK9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
- package/dist/PagesPanel-gGKCV394.cjs +0 -1
- package/dist/ProjectPanel-yFJRy0_E.cjs +0 -1
- package/dist/Settings-7wlLcvoh.cjs +0 -1
- package/dist/SidePanels-5H4j0mIs.cjs +0 -1
- package/dist/Topbar-V8xCetWF.cjs +0 -1
- package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
- package/dist/UploadImages-DnQ95_NW.cjs +0 -1
- package/dist/add-page-modal-MwS7iXn_.cjs +0 -1
- package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-5o4jXu-z.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-H6vIwGfD.cjs +0 -1
- package/dist/index-niHREMmR.js +0 -2938
- package/dist/page-viewer-SLt8XgYv.cjs +0 -1
- package/dist/project-general-setting-ym0yCdOq.cjs +0 -1
- package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
- package/dist/single-page-detail-IPod1o5P.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-aiHDvS5v.cjs"),x=require("./index-cM3eKmlx.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-TF2kd-0X.cjs");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-6L38HJC4.cjs"))),j=({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})})})]})},q=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(j,{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(q,{...i})))});exports.default=p;
|
|
@@ -1,16 +1,21 @@
|
|
|
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 {
|
|
5
|
-
import { e as j, b as N, d as b } from "./index-
|
|
4
|
+
import { aS as g, aT as h, aU as f } from "./index-pNYv0oAF.js";
|
|
5
|
+
import { e as j, b as N, d as b } from "./index-Fj3ead-J.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
|
-
import "@radix-ui/react-toggle";
|
|
8
|
-
import "class-variance-authority";
|
|
9
|
-
import "./utils-AvyFzbPC.js";
|
|
10
7
|
import "lodash-es";
|
|
11
|
-
import "./
|
|
8
|
+
import "./Functions-7jnEwJyw.js";
|
|
12
9
|
import "clsx";
|
|
13
10
|
import "tailwind-merge";
|
|
11
|
+
import "@chaibuilder/runtime";
|
|
12
|
+
import "jotai";
|
|
13
|
+
import "flat-to-nested";
|
|
14
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
15
|
+
import "@react-hookz/web";
|
|
16
|
+
import "@radix-ui/react-toggle";
|
|
17
|
+
import "class-variance-authority";
|
|
18
|
+
import "./Class-17XFhL48.js";
|
|
14
19
|
import "@radix-ui/react-switch";
|
|
15
20
|
import "@radix-ui/react-slot";
|
|
16
21
|
import "@radix-ui/react-accordion";
|
|
@@ -32,13 +37,6 @@ import "@radix-ui/react-context-menu";
|
|
|
32
37
|
import "react-icons-picker";
|
|
33
38
|
import "react-dom";
|
|
34
39
|
import "react-quill";
|
|
35
|
-
import "jotai";
|
|
36
|
-
import "flat-to-nested";
|
|
37
|
-
import "./Functions-7jnEwJyw.js";
|
|
38
|
-
import "redux-undo";
|
|
39
|
-
import "@chaibuilder/runtime";
|
|
40
|
-
import "lodash";
|
|
41
|
-
import "@react-hookz/web";
|
|
42
40
|
import "react-i18next";
|
|
43
41
|
import "i18next";
|
|
44
42
|
import "@floating-ui/react-dom";
|
|
@@ -52,8 +50,8 @@ import "./html-to-json-57841sEK.js";
|
|
|
52
50
|
import "himalaya";
|
|
53
51
|
import "lucide-react";
|
|
54
52
|
import "./web-blocks.js";
|
|
55
|
-
import "./
|
|
56
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
53
|
+
import "./empty-slot-MWycClTb.js";
|
|
54
|
+
const v = s.lazy(() => import("./single-page-detail-3z7TF-Yy.js")), P = ({ pageData: r }) => {
|
|
57
55
|
const [t, i] = n("CLOSE");
|
|
58
56
|
return /* @__PURE__ */ e.jsxs(
|
|
59
57
|
g,
|
|
@@ -105,11 +103,11 @@ const v = s.lazy(() => import("./single-page-detail-dnWMyg6P.js")), P = ({ pageD
|
|
|
105
103
|
]
|
|
106
104
|
}
|
|
107
105
|
) : null;
|
|
108
|
-
},
|
|
106
|
+
}, Ee = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
109
107
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
110
108
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
111
109
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
112
110
|
] }) : 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 }))) });
|
|
113
111
|
export {
|
|
114
|
-
|
|
112
|
+
Ee as default
|
|
115
113
|
};
|
|
@@ -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-aiHDvS5v.cjs"),o=require("./empty-slot-TF2kd-0X.cjs"),d=require("./form-KBb3kA8g.cjs"),m=require("./index-cM3eKmlx.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-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("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");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),p=({_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=p;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { u as c, o as u } from "./
|
|
5
|
-
import { F as d } from "./form-
|
|
6
|
-
import { b as x } from "./index-
|
|
3
|
+
import { be as n } from "./index-pNYv0oAF.js";
|
|
4
|
+
import { u as c, o as u } from "./empty-slot-MWycClTb.js";
|
|
5
|
+
import { F as d } from "./form-SYcFyACJ.js";
|
|
6
|
+
import { b as x } from "./index-Fj3ead-J.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
|
-
import "@radix-ui/react-toggle";
|
|
9
|
-
import "class-variance-authority";
|
|
10
|
-
import "./utils-AvyFzbPC.js";
|
|
11
8
|
import "lodash-es";
|
|
12
|
-
import "./
|
|
9
|
+
import "./Functions-7jnEwJyw.js";
|
|
13
10
|
import "clsx";
|
|
14
11
|
import "tailwind-merge";
|
|
12
|
+
import "@chaibuilder/runtime";
|
|
13
|
+
import "jotai";
|
|
14
|
+
import "flat-to-nested";
|
|
15
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
16
|
+
import "@react-hookz/web";
|
|
17
|
+
import "@radix-ui/react-toggle";
|
|
18
|
+
import "class-variance-authority";
|
|
19
|
+
import "./Class-17XFhL48.js";
|
|
15
20
|
import "@radix-ui/react-switch";
|
|
16
21
|
import "@radix-ui/react-slot";
|
|
17
22
|
import "@radix-ui/react-accordion";
|
|
@@ -34,13 +39,6 @@ import "@radix-ui/react-context-menu";
|
|
|
34
39
|
import "react-icons-picker";
|
|
35
40
|
import "react-dom";
|
|
36
41
|
import "react-quill";
|
|
37
|
-
import "jotai";
|
|
38
|
-
import "flat-to-nested";
|
|
39
|
-
import "./Functions-7jnEwJyw.js";
|
|
40
|
-
import "redux-undo";
|
|
41
|
-
import "@chaibuilder/runtime";
|
|
42
|
-
import "lodash";
|
|
43
|
-
import "@react-hookz/web";
|
|
44
42
|
import "react-i18next";
|
|
45
43
|
import "@rjsf/core";
|
|
46
44
|
import "@rjsf/validator-ajv8";
|
|
@@ -56,7 +54,7 @@ import "./html-to-json-57841sEK.js";
|
|
|
56
54
|
import "himalaya";
|
|
57
55
|
import "lucide-react";
|
|
58
56
|
import "./web-blocks.js";
|
|
59
|
-
const
|
|
57
|
+
const bo = ({
|
|
60
58
|
_projectData: m,
|
|
61
59
|
seany: t
|
|
62
60
|
}) => {
|
|
@@ -79,5 +77,5 @@ const ho = ({
|
|
|
79
77
|
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 }) });
|
|
80
78
|
};
|
|
81
79
|
export {
|
|
82
|
-
|
|
80
|
+
bo as default
|
|
83
81
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { b as D, u as c, g, o as x } from "./
|
|
3
|
-
import { F as v } from "./form-
|
|
2
|
+
import { b as D, u as c, g, o as x } from "./empty-slot-MWycClTb.js";
|
|
3
|
+
import { F as v } from "./form-SYcFyACJ.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "lodash-es";
|
|
7
|
+
import "./Functions-7jnEwJyw.js";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "tailwind-merge";
|
|
7
10
|
import "@rjsf/core";
|
|
8
11
|
import "@rjsf/validator-ajv8";
|
|
9
|
-
import "./index-
|
|
12
|
+
import "./index-pNYv0oAF.js";
|
|
13
|
+
import "@chaibuilder/runtime";
|
|
14
|
+
import "jotai";
|
|
15
|
+
import "flat-to-nested";
|
|
16
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
17
|
+
import "@react-hookz/web";
|
|
10
18
|
import "@radix-ui/react-toggle";
|
|
11
19
|
import "class-variance-authority";
|
|
12
|
-
import "./
|
|
13
|
-
import "./MODIFIERS-RiXS5Mn1.js";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
20
|
+
import "./Class-17XFhL48.js";
|
|
16
21
|
import "@radix-ui/react-switch";
|
|
17
22
|
import "@radix-ui/react-slot";
|
|
18
23
|
import "@radix-ui/react-accordion";
|
|
@@ -35,19 +40,12 @@ import "@radix-ui/react-context-menu";
|
|
|
35
40
|
import "react-icons-picker";
|
|
36
41
|
import "react-dom";
|
|
37
42
|
import "react-quill";
|
|
38
|
-
import "jotai";
|
|
39
|
-
import "flat-to-nested";
|
|
40
|
-
import "./Functions-7jnEwJyw.js";
|
|
41
|
-
import "redux-undo";
|
|
42
|
-
import "@chaibuilder/runtime";
|
|
43
|
-
import "lodash";
|
|
44
|
-
import "@react-hookz/web";
|
|
45
43
|
import "react-i18next";
|
|
46
|
-
const
|
|
44
|
+
const st = ({
|
|
47
45
|
_projectData: t,
|
|
48
46
|
seany: l
|
|
49
47
|
}) => {
|
|
50
|
-
var o,
|
|
48
|
+
var o, e, r, m, p, a;
|
|
51
49
|
const n = ({ formData: f }) => {
|
|
52
50
|
const i = { ...f };
|
|
53
51
|
i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((u) => ({
|
|
@@ -59,8 +57,8 @@ const nt = ({
|
|
|
59
57
|
title: "",
|
|
60
58
|
default: {
|
|
61
59
|
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
62
|
-
description: ((
|
|
63
|
-
image: ((
|
|
60
|
+
description: ((e = t.seoData) == null ? void 0 : e.description) || "",
|
|
61
|
+
image: ((r = t.seoData) == null ? void 0 : r.image) || ""
|
|
64
62
|
},
|
|
65
63
|
properties: {
|
|
66
64
|
title: c({
|
|
@@ -81,5 +79,5 @@ const nt = ({
|
|
|
81
79
|
return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
82
80
|
};
|
|
83
81
|
export {
|
|
84
|
-
|
|
82
|
+
st as default
|
|
85
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./empty-slot-TF2kd-0X.cjs"),g=require("./form-KBb3kA8g.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-aiHDvS5v.cjs");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-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("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(c=>({...c,...r}))},m={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:m,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 i=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),n=require("lodash-es"),S=require("tailwind-merge"),d=require("./MODIFIERS-2FeVfZQ9.cjs"),T=require("@chaibuilder/runtime"),y=require("./defaultTheme-IH19g4fv.cjs"),F=require("react-wrap-balancer"),_=require("@react-email/render"),p=require("@react-email/components"),C=require("@bobthered/tailwindcss-palette-generator");require("./_commonjsHelpers-wDK0ZLPo.cjs");const q=t=>{const r={};return Object.keys(t).forEach(e=>{n.isString(t[e])&&t[e].startsWith(d.SLOT_KEY)&&(r[e]=t[e].replace(d.SLOT_KEY,"").split(","))}),r},B=n.memoize((t,r)=>{const e=t.replace(d.STYLES_KEY,"").split(","),s=S.twMerge(e[0],e[1]);return y.addPrefixToClasses(s,r).replace(d.STYLES_KEY,"").trim()});function w(t,r){return n.get(t,`${r}_attrs`,{})}function O(t,r){const e={};return Object.keys(t).forEach(s=>{if(n.isString(t[s])&&t[s].startsWith(d.STYLES_KEY)){const o=B(t[s],r);e[s]={className:o,...w(t,s)}}}),e}function A(t,r){const e=n.get(t,"_bindings",{});return n.isEmpty(e)?{...t}:(n.each(e,(s,o)=>{n.isString(s)&&n.get(r,s,null)&&(t[o]=n.get(r,s,null))}),t)}function m({blocks:t,parent:r,classPrefix:e="c-",externalData:s={}}){const o=t,l=a=>O(a,e),u=r?n.filter(t,{_parent:r}):n.filter(t,a=>n.isEmpty(a._parent));return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:f.Children.toArray(u.map((a,h)=>{const g=q(a),x={};n.isEmpty(g)||Object.keys(g).forEach(c=>{x[c]=f.Children.toArray(g[c].map(j=>i.jsxRuntimeExports.jsx(m,{externalData:s,classPrefix:e,blocks:o,parent:j})))});const R=n.filter(o,{_parent:a._id});x.children=R.length>0?i.jsxRuntimeExports.jsx(m,{externalData:s,classPrefix:e,parent:a._id,blocks:o}):null;const E=T.getBlockComponent(a._type);if(E!==null){let c=a;const j=E.component;return c={...E.defaults,...a},f.createElement(j,n.omit({blockProps:{},inBuilder:!1,...c,index:h,...A(a,s),...l(c),...x},["_parent"]))}return i.jsxRuntimeExports.jsxs("noscript",{children:[a._type," not found"]})}))})}const L=({pageData:t,externalData:r={},before:e=null,after:s=null,classPrefix:o="c-"})=>{const l=n.get(t.project,"brandingOptions",d.BRANDING_OPTIONS_DEFAULTS);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e,i.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+y.getBrandingClasses(l,o)+" min-h-screen",children:i.jsxRuntimeExports.jsx(F.Provider,{children:i.jsxRuntimeExports.jsx(m,{externalData:r,blocks:t.page.blocks||[],classPrefix:o})})}),s]})},Y=(t,r="c-")=>{const e=n.get(t,"primaryColor","#000"),s=n.get(t,"secondaryColor","#ccc"),o=n.get(t,"bodyFont","Inter"),l=n.get(t,"roundedCorners","0"),u=C.tailwindcssPaletteGenerator({colors:[e,s],names:["primary","secondary"]});return n.set(u,"primary.DEFAULT",e),n.set(u,"secondary.DEFAULT",s),{theme:{fontFamily:{body:[o,...y.defaultTheme.fontFamily.sans]},extend:{borderRadius:{global:`${l||"0"}px`},colors:u}},...r?{prefix:r}:{}}},b=t=>({fontFamily:t,fallbackFontFamily:"Verdana",webFont:{url:`https://fonts.googleapis.com/css2?family=${t}&display=swap`,format:"woff"},fontWeight:400,fontStyle:"normal"}),N=(t,r,e="html")=>{const s=Y(r);return _.render(i.jsxRuntimeExports.jsx(p.Tailwind,{config:s,children:i.jsxRuntimeExports.jsxs(p.Html,{lang:"en",dir:"ltr",children:[i.jsxRuntimeExports.jsx(p.Head,{children:i.jsxRuntimeExports.jsx(p.Font,{...b(n.get(r,"bodyFont","Verdana"))})}),i.jsxRuntimeExports.jsx("body",{children:i.jsxRuntimeExports.jsx(m,{blocks:t})})]})}),e==="html"?{pretty:!0}:{plainText:!0})};exports.RenderChaiBlocks=m;exports.RenderChaiPage=L;exports.generateEmailTemplate=N;
|
package/dist/render.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare type ChaiPageProps = {
|
|
|
47
47
|
externalData?: Record<string, any>;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
export declare const generateEmailTemplate: (blocks: ChaiBlock[], brandingOptions: Record<string, any>, output?: "plain" | "html") => string;
|
|
51
|
+
|
|
50
52
|
export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, }: {
|
|
51
53
|
blocks: ChaiBlock[];
|
|
52
54
|
parent?: string;
|
package/dist/render.js
CHANGED
|
@@ -1,123 +1,164 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { isString as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { S as
|
|
6
|
-
import { getBlockComponent as
|
|
7
|
-
import { a as
|
|
8
|
-
import { Provider as
|
|
1
|
+
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { isString as _, memoize as S, get as a, isEmpty as j, each as B, filter as h, omit as A, set as x } from "lodash-es";
|
|
4
|
+
import { twMerge as w } from "tailwind-merge";
|
|
5
|
+
import { S as C, a as F, B as O } from "./MODIFIERS-RiXS5Mn1.js";
|
|
6
|
+
import { getBlockComponent as R } from "@chaibuilder/runtime";
|
|
7
|
+
import { a as N, g as L, d as b } from "./defaultTheme-YY8mlQS3.js";
|
|
8
|
+
import { Provider as I } from "react-wrap-balancer";
|
|
9
|
+
import { render as U } from "@react-email/render";
|
|
10
|
+
import { Tailwind as W, Html as Y, Head as $, Font as G } from "@react-email/components";
|
|
11
|
+
import { tailwindcssPaletteGenerator as H } from "@bobthered/tailwindcss-palette-generator";
|
|
9
12
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
10
|
-
const
|
|
13
|
+
const K = (t) => {
|
|
11
14
|
const r = {};
|
|
12
15
|
return Object.keys(t).forEach((n) => {
|
|
13
|
-
|
|
16
|
+
_(t[n]) && t[n].startsWith(C) && (r[n] = t[n].replace(C, "").split(","));
|
|
14
17
|
}), r;
|
|
15
|
-
},
|
|
16
|
-
const n = t.replace(
|
|
17
|
-
return
|
|
18
|
+
}, P = S((t, r) => {
|
|
19
|
+
const n = t.replace(F, "").split(","), e = w(n[0], n[1]);
|
|
20
|
+
return N(e, r).replace(F, "").trim();
|
|
18
21
|
});
|
|
19
|
-
function
|
|
20
|
-
return
|
|
22
|
+
function V(t, r) {
|
|
23
|
+
return a(t, `${r}_attrs`, {});
|
|
21
24
|
}
|
|
22
|
-
function
|
|
25
|
+
function z(t, r) {
|
|
23
26
|
const n = {};
|
|
24
|
-
return Object.keys(t).forEach((
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
n[
|
|
28
|
-
className:
|
|
29
|
-
...
|
|
27
|
+
return Object.keys(t).forEach((e) => {
|
|
28
|
+
if (_(t[e]) && t[e].startsWith(F)) {
|
|
29
|
+
const o = P(t[e], r);
|
|
30
|
+
n[e] = {
|
|
31
|
+
className: o,
|
|
32
|
+
...V(t, e)
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
}), n;
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
const n =
|
|
36
|
-
return
|
|
37
|
-
|
|
37
|
+
function D(t, r) {
|
|
38
|
+
const n = a(t, "_bindings", {});
|
|
39
|
+
return j(n) ? { ...t } : (B(n, (e, o) => {
|
|
40
|
+
_(e) && a(r, e, null) && (t[o] = a(r, e, null));
|
|
38
41
|
}), t);
|
|
39
42
|
}
|
|
40
|
-
function
|
|
43
|
+
function d({
|
|
41
44
|
blocks: t,
|
|
42
45
|
parent: r,
|
|
43
46
|
classPrefix: n = "c-",
|
|
44
|
-
externalData:
|
|
47
|
+
externalData: e = {}
|
|
45
48
|
}) {
|
|
46
|
-
const
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
const p =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
p[
|
|
53
|
-
|
|
49
|
+
const o = t, l = (i) => z(i, n), m = r ? h(t, { _parent: r }) : h(t, (i) => j(i._parent));
|
|
50
|
+
return /* @__PURE__ */ s.jsx(s.Fragment, { children: y.Children.toArray(
|
|
51
|
+
m.map((i, E) => {
|
|
52
|
+
const p = K(i), f = {};
|
|
53
|
+
j(p) || Object.keys(p).forEach((c) => {
|
|
54
|
+
f[c] = y.Children.toArray(
|
|
55
|
+
p[c].map((g) => /* @__PURE__ */ s.jsx(
|
|
56
|
+
d,
|
|
54
57
|
{
|
|
55
|
-
externalData:
|
|
58
|
+
externalData: e,
|
|
56
59
|
classPrefix: n,
|
|
57
|
-
blocks:
|
|
58
|
-
parent:
|
|
60
|
+
blocks: o,
|
|
61
|
+
parent: g
|
|
59
62
|
}
|
|
60
63
|
))
|
|
61
64
|
);
|
|
62
65
|
});
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const T = h(o, { _parent: i._id });
|
|
67
|
+
f.children = T.length > 0 ? /* @__PURE__ */ s.jsx(
|
|
68
|
+
d,
|
|
66
69
|
{
|
|
67
|
-
externalData:
|
|
70
|
+
externalData: e,
|
|
68
71
|
classPrefix: n,
|
|
69
|
-
parent:
|
|
70
|
-
blocks:
|
|
72
|
+
parent: i._id,
|
|
73
|
+
blocks: o
|
|
71
74
|
}
|
|
72
75
|
) : null;
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
let
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const u = R(i._type);
|
|
77
|
+
if (u !== null) {
|
|
78
|
+
let c = i;
|
|
79
|
+
const g = u.component;
|
|
80
|
+
return c = { ...u.defaults, ...i }, y.createElement(
|
|
81
|
+
g,
|
|
82
|
+
A(
|
|
80
83
|
{
|
|
81
84
|
blockProps: {},
|
|
82
85
|
inBuilder: !1,
|
|
83
|
-
...
|
|
84
|
-
index:
|
|
85
|
-
...
|
|
86
|
-
...l(
|
|
87
|
-
...
|
|
86
|
+
...c,
|
|
87
|
+
index: E,
|
|
88
|
+
...D(i, e),
|
|
89
|
+
...l(c),
|
|
90
|
+
...f
|
|
88
91
|
},
|
|
89
92
|
["_parent"]
|
|
90
93
|
)
|
|
91
94
|
);
|
|
92
95
|
}
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
|
|
96
|
+
return /* @__PURE__ */ s.jsxs("noscript", { children: [
|
|
97
|
+
i._type,
|
|
95
98
|
" not found"
|
|
96
99
|
] });
|
|
97
100
|
})
|
|
98
101
|
) });
|
|
99
102
|
}
|
|
100
|
-
const
|
|
103
|
+
const it = ({
|
|
101
104
|
pageData: t,
|
|
102
105
|
externalData: r = {},
|
|
103
106
|
before: n = null,
|
|
104
|
-
after:
|
|
105
|
-
classPrefix:
|
|
107
|
+
after: e = null,
|
|
108
|
+
classPrefix: o = "c-"
|
|
106
109
|
}) => {
|
|
107
|
-
const l =
|
|
108
|
-
return /* @__PURE__ */
|
|
110
|
+
const l = a(t.project, "brandingOptions", O);
|
|
111
|
+
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
109
112
|
n,
|
|
110
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ s.jsx(
|
|
111
114
|
"div",
|
|
112
115
|
{
|
|
113
|
-
className:
|
|
114
|
-
children: /* @__PURE__ */
|
|
116
|
+
className: o.replace("-", "") + " " + L(l, o) + " min-h-screen",
|
|
117
|
+
children: /* @__PURE__ */ s.jsx(I, { children: /* @__PURE__ */ s.jsx(d, { externalData: r, blocks: t.page.blocks || [], classPrefix: o }) })
|
|
115
118
|
}
|
|
116
119
|
),
|
|
117
|
-
|
|
120
|
+
e
|
|
118
121
|
] });
|
|
122
|
+
}, M = (t, r = "c-") => {
|
|
123
|
+
const n = a(t, "primaryColor", "#000"), e = a(t, "secondaryColor", "#ccc"), o = a(t, "bodyFont", "Inter"), l = a(t, "roundedCorners", "0"), m = H({
|
|
124
|
+
colors: [n, e],
|
|
125
|
+
names: ["primary", "secondary"]
|
|
126
|
+
});
|
|
127
|
+
return x(m, "primary.DEFAULT", n), x(m, "secondary.DEFAULT", e), {
|
|
128
|
+
theme: {
|
|
129
|
+
fontFamily: {
|
|
130
|
+
body: [o, ...b.fontFamily.sans]
|
|
131
|
+
},
|
|
132
|
+
extend: {
|
|
133
|
+
borderRadius: {
|
|
134
|
+
global: `${l || "0"}px`
|
|
135
|
+
},
|
|
136
|
+
colors: m
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
...r ? { prefix: r } : {}
|
|
140
|
+
};
|
|
141
|
+
}, q = (t) => ({
|
|
142
|
+
fontFamily: t,
|
|
143
|
+
fallbackFontFamily: "Verdana",
|
|
144
|
+
webFont: {
|
|
145
|
+
url: `https://fonts.googleapis.com/css2?family=${t}&display=swap`,
|
|
146
|
+
format: "woff"
|
|
147
|
+
},
|
|
148
|
+
fontWeight: 400,
|
|
149
|
+
fontStyle: "normal"
|
|
150
|
+
}), at = (t, r, n = "html") => {
|
|
151
|
+
const e = M(r);
|
|
152
|
+
return U(
|
|
153
|
+
/* @__PURE__ */ s.jsx(W, { config: e, children: /* @__PURE__ */ s.jsxs(Y, { lang: "en", dir: "ltr", children: [
|
|
154
|
+
/* @__PURE__ */ s.jsx($, { children: /* @__PURE__ */ s.jsx(G, { ...q(a(r, "bodyFont", "Verdana")) }) }),
|
|
155
|
+
/* @__PURE__ */ s.jsx("body", { children: /* @__PURE__ */ s.jsx(d, { blocks: t }) })
|
|
156
|
+
] }) }),
|
|
157
|
+
n === "html" ? { pretty: !0 } : { plainText: !0 }
|
|
158
|
+
);
|
|
119
159
|
};
|
|
120
160
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
161
|
+
d as RenderChaiBlocks,
|
|
162
|
+
it as RenderChaiPage,
|
|
163
|
+
at as generateEmailTemplate
|
|
123
164
|
};
|