@chaibuilder/sdk 1.2.13 → 1.2.14
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/{CanvasArea-nT6ZJh_V.cjs → CanvasArea-1PwexKQz.cjs} +1 -1
- package/dist/{CanvasArea-OSH8wqt1.js → CanvasArea-leUzGAdQ.js} +1 -1
- package/dist/{CurrentPage-SWR9WU4k.cjs → CurrentPage-M6uJPKhj.cjs} +1 -1
- package/dist/{CurrentPage-FzqNBLy4.js → CurrentPage-XSq62fdk.js} +1 -1
- package/dist/{Layers-g5_pwwgO.js → Layers-JoV3wull.js} +1 -1
- package/dist/{Layers-FRHRlPIH.cjs → Layers-tasAbEc8.cjs} +1 -1
- package/dist/{PagesPanel-PSg6aqlK.js → PagesPanel-5KjlPTtj.js} +2 -2
- package/dist/{PagesPanel-3jcf5-iH.cjs → PagesPanel-v1B780fd.cjs} +1 -1
- package/dist/{ProjectPanel-XW_Bx880.js → ProjectPanel-4X2KLnOi.js} +2 -2
- package/dist/{ProjectPanel-EyEcNyh8.cjs → ProjectPanel-NZYWWYTt.cjs} +1 -1
- package/dist/{Settings--7qJ7ciF.js → Settings-1WP3BWxr.js} +1 -1
- package/dist/{Settings-h1c8ukpI.cjs → Settings-FW-bX28i.cjs} +1 -1
- package/dist/{SidePanels-NbM1mfsY.cjs → SidePanels-YpyBLRub.cjs} +1 -1
- package/dist/{SidePanels-Lmj0Qkd1.js → SidePanels-ZlDXRldT.js} +2 -2
- package/dist/{add-page-modal-Bl6y65im.js → add-page-modal-iYgzDs08.js} +1 -1
- package/dist/{add-page-modal-65wltt_4.cjs → add-page-modal-ueEpfep_.cjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-Q3Si4nyd.cjs → delete-page-modal-CT-ZA6H5.cjs} +1 -1
- package/dist/{delete-page-modal-tiJ2UA5f.js → delete-page-modal-hlR-A69E.js} +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +1 -1
- package/dist/{index-wwk4px_E.js → index-DXznIJrr.js} +664 -659
- package/dist/{index-hS9T9Nub.cjs → index-TBa4RPnS.cjs} +22 -22
- package/dist/{page-viewer-rLCyM4QC.js → page-viewer-Hgr72mrQ.js} +2 -2
- package/dist/{page-viewer-w-ahza8q.cjs → page-viewer-voX6SLpK.cjs} +1 -1
- package/dist/{project-general-setting-pY-Mkc8G.js → project-general-setting-OdZj-lfx.js} +1 -1
- package/dist/{project-general-setting-RTcIwUWc.cjs → project-general-setting-VFFXhGpN.cjs} +1 -1
- package/dist/{single-page-detail-HYX4R3U0.js → single-page-detail-AjhWBVK1.js} +2 -2
- package/dist/{single-page-detail-wHDpn40R.cjs → single-page-detail-FIwXvGx2.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +110 -2
- package/dist/studio.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
|
2
2
|
import s, { useState as n, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
4
|
import { aT as g, aU as h, aV as f } from "./index-m9VziIOy.js";
|
|
5
|
-
import { e as j, b as N, d as b } from "./index-
|
|
5
|
+
import { e as j, b as N, d as b } from "./index-DXznIJrr.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -51,7 +51,7 @@ import "himalaya";
|
|
|
51
51
|
import "lucide-react";
|
|
52
52
|
import "./web-blocks.js";
|
|
53
53
|
import "./empty-slot-5FRrRq1E.js";
|
|
54
|
-
const v = s.lazy(() => import("./single-page-detail-
|
|
54
|
+
const v = s.lazy(() => import("./single-page-detail-AjhWBVK1.js")), P = ({ pageData: r }) => {
|
|
55
55
|
const [t, i] = n("CLOSE");
|
|
56
56
|
return /* @__PURE__ */ e.jsxs(
|
|
57
57
|
g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-bfKqnRvZ.cjs"),x=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./index-bfKqnRvZ.cjs"),x=require("./index-TBa4RPnS.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-FIwXvGx2.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},q=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},p=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(q,{...i})))});exports.default=p;
|
|
@@ -3,7 +3,7 @@ import * as l from "react";
|
|
|
3
3
|
import { bf as n } from "./index-m9VziIOy.js";
|
|
4
4
|
import { u as c, o as u } from "./empty-slot-5FRrRq1E.js";
|
|
5
5
|
import { F as d } from "./form-lbFCPUoE.js";
|
|
6
|
-
import { b as x } from "./index-
|
|
6
|
+
import { b as x } from "./index-DXznIJrr.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "lodash-es";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-bfKqnRvZ.cjs"),o=require("./empty-slot-2LSrWJaY.cjs"),d=require("./form-vNgf0kO2.cjs"),m=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-bfKqnRvZ.cjs"),o=require("./empty-slot-2LSrWJaY.cjs"),d=require("./form-vNgf0kO2.cjs"),m=require("./index-TBa4RPnS.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),p=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=p;
|
|
@@ -6,7 +6,7 @@ import { bf as Y, B as q } from "./index-m9VziIOy.js";
|
|
|
6
6
|
import { u as g, b as Z, g as $, o as F, r as Q } from "./empty-slot-5FRrRq1E.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
8
|
import { F as h } from "./form-lbFCPUoE.js";
|
|
9
|
-
import { h as V, b as X, i as _, c as K } from "./index-
|
|
9
|
+
import { h as V, b as X, i as _, c as K } from "./index-DXznIJrr.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
11
|
import "./Functions-7jnEwJyw.js";
|
|
12
12
|
import "clsx";
|
|
@@ -54,7 +54,7 @@ import "./html-to-json-57841sEK.js";
|
|
|
54
54
|
import "himalaya";
|
|
55
55
|
import "lucide-react";
|
|
56
56
|
import "./web-blocks.js";
|
|
57
|
-
const O = I.lazy(() => import("./delete-page-modal-
|
|
57
|
+
const O = I.lazy(() => import("./delete-page-modal-hlR-A69E.js")), J = I.lazy(() => import("./confirm-alert-Nw1JCtuu.js")), P = (r) => {
|
|
58
58
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
59
59
|
return !1;
|
|
60
60
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-bfKqnRvZ.cjs"),d=require("./empty-slot-2LSrWJaY.cjs"),w=require("sonner"),p=require("./form-vNgf0kO2.cjs"),P=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),f=require("react"),c=require("lodash-es"),H=require("@radix-ui/react-icons"),y=require("./index-bfKqnRvZ.cjs"),d=require("./empty-slot-2LSrWJaY.cjs"),w=require("sonner"),p=require("./form-vNgf0kO2.cjs"),P=require("./index-TBa4RPnS.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-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("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-CT-ZA6H5.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-_DCO6hCV.cjs"))),E=u=>{if(!c.isString(u)||!(u.includes("/[")&&u.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return u.split("/").forEach(n=>{e&&(n.includes("[[")&&n.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n):n.includes("[")&&n.includes("]")?e=s.test(n):e=q.test(n))}),e},h=u=>u&&c.isEmpty(u.seoData)?{...u,seoData:{title:"",description:"",image:""}}:u,G=(u,o)=>{const s=!c.isEqual(c.omit(u,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(u).seoData);return s||q},Y=({open:u,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),n=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){u==="ALERT"&&o("PENDING");return}n.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},S=({formData:l},t)=>{b(g=>{var R,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((R=l[t])==null?void 0:R.replace(/\d/g,"")):t==="slug"?x.slug=(N=l[t])==null?void 0:N.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_"):t==="seoData"&&(x.seoData={title:l[t].title||"",description:l[t].description||"",image:l[t].image||""}),{...g,...x}})},I=({formData:l},t)=>{A(g=>{const x={[t]:l[t]};return{...g,...x}})},v={name:d.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:u==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||n.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:S,disabled:n.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:S,disabled:n.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:n.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||n.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|
package/dist/studio.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-Z_BpKhVy.cjs");const e=require("./index-TBa4RPnS.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("i18next");require("react-i18next");require("./index-bfKqnRvZ.cjs");require("lodash-es");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("flat-to-nested");require("./MODIFIERS-2FeVfZQ9.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-5ARpH_Tu.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-2PeOCVey.cjs");require("himalaya");require("lucide-react");require("./web-blocks.cjs");require("./empty-slot-2LSrWJaY.cjs");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.d.ts
CHANGED
|
@@ -1,13 +1,121 @@
|
|
|
1
1
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
2
|
import { default as React_2 } from 'react';
|
|
3
3
|
|
|
4
|
+
declare interface Block {
|
|
5
|
+
type: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare type Breakpoint = {
|
|
10
|
+
title: string;
|
|
11
|
+
content: string;
|
|
12
|
+
breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
|
|
13
|
+
icon: React_2.ReactNode | Element;
|
|
14
|
+
width: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare type ChaiBlock = {
|
|
18
|
+
_id: string;
|
|
19
|
+
_type: string;
|
|
20
|
+
_name?: string;
|
|
21
|
+
_parent?: string | null | undefined;
|
|
22
|
+
_bindings?: Record<string, string>;
|
|
23
|
+
} & Record<string, any>;
|
|
24
|
+
|
|
25
|
+
declare interface ChaiBuilderEditorProps {
|
|
26
|
+
breakpoints?: Breakpoint[];
|
|
27
|
+
editable?: boolean;
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
locale?: string;
|
|
30
|
+
nonEditableComponent?: ReactComponentType;
|
|
31
|
+
canvas?: React_2.FC<any>;
|
|
32
|
+
canvasTopBarComponents?: {
|
|
33
|
+
right?: ReactComponentType[];
|
|
34
|
+
};
|
|
35
|
+
previewLink?: string;
|
|
36
|
+
dataBindingSupport?: boolean;
|
|
37
|
+
dataProviders?: DataProvider[];
|
|
38
|
+
darkMode?: boolean;
|
|
39
|
+
dndOptions?: any;
|
|
40
|
+
importHTMLSupport?: boolean;
|
|
41
|
+
fetchMediaCallback?: (limit?: number, offset?: number) => Promise<any[]>;
|
|
42
|
+
uploadMediaCallback?: (file: File) => Promise<{
|
|
43
|
+
url: string;
|
|
44
|
+
}>;
|
|
45
|
+
getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
|
|
46
|
+
blocks: ChaiBlock[];
|
|
47
|
+
html: string;
|
|
48
|
+
}>;
|
|
49
|
+
getUILibraryBlocks?: (libraryUuid: string) => Promise<PredefinedBlock[]>;
|
|
50
|
+
uiLibraries?: UILibrary[];
|
|
51
|
+
subPages?: Block[];
|
|
52
|
+
subPagesSupport?: boolean;
|
|
53
|
+
blocks?: ChaiBlock[];
|
|
54
|
+
onSaveBlocks?: ({ blocks, providers }: any) => Promise<any>;
|
|
55
|
+
onSavePage?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
|
|
56
|
+
brandingOptions?: Record<string, string>;
|
|
57
|
+
onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
|
|
58
|
+
container?: ChaiBlock | "Body" | "Container";
|
|
59
|
+
onSaveContainer?: (container: ChaiBlock) => Promise<boolean | Error>;
|
|
60
|
+
onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
|
|
61
|
+
previewComponent?: ReactComponentType;
|
|
62
|
+
sideBarComponents?: {
|
|
63
|
+
bottom?: ReactComponentType[];
|
|
64
|
+
top?: {
|
|
65
|
+
icon: ReactComponentType | string;
|
|
66
|
+
name: string;
|
|
67
|
+
panel: ReactComponentType;
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
topBarComponents?: {
|
|
71
|
+
center?: ReactComponentType[];
|
|
72
|
+
left?: ReactComponentType[];
|
|
73
|
+
right?: ReactComponentType[];
|
|
74
|
+
};
|
|
75
|
+
getPages?: () => Promise<ChaiPage[]>;
|
|
76
|
+
unsplashAccessKey?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
4
79
|
export declare const ChaiBuilderStudio: (props: ChaiBuilderStudioProps) => JSX_2.Element;
|
|
5
80
|
|
|
6
81
|
export declare type ChaiBuilderStudioProps = {
|
|
7
82
|
apiBaseUrl?: string;
|
|
8
83
|
logo?: React_2.FC<any> | React_2.LazyExoticComponent<any>;
|
|
9
|
-
|
|
10
|
-
|
|
84
|
+
} & Omit<ChaiBuilderEditorProps, "topBarComponents" | "editable" | "onSaveBrandingOptions" | "onSaveBlocks" | "blocks" | "brandingOptions">;
|
|
85
|
+
|
|
86
|
+
declare type ChaiPage = {
|
|
87
|
+
uuid?: string;
|
|
88
|
+
page_name?: string;
|
|
89
|
+
blocks: ChaiBlock[];
|
|
90
|
+
custom_code: string;
|
|
91
|
+
seo_data: Record<string, string>;
|
|
92
|
+
slug: string;
|
|
93
|
+
translations: Record<string, Record<string, string>>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
declare type DataProvider = {
|
|
97
|
+
providerKey: string;
|
|
98
|
+
args: Record<string, any>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare type PredefinedBlock = {
|
|
102
|
+
uuid: string;
|
|
103
|
+
name: string;
|
|
104
|
+
preview: string;
|
|
105
|
+
blocks?: ChaiBlock[];
|
|
106
|
+
html?: string;
|
|
11
107
|
};
|
|
12
108
|
|
|
109
|
+
declare type ReactComponentType = React_2.ComponentType<any>;
|
|
110
|
+
|
|
111
|
+
declare type SavePageData = {
|
|
112
|
+
blocks: ChaiBlock[];
|
|
113
|
+
providers?: DataProvider[];
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
declare interface UILibrary {
|
|
117
|
+
name: string;
|
|
118
|
+
uuid: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
13
121
|
export { }
|
package/dist/studio.js
CHANGED