@chaibuilder/sdk 4.0.0-beta.31 → 4.0.0-beta.33
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/{2SSKDMRQ-gmj-yWTy.js → 2SSKDMRQ-BXAXoR9y.js} +5 -5
- package/dist/{2SSKDMRQ-BksFOLpD.cjs → 2SSKDMRQ-BqOsh3tf.cjs} +1 -1
- package/dist/{AP7HFJJL-kVgc0R61.js → AP7HFJJL-B78LfetW.js} +1 -1
- package/dist/{AP7HFJJL-CO-deD_p.cjs → AP7HFJJL-Cv6sqAAd.cjs} +1 -1
- package/dist/{IconPicker-D_GRfhwS.js → IconPicker-BlO5Pnyu.js} +1 -1
- package/dist/{IconPicker-BJHUCDn4.cjs → IconPicker-D4yq_b-k.cjs} +1 -1
- package/dist/{WDYDFRGG-C9_E3QW0.js → WDYDFRGG-BE7jgVqa.js} +4 -4
- package/dist/{WDYDFRGG-KPpWFul_.cjs → WDYDFRGG-Dz9d3cVW.cjs} +1 -1
- package/dist/{actions-registery-Bj-j1k5i.js → actions-registery-D3-4Yha7.js} +1108 -1061
- package/dist/{actions-registery-Cy1lqUVI.cjs → actions-registery-vPaY-3dZ.cjs} +25 -25
- package/dist/actions.cjs +1 -1
- package/dist/actions.js +2 -2
- package/dist/{active-in-another-tab-1GoKTVcF.js → active-in-another-tab-CA47uafJ.js} +2 -2
- package/dist/{active-in-another-tab-iEd5fZD0.cjs → active-in-another-tab-CNn_R-55.cjs} +1 -1
- package/dist/{add-new-language-page-B3GUvWdP.js → add-new-language-page-B-kPbhFd.js} +3 -3
- package/dist/{add-new-language-page-Cq8R42Ro.cjs → add-new-language-page-QAZbAFQe.cjs} +1 -1
- package/dist/{add-new-page-DiHnECAR.cjs → add-new-page-D4nbAHOp.cjs} +1 -1
- package/dist/add-new-page-Y0d9tHh0.js +31 -0
- package/dist/{ai-panel-content-BPpawv4D.cjs → ai-panel-content-DXbebC-m.cjs} +1 -1
- package/dist/{ai-panel-content-tExD3yhH.js → ai-panel-content-WMOeK5pF.js} +5 -5
- package/dist/{ai-panel-default-lang-DnYLHSaS.js → ai-panel-default-lang-CM_psX_h.js} +7 -7
- package/dist/{ai-panel-default-lang-C6N4wUUF.cjs → ai-panel-default-lang-hmfyAYPM.cjs} +2 -2
- package/dist/{ai-panel-other-lang-D1pCJluY.js → ai-panel-other-lang-BKANRJAb.js} +13 -13
- package/dist/{ai-panel-other-lang-C65lVVtZ.cjs → ai-panel-other-lang-D4GL1b-W.cjs} +1 -1
- package/dist/{ai-prompt-input-Dws5BHhQ.cjs → ai-prompt-input-Dwd0-pcD.cjs} +1 -1
- package/dist/{ai-prompt-input-B2q30bhR.js → ai-prompt-input-mxXtWptn.js} +13 -13
- package/dist/{ai-translation-prompt-DnwG2BmF.cjs → ai-translation-prompt-7M2aEZ1w.cjs} +1 -1
- package/dist/{ai-translation-prompt-Dnn6i_t3.js → ai-translation-prompt-C_Pb7BE4.js} +1 -1
- package/dist/{apply-binding-chfbBKi2.js → apply-binding-BYCW1k2l.js} +1 -1
- package/dist/{apply-binding-9XSrYzAE.cjs → apply-binding-xiigK7eK.cjs} +1 -1
- package/dist/{change-password-modal-LKtYY-8V.cjs → change-password-modal-BYZoefwT.cjs} +1 -1
- package/dist/{change-password-modal-C0MMizgl.js → change-password-modal-Dqf_mleR.js} +5 -5
- package/dist/{code-editor-CWOmKcUc.js → code-editor-1fSEocLK.js} +1 -1
- package/dist/{code-editor-Cim6jQVF.cjs → code-editor-uN7W7KMD.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-oxYWGWON.js → continue-editing-in-this-client-DD7bBhjD.js} +2 -2
- package/dist/{continue-editing-in-this-client-Dd6nKIvX.cjs → continue-editing-in-this-client-DDM65ror.cjs} +1 -1
- package/dist/{core-BWQrViOY.cjs → core-czmLeR0h.cjs} +1 -1
- package/dist/{core-QlWEXm1d.js → core-nSRy3D7z.js} +16 -15
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +14 -2
- package/dist/core.js +19 -19
- package/dist/{css-import-modal-CXulmaB4.cjs → css-import-modal-BU7bJAaT.cjs} +1 -1
- package/dist/{css-import-modal-6bMTRlCg.js → css-import-modal-pBNRVmGj.js} +1 -1
- package/dist/default-theme-options-DN-3gIjM.cjs +22 -0
- package/dist/{plugin-BSjgGgwo.js → default-theme-options-saBIkWGT.js} +114 -114
- package/dist/{delete-page-D0tdn6VW.cjs → delete-page-8oEYsHPE.cjs} +1 -1
- package/dist/delete-page-B53nkF74.js +71 -0
- package/dist/{design-token-usage-D-hrcKz1.cjs → design-token-usage-Cm9m4AMz.cjs} +1 -1
- package/dist/{design-token-usage-lf7N_uOk.js → design-token-usage-DzWav2ip.js} +14 -14
- package/dist/{digital-asset-manager-DJhRhLGC.js → digital-asset-manager-1yLYGPuf.js} +5 -5
- package/dist/digital-asset-manager-BaTvMY8Q.cjs +1 -0
- package/dist/{duplicate-page-ChSp1TYN.cjs → duplicate-page-C2DZI4U0.cjs} +1 -1
- package/dist/{duplicate-page-CXzYy7vx.js → duplicate-page-DCRVR-kF.js} +6 -6
- package/dist/{dynamic-page-selector-btGtkyyv.cjs → dynamic-page-selector-CZJQnc-Q.cjs} +1 -1
- package/dist/{dynamic-page-selector-r5IR9_7k.js → dynamic-page-selector-DCGWkLVV.js} +12 -12
- package/dist/get-chai-builder-theme-C_qofMh_.cjs +1 -0
- package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-CyOkIlte.js} +1 -1
- package/dist/{image-compression-DsZ1oqpb.js → image-compression-DPFITwOL.js} +2 -2
- package/dist/image-compression-UaU7Bwqe.cjs +1 -0
- package/dist/{image-editor-CilPMtAC.js → image-editor-C0EYZJY_.js} +1 -1
- package/dist/{image-editor-BdW476J8.cjs → image-editor-DkgZrSGr.cjs} +1 -1
- package/dist/{index-DtMksfXx.js → index-BDrc0HJQ.js} +1729 -1680
- package/dist/index-BuXfCtgR.cjs +5 -0
- package/dist/{index-DsQXiNA_.js → index-C7bidKtE.js} +2786 -2752
- package/dist/index-DKjYF53r.cjs +160 -0
- package/dist/{json-diff-viewer-BkrnLb3B.cjs → json-diff-viewer-88jEhq8D.cjs} +1 -1
- package/dist/{json-diff-viewer-D3N3w3Ax.js → json-diff-viewer-wmzIZcuQ.js} +34 -34
- package/dist/{lang-panel-BAaaP4Qc.js → lang-panel--kWBnU_W.js} +7 -7
- package/dist/{lang-panel-BjDRrpwN.cjs → lang-panel-I_ABfjOZ.cjs} +1 -1
- package/dist/manage-design-tokens-CslCEOXU.cjs +1 -0
- package/dist/manage-design-tokens-JdVKj09s.js +445 -0
- package/dist/manage-design-tokens-modal-DA15ou0u.cjs +1 -0
- package/dist/{manage-design-tokens-modal-9qpcb-EC.js → manage-design-tokens-modal-xKxC72Bc.js} +9 -9
- package/dist/{mark-as-template-DNHYNjI9.js → mark-as-template-AbZrkEYl.js} +7 -7
- package/dist/{mark-as-template-IYRjta97.cjs → mark-as-template-ClQjC2p2.cjs} +1 -1
- package/dist/{nested-path-selector-content-Be-pbnVl.js → nested-path-selector-content-B04k-PPB.js} +1 -1
- package/dist/{nested-path-selector-content-CWmPgU-L.cjs → nested-path-selector-content-dFwZaM1r.cjs} +1 -1
- package/dist/{no-language-page-content-C-ltY7bj.js → no-language-page-content-CbUqxuC4.js} +2 -2
- package/dist/{no-language-page-content-8_J6y-cm.cjs → no-language-page-content-pzkWJAg6.cjs} +1 -1
- package/dist/{no-language-page-dialog-D5NXpDHi.js → no-language-page-dialog-AavD_Mmc.js} +2 -2
- package/dist/{no-language-page-dialog-BOZZZzqx.cjs → no-language-page-dialog-DhlOVXUm.cjs} +1 -1
- package/dist/{page-creator-BuHHnqiQ.js → page-creator-2OZveMsR.js} +95 -95
- package/dist/{page-creator-wtbae2U7.cjs → page-creator-DMjnStPf.cjs} +1 -1
- package/dist/{page-lock-pPGlTxj7.js → page-lock-5MwwTWe8.js} +2 -2
- package/dist/{page-lock-DN4iJc-V.cjs → page-lock-B3CpoFTs.cjs} +1 -1
- package/dist/{page-locked-dialog-Bl-ojgIW.js → page-locked-dialog-BhNZC9wZ.js} +13 -13
- package/dist/{page-locked-dialog-B_vdgv24.cjs → page-locked-dialog-ZOvjnxRI.cjs} +1 -1
- package/dist/page-manager-new-BcI-1Dms.cjs +1 -0
- package/dist/{page-manager-new-Bg8H6yrg.js → page-manager-new-l68-Lc9h.js} +85 -88
- package/dist/{page-manager-search-and-filter-CDXunXNd.cjs → page-manager-search-and-filter-BOpne6v-.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-CyfO7O96.js → page-manager-search-and-filter-DJn98D02.js} +31 -30
- package/dist/{page-revisions-content-BKT8S9_g.cjs → page-revisions-content-B00tDCzu.cjs} +1 -1
- package/dist/{page-revisions-content-B-egQgoZ.js → page-revisions-content-Bqp-9bae.js} +23 -23
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +14 -2
- package/dist/pages.js +12 -12
- package/dist/{publish-pages-content-D2B_ScCQ.js → publish-pages-content-CtZLSG6O.js} +68 -75
- package/dist/publish-pages-content-DfYG0biw.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.js +5 -5
- package/dist/{rte-widget-modal-c3T09VeO.js → rte-widget-modal-DGEWoQ1b.js} +1 -1
- package/dist/{rte-widget-modal-CC1KcrAT.cjs → rte-widget-modal-DX66uSPv.cjs} +1 -1
- package/dist/runtime.cjs +6 -6
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +36 -35
- package/dist/{save-to-lib-dT1NDd5w.js → save-to-lib-CCxX5ZmQ.js} +26 -26
- package/dist/{save-to-lib-CiM0wiIr.cjs → save-to-lib-DmAjdhzU.cjs} +1 -1
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-BgqcPsXI.cjs → selected-block-display-Csce27bR.cjs} +1 -1
- package/dist/{selected-block-display-BQndDPcY.js → selected-block-display-Cv6jBhJD.js} +20 -20
- package/dist/{seo-panel-DXZvGYEM.cjs → seo-panel-BZYXeYzE.cjs} +1 -1
- package/dist/{seo-panel-Z93Zf_bz.js → seo-panel-Ctstjs-d.js} +25 -25
- package/dist/{shared-json-ld-DwvUDGAS.cjs → shared-json-ld-BDWtjHgw.cjs} +1 -1
- package/dist/{shared-json-ld-Ct68RlWD.js → shared-json-ld-BNHGmUBd.js} +45 -45
- package/dist/{slug-input-CAqkFZBq.js → slug-input-Bui1Qmvh.js} +1 -1
- package/dist/{slug-input-Curnt2n3.cjs → slug-input-IAl_jfHr.cjs} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.js +272 -206
- package/dist/{take-over-request-D6y2HcDr.cjs → take-over-request-Bl6jS1cK.cjs} +1 -1
- package/dist/{take-over-request-C6ngP1QR.js → take-over-request-Ceuqyk5K.js} +13 -13
- package/dist/{translation-warning-modal-B876S5yp.cjs → translation-warning-modal-CCmmwz1C.cjs} +1 -1
- package/dist/{translation-warning-modal-kRcfrPgo.js → translation-warning-modal-DA5dt2FA.js} +9 -9
- package/dist/types.d.ts +14 -2
- package/dist/{unmark-as-template-DeeWUTco.js → unmark-as-template-CKVMibvu.js} +13 -13
- package/dist/{unmark-as-template-f1dl_YTz.cjs → unmark-as-template-OEUqo0uc.cjs} +1 -1
- package/dist/unpublish-page-A5qn6E6g.js +28 -0
- package/dist/{unpublish-page-DEPFjGuu.cjs → unpublish-page-C81bYHLI.cjs} +1 -1
- package/dist/{unpublished-partials-modal-Ts5ZhAK9.js → unpublished-partials-modal-FqzTp5el.js} +3 -3
- package/dist/{unpublished-partials-modal-CEFXp1D1.cjs → unpublished-partials-modal-af5uDL7Y.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +1 -1
- package/dist/{web-preview-CoT8r96b.js → web-preview-vge6uUSa.js} +1 -1
- package/dist/{web-preview-DTDoIE-c.cjs → web-preview-xtKkQOXy.cjs} +1 -1
- package/package.json +2 -7
- package/dist/add-new-page-C5HlQfzy.js +0 -31
- package/dist/delete-page-LnzR01A8.js +0 -71
- package/dist/digital-asset-manager-eCJHNSjj.cjs +0 -1
- package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
- package/dist/image-compression-DZ9WMmyn.cjs +0 -1
- package/dist/index-CAhDwfHE.cjs +0 -5
- package/dist/index-mPCp0j2h.cjs +0 -160
- package/dist/manage-design-tokens-BknGNAKE.cjs +0 -1
- package/dist/manage-design-tokens-Co5677WS.js +0 -428
- package/dist/manage-design-tokens-modal-BcgdwEXE.cjs +0 -1
- package/dist/page-manager-new-5W5M9_ue.cjs +0 -1
- package/dist/plugin-DHpuZZXz.cjs +0 -22
- package/dist/publish-pages-content-WJHTVYnx.cjs +0 -1
- package/dist/theme-panel-footer-CGZL2F7R.js +0 -26
- package/dist/theme-panel-footer-IgGj-_OA.cjs +0 -1
- package/dist/unpublish-page-U_79Pwc0.js +0 -28
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { d as ie } from "./index-
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as y, Fragment as q, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { d as ie } from "./index-C7bidKtE.js";
|
|
3
|
+
import { s as be, t as ge, w as ke, i as de, T as B, aQ as Ne, L as ve, k as Se, e as Le, c as Ae, aw as Te, aR as Ce, aS as Ee } from "./index-BDrc0HJQ.js";
|
|
4
4
|
import { u as J } from "./use-page-expand-manager-Cf4MUEJw.js";
|
|
5
|
-
import { compact as ue, filter as
|
|
5
|
+
import { compact as ue, filter as F, isEmpty as g, uniqBy as $e, keyBy as me, mapValues as Me, startCase as Ue, toLower as $, includes as _, get as R, find as W, map as Ie } from "lodash-es";
|
|
6
6
|
import { atom as ze, useAtom as Be, useSetAtom as Fe } from "jotai";
|
|
7
|
-
import { ExternalLink as Oe, Pencil as je, NotepadText as Ge, MoreHorizontal as De, Lock as Re,
|
|
8
|
-
import { useRef as Qe, useEffect as E, useMemo as
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { B as
|
|
7
|
+
import { ExternalLink as Oe, Pencil as je, NotepadText as Ge, MoreHorizontal as De, Lock as Re, Plus as We, ChevronRight as He, StarsIcon as _e, Hash as qe, File as he } from "lucide-react";
|
|
8
|
+
import { useRef as Qe, useEffect as E, useMemo as H, useState as v, useCallback as le, startTransition as Ve, Suspense as C, lazy as M } from "react";
|
|
9
|
+
import { useTranslation as Xe } from "react-i18next";
|
|
10
|
+
import { B as Ye } from "./register-chai-top-bar-D6GjnauV.js";
|
|
11
11
|
const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
12
|
-
|
|
12
|
+
F(e, (a) => {
|
|
13
13
|
const n = $(s);
|
|
14
|
-
return
|
|
14
|
+
return _($((a == null ? void 0 : a.name) || ""), n) || _($((a == null ? void 0 : a.slug) || ""), n);
|
|
15
15
|
})
|
|
16
|
-
),
|
|
16
|
+
), Je = (e, s) => {
|
|
17
17
|
const a = /* @__PURE__ */ new Set(), n = me(e, "id");
|
|
18
18
|
return s.forEach((i) => {
|
|
19
19
|
let o = i;
|
|
@@ -28,14 +28,14 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
28
28
|
children: n.children ? Y(n.children, s, a) : []
|
|
29
29
|
};
|
|
30
30
|
const i = n.children && n.children.some(
|
|
31
|
-
(o) =>
|
|
31
|
+
(o) => _($(o.name || ""), $(s)) || _($(o.slug || ""), $(s))
|
|
32
32
|
);
|
|
33
33
|
return {
|
|
34
34
|
...n,
|
|
35
35
|
shouldExpandOnSearch: i,
|
|
36
36
|
children: n.children ? Y(n.children, s, a) : []
|
|
37
37
|
};
|
|
38
|
-
}),
|
|
38
|
+
}), Ke = (e) => {
|
|
39
39
|
if (!e || !e.length) return [];
|
|
40
40
|
const s = {};
|
|
41
41
|
e.forEach((n) => {
|
|
@@ -48,18 +48,18 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
48
48
|
}, fe = (e) => !e || !e.length ? [] : [...e].sort((a, n) => (a.name || "").localeCompare(n.name || "")).map((a) => ({
|
|
49
49
|
...a,
|
|
50
50
|
children: a.children ? fe(a.children) : []
|
|
51
|
-
})),
|
|
51
|
+
})), Ze = (e, s, a, n) => {
|
|
52
52
|
if (!e || !e.length) return [];
|
|
53
53
|
let i = e;
|
|
54
|
-
if (a !== "all" && (i = ue(
|
|
54
|
+
if (a !== "all" && (i = ue(F(e, { pageType: a }))), g(s))
|
|
55
55
|
i = ce(i, s);
|
|
56
56
|
else {
|
|
57
|
-
const h = ce(i, s), c =
|
|
57
|
+
const h = ce(i, s), c = Je(e, h);
|
|
58
58
|
i = $e([...h, ...c], "id");
|
|
59
59
|
}
|
|
60
|
-
const o = fe(
|
|
60
|
+
const o = fe(Ke(i)), f = Y(o, s, n), P = F(f, (h) => n(h.pageType)).sort(
|
|
61
61
|
(h, c) => (h.name || "").localeCompare(c.name || "")
|
|
62
|
-
), d =
|
|
62
|
+
), d = F(f, (h) => !n(h.pageType));
|
|
63
63
|
let p = [];
|
|
64
64
|
if (a === "all") {
|
|
65
65
|
const h = me(d, "pageType");
|
|
@@ -75,11 +75,11 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
75
75
|
} else
|
|
76
76
|
p = d.sort((h, c) => (h.name || "").localeCompare(c.name || ""));
|
|
77
77
|
return [...P, ...p];
|
|
78
|
-
},
|
|
78
|
+
}, et = ze({
|
|
79
79
|
pageId: null,
|
|
80
80
|
position: { x: 0, y: 0 }
|
|
81
|
-
}),
|
|
82
|
-
const [a, n] = Be(
|
|
81
|
+
}), tt = ({ pageId: e, children: s }) => {
|
|
82
|
+
const [a, n] = Be(et), i = Qe(null), o = a.pageId === e;
|
|
83
83
|
E(() => {
|
|
84
84
|
const d = () => n({ pageId: null, position: { x: 0, y: 0 } });
|
|
85
85
|
if (o)
|
|
@@ -91,7 +91,7 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
91
91
|
const d = `${window.location.pathname}?page=${e}`;
|
|
92
92
|
window.open(d, "_blank"), n({ pageId: null, position: { x: 0, y: 0 } });
|
|
93
93
|
};
|
|
94
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ y(q, { children: [
|
|
95
95
|
/* @__PURE__ */ t("span", { onContextMenu: f, children: s }),
|
|
96
96
|
o && /* @__PURE__ */ t(
|
|
97
97
|
"div",
|
|
@@ -99,8 +99,8 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
99
99
|
ref: i,
|
|
100
100
|
className: "fixed z-[9999] max-w-[160px] rounded-md border border-gray-200 bg-white",
|
|
101
101
|
style: { top: a.position.y, left: a.position.x },
|
|
102
|
-
children: /* @__PURE__ */ t("div", { className: "", children: /* @__PURE__ */
|
|
103
|
-
|
|
102
|
+
children: /* @__PURE__ */ t("div", { className: "", children: /* @__PURE__ */ y(
|
|
103
|
+
Ye,
|
|
104
104
|
{
|
|
105
105
|
variant: "ghost",
|
|
106
106
|
onClick: P,
|
|
@@ -114,7 +114,7 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
] });
|
|
117
|
-
},
|
|
117
|
+
}, nt = ({ page: e }) => {
|
|
118
118
|
var n, i;
|
|
119
119
|
const { isExpanded: s, toggleExpanded: a } = J(e == null ? void 0 : e.id);
|
|
120
120
|
return /* @__PURE__ */ t(
|
|
@@ -126,7 +126,7 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
126
126
|
disabled: !((n = e == null ? void 0 : e.children) != null && n.length),
|
|
127
127
|
className: `flex h-[calc(100%-2px)] w-5 items-center justify-center rounded text-gray-400 transition-colors hover:bg-gray-200 hover:px-1 hover:text-gray-500 ${(i = e == null ? void 0 : e.children) != null && i.length ? "hover:text-blue-400" : "opacity-0"}`,
|
|
128
128
|
children: /* @__PURE__ */ t(
|
|
129
|
-
|
|
129
|
+
He,
|
|
130
130
|
{
|
|
131
131
|
size: 12,
|
|
132
132
|
className: `stroke-[4] transition-transform duration-200 ${s ? "rotate-90" : ""}`
|
|
@@ -134,13 +134,13 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
);
|
|
137
|
-
},
|
|
137
|
+
}, st = ({ page: e, pageType: s }) => /* @__PURE__ */ t("div", { className: "flex h-full items-center justify-center gap-x-1", children: e.dynamic ? /* @__PURE__ */ t(_e, { size: 12, className: "text-yellow-400" }) : s != null && s.icon ? /* @__PURE__ */ t(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
140
|
className: "flex h-4 max-h-4 w-4 max-w-4 items-center justify-center stroke-[1] text-slate-500",
|
|
141
141
|
dangerouslySetInnerHTML: { __html: s.icon }
|
|
142
142
|
}
|
|
143
|
-
) : s != null && s.hasSlug ? /* @__PURE__ */ t(he, { size: 12, className: "stroke-[1] text-slate-500" }) : /* @__PURE__ */ t(
|
|
143
|
+
) : s != null && s.hasSlug ? /* @__PURE__ */ t(he, { size: 12, className: "stroke-[1] text-slate-500" }) : /* @__PURE__ */ t(qe, { size: 12, className: "stroke-[1] text-slate-500" }) }), at = ({ isOnline: e }) => /* @__PURE__ */ t("div", { className: `h-2 w-2 rounded-full ${e ? "bg-green-300" : "bg-gray-300"}` }), rt = ({
|
|
144
144
|
page: e,
|
|
145
145
|
pageTypes: s,
|
|
146
146
|
currentPage: a,
|
|
@@ -149,20 +149,20 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
149
149
|
selectedLanguage: o,
|
|
150
150
|
showUntranslatedPages: f
|
|
151
151
|
}) => {
|
|
152
|
-
const P = be(), { pageToUser: d } = ge(), p =
|
|
153
|
-
let u =
|
|
154
|
-
u =
|
|
155
|
-
const L = o === x || !!u,
|
|
152
|
+
const P = be(), { pageToUser: d } = ge(), p = R(d, [e == null ? void 0 : e.id, "userId"]), { data: h } = ke(p), c = h && P !== p ? h == null ? void 0 : h.name : null, x = de(), k = a === e.id, Q = !!e.isTemplate, w = H(() => W(s, { key: e.pageType }), [s, e.pageType]);
|
|
153
|
+
let u = R(i, e == null ? void 0 : e.id);
|
|
154
|
+
u = R(u, "lang") === o ? u : null;
|
|
155
|
+
const L = o === x || !!u, T = (u == null ? void 0 : u.name) || (e == null ? void 0 : e.name) || "No name";
|
|
156
156
|
let N = (u == null ? void 0 : u.slug) || (e == null ? void 0 : e.slug) || "";
|
|
157
|
-
const O = N + (e != null && e.dynamic ? `/${
|
|
157
|
+
const O = N + (e != null && e.dynamic ? `/${w == null ? void 0 : w.dynamicSlug}` : "") + (e != null && e.dynamicSlugCustom ? `${e.dynamicSlugCustom}` : "");
|
|
158
158
|
if (N.startsWith("/") && !f) {
|
|
159
159
|
const l = N.split("/").pop();
|
|
160
160
|
N = N.endsWith(l) && e.dynamic ? "" : `/${l}`;
|
|
161
161
|
}
|
|
162
|
-
const j =
|
|
162
|
+
const j = H(() => {
|
|
163
163
|
const l = "flex h-7 min-w-0 flex-1 cursor-pointer select-none items-center gap-x-1.5 rounded px-px text-xs duration-300 border-[1px]", U = `${k ? "border-primary/30 bg-primary/5" : "border-transparent hover:border-gray-200 hover:bg-gray-100"}`;
|
|
164
164
|
return L ? `${l} ${U} ${c ? "opacity-60" : ""}` : `${l} bg-gray-100 opacity-50 group-hover:border-gray-200 border-transparent group-hover:bg-blue-100`;
|
|
165
|
-
}, [L, k, c]), G =
|
|
165
|
+
}, [L, k, c]), G = H(() => {
|
|
166
166
|
if (e.isPartialGroup) return !1;
|
|
167
167
|
if (u) {
|
|
168
168
|
if (!u.online || g(u.changes)) return !1;
|
|
@@ -170,27 +170,27 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
170
170
|
return !1;
|
|
171
171
|
return !0;
|
|
172
172
|
}, [u, e]);
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */ t(
|
|
173
|
+
return /* @__PURE__ */ y("div", { className: "group relative", children: [
|
|
174
|
+
/* @__PURE__ */ t(tt, { pageId: e.id, children: /* @__PURE__ */ y(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
177
|
onClick: () => !e.isPartialGroup && L && n("select", e == null ? void 0 : e.id),
|
|
178
178
|
className: j,
|
|
179
179
|
children: [
|
|
180
|
-
/* @__PURE__ */ t(
|
|
181
|
-
!e.isPartialGroup && /* @__PURE__ */ t(
|
|
182
|
-
!e.isPartialGroup && /* @__PURE__ */ t(
|
|
183
|
-
/* @__PURE__ */ t(
|
|
184
|
-
(N || e.dynamic) && /* @__PURE__ */ t(
|
|
180
|
+
/* @__PURE__ */ t(nt, { page: e }),
|
|
181
|
+
!e.isPartialGroup && /* @__PURE__ */ t(at, { isOnline: u ? u.online : e.online }),
|
|
182
|
+
!e.isPartialGroup && /* @__PURE__ */ t(st, { page: e, pageType: w }),
|
|
183
|
+
/* @__PURE__ */ t(B, { content: T, side: "top", showTooltip: T.length > 35, children: /* @__PURE__ */ t("span", { className: "max-w-[40%] truncate font-medium text-black", children: T }) }),
|
|
184
|
+
(N || e.dynamic) && /* @__PURE__ */ t(B, { content: O, side: "top", showTooltip: !0, children: /* @__PURE__ */ y("span", { className: "max-w-[40%] truncate font-mono text-xs text-muted-foreground", children: [
|
|
185
185
|
N,
|
|
186
|
-
e.dynamic && (
|
|
186
|
+
e.dynamic && (w == null ? void 0 : w.dynamicSlug) && /* @__PURE__ */ y("span", { className: "text-xs text-gray-500", children: [
|
|
187
187
|
"/",
|
|
188
|
-
|
|
188
|
+
w == null ? void 0 : w.dynamicSlug,
|
|
189
189
|
e.dynamicSlugCustom
|
|
190
190
|
] })
|
|
191
191
|
] }) }),
|
|
192
|
-
G && /* @__PURE__ */ t(
|
|
193
|
-
|
|
192
|
+
G && /* @__PURE__ */ t(B, { content: "Has unpublished changes", side: "top", children: /* @__PURE__ */ t("span", { className: "text-amber-500", children: /* @__PURE__ */ t(je, { size: 12, className: "stroke-[2]" }) }) }),
|
|
193
|
+
Q && /* @__PURE__ */ t(B, { content: "Template", side: "top", children: /* @__PURE__ */ t("span", { className: "text-blue-500", children: /* @__PURE__ */ t(Ge, { size: 16 }) }) }),
|
|
194
194
|
!e.isPartialGroup && L && !c ? /* @__PURE__ */ t("div", { className: "duration absolute right-0.5 top-[3px]", children: /* @__PURE__ */ t(
|
|
195
195
|
Ne,
|
|
196
196
|
{
|
|
@@ -204,17 +204,14 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
204
204
|
setUnmarkAsTemplate: (l) => n("unmarkAsTemplate", l),
|
|
205
205
|
children: /* @__PURE__ */ t("div", { className: "m-0 cursor-pointer rounded border border-transparent p-0.5 duration-100 hover:border-gray-400 hover:bg-white", children: /* @__PURE__ */ t(De, { className: "h-4 w-4", onClick: (l) => l.stopPropagation() }) })
|
|
206
206
|
}
|
|
207
|
-
) }) : c ? /* @__PURE__ */
|
|
207
|
+
) }) : c ? /* @__PURE__ */ y("span", { className: "duration absolute right-1.5 top-1/2 flex -translate-y-1/2 items-center gap-x-1 text-xs text-red-500", children: [
|
|
208
|
+
/* @__PURE__ */ t(Re, { className: "h-3 w-3 fill-red-200 text-red-500" }),
|
|
209
|
+
/* @__PURE__ */ t(B, { content: `${c} is editing this page`, children: /* @__PURE__ */ t("span", { className: "font-bold", children: c }) })
|
|
210
|
+
] }) : null
|
|
208
211
|
]
|
|
209
212
|
}
|
|
210
213
|
) }),
|
|
211
|
-
/* @__PURE__ */ t(
|
|
212
|
-
/* @__PURE__ */ t(We, { size: 12, className: "stroke-[3]" }),
|
|
213
|
-
" ",
|
|
214
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children: c }),
|
|
215
|
-
" is editing this page"
|
|
216
|
-
] }) }),
|
|
217
|
-
/* @__PURE__ */ t(F, { children: !L && !e.isPartialGroup && !c && /* @__PURE__ */ w(
|
|
214
|
+
/* @__PURE__ */ t(q, { children: !L && !e.isPartialGroup && !c && /* @__PURE__ */ y(
|
|
218
215
|
"button",
|
|
219
216
|
{
|
|
220
217
|
onClick: (l) => {
|
|
@@ -222,11 +219,11 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
222
219
|
},
|
|
223
220
|
className: "absolute left-1/2 top-1 flex -translate-x-1/2 items-center gap-x-1 rounded bg-blue-500 px-2 py-0.5 text-xs text-white opacity-0 duration-200 hover:bg-blue-700 group-hover:opacity-100",
|
|
224
221
|
children: [
|
|
225
|
-
/* @__PURE__ */ t(
|
|
222
|
+
/* @__PURE__ */ t(We, { size: 12, className: "stroke-[3]" }),
|
|
226
223
|
" ",
|
|
227
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ y("span", { className: "text-[10px]", children: [
|
|
228
225
|
"Add ",
|
|
229
|
-
|
|
226
|
+
R(ve, o),
|
|
230
227
|
" Page"
|
|
231
228
|
] })
|
|
232
229
|
]
|
|
@@ -244,9 +241,9 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
244
241
|
showUntranslatedPages: P
|
|
245
242
|
}) => {
|
|
246
243
|
const { expandedPages: d } = J();
|
|
247
|
-
return /* @__PURE__ */ t("div", { className: "space-y-0.5", style: { paddingLeft: `${s * 10}px` }, children: e.map((p) => /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ t("div", { className: "space-y-0.5", style: { paddingLeft: `${s * 10}px` }, children: e.map((p) => /* @__PURE__ */ y(q, { children: [
|
|
248
245
|
/* @__PURE__ */ t(
|
|
249
|
-
|
|
246
|
+
rt,
|
|
250
247
|
{
|
|
251
248
|
page: p,
|
|
252
249
|
pageTypes: a,
|
|
@@ -271,34 +268,34 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
271
268
|
}
|
|
272
269
|
)
|
|
273
270
|
] }, p.id)) });
|
|
274
|
-
},
|
|
275
|
-
const { t: s } =
|
|
271
|
+
}, ot = M(() => import("./page-manager-search-and-filter-DJn98D02.js")), it = M(() => import("./add-new-page-Y0d9tHh0.js")), lt = M(() => import("./delete-page-B53nkF74.js")), ct = M(() => import("./duplicate-page-DCRVR-kF.js")), dt = M(() => import("./mark-as-template-AbZrkEYl.js")), ut = M(() => import("./unmark-as-template-CKVMibvu.js")), mt = M(() => import("./unpublish-page-A5qn6E6g.js")), Nt = ({ close: e }) => {
|
|
272
|
+
const { t: s } = Xe(), { languages: a, setSelectedLang: n } = ie(), { data: i } = Se(), { data: o, isFetching: f } = Le(), [P, d] = Ae(), { updateForSelectedPage: p, expandPagesOnSearch: h } = J(null), c = de(), x = P.get("page"), [k, Q] = v(""), [w, u] = v(null), [L, T] = v(null), [N, O] = v(null), [j, G] = v(null), [l, U] = v(""), [K, Z] = v(null), [ee, te] = v(null), [b, V] = v(c), [xe, we] = v(!1), ne = Fe(Te), D = xe && b !== c, { data: I, isFetching: ye } = Ce(b), se = le(
|
|
276
273
|
(m) => {
|
|
277
274
|
var r;
|
|
278
|
-
return (r =
|
|
275
|
+
return (r = W(i, { key: m })) == null ? void 0 : r.hasSlug;
|
|
279
276
|
},
|
|
280
277
|
[i]
|
|
281
|
-
), S =
|
|
278
|
+
), S = H(() => o ? D ? F(o, (m) => !(I != null && I[m.id])) : Ze(o, k, l, se) : [], [o, se, k, l, I, D]);
|
|
282
279
|
E(() => {
|
|
283
280
|
n(c);
|
|
284
281
|
}, [c, n]), E(() => {
|
|
285
282
|
const m = P.get("lang");
|
|
286
283
|
if (m) {
|
|
287
|
-
const r = a,
|
|
288
|
-
|
|
289
|
-
z && b !== m ?
|
|
284
|
+
const r = a, A = a[0] ?? c, z = r.includes(m);
|
|
285
|
+
Ve(() => {
|
|
286
|
+
z && b !== m ? V(m) : !z && b !== A && V(A);
|
|
290
287
|
});
|
|
291
288
|
}
|
|
292
289
|
}, []), E(() => {
|
|
293
290
|
if (!g(l)) return;
|
|
294
291
|
const m = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
295
|
-
!g(i) && m && (
|
|
292
|
+
!g(i) && m && (W(i, { key: m }) ? U(m) : U("all"));
|
|
296
293
|
}, [i, l]), E(() => {
|
|
297
|
-
if (x && !f && !
|
|
294
|
+
if (x && !f && !W(o, { id: x })) {
|
|
298
295
|
const r = new URLSearchParams(P.toString());
|
|
299
296
|
if (r.delete("page"), [...r.keys()].length > 0) {
|
|
300
297
|
if (typeof window < "u" && window.history && window.location) {
|
|
301
|
-
const
|
|
298
|
+
const A = r.toString(), z = window.location.hash || "", oe = window.location.pathname, Pe = A ? `${oe}?${A}${z}` : `${oe}${z}`;
|
|
302
299
|
window.history.replaceState(window.history.state, "", Pe);
|
|
303
300
|
}
|
|
304
301
|
d(r);
|
|
@@ -321,11 +318,11 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
321
318
|
},
|
|
322
319
|
[e, d, X, b, c]
|
|
323
320
|
), re = (m, r) => {
|
|
324
|
-
var
|
|
321
|
+
var A;
|
|
325
322
|
if (r)
|
|
326
323
|
switch (m) {
|
|
327
324
|
case "add":
|
|
328
|
-
|
|
325
|
+
T(r);
|
|
329
326
|
break;
|
|
330
327
|
case "select":
|
|
331
328
|
ae(r);
|
|
@@ -335,7 +332,7 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
335
332
|
edit: !0,
|
|
336
333
|
id: r == null ? void 0 : r.id,
|
|
337
334
|
primaryPage: r == null ? void 0 : r.primaryPage
|
|
338
|
-
}) :
|
|
335
|
+
}) : T(r);
|
|
339
336
|
break;
|
|
340
337
|
case "delete":
|
|
341
338
|
u(r);
|
|
@@ -355,31 +352,31 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
355
352
|
case "addLanguagePage":
|
|
356
353
|
ne({
|
|
357
354
|
edit: !1,
|
|
358
|
-
primaryPage: ((
|
|
355
|
+
primaryPage: ((A = r == null ? void 0 : r.page) == null ? void 0 : A.id) || "",
|
|
359
356
|
preselectedLang: (r == null ? void 0 : r.language) || b
|
|
360
357
|
});
|
|
361
358
|
break;
|
|
362
359
|
}
|
|
363
360
|
};
|
|
364
|
-
return /* @__PURE__ */
|
|
365
|
-
/* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ y(q, { children: [
|
|
362
|
+
/* @__PURE__ */ y("div", { className: "flex h-full flex-col justify-between", children: [
|
|
366
363
|
/* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
367
|
-
|
|
364
|
+
ot,
|
|
368
365
|
{
|
|
369
366
|
pages: S,
|
|
370
367
|
search: k,
|
|
371
|
-
setSearch:
|
|
368
|
+
setSearch: Q,
|
|
372
369
|
languages: [c, ...a],
|
|
373
370
|
selectedLanguage: b,
|
|
374
|
-
setSelectedLanguage:
|
|
371
|
+
setSelectedLanguage: V,
|
|
375
372
|
selectedPageType: l,
|
|
376
373
|
setSelectedPageType: U,
|
|
377
374
|
onAddPage: (m) => re("add", m),
|
|
378
375
|
showUntranslatedPages: D,
|
|
379
|
-
setShowUntranslatedPages:
|
|
376
|
+
setShowUntranslatedPages: we
|
|
380
377
|
}
|
|
381
378
|
) }),
|
|
382
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto px-4 pb-6 pt-2", children: f ||
|
|
379
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto px-4 pb-6 pt-2", children: f || ye ? /* @__PURE__ */ t("div", { className: "space-y-2", children: Ie([...Array(15).keys()], (m) => /* @__PURE__ */ t("div", { className: "h-7 w-full animate-pulse rounded border border-gray-300 bg-gray-200" }, m)) }) : g(S) ? /* @__PURE__ */ y("div", { className: "flex h-[70vh] flex-col items-center justify-center gap-y-1 text-sm font-medium text-slate-500", children: [
|
|
383
380
|
/* @__PURE__ */ t(he, { className: "h-6 w-6 stroke-[1]" }),
|
|
384
381
|
s("Empty List!"),
|
|
385
382
|
/* @__PURE__ */ t("span", { className: "font-light", children: s("Add new page to start") })
|
|
@@ -398,21 +395,21 @@ const ce = (e, s) => !e || !Array.isArray(e) ? [] : g(s) ? e : ue(
|
|
|
398
395
|
) })
|
|
399
396
|
] }),
|
|
400
397
|
L && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
401
|
-
|
|
398
|
+
it,
|
|
402
399
|
{
|
|
403
400
|
closePanel: e,
|
|
404
401
|
editPage: ae,
|
|
405
402
|
addEditPage: L,
|
|
406
|
-
setAddEditPage:
|
|
403
|
+
setAddEditPage: T
|
|
407
404
|
}
|
|
408
405
|
) }),
|
|
409
|
-
|
|
410
|
-
N && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
411
|
-
j && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
412
|
-
ee && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
413
|
-
K && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(
|
|
406
|
+
w && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(lt, { page: w, onClose: () => u(null) }) }),
|
|
407
|
+
N && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(mt, { page: N, onClose: () => O(null) }) }),
|
|
408
|
+
j && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(dt, { page: j, onClose: () => G(null) }) }),
|
|
409
|
+
ee && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(ut, { page: ee, onClose: () => te(null) }) }),
|
|
410
|
+
K && /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(ct, { page: K, onClose: () => Z(null), closePanel: e }) })
|
|
414
411
|
] });
|
|
415
412
|
};
|
|
416
413
|
export {
|
|
417
|
-
|
|
414
|
+
Nt as default
|
|
418
415
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-DKjYF53r.cjs"),f=require("./index-BuXfCtgR.cjs"),w=require("./use-page-expand-manager-B6XTvk0E.cjs"),C=require("@tanstack/react-query"),s=require("lodash-es"),d=require("lucide-react"),S=require("react"),g=require("react-i18next"),k=({selectedPageType:l,setSelectedPageType:i})=>{const{t:a}=g.useTranslation(),[r,o]=S.useState(""),{data:c}=f.usePageTypes(),u=t=>{if(!r)return!0;const x=r.toLowerCase(),m=j=>String(s.get(t,j,"")).toLowerCase().includes(x);return m("name")||m("key")},p=c.find(t=>t.key===l);return e.jsxs(n.Select,{onValueChange:i,value:l,children:[e.jsx(n.SelectTrigger,{className:`${l==="all"?"bg-gray-100/30 hover:bg-gray-100":"gap-x-1 border bg-gray-100/30 hover:bg-gray-100"} h-9 w-max min-w-[150px] overflow-hidden whitespace-nowrap rounded p-0 px-2 py-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0 [&>svg]:hidden`,children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-x-1.5",children:[e.jsx("span",{className:"max-w-[150px] overflow-hidden truncate whitespace-nowrap font-medium leading-tight",children:(p==null?void 0:p.name)||a("All")}),e.jsx(d.ListFilter,{className:`${l!=="all"?"fill-sky-50 text-sky-500":""} pointer-events-none h-4 w-4 text-muted-foreground hover:bg-blue-300`})]})}),e.jsxs(n.SelectContent,{children:[e.jsx("div",{className:"sticky top-0 z-10 bg-white pb-2",children:e.jsxs("div",{className:"relative",children:[e.jsx(d.Search,{strokeWidth:2,className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-gray-400"}),e.jsx(h.Input,{placeholder:a("Search page types..."),className:"h-8 w-full rounded border pl-8 text-xs shadow-none",value:r,onChange:t=>o(t.target.value),onKeyDown:t=>t.stopPropagation()})]})}),e.jsx(n.SelectItem,{value:"all",children:a("All")}),!s.isEmpty(s.filter(c,t=>t.hasSlug&&u(t)))&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500",children:a("Pages")}),s.map([...s.filter(c,t=>t.hasSlug&&u(t))].sort((t,x)=>s.get(t,"name","").localeCompare(s.get(x,"name",""))),t=>e.jsx(n.SelectItem,{value:s.get(t,"key"),children:s.get(t,"name")},s.get(t,"key")))]}),!s.isEmpty(s.filter(c,t=>!t.hasSlug&&u(t)))&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500",children:a("Partials")}),s.map([...s.filter(c,t=>!t.hasSlug&&u(t))].sort((t,x)=>s.get(t,"name","").localeCompare(s.get(x,"name",""))),t=>e.jsx(n.SelectItem,{value:s.get(t,"key"),children:s.get(t,"name")},s.get(t,"key")))]}),s.isEmpty(s.filter(c,u))&&e.jsx("div",{className:"px-3 py-2 text-center text-sm text-gray-500",children:a("No matching page types found")})]})]})},T=({search:l,setSearch:i})=>{const{t:a}=g.useTranslation();return e.jsxs("div",{className:"relative flex h-9 flex-1 items-center gap-2 rounded-md border px-2.5",children:[e.jsx("label",{htmlFor:"page-search-input",className:"sr-only",children:a("Search Pages")}),e.jsx(d.Search,{className:`${l?"fill-sky-50 text-sky-500":""} pointer-events-none h-4 w-4 text-muted-foreground`,"aria-hidden":"true"}),e.jsx(h.Input,{id:"page-search-input",placeholder:a("Search pages"),value:l,onChange:r=>i(r.target.value),className:"border-none px-1.5 shadow-none outline-none ring-0 transition-none focus:outline-none focus:ring-0 focus-visible:ring-0",autoComplete:"off",autoFocus:!0})]})},E=({pages:l})=>{const{t:i}=g.useTranslation(),{expandAll:a,collapseAll:r,expandedPages:o}=w.usePageExpandManager(null);return e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(n.Tooltip,{children:[e.jsx(n.TooltipTrigger,{asChild:!0,children:e.jsx(h.Button,{variant:"outline",size:"icon",onClick:()=>a(l),className:"rounded p-1 text-gray-500",children:e.jsx(d.ChevronsUpDown,{})})}),e.jsx(n.TooltipContent,{children:i("Expand All")})]}),e.jsxs(n.Tooltip,{children:[e.jsx(n.TooltipTrigger,{asChild:!0,children:e.jsx(h.Button,{disabled:o.length===0,variant:"outline",size:"icon",onClick:()=>r(),className:"rounded p-1 text-gray-500",children:e.jsx(d.ChevronsDownUp,{})})}),e.jsx(n.TooltipContent,{children:i("Collapse All")})]})]})},b=({languages:l,selectedLanguage:i,setSelectedLanguage:a})=>{const r=f.useFallbackLang();return e.jsx("div",{className:"scrollbar-hide flex gap-1 overflow-x-auto pb-1",children:l.map(o=>e.jsxs(h.Button,{variant:i===o?"default":"outline",size:"sm",className:`h-6 flex-shrink-0 whitespace-nowrap rounded px-3 text-xs font-normal ${i===o?"bg-black text-white hover:bg-black":"text-gray-500"}`,onClick:()=>a(o.toLowerCase()),children:[o===r&&e.jsx(d.Star,{size:4,className:`p-0.5 ${i===r?"fill-white":"fill-black"}`}),f.LANGUAGES[o]||""]},o))})},y=()=>{const{t:l}=g.useTranslation(),i=C.useQueryClient();return e.jsxs(n.Tooltip,{children:[e.jsx(n.TooltipTrigger,{asChild:!0,children:e.jsx(h.Button,{size:"sm",variant:"ghost",onClick:()=>i.invalidateQueries({queryKey:[f.ACTIONS.GET_WEBSITE_PAGES]}),className:"mt-1 h-6 w-6",children:e.jsx(d.RefreshCw,{})})}),e.jsx(n.TooltipContent,{side:"bottom",children:l("Refresh pages list")})]})},q=({pages:l,search:i,setSearch:a,languages:r,onAddPage:o,selectedLanguage:c,setSelectedLanguage:u,selectedPageType:p,setSelectedPageType:t,showUntranslatedPages:x,setShowUntranslatedPages:m})=>{const{t:j}=g.useTranslation(),v=r.length>1;return e.jsxs("div",{className:"space-y-3 border-b border-b-gray-200 px-4 pb-1",children:[e.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsx(k,{selectedPageType:p,setSelectedPageType:t}),e.jsx(T,{search:i,setSearch:a}),e.jsx(E,{pages:l}),e.jsxs(h.Button,{variant:"default",onClick:o,className:"rounded px-3 font-normal",children:[e.jsx(d.Plus,{strokeWidth:2,className:"stroke-white stroke-[3]"}),e.jsx("span",{className:"font-normal text-white",children:j("Add Page")})]}),!v&&e.jsx(y,{})]}),v?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(b,{languages:r,selectedLanguage:c,setSelectedLanguage:N=>{u(N),m(x&&(r==null?void 0:r[0])!==c)}}),e.jsxs("div",{className:"flex items-center gap-x-2",children:[(r==null?void 0:r[0])!==c&&e.jsxs(n.Tooltip,{children:[e.jsx(n.TooltipTrigger,{asChild:!0,children:e.jsx(h.Button,{variant:"ghost",onClick:()=>m(!x),className:"h-6 rounded px-3 py-1 text-xs font-normal",children:x?e.jsx(d.FilterXIcon,{}):e.jsx(d.Filter,{})})}),e.jsx(n.TooltipContent,{side:"bottom",children:j("Toggle Untranslated Pages")})]}),e.jsx(y,{})]})]}):e.jsx("div",{className:"flex items-center justify-between gap-2"})]})};exports.LanguageSelector=b;exports.default=q;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as k } from "react/jsx-runtime";
|
|
2
2
|
import { B as m, z as E } from "./register-chai-top-bar-D6GjnauV.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { w as g, x as b, y, S as F, z as L, A as I, B as w } from "./index-C7bidKtE.js";
|
|
4
|
+
import { i as j, L as T, k as $, A as B } from "./index-BDrc0HJQ.js";
|
|
5
5
|
import { u as G } from "./use-page-expand-manager-Cf4MUEJw.js";
|
|
6
6
|
import { useQueryClient as D } from "@tanstack/react-query";
|
|
7
|
-
import { isEmpty as
|
|
7
|
+
import { isEmpty as N, filter as x, map as S, get as i } from "lodash-es";
|
|
8
8
|
import { Star as M, Plus as R, FilterXIcon as W, Filter as q, ListFilter as K, Search as P, ChevronsUpDown as Q, ChevronsDownUp as _, RefreshCw as O } from "lucide-react";
|
|
9
9
|
import { useState as U } from "react";
|
|
10
10
|
import { useTranslation as f } from "react-i18next";
|
|
11
11
|
const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
12
|
-
const { t: l } = f(), [r,
|
|
12
|
+
const { t: l } = f(), [r, o] = U(""), { data: c } = $(), h = (t) => {
|
|
13
13
|
if (!r) return !0;
|
|
14
|
-
const d = r.toLowerCase(), u = (v) => String(
|
|
14
|
+
const d = r.toLowerCase(), u = (v) => String(i(t, v, "")).toLowerCase().includes(d);
|
|
15
15
|
return u("name") || u("key");
|
|
16
16
|
}, p = c.find((t) => t.key === n);
|
|
17
|
-
return /* @__PURE__ */ a(
|
|
17
|
+
return /* @__PURE__ */ a(F, { onValueChange: s, value: n, children: [
|
|
18
18
|
/* @__PURE__ */ e(
|
|
19
|
-
|
|
19
|
+
L,
|
|
20
20
|
{
|
|
21
21
|
className: `${n === "all" ? "bg-gray-100/30 hover:bg-gray-100" : "gap-x-1 border bg-gray-100/30 hover:bg-gray-100"} h-9 w-max min-w-[150px] overflow-hidden whitespace-nowrap rounded p-0 px-2 py-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0 [&>svg]:hidden`,
|
|
22
22
|
children: /* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between gap-x-1.5", children: [
|
|
@@ -39,31 +39,31 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
39
39
|
placeholder: l("Search page types..."),
|
|
40
40
|
className: "h-8 w-full rounded border pl-8 text-xs shadow-none",
|
|
41
41
|
value: r,
|
|
42
|
-
onChange: (t) =>
|
|
42
|
+
onChange: (t) => o(t.target.value),
|
|
43
43
|
onKeyDown: (t) => t.stopPropagation()
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
] }) }),
|
|
47
|
-
/* @__PURE__ */ e(
|
|
48
|
-
!
|
|
47
|
+
/* @__PURE__ */ e(w, { value: "all", children: l("All") }),
|
|
48
|
+
!N(x(c, (t) => t.hasSlug && h(t))) && /* @__PURE__ */ a(k, { children: [
|
|
49
49
|
/* @__PURE__ */ e("div", { className: "mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500", children: l("Pages") }),
|
|
50
50
|
S(
|
|
51
51
|
[...x(c, (t) => t.hasSlug && h(t))].sort(
|
|
52
|
-
(t, d) =>
|
|
52
|
+
(t, d) => i(t, "name", "").localeCompare(i(d, "name", ""))
|
|
53
53
|
),
|
|
54
|
-
(t) => /* @__PURE__ */ e(
|
|
54
|
+
(t) => /* @__PURE__ */ e(w, { value: i(t, "key"), children: i(t, "name") }, i(t, "key"))
|
|
55
55
|
)
|
|
56
56
|
] }),
|
|
57
|
-
!
|
|
57
|
+
!N(x(c, (t) => !t.hasSlug && h(t))) && /* @__PURE__ */ a(k, { children: [
|
|
58
58
|
/* @__PURE__ */ e("div", { className: "mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500", children: l("Partials") }),
|
|
59
59
|
S(
|
|
60
60
|
[...x(c, (t) => !t.hasSlug && h(t))].sort(
|
|
61
|
-
(t, d) =>
|
|
61
|
+
(t, d) => i(t, "name", "").localeCompare(i(d, "name", ""))
|
|
62
62
|
),
|
|
63
|
-
(t) => /* @__PURE__ */ e(
|
|
63
|
+
(t) => /* @__PURE__ */ e(w, { value: i(t, "key"), children: i(t, "name") }, i(t, "key"))
|
|
64
64
|
)
|
|
65
65
|
] }),
|
|
66
|
-
|
|
66
|
+
N(x(c, h)) && /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-sm text-gray-500", children: l("No matching page types found") })
|
|
67
67
|
] })
|
|
68
68
|
] });
|
|
69
69
|
}, X = ({ search: n, setSearch: s }) => {
|
|
@@ -85,12 +85,13 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
85
85
|
value: n,
|
|
86
86
|
onChange: (r) => s(r.target.value),
|
|
87
87
|
className: "border-none px-1.5 shadow-none outline-none ring-0 transition-none focus:outline-none focus:ring-0 focus-visible:ring-0",
|
|
88
|
-
autoComplete: "off"
|
|
88
|
+
autoComplete: "off",
|
|
89
|
+
autoFocus: !0
|
|
89
90
|
}
|
|
90
91
|
)
|
|
91
92
|
] });
|
|
92
93
|
}, H = ({ pages: n }) => {
|
|
93
|
-
const { t: s } = f(), { expandAll: l, collapseAll: r, expandedPages:
|
|
94
|
+
const { t: s } = f(), { expandAll: l, collapseAll: r, expandedPages: o } = G(null);
|
|
94
95
|
return /* @__PURE__ */ a("div", { className: "flex gap-1", children: [
|
|
95
96
|
/* @__PURE__ */ a(g, { children: [
|
|
96
97
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(m, { variant: "outline", size: "icon", onClick: () => l(n), className: "rounded p-1 text-gray-500", children: /* @__PURE__ */ e(Q, {}) }) }),
|
|
@@ -100,7 +101,7 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
100
101
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
|
|
101
102
|
m,
|
|
102
103
|
{
|
|
103
|
-
disabled:
|
|
104
|
+
disabled: o.length === 0,
|
|
104
105
|
variant: "outline",
|
|
105
106
|
size: "icon",
|
|
106
107
|
onClick: () => r(),
|
|
@@ -113,19 +114,19 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
113
114
|
] });
|
|
114
115
|
}, J = ({ languages: n, selectedLanguage: s, setSelectedLanguage: l }) => {
|
|
115
116
|
const r = j();
|
|
116
|
-
return /* @__PURE__ */ e("div", { className: "scrollbar-hide flex gap-1 overflow-x-auto pb-1", children: n.map((
|
|
117
|
+
return /* @__PURE__ */ e("div", { className: "scrollbar-hide flex gap-1 overflow-x-auto pb-1", children: n.map((o) => /* @__PURE__ */ a(
|
|
117
118
|
m,
|
|
118
119
|
{
|
|
119
|
-
variant: s ===
|
|
120
|
+
variant: s === o ? "default" : "outline",
|
|
120
121
|
size: "sm",
|
|
121
|
-
className: `h-6 flex-shrink-0 whitespace-nowrap rounded px-3 text-xs font-normal ${s ===
|
|
122
|
-
onClick: () => l(
|
|
122
|
+
className: `h-6 flex-shrink-0 whitespace-nowrap rounded px-3 text-xs font-normal ${s === o ? "bg-black text-white hover:bg-black" : "text-gray-500"}`,
|
|
123
|
+
onClick: () => l(o.toLowerCase()),
|
|
123
124
|
children: [
|
|
124
|
-
|
|
125
|
-
T[
|
|
125
|
+
o === r && /* @__PURE__ */ e(M, { size: 4, className: `p-0.5 ${s === r ? "fill-white" : "fill-black"}` }),
|
|
126
|
+
T[o] || ""
|
|
126
127
|
]
|
|
127
128
|
},
|
|
128
|
-
|
|
129
|
+
o
|
|
129
130
|
)) });
|
|
130
131
|
}, A = () => {
|
|
131
132
|
const { t: n } = f(), s = D();
|
|
@@ -142,12 +143,12 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
142
143
|
) }),
|
|
143
144
|
/* @__PURE__ */ e(y, { side: "bottom", children: n("Refresh pages list") })
|
|
144
145
|
] });
|
|
145
|
-
},
|
|
146
|
+
}, ie = ({
|
|
146
147
|
pages: n,
|
|
147
148
|
search: s,
|
|
148
149
|
setSearch: l,
|
|
149
150
|
languages: r,
|
|
150
|
-
onAddPage:
|
|
151
|
+
onAddPage: o,
|
|
151
152
|
selectedLanguage: c,
|
|
152
153
|
setSelectedLanguage: h,
|
|
153
154
|
selectedPageType: p,
|
|
@@ -161,7 +162,7 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
161
162
|
/* @__PURE__ */ e(V, { selectedPageType: p, setSelectedPageType: t }),
|
|
162
163
|
/* @__PURE__ */ e(X, { search: s, setSearch: l }),
|
|
163
164
|
/* @__PURE__ */ e(H, { pages: n }),
|
|
164
|
-
/* @__PURE__ */ a(m, { variant: "default", onClick:
|
|
165
|
+
/* @__PURE__ */ a(m, { variant: "default", onClick: o, className: "rounded px-3 font-normal", children: [
|
|
165
166
|
/* @__PURE__ */ e(R, { strokeWidth: 2, className: "stroke-white stroke-[3]" }),
|
|
166
167
|
/* @__PURE__ */ e("span", { className: "font-normal text-white", children: v("Add Page") })
|
|
167
168
|
] }),
|
|
@@ -198,5 +199,5 @@ const V = ({ selectedPageType: n, setSelectedPageType: s }) => {
|
|
|
198
199
|
};
|
|
199
200
|
export {
|
|
200
201
|
J as LanguageSelector,
|
|
201
|
-
|
|
202
|
+
ie as default
|
|
202
203
|
};
|