@chaibuilder/sdk 1.2.11 → 1.2.13
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-k2p8Hy1n.cjs → AddBlocks-tomDo_Is.cjs} +1 -1
- package/dist/{AddBlocks-TSt8uJY4.js → AddBlocks-zN5--UP6.js} +11 -11
- package/dist/{BrandingOptions-WyVWfFVz.cjs → BrandingOptions-BUmE4f72.cjs} +1 -1
- package/dist/{BrandingOptions-uFTyYJZj.js → BrandingOptions-LbizrmRI.js} +2 -2
- package/dist/{CanvasArea-iRQqpOak.js → CanvasArea-OSH8wqt1.js} +22 -22
- package/dist/{CanvasArea-5erOZYLy.cjs → CanvasArea-nT6ZJh_V.cjs} +1 -1
- package/dist/{CurrentPage-RCxTz9Mc.js → CurrentPage-FzqNBLy4.js} +3 -3
- package/dist/{CurrentPage-NzmJloN7.cjs → CurrentPage-SWR9WU4k.cjs} +1 -1
- package/dist/{Layers-xDG7oltg.cjs → Layers-FRHRlPIH.cjs} +1 -1
- package/dist/{Layers-tXB5Pwid.js → Layers-g5_pwwgO.js} +57 -57
- package/dist/{PagesPanel-72nzYB1k.cjs → PagesPanel-3jcf5-iH.cjs} +1 -1
- package/dist/{PagesPanel-Jaz9jvye.js → PagesPanel-PSg6aqlK.js} +4 -4
- package/dist/{ProjectPanel-RU0QvH6e.cjs → ProjectPanel-EyEcNyh8.cjs} +1 -1
- package/dist/{ProjectPanel--S014Xx3.js → ProjectPanel-XW_Bx880.js} +4 -4
- package/dist/{Settings-gjvl5V1k.js → Settings--7qJ7ciF.js} +60 -60
- package/dist/{Settings-5EuwaVb3.cjs → Settings-h1c8ukpI.cjs} +1 -1
- package/dist/{SidePanels-Fq3kRwR0.js → SidePanels-Lmj0Qkd1.js} +8 -8
- package/dist/{SidePanels-uNCxnGte.cjs → SidePanels-NbM1mfsY.cjs} +1 -1
- package/dist/{Topbar-JqW89xI5.cjs → Topbar-2sOsQD2d.cjs} +1 -1
- package/dist/{Topbar-m5dbbI1f.js → Topbar-xvrno03z.js} +4 -4
- package/dist/{UnsplashImages-vACw5hbK.cjs → UnsplashImages-EiYSWkBa.cjs} +1 -1
- package/dist/{UnsplashImages-GhBD6owT.js → UnsplashImages-hhPOf7kt.js} +7 -7
- package/dist/{UploadImages-PzHdEKHT.cjs → UploadImages-GGCExfQd.cjs} +1 -1
- package/dist/{UploadImages-S1HgxeGb.js → UploadImages-JKjE44i7.js} +1 -1
- package/dist/{add-page-modal-GAizM2Jw.cjs → add-page-modal-65wltt_4.cjs} +1 -1
- package/dist/{add-page-modal-2P5hGXOQ.js → add-page-modal-Bl6y65im.js} +13 -13
- package/dist/{confirm-alert-57Xq5foA.js → confirm-alert-Nw1JCtuu.js} +1 -1
- package/dist/{confirm-alert-Uf84DpdR.cjs → confirm-alert-_DCO6hCV.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +8 -0
- package/dist/core.js +39 -37
- package/dist/{delete-page-modal-MG42FdnU.cjs → delete-page-modal-Q3Si4nyd.cjs} +1 -1
- package/dist/{delete-page-modal-ix5IjaFW.js → delete-page-modal-tiJ2UA5f.js} +3 -3
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +27 -27
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{empty-slot-TF2kd-0X.cjs → empty-slot-2LSrWJaY.cjs} +1 -1
- package/dist/{empty-slot-MWycClTb.js → empty-slot-5FRrRq1E.js} +33 -33
- package/dist/{form-SYcFyACJ.js → form-lbFCPUoE.js} +1 -1
- package/dist/{form-KBb3kA8g.cjs → form-vNgf0kO2.cjs} +1 -1
- package/dist/{index-aiHDvS5v.cjs → index-bfKqnRvZ.cjs} +1 -1
- package/dist/{index-cM3eKmlx.cjs → index-hS9T9Nub.cjs} +33 -33
- package/dist/{index-pNYv0oAF.js → index-m9VziIOy.js} +307 -295
- package/dist/{index-Fj3ead-J.js → index-wwk4px_E.js} +2069 -2059
- package/dist/{page-viewer-VxqOevr4.js → page-viewer-rLCyM4QC.js} +4 -4
- package/dist/{page-viewer-Sh99FGYk.cjs → page-viewer-w-ahza8q.cjs} +1 -1
- package/dist/{project-general-setting-VTLHa-Ik.cjs → project-general-setting-RTcIwUWc.cjs} +1 -1
- package/dist/{project-general-setting-nWOjPiin.js → project-general-setting-pY-Mkc8G.js} +4 -4
- package/dist/{project-seo-setting-70bWTwsB.js → project-seo-setting-9V67NFil.js} +3 -3
- package/dist/{project-seo-setting-ENAKc2Dl.cjs → project-seo-setting-aRDdqu88.cjs} +1 -1
- package/dist/{single-page-detail-3z7TF-Yy.js → single-page-detail-HYX4R3U0.js} +5 -5
- package/dist/{single-page-detail-6L38HJC4.cjs → single-page-detail-wHDpn40R.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +3 -3
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +25 -25
- package/dist/{useAddBlockByDrop-7mUMwNSG.cjs → useAddBlockByDrop-1WvPoBXa.cjs} +1 -1
- package/dist/{useAddBlockByDrop-tjQ5DgiO.js → useAddBlockByDrop-bs_SH7Tw.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +129 -129
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),o=require("react"),l=require("lodash-es"),C=require("@radix-ui/react-icons"),k=require("unsplash-js"),t=require("./index-bfKqnRvZ.cjs"),A=require("@react-hookz/web"),T=require("lucide-react");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const g=async(d,E)=>new Promise((a,n)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>n(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[n,f]=o.useState([]),[c,q]=o.useState(0),[u,S]=o.useState(),[x,b]=o.useState(),[I,R]=o.useState(0),[j,w]=A.useDebouncedState("",1e3),[h,m]=o.useState(!1),P=async s=>{if(l.isEmpty(j))return;let i=c+1;s&&(s.preventDefault(),i=1),m(!0),q(i);const p={query:j,page:i};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(i===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...n,...((v=r==null?void 0:r.response)==null?void 0:v.results)||[]]),R((N=r==null?void 0:r.response)==null?void 0:N.total_pages),m(!1)}).catch(()=>{m(!1)})};return o.useEffect(()=>{if(!l.isEmpty(j)&&a){m(!0);const s={query:j,page:1};u&&(s.orientation=u),x&&(s.color=x),q(1),g(s,a).then(i=>{var p,r;f(((p=i==null?void 0:i.response)==null?void 0:p.results)||[]),R((r=i==null?void 0:i.response)==null?void 0:r.total_pages),m(!1)}).catch(()=>{m(!1)})}},[u,x,j,a]),l.isEmpty(a)?e.jsxRuntimeExports.jsx("div",{className:"h-full flex flex-col items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"max-w-3xl text-center text-gray-500",children:["To enable Unsplash, kindly provide your",e.jsxRuntimeExports.jsx("a",{href:"https://unsplash.com/documentation#public-authentication",className:"underline px-1 hover:text-blue-400",target:"_blank",rel:"noopener noreferrer",children:"Unsplash Access Key"})]})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("form",{className:"flex items-center rounded-md border bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsx(t.Input,{type:"text",name:"query",className:"input",placeholder:'Try "dog" or "apple"',onChange:s=>w(s.target.value)}),e.jsxRuntimeExports.jsxs(t.Popover,{children:[e.jsxRuntimeExports.jsx(t.PopoverTrigger,{asChild:!0,className:"h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200",children:e.jsxRuntimeExports.jsx(C.MixerHorizontalIcon,{})}),e.jsxRuntimeExports.jsx(t.PopoverContent,{side:d?"bottom":"right",className:"z-[9999] flex w-max items-center justify-center",children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"py-1 text-sm font-medium",children:"Orientation"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:u,onValueChange:s=>S(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"landscape",children:"Landscape"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"portrait",children:"Portrait"}),e.jsxRuntimeExports.jsx(t.SelectItem,{value:"squarish",children:"Square"})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-1 pt-2 text-sm font-medium",children:"Color"}),e.jsxRuntimeExports.jsxs(t.Select,{defaultValue:x,onValueChange:s=>b(s),children:[e.jsxRuntimeExports.jsx(t.SelectTrigger,{className:"h-auto w-40 p-1 px-3",children:e.jsxRuntimeExports.jsx(t.SelectValue,{placeholder:"Select"})}),e.jsxRuntimeExports.jsxs(t.SelectContent,{className:"z-[9999]",children:[e.jsxRuntimeExports.jsx(t.SelectItem,{value:"",children:"All"}),["black_and_white","black","white","yellow","orange","red","purple","magenta","green","teal","blue"].map(s=>e.jsxRuntimeExports.jsx(t.SelectItem,{value:s,children:l.startCase(s)},s))]})]})]})})]})]}),e.jsxRuntimeExports.jsxs(t.ScrollArea,{className:`h-full ${d&&!l.isEmpty(n)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(n)&&!h&&e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center py-6",children:[e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Data"}),e.jsxRuntimeExports.jsx("div",{className:"text-sm text-gray-500",children:"Enter query and press enter"})]}),d?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:n.map(s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>E(s.urls.regular),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id))}):n.map(s=>e.jsxRuntimeExports.jsx("div",{className:"w-full px-2 py-1",children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.alt_description,src:s.urls.small})})},s.id)),h&&e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsxRuntimeExports.jsx(T.Loader,{className:"animate-spin w-6 h-6"})," Loading..."]}),!l.isEmpty(n)&&c<I&&!h&&e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"link",className:"w-full",onClick:()=>P(void 0),disabled:h,children:h?"":"Load More"})]})]})};exports.default=z;exports.fetchImage=g;
|
|
@@ -3,7 +3,7 @@ import { useState as p, useEffect as D } from "react";
|
|
|
3
3
|
import { isEmpty as d, startCase as E } from "lodash-es";
|
|
4
4
|
import { MixerHorizontalIcon as L } from "@radix-ui/react-icons";
|
|
5
5
|
import { createApi as U } from "unsplash-js";
|
|
6
|
-
import { i as
|
|
6
|
+
import { i as V, bc as B, aT as F, aU as K, aV as O, aj as P, ak as C, al as S, am as k, an as h, bf as Q, B as H } from "./index-m9VziIOy.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as $ } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -44,7 +44,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
44
44
|
o(i);
|
|
45
45
|
}).catch((i) => r(i));
|
|
46
46
|
}), De = ({ isModalView: x, onSelect: g }) => {
|
|
47
|
-
const o =
|
|
47
|
+
const o = V("unsplashAccessKey", ""), [r, j] = p([]), [i, v] = p(0), [l, A] = p(), [n, q] = p(), [T, y] = p(0), [u, z] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
48
|
if (d(u))
|
|
49
49
|
return;
|
|
50
50
|
let t = i + 1;
|
|
@@ -83,7 +83,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
83
83
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
84
84
|
/* @__PURE__ */ e.jsxs("form", { className: "flex items-center rounded-md border bg-gray-100 p-px", children: [
|
|
85
85
|
/* @__PURE__ */ e.jsx(
|
|
86
|
-
|
|
86
|
+
B,
|
|
87
87
|
{
|
|
88
88
|
type: "text",
|
|
89
89
|
name: "query",
|
|
@@ -92,8 +92,8 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
92
92
|
onChange: (s) => z(s.target.value)
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
/* @__PURE__ */ e.jsxs(
|
|
96
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
+
/* @__PURE__ */ e.jsxs(F, { children: [
|
|
96
|
+
/* @__PURE__ */ e.jsx(K, { asChild: !0, className: "h-full w-10 cursor-pointer p-2.5 hover:bg-slate-200", children: /* @__PURE__ */ e.jsx(L, {}) }),
|
|
97
97
|
/* @__PURE__ */ e.jsx(
|
|
98
98
|
O,
|
|
99
99
|
{
|
|
@@ -102,7 +102,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
102
102
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
103
103
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
104
104
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: l, onValueChange: (s) => A(s), children: [
|
|
105
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
106
106
|
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
107
107
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
108
108
|
/* @__PURE__ */ e.jsx(h, { value: "landscape", children: "Landscape" }),
|
|
@@ -112,7 +112,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
112
112
|
] }),
|
|
113
113
|
/* @__PURE__ */ e.jsx("div", { className: "pb-1 pt-2 text-sm font-medium", children: "Color" }),
|
|
114
114
|
/* @__PURE__ */ e.jsxs(P, { defaultValue: n, onValueChange: (s) => q(s), children: [
|
|
115
|
-
/* @__PURE__ */ e.jsx(
|
|
115
|
+
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
116
116
|
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
117
117
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
118
118
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),l=require("lodash-es"),d=require("@radix-ui/react-icons"),q=require("jotai"),m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("react"),l=require("lodash-es"),d=require("@radix-ui/react-icons"),q=require("jotai"),m=require("./index-bfKqnRvZ.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const N=q.atom([]),I=({isModalView:t,onSelect:a})=>{const E=m.useBuilderProp("uploadMediaCallback",()=>""),p=m.useBuilderProp("fetchMediaCallback",()=>[]),[i,u]=q.useAtom(N),[n,j]=r.useState(!1),[h,f]=r.useState(!1),[x,c]=r.useState(),[g,R]=r.useState("");r.useEffect(()=>{(async()=>{f(!0);const s=await p();u(s||[]),f(!1)})()},[]);const v=s=>{var o,b;s&&((b=(o=s==null?void 0:s.target)==null?void 0:o.files)==null?void 0:b.length)>0&&c(s.target.files[0])},y=async()=>{j(!0);try{const{url:s}=await E(x);a(s),c(void 0);const o=await p();u(o)}catch(s){u([]),R((s==null?void 0:s.message)||"Something went wrong.")}j(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[x?e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full flex-col items-center justify-center rounded-md border bg-slate-50 p-2 px-1",children:[e.jsxRuntimeExports.jsx("img",{src:URL.createObjectURL(x),alt:"",className:"h-auto w-full max-w-sm rounded-md max-h-96 object-contain"}),g&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:g}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full items-center justify-center gap-2 pt-2",children:[e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:y,disabled:n,className:"flex items-center rounded-full bg-blue-500 px-3 py-1 text-sm text-white hover:bg-blue-600 hover:text-white",children:[n?e.jsxRuntimeExports.jsx(d.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(d.UploadIcon,{className:"animate-bounce"})," ",n?"Uploading...":"Upload"]}),!n&&e.jsxRuntimeExports.jsxs("button",{type:"button",className:"flex items-center rounded-full border border-gray-300 px-3 py-1 text-sm hover:bg-gray-200",onClick:()=>c(void 0),children:[e.jsxRuntimeExports.jsx(d.Cross1Icon,{})," Cancel"]})]})]}):e.jsxRuntimeExports.jsxs("label",{htmlFor:t?"upload-in-modal":"upload-in-panel",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center rounded-md border border-dashed border-blue-900 bg-gray-200 py-8 hover:bg-blue-50",children:[e.jsxRuntimeExports.jsx("div",{className:"text-3xl",children:"+"}),e.jsxRuntimeExports.jsx("div",{children:"Click to choose file"})]}),e.jsxRuntimeExports.jsx("input",{type:"file",id:t?"upload-in-modal":"upload-in-panel",hidden:!0,onChange:v})]}),e.jsxRuntimeExports.jsxs(m.ScrollArea,{className:`-mx-2 flex h-full flex-col pb-8 pt-2 ${t?"px-2":""} pt-2`,children:[l.isEmpty(i)&&h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"animate-pulse font-medium",children:"Fetching..."})}),l.isEmpty(i)&&!h&&e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:e.jsxRuntimeExports.jsx("div",{className:"font-medium",children:"No Images"})}),t?e.jsxRuntimeExports.jsx("div",{className:"h-full columns-5 py-2",children:l.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.thumbUrl})})},s.id))}):l.map(i,s=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(s.url),children:e.jsxRuntimeExports.jsx("div",{className:"relative overflow-hidden rounded-md bg-cover bg-no-repeat",children:e.jsxRuntimeExports.jsx("img",{className:"h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",alt:s.name,src:s.url})})},s.id))]})]})};exports.default=I;
|
|
@@ -3,7 +3,7 @@ import { useState as a, useEffect as w } from "react";
|
|
|
3
3
|
import { isEmpty as g, map as b } from "lodash-es";
|
|
4
4
|
import { GearIcon as C, UploadIcon as U, Cross1Icon as k } from "@radix-ui/react-icons";
|
|
5
5
|
import { atom as F, useAtom as E } from "jotai";
|
|
6
|
-
import { i as j,
|
|
6
|
+
import { i as j, bf as A } from "./index-m9VziIOy.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
9
9
|
import "clsx";
|
|
@@ -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-bfKqnRvZ.cjs"),g=require("./empty-slot-2LSrWJaY.cjs"),R=require("./form-vNgf0kO2.cjs"),f=require("./index-hS9T9Nub.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");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 {
|
|
5
|
-
import { u as g } from "./empty-slot-
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { g as N } from "./index-
|
|
4
|
+
import { ae as b, B as u, ad as C, b1 as A } from "./index-m9VziIOy.js";
|
|
5
|
+
import { u as g } from "./empty-slot-5FRrRq1E.js";
|
|
6
|
+
import { F as D } from "./form-lbFCPUoE.js";
|
|
7
|
+
import { g as N } from "./index-wwk4px_E.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
@@ -54,9 +54,9 @@ import "./html-to-json-57841sEK.js";
|
|
|
54
54
|
import "himalaya";
|
|
55
55
|
import "lucide-react";
|
|
56
56
|
import "./web-blocks.js";
|
|
57
|
-
const S = ({ closeModal:
|
|
57
|
+
const S = ({ closeModal: e }) => {
|
|
58
58
|
var a, s;
|
|
59
|
-
const
|
|
59
|
+
const i = N(), [o, f] = c({
|
|
60
60
|
name: "",
|
|
61
61
|
slug: "",
|
|
62
62
|
blocks: [],
|
|
@@ -64,7 +64,7 @@ const S = ({ closeModal: i }) => {
|
|
|
64
64
|
seoData: {},
|
|
65
65
|
template: ""
|
|
66
66
|
}), x = () => {
|
|
67
|
-
|
|
67
|
+
i.mutate(o, { onSuccess: () => e() });
|
|
68
68
|
}, h = ({ formData: m }, r) => {
|
|
69
69
|
f((l) => {
|
|
70
70
|
var n, d;
|
|
@@ -83,22 +83,22 @@ const S = ({ closeModal: i }) => {
|
|
|
83
83
|
};
|
|
84
84
|
return /* @__PURE__ */ t.jsxs(b, { children: [
|
|
85
85
|
/* @__PURE__ */ t.jsx("div", { className: "px-1 font-bold", children: "Add Page" }),
|
|
86
|
-
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled:
|
|
86
|
+
/* @__PURE__ */ t.jsx(D, { formData: o, properties: P, onChange: h, disabled: i.isPending }),
|
|
87
87
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ t.jsx(
|
|
88
88
|
u,
|
|
89
89
|
{
|
|
90
90
|
type: "submit",
|
|
91
|
-
disabled: !o.name || !o.slug || ((a = o.name) == null ? void 0 : a.length) < 2 || ((s = o.slug) == null ? void 0 : s.length) < 2 ||
|
|
91
|
+
disabled: !o.name || !o.slug || ((a = o.name) == null ? void 0 : a.length) < 2 || ((s = o.slug) == null ? void 0 : s.length) < 2 || i.isPending,
|
|
92
92
|
onClick: x,
|
|
93
93
|
children: "Add Page"
|
|
94
94
|
}
|
|
95
95
|
) })
|
|
96
96
|
] });
|
|
97
97
|
}, Tt = () => {
|
|
98
|
-
const [
|
|
99
|
-
return /* @__PURE__ */ t.jsxs(C, { open:
|
|
100
|
-
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () =>
|
|
101
|
-
|
|
98
|
+
const [e, i] = c(!1);
|
|
99
|
+
return /* @__PURE__ */ t.jsxs(C, { open: e, onOpenChange: () => i(!e), children: [
|
|
100
|
+
/* @__PURE__ */ t.jsx(A, { asChild: !0, children: /* @__PURE__ */ t.jsx(u, { size: "sm", variant: "link", className: "text-blue-500", onClick: () => i(!e), children: "+ New Page" }) }),
|
|
101
|
+
e && /* @__PURE__ */ t.jsx(S, { closeModal: () => i(!e) })
|
|
102
102
|
] });
|
|
103
103
|
};
|
|
104
104
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a, C as n, E as c, F as x, H as j, B as d } from "./index-
|
|
2
|
+
import { A as a, C as n, E as c, F as x, H as j, B as d } from "./index-m9VziIOy.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "lodash-es";
|
|
@@ -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-bfKqnRvZ.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");const x=({open:t,onCancel:q=()=>{},onConfirm:s,title:n,description:i,disabled:u,cancelText:l="Discard",confirmText:o="Save"})=>e.jsxRuntimeExports.jsx(r.AlertDialog,{open:t,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:q,children:l}),e.jsxRuntimeExports.jsx(r.Button,{variant:"default",onClick:s,disabled:u,children:o})]})]})});exports.default=x;
|
package/dist/core.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 s=require("./index-hS9T9Nub.cjs"),e=require("./index-bfKqnRvZ.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("./empty-slot-2LSrWJaY.cjs");require("flat-to-nested");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-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");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.useBlocksStore=e.useBlocksStore;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderProp=e.useBuilderProp;exports.useBuilderReset=e.useBuilderReset;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCopyToClipboard=e.useCopyToClipboard;exports.useCurrentPage=e.useCurrentPage;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;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.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUndoManager=e.useUndoManager;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>r.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -110,6 +110,10 @@ declare type ClassDerivedObject = {
|
|
|
110
110
|
property: string;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
declare type CopiedValue = string | null;
|
|
114
|
+
|
|
115
|
+
declare type CopyFn = (text: string) => Promise<boolean>;
|
|
116
|
+
|
|
113
117
|
declare type DataProvider = {
|
|
114
118
|
providerKey: string;
|
|
115
119
|
args: Record<string, any>;
|
|
@@ -162,6 +166,8 @@ export declare const useAddClassesToBlocks: () => Function;
|
|
|
162
166
|
*/
|
|
163
167
|
export declare const useAllBlocks: () => ChaiBlock[];
|
|
164
168
|
|
|
169
|
+
export declare const useBlocksStore: () => [ChaiBlock[], Function];
|
|
170
|
+
|
|
165
171
|
/**
|
|
166
172
|
* Wrapper around useAtom
|
|
167
173
|
*/
|
|
@@ -183,6 +189,8 @@ export declare const useCanvasZoom: () => [number, (args_0: number | typeof RESE
|
|
|
183
189
|
|
|
184
190
|
export declare const useCopyBlockIds: () => [Array<string>, Function];
|
|
185
191
|
|
|
192
|
+
export declare const useCopyToClipboard: () => [CopiedValue, CopyFn];
|
|
193
|
+
|
|
186
194
|
export declare const useCurrentPage: () => {
|
|
187
195
|
currentPage: unknown;
|
|
188
196
|
};
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as q } from "./index-
|
|
2
|
-
import { J as ss,
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { C as q } from "./index-wwk4px_E.js";
|
|
2
|
+
import { J as ss, a8 as es, K as os, aa as as, L as ts, a7 as rs, s as is, t as ps, i as ms, v as ls, M as us, N as ds, O as cs, P as Bs, Q as ks, R as ns, U as Cs, l as Ss, V as Ps, W as gs, X as vs, Y as ys, h as As, I as Is, k as hs, Z as Ms, a9 as Rs, a0 as Us, $ as Ds, _ as bs, j as fs, a6 as xs, ab as Os, ac as Ts, a1 as Hs, a3 as Ls, a2 as Ws, m as Zs, a4 as js, a5 as ws } from "./index-m9VziIOy.js";
|
|
3
|
+
import { useTranslation as Fs } from "react-i18next";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -26,7 +26,7 @@ import "himalaya";
|
|
|
26
26
|
import "./MODIFIERS-RiXS5Mn1.js";
|
|
27
27
|
import "lucide-react";
|
|
28
28
|
import "./web-blocks.js";
|
|
29
|
-
import "./empty-slot-
|
|
29
|
+
import "./empty-slot-5FRrRq1E.js";
|
|
30
30
|
import "flat-to-nested";
|
|
31
31
|
import "@react-hookz/web";
|
|
32
32
|
import "@radix-ui/react-toggle";
|
|
@@ -59,37 +59,39 @@ export {
|
|
|
59
59
|
as as useAddBlockParent,
|
|
60
60
|
ts as useAddClassesToBlocks,
|
|
61
61
|
rs as useAllBlocks,
|
|
62
|
-
is as
|
|
63
|
-
ps as
|
|
64
|
-
ms as
|
|
65
|
-
ls as
|
|
66
|
-
us as
|
|
67
|
-
ds as
|
|
68
|
-
cs as
|
|
69
|
-
Bs as
|
|
70
|
-
ks as
|
|
71
|
-
ns as
|
|
72
|
-
Cs as
|
|
73
|
-
Ss as
|
|
74
|
-
Ps as
|
|
75
|
-
gs as
|
|
76
|
-
vs as
|
|
77
|
-
ys as
|
|
78
|
-
As as
|
|
79
|
-
Is as
|
|
80
|
-
hs as
|
|
81
|
-
Ms as
|
|
82
|
-
Rs as
|
|
83
|
-
Us as
|
|
84
|
-
Ds as
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Ls as
|
|
92
|
-
|
|
93
|
-
Ws as
|
|
94
|
-
Zs as
|
|
62
|
+
is as useBlocksStore,
|
|
63
|
+
ps as useBrandingOptions,
|
|
64
|
+
ms as useBuilderProp,
|
|
65
|
+
ls as useBuilderReset,
|
|
66
|
+
us as useCanvasWidth,
|
|
67
|
+
ds as useCanvasZoom,
|
|
68
|
+
cs as useCopyBlockIds,
|
|
69
|
+
Bs as useCopyToClipboard,
|
|
70
|
+
ks as useCurrentPage,
|
|
71
|
+
ns as useCutBlockIds,
|
|
72
|
+
Cs as useDarkMode,
|
|
73
|
+
Ss as useDuplicateBlocks,
|
|
74
|
+
Ps as useGetPageData,
|
|
75
|
+
gs as useHiddenBlockIds,
|
|
76
|
+
vs as useHighlightBlockId,
|
|
77
|
+
ys as usePasteBlocks,
|
|
78
|
+
As as usePreviewMode,
|
|
79
|
+
Is as useReadOnlyMode,
|
|
80
|
+
hs as useRemoveBlocks,
|
|
81
|
+
Ms as useRemoveClassesFromBlocks,
|
|
82
|
+
Rs as useSavePage,
|
|
83
|
+
Us as useSelectedBlock,
|
|
84
|
+
Ds as useSelectedBlockAllClasses,
|
|
85
|
+
bs as useSelectedBlockCurrentClasses,
|
|
86
|
+
fs as useSelectedBlockIds,
|
|
87
|
+
xs as useSelectedBlocksDisplayChild,
|
|
88
|
+
Os as useSelectedBreakpoints,
|
|
89
|
+
Ts as useSelectedStylingBlocks,
|
|
90
|
+
Hs as useStylingBreakpoint,
|
|
91
|
+
Ls as useStylingState,
|
|
92
|
+
Fs as useTranslation,
|
|
93
|
+
Ws as useUILibraryBlocks,
|
|
94
|
+
Zs as useUndoManager,
|
|
95
|
+
js as useUpdateBlocksProps,
|
|
96
|
+
ws as useUpdateBlocksPropsRealtime
|
|
95
97
|
};
|
|
@@ -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-bfKqnRvZ.cjs"),l=require("./index-hS9T9Nub.cjs"),q=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const d=({pageData:i,projectData:t})=>{const n={},u=l.useDeletePage(),s=i.uuid===t.homepage,o=()=>{u.mutate(i,{onSuccess:()=>{n({uuid:t.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:s,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${s?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(q.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:u.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(r.Button,{variant:"destructive",onClick:o,disabled:u.isPending,children:"Yes, Delete"})]})]})]})};exports.default=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as s, z as l, C as n, E as d, F as a, H as c, B as u } from "./index-
|
|
3
|
-
import { j as x } from "./index-
|
|
2
|
+
import { A as s, z as l, C as n, E as d, F as a, H as c, B as u } from "./index-m9VziIOy.js";
|
|
3
|
+
import { j as x } from "./index-wwk4px_E.js";
|
|
4
4
|
import { TrashIcon as h } from "@radix-ui/react-icons";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
6
|
import "react";
|
|
@@ -50,7 +50,7 @@ import "./html-to-json-57841sEK.js";
|
|
|
50
50
|
import "himalaya";
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
|
-
import "./empty-slot-
|
|
53
|
+
import "./empty-slot-5FRrRq1E.js";
|
|
54
54
|
const he = ({ pageData: r, projectData: i }) => {
|
|
55
55
|
const m = {}, t = x(), o = r.uuid === i.homepage, p = () => {
|
|
56
56
|
t.mutate(r, {
|
package/dist/email-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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"),
|
|
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"),s=require("@chaibuilder/runtime"),r=require("./empty-slot-2LSrWJaY.cjs"),a=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");const p=({blockProps:e,styles:t,children:o,inBuilder:n})=>{let i=o;return o||(i=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{},inBuilder:n})),l.jsxRuntimeExports.jsx(c.Container,{...e,...t,children:i})};s.registerChaiBlock(p,{type:"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})=>l.jsxRuntimeExports.jsx(c.Section,{...e,...t,children:o});s.registerChaiBlock(x,{type:"Section",label:"Section",group:"basic",category:"core",icon:a.ImageIcon,props:{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});s.registerChaiBlock(g,{type:"Row",label:"Row",group:"basic",category:"core",icon:a.ImageIcon,blocks:[{_type:"Row",_id:"a"},{_type:"Column",_id:"b",_parent:"a"}],props:{styles:r.S({default:""})},canAcceptBlock:e=>e==="Column"});const m=({blockProps:e,styles:t,children:o,align:n})=>{let i=o;return o||(i=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx(c.Column,{...e,...t,align:n,children:i})};s.registerChaiBlock(m,{type:"Column",label:"Column",group:"basic",category:"core",icon:a.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,canBeNested:e=>e==="Row"});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});s.registerChaiBlock(h,{type:"Heading",label:"Heading",group:"basic",category:"core",icon:a.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});s.registerChaiBlock(b,{type:"Text",label:"Text",group:"basic",category:"core",icon:a.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 C=({content:e})=>e,j=({content:e,blockProps:t})=>l.jsxRuntimeExports.jsx("span",{...t,children:e});s.registerChaiBlock(C,{type:"RawText",label:"Raw Text",group:"basic",category:"core",icon:a.TextIcon,hidden:!0,builderComponent:j,props:{content:r.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. "})}});const f=({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});s.registerChaiBlock(f,{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 R=({blockProps:e,styles:t,href:o,content:n,target:i,children:u})=>l.jsxRuntimeExports.jsx(c.Link,{...e,...t,href:o,target:i,children:u||n}),v=({blockProps:e,styles:t,content:o,children:n})=>{let i=n;return n||(i=l.jsxRuntimeExports.jsx(r.EmptySlot,{blockProps:{},styles:{}})),l.jsxRuntimeExports.jsx("span",{...e,...t,children:i||o})};s.registerChaiBlock(R,{type:"Link",label:"Link",group:"basic",category:"core",icon:a.Link1Icon,blocks:[{_id:"a",_type:"Link"},{_id:"b",_parent:"a",_type:"RawText",content:"I am a link."}],builderComponent:v,props:{content: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}),w=({blockProps:e,styles:t,content:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:o});s.registerChaiBlock(E,{type:"Preview",label:"Preview",group:"basic",category:"core",builderComponent:w,canAcceptBlock:()=>!0,canDuplicate:()=>!1,props:{content:r.g({default:"Preview content",title:"Content"})}});const I=({blockProps:e,content:t})=>l.jsxRuntimeExports.jsx(c.Markdown,{children:t,...e});s.registerChaiBlock(I,{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:i,height:u})=>l.jsxRuntimeExports.jsx(c.Img,{...e,...t,src:n,alt:o,width:i,height:u}),L=({blockProps:e,styles:t,alt:o,image:n,width:i,height:u})=>l.jsxRuntimeExports.jsx("img",{...e,...t,src:n,alt:o,width:i,height:u});s.registerChaiBlock(S,{type:"Image",label:"Image",group:"basic",category:"core",icon:a.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}),q=({blockProps:e,styles:t})=>l.jsxRuntimeExports.jsx("hr",{...e,...t});s.registerChaiBlock(T,{type:"Divider",label:"Divider",group:"basic",category:"core",icon:a.DividerHorizontalIcon,builderComponent:q,props:{styles:r.S({default:"w-full h-2"})}});const H=({blockProps:e,styles:t,code:o,lineNumbers:n,theme:i,language:u})=>l.jsxRuntimeExports.jsx(c.CodeBlock,{...e,...t,code:o,linenumbers:n,theme:i,language:u}),_=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("div",{...e,...t,children:l.jsxRuntimeExports.jsx("code",{children:o})});s.registerChaiBlock(H,{type:"CodeBlock",label:"Code Block",group:"basic",category:"core",hidden:!0,icon:a.CodeSandboxLogoIcon,builderComponent:_,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 A=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx(c.CodeInline,{...e,...t,children:o}),P=({blockProps:e,styles:t,code:o})=>l.jsxRuntimeExports.jsx("code",{...e,...t,children:o});s.registerChaiBlock(A,{type:"CodeInline",label:"Code Inline",group:"basic",category:"core",icon:a.CodeSandboxLogoIcon,builderComponent:P,props:{styles:r.S({default:""}),code:r.g({title:"Code",default:"console.log('Hello, world!');"})}});const D=d.noop;exports.loadEmailBlocks=D;
|