@chaibuilder/sdk 1.2.33 → 1.2.35
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-fpRgZNZT.js} +36 -32
- package/dist/AddBlocks-i2OFXcGZ.cjs +1 -0
- package/dist/BrandingOptions-BuV0XItY.cjs +1 -0
- package/dist/{BrandingOptions-yYAznnw2.js → BrandingOptions-RxIUds41.js} +37 -31
- package/dist/CanvasArea-C1VfoHjl.js +1200 -0
- package/dist/CanvasArea-a-I0uB7y.cjs +55 -0
- package/dist/{index-AJalHhkO.js → ChaiBuilderEditor-ChKigulx.js} +26119 -22752
- package/dist/ChaiBuilderEditor-pWAMhLiq.cjs +206 -0
- package/dist/CurrentPage-JgJ2XITk.cjs +1 -0
- package/dist/{CurrentPage-1v40uk8K.js → CurrentPage-tWXo7zPq.js} +19 -19
- package/dist/{ListTree-0ZrRreCs.js → ListTree-_JJ1Ka3e.js} +86 -81
- package/dist/ListTree-rJ4eHyKn.cjs +1 -0
- package/dist/{PagesPanel-AxQX-BX2.js → PagesPanel-bwRvd7HB.js} +14 -14
- package/dist/PagesPanel-zd48fj10.cjs +1 -0
- package/dist/{ProjectPanel-GYdge5v9.js → ProjectPanel-S7X2GDYk.js} +16 -16
- package/dist/ProjectPanel-sIURK9WR.cjs +1 -0
- package/dist/{Settings-9JAzGHau.js → Settings-59DRCnXh.js} +53 -53
- package/dist/Settings-Lw_UvEWj.cjs +1 -0
- package/dist/SidePanels-FX3WxtRi.cjs +1 -0
- package/dist/{SidePanels-bLwsW29O.js → SidePanels-QwN_fVWJ.js} +70 -70
- package/dist/Topbar-_k5gwR_4.js +133 -0
- package/dist/Topbar-cRmIAzUg.cjs +1 -0
- package/dist/{UnsplashImages-NYwOOgYa.js → UnsplashImages-hI0Zvl2t.js} +27 -22
- package/dist/UnsplashImages-texUmBiW.cjs +1 -0
- package/dist/{UploadImages-vpZeW-YW.js → UploadImages-diXySdpc.js} +33 -27
- package/dist/UploadImages-kRSLsKBv.cjs +1 -0
- package/dist/{add-page-modal-hDyzsEU7.js → add-page-modal-Md_OotSU.js} +22 -22
- package/dist/add-page-modal-R9nsF97c.cjs +1 -0
- package/dist/{confirm-alert-FGQKKQJU.js → confirm-alert-DS8nMVJP.js} +16 -10
- package/dist/confirm-alert-gKJ-H8aH.cjs +1 -0
- 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-KxeyBri2.js → delete-page-modal-PVpCkC06.js} +15 -15
- package/dist/delete-page-modal-ez831xRV.cjs +1 -0
- 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-6D7DLOsP.cjs +1 -0
- package/dist/{form-77dY98bF.js → form-BcCd02eY.js} +7 -7
- package/dist/index-F_-wLCKB.cjs +1 -0
- package/dist/{index-5zkCTSAM.js → index-NmcmhDTV.js} +28 -29
- package/dist/{page-viewer-umQaut1j.js → page-viewer-1bDdfbfY.js} +21 -21
- package/dist/page-viewer-MyIBh0H7.cjs +1 -0
- package/dist/project-general-setting-1UvYceGY.cjs +1 -0
- package/dist/{project-general-setting-uuCemMCU.js → project-general-setting-cAuIqXqs.js} +24 -24
- package/dist/{project-seo-setting-asvbPQiI.js → project-seo-setting-DIspBN3U.js} +26 -20
- package/dist/project-seo-setting-ePXNygH3.cjs +1 -0
- package/dist/single-page-detail-6M4by4GP.cjs +1 -0
- package/dist/{single-page-detail-F6pKWyq1.js → single-page-detail-VEdxOlo1.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-YdWIGhpI.js +6 -0
- package/dist/useCanvasSettings-xq3gcMsb.cjs +1 -0
- 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-0Ql8pHVc.js +0 -132
- 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/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
- package/dist/useCanvasSettings-ikt217kv.js +0 -6
|
@@ -18,15 +18,14 @@ var v2 = (a, t, h, v) => ({
|
|
|
18
18
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
19
19
|
import * as b from "react";
|
|
20
20
|
import H0, { lazy as A2, useCallback as g2, useState as M2, Suspense as u0, useEffect as s0 } from "react";
|
|
21
|
-
import
|
|
22
|
-
import { FileTextIcon as
|
|
23
|
-
import { u as
|
|
21
|
+
import "./core.js";
|
|
22
|
+
import { FileTextIcon as p0, GearIcon as V0, EyeClosedIcon as f0, EyeOpenIcon as m0 } from "@radix-ui/react-icons";
|
|
23
|
+
import { u as L0, G as Y2, B as X2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-ChKigulx.js";
|
|
24
24
|
import { toast as h1, Toaster as F0 } from "sonner";
|
|
25
25
|
import { useTranslation as D0 } from "react-i18next";
|
|
26
26
|
import { sortBy as R0, filter as k0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
|
|
27
27
|
import { g as W0 } from "./html-to-json-ZV4QjSww.js";
|
|
28
28
|
import { Loader as U0, Loader2 as j0, LogOutIcon as Q0 } from "lucide-react";
|
|
29
|
-
import { G as X2 } from "./index-YpnaudSM.js";
|
|
30
29
|
var N1 = class {
|
|
31
30
|
constructor() {
|
|
32
31
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
@@ -1619,7 +1618,7 @@ var i0 = b.createContext(
|
|
|
1619
1618
|
children: t
|
|
1620
1619
|
}) => (b.useEffect(() => (a.mount(), () => {
|
|
1621
1620
|
a.unmount();
|
|
1622
|
-
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1), z4 = () => b.useContext(e0),
|
|
1621
|
+
}), [a]), /* @__PURE__ */ b.createElement(i0.Provider, { value: a }, t)), e0 = b.createContext(!1), z4 = () => b.useContext(e0), it = e0.Provider;
|
|
1623
1622
|
function g4() {
|
|
1624
1623
|
let a = !1;
|
|
1625
1624
|
return {
|
|
@@ -1826,9 +1825,9 @@ const I = {
|
|
|
1826
1825
|
}
|
|
1827
1826
|
});
|
|
1828
1827
|
}, A4 = () => {
|
|
1829
|
-
const [a] = ["SAVED"], [t, h] = m1(), v =
|
|
1828
|
+
const [a] = ["SAVED"], [t, h] = m1(), v = L0(), { t: r } = D0();
|
|
1830
1829
|
return (n) => a !== "SAVED" ? (h1.error(r("You have unsaved changes. Please save before changing the page.")), !1) : t === n.uuid ? !1 : (v(), setTimeout(() => h(n.uuid), 100), !0);
|
|
1831
|
-
},
|
|
1830
|
+
}, et = () => {
|
|
1832
1831
|
const a = G(), t = A4(), h = R();
|
|
1833
1832
|
return _({
|
|
1834
1833
|
mutationFn: async (v) => I.post(`${h}/pages`, v).then((r) => r.json()),
|
|
@@ -1872,7 +1871,7 @@ const I = {
|
|
|
1872
1871
|
});
|
|
1873
1872
|
}
|
|
1874
1873
|
});
|
|
1875
|
-
},
|
|
1874
|
+
}, dt = () => {
|
|
1876
1875
|
const a = G(), t = R();
|
|
1877
1876
|
return _({
|
|
1878
1877
|
mutationFn: async (h) => I.delete(`${t}/page`, h).then((v) => v.json()),
|
|
@@ -1929,10 +1928,10 @@ const I = {
|
|
|
1929
1928
|
});
|
|
1930
1929
|
};
|
|
1931
1930
|
function o0(a) {
|
|
1932
|
-
return
|
|
1931
|
+
return Y2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" } }] })(a);
|
|
1933
1932
|
}
|
|
1934
1933
|
function R4(a) {
|
|
1935
|
-
return
|
|
1934
|
+
return Y2({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" } }] })(a);
|
|
1936
1935
|
}
|
|
1937
1936
|
const k4 = () => {
|
|
1938
1937
|
const { mutate: a, isPending: t } = b4(), [h] = m1(), { data: v } = M0(), r = b2(v, "lockedBy.name", ""), n = b2(v, "lockedBy.email", "");
|
|
@@ -1965,7 +1964,7 @@ const k4 = () => {
|
|
|
1965
1964
|
] })
|
|
1966
1965
|
] }),
|
|
1967
1966
|
/* @__PURE__ */ i.jsx(
|
|
1968
|
-
|
|
1967
|
+
X2,
|
|
1969
1968
|
{
|
|
1970
1969
|
disabled: t,
|
|
1971
1970
|
onClick: () => a(h),
|
|
@@ -2016,19 +2015,19 @@ const k4 = () => {
|
|
|
2016
2015
|
});
|
|
2017
2016
|
}, I4 = ({ children: a }) => {
|
|
2018
2017
|
const t = N4();
|
|
2019
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2020
|
-
/* @__PURE__ */ i.jsx(
|
|
2021
|
-
/* @__PURE__ */ i.jsxs(
|
|
2022
|
-
/* @__PURE__ */ i.jsxs(
|
|
2023
|
-
/* @__PURE__ */ i.jsxs(
|
|
2018
|
+
return /* @__PURE__ */ i.jsxs(x0, { children: [
|
|
2019
|
+
/* @__PURE__ */ i.jsx(w0, { asChild: !0, children: a }),
|
|
2020
|
+
/* @__PURE__ */ i.jsxs(B0, { children: [
|
|
2021
|
+
/* @__PURE__ */ i.jsxs(C0, { children: [
|
|
2022
|
+
/* @__PURE__ */ i.jsxs(O0, { children: [
|
|
2024
2023
|
"Are you sure, you want to ",
|
|
2025
2024
|
/* @__PURE__ */ i.jsx("span", { className: "text-red-500", children: "Sign Out" }),
|
|
2026
2025
|
"?"
|
|
2027
2026
|
] }),
|
|
2028
|
-
/* @__PURE__ */ i.jsx(
|
|
2027
|
+
/* @__PURE__ */ i.jsx(A0, { children: "Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information" })
|
|
2029
2028
|
] }),
|
|
2030
|
-
/* @__PURE__ */ i.jsxs(
|
|
2031
|
-
/* @__PURE__ */ i.jsx(
|
|
2029
|
+
/* @__PURE__ */ i.jsxs(S0, { children: [
|
|
2030
|
+
/* @__PURE__ */ i.jsx(y0, { disabled: t.isPending, children: "Cancel" }),
|
|
2032
2031
|
/* @__PURE__ */ i.jsxs(
|
|
2033
2032
|
"button",
|
|
2034
2033
|
{
|
|
@@ -2044,9 +2043,9 @@ const k4 = () => {
|
|
|
2044
2043
|
] })
|
|
2045
2044
|
] })
|
|
2046
2045
|
] });
|
|
2047
|
-
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-
|
|
2046
|
+
}, W4 = () => /* @__PURE__ */ i.jsx(I4, { children: /* @__PURE__ */ i.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ i.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-bwRvd7HB.js")), j4 = A2(() => import("./ProjectPanel-S7X2GDYk.js")), Q4 = A2(() => import("./CurrentPage-tWXo7zPq.js")), K4 = () => /* @__PURE__ */ i.jsx("h2", { children: "Your Logo" }), G4 = () => {
|
|
2048
2047
|
const { mutate: a } = y4();
|
|
2049
|
-
return
|
|
2048
|
+
return b0("editable", !0) ? /* @__PURE__ */ i.jsx(X2, { onClick: a, className: "bg-blue-600 text-white", children: "Publish" }) : null;
|
|
2050
2049
|
}, q4 = (a) => {
|
|
2051
2050
|
var f;
|
|
2052
2051
|
const { data: t, isLoading: h } = z0(), { data: v, isLoading: r } = g0(), { data: n } = M0(), { mutate: e } = O4(), { mutate: g } = S4(), [s] = m1(), p = D4(), z = P4(), x = F4(), F = R(), H = g2(
|
|
@@ -2080,8 +2079,8 @@ const k4 = () => {
|
|
|
2080
2079
|
},
|
|
2081
2080
|
sideBarComponents: {
|
|
2082
2081
|
top: [
|
|
2083
|
-
{ icon:
|
|
2084
|
-
{ icon:
|
|
2082
|
+
{ icon: p0, name: "pages", panel: U4 },
|
|
2083
|
+
{ icon: V0, name: "settings", panel: j4 },
|
|
2085
2084
|
...((f = a.sideBarComponents) == null ? void 0 : f.top) || []
|
|
2086
2085
|
],
|
|
2087
2086
|
bottom: [W4]
|
|
@@ -2092,7 +2091,7 @@ const k4 = () => {
|
|
|
2092
2091
|
getExternalPredefinedBlock: B,
|
|
2093
2092
|
getPages: () => v
|
|
2094
2093
|
};
|
|
2095
|
-
return /* @__PURE__ */ i.jsx(
|
|
2094
|
+
return /* @__PURE__ */ i.jsx(P0, { ...O });
|
|
2096
2095
|
}, _4 = ({ logo: a }) => {
|
|
2097
2096
|
const [t, h] = M2(!1), [v, r] = M2(""), [n, e] = M2(""), { mutate: g, isPending: s } = T4(), p = (z) => {
|
|
2098
2097
|
z.preventDefault(), g({ email: v, password: n });
|
|
@@ -2154,7 +2153,7 @@ const k4 = () => {
|
|
|
2154
2153
|
type: "button",
|
|
2155
2154
|
className: "absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",
|
|
2156
2155
|
onClick: () => h(!t),
|
|
2157
|
-
children: t ? /* @__PURE__ */ i.jsx(
|
|
2156
|
+
children: t ? /* @__PURE__ */ i.jsx(f0, {}) : /* @__PURE__ */ i.jsx(m0, {})
|
|
2158
2157
|
}
|
|
2159
2158
|
)
|
|
2160
2159
|
] }) }),
|
|
@@ -2183,19 +2182,19 @@ const k4 = () => {
|
|
|
2183
2182
|
return s0(() => {
|
|
2184
2183
|
v.setQueryData(["apiBaseUrl"], a.apiBaseUrl || "/api/chaibuilder");
|
|
2185
2184
|
}, [a.apiBaseUrl, v]), h ? /* @__PURE__ */ i.jsx(O2, {}) : t != null && t.valid ? /* @__PURE__ */ i.jsx(q4, { ...a }) : /* @__PURE__ */ i.jsx(_4, { logo: a.logo });
|
|
2186
|
-
}, J4 = new r4(),
|
|
2185
|
+
}, J4 = new r4(), zt = (a) => /* @__PURE__ */ i.jsxs(d4, { client: J4, children: [
|
|
2187
2186
|
/* @__PURE__ */ i.jsx(F0, { richColors: !0 }),
|
|
2188
2187
|
/* @__PURE__ */ i.jsx($4, { ...a })
|
|
2189
2188
|
] });
|
|
2190
2189
|
export {
|
|
2191
|
-
|
|
2190
|
+
zt as C,
|
|
2192
2191
|
z0 as a,
|
|
2193
2192
|
O4 as b,
|
|
2194
2193
|
A4 as c,
|
|
2195
2194
|
m1 as d,
|
|
2196
|
-
|
|
2195
|
+
et as e,
|
|
2197
2196
|
G as f,
|
|
2198
2197
|
S4 as g,
|
|
2199
|
-
|
|
2198
|
+
dt as h,
|
|
2200
2199
|
g0 as u
|
|
2201
2200
|
};
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
2
|
import s, { useState as p, Suspense as l } from "react";
|
|
3
3
|
import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
|
|
4
|
-
import {
|
|
5
|
-
import { d as j, a as N, c as
|
|
4
|
+
import { aO as g, aP as h, aQ as f } from "./ChaiBuilderEditor-ChKigulx.js";
|
|
5
|
+
import { d as j, a as N, c as P } from "./index-NmcmhDTV.js";
|
|
6
6
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import "@radix-ui/react-scroll-area";
|
|
10
|
+
import "@floating-ui/react-dom";
|
|
11
|
+
import "jotai";
|
|
12
|
+
import "i18next";
|
|
13
|
+
import "react-i18next";
|
|
14
|
+
import "flagged";
|
|
7
15
|
import "lodash-es";
|
|
16
|
+
import "./STRINGS--j49GZJP.js";
|
|
8
17
|
import "./Functions-7jnEwJyw.js";
|
|
9
|
-
import "clsx";
|
|
10
18
|
import "tailwind-merge";
|
|
11
19
|
import "@chaibuilder/runtime";
|
|
12
|
-
import "jotai";
|
|
13
|
-
import "./STRINGS--j49GZJP.js";
|
|
14
20
|
import "@react-hookz/web";
|
|
15
21
|
import "./MODIFIERS-cBT31iqE.js";
|
|
16
|
-
import "./Class-6Hz2KzYb.js";
|
|
17
|
-
import "react-i18next";
|
|
18
22
|
import "@radix-ui/react-toggle";
|
|
19
23
|
import "class-variance-authority";
|
|
24
|
+
import "./Class-6Hz2KzYb.js";
|
|
20
25
|
import "@radix-ui/react-switch";
|
|
21
26
|
import "@radix-ui/react-slot";
|
|
22
27
|
import "@radix-ui/react-accordion";
|
|
23
28
|
import "@radix-ui/react-alert-dialog";
|
|
24
29
|
import "@radix-ui/react-dialog";
|
|
25
30
|
import "@radix-ui/react-label";
|
|
26
|
-
import "@radix-ui/react-scroll-area";
|
|
27
31
|
import "@radix-ui/react-tabs";
|
|
28
32
|
import "@radix-ui/react-tooltip";
|
|
29
33
|
import "@radix-ui/react-popover";
|
|
@@ -36,19 +40,15 @@ import "@radix-ui/react-toast";
|
|
|
36
40
|
import "cmdk";
|
|
37
41
|
import "@radix-ui/react-context-menu";
|
|
38
42
|
import "react-icons-picker";
|
|
39
|
-
import "react-dom";
|
|
40
43
|
import "react-quill";
|
|
41
|
-
import "./index-AJalHhkO.js";
|
|
42
|
-
import "i18next";
|
|
43
|
-
import "@floating-ui/react-dom";
|
|
44
|
-
import "flagged";
|
|
45
44
|
import "react-hotkeys-hook";
|
|
45
|
+
import "lodash";
|
|
46
|
+
import "lucide-react";
|
|
47
|
+
import "./core.js";
|
|
46
48
|
import "sonner";
|
|
47
49
|
import "./html-to-json-ZV4QjSww.js";
|
|
48
50
|
import "himalaya";
|
|
49
|
-
import
|
|
50
|
-
import "./index-YpnaudSM.js";
|
|
51
|
-
const v = s.lazy(() => import("./single-page-detail-F6pKWyq1.js")), P = ({ pageData: r }) => {
|
|
51
|
+
const b = s.lazy(() => import("./single-page-detail-VEdxOlo1.js")), v = ({ pageData: r }) => {
|
|
52
52
|
const [t, i] = p("CLOSE");
|
|
53
53
|
return /* @__PURE__ */ e.jsxs(
|
|
54
54
|
g,
|
|
@@ -76,14 +76,14 @@ const v = s.lazy(() => import("./single-page-detail-F6pKWyq1.js")), P = ({ pageD
|
|
|
76
76
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" }),
|
|
77
77
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-300 h-20 w-full" })
|
|
78
78
|
] }),
|
|
79
|
-
children: /* @__PURE__ */ e.jsx(
|
|
79
|
+
children: /* @__PURE__ */ e.jsx(b, { pageData: r, open: t, setOpen: i })
|
|
80
80
|
}
|
|
81
81
|
) })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
}, E = (r) => {
|
|
86
|
-
const [t] = j(), { data: i } = N(), o =
|
|
86
|
+
const [t] = j(), { data: i } = N(), o = P(), a = (i == null ? void 0 : i.homepage) === r.uuid, m = t === r.uuid, n = () => o(r);
|
|
87
87
|
return i ? /* @__PURE__ */ e.jsxs(
|
|
88
88
|
"button",
|
|
89
89
|
{
|
|
@@ -96,15 +96,15 @@ const v = s.lazy(() => import("./single-page-detail-F6pKWyq1.js")), P = ({ pageD
|
|
|
96
96
|
" ",
|
|
97
97
|
r.name
|
|
98
98
|
] }),
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
99
|
+
/* @__PURE__ */ e.jsx(v, { pageData: r })
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
) : null;
|
|
103
|
-
},
|
|
103
|
+
}, Pe = ({ pages: r, isLoading: t }) => t ? /* @__PURE__ */ e.jsxs("div", { className: "flex animate-pulse flex-col gap-y-1 px-2.5 pt-2", children: [
|
|
104
104
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
105
105
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" }),
|
|
106
106
|
/* @__PURE__ */ e.jsx("div", { className: "bg-background-200 h-7 w-full" })
|
|
107
107
|
] }) : r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-2.5 pb-2 pt-4", children: "No pages" }) : /* @__PURE__ */ e.jsx("div", { className: "-mb-2", children: s.Children.toArray(r.map((i) => /* @__PURE__ */ e.jsx(E, { ...i }))) });
|
|
108
108
|
export {
|
|
109
|
-
|
|
109
|
+
Pe as default
|
|
110
110
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./ChaiBuilderEditor-pWAMhLiq.cjs"),x=require("./index-F_-wLCKB.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("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-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("./core.cjs");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-6M4by4GP.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
|
|
@@ -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("./ChaiBuilderEditor-pWAMhLiq.cjs"),o=require("./controls-jWJDao88.cjs"),d=require("./form-6D7DLOsP.cjs"),m=require("./index-F_-wLCKB.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("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("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-Xhu27KFD.cjs");require("himalaya");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.l({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.q({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;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-WbnYoNE9.js";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { F as
|
|
6
|
-
import { a as x } from "./index-
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { ba as n } from "./ChaiBuilderEditor-ChKigulx.js";
|
|
4
|
+
import { l as c, q as d } from "./controls-VTdJhdSz.js";
|
|
5
|
+
import { F as u } from "./form-BcCd02eY.js";
|
|
6
|
+
import { a as x } from "./index-NmcmhDTV.js";
|
|
7
7
|
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@radix-ui/react-scroll-area";
|
|
11
|
+
import "@floating-ui/react-dom";
|
|
12
|
+
import "jotai";
|
|
13
|
+
import "i18next";
|
|
14
|
+
import "react-i18next";
|
|
15
|
+
import "flagged";
|
|
8
16
|
import "lodash-es";
|
|
17
|
+
import "./STRINGS--j49GZJP.js";
|
|
9
18
|
import "./Functions-7jnEwJyw.js";
|
|
10
|
-
import "clsx";
|
|
11
19
|
import "tailwind-merge";
|
|
12
20
|
import "@chaibuilder/runtime";
|
|
13
|
-
import "jotai";
|
|
14
|
-
import "./STRINGS--j49GZJP.js";
|
|
15
21
|
import "@react-hookz/web";
|
|
16
22
|
import "./MODIFIERS-cBT31iqE.js";
|
|
17
|
-
import "./Class-6Hz2KzYb.js";
|
|
18
|
-
import "react-i18next";
|
|
19
23
|
import "@radix-ui/react-toggle";
|
|
20
24
|
import "class-variance-authority";
|
|
25
|
+
import "./Class-6Hz2KzYb.js";
|
|
21
26
|
import "@radix-ui/react-switch";
|
|
22
27
|
import "@radix-ui/react-slot";
|
|
23
28
|
import "@radix-ui/react-accordion";
|
|
@@ -25,7 +30,6 @@ import "@radix-ui/react-icons";
|
|
|
25
30
|
import "@radix-ui/react-alert-dialog";
|
|
26
31
|
import "@radix-ui/react-dialog";
|
|
27
32
|
import "@radix-ui/react-label";
|
|
28
|
-
import "@radix-ui/react-scroll-area";
|
|
29
33
|
import "@radix-ui/react-tabs";
|
|
30
34
|
import "@radix-ui/react-tooltip";
|
|
31
35
|
import "@radix-ui/react-popover";
|
|
@@ -38,31 +42,27 @@ import "@radix-ui/react-toast";
|
|
|
38
42
|
import "cmdk";
|
|
39
43
|
import "@radix-ui/react-context-menu";
|
|
40
44
|
import "react-icons-picker";
|
|
41
|
-
import "react-dom";
|
|
42
45
|
import "react-quill";
|
|
46
|
+
import "react-hotkeys-hook";
|
|
47
|
+
import "lodash";
|
|
48
|
+
import "lucide-react";
|
|
43
49
|
import "@rjsf/core";
|
|
44
50
|
import "@rjsf/validator-ajv8";
|
|
45
|
-
import "./
|
|
46
|
-
import "i18next";
|
|
47
|
-
import "@floating-ui/react-dom";
|
|
48
|
-
import "flagged";
|
|
49
|
-
import "react-hotkeys-hook";
|
|
51
|
+
import "./core.js";
|
|
50
52
|
import "sonner";
|
|
51
53
|
import "./html-to-json-ZV4QjSww.js";
|
|
52
54
|
import "himalaya";
|
|
53
|
-
import "lucide-react";
|
|
54
|
-
import "./index-YpnaudSM.js";
|
|
55
55
|
const jo = ({
|
|
56
56
|
_projectData: m,
|
|
57
57
|
seany: t
|
|
58
58
|
}) => {
|
|
59
59
|
const { data: o, isLoading: p } = x();
|
|
60
|
-
|
|
60
|
+
f.useEffect(() => {
|
|
61
61
|
o && t(o);
|
|
62
62
|
}, [o, t]);
|
|
63
63
|
const e = ({ formData: s }, r) => {
|
|
64
|
-
t((
|
|
65
|
-
...
|
|
64
|
+
t((l) => ({
|
|
65
|
+
...l,
|
|
66
66
|
[r]: s[r]
|
|
67
67
|
}));
|
|
68
68
|
}, a = {
|
|
@@ -70,9 +70,9 @@ const jo = ({
|
|
|
70
70
|
title: "Project Name",
|
|
71
71
|
default: o == null ? void 0 : o.name
|
|
72
72
|
}),
|
|
73
|
-
favicon:
|
|
73
|
+
favicon: d({ title: "Favicon", default: o == null ? void 0 : o.favicon })
|
|
74
74
|
};
|
|
75
|
-
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(
|
|
75
|
+
return /* @__PURE__ */ i.jsx(n, { className: "flex h-full select-none flex-col", children: /* @__PURE__ */ i.jsx(u, { properties: a, disabled: p, formData: m, onChange: e }) });
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
78
|
jo as default
|
|
@@ -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-BcCd02eY.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-ChKigulx.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-6D7DLOsP.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("react");require("lodash-es");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./ChaiBuilderEditor-pWAMhLiq.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;
|
|
@@ -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-pWAMhLiq.cjs"),d=require("./controls-jWJDao88.cjs"),w=require("sonner"),p=require("./form-6D7DLOsP.cjs"),P=require("./index-F_-wLCKB.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-ez831xRV.cjs"))),L=f.lazy(()=>Promise.resolve().then(()=>require("./confirm-alert-gKJ-H8aH.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 { ba as G, B as Y } from "./ChaiBuilderEditor-ChKigulx.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-BcCd02eY.js";
|
|
9
|
+
import { f as V, a as X, g as _, b as K } from "./index-NmcmhDTV.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-PVpCkC06.js")), J = I.lazy(() => import("./confirm-alert-DS8nMVJP.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-F_-wLCKB.cjs");require("react");require("sonner");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./core.cjs");require("./ChaiBuilderEditor-pWAMhLiq.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;
|