@chaibuilder/sdk 1.2.32 → 1.2.34
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-0eVRNr1d.js → AddBlocks-RmEkZXdE.js} +37 -33
- package/dist/AddBlocks-XYCWUol8.cjs +1 -0
- package/dist/{BrandingOptions-yYAznnw2.js → BrandingOptions-TnzCIC7A.js} +37 -31
- package/dist/BrandingOptions-qnaKl27s.cjs +1 -0
- package/dist/CanvasArea-SeSRWHy0.js +1200 -0
- package/dist/CanvasArea-iIwERFUC.cjs +55 -0
- package/dist/ChaiBuilderEditor-YqEKonJ_.cjs +206 -0
- package/dist/{index-AJalHhkO.js → ChaiBuilderEditor-y1NxvXJ7.js} +24114 -20836
- package/dist/{CurrentPage-1v40uk8K.js → CurrentPage-9KDre_9q.js} +19 -19
- package/dist/CurrentPage-TNff16tH.cjs +1 -0
- package/dist/ListTree-GxCAsv2Y.cjs +1 -0
- package/dist/{ListTree-0ZrRreCs.js → ListTree-H2WaKwOs.js} +81 -76
- package/dist/PagesPanel-5DRsqV-G.cjs +1 -0
- package/dist/{PagesPanel-AxQX-BX2.js → PagesPanel-jHMmJEtv.js} +14 -14
- package/dist/ProjectPanel-CDnnGpVo.cjs +1 -0
- package/dist/{ProjectPanel-GYdge5v9.js → ProjectPanel-uxhq_D3j.js} +16 -16
- package/dist/Settings-nGnVavh4.cjs +1 -0
- package/dist/{Settings-9JAzGHau.js → Settings-yqZksAbO.js} +53 -53
- package/dist/{SidePanels-bLwsW29O.js → SidePanels-1gwirESt.js} +70 -70
- package/dist/SidePanels-33KNaSS3.cjs +1 -0
- package/dist/{Topbar-0Ql8pHVc.js → Topbar-NHF8D1di.js} +19 -14
- package/dist/Topbar-Wwdd9Flx.cjs +1 -0
- package/dist/{UnsplashImages-NYwOOgYa.js → UnsplashImages-LLu2wFeN.js} +26 -21
- package/dist/UnsplashImages-lnz6NfSD.cjs +1 -0
- package/dist/UploadImages-3nl_4mDf.cjs +1 -0
- package/dist/{UploadImages-vpZeW-YW.js → UploadImages-FtvaDyk9.js} +33 -27
- package/dist/{add-page-modal-hDyzsEU7.js → add-page-modal-V9DTBMmY.js} +22 -22
- package/dist/add-page-modal-sIZk552b.cjs +1 -0
- package/dist/confirm-alert-Uzq5XNGt.cjs +1 -0
- package/dist/{confirm-alert-FGQKKQJU.js → confirm-alert-sI4pItIN.js} +16 -10
- package/dist/{controls-OfJWSEqC.js → controls-VTdJhdSz.js} +44 -41
- package/dist/controls-jWJDao88.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +9 -0
- package/dist/core.js +46 -45
- package/dist/delete-page-modal-UminFzYh.cjs +1 -0
- package/dist/{delete-page-modal-KxeyBri2.js → delete-page-modal-XrIpujav.js} +15 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +9 -0
- package/dist/email.js +18 -16
- package/dist/{form-77dY98bF.js → form-dQQ2tTRZ.js} +7 -7
- package/dist/form-q7lxaK3j.cjs +1 -0
- package/dist/functions-ge87TVcc.js +30 -0
- package/dist/functions-sBiIevFh.cjs +1 -0
- package/dist/{index-5zkCTSAM.js → index-OsS2_gM8.js} +28 -29
- package/dist/index-eYwpNzUl.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +12 -10
- package/dist/{page-viewer-umQaut1j.js → page-viewer-AoJ5HU6j.js} +21 -21
- package/dist/page-viewer-FzhqSyNO.cjs +1 -0
- package/dist/project-general-setting-WzJ8U1OW.cjs +1 -0
- package/dist/{project-general-setting-uuCemMCU.js → project-general-setting-g3YJYszB.js} +24 -24
- package/dist/{project-seo-setting-asvbPQiI.js → project-seo-setting-1sLmV-wv.js} +26 -20
- package/dist/project-seo-setting-GuObNafp.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +55 -53
- package/dist/single-page-detail-WGars7Tl.cjs +1 -0
- package/dist/{single-page-detail-F6pKWyq1.js → single-page-detail-sQ3BH6Rc.js} +25 -25
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +9 -0
- package/dist/studio.js +13 -13
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +153 -147
- package/dist/useCanvasSettings-QcsmJd9b.cjs +1 -0
- package/dist/{useCanvasSettings-ikt217kv.js → useCanvasSettings-XwFRrknO.js} +1 -1
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +137 -113
- package/package.json +9 -3
- package/dist/AddBlocks-t0hKDSud.cjs +0 -1
- package/dist/BrandingOptions-NVmCxZfD.cjs +0 -1
- package/dist/CanvasArea-2b4oSjRx.js +0 -1177
- package/dist/CanvasArea-OzyCq6UU.cjs +0 -55
- package/dist/CurrentPage-YBMhEBZG.cjs +0 -1
- package/dist/ListTree-jPwxgI6R.cjs +0 -1
- package/dist/PagesPanel-ivEL9tIQ.cjs +0 -1
- package/dist/ProjectPanel-shgvg_yT.cjs +0 -1
- package/dist/Settings-MMwEBADN.cjs +0 -1
- package/dist/SidePanels-iaaRCUeQ.cjs +0 -1
- package/dist/Topbar-CkUhCnSW.cjs +0 -1
- package/dist/UnsplashImages-juwtWvXe.cjs +0 -1
- package/dist/UploadImages-4_jmnoVi.cjs +0 -1
- package/dist/add-page-modal-2ZPjc54F.cjs +0 -1
- package/dist/confirm-alert-QRxOc76t.cjs +0 -1
- package/dist/controls-KK2oLIa8.cjs +0 -1
- package/dist/delete-page-modal--N1nPPIL.cjs +0 -1
- package/dist/form-hT5dGoJH.cjs +0 -1
- package/dist/functions-I6BoMqqb.js +0 -21
- package/dist/functions-r3ExvGGf.cjs +0 -1
- package/dist/index-FPBudsRF.cjs +0 -1
- package/dist/index-JIcsKKoG.cjs +0 -1
- package/dist/index-YpnaudSM.js +0 -63
- package/dist/index-ecnGWzh9.cjs +0 -1
- package/dist/index-hH5SIZ29.js +0 -3116
- package/dist/index-sJ9Uc9UY.cjs +0 -206
- package/dist/page-viewer-k-g15j8B.cjs +0 -1
- package/dist/project-general-setting-1leAiCJQ.cjs +0 -1
- package/dist/project-seo-setting-kDBSOzgX.cjs +0 -1
- package/dist/single-page-detail-IFtVxwl5.cjs +0 -1
- package/dist/useCanvasSettings-Am2o80hW.cjs +0 -1
package/dist/core.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as Os } from "react-i18next";
|
|
4
|
-
import "i18next";
|
|
1
|
+
import { C as K, l as N, U as Q, m as V, W as X, n as Y, T as Z, i as _, F as $, h as ss, u as es, o as os, p as ts, q as as, r as rs, s as is, t as ps, v as ls, w as ms, x as us, y as ds, z as cs, D as Bs, E as ks, k as ns, H as Cs, I as Ss, V as Ps, M as gs, K as vs, J as ys, L as As, S as Is, X as hs, Y as Ms, N as Rs, P as Ds, O as Us, j as Ts, Q as xs, R as Hs } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
2
|
+
import { useTranslation as bs } from "react-i18next";
|
|
5
3
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
5
|
import "react";
|
|
@@ -10,22 +8,22 @@ import "react-dom";
|
|
|
10
8
|
import "@radix-ui/react-scroll-area";
|
|
11
9
|
import "@floating-ui/react-dom";
|
|
12
10
|
import "jotai";
|
|
11
|
+
import "i18next";
|
|
13
12
|
import "flagged";
|
|
14
13
|
import "lodash-es";
|
|
14
|
+
import "./STRINGS--j49GZJP.js";
|
|
15
15
|
import "./Functions-7jnEwJyw.js";
|
|
16
16
|
import "tailwind-merge";
|
|
17
|
-
import "@radix-ui/react-icons";
|
|
18
|
-
import "react-hotkeys-hook";
|
|
19
17
|
import "@chaibuilder/runtime";
|
|
20
18
|
import "@react-hookz/web";
|
|
21
|
-
import "./STRINGS--j49GZJP.js";
|
|
22
19
|
import "./MODIFIERS-cBT31iqE.js";
|
|
23
|
-
import "./Class-6Hz2KzYb.js";
|
|
24
20
|
import "@radix-ui/react-toggle";
|
|
25
21
|
import "class-variance-authority";
|
|
22
|
+
import "./Class-6Hz2KzYb.js";
|
|
26
23
|
import "@radix-ui/react-switch";
|
|
27
24
|
import "@radix-ui/react-slot";
|
|
28
25
|
import "@radix-ui/react-accordion";
|
|
26
|
+
import "@radix-ui/react-icons";
|
|
29
27
|
import "@radix-ui/react-alert-dialog";
|
|
30
28
|
import "@radix-ui/react-dialog";
|
|
31
29
|
import "@radix-ui/react-label";
|
|
@@ -42,47 +40,50 @@ import "cmdk";
|
|
|
42
40
|
import "@radix-ui/react-context-menu";
|
|
43
41
|
import "react-icons-picker";
|
|
44
42
|
import "react-quill";
|
|
43
|
+
import "react-hotkeys-hook";
|
|
44
|
+
import "lodash";
|
|
45
|
+
import "lucide-react";
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
K as ChaiBuilderEditor,
|
|
48
|
+
N as useActiveModal,
|
|
49
|
+
Q as useActivePanel,
|
|
50
|
+
V as useAddBlock,
|
|
51
|
+
X as useAddBlockParent,
|
|
52
|
+
Y as useAddClassesToBlocks,
|
|
53
|
+
Z as useAllBlocks,
|
|
53
54
|
_ as useBlocksStore,
|
|
54
55
|
$ as useBrandingOptions,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
ss as useBuilderProp,
|
|
57
|
+
es as useBuilderReset,
|
|
58
|
+
os as useCanvasWidth,
|
|
59
|
+
ts as useCanvasZoom,
|
|
59
60
|
as as useCopyBlockIds,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
rs as useCopyToClipboard,
|
|
62
|
+
is as useCurrentPage,
|
|
63
|
+
ps as useCutBlockIds,
|
|
64
|
+
ls as useDarkMode,
|
|
65
|
+
ms as useDuplicateBlocks,
|
|
66
|
+
us as useGetPageData,
|
|
67
|
+
ds as useHiddenBlockIds,
|
|
68
|
+
cs as useHighlightBlockId,
|
|
69
|
+
Bs as usePasteBlocks,
|
|
70
|
+
ks as usePreviewMode,
|
|
71
|
+
ns as useReadOnlyMode,
|
|
72
|
+
Cs as useRemoveBlocks,
|
|
73
|
+
Ss as useRemoveClassesFromBlocks,
|
|
74
|
+
Ps as useSavePage,
|
|
75
|
+
gs as useSelectedBlock,
|
|
76
|
+
vs as useSelectedBlockAllClasses,
|
|
77
|
+
ys as useSelectedBlockCurrentClasses,
|
|
78
|
+
As as useSelectedBlockIds,
|
|
79
|
+
Is as useSelectedBlocksDisplayChild,
|
|
79
80
|
hs as useSelectedBreakpoints,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
Ms as useSelectedStylingBlocks,
|
|
82
|
+
Rs as useStylingBreakpoint,
|
|
83
|
+
Ds as useStylingState,
|
|
84
|
+
bs as useTranslation,
|
|
84
85
|
Us as useUILibraryBlocks,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
Ts as useUndoManager,
|
|
87
|
+
xs as useUpdateBlocksProps,
|
|
88
|
+
Hs as useUpdateBlocksPropsRealtime
|
|
88
89
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./ChaiBuilderEditor-YqEKonJ_.cjs"),l=require("./index-eYwpNzUl.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.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-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-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");require("./core.cjs");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");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,29 +1,33 @@
|
|
|
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 "./
|
|
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 "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
3
|
+
import { h } from "./index-OsS2_gM8.js";
|
|
4
4
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import "@radix-ui/react-scroll-area";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "i18next";
|
|
13
|
+
import "react-i18next";
|
|
14
|
+
import "flagged";
|
|
7
15
|
import "lodash-es";
|
|
16
|
+
import "./STRINGS--j49GZJP.js";
|
|
8
17
|
import "./Functions-7jnEwJyw.js";
|
|
9
|
-
import "clsx";
|
|
10
18
|
import "tailwind-merge";
|
|
11
19
|
import "@chaibuilder/runtime";
|
|
12
|
-
import "jotai";
|
|
13
|
-
import "./STRINGS--j49GZJP.js";
|
|
14
20
|
import "@react-hookz/web";
|
|
15
21
|
import "./MODIFIERS-cBT31iqE.js";
|
|
16
|
-
import "./Class-6Hz2KzYb.js";
|
|
17
|
-
import "react-i18next";
|
|
18
22
|
import "@radix-ui/react-toggle";
|
|
19
23
|
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
20
25
|
import "@radix-ui/react-switch";
|
|
21
26
|
import "@radix-ui/react-slot";
|
|
22
27
|
import "@radix-ui/react-accordion";
|
|
23
28
|
import "@radix-ui/react-alert-dialog";
|
|
24
29
|
import "@radix-ui/react-dialog";
|
|
25
30
|
import "@radix-ui/react-label";
|
|
26
|
-
import "@radix-ui/react-scroll-area";
|
|
27
31
|
import "@radix-ui/react-tabs";
|
|
28
32
|
import "@radix-ui/react-tooltip";
|
|
29
33
|
import "@radix-ui/react-popover";
|
|
@@ -36,18 +40,14 @@ import "@radix-ui/react-toast";
|
|
|
36
40
|
import "cmdk";
|
|
37
41
|
import "@radix-ui/react-context-menu";
|
|
38
42
|
import "react-icons-picker";
|
|
39
|
-
import "react-dom";
|
|
40
43
|
import "react-quill";
|
|
41
|
-
import "./index-AJalHhkO.js";
|
|
42
|
-
import "i18next";
|
|
43
|
-
import "@floating-ui/react-dom";
|
|
44
|
-
import "flagged";
|
|
45
44
|
import "react-hotkeys-hook";
|
|
45
|
+
import "lodash";
|
|
46
|
+
import "lucide-react";
|
|
47
|
+
import "./core.js";
|
|
46
48
|
import "sonner";
|
|
47
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
48
50
|
import "himalaya";
|
|
49
|
-
import "lucide-react";
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
51
|
const ce = ({ pageData: r, projectData: i }) => {
|
|
52
52
|
const m = {}, t = h(), o = r.uuid === i.homepage, s = () => {
|
|
53
53
|
t.mutate(r, {
|
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-
|
|
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-jWJDao88.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.y({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.y({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.l({title:"Content",default:"Enter your heading here..."}),styles:l.S({default:"text-xl"}),level:l.y({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}),y=({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:y,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 C=({content:e})=>e,j=({content:e,blockProps:t})=>i.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(C,{type:"Email/RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:j,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.l({title:"Content",default:"Click me"}),link:l.T({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.l({title:"Content",default:"I am a link."}),link:l.T({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 T=({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}),L=({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(T,{type:"Email/Image",label:"Image",group:"basic",category:"core",icon:a.ImageIcon,builderComponent:L,props:{styles:l.S({default:"w-full"}),image:l.q({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.l({title:"Alt",default:""}),width:l.l({title:"Width",default:""}),height:l.l({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.l({title:"Theme",default:"dracula"}),lineNumbers:l.r({title:"Line number",default:!1}),language:l.y({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
|
@@ -3,7 +3,7 @@ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
3
3
|
import { Container as f, Section as y, Row as x, Column as B, Heading as C, Text as v, Button as j, Link as w, Preview as E, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as R } from "@react-email/components";
|
|
4
4
|
import { registerChaiBlock as r } from "@chaibuilder/runtime";
|
|
5
5
|
import { E as m } from "./empty-slot-ZBlsQi6m.js";
|
|
6
|
-
import {
|
|
6
|
+
import { y as d, S as a, l as s, g as u, T as g, q as _, r as A } from "./controls-VTdJhdSz.js";
|
|
7
7
|
import { ImageIcon as p, HeadingIcon as S, TextIcon as h, Link1Icon as P, DividerHorizontalIcon as D, CodeSandboxLogoIcon as b } from "@radix-ui/react-icons";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "react";
|
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")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs");require("./core.cjs");const r=require("@radix-ui/react-icons"),q=require("lodash-es"),n=require("./ChaiBuilderEditor-YqEKonJ_.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("react-i18next");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.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-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-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");const o=[{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=>q.includes(t.type,"Email/"),importHTMLSupport:!1,dataBindingSupport:!1,breakpoints:o};return e.jsxRuntimeExports.jsx(n.ChaiBuilderEditor,{...u})};exports.ChaiBuilderEmail=s;
|
package/dist/email.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
2
2
|
import { default as React_2 } from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
declare type AskAiResponse = {
|
|
6
|
+
blocks?: Array<{
|
|
7
|
+
_id: string;
|
|
8
|
+
} & Partial<ChaiBlock>>;
|
|
9
|
+
usage?: Record<any, number>;
|
|
10
|
+
error?: any;
|
|
11
|
+
};
|
|
12
|
+
|
|
5
13
|
declare interface Block {
|
|
6
14
|
type: string;
|
|
7
15
|
[key: string]: any;
|
|
@@ -48,6 +56,7 @@ declare interface ChaiBuilderEditorProps {
|
|
|
48
56
|
uploadMediaCallback?: (file: File) => Promise<{
|
|
49
57
|
url: string;
|
|
50
58
|
}>;
|
|
59
|
+
askAiCallBack?: (prompt: string, blocks: ChaiBlock[]) => Promise<AskAiResponse>;
|
|
51
60
|
getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
|
|
52
61
|
blocks: ChaiBlock[];
|
|
53
62
|
html: string;
|
package/dist/email.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import
|
|
2
|
+
import "./core.js";
|
|
3
3
|
import { MobileIcon as t } from "@radix-ui/react-icons";
|
|
4
|
-
import { includes as
|
|
4
|
+
import { includes as p } from "lodash-es";
|
|
5
|
+
import { C as e } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
5
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
7
|
import "react";
|
|
7
|
-
import "i18next";
|
|
8
8
|
import "react-i18next";
|
|
9
|
-
import "./index-hH5SIZ29.js";
|
|
10
|
-
import "./Functions-7jnEwJyw.js";
|
|
11
9
|
import "clsx";
|
|
12
|
-
import "
|
|
13
|
-
import "@
|
|
10
|
+
import "react-dom";
|
|
11
|
+
import "@radix-ui/react-scroll-area";
|
|
12
|
+
import "@floating-ui/react-dom";
|
|
14
13
|
import "jotai";
|
|
14
|
+
import "i18next";
|
|
15
|
+
import "flagged";
|
|
15
16
|
import "./STRINGS--j49GZJP.js";
|
|
17
|
+
import "./Functions-7jnEwJyw.js";
|
|
18
|
+
import "tailwind-merge";
|
|
19
|
+
import "@chaibuilder/runtime";
|
|
16
20
|
import "@react-hookz/web";
|
|
17
21
|
import "./MODIFIERS-cBT31iqE.js";
|
|
18
|
-
import "./Class-6Hz2KzYb.js";
|
|
19
22
|
import "@radix-ui/react-toggle";
|
|
20
23
|
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
21
25
|
import "@radix-ui/react-switch";
|
|
22
26
|
import "@radix-ui/react-slot";
|
|
23
27
|
import "@radix-ui/react-accordion";
|
|
24
28
|
import "@radix-ui/react-alert-dialog";
|
|
25
29
|
import "@radix-ui/react-dialog";
|
|
26
30
|
import "@radix-ui/react-label";
|
|
27
|
-
import "@radix-ui/react-scroll-area";
|
|
28
31
|
import "@radix-ui/react-tabs";
|
|
29
32
|
import "@radix-ui/react-tooltip";
|
|
30
33
|
import "@radix-ui/react-popover";
|
|
@@ -37,11 +40,10 @@ import "@radix-ui/react-toast";
|
|
|
37
40
|
import "cmdk";
|
|
38
41
|
import "@radix-ui/react-context-menu";
|
|
39
42
|
import "react-icons-picker";
|
|
40
|
-
import "react-dom";
|
|
41
43
|
import "react-quill";
|
|
42
|
-
import "@floating-ui/react-dom";
|
|
43
|
-
import "flagged";
|
|
44
44
|
import "react-hotkeys-hook";
|
|
45
|
+
import "lodash";
|
|
46
|
+
import "lucide-react";
|
|
45
47
|
const n = [
|
|
46
48
|
{
|
|
47
49
|
title: "Mobile",
|
|
@@ -57,16 +59,16 @@ const n = [
|
|
|
57
59
|
icon: /* @__PURE__ */ i.jsx(t, { className: "rotate-90" }),
|
|
58
60
|
width: 700
|
|
59
61
|
}
|
|
60
|
-
],
|
|
62
|
+
], ii = (o) => {
|
|
61
63
|
const r = {
|
|
62
64
|
...o,
|
|
63
|
-
filterChaiBlock: (m) =>
|
|
65
|
+
filterChaiBlock: (m) => p(m.type, "Email/"),
|
|
64
66
|
importHTMLSupport: !1,
|
|
65
67
|
dataBindingSupport: !1,
|
|
66
68
|
breakpoints: n
|
|
67
69
|
};
|
|
68
|
-
return /* @__PURE__ */ i.jsx(
|
|
70
|
+
return /* @__PURE__ */ i.jsx(e, { ...r });
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
ii as ChaiBuilderEmail
|
|
72
74
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { includes as h, get as a, set as
|
|
5
|
-
import {
|
|
2
|
+
import x from "@rjsf/core";
|
|
3
|
+
import $ from "@rjsf/validator-ajv8";
|
|
4
|
+
import { includes as h, get as a, set as b, first as F } from "lodash-es";
|
|
5
|
+
import { aZ as P, a_ as E, a$ as O, b0 as S } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -61,7 +61,7 @@ const d = (i, l = "") => {
|
|
|
61
61
|
if (h(["slot", "styles"], t.type))
|
|
62
62
|
return;
|
|
63
63
|
const s = a(t, "i18n", !1) ? `${o}-${l}` : o;
|
|
64
|
-
e.items.properties[s] = y(t, l),
|
|
64
|
+
e.items.properties[s] = y(t, l), b(e.items, "title", a(t, "itemTitle", `${r} item`));
|
|
65
65
|
}), e;
|
|
66
66
|
default:
|
|
67
67
|
return {};
|
|
@@ -95,7 +95,7 @@ const d = (i, l = "") => {
|
|
|
95
95
|
return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
96
96
|
i && /* @__PURE__ */ u.jsx("h1", { className: "px-1 text-sm font-semibold underline", children: i }),
|
|
97
97
|
/* @__PURE__ */ u.jsx("div", { className: "-mx-3", children: /* @__PURE__ */ u.jsx(
|
|
98
|
-
|
|
98
|
+
x,
|
|
99
99
|
{
|
|
100
100
|
widgets: {
|
|
101
101
|
richtext: P,
|
|
@@ -113,7 +113,7 @@ const d = (i, l = "") => {
|
|
|
113
113
|
uiSchema: e,
|
|
114
114
|
schema: r,
|
|
115
115
|
formData: c,
|
|
116
|
-
validator:
|
|
116
|
+
validator: $,
|
|
117
117
|
onChange: o,
|
|
118
118
|
disabled: n
|
|
119
119
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./ChaiBuilderEditor-YqEKonJ_.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=$;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { get as o, last as g } from "lodash-es";
|
|
2
|
+
import { a as $ } from "./STRINGS--j49GZJP.js";
|
|
3
|
+
const h = (s, t = "") => {
|
|
4
|
+
const n = o(s, "bodyTextLightColor", "#64748b"), e = o(s, "bodyTextDarkColor", "#94a3b8"), c = o(s, "bodyBgLightColor", "#FFFFFF"), l = o(s, "bodyBgDarkColor", "#0f172a");
|
|
5
|
+
return `${t}font-body ${t}antialiased ${t}text-[${n}] ${t}bg-[${c}] dark:${t}text-[${e}] dark:${t}bg-[${l}]`;
|
|
6
|
+
}, b = (s, t = "") => {
|
|
7
|
+
const e = s.replace($, "").split(",").map((c) => c.split(" ").map((r) => {
|
|
8
|
+
if (r === "")
|
|
9
|
+
return "";
|
|
10
|
+
if (r.includes(":")) {
|
|
11
|
+
const a = r.split(":");
|
|
12
|
+
return a[a.length - 1] = t + g(a), a.join(":");
|
|
13
|
+
}
|
|
14
|
+
return `${t}${r}`;
|
|
15
|
+
}).join(" "));
|
|
16
|
+
return `${$}${e.join(" , ")}`;
|
|
17
|
+
}, k = (s) => {
|
|
18
|
+
if (!s)
|
|
19
|
+
return [];
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(s);
|
|
22
|
+
} catch {
|
|
23
|
+
return [{ _type: "Paragraph", _id: "error", content: "Invalid JSON. Please check the JSON string." }];
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
b as a,
|
|
28
|
+
k as c,
|
|
29
|
+
h as g
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("lodash-es"),g=require("./STRINGS-gPz7CUOk.cjs"),d=(t,s="")=>{const c=e.get(t,"bodyTextLightColor","#64748b"),o=e.get(t,"bodyTextDarkColor","#94a3b8"),n=e.get(t,"bodyBgLightColor","#FFFFFF"),l=e.get(t,"bodyBgDarkColor","#0f172a");return`${s}font-body ${s}antialiased ${s}text-[${c}] ${s}bg-[${n}] dark:${s}text-[${o}] dark:${s}bg-[${l}]`},u=(t,s="")=>{const o=t.replace(g.STYLES_KEY,"").split(",").map(n=>n.split(" ").map(r=>{if(r==="")return"";if(r.includes(":")){const a=r.split(":");return a[a.length-1]=s+e.last(a),a.join(":")}return`${s}${r}`}).join(" "));return`${g.STYLES_KEY}${o.join(" , ")}`},$=t=>{if(!t)return[];try{return JSON.parse(t)}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};exports.addPrefixToClasses=u;exports.convertToBlocks=$;exports.getBrandingClasses=d;
|
|
@@ -18,15 +18,14 @@ var v2 = (a, t, h, v) => ({
|
|
|
18
18
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
19
19
|
import * as b from "react";
|
|
20
20
|
import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
|
|
21
|
-
import
|
|
22
|
-
import { FileTextIcon as
|
|
23
|
-
import { u as
|
|
21
|
+
import "./core.js";
|
|
22
|
+
import { FileTextIcon as p0, GearIcon as V0, EyeClosedIcon as f0, EyeOpenIcon as m0 } from "@radix-ui/react-icons";
|
|
23
|
+
import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
24
24
|
import { toast as h1, Toaster as F0 } from "sonner";
|
|
25
25
|
import { useTranslation as D0 } from "react-i18next";
|
|
26
26
|
import { sortBy as R0, filter as k0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
|
|
27
27
|
import { g as W0 } from "./html-to-json-ZV4QjSww.js";
|
|
28
28
|
import { Loader as U0, Loader2 as j0, LogOutIcon as Q0 } from "lucide-react";
|
|
29
|
-
import { G as X2 } from "./index-YpnaudSM.js";
|
|
30
29
|
var N1 = class {
|
|
31
30
|
constructor() {
|
|
32
31
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -1619,7 +1618,7 @@ var i0 = b.createContext(
|
|
|
1619
1618
|
children: t
|
|
1620
1619
|
}) => (b.useEffect(() => (a.mount(), () => {
|
|
1621
1620
|
a.unmount();
|
|
1622
|
-
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1), z4 = () => b.useContext(e0),
|
|
1621
|
+
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1), z4 = () => b.useContext(e0), it = e0.Provider;
|
|
1623
1622
|
function g4() {
|
|
1624
1623
|
let a = !1;
|
|
1625
1624
|
return {
|
|
@@ -1826,9 +1825,9 @@ const I = {
|
|
|
1826
1825
|
}
|
|
1827
1826
|
});
|
|
1828
1827
|
}, A4 = () => {
|
|
1829
|
-
const [a] = ["SAVED"], [t, h] = m1(), v =
|
|
1828
|
+
const [a] = ["SAVED"], [t, h] = m1(), v = L0(), { t: r } = D0();
|
|
1830
1829
|
return (n) => a !== "SAVED" ? (h1.error(r("You have unsaved changes. Please save before changing the page.")), !1) : t === n.uuid ? !1 : (v(), setTimeout(() => h(n.uuid), 100), !0);
|
|
1831
|
-
},
|
|
1830
|
+
}, et = () => {
|
|
1832
1831
|
const a = G(), t = A4(), h = R();
|
|
1833
1832
|
return _({
|
|
1834
1833
|
mutationFn: async (v) => I.post(`${h}/pages`, v).then((r) => r.json()),
|
|
@@ -1872,7 +1871,7 @@ const I = {
|
|
|
1872
1871
|
});
|
|
1873
1872
|
}
|
|
1874
1873
|
});
|
|
1875
|
-
},
|
|
1874
|
+
}, dt = () => {
|
|
1876
1875
|
const a = G(), t = R();
|
|
1877
1876
|
return _({
|
|
1878
1877
|
mutationFn: async (h) => I.delete(`${t}/page`, h).then((v) => v.json()),
|
|
@@ -1929,10 +1928,10 @@ const I = {
|
|
|
1929
1928
|
});
|
|
1930
1929
|
};
|
|
1931
1930
|
function o0(a) {
|
|
1932
|
-
return
|
|
1931
|
+
return Y2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" } }] })(a);
|
|
1933
1932
|
}
|
|
1934
1933
|
function R4(a) {
|
|
1935
|
-
return
|
|
1934
|
+
return Y2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" } }] })(a);
|
|
1936
1935
|
}
|
|
1937
1936
|
const k4 = () => {
|
|
1938
1937
|
const { mutate: a, isPending: t } = b4(), [h] = m1(), { data: v } = M0(), r = b2(v, "lockedBy.name", ""), n = b2(v, "lockedBy.email", "");
|
|
@@ -1965,7 +1964,7 @@ const k4 = () => {
|
|
|
1965
1964
|
] })
|
|
1966
1965
|
] }),
|
|
1967
1966
|
/* @__PURE__ */ i.jsx(
|
|
1968
|
-
|
|
1967
|
+
X2,
|
|
1969
1968
|
{
|
|
1970
1969
|
disabled: t,
|
|
1971
1970
|
onClick: () => a(h),
|
|
@@ -2016,19 +2015,19 @@ const k4 = () => {
|
|
|
2016
2015
|
});
|
|
2017
2016
|
}, I4 = ({ children: a }) => {
|
|
2018
2017
|
const t = N4();
|
|
2019
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2020
|
-
/* @__PURE__ */ i.jsx(
|
|
2021
|
-
/* @__PURE__ */ i.jsxs(
|
|
2022
|
-
/* @__PURE__ */ i.jsxs(
|
|
2023
|
-
/* @__PURE__ */ i.jsxs(
|
|
2018
|
+
return /* @__PURE__ */ i.jsxs(x0, { children: [
|
|
2019
|
+
/* @__PURE__ */ i.jsx(w0, { asChild: !0, children: a }),
|
|
2020
|
+
/* @__PURE__ */ i.jsxs(B0, { children: [
|
|
2021
|
+
/* @__PURE__ */ i.jsxs(C0, { children: [
|
|
2022
|
+
/* @__PURE__ */ i.jsxs(O0, { children: [
|
|
2024
2023
|
"Are you sure, you want to ",
|
|
2025
2024
|
/* @__PURE__ */ i.jsx("span", { className: "text-red-500", children: "Sign Out" }),
|
|
2026
2025
|
"?"
|
|
2027
2026
|
] }),
|
|
2028
|
-
/* @__PURE__ */ i.jsx(
|
|
2027
|
+
/* @__PURE__ */ i.jsx(A0, { children: "Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information" })
|
|
2029
2028
|
] }),
|
|
2030
|
-
/* @__PURE__ */ i.jsxs(
|
|
2031
|
-
/* @__PURE__ */ i.jsx(
|
|
2029
|
+
/* @__PURE__ */ i.jsxs(S0, { children: [
|
|
2030
|
+
/* @__PURE__ */ i.jsx(y0, { disabled: t.isPending, children: "Cancel" }),
|
|
2032
2031
|
/* @__PURE__ */ i.jsxs(
|
|
2033
2032
|
"button",
|
|
2034
2033
|
{
|
|
@@ -2044,9 +2043,9 @@ const k4 = () => {
|
|
|
2044
2043
|
] })
|
|
2045
2044
|
] })
|
|
2046
2045
|
] });
|
|
2047
|
-
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-
|
|
2046
|
+
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-jHMmJEtv.js")), j4 = A2(() => import("./ProjectPanel-uxhq_D3j.js")), Q4 = A2(() => import("./CurrentPage-9KDre_9q.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
|
|
2048
2047
|
const { mutate: a } = y4();
|
|
2049
|
-
return
|
|
2048
|
+
return b0("editable", !0) ? /* @__PURE__ */ i.jsx(X2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
2050
2049
|
}, q4 = (a) => {
|
|
2051
2050
|
var f;
|
|
2052
2051
|
const { data: t, isLoading: h } = z0(), { data: v, isLoading: r } = g0(), { data: n } = M0(), { mutate: e } = O4(), { mutate: g } = S4(), [s] = m1(), p = D4(), z = P4(), x = F4(), F = R(), H = g2(
|
|
@@ -2080,8 +2079,8 @@ const k4 = () => {
|
|
|
2080
2079
|
},
|
|
2081
2080
|
sideBarComponents: {
|
|
2082
2081
|
top: [
|
|
2083
|
-
{ icon:
|
|
2084
|
-
{ icon:
|
|
2082
|
+
{ icon: p0, name: "pages", panel: U4 },
|
|
2083
|
+
{ icon: V0, name: "settings", panel: j4 },
|
|
2085
2084
|
...((f = a.sideBarComponents) == null ? void 0 : f.top) || []
|
|
2086
2085
|
],
|
|
2087
2086
|
bottom: [W4]
|
|
@@ -2092,7 +2091,7 @@ const k4 = () => {
|
|
|
2092
2091
|
getExternalPredefinedBlock: B,
|
|
2093
2092
|
getPages: () => v
|
|
2094
2093
|
};
|
|
2095
|
-
return /* @__PURE__ */ i.jsx(
|
|
2094
|
+
return /* @__PURE__ */ i.jsx(P0, { ...O });
|
|
2096
2095
|
}, _4 = ({ logo: a }) => {
|
|
2097
2096
|
const [t, h] = M2(!1), [v, r] = M2(""), [n, e] = M2(""), { mutate: g, isPending: s } = T4(), p = (z) => {
|
|
2098
2097
|
z.preventDefault(), g({ email: v, password: n });
|
|
@@ -2154,7 +2153,7 @@ const k4 = () => {
|
|
|
2154
2153
|
type: "button",
|
|
2155
2154
|
className: "absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",
|
|
2156
2155
|
onClick: () => h(!t),
|
|
2157
|
-
children: t ? /* @__PURE__ */ i.jsx(
|
|
2156
|
+
children: t ? /* @__PURE__ */ i.jsx(f0, {}) : /* @__PURE__ */ i.jsx(m0, {})
|
|
2158
2157
|
}
|
|
2159
2158
|
)
|
|
2160
2159
|
] }) }),
|
|
@@ -2183,19 +2182,19 @@ const k4 = () => {
|
|
|
2183
2182
|
return s0(() => {
|
|
2184
2183
|
v.setQueryData(["apiBaseUrl"], a.apiBaseUrl || "/api/chaibuilder");
|
|
2185
2184
|
}, [a.apiBaseUrl, v]), h ? /* @__PURE__ */ i.jsx(O2, {}) : t != null && t.valid ? /* @__PURE__ */ i.jsx(q4, { ...a }) : /* @__PURE__ */ i.jsx(_4, { logo: a.logo });
|
|
2186
|
-
}, J4 = new r4(),
|
|
2185
|
+
}, J4 = new r4(), zt = (a) => /* @__PURE__ */ i.jsxs(d4, { client: J4, children: [
|
|
2187
2186
|
/* @__PURE__ */ i.jsx(F0, { richColors: !0 }),
|
|
2188
2187
|
/* @__PURE__ */ i.jsx($4, { ...a })
|
|
2189
2188
|
] });
|
|
2190
2189
|
export {
|
|
2191
|
-
|
|
2190
|
+
zt as C,
|
|
2192
2191
|
z0 as a,
|
|
2193
2192
|
O4 as b,
|
|
2194
2193
|
A4 as c,
|
|
2195
2194
|
m1 as d,
|
|
2196
|
-
|
|
2195
|
+
et as e,
|
|
2197
2196
|
G as f,
|
|
2198
2197
|
S4 as g,
|
|
2199
|
-
|
|
2198
|
+
dt as h,
|
|
2200
2199
|
g0 as u
|
|
2201
2200
|
};
|