@chaibuilder/sdk 1.2.32 → 1.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-0eVRNr1d.js → AddBlocks-RmEkZXdE.js} +37 -33
- package/dist/AddBlocks-XYCWUol8.cjs +1 -0
- package/dist/{BrandingOptions-yYAznnw2.js → BrandingOptions-TnzCIC7A.js} +37 -31
- package/dist/BrandingOptions-qnaKl27s.cjs +1 -0
- package/dist/CanvasArea-SeSRWHy0.js +1200 -0
- package/dist/CanvasArea-iIwERFUC.cjs +55 -0
- package/dist/ChaiBuilderEditor-YqEKonJ_.cjs +206 -0
- package/dist/{index-AJalHhkO.js → ChaiBuilderEditor-y1NxvXJ7.js} +24114 -20836
- package/dist/{CurrentPage-1v40uk8K.js → CurrentPage-9KDre_9q.js} +19 -19
- package/dist/CurrentPage-TNff16tH.cjs +1 -0
- package/dist/ListTree-GxCAsv2Y.cjs +1 -0
- package/dist/{ListTree-0ZrRreCs.js → ListTree-H2WaKwOs.js} +81 -76
- package/dist/PagesPanel-5DRsqV-G.cjs +1 -0
- package/dist/{PagesPanel-AxQX-BX2.js → PagesPanel-jHMmJEtv.js} +14 -14
- package/dist/ProjectPanel-CDnnGpVo.cjs +1 -0
- package/dist/{ProjectPanel-GYdge5v9.js → ProjectPanel-uxhq_D3j.js} +16 -16
- package/dist/Settings-nGnVavh4.cjs +1 -0
- package/dist/{Settings-9JAzGHau.js → Settings-yqZksAbO.js} +53 -53
- package/dist/{SidePanels-bLwsW29O.js → SidePanels-1gwirESt.js} +70 -70
- package/dist/SidePanels-33KNaSS3.cjs +1 -0
- package/dist/{Topbar-0Ql8pHVc.js → Topbar-NHF8D1di.js} +19 -14
- package/dist/Topbar-Wwdd9Flx.cjs +1 -0
- package/dist/{UnsplashImages-NYwOOgYa.js → UnsplashImages-LLu2wFeN.js} +26 -21
- package/dist/UnsplashImages-lnz6NfSD.cjs +1 -0
- package/dist/UploadImages-3nl_4mDf.cjs +1 -0
- package/dist/{UploadImages-vpZeW-YW.js → UploadImages-FtvaDyk9.js} +33 -27
- package/dist/{add-page-modal-hDyzsEU7.js → add-page-modal-V9DTBMmY.js} +22 -22
- package/dist/add-page-modal-sIZk552b.cjs +1 -0
- package/dist/confirm-alert-Uzq5XNGt.cjs +1 -0
- package/dist/{confirm-alert-FGQKKQJU.js → confirm-alert-sI4pItIN.js} +16 -10
- package/dist/{controls-OfJWSEqC.js → controls-VTdJhdSz.js} +44 -41
- package/dist/controls-jWJDao88.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +9 -0
- package/dist/core.js +46 -45
- package/dist/delete-page-modal-UminFzYh.cjs +1 -0
- package/dist/{delete-page-modal-KxeyBri2.js → delete-page-modal-XrIpujav.js} +15 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.d.ts +9 -0
- package/dist/email.js +18 -16
- package/dist/{form-77dY98bF.js → form-dQQ2tTRZ.js} +7 -7
- package/dist/form-q7lxaK3j.cjs +1 -0
- package/dist/functions-ge87TVcc.js +30 -0
- package/dist/functions-sBiIevFh.cjs +1 -0
- package/dist/{index-5zkCTSAM.js → index-OsS2_gM8.js} +28 -29
- package/dist/index-eYwpNzUl.cjs +1 -0
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +12 -10
- package/dist/{page-viewer-umQaut1j.js → page-viewer-AoJ5HU6j.js} +21 -21
- package/dist/page-viewer-FzhqSyNO.cjs +1 -0
- package/dist/project-general-setting-WzJ8U1OW.cjs +1 -0
- package/dist/{project-general-setting-uuCemMCU.js → project-general-setting-g3YJYszB.js} +24 -24
- package/dist/{project-seo-setting-asvbPQiI.js → project-seo-setting-1sLmV-wv.js} +26 -20
- package/dist/project-seo-setting-GuObNafp.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +55 -53
- package/dist/single-page-detail-WGars7Tl.cjs +1 -0
- package/dist/{single-page-detail-F6pKWyq1.js → single-page-detail-sQ3BH6Rc.js} +25 -25
- package/dist/studio.cjs +1 -1
- package/dist/studio.d.ts +9 -0
- package/dist/studio.js +13 -13
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +153 -147
- package/dist/useCanvasSettings-QcsmJd9b.cjs +1 -0
- package/dist/{useCanvasSettings-ikt217kv.js → useCanvasSettings-XwFRrknO.js} +1 -1
- package/dist/web-blocks.cjs +4 -4
- package/dist/web-blocks.js +137 -113
- package/package.json +9 -3
- package/dist/AddBlocks-t0hKDSud.cjs +0 -1
- package/dist/BrandingOptions-NVmCxZfD.cjs +0 -1
- package/dist/CanvasArea-2b4oSjRx.js +0 -1177
- package/dist/CanvasArea-OzyCq6UU.cjs +0 -55
- package/dist/CurrentPage-YBMhEBZG.cjs +0 -1
- package/dist/ListTree-jPwxgI6R.cjs +0 -1
- package/dist/PagesPanel-ivEL9tIQ.cjs +0 -1
- package/dist/ProjectPanel-shgvg_yT.cjs +0 -1
- package/dist/Settings-MMwEBADN.cjs +0 -1
- package/dist/SidePanels-iaaRCUeQ.cjs +0 -1
- package/dist/Topbar-CkUhCnSW.cjs +0 -1
- package/dist/UnsplashImages-juwtWvXe.cjs +0 -1
- package/dist/UploadImages-4_jmnoVi.cjs +0 -1
- package/dist/add-page-modal-2ZPjc54F.cjs +0 -1
- package/dist/confirm-alert-QRxOc76t.cjs +0 -1
- package/dist/controls-KK2oLIa8.cjs +0 -1
- package/dist/delete-page-modal--N1nPPIL.cjs +0 -1
- package/dist/form-hT5dGoJH.cjs +0 -1
- package/dist/functions-I6BoMqqb.js +0 -21
- package/dist/functions-r3ExvGGf.cjs +0 -1
- package/dist/index-FPBudsRF.cjs +0 -1
- package/dist/index-JIcsKKoG.cjs +0 -1
- package/dist/index-YpnaudSM.js +0 -63
- package/dist/index-ecnGWzh9.cjs +0 -1
- package/dist/index-hH5SIZ29.js +0 -3116
- package/dist/index-sJ9Uc9UY.cjs +0 -206
- package/dist/page-viewer-k-g15j8B.cjs +0 -1
- package/dist/project-general-setting-1leAiCJQ.cjs +0 -1
- package/dist/project-seo-setting-kDBSOzgX.cjs +0 -1
- package/dist/single-page-detail-IFtVxwl5.cjs +0 -1
- package/dist/useCanvasSettings-Am2o80hW.cjs +0 -1
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { b as
|
|
3
|
-
import { F as v } from "./form-
|
|
2
|
+
import { b as c, l as u, g, q as x } from "./controls-VTdJhdSz.js";
|
|
3
|
+
import { F as v } from "./form-dQQ2tTRZ.js";
|
|
4
4
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "@rjsf/core";
|
|
8
8
|
import "@rjsf/validator-ajv8";
|
|
9
|
-
import "./
|
|
10
|
-
import "./Functions-7jnEwJyw.js";
|
|
9
|
+
import "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
11
10
|
import "clsx";
|
|
12
|
-
import "
|
|
13
|
-
import "@
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import "@radix-ui/react-scroll-area";
|
|
13
|
+
import "@floating-ui/react-dom";
|
|
14
14
|
import "jotai";
|
|
15
|
+
import "i18next";
|
|
16
|
+
import "react-i18next";
|
|
17
|
+
import "flagged";
|
|
15
18
|
import "./STRINGS--j49GZJP.js";
|
|
19
|
+
import "./Functions-7jnEwJyw.js";
|
|
20
|
+
import "tailwind-merge";
|
|
21
|
+
import "@chaibuilder/runtime";
|
|
16
22
|
import "@react-hookz/web";
|
|
17
23
|
import "./MODIFIERS-cBT31iqE.js";
|
|
18
|
-
import "./Class-6Hz2KzYb.js";
|
|
19
|
-
import "react-i18next";
|
|
20
24
|
import "@radix-ui/react-toggle";
|
|
21
25
|
import "class-variance-authority";
|
|
26
|
+
import "./Class-6Hz2KzYb.js";
|
|
22
27
|
import "@radix-ui/react-switch";
|
|
23
28
|
import "@radix-ui/react-slot";
|
|
24
29
|
import "@radix-ui/react-accordion";
|
|
@@ -26,7 +31,6 @@ import "@radix-ui/react-icons";
|
|
|
26
31
|
import "@radix-ui/react-alert-dialog";
|
|
27
32
|
import "@radix-ui/react-dialog";
|
|
28
33
|
import "@radix-ui/react-label";
|
|
29
|
-
import "@radix-ui/react-scroll-area";
|
|
30
34
|
import "@radix-ui/react-tabs";
|
|
31
35
|
import "@radix-ui/react-tooltip";
|
|
32
36
|
import "@radix-ui/react-popover";
|
|
@@ -39,31 +43,33 @@ import "@radix-ui/react-toast";
|
|
|
39
43
|
import "cmdk";
|
|
40
44
|
import "@radix-ui/react-context-menu";
|
|
41
45
|
import "react-icons-picker";
|
|
42
|
-
import "react-dom";
|
|
43
46
|
import "react-quill";
|
|
44
|
-
|
|
47
|
+
import "react-hotkeys-hook";
|
|
48
|
+
import "lodash";
|
|
49
|
+
import "lucide-react";
|
|
50
|
+
const ct = ({
|
|
45
51
|
_projectData: t,
|
|
46
52
|
seany: l
|
|
47
53
|
}) => {
|
|
48
|
-
var o,
|
|
54
|
+
var o, r, m, e, p, a;
|
|
49
55
|
const n = ({ formData: f }) => {
|
|
50
56
|
const i = { ...f };
|
|
51
|
-
i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((
|
|
52
|
-
...
|
|
57
|
+
i.seoData.title === void 0 && (i.seoData.title = ""), i.seoData.description === void 0 && (i.seoData.description = ""), i.seoData.image === void 0 && (i.seoData.image = ""), l((D) => ({
|
|
58
|
+
...D,
|
|
53
59
|
...i
|
|
54
60
|
}));
|
|
55
61
|
}, d = {
|
|
56
|
-
seoData:
|
|
62
|
+
seoData: c({
|
|
57
63
|
title: "",
|
|
58
64
|
default: {
|
|
59
65
|
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
60
|
-
description: ((
|
|
61
|
-
image: ((
|
|
66
|
+
description: ((r = t.seoData) == null ? void 0 : r.description) || "",
|
|
67
|
+
image: ((m = t.seoData) == null ? void 0 : m.image) || ""
|
|
62
68
|
},
|
|
63
69
|
properties: {
|
|
64
|
-
title:
|
|
70
|
+
title: u({
|
|
65
71
|
title: "Default Title",
|
|
66
|
-
default: ((
|
|
72
|
+
default: ((e = t.seoData) == null ? void 0 : e.title) || ""
|
|
67
73
|
}),
|
|
68
74
|
description: g({
|
|
69
75
|
title: "Default Description",
|
|
@@ -79,5 +85,5 @@ const st = ({
|
|
|
79
85
|
return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
80
86
|
};
|
|
81
87
|
export {
|
|
82
|
-
|
|
88
|
+
ct as default
|
|
83
89
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./controls-jWJDao88.cjs"),g=require("./form-q7lxaK3j.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./ChaiBuilderEditor-YqEKonJ_.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");const D=({_projectData:e,seany:n})=>{var t,u,q,o,s,a;const d=({formData:f})=>{const r={...f};r.seoData.title===void 0&&(r.seoData.title=""),r.seoData.description===void 0&&(r.seoData.description=""),r.seoData.image===void 0&&(r.seoData.image=""),n(m=>({...m,...r}))},c={seoData:i.b({title:"",default:{title:((t=e.seoData)==null?void 0:t.title)||"",description:((u=e.seoData)==null?void 0:u.description)||"",image:((q=e.seoData)==null?void 0:q.image)||""},properties:{title:i.l({title:"Default Title",default:((o=e.seoData)==null?void 0:o.title)||""}),description:i.g({title:"Default Description",default:((s=e.seoData)==null?void 0:s.description)||""}),image:i.q({title:"Social Media Image",default:((a=e.seoData)==null?void 0:a.image)||""})}})};return l.jsxRuntimeExports.jsx("div",{className:"flex h-full select-none flex-col",children:l.jsxRuntimeExports.jsx(g.Form,{properties:c,formData:e,onChange:d})})};exports.default=D;
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),d=require("react"),r=require("lodash-es"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),d=require("react"),r=require("lodash-es"),T=require("tailwind-merge"),a=require("./STRINGS-gPz7CUOk.cjs"),_=require("./functions-sBiIevFh.cjs"),Y=require("@chaibuilder/runtime"),C=require("react-wrap-balancer"),B=require("./MODIFIERS-YPHRtwrM.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");const O=t=>{const n={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(a.SLOT_KEY)&&(n[e]=t[e].replace(a.SLOT_KEY,"").split(","))}),n},L=r.memoize((t,n)=>{const e=t.replace(a.STYLES_KEY,"").split(","),s=T.twMerge(e[0],e[1]);return n?_.addPrefixToClasses(s,n).replace(a.STYLES_KEY,"").trim():s.replace(a.STYLES_KEY,"").trim()});function A(t,n){return r.get(t,`${n}_attrs`,{})}function K(t,n){const e={};return Object.keys(t).forEach(s=>{if(r.isString(t[s])&&t[s].startsWith(a.STYLES_KEY)){const i=L(t[s],n);e[s]={className:i,...A(t,s)}}}),e}function q(t,n){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(s,i)=>{r.isString(s)&&r.get(n,s,null)&&(t[i]=r.get(n,s,null))}),t)}function y(t){const{components:n,blocks:e,parent:s,classPrefix:i="",externalData:u={}}=t,g=e,l=o=>K(o,i),h=s?r.filter(e,{_parent:s}):r.filter(e,o=>r.isEmpty(o._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:d.Children.toArray(h.map((o,f)=>{const x=O(o),m={};r.isEmpty(x)||Object.keys(x).forEach(S=>{m[S]=d.Children.toArray(x[S].map(R=>c.jsxRuntimeExports.jsx(y,{externalData:u,classPrefix:i,blocks:g,parent:R,components:n})))});const p=r.filter(g,{_parent:o._id});m.children=p.length>0?c.jsxRuntimeExports.jsx(y,{externalData:u,classPrefix:i,parent:o._id,blocks:g,components:n}):null;const E=r.get(n,o._type,null);if(E!==null){let S=o;const R=E;return d.createElement(R,r.omit({...S,index:f,...q(o,u),...l(S),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[o._type," not found"]})}))})}const N=t=>{const n={};return Object.keys(t).forEach(e=>{r.isString(t[e])&&t[e].startsWith(a.SLOT_KEY)&&(n[e]=t[e].replace(a.SLOT_KEY,"").split(","))}),n},$=r.memoize((t,n)=>{const e=t.replace(a.STYLES_KEY,"").split(","),s=T.twMerge(e[0],e[1]);return n===""?s.replace(a.STYLES_KEY,"").trim():_.addPrefixToClasses(s,n).replace(a.STYLES_KEY,"").trim()});function F(t,n){return r.get(t,`${n}_attrs`,{})}function I(t,n){const e={};return Object.keys(t).forEach(s=>{if(r.isString(t[s])&&t[s].startsWith(a.STYLES_KEY)){const i=$(t[s],n);e[s]={className:i,...F(t,s)}}}),e}function M(t,n){const e=r.get(t,"_bindings",{});return r.isEmpty(e)?{...t}:(r.each(e,(s,i)=>{r.isString(s)&&r.get(n,s,null)&&(t[i]=r.get(n,s,null))}),t)}function j({blocks:t,parent:n,classPrefix:e="",externalData:s={}}){const i=t,u=l=>I(l,e),g=n?r.filter(t,{_parent:n}):r.filter(t,l=>r.isEmpty(l._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:d.Children.toArray(g.map((l,h)=>{const o=N(l),f={};r.isEmpty(o)||Object.keys(o).forEach(p=>{f[p]=d.Children.toArray(o[p].map(E=>c.jsxRuntimeExports.jsx(j,{externalData:s,classPrefix:e,blocks:i,parent:E})))});const x=r.filter(i,{_parent:l._id});f.children=x.length>0?c.jsxRuntimeExports.jsx(j,{externalData:s,classPrefix:e,parent:l._id,blocks:i}):null;const m=Y.getBlockComponent(l._type);if(m!==null){let p=l;const E=m.component;return p={...m.defaults,...l},d.createElement(E,r.omit({blockProps:{},inBuilder:!1,...p,index:h,...M(l,s),...u(p),...f},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[l._type," not found"]})}))})}const W=({pageData:t,externalData:n={},before:e=null,after:s=null,classPrefix:i="c-"})=>{const u=r.get(t.project,"brandingOptions",B.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:i.replace("-","")+" "+_.getBrandingClasses(u,i)+" min-h-screen",children:c.jsxRuntimeExports.jsx(C.Provider,{children:c.jsxRuntimeExports.jsx(j,{externalData:n,blocks:t.page.blocks||[],classPrefix:i})})}),s]})};exports.convertToBlocks=_.convertToBlocks;exports.RenderChaiBlocks=j;exports.RenderChaiPage=W;exports.RenderUnregisteredComponents=y;
|
package/dist/render.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ declare type ChaiPageProps = {
|
|
|
47
47
|
externalData?: Record<string, any>;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
export declare const convertToBlocks: (jsonString: string) => ChaiBlock[];
|
|
51
|
+
|
|
50
52
|
export declare function RenderChaiBlocks({ blocks, parent, classPrefix, externalData, }: {
|
|
51
53
|
blocks: ChaiBlock[];
|
|
52
54
|
parent?: string;
|
package/dist/render.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import { isString as _, memoize as N, get as
|
|
3
|
+
import { isString as _, memoize as N, get as a, isEmpty as h, each as $, filter as g, omit as R } from "lodash-es";
|
|
4
4
|
import { twMerge as T } from "tailwind-merge";
|
|
5
5
|
import { S as y, a as p } from "./STRINGS--j49GZJP.js";
|
|
6
|
-
import { a as F, g as W } from "./functions-
|
|
6
|
+
import { a as F, g as W } from "./functions-ge87TVcc.js";
|
|
7
|
+
import { c as ot } from "./functions-ge87TVcc.js";
|
|
7
8
|
import { getBlockComponent as L } from "@chaibuilder/runtime";
|
|
8
9
|
import { Provider as Y } from "react-wrap-balancer";
|
|
9
10
|
import { B as I } from "./MODIFIERS-cBT31iqE.js";
|
|
@@ -18,7 +19,7 @@ const K = (t) => {
|
|
|
18
19
|
return s ? F(r, s).replace(p, "").trim() : r.replace(p, "").trim();
|
|
19
20
|
});
|
|
20
21
|
function w(t, s) {
|
|
21
|
-
return
|
|
22
|
+
return a(t, `${s}_attrs`, {});
|
|
22
23
|
}
|
|
23
24
|
function z(t, s) {
|
|
24
25
|
const n = {};
|
|
@@ -33,20 +34,20 @@ function z(t, s) {
|
|
|
33
34
|
}), n;
|
|
34
35
|
}
|
|
35
36
|
function G(t, s) {
|
|
36
|
-
const n =
|
|
37
|
+
const n = a(t, "_bindings", {});
|
|
37
38
|
return h(n) ? { ...t } : ($(n, (r, e) => {
|
|
38
|
-
_(r) &&
|
|
39
|
+
_(r) && a(s, r, null) && (t[e] = a(s, r, null));
|
|
39
40
|
}), t);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
const { components: s, blocks: n, parent: r, classPrefix: e = "", externalData: m = {} } = t, j = n,
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
S.map((
|
|
45
|
-
const
|
|
46
|
-
h(
|
|
47
|
-
d[
|
|
48
|
-
C
|
|
49
|
-
|
|
42
|
+
function O(t) {
|
|
43
|
+
const { components: s, blocks: n, parent: r, classPrefix: e = "", externalData: m = {} } = t, j = n, c = (o) => z(o, e), S = r ? g(n, { _parent: r }) : g(n, (o) => h(o._parent));
|
|
44
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: u.Children.toArray(
|
|
45
|
+
S.map((o, E) => {
|
|
46
|
+
const B = K(o), d = {};
|
|
47
|
+
h(B) || Object.keys(B).forEach((C) => {
|
|
48
|
+
d[C] = u.Children.toArray(
|
|
49
|
+
B[C].map((A) => /* @__PURE__ */ i.jsx(
|
|
50
|
+
O,
|
|
50
51
|
{
|
|
51
52
|
externalData: m,
|
|
52
53
|
classPrefix: e,
|
|
@@ -57,37 +58,37 @@ function x(t) {
|
|
|
57
58
|
))
|
|
58
59
|
);
|
|
59
60
|
});
|
|
60
|
-
const l = g(j, { _parent:
|
|
61
|
-
d.children = l.length > 0 ? /* @__PURE__ */
|
|
62
|
-
|
|
61
|
+
const l = g(j, { _parent: o._id });
|
|
62
|
+
d.children = l.length > 0 ? /* @__PURE__ */ i.jsx(
|
|
63
|
+
O,
|
|
63
64
|
{
|
|
64
65
|
externalData: m,
|
|
65
66
|
classPrefix: e,
|
|
66
|
-
parent:
|
|
67
|
+
parent: o._id,
|
|
67
68
|
blocks: j,
|
|
68
69
|
components: s
|
|
69
70
|
}
|
|
70
71
|
) : null;
|
|
71
|
-
const f =
|
|
72
|
+
const f = a(s, o._type, null);
|
|
72
73
|
if (f !== null) {
|
|
73
|
-
let
|
|
74
|
+
let C = o;
|
|
74
75
|
const A = f;
|
|
75
76
|
return u.createElement(
|
|
76
77
|
A,
|
|
77
78
|
R(
|
|
78
79
|
{
|
|
79
|
-
...
|
|
80
|
+
...C,
|
|
80
81
|
index: E,
|
|
81
|
-
...G(
|
|
82
|
-
...
|
|
82
|
+
...G(o, m),
|
|
83
|
+
...c(C),
|
|
83
84
|
...d
|
|
84
85
|
},
|
|
85
86
|
["_parent"]
|
|
86
87
|
)
|
|
87
88
|
);
|
|
88
89
|
}
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
90
|
+
return /* @__PURE__ */ i.jsxs("noscript", { children: [
|
|
91
|
+
o._type,
|
|
91
92
|
" not found"
|
|
92
93
|
] });
|
|
93
94
|
})
|
|
@@ -103,7 +104,7 @@ const M = (t) => {
|
|
|
103
104
|
return s === "" ? r.replace(p, "").trim() : F(r, s).replace(p, "").trim();
|
|
104
105
|
});
|
|
105
106
|
function H(t, s) {
|
|
106
|
-
return
|
|
107
|
+
return a(t, `${s}_attrs`, {});
|
|
107
108
|
}
|
|
108
109
|
function J(t, s) {
|
|
109
110
|
const n = {};
|
|
@@ -118,25 +119,25 @@ function J(t, s) {
|
|
|
118
119
|
}), n;
|
|
119
120
|
}
|
|
120
121
|
function P(t, s) {
|
|
121
|
-
const n =
|
|
122
|
+
const n = a(t, "_bindings", {});
|
|
122
123
|
return h(n) ? { ...t } : ($(n, (r, e) => {
|
|
123
|
-
_(r) &&
|
|
124
|
+
_(r) && a(s, r, null) && (t[e] = a(s, r, null));
|
|
124
125
|
}), t);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function x({
|
|
127
128
|
blocks: t,
|
|
128
129
|
parent: s,
|
|
129
130
|
classPrefix: n = "",
|
|
130
131
|
externalData: r = {}
|
|
131
132
|
}) {
|
|
132
|
-
const e = t, m = (
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
j.map((
|
|
135
|
-
const
|
|
136
|
-
h(
|
|
133
|
+
const e = t, m = (c) => J(c, n), j = s ? g(t, { _parent: s }) : g(t, (c) => h(c._parent));
|
|
134
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: u.Children.toArray(
|
|
135
|
+
j.map((c, S) => {
|
|
136
|
+
const o = M(c), E = {};
|
|
137
|
+
h(o) || Object.keys(o).forEach((l) => {
|
|
137
138
|
E[l] = u.Children.toArray(
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
o[l].map((f) => /* @__PURE__ */ i.jsx(
|
|
140
|
+
x,
|
|
140
141
|
{
|
|
141
142
|
externalData: r,
|
|
142
143
|
classPrefix: n,
|
|
@@ -146,21 +147,21 @@ function O({
|
|
|
146
147
|
))
|
|
147
148
|
);
|
|
148
149
|
});
|
|
149
|
-
const
|
|
150
|
-
E.children =
|
|
151
|
-
|
|
150
|
+
const B = g(e, { _parent: c._id });
|
|
151
|
+
E.children = B.length > 0 ? /* @__PURE__ */ i.jsx(
|
|
152
|
+
x,
|
|
152
153
|
{
|
|
153
154
|
externalData: r,
|
|
154
155
|
classPrefix: n,
|
|
155
|
-
parent:
|
|
156
|
+
parent: c._id,
|
|
156
157
|
blocks: e
|
|
157
158
|
}
|
|
158
159
|
) : null;
|
|
159
|
-
const d = L(
|
|
160
|
+
const d = L(c._type);
|
|
160
161
|
if (d !== null) {
|
|
161
|
-
let l =
|
|
162
|
+
let l = c;
|
|
162
163
|
const f = d.component;
|
|
163
|
-
return l = { ...d.defaults, ...
|
|
164
|
+
return l = { ...d.defaults, ...c }, u.createElement(
|
|
164
165
|
f,
|
|
165
166
|
R(
|
|
166
167
|
{
|
|
@@ -168,7 +169,7 @@ function O({
|
|
|
168
169
|
inBuilder: !1,
|
|
169
170
|
...l,
|
|
170
171
|
index: S,
|
|
171
|
-
...P(
|
|
172
|
+
...P(c, r),
|
|
172
173
|
...m(l),
|
|
173
174
|
...E
|
|
174
175
|
},
|
|
@@ -176,8 +177,8 @@ function O({
|
|
|
176
177
|
)
|
|
177
178
|
);
|
|
178
179
|
}
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
|
|
180
|
+
return /* @__PURE__ */ i.jsxs("noscript", { children: [
|
|
181
|
+
c._type,
|
|
181
182
|
" not found"
|
|
182
183
|
] });
|
|
183
184
|
})
|
|
@@ -190,21 +191,22 @@ const st = ({
|
|
|
190
191
|
after: r = null,
|
|
191
192
|
classPrefix: e = "c-"
|
|
192
193
|
}) => {
|
|
193
|
-
const m =
|
|
194
|
-
return /* @__PURE__ */
|
|
194
|
+
const m = a(t.project, "brandingOptions", I);
|
|
195
|
+
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
195
196
|
n,
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ i.jsx(
|
|
197
198
|
"div",
|
|
198
199
|
{
|
|
199
200
|
className: e.replace("-", "") + " " + W(m, e) + " min-h-screen",
|
|
200
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ i.jsx(Y, { children: /* @__PURE__ */ i.jsx(x, { externalData: s, blocks: t.page.blocks || [], classPrefix: e }) })
|
|
201
202
|
}
|
|
202
203
|
),
|
|
203
204
|
r
|
|
204
205
|
] });
|
|
205
206
|
};
|
|
206
207
|
export {
|
|
207
|
-
|
|
208
|
+
x as RenderChaiBlocks,
|
|
208
209
|
st as RenderChaiPage,
|
|
209
|
-
|
|
210
|
+
O as RenderUnregisteredComponents,
|
|
211
|
+
ot as convertToBlocks
|
|
210
212
|
};
|
|
@@ -0,0 +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("./ChaiBuilderEditor-YqEKonJ_.cjs"),d=require("./controls-jWJDao88.cjs"),w=require("sonner"),p=require("./form-q7lxaK3j.cjs"),P=require("./index-eYwpNzUl.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-UminFzYh.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-Uzq5XNGt.cjs"))),E=n=>{if(!c.isString(n)||!(n.includes("/[")&&n.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return n.split("/").forEach(u=>{e&&(u.includes("[[")&&u.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(u):u.includes("[")&&u.includes("]")?e=s.test(u):e=q.test(u))}),e},h=n=>n&&c.isEmpty(n.seoData)?{...n,seoData:{title:"",description:"",image:""}}:n,G=(n,o)=>{const s=!c.isEqual(c.omit(n,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(n).seoData);return s||q},Y=({open:n,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),u=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)||"")){n==="ALERT"&&o("PENDING");return}u.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")})},R=({formData:l},t)=>{b(g=>{var S,N;if(!t)return g;const x={[t]:l[t]};return t==="name"?x.slug=c.kebabCase((S=l[t])==null?void 0:S.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.l({title:"Page Name",default:i.name}),slug:d.l({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.l({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.q({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:n==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||u.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:R,disabled:u.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:R,disabled:u.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:u.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||u.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;
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import I, { useState as j, useEffect as z } from "react";
|
|
3
|
-
import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as
|
|
4
|
-
import { HomeIcon as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { isString as L, isEmpty as x, isEqual as C, omit as y, kebabCase as q } from "lodash-es";
|
|
4
|
+
import { HomeIcon as B } from "@radix-ui/react-icons";
|
|
5
|
+
import { b9 as G, B as Y } from "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
6
|
+
import { l as g, b as Z, g as $, q as F, r as Q } from "./controls-VTdJhdSz.js";
|
|
7
7
|
import { toast as U } from "sonner";
|
|
8
|
-
import { F as P } from "./form-
|
|
9
|
-
import { f as V, a as X, g as _, b as K } from "./index-
|
|
8
|
+
import { F as P } from "./form-dQQ2tTRZ.js";
|
|
9
|
+
import { f as V, a as X, g as _, b as K } from "./index-OsS2_gM8.js";
|
|
10
10
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
11
|
-
import "./Functions-7jnEwJyw.js";
|
|
12
11
|
import "clsx";
|
|
13
|
-
import "
|
|
14
|
-
import "@
|
|
12
|
+
import "react-dom";
|
|
13
|
+
import "@radix-ui/react-scroll-area";
|
|
14
|
+
import "@floating-ui/react-dom";
|
|
15
15
|
import "jotai";
|
|
16
|
+
import "i18next";
|
|
17
|
+
import "react-i18next";
|
|
18
|
+
import "flagged";
|
|
16
19
|
import "./STRINGS--j49GZJP.js";
|
|
20
|
+
import "./Functions-7jnEwJyw.js";
|
|
21
|
+
import "tailwind-merge";
|
|
22
|
+
import "@chaibuilder/runtime";
|
|
17
23
|
import "@react-hookz/web";
|
|
18
24
|
import "./MODIFIERS-cBT31iqE.js";
|
|
19
|
-
import "./Class-6Hz2KzYb.js";
|
|
20
|
-
import "react-i18next";
|
|
21
25
|
import "@radix-ui/react-toggle";
|
|
22
26
|
import "class-variance-authority";
|
|
27
|
+
import "./Class-6Hz2KzYb.js";
|
|
23
28
|
import "@radix-ui/react-switch";
|
|
24
29
|
import "@radix-ui/react-slot";
|
|
25
30
|
import "@radix-ui/react-accordion";
|
|
26
31
|
import "@radix-ui/react-alert-dialog";
|
|
27
32
|
import "@radix-ui/react-dialog";
|
|
28
33
|
import "@radix-ui/react-label";
|
|
29
|
-
import "@radix-ui/react-scroll-area";
|
|
30
34
|
import "@radix-ui/react-tabs";
|
|
31
35
|
import "@radix-ui/react-tooltip";
|
|
32
36
|
import "@radix-ui/react-popover";
|
|
@@ -39,20 +43,16 @@ import "@radix-ui/react-toast";
|
|
|
39
43
|
import "cmdk";
|
|
40
44
|
import "@radix-ui/react-context-menu";
|
|
41
45
|
import "react-icons-picker";
|
|
42
|
-
import "react-dom";
|
|
43
46
|
import "react-quill";
|
|
47
|
+
import "react-hotkeys-hook";
|
|
48
|
+
import "lodash";
|
|
49
|
+
import "lucide-react";
|
|
44
50
|
import "@rjsf/core";
|
|
45
51
|
import "@rjsf/validator-ajv8";
|
|
46
|
-
import "./
|
|
47
|
-
import "i18next";
|
|
48
|
-
import "@floating-ui/react-dom";
|
|
49
|
-
import "flagged";
|
|
50
|
-
import "react-hotkeys-hook";
|
|
52
|
+
import "./core.js";
|
|
51
53
|
import "./html-to-json-ZV4QjSww.js";
|
|
52
54
|
import "himalaya";
|
|
53
|
-
import "
|
|
54
|
-
import "./index-YpnaudSM.js";
|
|
55
|
-
const O = I.lazy(() => import("./delete-page-modal-KxeyBri2.js")), J = I.lazy(() => import("./confirm-alert-FGQKKQJU.js")), h = (r) => {
|
|
55
|
+
const O = I.lazy(() => import("./delete-page-modal-XrIpujav.js")), J = I.lazy(() => import("./confirm-alert-sI4pItIN.js")), h = (r) => {
|
|
56
56
|
if (!L(r) || !(r.includes("/[") && r.includes("]")))
|
|
57
57
|
return !1;
|
|
58
58
|
const s = /^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/, u = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -96,7 +96,7 @@ const O = I.lazy(() => import("./delete-page-modal-KxeyBri2.js")), J = I.lazy(()
|
|
|
96
96
|
if (!o)
|
|
97
97
|
return p;
|
|
98
98
|
const a = { [o]: l[o] };
|
|
99
|
-
return o === "name" ? a.slug =
|
|
99
|
+
return o === "name" ? a.slug = q((E = l[o]) == null ? void 0 : E.replace(/\d/g, "")) : o === "slug" ? a.slug = (A = l[o]) == null ? void 0 : A.replace(/\d/g, "").replace(/\s+/g, "").replace("--", "-").replace("__", "_") : o === "seoData" && (a.seoData = {
|
|
100
100
|
title: l[o].title || "",
|
|
101
101
|
description: l[o].description || "",
|
|
102
102
|
image: l[o].image || ""
|
|
@@ -146,7 +146,7 @@ const O = I.lazy(() => import("./delete-page-modal-KxeyBri2.js")), J = I.lazy(()
|
|
|
146
146
|
default: d.isHomePage
|
|
147
147
|
})
|
|
148
148
|
};
|
|
149
|
-
return /* @__PURE__ */ t.jsxs(
|
|
149
|
+
return /* @__PURE__ */ t.jsxs(G, { className: "flex h-full select-none flex-col", children: [
|
|
150
150
|
/* @__PURE__ */ t.jsx(
|
|
151
151
|
J,
|
|
152
152
|
{
|
|
@@ -189,7 +189,7 @@ const O = I.lazy(() => import("./delete-page-modal-KxeyBri2.js")), J = I.lazy(()
|
|
|
189
189
|
disabled: n.isPending || c.isPending
|
|
190
190
|
}
|
|
191
191
|
) : s.type === "STATIC" && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500", children: [
|
|
192
|
-
/* @__PURE__ */ t.jsx(
|
|
192
|
+
/* @__PURE__ */ t.jsx(B, {}),
|
|
193
193
|
" This is homepage",
|
|
194
194
|
" "
|
|
195
195
|
] }),
|
|
@@ -199,7 +199,7 @@ const O = I.lazy(() => import("./delete-page-modal-KxeyBri2.js")), J = I.lazy(()
|
|
|
199
199
|
] }),
|
|
200
200
|
/* @__PURE__ */ t.jsxs("div", { className: "my-2 flex w-full items-center justify-between gap-x-2 px-1", children: [
|
|
201
201
|
/* @__PURE__ */ t.jsx(
|
|
202
|
-
|
|
202
|
+
Y,
|
|
203
203
|
{
|
|
204
204
|
className: "w-full",
|
|
205
205
|
type: "submit",
|
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-eYwpNzUl.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./core.cjs");require("./ChaiBuilderEditor-YqEKonJ_.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");exports.ChaiBuilderStudio=e.ChaiBuilderStudio;
|
package/dist/studio.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
2
2
|
import { default as React_2 } from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
declare type AskAiResponse = {
|
|
6
|
+
blocks?: Array<{
|
|
7
|
+
_id: string;
|
|
8
|
+
} & Partial<ChaiBlock>>;
|
|
9
|
+
usage?: Record<any, number>;
|
|
10
|
+
error?: any;
|
|
11
|
+
};
|
|
12
|
+
|
|
5
13
|
declare interface Block {
|
|
6
14
|
type: string;
|
|
7
15
|
[key: string]: any;
|
|
@@ -48,6 +56,7 @@ declare interface ChaiBuilderEditorProps {
|
|
|
48
56
|
uploadMediaCallback?: (file: File) => Promise<{
|
|
49
57
|
url: string;
|
|
50
58
|
}>;
|
|
59
|
+
askAiCallBack?: (prompt: string, blocks: ChaiBlock[]) => Promise<AskAiResponse>;
|
|
51
60
|
getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
|
|
52
61
|
blocks: ChaiBlock[];
|
|
53
62
|
html: string;
|
package/dist/studio.js
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import { C as Z } from "./index-
|
|
2
|
+
import { C as Z } from "./index-OsS2_gM8.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
6
|
-
import "./
|
|
6
|
+
import "./core.js";
|
|
7
|
+
import "./ChaiBuilderEditor-y1NxvXJ7.js";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@radix-ui/react-scroll-area";
|
|
11
|
+
import "@floating-ui/react-dom";
|
|
12
|
+
import "jotai";
|
|
7
13
|
import "i18next";
|
|
8
14
|
import "react-i18next";
|
|
9
|
-
import "
|
|
15
|
+
import "flagged";
|
|
10
16
|
import "lodash-es";
|
|
17
|
+
import "./STRINGS--j49GZJP.js";
|
|
11
18
|
import "./Functions-7jnEwJyw.js";
|
|
12
|
-
import "clsx";
|
|
13
19
|
import "tailwind-merge";
|
|
14
20
|
import "@chaibuilder/runtime";
|
|
15
|
-
import "jotai";
|
|
16
|
-
import "./STRINGS--j49GZJP.js";
|
|
17
21
|
import "@react-hookz/web";
|
|
18
22
|
import "./MODIFIERS-cBT31iqE.js";
|
|
19
|
-
import "./Class-6Hz2KzYb.js";
|
|
20
23
|
import "@radix-ui/react-toggle";
|
|
21
24
|
import "class-variance-authority";
|
|
25
|
+
import "./Class-6Hz2KzYb.js";
|
|
22
26
|
import "@radix-ui/react-switch";
|
|
23
27
|
import "@radix-ui/react-slot";
|
|
24
28
|
import "@radix-ui/react-accordion";
|
|
@@ -26,7 +30,6 @@ import "@radix-ui/react-icons";
|
|
|
26
30
|
import "@radix-ui/react-alert-dialog";
|
|
27
31
|
import "@radix-ui/react-dialog";
|
|
28
32
|
import "@radix-ui/react-label";
|
|
29
|
-
import "@radix-ui/react-scroll-area";
|
|
30
33
|
import "@radix-ui/react-tabs";
|
|
31
34
|
import "@radix-ui/react-tooltip";
|
|
32
35
|
import "@radix-ui/react-popover";
|
|
@@ -39,15 +42,12 @@ import "@radix-ui/react-toast";
|
|
|
39
42
|
import "cmdk";
|
|
40
43
|
import "@radix-ui/react-context-menu";
|
|
41
44
|
import "react-icons-picker";
|
|
42
|
-
import "react-dom";
|
|
43
45
|
import "react-quill";
|
|
44
|
-
import "@floating-ui/react-dom";
|
|
45
|
-
import "flagged";
|
|
46
46
|
import "react-hotkeys-hook";
|
|
47
|
+
import "lodash";
|
|
48
|
+
import "lucide-react";
|
|
47
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
48
50
|
import "himalaya";
|
|
49
|
-
import "lucide-react";
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
51
|
export {
|
|
52
52
|
Z as ChaiBuilderStudio
|
|
53
53
|
};
|
package/dist/ui.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ChaiBuilderEditor-YqEKonJ_.cjs");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("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./STRINGS-gPz7CUOk.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lodash");require("lucide-react");exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.Alert=e.Alert;exports.AlertDescription=e.AlertDescription;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.AlertTitle=e.AlertTitle;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.IconPickerField=e.IconPickerField;exports.ImagePickerField=e.ImagePickerField;exports.Input=e.Input;exports.Label=e.Label;exports.LinkField=e.LinkField;exports.Menubar=e.Menubar;exports.MenubarCheckboxItem=e.MenubarCheckboxItem;exports.MenubarContent=e.MenubarContent;exports.MenubarGroup=e.MenubarGroup;exports.MenubarItem=e.MenubarItem;exports.MenubarLabel=e.MenubarLabel;exports.MenubarMenu=e.MenubarMenu;exports.MenubarPortal=e.MenubarPortal;exports.MenubarRadioGroup=e.MenubarRadioGroup;exports.MenubarRadioItem=e.MenubarRadioItem;exports.MenubarSeparator=e.MenubarSeparator;exports.MenubarShortcut=e.MenubarShortcut;exports.MenubarSub=e.MenubarSub;exports.MenubarSubContent=e.MenubarSubContent;exports.MenubarSubTrigger=e.MenubarSubTrigger;exports.MenubarTrigger=e.MenubarTrigger;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.RTEField=e.RichTextEditorField;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Sheet=e.Sheet;exports.SheetClose=e.SheetClose;exports.SheetContent=e.SheetContent;exports.SheetDescription=e.SheetDescription;exports.SheetFooter=e.SheetFooter;exports.SheetHeader=e.SheetHeader;exports.SheetTitle=e.SheetTitle;exports.SheetTrigger=e.SheetTrigger;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.toggleVariants=e.toggleVariants;exports.useToast=e.useToast;
|