@chaibuilder/sdk 1.2.18 → 1.2.20
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-uCdu9Xpr.js → AddBlocks-VIWJkaHJ.js} +24 -25
- package/dist/AddBlocks-X9eh8OWJ.cjs +1 -0
- package/dist/{BrandingOptions-JbHRN7V5.js → BrandingOptions-5ss0k1nb.js} +12 -13
- package/dist/BrandingOptions-PzPdafIT.cjs +1 -0
- package/dist/CanvasArea-TTGqlBKO.js +908 -0
- package/dist/CanvasArea-hoyr4dfb.cjs +55 -0
- package/dist/CurrentPage-EddxgHU-.cjs +1 -0
- package/dist/{CurrentPage-AlOLPG4o.js → CurrentPage-a3T2uy8Q.js} +10 -12
- package/dist/ListTree-kergCZrw.js +126 -0
- package/dist/ListTree-tADrgsqZ.cjs +1 -0
- package/dist/Outline-3IHYlOzF.cjs +1 -0
- package/dist/Outline-rNFJGkap.js +294 -0
- package/dist/{PagesPanel-VbSQHEu_.js → PagesPanel-0bL28ofN.js} +5 -7
- package/dist/PagesPanel-B33hWN11.cjs +1 -0
- package/dist/ProjectPanel-qtRTXNOP.cjs +1 -0
- package/dist/{ProjectPanel-fqux215P.js → ProjectPanel-sBRkUXnY.js} +15 -17
- package/dist/{Settings-IhWI1ice.js → Settings-HgGe1ANj.js} +587 -554
- package/dist/Settings-rXxS3RGM.cjs +1 -0
- package/dist/{SidePanels-lMCXrchR.js → SidePanels-R_g9rSjP.js} +132 -134
- package/dist/SidePanels-aAm-2A3s.cjs +1 -0
- package/dist/{Topbar-DYiisBtw.js → Topbar-AUTKpVHO.js} +3 -4
- package/dist/Topbar-cXtxVswU.cjs +1 -0
- package/dist/TypeIcon-ElNNPazl.cjs +1 -0
- package/dist/TypeIcon-qO96rNbV.js +69 -0
- package/dist/{UnsplashImages-lGLcqo4M.js → UnsplashImages-1RFHZIte.js} +13 -14
- package/dist/UnsplashImages-p34UJJWJ.cjs +1 -0
- package/dist/UploadImages-CLfyNo1i.cjs +1 -0
- package/dist/{UploadImages-06m6vjbL.js → UploadImages-G2orrhmZ.js} +8 -9
- package/dist/{add-page-modal-mEbIXSKX.js → add-page-modal-DUthvJNJ.js} +7 -9
- package/dist/add-page-modal-KCy_Khfe.cjs +1 -0
- package/dist/confirm-alert-T8vimDRx.cjs +1 -0
- package/dist/{confirm-alert-YETlIRpE.js → confirm-alert-nk2WQHud.js} +3 -4
- package/dist/{controls-Dy1qa8Dc.cjs → controls-KK2oLIa8.cjs} +1 -1
- package/dist/{controls-XPXGHKht.js → controls-OfJWSEqC.js} +29 -28
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +2 -1
- package/dist/core.js +45 -47
- package/dist/defaultTheme-7Lk2zq60.cjs +1 -0
- package/dist/{defaultTheme-s0cpA5Oy.js → defaultTheme-gunU_Fe5.js} +31 -33
- package/dist/{delete-page-modal-J_SmPWrw.js → delete-page-modal-WvWRQUgU.js} +8 -10
- package/dist/delete-page-modal-_pFjWLJn.cjs +1 -0
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +81 -81
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +2 -0
- package/dist/email.js +4 -6
- package/dist/{form-Y0Vb4m04.cjs → form-YnnWtUGk.cjs} +1 -1
- package/dist/{form-2xJcQs_Y.js → form-kXQX4L2W.js} +1 -1
- package/dist/{index-627XtO9e.js → index--Pt4B5bv.js} +3 -3
- package/dist/index-DeHH1q_1.cjs +1 -0
- package/dist/{index-3TQsdso6.cjs → index-JqRQZLN5.cjs} +1 -1
- package/dist/{index-LF3KXx4u.js → index-QIbDWoML.js} +8308 -8162
- package/dist/{index-ZwpjuB-N.cjs → index-e5cgISUO.cjs} +51 -51
- package/dist/{index-ZBqiaKhx.js → index-la4rqGKN.js} +802 -794
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +1 -1
- package/dist/page-viewer-6phtctz6.cjs +1 -0
- package/dist/{page-viewer-7u0SWWmO.js → page-viewer-s_lHBVfx.js} +6 -8
- package/dist/project-general-setting-SaNOMXEl.cjs +1 -0
- package/dist/{project-general-setting-SqC85J7F.js → project-general-setting-gj4A0X5W.js} +7 -9
- package/dist/{project-seo-setting-TlQherop.js → project-seo-setting-aCPg-IIc.js} +5 -6
- package/dist/project-seo-setting-bMDdgKRZ.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +10 -0
- package/dist/render.js +164 -78
- package/dist/{single-page-detail-ClZYIdSO.js → single-page-detail-TP-cxVIT.js} +36 -38
- package/dist/single-page-detail-er8i2FIF.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +2 -0
- package/dist/studio.js +4 -6
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +130 -131
- package/dist/{useAddBlockByDrop-E343zoB3.cjs → useAddBlockByDrop-LSV8adwE.cjs} +1 -1
- package/dist/{useAddBlockByDrop-sPX4lN-O.js → useAddBlockByDrop-_vczk5o_.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/package.json +4 -14
- package/dist/AddBlocks-5Q5w5lPJ.cjs +0 -1
- package/dist/BrandingOptions-xrGQI1Kn.cjs +0 -1
- package/dist/CanvasArea-aWzbzB9p.js +0 -1403
- package/dist/CanvasArea-oUIvLfdq.cjs +0 -60
- package/dist/CurrentPage-atmd8UrZ.cjs +0 -1
- package/dist/Outline-oGoAdnBw.js +0 -355
- package/dist/Outline-uMUTwN-R.cjs +0 -1
- package/dist/PagesPanel-nN3QUwXp.cjs +0 -1
- package/dist/ProjectPanel-UIEFhref.cjs +0 -1
- package/dist/Settings-8qUW0Iow.cjs +0 -1
- package/dist/SidePanels-cOHgPE9y.cjs +0 -1
- package/dist/Topbar-vLD-rWl5.cjs +0 -1
- package/dist/UnsplashImages-1JWfKlBc.cjs +0 -1
- package/dist/UploadImages-T4MYMOhW.cjs +0 -1
- package/dist/add-page-modal-niwhffYL.cjs +0 -1
- package/dist/confirm-alert-ZpEIxh3X.cjs +0 -1
- package/dist/defaultTheme-1XwPZT2b.cjs +0 -1
- package/dist/delete-page-modal-sOqRlmKb.cjs +0 -1
- package/dist/index-T3wfa1kz.cjs +0 -1
- package/dist/page-viewer-6UDraUKW.cjs +0 -1
- package/dist/project-general-setting-AW5Vtmgx.cjs +0 -1
- package/dist/project-seo-setting-cWiNZcxW.cjs +0 -1
- package/dist/single-page-detail-kJUW6FE9.cjs +0 -1
|
@@ -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 V } from "unsplash-js";
|
|
6
|
-
import { h as B, bd as F, aV as K, aW as U, aX as O, aj as P, ak as C, al as S, am as k, an as h,
|
|
6
|
+
import { h as B, bd as F, aV as K, aW as U, aX 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-la4rqGKN.js";
|
|
7
7
|
import { useDebouncedState as R } from "@react-hookz/web";
|
|
8
8
|
import { Loader as W } from "lucide-react";
|
|
9
9
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
@@ -12,7 +12,6 @@ import "clsx";
|
|
|
12
12
|
import "tailwind-merge";
|
|
13
13
|
import "@chaibuilder/runtime";
|
|
14
14
|
import "jotai";
|
|
15
|
-
import "flat-to-nested";
|
|
16
15
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
17
16
|
import "@radix-ui/react-toggle";
|
|
18
17
|
import "class-variance-authority";
|
|
@@ -40,17 +39,17 @@ import "react-dom";
|
|
|
40
39
|
import "react-quill";
|
|
41
40
|
import "react-i18next";
|
|
42
41
|
const I = async (x, g) => new Promise((o, r) => {
|
|
43
|
-
V({ accessKey: g }).search.getPhotos(x).then((
|
|
44
|
-
o(
|
|
45
|
-
}).catch((
|
|
46
|
-
}),
|
|
47
|
-
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [
|
|
42
|
+
V({ accessKey: g }).search.getPhotos(x).then((l) => {
|
|
43
|
+
o(l);
|
|
44
|
+
}).catch((l) => r(l));
|
|
45
|
+
}), _e = ({ isModalView: x, onSelect: g }) => {
|
|
46
|
+
const o = B("unsplashAccessKey", ""), [r, j] = p([]), [l, v] = p(0), [i, A] = p(), [n, q] = p(), [z, y] = p(0), [u, T] = R("", 1e3), [f, c] = p(!1), _ = async (s) => {
|
|
48
47
|
if (d(u))
|
|
49
48
|
return;
|
|
50
|
-
let t =
|
|
49
|
+
let t = l + 1;
|
|
51
50
|
s && (s.preventDefault(), t = 1), c(!0), v(t);
|
|
52
51
|
const m = { query: u, page: t };
|
|
53
|
-
|
|
52
|
+
i && (m.orientation = i), n && (m.color = n), I(m, o).then((a) => {
|
|
54
53
|
var N, b, w;
|
|
55
54
|
j(t === 1 ? ((N = a == null ? void 0 : a.response) == null ? void 0 : N.results) || [] : [...r, ...((b = a == null ? void 0 : a.response) == null ? void 0 : b.results) || []]), y((w = a == null ? void 0 : a.response) == null ? void 0 : w.total_pages), c(!1);
|
|
56
55
|
}).catch(() => {
|
|
@@ -61,14 +60,14 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
61
60
|
if (!d(u) && o) {
|
|
62
61
|
c(!0);
|
|
63
62
|
const s = { query: u, page: 1 };
|
|
64
|
-
|
|
63
|
+
i && (s.orientation = i), n && (s.color = n), v(1), I(s, o).then((t) => {
|
|
65
64
|
var m, a;
|
|
66
65
|
j(((m = t == null ? void 0 : t.response) == null ? void 0 : m.results) || []), y((a = t == null ? void 0 : t.response) == null ? void 0 : a.total_pages), c(!1);
|
|
67
66
|
}).catch(() => {
|
|
68
67
|
c(!1);
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
|
-
}, [
|
|
70
|
+
}, [i, n, u, o]), d(o) ? /* @__PURE__ */ e.jsx("div", { className: "h-full flex flex-col items-center justify-center", children: /* @__PURE__ */ e.jsxs("p", { className: "max-w-3xl text-center text-gray-500", children: [
|
|
72
71
|
"To enable Unsplash, kindly provide your",
|
|
73
72
|
/* @__PURE__ */ e.jsx(
|
|
74
73
|
"a",
|
|
@@ -101,7 +100,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
101
100
|
className: "z-[9999] flex w-max items-center justify-center",
|
|
102
101
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
103
102
|
/* @__PURE__ */ e.jsx("div", { className: "py-1 text-sm font-medium", children: "Orientation" }),
|
|
104
|
-
/* @__PURE__ */ e.jsxs(P, { defaultValue:
|
|
103
|
+
/* @__PURE__ */ e.jsxs(P, { defaultValue: i, onValueChange: (s) => A(s), children: [
|
|
105
104
|
/* @__PURE__ */ e.jsx(C, { className: "h-auto w-40 p-1 px-3", children: /* @__PURE__ */ e.jsx(S, { placeholder: "Select" }) }),
|
|
106
105
|
/* @__PURE__ */ e.jsxs(k, { className: "z-[9999]", children: [
|
|
107
106
|
/* @__PURE__ */ e.jsx(h, { value: "", children: "All" }),
|
|
@@ -176,7 +175,7 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
176
175
|
/* @__PURE__ */ e.jsx(W, { className: "animate-spin w-6 h-6" }),
|
|
177
176
|
" Loading..."
|
|
178
177
|
] }),
|
|
179
|
-
!d(r) &&
|
|
178
|
+
!d(r) && l < z && !f && /* @__PURE__ */ e.jsx(
|
|
180
179
|
H,
|
|
181
180
|
{
|
|
182
181
|
size: "sm",
|
|
@@ -193,6 +192,6 @@ const I = async (x, g) => new Promise((o, r) => {
|
|
|
193
192
|
] });
|
|
194
193
|
};
|
|
195
194
|
export {
|
|
196
|
-
|
|
195
|
+
_e as default,
|
|
197
196
|
I as fetchImage
|
|
198
197
|
};
|
|
@@ -0,0 +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-DeHH1q_1.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("./MODIFIERS-9EwxLM8V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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,i)=>{k.createApi({accessKey:E}).search.getPhotos(d).then(c=>{a(c)}).catch(c=>i(c))}),z=({isModalView:d,onSelect:E})=>{const a=t.useBuilderProp("unsplashAccessKey",""),[i,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 n=c+1;s&&(s.preventDefault(),n=1),m(!0),q(n);const p={query:j,page:n};u&&(p.orientation=u),x&&(p.color=x),g(p,a).then(r=>{var y,v,N;f(n===1?((y=r==null?void 0:r.response)==null?void 0:y.results)||[]:[...i,...((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(n=>{var p,r;f(((p=n==null?void 0:n.response)==null?void 0:p.results)||[]),R((r=n==null?void 0:n.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(i)?"-mx-2 flex flex-wrap px-2":"-mx-2 flex flex-col pb-8 pt-2"}`,children:[l.isEmpty(i)&&!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:i.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))}):i.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(i)&&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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),s=require("react"),l=require("lodash-es"),m=require("@radix-ui/react-icons"),E=require("jotai"),p=require("./index-DeHH1q_1.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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=E.atom([]),I=({isModalView:t,onSelect:a})=>{const j=p.useBuilderProp("uploadMediaCallback"),u=p.useBuilderProp("fetchMediaCallback"),[i,x]=E.useAtom(N),[n,f]=s.useState(!1),[h,g]=s.useState(!1),[c,d]=s.useState(),[b,R]=s.useState("");s.useEffect(()=>{(async()=>{if(!u)return;g(!0);const r=await u();x(r||[]),g(!1)})()},[]);const v=r=>{var o,q;r&&((q=(o=r==null?void 0:r.target)==null?void 0:o.files)==null?void 0:q.length)>0&&d(r.target.files[0])},y=async()=>{if(j){f(!0);try{const{url:r}=await j(c);a(r),d(void 0);const o=await u();x(o)}catch(r){x([]),R((r==null?void 0:r.message)||"Something went wrong.")}f(!1)}};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?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(c),alt:"",className:"h-auto max-h-96 w-full max-w-sm rounded-md object-contain"}),b&&e.jsxRuntimeExports.jsx("div",{className:"w-full pt-2 text-center text-sm text-red-500",children:b}),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(m.GearIcon,{className:"animate-spin"}):e.jsxRuntimeExports.jsx(m.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:()=>d(void 0),children:[e.jsxRuntimeExports.jsx(m.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(p.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,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"my-1 flex",onClick:()=>a(r.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:r.name,src:r.thumbUrl})})},r.id))}):l.map(i,r=>e.jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,className:"px-2 py-1",onClick:()=>a(r.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:r.name,src:r.url})})},r.id))]})]})};exports.default=I;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as a, useEffect as w } from "react";
|
|
3
3
|
import { isEmpty as b, map as j } 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 { h as v,
|
|
6
|
+
import { h as v, bf as A } from "./index-la4rqGKN.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "./Functions-7jnEwJyw.js";
|
|
9
9
|
import "clsx";
|
|
10
10
|
import "tailwind-merge";
|
|
11
11
|
import "@chaibuilder/runtime";
|
|
12
|
-
import "flat-to-nested";
|
|
13
12
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
14
13
|
import "@react-hookz/web";
|
|
15
14
|
import "@radix-ui/react-toggle";
|
|
@@ -37,8 +36,8 @@ import "react-icons-picker";
|
|
|
37
36
|
import "react-dom";
|
|
38
37
|
import "react-quill";
|
|
39
38
|
import "react-i18next";
|
|
40
|
-
const R = F([]),
|
|
41
|
-
const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] =
|
|
39
|
+
const R = F([]), he = ({ isModalView: r, onSelect: i }) => {
|
|
40
|
+
const p = v("uploadMediaCallback"), n = v("fetchMediaCallback"), [s, m] = E(R), [o, u] = a(!1), [x, f] = a(!1), [d, c] = a(), [h, y] = a("");
|
|
42
41
|
w(() => {
|
|
43
42
|
(async () => {
|
|
44
43
|
if (!n)
|
|
@@ -56,7 +55,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
56
55
|
u(!0);
|
|
57
56
|
try {
|
|
58
57
|
const { url: t } = await p(d);
|
|
59
|
-
|
|
58
|
+
i(t), c(void 0);
|
|
60
59
|
const l = await n();
|
|
61
60
|
m(l);
|
|
62
61
|
} catch (t) {
|
|
@@ -114,7 +113,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
114
113
|
/* @__PURE__ */ e.jsxs(A, { className: `-mx-2 flex h-full flex-col pb-8 pt-2 ${r ? "px-2" : ""} pt-2`, children: [
|
|
115
114
|
b(s) && x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "animate-pulse font-medium", children: "Fetching..." }) }),
|
|
116
115
|
b(s) && !x && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e.jsx("div", { className: "font-medium", children: "No Images" }) }),
|
|
117
|
-
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () =>
|
|
116
|
+
r ? /* @__PURE__ */ e.jsx("div", { className: "h-full columns-5 py-2", children: j(s, (t) => /* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "my-1 flex", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
118
117
|
"img",
|
|
119
118
|
{
|
|
120
119
|
className: "h-auto flex-1 cursor-pointer rounded-md transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -123,7 +122,7 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
123
122
|
}
|
|
124
123
|
) }) }, t.id)) }) : j(s, (t) => (
|
|
125
124
|
// TODO: Drag and Drop Image to Canvas from Here use `pic.url` for image quality
|
|
126
|
-
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () =>
|
|
125
|
+
/* @__PURE__ */ e.jsx("div", { role: "button", tabIndex: 0, className: "px-2 py-1", onClick: () => i(t.url), children: /* @__PURE__ */ e.jsx("div", { className: "relative overflow-hidden rounded-md bg-cover bg-no-repeat", children: /* @__PURE__ */ e.jsx(
|
|
127
126
|
"img",
|
|
128
127
|
{
|
|
129
128
|
className: "h-auto w-full cursor-pointer transition duration-300 ease-in-out hover:scale-105",
|
|
@@ -136,5 +135,5 @@ const R = F([]), ge = ({ isModalView: r, onSelect: a }) => {
|
|
|
136
135
|
] });
|
|
137
136
|
};
|
|
138
137
|
export {
|
|
139
|
-
|
|
138
|
+
he as default
|
|
140
139
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
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 { ae as C, B as u, ad as b, ao as A } from "./index-
|
|
5
|
-
import { u as g } from "./controls-
|
|
6
|
-
import { F as D } from "./form-
|
|
7
|
-
import { e as N } from "./index
|
|
4
|
+
import { ae as C, B as u, ad as b, ao as A } from "./index-la4rqGKN.js";
|
|
5
|
+
import { u as g } from "./controls-OfJWSEqC.js";
|
|
6
|
+
import { F as D } from "./form-kXQX4L2W.js";
|
|
7
|
+
import { e as N } from "./index--Pt4B5bv.js";
|
|
8
8
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
9
|
import "./Functions-7jnEwJyw.js";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
12
12
|
import "@chaibuilder/runtime";
|
|
13
13
|
import "jotai";
|
|
14
|
-
import "flat-to-nested";
|
|
15
14
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
16
15
|
import "@react-hookz/web";
|
|
17
16
|
import "@radix-ui/react-toggle";
|
|
@@ -42,10 +41,9 @@ import "react-quill";
|
|
|
42
41
|
import "react-i18next";
|
|
43
42
|
import "@rjsf/core";
|
|
44
43
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./index-
|
|
44
|
+
import "./index-QIbDWoML.js";
|
|
46
45
|
import "i18next";
|
|
47
46
|
import "@floating-ui/react-dom";
|
|
48
|
-
import "react-textarea-autosize";
|
|
49
47
|
import "flagged";
|
|
50
48
|
import "react-dnd";
|
|
51
49
|
import "@minoru/react-dnd-treeview";
|
|
@@ -95,7 +93,7 @@ const S = ({ closeModal: e }) => {
|
|
|
95
93
|
}
|
|
96
94
|
) })
|
|
97
95
|
] });
|
|
98
|
-
},
|
|
96
|
+
}, Mt = () => {
|
|
99
97
|
const [e, i] = c(!1);
|
|
100
98
|
return /* @__PURE__ */ t.jsxs(b, { open: e, onOpenChange: () => i(!e), children: [
|
|
101
99
|
/* @__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" }) }),
|
|
@@ -103,5 +101,5 @@ const S = ({ closeModal: e }) => {
|
|
|
103
101
|
] });
|
|
104
102
|
};
|
|
105
103
|
export {
|
|
106
|
-
|
|
104
|
+
Mt as default
|
|
107
105
|
};
|
|
@@ -0,0 +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-DeHH1q_1.cjs"),g=require("./controls-KK2oLIa8.cjs"),R=require("./form-YnnWtUGk.cjs"),f=require("./index-JqRQZLN5.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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("./index-e5cgISUO.cjs");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-FGufPv9R.cjs");require("himalaya");require("lucide-react");require("./index-ecnGWzh9.cjs");const b=({closeModal:i})=>{var l,o;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(q=>{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("__","_")),{...q,...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||((o=r.slug)==null?void 0:o.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),r=require("./index-DeHH1q_1.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("./MODIFIERS-9EwxLM8V.cjs");require("@react-hookz/web");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-
|
|
2
|
+
import { A as a, b as n, d as c, e as x, g as d, B as j } from "./index-la4rqGKN.js";
|
|
3
3
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "lodash-es";
|
|
@@ -8,7 +8,6 @@ import "clsx";
|
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import "@chaibuilder/runtime";
|
|
10
10
|
import "jotai";
|
|
11
|
-
import "flat-to-nested";
|
|
12
11
|
import "./MODIFIERS-WQdaNvb8.js";
|
|
13
12
|
import "@react-hookz/web";
|
|
14
13
|
import "@radix-ui/react-toggle";
|
|
@@ -37,7 +36,7 @@ import "react-icons-picker";
|
|
|
37
36
|
import "react-dom";
|
|
38
37
|
import "react-quill";
|
|
39
38
|
import "react-i18next";
|
|
40
|
-
const
|
|
39
|
+
const $ = ({
|
|
41
40
|
open: o,
|
|
42
41
|
onCancel: m = () => {
|
|
43
42
|
},
|
|
@@ -56,5 +55,5 @@ const ii = ({
|
|
|
56
55
|
] })
|
|
57
56
|
] }) });
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
$ as default
|
|
60
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("lodash-es"),n="#styles:";const a=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,dataType:"string",required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),d=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),r=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),u=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,required:i.required||!1,dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),l=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const s=i=>({type:"singular",default:i.default||"",i18n:i.i18n||!1,binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),p=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),o=i=>({type:"styles",binding:!1,default:`${n},${i.default||""}
|
|
1
|
+
"use strict";const t=require("lodash-es"),n="#styles:";const a=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,dataType:"string",required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:placeholder":i.placeholder||"Enter here"}}),d=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"string",...t.omit(i,["i18n","required","rows"])},uiSchema:{"ui:widget":"textarea","ui:placeholder":i.placeholder||"Enter here","ui:options":{rows:i.rows||4}}}),r=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||!1,dataType:"boolean",binding:t.get(i,"binding",!0),schema:{type:"boolean",...t.omit(i,["i18n","required"])},uiSchema:{"ui:title":i.title||"Select Item","ui:description":""}}),u=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"number",i18n:i.i18n||!1,required:i.required||!1,schema:{type:"number",...t.omit(i,["i18n","required"])},uiSchema:{}}),g=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),i18n:i.i18n||!1,required:i.required||!1,dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required","options","binding"]),oneOf:i.options.map(e=>({const:e.value,title:e.title}))},uiSchema:{"ui:widget":"select"}}),l=i=>({type:"singular",i18n:i.i18n||!1,default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"color"}});const s=i=>({type:"singular",default:i.default||"",i18n:i.i18n||!1,binding:t.get(i,"binding",!0),dataType:"string",schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"richtext"}}),p=i=>({type:"model",title:i.title,dataType:"object",default:i.default||{},binding:t.get(i,"binding",!0),properties:i.properties}),y=i=>({type:"list",itemProperties:i.itemProperties,binding:t.get(i,"binding",!0),title:i.title,dataType:"array",default:i.default||[],itemTitle:i.getItemLabel?i.getItemLabel({}):()=>""}),o=i=>({type:"styles",binding:!1,default:`${n},${i.default||""}`,presets:i.presets||{}}),m=i=>({default:i.default||"",binding:t.get(i,"binding",!0),type:"singular",i18n:i.i18n||!1,dataType:"string",schema:{type:"string",title:"Icon",default:i.default||""},uiSchema:{"ui:widget":"icon"}}),c=i=>({default:i.default,type:"singular",binding:t.get(i,"binding",!0),dataType:"object",i18n:i.i18n||!1,schema:{type:"object",...i||{},properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}}},uiSchema:{"ui:field":"link"}}),b=i=>({type:"singular",default:i.default||"",binding:t.get(i,"binding",!0),dataType:"string",i18n:i.i18n||!1,schema:{type:"string",...t.omit(i,["i18n","required"])},uiSchema:{"ui:widget":"image"}});exports.S=o;exports.T=m;exports.b=p;exports.c=u;exports.f=l;exports.g=d;exports.h=y;exports.m=s;exports.o=b;exports.q=c;exports.r=r;exports.s=g;exports.u=a;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { get as
|
|
1
|
+
import { get as e, omit as t } from "lodash-es";
|
|
2
2
|
const a = "#styles:";
|
|
3
3
|
const r = (i) => ({
|
|
4
4
|
type: "singular",
|
|
5
5
|
default: i.default || "",
|
|
6
|
-
binding:
|
|
6
|
+
binding: e(i, "binding", !0),
|
|
7
7
|
i18n: i.i18n || !1,
|
|
8
8
|
dataType: "string",
|
|
9
9
|
required: i.required || !1,
|
|
10
10
|
schema: {
|
|
11
11
|
type: "string",
|
|
12
|
-
...
|
|
12
|
+
...t(i, ["i18n", "required"])
|
|
13
13
|
},
|
|
14
14
|
uiSchema: {
|
|
15
15
|
"ui:placeholder": i.placeholder || "Enter here"
|
|
@@ -17,13 +17,13 @@ const r = (i) => ({
|
|
|
17
17
|
}), u = (i) => ({
|
|
18
18
|
type: "singular",
|
|
19
19
|
default: i.default || "",
|
|
20
|
-
binding:
|
|
20
|
+
binding: e(i, "binding", !0),
|
|
21
21
|
dataType: "string",
|
|
22
22
|
i18n: i.i18n || !1,
|
|
23
23
|
required: i.required || !1,
|
|
24
24
|
schema: {
|
|
25
25
|
type: "string",
|
|
26
|
-
...
|
|
26
|
+
...t(i, ["i18n", "required", "rows"])
|
|
27
27
|
},
|
|
28
28
|
uiSchema: {
|
|
29
29
|
"ui:widget": "textarea",
|
|
@@ -37,37 +37,37 @@ const r = (i) => ({
|
|
|
37
37
|
i18n: i.i18n || !1,
|
|
38
38
|
default: i.default || !1,
|
|
39
39
|
dataType: "boolean",
|
|
40
|
-
binding:
|
|
40
|
+
binding: e(i, "binding", !0),
|
|
41
41
|
schema: {
|
|
42
42
|
type: "boolean",
|
|
43
|
-
...
|
|
43
|
+
...t(i, ["i18n", "required"])
|
|
44
44
|
},
|
|
45
45
|
uiSchema: {
|
|
46
46
|
"ui:title": i.title || "Select Item",
|
|
47
47
|
"ui:description": ""
|
|
48
48
|
}
|
|
49
|
-
}),
|
|
49
|
+
}), s = (i) => ({
|
|
50
50
|
type: "singular",
|
|
51
51
|
default: i.default || "",
|
|
52
|
-
binding:
|
|
52
|
+
binding: e(i, "binding", !0),
|
|
53
53
|
dataType: "number",
|
|
54
54
|
i18n: i.i18n || !1,
|
|
55
55
|
required: i.required || !1,
|
|
56
56
|
schema: {
|
|
57
57
|
type: "number",
|
|
58
|
-
...
|
|
58
|
+
...t(i, ["i18n", "required"])
|
|
59
59
|
},
|
|
60
60
|
uiSchema: {}
|
|
61
|
-
}),
|
|
61
|
+
}), g = (i) => ({
|
|
62
62
|
type: "singular",
|
|
63
63
|
default: i.default || "",
|
|
64
|
-
binding:
|
|
64
|
+
binding: e(i, "binding", !0),
|
|
65
65
|
i18n: i.i18n || !1,
|
|
66
66
|
required: i.required || !1,
|
|
67
67
|
dataType: "string",
|
|
68
68
|
schema: {
|
|
69
69
|
type: "string",
|
|
70
|
-
...
|
|
70
|
+
...t(i, ["i18n", "required", "options", "binding"]),
|
|
71
71
|
oneOf: i.options.map((n) => ({ const: n.value, title: n.title }))
|
|
72
72
|
},
|
|
73
73
|
uiSchema: {
|
|
@@ -77,11 +77,11 @@ const r = (i) => ({
|
|
|
77
77
|
type: "singular",
|
|
78
78
|
i18n: i.i18n || !1,
|
|
79
79
|
default: i.default || "",
|
|
80
|
-
binding:
|
|
80
|
+
binding: e(i, "binding", !0),
|
|
81
81
|
dataType: "string",
|
|
82
82
|
schema: {
|
|
83
83
|
type: "string",
|
|
84
|
-
...
|
|
84
|
+
...t(i, ["i18n", "required"])
|
|
85
85
|
},
|
|
86
86
|
uiSchema: {
|
|
87
87
|
"ui:widget": "color"
|
|
@@ -91,11 +91,11 @@ const y = (i) => ({
|
|
|
91
91
|
type: "singular",
|
|
92
92
|
default: i.default || "",
|
|
93
93
|
i18n: i.i18n || !1,
|
|
94
|
-
binding:
|
|
94
|
+
binding: e(i, "binding", !0),
|
|
95
95
|
dataType: "string",
|
|
96
96
|
schema: {
|
|
97
97
|
type: "string",
|
|
98
|
-
...
|
|
98
|
+
...t(i, ["i18n", "required"])
|
|
99
99
|
},
|
|
100
100
|
uiSchema: {
|
|
101
101
|
"ui:widget": "richtext"
|
|
@@ -105,12 +105,12 @@ const y = (i) => ({
|
|
|
105
105
|
title: i.title,
|
|
106
106
|
dataType: "object",
|
|
107
107
|
default: i.default || {},
|
|
108
|
-
binding:
|
|
108
|
+
binding: e(i, "binding", !0),
|
|
109
109
|
properties: i.properties
|
|
110
110
|
}), o = (i) => ({
|
|
111
111
|
type: "list",
|
|
112
112
|
itemProperties: i.itemProperties,
|
|
113
|
-
binding:
|
|
113
|
+
binding: e(i, "binding", !0),
|
|
114
114
|
title: i.title,
|
|
115
115
|
dataType: "array",
|
|
116
116
|
default: i.default || [],
|
|
@@ -118,10 +118,11 @@ const y = (i) => ({
|
|
|
118
118
|
}), c = (i) => ({
|
|
119
119
|
type: "styles",
|
|
120
120
|
binding: !1,
|
|
121
|
-
default: `${a},${i.default || ""}
|
|
121
|
+
default: `${a},${i.default || ""}`,
|
|
122
|
+
presets: i.presets || {}
|
|
122
123
|
}), b = (i) => ({
|
|
123
124
|
default: i.default || "",
|
|
124
|
-
binding:
|
|
125
|
+
binding: e(i, "binding", !0),
|
|
125
126
|
type: "singular",
|
|
126
127
|
i18n: i.i18n || !1,
|
|
127
128
|
dataType: "string",
|
|
@@ -136,7 +137,7 @@ const y = (i) => ({
|
|
|
136
137
|
}), f = (i) => ({
|
|
137
138
|
default: i.default,
|
|
138
139
|
type: "singular",
|
|
139
|
-
binding:
|
|
140
|
+
binding: e(i, "binding", !0),
|
|
140
141
|
dataType: "object",
|
|
141
142
|
i18n: i.i18n || !1,
|
|
142
143
|
schema: {
|
|
@@ -154,12 +155,12 @@ const y = (i) => ({
|
|
|
154
155
|
}), h = (i) => ({
|
|
155
156
|
type: "singular",
|
|
156
157
|
default: i.default || "",
|
|
157
|
-
binding:
|
|
158
|
+
binding: e(i, "binding", !0),
|
|
158
159
|
dataType: "string",
|
|
159
160
|
i18n: i.i18n || !1,
|
|
160
161
|
schema: {
|
|
161
162
|
type: "string",
|
|
162
|
-
...
|
|
163
|
+
...t(i, ["i18n", "required"])
|
|
163
164
|
},
|
|
164
165
|
uiSchema: {
|
|
165
166
|
"ui:widget": "image"
|
|
@@ -169,14 +170,14 @@ export {
|
|
|
169
170
|
c as S,
|
|
170
171
|
b as T,
|
|
171
172
|
m as b,
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
s as c,
|
|
174
|
+
p as f,
|
|
174
175
|
u as g,
|
|
175
176
|
o as h,
|
|
176
177
|
y as m,
|
|
177
178
|
h as o,
|
|
178
179
|
f as q,
|
|
179
180
|
l as r,
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
g as s,
|
|
182
|
+
r as u
|
|
182
183
|
};
|
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-e5cgISUO.cjs"),e=require("./index-DeHH1q_1.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("jotai");require("flagged");require("react-dnd");require("lodash-es");require("@minoru/react-dnd-treeview");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@radix-ui/react-icons");require("react-hotkeys-hook");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-9EwxLM8V.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-MmCxz2Ay.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
|
@@ -39,6 +39,7 @@ export declare type ChaiBlock = {
|
|
|
39
39
|
export declare const ChaiBuilderEditor: (props: ChaiBuilderEditorProps) => JSX_2.Element;
|
|
40
40
|
|
|
41
41
|
export declare interface ChaiBuilderEditorProps {
|
|
42
|
+
showDebugLogs?: boolean;
|
|
42
43
|
autoSaveSupport?: boolean;
|
|
43
44
|
autoSaveInterval?: TimeInSeconds;
|
|
44
45
|
breakpoints?: Breakpoint[];
|
|
@@ -92,6 +93,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
92
93
|
outlineMenuItems?: OutlineMenuItems;
|
|
93
94
|
getPages?: () => Promise<ChaiPage[]>;
|
|
94
95
|
unsplashAccessKey?: string;
|
|
96
|
+
_flags?: Record<string, boolean>;
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
declare type ChaiPage = {
|
|
@@ -225,7 +227,6 @@ export declare const useDuplicateBlocks: () => Function;
|
|
|
225
227
|
export declare const useGetPageData: () => () => {
|
|
226
228
|
currentPage: unknown;
|
|
227
229
|
blocks: any;
|
|
228
|
-
globalBlocks: any;
|
|
229
230
|
};
|
|
230
231
|
|
|
231
232
|
export declare const useHiddenBlockIds: () => (string[] | ((args_0: string[] | ((prev: string[]) => string[])) => void) | ((blockId: string) => void))[];
|