@chaibuilder/sdk 1.1.18 → 1.2.0
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-57-vroWk.cjs +1 -0
- package/dist/AddBlocks-QvCc-oag.js +225 -0
- package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
- package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
- package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
- package/dist/CanvasArea-jRg53jrS.cjs +59 -0
- package/dist/CurrentPage-MLObvs0K.cjs +1 -0
- package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
- package/dist/Functions-7jnEwJyw.js +15 -0
- package/dist/Functions-N3yhPYKY.cjs +1 -0
- package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
- package/dist/Layers-x_mWeT_q.cjs +1 -0
- package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
- package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
- package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
- package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
- package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
- package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
- package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
- package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
- package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
- package/dist/Settings-KlTtgu3w.cjs +1 -0
- package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
- package/dist/SidePanels-eJBA_cUu.cjs +1 -0
- package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
- package/dist/Topbar-u5XKdWgQ.cjs +1 -0
- package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
- package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
- package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
- package/dist/UploadImages-eHYxwWAp.cjs +1 -0
- package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
- package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
- package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
- package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
- package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
- package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
- package/dist/controls-Dy1qa8Dc.cjs +1 -0
- package/dist/controls-XPXGHKht.js +182 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +10 -1
- package/dist/core.js +60 -57
- package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
- package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
- package/dist/email-blocks.cjs +1 -0
- package/dist/email-blocks.d.ts +3 -0
- package/dist/email-blocks.js +35 -0
- package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
- package/dist/form-lJhy9DEC.cjs +1 -0
- package/dist/functions-Ox_svtKm.cjs +1 -0
- package/dist/functions-xIebp8Aw.js +23 -0
- package/dist/html-to-json-dfALTAdG.cjs +1 -0
- package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
- package/dist/index-IIJ_o44s.cjs +1 -0
- package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
- package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
- package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
- package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
- package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
- package/dist/lib.cjs +2 -2
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js +47 -44
- package/dist/page-viewer-WhM1FSU0.cjs +1 -0
- package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
- package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
- package/dist/project-general-setting-y8daY7V9.cjs +1 -0
- package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
- package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +50 -49
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +11 -11
- package/dist/single-page-detail--xPv74bX.cjs +1 -0
- package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +11 -8
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -142
- package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
- package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
- package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
- package/dist/utils-PTxFk6qT.cjs +1 -0
- package/dist/web-blocks.cjs +9 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1033 -0
- package/package.json +5 -2
- package/dist/AddBlocks-sKF4ti68.js +0 -222
- package/dist/AddBlocks-yPovJXtD.cjs +0 -1
- package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
- package/dist/CanvasArea-xxqOiENt.cjs +0 -59
- package/dist/CurrentPage-ju6otPNk.cjs +0 -1
- package/dist/Layers-d9OU0HRE.cjs +0 -1
- package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
- package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
- package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
- package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
- package/dist/Settings-eZnusNbR.cjs +0 -1
- package/dist/SidePanels-BVM5JwGC.cjs +0 -1
- package/dist/Topbar-gQxbcPtG.cjs +0 -1
- package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
- package/dist/UploadImages-BoSSsLtD.cjs +0 -1
- package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
- package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
- package/dist/controls-QnyBNkXG.cjs +0 -36
- package/dist/controls-kEuiMMDf.js +0 -4600
- package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
- package/dist/form-6qGAOYI3.cjs +0 -1
- package/dist/functions-86L6n983.js +0 -23
- package/dist/functions-Jr7gX_RX.cjs +0 -1
- package/dist/html-to-json-AqLy6ye-.cjs +0 -1
- package/dist/index-d55M5MRz.cjs +0 -1
- package/dist/lodash-2us0VT8I.cjs +0 -36
- package/dist/lodash-3gkdNK5u.js +0 -4538
- package/dist/page-viewer-G2YIKVSt.cjs +0 -1
- package/dist/project-general-setting-sinIiBKe.cjs +0 -1
- package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
- package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
- package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
- package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
- package/dist/utils-37UXq2O5.cjs +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-
|
|
1
|
+
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { F as
|
|
6
|
-
import { b as x } from "./index-
|
|
7
|
-
import "./
|
|
3
|
+
import { bn as n } from "./index-_OgCuSUz.js";
|
|
4
|
+
import { u as c, o as u } from "./controls-XPXGHKht.js";
|
|
5
|
+
import { F as d } from "./form-Moz_psOw.js";
|
|
6
|
+
import { b as x } from "./index-QEchoZ98.js";
|
|
7
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
8
|
import "@radix-ui/react-toggle";
|
|
9
9
|
import "class-variance-authority";
|
|
10
|
-
import "./utils-
|
|
11
|
-
import "
|
|
10
|
+
import "./utils-AvyFzbPC.js";
|
|
11
|
+
import "lodash-es";
|
|
12
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
12
13
|
import "clsx";
|
|
13
14
|
import "tailwind-merge";
|
|
14
15
|
import "@radix-ui/react-switch";
|
|
@@ -35,6 +36,7 @@ import "react-dom";
|
|
|
35
36
|
import "react-quill";
|
|
36
37
|
import "jotai";
|
|
37
38
|
import "flat-to-nested";
|
|
39
|
+
import "./Functions-7jnEwJyw.js";
|
|
38
40
|
import "redux-undo";
|
|
39
41
|
import "@chaibuilder/runtime";
|
|
40
42
|
import "@react-hookz/web";
|
|
@@ -49,10 +51,11 @@ import "react-dnd";
|
|
|
49
51
|
import "@minoru/react-dnd-treeview";
|
|
50
52
|
import "react-hotkeys-hook";
|
|
51
53
|
import "sonner";
|
|
52
|
-
import "./html-to-json-
|
|
54
|
+
import "./html-to-json-xKBERAI1.js";
|
|
53
55
|
import "himalaya";
|
|
56
|
+
import "lodash";
|
|
54
57
|
import "lucide-react";
|
|
55
|
-
const
|
|
58
|
+
const go = ({
|
|
56
59
|
_projectData: m,
|
|
57
60
|
seany: t
|
|
58
61
|
}) => {
|
|
@@ -70,10 +73,10 @@ const jo = ({
|
|
|
70
73
|
title: "Project Name",
|
|
71
74
|
default: o == null ? void 0 : o.name
|
|
72
75
|
}),
|
|
73
|
-
favicon:
|
|
76
|
+
favicon: u({ title: "Favicon", default: o == null ? void 0 : o.favicon })
|
|
74
77
|
};
|
|
75
|
-
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(
|
|
78
|
+
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(d, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
76
79
|
};
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
go as default
|
|
79
82
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./index-IIJ_o44s.cjs"),o=require("./controls-Dy1qa8Dc.cjs"),d=require("./form-lJhy9DEC.cjs"),m=require("./index-hMoPNZVn.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("lodash-es");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("sonner");require("./html-to-json-dfALTAdG.cjs");require("himalaya");require("lodash");require("lucide-react");function j(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const g=j(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();g.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.u({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.o({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-Z_BpKhVy.cjs"),i=require("./controls-Dy1qa8Dc.cjs"),g=require("./form-lJhy9DEC.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./index-IIJ_o44s.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");const D=({_projectData:e,seany:n})=>{var t,u,o,q,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:((o=e.seoData)==null?void 0:o.image)||""},properties:{title:i.u({title:"Default Title",default:((q=e.seoData)==null?void 0:q.title)||""}),description:i.g({title:"Default Description",default:((s=e.seoData)==null?void 0:s.description)||""}),image:i.o({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;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { j as s } from "./jsx-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { F as v } from "./form-
|
|
4
|
-
import "./
|
|
1
|
+
import { j as s } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
+
import { b as D, u as c, g, o as x } from "./controls-XPXGHKht.js";
|
|
3
|
+
import { F as v } from "./form-Moz_psOw.js";
|
|
4
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import "lodash-es";
|
|
6
7
|
import "@rjsf/core";
|
|
7
8
|
import "@rjsf/validator-ajv8";
|
|
8
|
-
import "./
|
|
9
|
-
import "./index-0OqmBgqo.js";
|
|
9
|
+
import "./index-_OgCuSUz.js";
|
|
10
10
|
import "@radix-ui/react-toggle";
|
|
11
11
|
import "class-variance-authority";
|
|
12
|
-
import "./utils-
|
|
12
|
+
import "./utils-AvyFzbPC.js";
|
|
13
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
13
14
|
import "clsx";
|
|
14
15
|
import "tailwind-merge";
|
|
15
16
|
import "@radix-ui/react-switch";
|
|
@@ -36,23 +37,24 @@ import "react-dom";
|
|
|
36
37
|
import "react-quill";
|
|
37
38
|
import "jotai";
|
|
38
39
|
import "flat-to-nested";
|
|
40
|
+
import "./Functions-7jnEwJyw.js";
|
|
39
41
|
import "redux-undo";
|
|
40
42
|
import "@chaibuilder/runtime";
|
|
41
43
|
import "@react-hookz/web";
|
|
42
44
|
import "react-i18next";
|
|
43
|
-
const
|
|
45
|
+
const lt = ({
|
|
44
46
|
_projectData: t,
|
|
45
47
|
seany: l
|
|
46
48
|
}) => {
|
|
47
49
|
var o, e, r, m, p, a;
|
|
48
50
|
const n = ({ formData: f }) => {
|
|
49
51
|
const i = { ...f };
|
|
50
|
-
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((
|
|
51
|
-
...
|
|
52
|
+
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((u) => ({
|
|
53
|
+
...u,
|
|
52
54
|
...i
|
|
53
55
|
}));
|
|
54
56
|
}, d = {
|
|
55
|
-
seoData:
|
|
57
|
+
seoData: D({
|
|
56
58
|
title: "",
|
|
57
59
|
default: {
|
|
58
60
|
title: ((o = t.seoData) == null ? void 0 : o.title) || "",
|
|
@@ -60,7 +62,7 @@ const at = ({
|
|
|
60
62
|
image: ((r = t.seoData) == null ? void 0 : r.image) || ""
|
|
61
63
|
},
|
|
62
64
|
properties: {
|
|
63
|
-
title:
|
|
65
|
+
title: c({
|
|
64
66
|
title: "Default Title",
|
|
65
67
|
default: ((m = t.seoData) == null ? void 0 : m.title) || ""
|
|
66
68
|
}),
|
|
@@ -78,5 +80,5 @@ const at = ({
|
|
|
78
80
|
return /* @__PURE__ */ s.jsx("div", { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ s.jsx(v, { properties: d, formData: t, onChange: n }) });
|
|
79
81
|
};
|
|
80
82
|
export {
|
|
81
|
-
|
|
83
|
+
lt as default
|
|
82
84
|
};
|
package/dist/render.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-Z_BpKhVy.cjs"),j=require("react"),s=require("lodash-es"),R=require("tailwind-merge"),u=require("./MODIFIERS-2FeVfZQ9.cjs"),_=require("@chaibuilder/runtime"),x=require("./functions-Ox_svtKm.cjs"),y=require("react-wrap-balancer");require("./_commonjsHelpers-wDK0ZLPo.cjs");const B=t=>{const r={};return Object.keys(t).forEach(e=>{s.isString(t[e])&&t[e].startsWith(u.SLOT_KEY)&&(r[e]=t[e].replace(u.SLOT_KEY,"").split(","))}),r},C=s.memoize((t,r)=>{const e=t.replace(u.STYLES_KEY,"").split(","),n=R.twMerge(e[0],e[1]);return x.addPrefixToClasses(n,r).replace(u.STYLES_KEY,"").trim()});function O(t,r){return s.get(t,`${r}_attrs`,{})}function q(t,r){const e={};return Object.keys(t).forEach(n=>{if(s.isString(t[n])&&t[n].startsWith(u.STYLES_KEY)){const o=C(t[n],r);e[n]={className:o,...O(t,n)}}}),e}function T(t,r){const e=s.get(t,"_bindings",{});return s.isEmpty(e)?{...t}:(s.each(e,(n,o)=>{s.isString(n)&&s.get(r,n,null)&&(t[o]=s.get(r,n,null))}),t)}function a({blocks:t,parent:r,classPrefix:e="c-",externalData:n={}}){const o=t,p=i=>q(i,e),f=r?s.filter(t,{_parent:r}):s.filter(t,i=>s.isEmpty(i._parent));return c.jsxRuntimeExports.jsx(c.jsxRuntimeExports.Fragment,{children:j.Children.toArray(f.map((i,h)=>{const d=B(i),m={};s.isEmpty(d)||Object.keys(d).forEach(l=>{m[l]=j.Children.toArray(d[l].map(E=>c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,blocks:o,parent:E})))});const S=s.filter(o,{_parent:i._id});m.children=S.length>0?c.jsxRuntimeExports.jsx(a,{externalData:n,classPrefix:e,parent:i._id,blocks:o}):null;const g=_.getBlockComponent(i._type);if(g!==null){let l=i;const E=g.component;return l={...g.defaults,...i},j.createElement(E,s.omit({blockProps:{},inBuilder:!1,...l,index:h,...T(i,n),...p(l),...m},["_parent"]))}return c.jsxRuntimeExports.jsxs("noscript",{children:[i._type," not found"]})}))})}const Y=({pageData:t,externalData:r={},before:e=null,after:n=null,classPrefix:o="c-"})=>{const p=s.get(t.project,"brandingOptions",u.BRANDING_OPTIONS_DEFAULTS);return c.jsxRuntimeExports.jsxs(c.jsxRuntimeExports.Fragment,{children:[e,c.jsxRuntimeExports.jsx("div",{className:o.replace("-","")+" "+x.getBrandingClasses(p,o)+" min-h-screen",children:c.jsxRuntimeExports.jsx(y.Provider,{children:c.jsxRuntimeExports.jsx(a,{externalData:r,blocks:t.page.blocks||[],classPrefix:o})})}),n]})};exports.RenderChaiBlocks=a;exports.RenderChaiPage=Y;
|
package/dist/render.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { default as React_2 } from 'react';
|
|
|
3
3
|
|
|
4
4
|
declare type ChaiBlock = {
|
|
5
5
|
_id: string;
|
|
6
|
+
_type: string;
|
|
6
7
|
_name?: string;
|
|
7
8
|
_parent?: string | null | undefined;
|
|
8
9
|
_bindings?: Record<string, string>;
|
|
9
|
-
readonly _type: string;
|
|
10
10
|
} & Record<string, any>;
|
|
11
11
|
|
|
12
12
|
export declare type ChaiPageData = {
|
package/dist/render.js
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { isString as E, memoize as y, get as c, isEmpty as h, each as A, filter as g, omit as x } from "lodash-es";
|
|
4
4
|
import { twMerge as N } from "tailwind-merge";
|
|
5
|
-
import { S as B, a as _, B as R } from "./MODIFIERS-
|
|
5
|
+
import { S as B, a as _, B as R } from "./MODIFIERS-RiXS5Mn1.js";
|
|
6
6
|
import { getBlockComponent as T } from "@chaibuilder/runtime";
|
|
7
|
-
import { a as F, g as L } from "./functions-
|
|
7
|
+
import { a as F, g as L } from "./functions-xIebp8Aw.js";
|
|
8
8
|
import { Provider as Y } from "react-wrap-balancer";
|
|
9
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
9
10
|
const I = (t) => {
|
|
10
11
|
const r = {};
|
|
11
|
-
return Object.keys(t).forEach((
|
|
12
|
-
E(t[
|
|
12
|
+
return Object.keys(t).forEach((n) => {
|
|
13
|
+
E(t[n]) && t[n].startsWith(B) && (r[n] = t[n].replace(B, "").split(","));
|
|
13
14
|
}), r;
|
|
14
15
|
}, K = y((t, r) => {
|
|
15
|
-
const
|
|
16
|
-
return F(
|
|
16
|
+
const n = t.replace(_, "").split(","), s = N(n[0], n[1]);
|
|
17
|
+
return F(s, r).replace(_, "").trim();
|
|
17
18
|
});
|
|
18
19
|
function W(t, r) {
|
|
19
20
|
return c(t, `${r}_attrs`, {});
|
|
20
21
|
}
|
|
21
22
|
function w(t, r) {
|
|
22
|
-
const
|
|
23
|
-
return Object.keys(t).forEach((
|
|
24
|
-
if (E(t[
|
|
25
|
-
const
|
|
26
|
-
s
|
|
27
|
-
className:
|
|
28
|
-
...W(t,
|
|
23
|
+
const n = {};
|
|
24
|
+
return Object.keys(t).forEach((s) => {
|
|
25
|
+
if (E(t[s]) && t[s].startsWith(_)) {
|
|
26
|
+
const i = K(t[s], r);
|
|
27
|
+
n[s] = {
|
|
28
|
+
className: i,
|
|
29
|
+
...W(t, s)
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
}),
|
|
32
|
+
}), n;
|
|
32
33
|
}
|
|
33
34
|
function z(t, r) {
|
|
34
|
-
const
|
|
35
|
-
return h(
|
|
36
|
-
E(
|
|
35
|
+
const n = c(t, "_bindings", {});
|
|
36
|
+
return h(n) ? { ...t } : (A(n, (s, i) => {
|
|
37
|
+
E(s) && c(r, s, null) && (t[i] = c(r, s, null));
|
|
37
38
|
}), t);
|
|
38
39
|
}
|
|
39
40
|
function j({
|
|
40
41
|
blocks: t,
|
|
41
42
|
parent: r,
|
|
42
|
-
classPrefix:
|
|
43
|
-
externalData:
|
|
43
|
+
classPrefix: n = "c-",
|
|
44
|
+
externalData: s = {}
|
|
44
45
|
}) {
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
const i = t, l = (e) => w(e, n), S = r ? g(t, { _parent: r }) : g(t, (e) => h(e._parent));
|
|
47
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: u.Children.toArray(
|
|
47
48
|
S.map((e, C) => {
|
|
48
|
-
const
|
|
49
|
-
h(
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const p = I(e), m = {};
|
|
50
|
+
h(p) || Object.keys(p).forEach((a) => {
|
|
51
|
+
m[a] = u.Children.toArray(
|
|
52
|
+
p[a].map((f) => /* @__PURE__ */ o.jsx(
|
|
52
53
|
j,
|
|
53
54
|
{
|
|
54
|
-
externalData:
|
|
55
|
-
classPrefix:
|
|
56
|
-
blocks:
|
|
55
|
+
externalData: s,
|
|
56
|
+
classPrefix: n,
|
|
57
|
+
blocks: i,
|
|
57
58
|
parent: f
|
|
58
59
|
}
|
|
59
60
|
))
|
|
60
61
|
);
|
|
61
62
|
});
|
|
62
|
-
const O = g(
|
|
63
|
-
|
|
63
|
+
const O = g(i, { _parent: e._id });
|
|
64
|
+
m.children = O.length > 0 ? /* @__PURE__ */ o.jsx(
|
|
64
65
|
j,
|
|
65
66
|
{
|
|
66
|
-
externalData:
|
|
67
|
-
classPrefix:
|
|
67
|
+
externalData: s,
|
|
68
|
+
classPrefix: n,
|
|
68
69
|
parent: e._id,
|
|
69
|
-
blocks:
|
|
70
|
+
blocks: i
|
|
70
71
|
}
|
|
71
72
|
) : null;
|
|
72
73
|
const d = T(e._type);
|
|
@@ -81,42 +82,42 @@ function j({
|
|
|
81
82
|
inBuilder: !1,
|
|
82
83
|
...a,
|
|
83
84
|
index: C,
|
|
84
|
-
...z(e,
|
|
85
|
+
...z(e, s),
|
|
85
86
|
...l(a),
|
|
86
|
-
...
|
|
87
|
+
...m
|
|
87
88
|
},
|
|
88
89
|
["_parent"]
|
|
89
90
|
)
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ o.jsxs("noscript", { children: [
|
|
93
94
|
e._type,
|
|
94
95
|
" not found"
|
|
95
96
|
] });
|
|
96
97
|
})
|
|
97
98
|
) });
|
|
98
99
|
}
|
|
99
|
-
const
|
|
100
|
+
const Q = ({
|
|
100
101
|
pageData: t,
|
|
101
102
|
externalData: r = {},
|
|
102
|
-
before:
|
|
103
|
-
after:
|
|
104
|
-
classPrefix:
|
|
103
|
+
before: n = null,
|
|
104
|
+
after: s = null,
|
|
105
|
+
classPrefix: i = "c-"
|
|
105
106
|
}) => {
|
|
106
107
|
const l = c(t.project, "brandingOptions", R);
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
109
|
+
n,
|
|
110
|
+
/* @__PURE__ */ o.jsx(
|
|
110
111
|
"div",
|
|
111
112
|
{
|
|
112
|
-
className:
|
|
113
|
-
children: /* @__PURE__ */
|
|
113
|
+
className: i.replace("-", "") + " " + L(l, i) + " min-h-screen",
|
|
114
|
+
children: /* @__PURE__ */ o.jsx(Y, { children: /* @__PURE__ */ o.jsx(j, { externalData: r, blocks: t.page.blocks || [], classPrefix: i }) })
|
|
114
115
|
}
|
|
115
116
|
),
|
|
116
|
-
|
|
117
|
+
s
|
|
117
118
|
] });
|
|
118
119
|
};
|
|
119
120
|
export {
|
|
120
121
|
j as RenderChaiBlocks,
|
|
121
|
-
|
|
122
|
+
Q as RenderChaiPage
|
|
122
123
|
};
|
package/dist/server.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var g=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var h=(a,t,e)=>(g(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("
|
|
1
|
+
"use strict";var u=Object.defineProperty;var g=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var h=(a,t,e)=>(g(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash-es"),l=require("@chaibuilder/runtime"),d="https://api.chaibuilder.com";class p{constructor(t,e){h(this,"_authSecret");h(this,"_accessToken",null);h(this,"_appKey");if(!t)throw"Please provide valid auth secret.";if(!e)throw"Please provide valid project key.";this._authSecret=t,this._appKey=e}setAccessToken(t){this._accessToken=t}async getPageData(t){const e=this.getHeaders(),s=this.getURL("page-data",i.isEmpty(t)?{}:{slug:t}),o={method:"GET",headers:e,next:{tags:["everything",i.isEmpty(t)?"_homepage":t]}};return this.fetchAPI(s,o)}async unlockPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page/unlock"),o={method:"POST",headers:e,body:JSON.stringify({uuid:t})};return this.fetchAPI(s,o)}async getPage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"GET",headers:e};return this.fetchAPI(s,o)}async getPages(){const t=this.getHeaders(),e=this.getURL("pages"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async addPage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async deletePage(t){if(!t)return Promise.reject({data:null,error:{message:"Invalid page uuid"},result:"error"});const e=this.getHeaders(),s=this.getURL("page",{uuid:t}),o={method:"DELETE",headers:e};return this.fetchAPI(s,o)}async updatePage(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("page"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async getProject(){const t=this.getHeaders(),e=this.getURL("project"),r={method:"GET",headers:t};return this.fetchAPI(e,r)}async updateProject(t){const e=JSON.stringify(t),s=this.getHeaders(),r=this.getURL("project"),n={method:"PUT",headers:s,body:e};return this.fetchAPI(r,n)}async uploadAsset(t){const e=this.getHeaders(),s=this.getURL("asset"),r="POST",o=await t.get("file"),n=new FormData;n.append("file",o);const c={method:r,headers:e,body:n};return this.fetchAPI(s,c)}async getAssets(t,e){const s=this.getHeaders(),r=this.getURL("asset");t&&r.concat(`?limit=${t}`),e&&r.concat(`&offset=${e}`);const n={method:"GET",headers:s};return this.fetchAPI(r,n)}async authenticate({password:t}){const e=JSON.stringify({password:t}),s=this.getHeaders(),r=this.getURL("authenticate"),n={method:"POST",headers:s,body:e};return this.fetchAPI(r,n)}async login({password:t,email:e}){const s=JSON.stringify({password:t,email:e}),r=this.getHeaders(),o=this.getURL("login"),c={method:"POST",headers:r,body:s};return this.fetchAPI(o,c)}async logout(){const t=this.getHeaders(),e=this.getURL("logout"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}async verify(){const t=this.getHeaders(),e=this.getURL("verify"),r={method:"POST",headers:t};return this.fetchAPI(e,r)}getURL(t,e){const s=new URLSearchParams(e).toString();return i.isEmpty(e)?`${d}/v1/${t}`:`${d}/v1/${t}?${s}`}getHeaders(){const t=new Headers;return t.append("x-chai-app-key",this._appKey),t.append("x-chai-auth-secret",this._authSecret),this._accessToken&&t.append("x-chai-access-token",this._accessToken),t}async fetchAPI(t,e){try{const s=await fetch(t,e).then(r=>r.json());if((s==null?void 0:s.result)==="success")return{data:s==null?void 0:s.data,error:null,result:"success"};throw s==null?void 0:s.error}catch(s){return{data:null,error:s,result:"error"}}}}const y=async(a,t)=>{const e=l.getChaiDataProviders(),s=i.filter(e,n=>i.map(a,"providerKey").includes(n.providerKey)),r={},o=[];for(const n of s)try{r[n.providerKey]=await n.dataFn({},t)}catch(c){o.push(c)}return{data:r,errors:o}};exports.ChaibuilderBackend=p;exports.prepareExternalData=y;
|
package/dist/server.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ declare type ChaiAsset = {
|
|
|
12
12
|
|
|
13
13
|
declare type ChaiBlock = {
|
|
14
14
|
_id: string;
|
|
15
|
+
_type: string;
|
|
15
16
|
_name?: string;
|
|
16
17
|
_parent?: string | null | undefined;
|
|
17
18
|
_bindings?: Record<string, string>;
|
|
18
|
-
readonly _type: string;
|
|
19
19
|
} & Record<string, any>;
|
|
20
20
|
|
|
21
21
|
export declare class ChaibuilderBackend implements ChaibuilderBackendInterface {
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var u = (
|
|
3
|
-
var h = (
|
|
4
|
-
import {
|
|
2
|
+
var u = (c, t, e) => t in c ? g(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
|
+
var h = (c, t, e) => (u(c, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { isEmpty as i, filter as l, map as p } from "lodash-es";
|
|
5
5
|
import { getChaiDataProviders as m } from "@chaibuilder/runtime";
|
|
6
6
|
const d = "https://api.chaibuilder.com";
|
|
7
7
|
class A {
|
|
@@ -118,8 +118,8 @@ class A {
|
|
|
118
118
|
async uploadAsset(t) {
|
|
119
119
|
const e = this.getHeaders(), s = this.getURL("asset"), o = "POST", r = await t.get("file"), n = new FormData();
|
|
120
120
|
n.append("file", r);
|
|
121
|
-
const
|
|
122
|
-
return this.fetchAPI(s,
|
|
121
|
+
const a = { method: o, headers: e, body: n };
|
|
122
|
+
return this.fetchAPI(s, a);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
*
|
|
@@ -148,8 +148,8 @@ class A {
|
|
|
148
148
|
* @returns { token }
|
|
149
149
|
*/
|
|
150
150
|
async login({ password: t, email: e }) {
|
|
151
|
-
const s = JSON.stringify({ password: t, email: e }), o = this.getHeaders(), r = this.getURL("login"),
|
|
152
|
-
return this.fetchAPI(r,
|
|
151
|
+
const s = JSON.stringify({ password: t, email: e }), o = this.getHeaders(), r = this.getURL("login"), a = { method: "POST", headers: o, body: s };
|
|
152
|
+
return this.fetchAPI(r, a);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
*
|
|
@@ -200,13 +200,13 @@ class A {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
const T = async (
|
|
204
|
-
const e = m(), s = l(e, (n) => p(
|
|
203
|
+
const T = async (c, t) => {
|
|
204
|
+
const e = m(), s = l(e, (n) => p(c, "providerKey").includes(n.providerKey)), o = {}, r = [];
|
|
205
205
|
for (const n of s)
|
|
206
206
|
try {
|
|
207
207
|
o[n.providerKey] = await n.dataFn({}, t);
|
|
208
|
-
} catch (
|
|
209
|
-
r.push(
|
|
208
|
+
} catch (a) {
|
|
209
|
+
r.push(a);
|
|
210
210
|
}
|
|
211
211
|
return { data: o, errors: r };
|
|
212
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("./index-IIJ_o44s.cjs"),d=require("./controls-Dy1qa8Dc.cjs"),w=require("sonner"),p=require("./form-lJhy9DEC.cjs"),P=require("./index-hMoPNZVn.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("./utils-PTxFk6qT.cjs");require("./MODIFIERS-2FeVfZQ9.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("jotai");require("flat-to-nested");require("./Functions-N3yhPYKY.cjs");require("redux-undo");require("@chaibuilder/runtime");require("@react-hookz/web");require("react-i18next");require("@rjsf/core");require("@rjsf/validator-ajv8");require("i18next");require("@floating-ui/react-dom");require("react-textarea-autosize");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("./html-to-json-dfALTAdG.cjs");require("himalaya");require("lodash");require("lucide-react");const z=f.lazy(()=>Promise.resolve().then(()=>require("./delete-page-modal-U4yiuhx0.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-f3DYO5Hj.cjs"))),E=u=>{if(!c.isString(u)||!(u.includes("/[")&&u.includes("]")))return!1;const s=/^\[((?:\.{3})?[a-zA-Z0-9_-]+)\]$/,q=/^[a-zA-Z0-9_-]+$/;let e=!0;return u.split("/").forEach(n=>{e&&(n.includes("[[")&&n.includes("]]")?e=/^\[\[\.{3}[a-zA-Z0-9_-]+\]\]$/.test(n):n.includes("[")&&n.includes("]")?e=s.test(n):e=q.test(n))}),e},h=u=>u&&c.isEmpty(u.seoData)?{...u,seoData:{title:"",description:"",image:""}}:u,G=(u,o)=>{const s=!c.isEqual(c.omit(u,["seoData"]),c.omit(o,["seoData"])),q=!c.isEqual(h(o).seoData,h(u).seoData);return s||q},Y=({open:u,setOpen:o,pageData:s})=>{const q=P.useQueryClient(),{data:e}=P.useProject(),n=P.useUpdatePage(),m=P.useUpdateProject("Homepage updated successfully."),[i,b]=f.useState(h(s)),[a,A]=f.useState({isHomePage:(e==null?void 0:e.homepage)===s.uuid}),j=G(i,s);f.useEffect(()=>{const l=!c.isEqual(h(s),i),t=(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage;o(l||t?"PENDING":"OPEN")},[e,s,i,a,o]);const C=()=>{if(j){if(s.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")){u==="ALERT"&&o("PENDING");return}n.mutate(i,{onSuccess:()=>{q.invalidateQueries({refetchType:"active",queryKey:["pages",e==null?void 0:e.uuid]}),o("CLOSE"),w.toast.success("Page updated successfully.")}})}a.isHomePage&&(e==null?void 0:e.homepage)!==s.uuid&&m.mutate({...e,homepage:s==null?void 0:s.uuid},{onSuccess:()=>o("CLOSE")})},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.u({title:"Page Name",default:i.name}),slug:d.u({title:"Page Slug",default:i.slug})},T={seoData:d.b({title:"",description:"",default:{title:"",description:"",image:""},properties:{title:d.u({title:"Meta Title",default:i.name}),description:d.g({title:"Meta Description",default:i.slug}),image:d.o({title:"Social Media Image",default:""})}})},M={isHomePage:d.r({title:"Set as homepage",default:a.isHomePage})};return r.jsxRuntimeExports.jsxs(y.ScrollArea,{className:"flex h-full select-none flex-col",children:[r.jsxRuntimeExports.jsx(L,{open:u==="ALERT",title:"Do yo want to save changes?",onCancel:()=>o("CLOSE"),onConfirm:C,disabled:m.isPending||n.isPending}),r.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 px-2.5 py-1",children:r.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Page Details"})}),r.jsxRuntimeExports.jsx("div",{className:"px-2.5 pt-2",children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2",children:[r.jsxRuntimeExports.jsx(p.Form,{title:"Basic Details",formData:i,properties:v,onChange:R,disabled:n.isPending||m.isPending}),r.jsxRuntimeExports.jsx("div",{className:"h-2 w-full"}),r.jsxRuntimeExports.jsx(p.Form,{title:"SEO Details",formData:i,properties:T,onChange:R,disabled:n.isPending||m.isPending}),(e==null?void 0:e.homepage)!==s.uuid&&s.type==="STATIC"?r.jsxRuntimeExports.jsx(p.Form,{formData:a,properties:M,onChange:I,disabled:n.isPending||m.isPending}):s.type==="STATIC"&&r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1 px-1 pt-2 text-xs font-medium text-gray-500",children:[r.jsxRuntimeExports.jsx(H.HomeIcon,{})," This is homepage"," "]}),i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||"")&&r.jsxRuntimeExports.jsxs("small",{className:"px-1 text-red-400",children:["Add dynamic ID in page slug Eg: ",r.jsxRuntimeExports.jsx("i",{className:"underline",children:"some-url/[some-id]"})]}),r.jsxRuntimeExports.jsxs("div",{className:"my-2 flex w-full items-center justify-between gap-x-2 px-1",children:[r.jsxRuntimeExports.jsx(y.Button,{className:"w-full",type:"submit",onClick:C,disabled:(e==null?void 0:e.homepage)!==s.uuid&&a.isHomePage?!1:c.isEmpty(i.name)||c.isEmpty(i.slug)||!j||n.isPending||m.isPending||i.type==="DYNAMIC"&&!E((i==null?void 0:i.slug)||""),children:"Save"}),r.jsxRuntimeExports.jsx(z,{pageData:s,projectData:e})]})]})})]})};exports.default=Y;
|