@chaibuilder/sdk 1.2.6 → 1.2.8
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-gbfzju1d.js → AddBlocks-tMxKPoen.js} +50 -50
- package/dist/{AddBlocks-wuKI1ieB.cjs → AddBlocks-x2LkOHSj.cjs} +1 -1
- package/dist/BrandingOptions-EzT9UYd6.cjs +1 -0
- package/dist/{BrandingOptions-mZXO7thQ.js → BrandingOptions-QJJ1y5ez.js} +55 -50
- package/dist/{CanvasArea-7GpvsKP6.js → CanvasArea-EfZgx-gN.js} +406 -404
- package/dist/CanvasArea-rIDwPHl5.cjs +60 -0
- package/dist/{CurrentPage-tHBommaV.cjs → CurrentPage-QNFPD078.cjs} +1 -1
- package/dist/{CurrentPage-C52wu_r7.js → CurrentPage-ulHTz4MD.js} +7 -7
- package/dist/{Layers-NDtp2-im.js → Layers-rehZkz78.js} +171 -148
- package/dist/Layers-v-7k3W2I.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-SPWd6Flk.js → MarkAsGlobalBlock-BjP-Rqlf.js} +6 -5
- package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +1 -0
- package/dist/{PagesPanel-qV7yGT-K.js → PagesPanel-acGVGJf-.js} +5 -5
- package/dist/{PagesPanel-qZ_-tybb.cjs → PagesPanel-x5ms_LOD.cjs} +1 -1
- package/dist/{ProjectPanel-vzyFbBNU.cjs → ProjectPanel-5BHQ5ANP.cjs} +1 -1
- package/dist/{ProjectPanel-RJqNz-uq.js → ProjectPanel-aLFJq49M.js} +5 -5
- package/dist/Settings-iOjfw5NQ.cjs +1 -0
- package/dist/{Settings-t0I7LKxe.js → Settings-v-txwlII.js} +172 -171
- package/dist/{SidePanels-rXx-fGjB.js → SidePanels-Vdc-J5wK.js} +96 -93
- package/dist/SidePanels-t0g9ZQFT.cjs +1 -0
- package/dist/Topbar-V8xCetWF.cjs +1 -0
- package/dist/{Topbar-ks1ckGLz.js → Topbar-j4t4AgCq.js} +4 -3
- package/dist/{UnsplashImages-8vJPuqrF.js → UnsplashImages-41Y3q5_Q.js} +7 -6
- package/dist/UnsplashImages-DbHky6cj.cjs +1 -0
- package/dist/UploadImages-DnQ95_NW.cjs +1 -0
- package/dist/{UploadImages-6N6UrjLo.js → UploadImages-xBg-kbKv.js} +13 -12
- package/dist/{add-page-modal-a8r8poMY.cjs → add-page-modal-0YAI9dXr.cjs} +1 -1
- package/dist/{add-page-modal-2VlONTs5.js → add-page-modal-6DlGzdA4.js} +5 -5
- package/dist/{confirm-alert-f3DYO5Hj.cjs → confirm-alert-U7-NcG7G.cjs} +1 -1
- package/dist/{confirm-alert-biqvaLT-.js → confirm-alert-i4pM3mOt.js} +4 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +19 -19
- package/dist/{delete-page-modal-_8O4RCkG.js → delete-page-modal-T_rlQfNd.js} +4 -4
- package/dist/{delete-page-modal-NmwHGjZP.cjs → delete-page-modal-qXpi_2xR.cjs} +1 -1
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +263 -24
- package/dist/{form-Moz_psOw.js → form-OVmsLOrc.js} +1 -1
- package/dist/{form-lJhy9DEC.cjs → form-VbouZlAW.cjs} +1 -1
- package/dist/html-to-json-2PeOCVey.cjs +1 -0
- package/dist/{html-to-json-yjzEN9OX.js → html-to-json-57841sEK.js} +25 -26
- package/dist/{index-482XFRhB.js → index-EGUphg4R.js} +5402 -5366
- package/dist/index-H6vIwGfD.cjs +1 -0
- package/dist/index-e0c8PmRQ.js +205 -0
- package/dist/index-gi1LIOCw.cjs +1 -0
- package/dist/{index-3OU9zl6c.cjs → index-jw8RxsTv.cjs} +33 -33
- package/dist/{index-_OgCuSUz.js → index-niHREMmR.js} +1051 -1043
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +20 -21
- package/dist/mockServiceWorker.js +1 -1
- package/dist/{page-viewer-ajtG_WZC.js → page-viewer-EoYYnA56.js} +5 -5
- package/dist/{page-viewer-k2VlWE3T.cjs → page-viewer-Ou8vDXGV.cjs} +1 -1
- package/dist/{project-general-setting-tAgCjUtR.cjs → project-general-setting-92q4oEYv.cjs} +1 -1
- package/dist/{project-general-setting-TIHLI4Qg.js → project-general-setting-DC_nADG-.js} +5 -5
- package/dist/{project-seo-setting-9JGBPzcA.cjs → project-seo-setting-Snn2nZgS.cjs} +1 -1
- package/dist/{project-seo-setting-dXclexQW.js → project-seo-setting-wxAGEkd_.js} +8 -7
- package/dist/{single-page-detail-6btKDNjs.cjs → single-page-detail-QmmhR_h2.cjs} +1 -1
- package/dist/{single-page-detail-lST7hWvC.js → single-page-detail-xtNZ9YxX.js} +6 -6
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +4 -4
- package/dist/style.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +134 -133
- package/dist/{useAddBlockByDrop-uPXvrg4G.js → useAddBlockByDrop-_nwI4W3q.js} +1 -1
- package/dist/{useAddBlockByDrop-_nd8yZBa.cjs → useAddBlockByDrop-inkD7Lck.cjs} +1 -1
- package/dist/web-blocks.cjs +2 -2
- package/dist/web-blocks.js +138 -139
- package/package.json +5 -5
- package/dist/BrandingOptions-arKT1zCy.cjs +0 -1
- package/dist/CanvasArea-jvwkPvtQ.cjs +0 -59
- package/dist/Layers-4G-0aNk9.cjs +0 -1
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +0 -1
- package/dist/Settings-SV08lVcH.cjs +0 -1
- package/dist/SidePanels-TOJotvzn.cjs +0 -1
- package/dist/Topbar-u5XKdWgQ.cjs +0 -1
- package/dist/UnsplashImages-V8oKEHfi.cjs +0 -1
- package/dist/UploadImages-eHYxwWAp.cjs +0 -1
- package/dist/html-to-json-5UoswV2Q.cjs +0 -1
- package/dist/index-IIJ_o44s.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),x=require("react"),P=require("lodash-es"),t=require("./index-H6vIwGfD.cjs"),g=require("./controls-Dy1qa8Dc.cjs"),R=require("./form-VbouZlAW.cjs"),f=require("./index-jw8RxsTv.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");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");const b=({closeModal:i})=>{var l,q;const u=f.useAddPage(),[r,m]=x.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{},template:""}),p=()=>{u.mutate(r,{onSuccess:()=>i()})},j=({formData:n},s)=>{m(o=>{var d,c;const a={[s]:n[s]};return s==="name"?a.slug=P.kebabCase((d=n[s])==null?void 0:d.replace(/\d/g,"")):s==="slug"&&(a.slug=(c=n[s])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...o,...a}})},h={name:g.u({title:"Page Name",default:r.name}),slug:g.u({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(t.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(R.Form,{formData:r,properties:h,onChange:j,disabled:u.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(t.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((q=r.slug)==null?void 0:q.length)<2||u.isPending,onClick:p,children:"Add Page"})})]})},E=()=>{const[i,u]=x.useState(!1);return e.jsxRuntimeExports.jsxs(t.Dialog,{open:i,onOpenChange:()=>u(!i),children:[e.jsxRuntimeExports.jsx(t.DialogTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>u(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(b,{closeModal:()=>u(!i)})]})};exports.default=E;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import { useState as c } from "react";
|
|
3
3
|
import { kebabCase as j } from "lodash-es";
|
|
4
|
-
import {
|
|
4
|
+
import { am as b, B as u, al as C, b9 as A } from "./index-niHREMmR.js";
|
|
5
5
|
import { u as g } from "./controls-XPXGHKht.js";
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { g as N } from "./index-
|
|
6
|
+
import { F as D } from "./form-OVmsLOrc.js";
|
|
7
|
+
import { g as N } from "./index-EGUphg4R.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "@radix-ui/react-toggle";
|
|
10
10
|
import "class-variance-authority";
|
|
@@ -39,6 +39,7 @@ import "flat-to-nested";
|
|
|
39
39
|
import "./Functions-7jnEwJyw.js";
|
|
40
40
|
import "redux-undo";
|
|
41
41
|
import "@chaibuilder/runtime";
|
|
42
|
+
import "lodash";
|
|
42
43
|
import "@react-hookz/web";
|
|
43
44
|
import "react-i18next";
|
|
44
45
|
import "@rjsf/core";
|
|
@@ -51,9 +52,8 @@ import "react-dnd";
|
|
|
51
52
|
import "@minoru/react-dnd-treeview";
|
|
52
53
|
import "react-hotkeys-hook";
|
|
53
54
|
import "sonner";
|
|
54
|
-
import "./html-to-json-
|
|
55
|
+
import "./html-to-json-57841sEK.js";
|
|
55
56
|
import "himalaya";
|
|
56
|
-
import "lodash";
|
|
57
57
|
import "lucide-react";
|
|
58
58
|
import "./web-blocks.js";
|
|
59
59
|
const S = ({ closeModal: i }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-H6vIwGfD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");require("react-i18next");const x=({open:q,onCancel:t=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:q,children:e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTitle,{children:n}),i&&e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:i}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u,onClick:t,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import {
|
|
2
|
+
import { E as a, G as n, I as c, J as x, L as j, B as d } from "./index-niHREMmR.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@radix-ui/react-toggle";
|
|
@@ -36,9 +36,10 @@ import "flat-to-nested";
|
|
|
36
36
|
import "./Functions-7jnEwJyw.js";
|
|
37
37
|
import "redux-undo";
|
|
38
38
|
import "@chaibuilder/runtime";
|
|
39
|
+
import "lodash";
|
|
39
40
|
import "@react-hookz/web";
|
|
40
41
|
import "react-i18next";
|
|
41
|
-
const
|
|
42
|
+
const ti = ({
|
|
42
43
|
open: o,
|
|
43
44
|
onCancel: m = () => {
|
|
44
45
|
},
|
|
@@ -57,5 +58,5 @@ const ri = ({
|
|
|
57
58
|
] })
|
|
58
59
|
] }) });
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
ti as default
|
|
61
62
|
};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-jw8RxsTv.cjs"),e=require("./index-H6vIwGfD.cjs"),r=require("react-i18next");require("i18next");require("./jsx-runtime-Z_BpKhVy.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("react-textarea-autosize");require("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@radix-ui/react-icons");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("./MODIFIERS-2FeVfZQ9.cjs");require("lucide-react");require("./web-blocks.cjs");require("./controls-Dy1qa8Dc.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.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("flat-to-nested");require("redux-undo");require("lodash");require("@react-hookz/web");exports.ChaiBuilderEditor=s.ChaiBuilderEditor;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.useProject=e.useProject;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as ss } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { k as ss } from "./index-EGUphg4R.js";
|
|
2
|
+
import { O as as, ag as os, P as ts, ai as rs, Q as is, af as ps, x as ls, i as ms, z as us, R as cs, p as ds, U as ks, V as Bs, k as ns, W as Ss, n as Cs, X as Ps, Y as vs, m as gs, M as As, Z as ys, _ as Ms, $ as hs, a0 as Ds, a1 as Is, o as Rs, h as fs, a2 as xs, N as Ts, l as Us, a4 as bs, ah as js, a7 as ws, a6 as Hs, a5 as Os, j as Fs, ae as Gs, aj as Ws, ak as Zs, w as zs, a8 as Es, aa as Ls, a3 as Ns, ab as Qs, a9 as Vs, ac as Xs, ad as Ys } from "./index-niHREMmR.js";
|
|
3
|
+
import { useTranslation as $s } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -21,10 +21,9 @@ import "react-hotkeys-hook";
|
|
|
21
21
|
import "@chaibuilder/runtime";
|
|
22
22
|
import "@radix-ui/react-icons";
|
|
23
23
|
import "sonner";
|
|
24
|
-
import "./html-to-json-
|
|
24
|
+
import "./html-to-json-57841sEK.js";
|
|
25
25
|
import "himalaya";
|
|
26
26
|
import "./MODIFIERS-RiXS5Mn1.js";
|
|
27
|
-
import "lodash";
|
|
28
27
|
import "lucide-react";
|
|
29
28
|
import "./web-blocks.js";
|
|
30
29
|
import "./controls-XPXGHKht.js";
|
|
@@ -52,6 +51,7 @@ import "react-icons-picker";
|
|
|
52
51
|
import "react-quill";
|
|
53
52
|
import "flat-to-nested";
|
|
54
53
|
import "redux-undo";
|
|
54
|
+
import "lodash";
|
|
55
55
|
import "@react-hookz/web";
|
|
56
56
|
export {
|
|
57
57
|
ss as ChaiBuilderEditor,
|
|
@@ -66,16 +66,16 @@ export {
|
|
|
66
66
|
us as useBuilderReset,
|
|
67
67
|
cs as useBuildingBlocks,
|
|
68
68
|
ds as useCanvasHistory,
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
ks as useCanvasWidth,
|
|
70
|
+
Bs as useCanvasZoom,
|
|
71
71
|
ns as useCopyBlockIds,
|
|
72
72
|
Ss as useCurrentPage,
|
|
73
73
|
Cs as useCutBlockIds,
|
|
74
74
|
Ps as useDarkMode,
|
|
75
75
|
vs as useDeveloperPreviewMode,
|
|
76
76
|
gs as useDuplicateBlocks,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
As as useFeatureSupport,
|
|
78
|
+
ys as useGetPageData,
|
|
79
79
|
Ms as useHiddenBlockIds,
|
|
80
80
|
hs as useHighlightBlockId,
|
|
81
81
|
Ds as useMarkAsGlobalBlock,
|
|
@@ -92,15 +92,15 @@ export {
|
|
|
92
92
|
Os as useSelectedBlockCurrentClasses,
|
|
93
93
|
Fs as useSelectedBlockIds,
|
|
94
94
|
Gs as useSelectedBlocksDisplayChild,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
Ws as useSelectedBreakpoints,
|
|
96
|
+
Zs as useSelectedStylingBlocks,
|
|
97
|
+
zs as useSetAllBlocks,
|
|
98
98
|
Es as useStylingBreakpoint,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
Ls as useStylingState,
|
|
100
|
+
$s as useTranslation,
|
|
101
|
+
Ns as useTranslations,
|
|
102
|
+
Qs as useTreeData,
|
|
103
|
+
Vs as useUILibraryBlocks,
|
|
104
|
+
Xs as useUpdateBlocksProps,
|
|
105
|
+
Ys as useUpdateBlocksPropsRealtime
|
|
106
106
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import {
|
|
3
|
-
import { j as x } from "./index-
|
|
2
|
+
import { E as s, F as l, G as n, I as d, J as a, L as c, B as u } from "./index-niHREMmR.js";
|
|
3
|
+
import { j as x } from "./index-EGUphg4R.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -37,6 +37,7 @@ import "flat-to-nested";
|
|
|
37
37
|
import "./Functions-7jnEwJyw.js";
|
|
38
38
|
import "redux-undo";
|
|
39
39
|
import "@chaibuilder/runtime";
|
|
40
|
+
import "lodash";
|
|
40
41
|
import "@react-hookz/web";
|
|
41
42
|
import "react-i18next";
|
|
42
43
|
import "i18next";
|
|
@@ -47,9 +48,8 @@ import "react-dnd";
|
|
|
47
48
|
import "@minoru/react-dnd-treeview";
|
|
48
49
|
import "react-hotkeys-hook";
|
|
49
50
|
import "sonner";
|
|
50
|
-
import "./html-to-json-
|
|
51
|
+
import "./html-to-json-57841sEK.js";
|
|
51
52
|
import "himalaya";
|
|
52
|
-
import "lodash";
|
|
53
53
|
import "lucide-react";
|
|
54
54
|
import "./web-blocks.js";
|
|
55
55
|
import "./controls-XPXGHKht.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-H6vIwGfD.cjs"),q=require("./index-jw8RxsTv.cjs"),l=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");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("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("lodash");require("@react-hookz/web");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("./controls-Dy1qa8Dc.cjs");const d=({pageData:i,projectData:t})=>{const n={},u=q.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(l.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;
|
package/dist/email-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-es"),l=require("./jsx-runtime-Z_BpKhVy.cjs"),c=require("@react-email/components"),i=require("@chaibuilder/runtime"),r=require("./controls-Dy1qa8Dc.cjs"),s=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");const p=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:o});i.registerChaiBlock(p,{type:"Container",label:"Container",group:"basic",category:"core",props:{styles:r.S({default:""})},canAcceptBlock:()=>!0,canMove:()=>!0,canDelete:()=>!1,canDuplicate:()=>!1});const x=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});i.registerChaiBlock(x,{type:"Section",label:"Section",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:"w-full"}),align:r.f({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})=>l.jsxRuntimeExports.jsx(c.Row,{...e,...t,children:o});i.registerChaiBlock(g,{type:"Row",label:"Row",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const m=({blockProps:e,styles:t,children:o,align:n})=>l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:o});i.registerChaiBlock(m,{type:"Column",label:"Column",group:"basic",category:"core",icon:s.ImageIcon,props:{styles:r.S({default:""}),align:r.f({title:"Align",default:"",options:[{value:"",title:"None"},{value:"left",title:"left"},{value:"center",title:"center"},{value:"right",title:"right"}]})},canAcceptBlock:()=>!0});const h=({level:e,blockProps:t,styles:o,content:n})=>l.jsxRuntimeExports.jsx(c.Heading,{as:e,...t,...o,children:n}),k=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("h1",{...e,...t,children:o});i.registerChaiBlock(h,{type:"Heading",label:"Heading",group:"basic",category:"core",icon:s.HeadingIcon,builderComponent:k,props:{content:r.u({title:"Content",default:"Enter your heading here..."}),styles:r.S({default:"text-xl"}),level:r.f({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=>["Link","RawText"].includes(e)});const b=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx(c.Text,{...e,...t,children:o}),B=({content:e,blockProps:t,styles:o})=>l.jsxRuntimeExports.jsx("p",{...t,...o,children:e});i.registerChaiBlock(b,{type:"Text",label:"Text",group:"basic",category:"core",icon:s.TextIcon,builderComponent:B,props:{content:r.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:r.S({default:""})},canAcceptBlock:e=>["Link","RawText"].includes(e)});const f=({content:e})=>e,C=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});i.registerChaiBlock(f,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:s.TextIcon,hidden:!0,builderComponent:C,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const j=({blockProps:e,styles:t,link:o,content:n})=>l.jsxRuntimeExports.jsx(c.Button,{...e,...t,href:o.href,children:n}),y=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("button",{type:"button",...e,...t,children:o});i.registerChaiBlock(j,{type:"Button",label:"Button",group:"basic",category:"core",builderComponent:y,props:{content:r.u({title:"Content",default:"Click me"}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"bg-primary text-white px-4 py-2 rounded-md"})}});const v=({blockProps:e,styles:t,href:o,content:n,target:a})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:a,children:n}),R=({blockProps:e,styles:t,content:o,children:n})=>l.jsxRuntimeExports.jsx("span",{...e,...t,children:n||o});i.registerChaiBlock(v,{type:"Link",label:"Link",group:"basic",category:"core",icon:s.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:R,props:{content:r.u({title:"Content",default:"I am a link."}),link:r.q({title:"Link",default:{href:"https://chaibuilder.com",target:"_blank",type:"url"}}),styles:r.S({default:"font-bold text-blue-500"})},canAcceptBlock:()=>!0});const E=({blockProps:e,styles:t,children:o})=>l.jsxRuntimeExports.jsx(c.Preview,{...e,...t,children:o}),I=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:o});i.registerChaiBlock(E,{type:"Preview",label:"Preview",group:"basic",category:"core",builderComponent:I,canAcceptBlock:()=>!0,canDuplicate:()=>!1});const w=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});i.registerChaiBlock(w,{type:"Markdown",label:"Markdown",group:"basic",category:"core",props:{content:r.g({default:"# This is a ~~strikethrough~~",title:"Markdown"})}});const S=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:a,height:u}),L=({blockProps:e,styles:t,alt:o,image:n,width:a,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:a,height:u});i.registerChaiBlock(S,{type:"Image",label:"Image",group:"basic",category:"core",icon:s.ImageIcon,builderComponent:L,props:{styles:r.S({default:"w-full"}),image:r.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:r.u({title:"Alt",default:""}),width:r.u({title:"Width",default:""}),height:r.u({title:"Height",default:""})}});const T=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx(c.Hr,{...e,...t}),H=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});i.registerChaiBlock(T,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:s.DividerHorizontalIcon,builderComponent:H,props:{styles:r.S({default:"w-full h-2"})}});const q=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:a,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:a,language:u}),A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});i.registerChaiBlock(q,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:s.CodeSandboxLogoIcon,builderComponent:A,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"}),theme:r.u({title:"Theme",default:"dracula"}),lineNumbers:r.r({title:"Line number",default:!1}),language:r.f({title:"Language",default:"javascript",binding:!1,options:[{value:"javascript",title:"JavaScript"},{value:"html",title:"HTML"},{value:"css",title:"CSS"}]})}});const D=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),M=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});i.registerChaiBlock(D,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:s.CodeSandboxLogoIcon,builderComponent:M,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const _=d.noop;exports.loadEmailBlocks=_;
|
package/dist/email-blocks.js
CHANGED
|
@@ -1,35 +1,274 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { noop as b } from "lodash-es";
|
|
2
|
+
import { j as l } from "./jsx-runtime-WbnYoNE9.js";
|
|
3
|
+
import { Container as f, Section as k, Row as y, Column as x, Heading as B, Text as C, Button as v, Link as j, Preview as w, Markdown as I, Img as L, Hr as T, CodeBlock as H, CodeInline as A } from "@react-email/components";
|
|
4
|
+
import { registerChaiBlock as r } from "@chaibuilder/runtime";
|
|
5
|
+
import { S as i, f as d, u as a, g as s, q as g, o as R, r as S } from "./controls-XPXGHKht.js";
|
|
6
|
+
import { ImageIcon as p, HeadingIcon as D, TextIcon as m, Link1Icon as M, DividerHorizontalIcon as _, CodeSandboxLogoIcon as h } from "@radix-ui/react-icons";
|
|
6
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
8
|
import "react";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */ o.jsx(
|
|
11
|
-
c,
|
|
12
|
-
{
|
|
13
|
-
href: "https://example.com",
|
|
14
|
-
className: "c-bg-red-500 c-px-4 c-py-1 c-border c-rounded-md c-inline-block c-text-white c-font-bold",
|
|
15
|
-
children: "Click me"
|
|
16
|
-
}
|
|
17
|
-
),
|
|
18
|
-
/* @__PURE__ */ o.jsx(n, {}),
|
|
19
|
-
/* @__PURE__ */ o.jsx(l, { children: "@react-email/code-inline" }),
|
|
20
|
-
";",
|
|
21
|
-
t
|
|
22
|
-
] });
|
|
23
|
-
m(a, {
|
|
9
|
+
const N = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(f, { ...e, ...t, children: o });
|
|
10
|
+
r(N, {
|
|
24
11
|
type: "Container",
|
|
25
12
|
label: "Container",
|
|
26
13
|
group: "basic",
|
|
27
14
|
category: "core",
|
|
15
|
+
props: { styles: i({ default: "" }) },
|
|
16
|
+
canAcceptBlock: () => !0,
|
|
17
|
+
canMove: () => !0,
|
|
18
|
+
canDelete: () => !1,
|
|
19
|
+
canDuplicate: () => !1
|
|
20
|
+
});
|
|
21
|
+
const P = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(k, { ...e, ...t, children: o });
|
|
22
|
+
r(P, {
|
|
23
|
+
type: "Section",
|
|
24
|
+
label: "Section",
|
|
25
|
+
group: "basic",
|
|
26
|
+
category: "core",
|
|
27
|
+
icon: p,
|
|
28
|
+
props: {
|
|
29
|
+
styles: i({ default: "w-full" }),
|
|
30
|
+
align: d({
|
|
31
|
+
title: "Align",
|
|
32
|
+
default: "",
|
|
33
|
+
options: [
|
|
34
|
+
{ value: "", title: "None" },
|
|
35
|
+
{ value: "left", title: "left" },
|
|
36
|
+
{ value: "center", title: "center" },
|
|
37
|
+
{ value: "right", title: "right" }
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
canAcceptBlock: () => !0
|
|
42
|
+
});
|
|
43
|
+
const $ = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(y, { ...e, ...t, children: o });
|
|
44
|
+
r($, {
|
|
45
|
+
type: "Row",
|
|
46
|
+
label: "Row",
|
|
47
|
+
group: "basic",
|
|
48
|
+
category: "core",
|
|
49
|
+
icon: p,
|
|
50
|
+
props: {
|
|
51
|
+
styles: i({ default: "" })
|
|
52
|
+
},
|
|
53
|
+
canAcceptBlock: (e) => e === "Column"
|
|
54
|
+
});
|
|
55
|
+
const E = ({ blockProps: e, styles: t, children: o, align: n }) => /* @__PURE__ */ l.jsx(x, { ...e, ...t, align: n, children: o });
|
|
56
|
+
r(E, {
|
|
57
|
+
type: "Column",
|
|
58
|
+
label: "Column",
|
|
59
|
+
group: "basic",
|
|
60
|
+
category: "core",
|
|
61
|
+
icon: p,
|
|
62
|
+
props: {
|
|
63
|
+
styles: i({ default: "" }),
|
|
64
|
+
align: d({
|
|
65
|
+
title: "Align",
|
|
66
|
+
default: "",
|
|
67
|
+
options: [
|
|
68
|
+
{ value: "", title: "None" },
|
|
69
|
+
{ value: "left", title: "left" },
|
|
70
|
+
{ value: "center", title: "center" },
|
|
71
|
+
{ value: "right", title: "right" }
|
|
72
|
+
]
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
canAcceptBlock: () => !0
|
|
76
|
+
});
|
|
77
|
+
const q = ({ level: e, blockProps: t, styles: o, content: n }) => /* @__PURE__ */ l.jsx(B, { as: e, ...t, ...o, children: n }), z = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("h1", { ...e, ...t, children: o });
|
|
78
|
+
r(q, {
|
|
79
|
+
type: "Heading",
|
|
80
|
+
label: "Heading",
|
|
81
|
+
group: "basic",
|
|
82
|
+
category: "core",
|
|
83
|
+
icon: D,
|
|
84
|
+
builderComponent: z,
|
|
85
|
+
props: {
|
|
86
|
+
content: a({ title: "Content", default: "Enter your heading here..." }),
|
|
87
|
+
styles: i({ default: "text-xl" }),
|
|
88
|
+
level: d({
|
|
89
|
+
title: "Level",
|
|
90
|
+
default: "h1",
|
|
91
|
+
binding: !1,
|
|
92
|
+
options: [
|
|
93
|
+
{ value: "h1", title: "h1" },
|
|
94
|
+
{ value: "h2", title: "h2" },
|
|
95
|
+
{ value: "h3", title: "h3" },
|
|
96
|
+
{ value: "h4", title: "h4" },
|
|
97
|
+
{ value: "h5", title: "h5" },
|
|
98
|
+
{ value: "h6", title: "h6" }
|
|
99
|
+
]
|
|
100
|
+
})
|
|
101
|
+
},
|
|
102
|
+
canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
|
|
103
|
+
});
|
|
104
|
+
const J = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx(C, { ...e, ...t, children: o }), U = ({ content: e, blockProps: t, styles: o }) => /* @__PURE__ */ l.jsx("p", { ...t, ...o, children: e });
|
|
105
|
+
r(J, {
|
|
106
|
+
type: "Text",
|
|
107
|
+
label: "Text",
|
|
108
|
+
group: "basic",
|
|
109
|
+
category: "core",
|
|
110
|
+
icon: m,
|
|
111
|
+
builderComponent: U,
|
|
112
|
+
props: {
|
|
113
|
+
content: s({
|
|
114
|
+
title: "Content",
|
|
115
|
+
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."
|
|
116
|
+
}),
|
|
117
|
+
styles: i({ default: "" })
|
|
118
|
+
},
|
|
119
|
+
canAcceptBlock: (e) => ["Link", "RawText"].includes(e)
|
|
120
|
+
});
|
|
121
|
+
const V = ({ content: e }) => e, W = ({ content: e, blockProps: t }) => /* @__PURE__ */ l.jsx("span", { ...t, children: e });
|
|
122
|
+
r(V, {
|
|
123
|
+
type: "RawText",
|
|
124
|
+
label: "Raw Text",
|
|
125
|
+
group: "basic",
|
|
126
|
+
category: "core",
|
|
127
|
+
icon: m,
|
|
128
|
+
hidden: !0,
|
|
129
|
+
builderComponent: W,
|
|
130
|
+
props: {
|
|
131
|
+
content: s({
|
|
132
|
+
title: "Content",
|
|
133
|
+
default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
const F = ({ blockProps: e, styles: t, link: o, content: n }) => /* @__PURE__ */ l.jsx(v, { ...e, ...t, href: o.href, children: n }), G = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("button", { type: "button", ...e, ...t, children: o });
|
|
138
|
+
r(F, {
|
|
139
|
+
type: "Button",
|
|
140
|
+
label: "Button",
|
|
141
|
+
group: "basic",
|
|
142
|
+
category: "core",
|
|
143
|
+
builderComponent: G,
|
|
144
|
+
props: {
|
|
145
|
+
content: a({ title: "Content", default: "Click me" }),
|
|
146
|
+
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
147
|
+
styles: i({ default: "bg-primary text-white px-4 py-2 rounded-md" })
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
const K = ({ blockProps: e, styles: t, href: o, content: n, target: c }) => /* @__PURE__ */ l.jsx(j, { ...e, ...t, href: o, target: c, children: n }), O = ({ blockProps: e, styles: t, content: o, children: n }) => /* @__PURE__ */ l.jsx("span", { ...e, ...t, children: n || o });
|
|
151
|
+
r(K, {
|
|
152
|
+
type: "Link",
|
|
153
|
+
label: "Link",
|
|
154
|
+
group: "basic",
|
|
155
|
+
category: "core",
|
|
156
|
+
icon: M,
|
|
157
|
+
blocks: [
|
|
158
|
+
{
|
|
159
|
+
_id: "a",
|
|
160
|
+
_type: "Link"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
_id: "b",
|
|
164
|
+
_parent: "a",
|
|
165
|
+
_type: "RawText",
|
|
166
|
+
content: "I am a link."
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
builderComponent: O,
|
|
170
|
+
props: {
|
|
171
|
+
content: a({ title: "Content", default: "I am a link." }),
|
|
172
|
+
link: g({ title: "Link", default: { href: "https://chaibuilder.com", target: "_blank", type: "url" } }),
|
|
173
|
+
styles: i({ default: "font-bold text-blue-500" })
|
|
174
|
+
},
|
|
175
|
+
canAcceptBlock: () => !0
|
|
176
|
+
});
|
|
177
|
+
const Q = ({ blockProps: e, styles: t, children: o }) => /* @__PURE__ */ l.jsx(w, { ...e, ...t, children: o }), X = ({ blockProps: e, styles: t, content: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: o });
|
|
178
|
+
r(Q, {
|
|
179
|
+
type: "Preview",
|
|
180
|
+
label: "Preview",
|
|
181
|
+
group: "basic",
|
|
182
|
+
category: "core",
|
|
183
|
+
builderComponent: X,
|
|
184
|
+
canAcceptBlock: () => !0,
|
|
185
|
+
canDuplicate: () => !1
|
|
186
|
+
});
|
|
187
|
+
const Y = ({ blockProps: e, content: t }) => /* @__PURE__ */ l.jsx(I, { children: t, ...e });
|
|
188
|
+
r(Y, {
|
|
189
|
+
type: "Markdown",
|
|
190
|
+
label: "Markdown",
|
|
191
|
+
group: "basic",
|
|
192
|
+
category: "core",
|
|
193
|
+
props: {
|
|
194
|
+
content: s({ default: "# This is a ~~strikethrough~~", title: "Markdown" })
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const Z = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx(L, { ...e, ...t, src: n, alt: o, width: c, height: u }), ee = ({ blockProps: e, styles: t, alt: o, image: n, width: c, height: u }) => /* @__PURE__ */ l.jsx("img", { ...e, ...t, src: n, alt: o, width: c, height: u });
|
|
198
|
+
r(Z, {
|
|
199
|
+
type: "Image",
|
|
200
|
+
label: "Image",
|
|
201
|
+
group: "basic",
|
|
202
|
+
category: "core",
|
|
203
|
+
icon: p,
|
|
204
|
+
builderComponent: ee,
|
|
205
|
+
props: {
|
|
206
|
+
styles: i({ default: "w-full" }),
|
|
207
|
+
image: R({
|
|
208
|
+
title: "Image",
|
|
209
|
+
default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
|
|
210
|
+
}),
|
|
211
|
+
alt: a({ title: "Alt", default: "" }),
|
|
212
|
+
width: a({ title: "Width", default: "" }),
|
|
213
|
+
height: a({ title: "Height", default: "" })
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const te = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx(T, { ...e, ...t }), oe = ({ blockProps: e, styles: t }) => /* @__PURE__ */ l.jsx("hr", { ...e, ...t });
|
|
217
|
+
r(te, {
|
|
218
|
+
type: "Divider",
|
|
219
|
+
label: "Divider",
|
|
220
|
+
group: "basic",
|
|
221
|
+
category: "core",
|
|
222
|
+
icon: _,
|
|
223
|
+
builderComponent: oe,
|
|
224
|
+
props: {
|
|
225
|
+
styles: i({ default: "w-full h-2" })
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
const le = ({ blockProps: e, styles: t, code: o, lineNumbers: n, theme: c, language: u }) => /* @__PURE__ */ l.jsx(H, { ...e, ...t, code: o, linenumbers: n, theme: c, language: u }), ne = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("div", { ...e, ...t, children: /* @__PURE__ */ l.jsx("code", { children: o }) });
|
|
229
|
+
r(le, {
|
|
230
|
+
type: "CodeBlock",
|
|
231
|
+
label: "Code Block",
|
|
232
|
+
group: "basic",
|
|
233
|
+
category: "core",
|
|
234
|
+
hidden: !0,
|
|
235
|
+
icon: h,
|
|
236
|
+
builderComponent: ne,
|
|
237
|
+
props: {
|
|
238
|
+
styles: i({ default: "" }),
|
|
239
|
+
code: s({ title: "Code", default: "console.log('Hello, world!');" }),
|
|
240
|
+
theme: a({ title: "Theme", default: "dracula" }),
|
|
241
|
+
lineNumbers: S({
|
|
242
|
+
title: "Line number",
|
|
243
|
+
default: !1
|
|
244
|
+
}),
|
|
245
|
+
language: d({
|
|
246
|
+
title: "Language",
|
|
247
|
+
default: "javascript",
|
|
248
|
+
binding: !1,
|
|
249
|
+
options: [
|
|
250
|
+
{ value: "javascript", title: "JavaScript" },
|
|
251
|
+
{ value: "html", title: "HTML" },
|
|
252
|
+
{ value: "css", title: "CSS" }
|
|
253
|
+
//add more options
|
|
254
|
+
]
|
|
255
|
+
})
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
const re = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx(A, { ...e, ...t, children: o }), ie = ({ blockProps: e, styles: t, code: o }) => /* @__PURE__ */ l.jsx("code", { ...e, ...t, children: o });
|
|
259
|
+
r(re, {
|
|
260
|
+
type: "CodeInline",
|
|
261
|
+
label: "Code Inline",
|
|
262
|
+
group: "basic",
|
|
263
|
+
category: "core",
|
|
264
|
+
icon: h,
|
|
265
|
+
builderComponent: ie,
|
|
28
266
|
props: {
|
|
29
|
-
styles:
|
|
267
|
+
styles: i({ default: "" }),
|
|
268
|
+
code: s({ title: "Code", default: "console.log('Hello, world!');" })
|
|
30
269
|
}
|
|
31
270
|
});
|
|
32
|
-
const
|
|
271
|
+
const he = b;
|
|
33
272
|
export {
|
|
34
|
-
|
|
273
|
+
he as loadEmailBlocks
|
|
35
274
|
};
|
|
@@ -2,7 +2,7 @@ import { j as u } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import b from "@rjsf/core";
|
|
3
3
|
import x from "@rjsf/validator-ajv8";
|
|
4
4
|
import { includes as h, get as a, set as $, first as F } from "lodash-es";
|
|
5
|
-
import { bc as P, bd as E, be as O, bf as S } from "./index-
|
|
5
|
+
import { bc as P, bd as E, be as O, bf as S } from "./index-niHREMmR.js";
|
|
6
6
|
const d = (i, l = "") => {
|
|
7
7
|
switch (i.type) {
|
|
8
8
|
case "singular":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-
|
|
1
|
+
"use strict";const f=require("./jsx-runtime-Z_BpKhVy.cjs"),y=require("@rjsf/core"),E=require("@rjsf/validator-ajv8"),i=require("lodash-es"),d=require("./index-H6vIwGfD.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 @@
|
|
|
1
|
+
"use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),e=require("lodash-es"),o=require("./MODIFIERS-2FeVfZQ9.cjs"),T=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,r=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||r.test(t)},v=t=>{if(e.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(s),l=t.match(r),i=a?a[1]:l?l[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(c.test(i)||n.test(i))?i:t},w={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},x=(t,s)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],s._type),h=t=>t.map(s=>s.type==="text"?e.get(s,"content",""):e.isEmpty(s.children)?"":h(s.children)).join(""),g=t=>t===null?!0:t,y=t=>{const s={},r=w[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:i})=>{if(r[l]){if(t.tagName==="img"&&l==="src"&&!i.startsWith("http")){const c=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});c&&n?i=`https://via.placeholder.com/${c==null?void 0:c.value}x${n==null?void 0:n.value}`:i="https://via.placeholder.com/150x150"}e.set(s,r[l],g(i))}else e.includes(["style","class","srcset"],l)||e.set(s,`styles_attrs.${l}`,g(i))}),delete s.class,s},S=(t,s="styles")=>{if(!t.attributes)return{[s]:`${o.STYLES_KEY},`};const r=e.find(t.attributes,{key:"class"});if(r){const a=r.value;return{[s]:`${o.STYLES_KEY},${a}`}}return{[s]:`${o.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,_name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},m=(t,s=null)=>e.flatMapDeep(t,r=>{var i;if(r.type==="comment")return[];let a={_id:p.generateUUID()};if(s&&(a._parent=s.block._id),r.type==="text")return e.isEmpty(e.get(r,"content",""))?[]:s&&x(s.node,s.block)?(e.set(s,"block.content",e.get(r,"content","")),[]):{...a,_type:"Text",content:e.get(r,"content","")};if(a={...a,...L(r),...y(r),...S(r)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?e.set(a,"_type","Checkbox"):c==="radio"&&e.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const c=u.stringify([r]);return T(c)&&(e.set(a,"_type","Video"),e.set(a,"url",v(c)),e.set(a,"styles",`${o.STYLES_KEY},absolute top-0 left-0 w-full h-full`),e.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(r.tagName==="svg"){const c=e.find(r.attributes,{key:"height"}),n=e.find(r.attributes,{key:"width"}),f=e.get(c,"value")?`[${e.get(c,"value")}px]`:"24px",d=e.get(n,"value")?`[${e.get(n,"value")}px]`:"24px",b=e.get(e.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${o.STYLES_KEY}, ${p.cn(`w-${d} h-${f}`,b)}`.trim(),r.attributes=e.filter(r.attributes,_=>!e.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([r]),e.set(a,"styles_attrs",e.omit(e.get(a,"styles_attrs")||{},["height","width","style","class"])),[a]}else if(r.tagName=="option"&&s&&((i=s.block)==null?void 0:i._type)==="Select")return s.block.options.push({label:h(r.children),...y(r)}),[];const l=m(r.children,{block:a,node:r});return[a,...l]}),N=t=>{const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},k=t=>{const s=u.parse(N(t));return e.isEmpty(t)?[]:e.flatten(m(s))};exports.getBlocksFromHTML=k;
|