strapi-plugin-navigation 3.3.5 → 3.3.6
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/admin/index.js +2 -2
- package/dist/admin/index.mjs +513 -507
- package/dist/server/index.js +17 -17
- package/dist/server/index.mjs +300 -299
- package/dist/server/src/repositories/navigation-item.d.ts +1 -1
- package/package.json +1 -1
package/dist/admin/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Bn, { useRef as We, useEffect as V, useCallback as E, useState as N, useMemo as X, createContext as tn, useContext as nn } from "react";
|
|
2
2
|
import { jsx as n, jsxs as w, Fragment as ie } from "react/jsx-runtime";
|
|
3
|
-
import oe, { useTheme as
|
|
4
|
-
import { getFetchClient as j, useRBAC as
|
|
5
|
-
import { useDrop as
|
|
6
|
-
import { HTML5Backend as
|
|
7
|
-
import { Routes as
|
|
3
|
+
import oe, { useTheme as On } from "styled-components";
|
|
4
|
+
import { getFetchClient as j, useRBAC as zn, useMediaQuery as Pt, useIsMobile as an, useIsTablet as _n, useIsDesktop as Qn, Form as at, useNotification as Oe, Layouts as qe, useStrapiApp as Un, Page as Te, useAuth as Kn } from "@strapi/strapi/admin";
|
|
5
|
+
import { useDrop as Wn, useDrag as Hn, DndProvider as Xn } from "react-dnd";
|
|
6
|
+
import { HTML5Backend as Gn } from "react-dnd-html5-backend";
|
|
7
|
+
import { Routes as Zn, Route as Mt } from "react-router-dom";
|
|
8
8
|
import { useQuery as Fe, useMutation as ge, useQueryClient as be, QueryClient as on, QueryClientProvider as rn } from "@tanstack/react-query";
|
|
9
|
-
import { once as
|
|
9
|
+
import { once as Jn, isEmpty as Y, capitalize as ln, get as J, first as Ct, orderBy as Yn, isObject as He, isNil as Be, isString as ot, set as it, sortBy as Xe, isNumber as kt, isBoolean as ea, isNull as ta, isArray as na } from "lodash";
|
|
10
10
|
import { useIntl as A } from "react-intl";
|
|
11
|
-
import { Dialog as Qe, Flex as P, Typography as F, Button as K, Modal as H, Grid as S, TextInput as we, Toggle as me, Box as D, Table as sn, Thead as dn, Tr as et, Th as ce, Checkbox as qt, IconButton as ye, Tbody as cn, Td as ue, Loader as bt, Tag as
|
|
12
|
-
import { Check as Ge, WarningCircle as fa, Feather as ya, Pencil as vt, Trash as Tt, Information as ba, CaretDown as Ia, CaretUp as Ca, Drag as va, Eye as
|
|
11
|
+
import { Dialog as Qe, Flex as P, Typography as F, Button as K, Modal as H, Grid as S, TextInput as we, Toggle as me, Box as D, Table as sn, Thead as dn, Tr as et, Th as ce, Checkbox as qt, IconButton as ye, Tbody as cn, Td as ue, Loader as bt, Tag as aa, Field as Dt, SingleSelect as xe, SingleSelectOption as Ae, Badge as un, CardTitle as oa, IconButtonGroup as pn, Card as ia, CardBody as Vt, Divider as tt, TextButton as ra, Link as la, MultiSelect as De, MultiSelectOption as Ve, Textarea as sa, Combobox as mn, ComboboxOption as da, Searchbar as ca, NumberInput as ua, VisuallyHidden as pa, Tooltip as ma, TFooter as ga, Accordion as Ue, Alert as ha } from "@strapi/design-system";
|
|
12
|
+
import { Check as Ge, WarningCircle as fa, Feather as ya, Pencil as vt, Trash as Tt, Information as ba, CaretDown as Ia, CaretUp as Ca, Drag as va, Eye as gn, ArrowClockwise as Ta, Earth as wa, Cog as Sa, Link as xa, Plus as wt, ArrowRight as Aa, Search as Fa, ListPlus as Na, Minus as Ra, EyeStriked as La, PriceTag as $a, Play as Ea, Typhoon as Pa } from "@strapi/icons";
|
|
13
13
|
import * as s from "zod";
|
|
14
14
|
import { z as g } from "zod";
|
|
15
15
|
import { usePluginTheme as Ma, Field as $, prefixPluginTranslations as jt, flattenObject as Bt } from "@sensinum/strapi-utils";
|
|
@@ -65,13 +65,13 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
65
65
|
type: g.literal("media"),
|
|
66
66
|
multi: g.literal(!1).optional(),
|
|
67
67
|
options: g.array(g.string()).max(0).optional()
|
|
68
|
-
}),
|
|
68
|
+
}), hn = g.discriminatedUnion("type", [
|
|
69
69
|
Oa,
|
|
70
70
|
za,
|
|
71
71
|
Ba
|
|
72
72
|
]), _a = g.union([
|
|
73
73
|
g.literal("audience"),
|
|
74
|
-
|
|
74
|
+
hn
|
|
75
75
|
]), Qa = g.object({
|
|
76
76
|
additionalFields: g.array(_a),
|
|
77
77
|
allowedLevels: g.number(),
|
|
@@ -110,11 +110,11 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
110
110
|
documentId: s.string(),
|
|
111
111
|
name: s.string(),
|
|
112
112
|
key: s.string()
|
|
113
|
-
}),
|
|
113
|
+
}), fn = s.enum(["INTERNAL", "EXTERNAL", "WRAPPER"]), Wa = s.object({
|
|
114
114
|
id: s.number(),
|
|
115
115
|
documentId: s.string(),
|
|
116
116
|
title: s.string(),
|
|
117
|
-
type:
|
|
117
|
+
type: fn,
|
|
118
118
|
path: s.string().or(s.null()).optional(),
|
|
119
119
|
externalPath: s.string().or(s.null()).optional(),
|
|
120
120
|
uiRouterKey: s.string(),
|
|
@@ -131,8 +131,8 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
131
131
|
removed: s.boolean().optional(),
|
|
132
132
|
isSearchActive: s.boolean().optional(),
|
|
133
133
|
updated: s.boolean().optional()
|
|
134
|
-
}),
|
|
135
|
-
items: s.lazy(() =>
|
|
134
|
+
}), yn = Wa.extend({
|
|
135
|
+
items: s.lazy(() => yn.array().or(s.null())).optional()
|
|
136
136
|
}), zt = s.object({
|
|
137
137
|
id: s.number(),
|
|
138
138
|
documentId: s.string(),
|
|
@@ -140,7 +140,7 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
140
140
|
slug: s.string(),
|
|
141
141
|
locale: s.string(),
|
|
142
142
|
visible: s.boolean(),
|
|
143
|
-
items: s.array(
|
|
143
|
+
items: s.array(yn)
|
|
144
144
|
}), xt = s.object({
|
|
145
145
|
name: s.string({ required_error: "requiredError" }).nonempty("requiredError").refine((e) => !e.includes(" "), { message: "noSpaceError" }),
|
|
146
146
|
label: s.string({ required_error: "requiredError" }).nonempty("requiredError"),
|
|
@@ -215,7 +215,7 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
215
215
|
displayName: s.string(),
|
|
216
216
|
description: s.string().optional(),
|
|
217
217
|
name: s.string().optional()
|
|
218
|
-
}),
|
|
218
|
+
}), bn = s.object({
|
|
219
219
|
required: s.boolean().optional(),
|
|
220
220
|
max: s.number().optional(),
|
|
221
221
|
min: s.number().optional(),
|
|
@@ -243,9 +243,9 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
243
243
|
"json",
|
|
244
244
|
"relation",
|
|
245
245
|
"media"
|
|
246
|
-
]), io =
|
|
246
|
+
]), io = bn.extend({
|
|
247
247
|
type: oo
|
|
248
|
-
}), ro =
|
|
248
|
+
}), ro = bn.extend({
|
|
249
249
|
type: s.literal("enumeration"),
|
|
250
250
|
enum: s.string().array()
|
|
251
251
|
}), lo = s.object({
|
|
@@ -321,9 +321,9 @@ const ho = s.object({
|
|
|
321
321
|
path: s.string().or(s.null()).optional(),
|
|
322
322
|
related: s.object({ documentId: s.string().optional(), __type: s.string() }).catchall(s.unknown()).nullish(),
|
|
323
323
|
title: s.string(),
|
|
324
|
-
type:
|
|
324
|
+
type: fn,
|
|
325
325
|
uiRouterKey: s.string()
|
|
326
|
-
}), q = "navigation", B =
|
|
326
|
+
}), q = "navigation", B = Jn((e) => ({
|
|
327
327
|
getIndexPrefix() {
|
|
328
328
|
return [q];
|
|
329
329
|
},
|
|
@@ -445,7 +445,7 @@ const ho = s.object({
|
|
|
445
445
|
queryFn: t.readLocale,
|
|
446
446
|
staleTime: 1 / 0
|
|
447
447
|
});
|
|
448
|
-
},
|
|
448
|
+
}, In = (e) => {
|
|
449
449
|
const t = j(), a = B(t);
|
|
450
450
|
return Fe({
|
|
451
451
|
queryKey: a.readContentTypeItemsIndex(e),
|
|
@@ -546,7 +546,7 @@ const ho = s.object({
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
|
-
},
|
|
549
|
+
}, Cn = ({
|
|
550
550
|
onError: e,
|
|
551
551
|
onSuccess: t
|
|
552
552
|
}) => {
|
|
@@ -560,7 +560,7 @@ const ho = s.object({
|
|
|
560
560
|
},
|
|
561
561
|
onError: e
|
|
562
562
|
});
|
|
563
|
-
},
|
|
563
|
+
}, vn = () => {
|
|
564
564
|
const e = j(), t = B(e);
|
|
565
565
|
return ge({
|
|
566
566
|
mutationFn(a) {
|
|
@@ -730,9 +730,9 @@ const ho = s.object({
|
|
|
730
730
|
closeNavigationItemPopup: d,
|
|
731
731
|
isItemPopupVisible: o
|
|
732
732
|
};
|
|
733
|
-
},
|
|
733
|
+
}, Tn = (e, t, a) => {
|
|
734
734
|
const o = e.reduce((i, r) => {
|
|
735
|
-
const d = r.items?.length ?
|
|
735
|
+
const d = r.items?.length ? Tn(r.items ?? [], t) : [];
|
|
736
736
|
return t(r) ? [r, ...d, ...i] : [...d, ...i];
|
|
737
737
|
}, []);
|
|
738
738
|
if (a !== void 0) {
|
|
@@ -744,7 +744,7 @@ const ho = s.object({
|
|
|
744
744
|
const [{ value: t, index: a }, o] = N({
|
|
745
745
|
value: "",
|
|
746
746
|
index: 0
|
|
747
|
-
}), i = Y(t), r = (t || "").toLowerCase(), d = i ? [] :
|
|
747
|
+
}), i = Y(t), r = (t || "").toLowerCase(), d = i ? [] : Tn(
|
|
748
748
|
e?.items.map((c) => ({ ...c })) ?? [],
|
|
749
749
|
(c) => (c?.title || "").toLowerCase().includes(r),
|
|
750
750
|
r ? a : void 0
|
|
@@ -773,14 +773,14 @@ const ho = s.object({
|
|
|
773
773
|
), {
|
|
774
774
|
isLoading: t,
|
|
775
775
|
allowedActions: { canUpdate: a, canAccess: o }
|
|
776
|
-
} =
|
|
776
|
+
} = zn(e);
|
|
777
777
|
return { canAccess: o, canUpdate: a, isLoadingForPermissions: t };
|
|
778
778
|
}, Ze = () => {
|
|
779
779
|
const {
|
|
780
780
|
theme: { breakpoints: e }
|
|
781
|
-
} = Ma(), t = !Pt(e.small), a = an(), o =
|
|
781
|
+
} = Ma(), t = !Pt(e.small), a = an(), o = _n(), i = Qn(), r = Pt("@media (min-width: 1280px)");
|
|
782
782
|
return { isSmallMobile: t, isMobile: a, isTablet: o, isDesktop: i, isLargeDesktop: r };
|
|
783
|
-
}, Ke = (e = []) =>
|
|
783
|
+
}, Ke = (e = []) => Yn(e, ["order"], ["asc"]).map((t, a) => {
|
|
784
784
|
const o = a + 1;
|
|
785
785
|
return {
|
|
786
786
|
...t,
|
|
@@ -974,7 +974,7 @@ const ho = s.object({
|
|
|
974
974
|
isSearchActive: e.isSearchActive,
|
|
975
975
|
path: e.path ?? ""
|
|
976
976
|
};
|
|
977
|
-
},
|
|
977
|
+
}, wn = (e) => e.find(({ isPending: t }) => t), ke = (e, t) => e.collapsed !== t ? {
|
|
978
978
|
...e,
|
|
979
979
|
collapsed: t,
|
|
980
980
|
updated: !0,
|
|
@@ -989,7 +989,7 @@ const ho = s.object({
|
|
|
989
989
|
name: g.string().min(2).and(g.string().refine((t) => !e.includes(t), "Name already used")),
|
|
990
990
|
// TODO: add translation
|
|
991
991
|
visible: g.boolean()
|
|
992
|
-
}),
|
|
992
|
+
}), Sn = ({
|
|
993
993
|
navigation: e,
|
|
994
994
|
onChange: t,
|
|
995
995
|
alreadyUsedNames: a = [],
|
|
@@ -1105,7 +1105,7 @@ const ho = s.object({
|
|
|
1105
1105
|
[e]
|
|
1106
1106
|
);
|
|
1107
1107
|
return /* @__PURE__ */ n(
|
|
1108
|
-
|
|
1108
|
+
Sn,
|
|
1109
1109
|
{
|
|
1110
1110
|
alreadyUsedNames: o,
|
|
1111
1111
|
navigation: t,
|
|
@@ -1339,7 +1339,7 @@ const ho = s.object({
|
|
|
1339
1339
|
[i, o, e]
|
|
1340
1340
|
);
|
|
1341
1341
|
return /* @__PURE__ */ n(
|
|
1342
|
-
|
|
1342
|
+
Sn,
|
|
1343
1343
|
{
|
|
1344
1344
|
navigation: r,
|
|
1345
1345
|
onChange: d,
|
|
@@ -1392,10 +1392,10 @@ const ho = s.object({
|
|
|
1392
1392
|
}
|
|
1393
1393
|
);
|
|
1394
1394
|
}, ni = (e) => e.map(nt("name")).join(", "), ai = ({ initialState: e, isOpened: t, onClose: a }) => {
|
|
1395
|
-
const { formatMessage: o } = A(), [i, r] = N(e), { toggleNotification: d } = Oe(), c = So(), m = xo(), p = No(), u =
|
|
1395
|
+
const { formatMessage: o } = A(), [i, r] = N(e), { toggleNotification: d } = Oe(), c = So(), m = xo(), p = No(), u = Cn({}), C = vn(), b = Ft(), v = At(), h = X(
|
|
1396
1396
|
() => Xe(b.data ?? [], "id"),
|
|
1397
1397
|
[b.data]
|
|
1398
|
-
), f =
|
|
1398
|
+
), f = wn([
|
|
1399
1399
|
m,
|
|
1400
1400
|
b,
|
|
1401
1401
|
p,
|
|
@@ -1735,7 +1735,7 @@ const ho = s.object({
|
|
|
1735
1735
|
]
|
|
1736
1736
|
}
|
|
1737
1737
|
),
|
|
1738
|
-
secondaryAction: !z && /* @__PURE__ */ n(
|
|
1738
|
+
secondaryAction: !z && /* @__PURE__ */ n(aa, { icon: /* @__PURE__ */ n(ba, { "aria-hidden": !0 }), children: e ? b(l("header.meta"), {
|
|
1739
1739
|
id: e?.documentId,
|
|
1740
1740
|
key: e?.slug
|
|
1741
1741
|
}) : null })
|
|
@@ -1808,7 +1808,7 @@ const ho = s.object({
|
|
|
1808
1808
|
]
|
|
1809
1809
|
}
|
|
1810
1810
|
);
|
|
1811
|
-
},
|
|
1811
|
+
}, xn = oe(un).withConfig({
|
|
1812
1812
|
shouldForwardProp: (e) => !["small"].includes(e)
|
|
1813
1813
|
})`
|
|
1814
1814
|
border: 1px solid
|
|
@@ -1875,7 +1875,7 @@ const ho = s.object({
|
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
}
|
|
1878
|
-
`, gi =
|
|
1878
|
+
`, gi = Bn.forwardRef((e, t) => {
|
|
1879
1879
|
const { isSmallMobile: a } = Ze();
|
|
1880
1880
|
return /* @__PURE__ */ n(mi, { ...e, ref: t, isMobile: a, children: /* @__PURE__ */ n(va, {}) });
|
|
1881
1881
|
}), hi = oe(oa)`
|
|
@@ -1889,7 +1889,7 @@ const ho = s.object({
|
|
|
1889
1889
|
> div > * {
|
|
1890
1890
|
margin: 0px ${({ theme: e }) => e.spaces[1]};
|
|
1891
1891
|
}
|
|
1892
|
-
`, fi = /* @__PURE__ */ n(vt, {}), yi = /* @__PURE__ */ n(Tt, {}), bi = /* @__PURE__ */ n(
|
|
1892
|
+
`, fi = /* @__PURE__ */ n(vt, {}), yi = /* @__PURE__ */ n(Tt, {}), bi = /* @__PURE__ */ n(gn, {}), Ii = /* @__PURE__ */ n(Ta, {}), Ci = { zIndex: 2 }, vi = { maxWidth: "425px" }, Ti = ({
|
|
1893
1893
|
title: e,
|
|
1894
1894
|
path: t,
|
|
1895
1895
|
icon: a,
|
|
@@ -1921,8 +1921,8 @@ const ho = s.object({
|
|
|
1921
1921
|
/* @__PURE__ */ n(P, { children: a })
|
|
1922
1922
|
] }),
|
|
1923
1923
|
/* @__PURE__ */ w(P, { alignItems: "center", style: Ci, children: [
|
|
1924
|
-
o && /* @__PURE__ */ n(
|
|
1925
|
-
/* @__PURE__ */ w(
|
|
1924
|
+
o && /* @__PURE__ */ n(xn, { borderColor: "danger200", backgroundColor: "danger100", textColor: "danger600", children: u(l("components.navigationItem.badge.removed")) }),
|
|
1925
|
+
/* @__PURE__ */ w(pn, { children: [
|
|
1926
1926
|
/* @__PURE__ */ n(
|
|
1927
1927
|
ht,
|
|
1928
1928
|
{
|
|
@@ -2040,14 +2040,14 @@ const ho = s.object({
|
|
|
2040
2040
|
const y = Se(e, !0), { formatMessage: T } = A(), L = ne(), z = an(), k = y.type === "EXTERNAL", x = y.type === "WRAPPER", M = kt(L.data?.allowedLevels) ? a < L.data.allowedLevels - 1 : !0, _ = kt(L.data?.allowedLevels) ? a < L.data.allowedLevels : !0, re = !Y(e.items) && !b, Q = k ? void 0 : `${o === "/" ? "" : o}/${y.path === "/" ? "" : y.path}`.replace(
|
|
2041
2041
|
"//",
|
|
2042
2042
|
"/"
|
|
2043
|
-
), le =
|
|
2043
|
+
), le = In({
|
|
2044
2044
|
uid: y.type === "INTERNAL" ? y.relatedType ?? "" : "",
|
|
2045
2045
|
locale: I
|
|
2046
2046
|
}), ee = bo().data?.find(
|
|
2047
2047
|
(W) => y.type === "INTERNAL" ? W.uid === y.relatedType : !1
|
|
2048
2048
|
), _e = ee?.uid.includes("api::"), pe = le.data?.find(
|
|
2049
2049
|
(W) => y.type === "INTERNAL" ? W.documentId === y.related : !1
|
|
2050
|
-
) ?? { documentId: "", id: 0 }, Re = !!pe?.publishedAt, G = k ? "" : st(pe, L.data), R = ee?.info.displayName ?? "", Z = Re ? "success" : "secondary", se = v.canUpdate, U = We(null), Le = We(null), Ie = We(null), [, Ce] =
|
|
2050
|
+
) ?? { documentId: "", id: 0 }, Re = !!pe?.publishedAt, G = k ? "" : st(pe, L.data), R = ee?.info.displayName ?? "", Z = Re ? "success" : "secondary", se = v.canUpdate, U = We(null), Le = We(null), Ie = We(null), [, Ce] = Wn({
|
|
2051
2051
|
accept: `navigation-item_${o}`,
|
|
2052
2052
|
hover(W, ve) {
|
|
2053
2053
|
const te = W.order ?? 0, Pe = e.order ?? 0;
|
|
@@ -2056,29 +2056,29 @@ const ho = s.object({
|
|
|
2056
2056
|
const ct = Le.current.getBoundingClientRect(), ut = (ct.bottom - ct.top) / 2, Et = ve.getClientOffset();
|
|
2057
2057
|
if (!Et)
|
|
2058
2058
|
return;
|
|
2059
|
-
const pt = Et.y - ct.top,
|
|
2059
|
+
const pt = Et.y - ct.top, jn = pt > ut ? (e.order ?? 0) + 0.5 : (e.order ?? 0) - 0.5;
|
|
2060
2060
|
te < Pe && pt < ut || te > Pe && pt > ut || p({
|
|
2061
2061
|
item: Se(W, !0),
|
|
2062
|
-
newOrder:
|
|
2062
|
+
newOrder: jn
|
|
2063
2063
|
});
|
|
2064
2064
|
},
|
|
2065
2065
|
collect: (W) => ({
|
|
2066
2066
|
isOverCurrent: W.isOver({ shallow: !0 })
|
|
2067
2067
|
})
|
|
2068
|
-
}), [{ isDragging:
|
|
2068
|
+
}), [{ isDragging: Pn }, Mn, kn] = Hn({
|
|
2069
2069
|
type: `navigation-item_${o}`,
|
|
2070
2070
|
item: () => e,
|
|
2071
2071
|
collect: (W) => ({
|
|
2072
2072
|
isDragging: W.isDragging()
|
|
2073
2073
|
})
|
|
2074
2074
|
}), Ee = {
|
|
2075
|
-
dragRef:
|
|
2075
|
+
dragRef: Mn(U),
|
|
2076
2076
|
dropRef: Ce(Le),
|
|
2077
|
-
previewRef:
|
|
2078
|
-
},
|
|
2077
|
+
previewRef: kn(Ie)
|
|
2078
|
+
}, qn = (W) => {
|
|
2079
2079
|
const ve = ee?.kind === "singleType", te = W?.locale ? `?plugins[i18n][locale]=${W?.locale}` : "";
|
|
2080
2080
|
return `/admin/content-manager/${ve ? "single-types" : "collection-types"}/${ee?.uid}${ve ? "" : "/" + W?.documentId}${te}`;
|
|
2081
|
-
},
|
|
2081
|
+
}, Dn = E(
|
|
2082
2082
|
(W) => {
|
|
2083
2083
|
if (!se)
|
|
2084
2084
|
return;
|
|
@@ -2110,20 +2110,20 @@ const ho = s.object({
|
|
|
2110
2110
|
inline: "center"
|
|
2111
2111
|
});
|
|
2112
2112
|
}, [y.isSearchActive, Ee.dropRef.current]);
|
|
2113
|
-
const
|
|
2113
|
+
const Vn = vo({
|
|
2114
2114
|
uid: y.type === "INTERNAL" ? y.relatedType ?? "" : "",
|
|
2115
2115
|
locale: I
|
|
2116
2116
|
});
|
|
2117
2117
|
V(() => {
|
|
2118
|
-
|
|
2118
|
+
Vn();
|
|
2119
2119
|
}, []);
|
|
2120
|
-
const $t =
|
|
2120
|
+
const $t = On();
|
|
2121
2121
|
return /* @__PURE__ */ w(
|
|
2122
2122
|
Si,
|
|
2123
2123
|
{
|
|
2124
2124
|
level: a,
|
|
2125
2125
|
isLast: t,
|
|
2126
|
-
style: { opacity:
|
|
2126
|
+
style: { opacity: Pn ? 0.2 : 1 },
|
|
2127
2127
|
ref: Ee ? Ee.dropRef : void 0,
|
|
2128
2128
|
children: [
|
|
2129
2129
|
/* @__PURE__ */ w(
|
|
@@ -2225,7 +2225,7 @@ const ho = s.object({
|
|
|
2225
2225
|
{
|
|
2226
2226
|
disabled: y.removed,
|
|
2227
2227
|
startIcon: /* @__PURE__ */ n(wt, {}),
|
|
2228
|
-
onClick:
|
|
2228
|
+
onClick: Dn,
|
|
2229
2229
|
size: "S",
|
|
2230
2230
|
children: /* @__PURE__ */ n(
|
|
2231
2231
|
F,
|
|
@@ -2265,7 +2265,7 @@ const ho = s.object({
|
|
|
2265
2265
|
] }) : null,
|
|
2266
2266
|
G && /* @__PURE__ */ w(P, { justifyContent: "center", alignItems: "center", children: [
|
|
2267
2267
|
!z && /* @__PURE__ */ n(
|
|
2268
|
-
|
|
2268
|
+
xn,
|
|
2269
2269
|
{
|
|
2270
2270
|
borderColor: `${Z}200`,
|
|
2271
2271
|
backgroundColor: `${Z}100`,
|
|
@@ -2303,7 +2303,7 @@ const ho = s.object({
|
|
|
2303
2303
|
_e && /* @__PURE__ */ n(
|
|
2304
2304
|
la,
|
|
2305
2305
|
{
|
|
2306
|
-
href:
|
|
2306
|
+
href: qn(pe ?? void 0),
|
|
2307
2307
|
endIcon: /* @__PURE__ */ n(Aa, {}),
|
|
2308
2308
|
children: " "
|
|
2309
2309
|
}
|
|
@@ -2317,7 +2317,7 @@ const ho = s.object({
|
|
|
2317
2317
|
}
|
|
2318
2318
|
),
|
|
2319
2319
|
re && !y.removed && !y.collapsed && /* @__PURE__ */ n(
|
|
2320
|
-
|
|
2320
|
+
An,
|
|
2321
2321
|
{
|
|
2322
2322
|
onItemLevelAdd: r,
|
|
2323
2323
|
onItemEdit: m,
|
|
@@ -2352,7 +2352,7 @@ const ho = s.object({
|
|
|
2352
2352
|
border-left: 4px solid ${t.colors.neutral300};
|
|
2353
2353
|
}
|
|
2354
2354
|
`};
|
|
2355
|
-
`,
|
|
2355
|
+
`, An = ({
|
|
2356
2356
|
isParentAttachedToMenu: e = !1,
|
|
2357
2357
|
items: t,
|
|
2358
2358
|
level: a = 0,
|
|
@@ -2550,7 +2550,7 @@ const ho = s.object({
|
|
|
2550
2550
|
let m = o.additionalFields[d];
|
|
2551
2551
|
switch (c) {
|
|
2552
2552
|
case "boolean":
|
|
2553
|
-
m =
|
|
2553
|
+
m = ea(m) ? `${m}` : m;
|
|
2554
2554
|
break;
|
|
2555
2555
|
case "media":
|
|
2556
2556
|
m = m && JSON.stringify(m);
|
|
@@ -2686,7 +2686,7 @@ const ho = s.object({
|
|
|
2686
2686
|
}) : e || "";
|
|
2687
2687
|
return `${a.levelPath !== "/" ? `${a.levelPath}` : ""}/${p}`.replace("//", "/");
|
|
2688
2688
|
}
|
|
2689
|
-
},
|
|
2689
|
+
}, Fn = tn({
|
|
2690
2690
|
values: {},
|
|
2691
2691
|
onChange: () => null,
|
|
2692
2692
|
handleChange: () => null,
|
|
@@ -2694,7 +2694,7 @@ const ho = s.object({
|
|
|
2694
2694
|
setFormValueItem: () => null,
|
|
2695
2695
|
canUpdate: void 0,
|
|
2696
2696
|
isLoading: !0
|
|
2697
|
-
}), he = () => nn(
|
|
2697
|
+
}), he = () => nn(Fn), ji = () => {
|
|
2698
2698
|
const { formatMessage: e } = A(), t = ne(), { values: a, onChange: o, handleChange: i, renderError: r, canUpdate: d } = he(), m = (t.data?.contentTypes.length ? ["INTERNAL", "EXTERNAL", "WRAPPER"] : ["EXTERNAL", "WRAPPER"]).map((p) => ({
|
|
2699
2699
|
key: p,
|
|
2700
2700
|
value: p,
|
|
@@ -2888,7 +2888,7 @@ const ho = s.object({
|
|
|
2888
2888
|
value: r,
|
|
2889
2889
|
disabled: d
|
|
2890
2890
|
}) => {
|
|
2891
|
-
const { toggleNotification: c } = Oe(), { formatMessage: m } = A(), u =
|
|
2891
|
+
const { toggleNotification: c } = Oe(), { formatMessage: m } = A(), u = Un("AdditionalFieldInput", (b) => b.fields).media, C = X(
|
|
2892
2892
|
() => ({
|
|
2893
2893
|
id: t.name,
|
|
2894
2894
|
name: e || t.name,
|
|
@@ -2899,7 +2899,7 @@ const ho = s.object({
|
|
|
2899
2899
|
);
|
|
2900
2900
|
switch (V(() => {
|
|
2901
2901
|
if (t.type === "media") {
|
|
2902
|
-
const b =
|
|
2902
|
+
const b = ta(r) ? void 0 : r;
|
|
2903
2903
|
i(C.name, b, o);
|
|
2904
2904
|
}
|
|
2905
2905
|
}, [r]), t.type) {
|
|
@@ -3101,7 +3101,7 @@ const ho = s.object({
|
|
|
3101
3101
|
) }) })
|
|
3102
3102
|
] })
|
|
3103
3103
|
] }, "title") });
|
|
3104
|
-
}, Gt = (e, t) => t ? e.find((a) => a.value === t)?.label ?? "" : "",
|
|
3104
|
+
}, Gt = (e, t) => t ? e.find((a) => a.value === t)?.label ?? "" : "", Nn = ({
|
|
3105
3105
|
name: e,
|
|
3106
3106
|
onClear: t,
|
|
3107
3107
|
onChange: a,
|
|
@@ -3113,7 +3113,7 @@ const ho = s.object({
|
|
|
3113
3113
|
return V(() => {
|
|
3114
3114
|
c(Gt(o, i));
|
|
3115
3115
|
}, [i, o]), /* @__PURE__ */ n(
|
|
3116
|
-
|
|
3116
|
+
mn,
|
|
3117
3117
|
{
|
|
3118
3118
|
name: e,
|
|
3119
3119
|
autocomplete: "list",
|
|
@@ -3175,7 +3175,7 @@ const ho = s.object({
|
|
|
3175
3175
|
l("popup.item.form.relatedType.empty", "There are no more content types")
|
|
3176
3176
|
) : void 0,
|
|
3177
3177
|
children: /* @__PURE__ */ n(
|
|
3178
|
-
|
|
3178
|
+
Nn,
|
|
3179
3179
|
{
|
|
3180
3180
|
name: "relatedType",
|
|
3181
3181
|
onClear: () => i({
|
|
@@ -3248,7 +3248,7 @@ const ho = s.object({
|
|
|
3248
3248
|
{ contentTypeName: o.relatedType }
|
|
3249
3249
|
) : void 0,
|
|
3250
3250
|
children: /* @__PURE__ */ n(
|
|
3251
|
-
|
|
3251
|
+
Nn,
|
|
3252
3252
|
{
|
|
3253
3253
|
name: "related",
|
|
3254
3254
|
onClear: () => p("related", void 0, u),
|
|
@@ -3279,7 +3279,7 @@ const ho = s.object({
|
|
|
3279
3279
|
setFormValue: x,
|
|
3280
3280
|
setFormValueItem: M,
|
|
3281
3281
|
setFormValuesItems: _
|
|
3282
|
-
} = ki(), { encodePayload: re, decodePayload: Q } = Mi(), le = T.type === "INTERNAL", fe = le && !T.related && !v || u, ee =
|
|
3282
|
+
} = ki(), { encodePayload: re, decodePayload: Q } = Mi(), le = T.type === "INTERNAL", fe = le && !T.related && !v || u, ee = In({
|
|
3283
3283
|
uid: le ? T.relatedType : "",
|
|
3284
3284
|
locale: d
|
|
3285
3285
|
}), _e = async (G, R) => {
|
|
@@ -3355,7 +3355,7 @@ const ho = s.object({
|
|
|
3355
3355
|
);
|
|
3356
3356
|
}, [a]), /* @__PURE__ */ w(ie, { children: [
|
|
3357
3357
|
/* @__PURE__ */ n(H.Body, { children: /* @__PURE__ */ n(at, { width: "auto", height: "auto", method: "POST", initialValues: T, children: ({ values: G, onChange: R }) => /* @__PURE__ */ w(
|
|
3358
|
-
|
|
3358
|
+
Fn.Provider,
|
|
3359
3359
|
{
|
|
3360
3360
|
value: {
|
|
3361
3361
|
values: G,
|
|
@@ -3406,7 +3406,7 @@ const ho = s.object({
|
|
|
3406
3406
|
}
|
|
3407
3407
|
)
|
|
3408
3408
|
] }),
|
|
3409
|
-
G.type !== "INTERNAL" && /* @__PURE__ */ n(S.Root, { display: "none", children: /* @__PURE__ */ n(D, { display: "none", children: /* @__PURE__ */ n(
|
|
3409
|
+
G.type !== "INTERNAL" && /* @__PURE__ */ n(S.Root, { display: "none", children: /* @__PURE__ */ n(D, { display: "none", children: /* @__PURE__ */ n(mn, {}) }) }),
|
|
3410
3410
|
/* @__PURE__ */ n(Zi, {}),
|
|
3411
3411
|
/* @__PURE__ */ n(
|
|
3412
3412
|
Ji,
|
|
@@ -3697,7 +3697,7 @@ const ho = s.object({
|
|
|
3697
3697
|
e && u
|
|
3698
3698
|
] });
|
|
3699
3699
|
}, cr = new on(), ur = () => {
|
|
3700
|
-
const { formatMessage: e } = A(), t = Ft(), a = ne(), o =
|
|
3700
|
+
const { formatMessage: e } = A(), t = Ft(), a = ne(), o = vn(), { toggleNotification: i } = Oe(), [r, d] = N(), [c, m] = N(), [p, u] = N(!1), { canAccess: C, canUpdate: b, isLoadingForPermissions: v } = Do(), {
|
|
3701
3701
|
localeData: h,
|
|
3702
3702
|
currentLocale: f,
|
|
3703
3703
|
isChangeLanguageVisible: I,
|
|
@@ -3709,7 +3709,7 @@ const ho = s.object({
|
|
|
3709
3709
|
editNavigationItem: re,
|
|
3710
3710
|
closeNavigationItemPopup: Q,
|
|
3711
3711
|
isItemPopupVisible: le
|
|
3712
|
-
} = ko(b), fe =
|
|
3712
|
+
} = ko(b), fe = wn([t, { isPending: v }]), ee = Cn({
|
|
3713
3713
|
onError: (R) => {
|
|
3714
3714
|
i({
|
|
3715
3715
|
type: "danger",
|
|
@@ -3797,7 +3797,7 @@ const ho = s.object({
|
|
|
3797
3797
|
}
|
|
3798
3798
|
),
|
|
3799
3799
|
c?.items.length ? /* @__PURE__ */ n(
|
|
3800
|
-
|
|
3800
|
+
An,
|
|
3801
3801
|
{
|
|
3802
3802
|
items: G,
|
|
3803
3803
|
onItemLevelAdd: _,
|
|
@@ -3848,10 +3848,15 @@ const ho = s.object({
|
|
|
3848
3848
|
function pr() {
|
|
3849
3849
|
return /* @__PURE__ */ n(rn, { client: cr, children: /* @__PURE__ */ n(ur, {}) });
|
|
3850
3850
|
}
|
|
3851
|
-
const mr = () => /* @__PURE__ */ n(
|
|
3851
|
+
const mr = () => /* @__PURE__ */ n(Xn, { backend: Gn, children: /* @__PURE__ */ w(Zn, { children: [
|
|
3852
3852
|
/* @__PURE__ */ n(Mt, { path: "/", index: !0, Component: pr }),
|
|
3853
3853
|
/* @__PURE__ */ n(Mt, { path: "/*", Component: Te.Error })
|
|
3854
|
-
] }) }), gr =
|
|
3854
|
+
] }) }), gr = "3.3.6", hr = ["string", "boolean", "select", "media"], Je = {
|
|
3855
|
+
background: "neutral0",
|
|
3856
|
+
hasRadius: !0,
|
|
3857
|
+
shadow: "filterShadow",
|
|
3858
|
+
padding: 6
|
|
3859
|
+
}, fr = /^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i, yr = (e = "", t = {}) => {
|
|
3855
3860
|
const {
|
|
3856
3861
|
allowedContentTypes: a = [],
|
|
3857
3862
|
restrictedContentTypes: o = [],
|
|
@@ -3859,10 +3864,10 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3859
3864
|
preferCustomContentTypes: r = !1
|
|
3860
3865
|
} = t, c = (r ? ["api::", ...i] : a).filter((p) => e.includes(p) || e === p).length > 0, m = o.filter((p) => e.includes(p) || e === p).length === 0;
|
|
3861
3866
|
return !!e && c && m;
|
|
3862
|
-
},
|
|
3863
|
-
const t = (r) => r.split("-").map((d) => ln(d)).join(""), [a, o, i] =
|
|
3867
|
+
}, br = (e = "") => {
|
|
3868
|
+
const t = (r) => r.split("-").map((d) => ln(d)).join(""), [a, o, i] = Ir(e);
|
|
3864
3869
|
return a === "api" ? t(i) : `${t(o)}${t(i)}`;
|
|
3865
|
-
},
|
|
3870
|
+
}, Ir = (e = "") => e.split(fr).filter((t) => t && t.length > 0), Zt = "SERVER OFFLINE", Rn = (e, t) => new Promise((a) => {
|
|
3866
3871
|
fetch(`${window.strapi.backendURL}/_health`, {
|
|
3867
3872
|
method: "HEAD",
|
|
3868
3873
|
mode: "no-cors",
|
|
@@ -3877,7 +3882,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3877
3882
|
throw new Error(Zt);
|
|
3878
3883
|
a(e);
|
|
3879
3884
|
}).catch((o) => {
|
|
3880
|
-
setTimeout(() =>
|
|
3885
|
+
setTimeout(() => Rn(e, o.message !== Zt).then(
|
|
3881
3886
|
a
|
|
3882
3887
|
), 100);
|
|
3883
3888
|
});
|
|
@@ -3890,7 +3895,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3890
3895
|
},
|
|
3891
3896
|
staleTime: 1e3 * 60 * 5
|
|
3892
3897
|
});
|
|
3893
|
-
},
|
|
3898
|
+
}, Ln = () => {
|
|
3894
3899
|
const e = j(), t = B(e), a = Fe({
|
|
3895
3900
|
queryKey: t.healthCheckIndex(),
|
|
3896
3901
|
queryFn: () => t.healthCheck(),
|
|
@@ -3901,7 +3906,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3901
3906
|
return ge({
|
|
3902
3907
|
mutationFn: () => t.restart().then(() => a.refetch())
|
|
3903
3908
|
});
|
|
3904
|
-
},
|
|
3909
|
+
}, $n = () => {
|
|
3905
3910
|
const e = j(), t = B(e);
|
|
3906
3911
|
return ge({
|
|
3907
3912
|
mutationFn: () => t.restoreConfig()
|
|
@@ -3913,7 +3918,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3913
3918
|
queryFn: () => t.readContentType(),
|
|
3914
3919
|
staleTime: 1 / 0
|
|
3915
3920
|
});
|
|
3916
|
-
},
|
|
3921
|
+
}, Cr = () => {
|
|
3917
3922
|
const e = j(), t = B(e);
|
|
3918
3923
|
return ge({
|
|
3919
3924
|
mutationFn(a) {
|
|
@@ -3930,7 +3935,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3930
3935
|
),
|
|
3931
3936
|
additionalFields: a.audienceFieldChecked ? [...a.additionalFields, "audience"] : a.additionalFields,
|
|
3932
3937
|
gql: {
|
|
3933
|
-
navigationItemRelated: a.contentTypes.map((o) =>
|
|
3938
|
+
navigationItemRelated: a.contentTypes.map((o) => br(o))
|
|
3934
3939
|
}
|
|
3935
3940
|
});
|
|
3936
3941
|
}
|
|
@@ -3944,7 +3949,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3944
3949
|
key: i,
|
|
3945
3950
|
fields: r
|
|
3946
3951
|
})).concat(a);
|
|
3947
|
-
},
|
|
3952
|
+
}, vr = ({ config: e, setFormValue: t }) => {
|
|
3948
3953
|
V(() => {
|
|
3949
3954
|
if (e) {
|
|
3950
3955
|
const {
|
|
@@ -3964,12 +3969,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3964
3969
|
});
|
|
3965
3970
|
}
|
|
3966
3971
|
}, [e]);
|
|
3967
|
-
},
|
|
3968
|
-
background: "neutral0",
|
|
3969
|
-
hasRadius: !0,
|
|
3970
|
-
shadow: "filterShadow",
|
|
3971
|
-
padding: 6
|
|
3972
|
-
}, $n = tn({
|
|
3972
|
+
}, En = tn({
|
|
3973
3973
|
values: {},
|
|
3974
3974
|
onChange: () => null,
|
|
3975
3975
|
handleChange: () => null,
|
|
@@ -3977,81 +3977,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3977
3977
|
setRestartStatus: () => null,
|
|
3978
3978
|
renderError: () => "",
|
|
3979
3979
|
setFormValueItem: () => null
|
|
3980
|
-
}), Ne = () => nn(
|
|
3981
|
-
const { formatMessage: t } = A(), a = Ln(), { setRestartStatus: o } = Ne(), [i, r] = N(!1), d = async (c) => {
|
|
3982
|
-
r(!1), c && (a.mutate(), o({ required: !0 }));
|
|
3983
|
-
};
|
|
3984
|
-
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
3985
|
-
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: t(l("pages.settings.restoring.title")) }),
|
|
3986
|
-
/* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
3987
|
-
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(F, { children: t(l("pages.settings.actions.restore.description")) }) }),
|
|
3988
|
-
/* @__PURE__ */ w(S.Item, { col: 12, s: 12, xs: 12, children: [
|
|
3989
|
-
e && /* @__PURE__ */ n(
|
|
3990
|
-
K,
|
|
3991
|
-
{
|
|
3992
|
-
variant: "danger-light",
|
|
3993
|
-
startIcon: /* @__PURE__ */ n(Ge, {}),
|
|
3994
|
-
onClick: () => r(!0),
|
|
3995
|
-
children: t(l("pages.settings.actions.restore.label"))
|
|
3996
|
-
}
|
|
3997
|
-
),
|
|
3998
|
-
/* @__PURE__ */ n(
|
|
3999
|
-
lt,
|
|
4000
|
-
{
|
|
4001
|
-
isVisible: i,
|
|
4002
|
-
header: t(l("pages.settings.actions.restore.confirmation.header")),
|
|
4003
|
-
labelConfirm: t(
|
|
4004
|
-
l("pages.settings.actions.restore.confirmation.confirm")
|
|
4005
|
-
),
|
|
4006
|
-
iconConfirm: /* @__PURE__ */ n(Ra, {}),
|
|
4007
|
-
onConfirm: () => d(!0),
|
|
4008
|
-
onCancel: () => d(!1),
|
|
4009
|
-
children: t(l("pages.settings.actions.restore.confirmation.description"))
|
|
4010
|
-
}
|
|
4011
|
-
)
|
|
4012
|
-
] })
|
|
4013
|
-
] })
|
|
4014
|
-
] }) });
|
|
4015
|
-
}, Tr = oe(ua)`
|
|
4016
|
-
[role='status'] {
|
|
4017
|
-
flex-direction: column;
|
|
4018
|
-
}
|
|
4019
|
-
`, wr = ({ setIsReloading: e }) => {
|
|
4020
|
-
const { formatMessage: t } = A(), a = Rn(), { restartStatus: o, setRestartStatus: i } = Ne(), r = async () => {
|
|
4021
|
-
a.mutate(void 0, {
|
|
4022
|
-
onSuccess() {
|
|
4023
|
-
e(!0), Nn(!0).then((c) => {
|
|
4024
|
-
c && window.location.reload();
|
|
4025
|
-
});
|
|
4026
|
-
},
|
|
4027
|
-
onError() {
|
|
4028
|
-
i({ required: !1 });
|
|
4029
|
-
}
|
|
4030
|
-
});
|
|
4031
|
-
}, d = () => i({ required: !1 });
|
|
4032
|
-
return o.required ? /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ n(
|
|
4033
|
-
Tr,
|
|
4034
|
-
{
|
|
4035
|
-
closeLabel: t(l("pages.settings.actions.restart.alert.cancel")),
|
|
4036
|
-
title: t(l("pages.settings.actions.restart.alert.title")),
|
|
4037
|
-
action: /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(K, { onClick: r, startIcon: /* @__PURE__ */ n(La, {}), children: t(l("pages.settings.actions.restart.label")) }) }),
|
|
4038
|
-
onClose: d,
|
|
4039
|
-
children: /* @__PURE__ */ w(ie, { children: [
|
|
4040
|
-
/* @__PURE__ */ n(D, { paddingBottom: 1, children: t(l("pages.settings.actions.restart.alert.description")) }),
|
|
4041
|
-
o.reasons?.map((c, m) => /* @__PURE__ */ n(
|
|
4042
|
-
D,
|
|
4043
|
-
{
|
|
4044
|
-
paddingBottom: 1,
|
|
4045
|
-
children: t(
|
|
4046
|
-
l(`pages.settings.actions.restart.alert.reason.${c}`)
|
|
4047
|
-
)
|
|
4048
|
-
},
|
|
4049
|
-
m
|
|
4050
|
-
))
|
|
4051
|
-
] })
|
|
4052
|
-
}
|
|
4053
|
-
) }) : null;
|
|
4054
|
-
}, Sr = () => {
|
|
3980
|
+
}), Ne = () => nn(En), Tr = () => {
|
|
4055
3981
|
const e = Lt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r } = Ne();
|
|
4056
3982
|
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4057
3983
|
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: t(l("pages.settings.additional.title")) }),
|
|
@@ -4063,7 +3989,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4063
3989
|
label: t(l("pages.settings.form.allowedLevels.label")),
|
|
4064
3990
|
hint: t(l("pages.settings.form.allowedLevels.hint")),
|
|
4065
3991
|
children: /* @__PURE__ */ n(
|
|
4066
|
-
|
|
3992
|
+
ua,
|
|
4067
3993
|
{
|
|
4068
3994
|
width: "100%",
|
|
4069
3995
|
name: "allowedLevels",
|
|
@@ -4150,315 +4076,52 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4150
4076
|
) })
|
|
4151
4077
|
] })
|
|
4152
4078
|
] }) });
|
|
4153
|
-
},
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
).map((b) => {
|
|
4185
|
-
const v = t.data?.find((h) => h.uid === b.uid);
|
|
4186
|
-
if (v) {
|
|
4187
|
-
const { isDisplayed: h, kind: f } = v;
|
|
4188
|
-
return {
|
|
4189
|
-
...b,
|
|
4190
|
-
available: h,
|
|
4191
|
-
isSingle: f === "singleType"
|
|
4192
|
-
};
|
|
4079
|
+
}, Jt = /* @__PURE__ */ n($a, {}), wr = /* @__PURE__ */ n(wt, {}), ae = "pages.settings.form.customFields.table.", Sr = ({
|
|
4080
|
+
data: e = [],
|
|
4081
|
+
onOpenModal: t,
|
|
4082
|
+
onRemoveCustomField: a,
|
|
4083
|
+
onToggleCustomField: o
|
|
4084
|
+
}) => {
|
|
4085
|
+
const [i, r] = N(!1), [d, c] = N(null), { toggleNotification: m } = Oe(), p = X(() => Xe(e, "name"), [e]), { formatMessage: u } = A(), C = E(
|
|
4086
|
+
(h) => {
|
|
4087
|
+
c(h), r(!0);
|
|
4088
|
+
},
|
|
4089
|
+
[c, r]
|
|
4090
|
+
), b = E(() => {
|
|
4091
|
+
c(null), r(!1);
|
|
4092
|
+
}, [c, r]), v = E(() => {
|
|
4093
|
+
d === null ? m({
|
|
4094
|
+
type: "warning",
|
|
4095
|
+
message: u(l(`${ae}confirmation.error`))
|
|
4096
|
+
}) : a(d), b();
|
|
4097
|
+
}, [b, d, It, a, m]);
|
|
4098
|
+
return /* @__PURE__ */ w(ie, { children: [
|
|
4099
|
+
/* @__PURE__ */ n(
|
|
4100
|
+
lt,
|
|
4101
|
+
{
|
|
4102
|
+
isVisible: i,
|
|
4103
|
+
header: u(l(`${ae}confirmation.header`)),
|
|
4104
|
+
children: u(l(`${ae}confirmation.message`)),
|
|
4105
|
+
labelConfirm: u(l(`${ae}confirmation.confirm`)),
|
|
4106
|
+
iconConfirm: Jt,
|
|
4107
|
+
mainIcon: Jt,
|
|
4108
|
+
onConfirm: v,
|
|
4109
|
+
onCancel: b
|
|
4193
4110
|
}
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
hint: a(l("pages.settings.form.contentTypes.hint")),
|
|
4204
|
-
children: /* @__PURE__ */ n(
|
|
4205
|
-
De,
|
|
4206
|
-
{
|
|
4207
|
-
name: "contentTypes",
|
|
4208
|
-
label: a(l("pages.settings.form.contentTypes.label")),
|
|
4209
|
-
"aria-label": a(l("pages.settings.form.contentTypes.label")),
|
|
4210
|
-
placeholder: a(l("pages.settings.form.contentTypes.placeholder")),
|
|
4211
|
-
value: o.contentTypes,
|
|
4212
|
-
onChange: (b) => {
|
|
4213
|
-
r("contentTypes", b, i);
|
|
4214
|
-
const {
|
|
4215
|
-
contentTypesNameFields: v = [],
|
|
4216
|
-
contentTypesPopulate: h = [],
|
|
4217
|
-
pathDefaultFields: f = []
|
|
4218
|
-
} = o, I = b.filter(
|
|
4219
|
-
(T) => !v.find((L) => L.key === T)
|
|
4220
|
-
) ?? [], y = v.filter(
|
|
4221
|
-
(T) => !b.includes(T.key) || T.key === "default"
|
|
4222
|
-
).map(({ key: T }) => T) ?? [];
|
|
4223
|
-
c("contentTypesNameFields", [
|
|
4224
|
-
...v.filter(
|
|
4225
|
-
({ key: T }) => !y.includes(T) || T === "default"
|
|
4226
|
-
) ?? [],
|
|
4227
|
-
...I.map((T) => ({ key: T, fields: [] }))
|
|
4228
|
-
]), c("contentTypesPopulate", [
|
|
4229
|
-
...h.filter(
|
|
4230
|
-
({ key: T }) => !y.includes(T) || T === "default"
|
|
4231
|
-
) ?? [],
|
|
4232
|
-
...I.map((T) => ({ key: T, fields: [] }))
|
|
4233
|
-
]), c("pathDefaultFields", [
|
|
4234
|
-
...f.filter(
|
|
4235
|
-
({ key: T }) => !y.includes(T) || T === "default"
|
|
4236
|
-
) ?? [],
|
|
4237
|
-
...I.map((T) => ({ key: T, fields: [] }))
|
|
4238
|
-
]);
|
|
4239
|
-
},
|
|
4240
|
-
disabled: d.required,
|
|
4241
|
-
error: m("contentTypes"),
|
|
4242
|
-
withTags: !0,
|
|
4243
|
-
width: "100%",
|
|
4244
|
-
children: C.map((b) => /* @__PURE__ */ n(Ve, { value: b.uid, children: b.info.displayName }, b.uid))
|
|
4245
|
-
}
|
|
4246
|
-
)
|
|
4247
|
-
}
|
|
4248
|
-
) });
|
|
4249
|
-
}, Fr = () => {
|
|
4250
|
-
const e = dt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r, renderError: d } = Ne(), c = X(
|
|
4251
|
-
() => a.contentTypes?.map((m) => e.data?.find(({ uid: p }) => p === m)).filter(
|
|
4252
|
-
(m) => m !== void 0
|
|
4253
|
-
) || [],
|
|
4254
|
-
[a.contentTypes, e.data]
|
|
4255
|
-
);
|
|
4256
|
-
return V(() => {
|
|
4257
|
-
a.defaultContentType && (a.contentTypes.includes(a.defaultContentType) || i("defaultContentType", void 0, o));
|
|
4258
|
-
}, [a.contentTypes]), /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4259
|
-
$,
|
|
4260
|
-
{
|
|
4261
|
-
name: "defaultContentType",
|
|
4262
|
-
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
4263
|
-
hint: t(l("pages.settings.form.defaultContentType.hint")),
|
|
4264
|
-
children: /* @__PURE__ */ n(
|
|
4265
|
-
xe,
|
|
4266
|
-
{
|
|
4267
|
-
name: "defaultContentType",
|
|
4268
|
-
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
4269
|
-
"aria-label": t(l("pages.settings.form.defaultContentType.label")),
|
|
4270
|
-
placeholder: t(l("pages.settings.form.defaultContentType.placeholder")),
|
|
4271
|
-
value: a.defaultContentType,
|
|
4272
|
-
onChange: (m) => i("defaultContentType", m, o),
|
|
4273
|
-
onClear: () => i("defaultContentType", void 0, o),
|
|
4274
|
-
disabled: r.required,
|
|
4275
|
-
error: d("defaultContentType"),
|
|
4276
|
-
withTags: !0,
|
|
4277
|
-
width: "100%",
|
|
4278
|
-
children: c.map((m) => /* @__PURE__ */ n(Ae, { value: m.uid, children: m.info.displayName }, m.uid))
|
|
4279
|
-
}
|
|
4280
|
-
)
|
|
4281
|
-
}
|
|
4282
|
-
) });
|
|
4283
|
-
}, Nr = ["relation", "media", "component", "dynamiczone"], Rr = () => {
|
|
4284
|
-
const e = dt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r, renderError: d } = Ne(), {
|
|
4285
|
-
contentTypes: c,
|
|
4286
|
-
contentTypesNameFields: m
|
|
4287
|
-
} = a;
|
|
4288
|
-
return /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: c?.length ? /* @__PURE__ */ n(Ue.Root, { style: { width: "100%" }, children: m.map((p, u) => {
|
|
4289
|
-
const C = e.data?.find(({ uid: f }) => f === p.key), b = C?.attributes ?? {}, v = Object.keys(b).sort(), h = v.filter(
|
|
4290
|
-
(f) => Nr.includes(b[f]?.type)
|
|
4291
|
-
);
|
|
4292
|
-
return C ? /* @__PURE__ */ w(Ue.Item, { value: p.key, children: [
|
|
4293
|
-
/* @__PURE__ */ n(Ue.Header, { children: /* @__PURE__ */ n(Ue.Trigger, { children: C?.info.displayName ?? t(l("pages.settings.form.nameField.default")) }) }),
|
|
4294
|
-
/* @__PURE__ */ n(Ue.Content, { children: /* @__PURE__ */ w(S.Root, { gap: 4, padding: 2, children: [
|
|
4295
|
-
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4296
|
-
$,
|
|
4297
|
-
{
|
|
4298
|
-
name: `contentTypesNameFields[${u}]`,
|
|
4299
|
-
label: t(l("pages.settings.form.nameField.label")),
|
|
4300
|
-
hint: t(
|
|
4301
|
-
l(
|
|
4302
|
-
`pages.settings.form.nameField.${Y(J(a, `contentTypesNameFields[${u}].fields`, [])) ? "empty" : "hint"}`
|
|
4303
|
-
)
|
|
4304
|
-
),
|
|
4305
|
-
children: /* @__PURE__ */ n(
|
|
4306
|
-
De,
|
|
4307
|
-
{
|
|
4308
|
-
name: `contentTypesNameFields[${u}]`,
|
|
4309
|
-
placeholder: t(
|
|
4310
|
-
l("pages.settings.form.nameField.placeholder")
|
|
4311
|
-
),
|
|
4312
|
-
value: J(a, `contentTypesNameFields[${u}].fields`),
|
|
4313
|
-
onChange: (f) => {
|
|
4314
|
-
const I = J(a, "contentTypesNameFields", []).map(
|
|
4315
|
-
(y, T) => T === u ? {
|
|
4316
|
-
...y,
|
|
4317
|
-
fields: f
|
|
4318
|
-
} : y
|
|
4319
|
-
);
|
|
4320
|
-
return i("contentTypesNameFields", I, o);
|
|
4321
|
-
},
|
|
4322
|
-
disabled: r.required,
|
|
4323
|
-
error: d(`contentTypesNameFields[${u}]`),
|
|
4324
|
-
withTags: !0,
|
|
4325
|
-
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4326
|
-
}
|
|
4327
|
-
)
|
|
4328
|
-
}
|
|
4329
|
-
) }),
|
|
4330
|
-
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4331
|
-
$,
|
|
4332
|
-
{
|
|
4333
|
-
name: `contentTypesPopulate[${u - 1}]`,
|
|
4334
|
-
label: t(l("pages.settings.form.populate.label")),
|
|
4335
|
-
hint: t(
|
|
4336
|
-
l(
|
|
4337
|
-
`pages.settings.form.populate.${Y(J(a, `contentTypesPopulate[${u - 1}]fields`, [])) ? "empty" : "hint"}`
|
|
4338
|
-
)
|
|
4339
|
-
),
|
|
4340
|
-
children: /* @__PURE__ */ n(
|
|
4341
|
-
De,
|
|
4342
|
-
{
|
|
4343
|
-
width: "100%",
|
|
4344
|
-
name: `contentTypesPopulate[${u - 1}]`,
|
|
4345
|
-
placeholder: t(
|
|
4346
|
-
l("pages.settings.form.populate.placeholder")
|
|
4347
|
-
),
|
|
4348
|
-
value: J(a, `contentTypesPopulate[${u - 1}].fields`, []),
|
|
4349
|
-
onChange: (f) => {
|
|
4350
|
-
const I = J(a, "contentTypesPopulate", []).map(
|
|
4351
|
-
(y, T) => T === u - 1 ? {
|
|
4352
|
-
...y,
|
|
4353
|
-
fields: f
|
|
4354
|
-
} : y
|
|
4355
|
-
);
|
|
4356
|
-
return i("contentTypesPopulate", I, o);
|
|
4357
|
-
},
|
|
4358
|
-
disabled: r.required,
|
|
4359
|
-
error: d(`contentTypesPopulate[${u - 1}]`),
|
|
4360
|
-
withTags: !0,
|
|
4361
|
-
children: h.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4362
|
-
}
|
|
4363
|
-
)
|
|
4364
|
-
}
|
|
4365
|
-
) }),
|
|
4366
|
-
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4367
|
-
$,
|
|
4368
|
-
{
|
|
4369
|
-
name: `pathDefaultFields[${u - 1}]`,
|
|
4370
|
-
label: t(
|
|
4371
|
-
l("pages.settings.form.pathDefaultFields.label")
|
|
4372
|
-
),
|
|
4373
|
-
hint: t(
|
|
4374
|
-
l(
|
|
4375
|
-
`pages.settings.form.pathDefaultFields.${Y(J(a, `pathDefaultFields[${u - 1}].fields`, [])) ? "empty" : "hint"}`
|
|
4376
|
-
)
|
|
4377
|
-
),
|
|
4378
|
-
children: /* @__PURE__ */ n(
|
|
4379
|
-
De,
|
|
4380
|
-
{
|
|
4381
|
-
name: `pathDefaultFields[${u - 1}]`,
|
|
4382
|
-
width: "100%",
|
|
4383
|
-
placeholder: t(
|
|
4384
|
-
l("pages.settings.form.pathDefaultFields.placeholder")
|
|
4385
|
-
),
|
|
4386
|
-
value: J(a, `pathDefaultFields[${u - 1}].fields`, []),
|
|
4387
|
-
onChange: (f) => {
|
|
4388
|
-
const I = J(a, "pathDefaultFields", []).map((y, T) => T === u - 1 ? {
|
|
4389
|
-
...y,
|
|
4390
|
-
fields: f
|
|
4391
|
-
} : y);
|
|
4392
|
-
return i("pathDefaultFields", I, o);
|
|
4393
|
-
},
|
|
4394
|
-
disabled: r.required,
|
|
4395
|
-
error: d(`pathDefaultFields[${u - 1}]`),
|
|
4396
|
-
withTags: !0,
|
|
4397
|
-
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4398
|
-
}
|
|
4399
|
-
)
|
|
4400
|
-
}
|
|
4401
|
-
) })
|
|
4402
|
-
] }) })
|
|
4403
|
-
] }, p.key) : null;
|
|
4404
|
-
}) }) : null });
|
|
4405
|
-
}, Lr = () => {
|
|
4406
|
-
const { formatMessage: e } = A();
|
|
4407
|
-
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4408
|
-
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: e(l("pages.settings.general.title")) }),
|
|
4409
|
-
/* @__PURE__ */ n(S.Root, { gap: 4, width: "100%", children: /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
4410
|
-
/* @__PURE__ */ n(xr, {}),
|
|
4411
|
-
/* @__PURE__ */ n(Ar, {}),
|
|
4412
|
-
/* @__PURE__ */ n(Fr, {}),
|
|
4413
|
-
/* @__PURE__ */ n(Rr, {})
|
|
4414
|
-
] }) }) })
|
|
4415
|
-
] }) });
|
|
4416
|
-
}, Jt = /* @__PURE__ */ n(Pa, {}), $r = /* @__PURE__ */ n(wt, {}), ae = "pages.settings.form.customFields.table.", Er = ({
|
|
4417
|
-
data: e = [],
|
|
4418
|
-
onOpenModal: t,
|
|
4419
|
-
onRemoveCustomField: a,
|
|
4420
|
-
onToggleCustomField: o
|
|
4421
|
-
}) => {
|
|
4422
|
-
const [i, r] = N(!1), [d, c] = N(null), { toggleNotification: m } = Oe(), p = X(() => Xe(e, "name"), [e]), { formatMessage: u } = A(), C = E(
|
|
4423
|
-
(h) => {
|
|
4424
|
-
c(h), r(!0);
|
|
4425
|
-
},
|
|
4426
|
-
[c, r]
|
|
4427
|
-
), b = E(() => {
|
|
4428
|
-
c(null), r(!1);
|
|
4429
|
-
}, [c, r]), v = E(() => {
|
|
4430
|
-
d === null ? m({
|
|
4431
|
-
type: "warning",
|
|
4432
|
-
message: u(l(`${ae}confirmation.error`))
|
|
4433
|
-
}) : a(d), b();
|
|
4434
|
-
}, [b, d, It, a, m]);
|
|
4435
|
-
return /* @__PURE__ */ w(ie, { children: [
|
|
4436
|
-
/* @__PURE__ */ n(
|
|
4437
|
-
lt,
|
|
4438
|
-
{
|
|
4439
|
-
isVisible: i,
|
|
4440
|
-
header: u(l(`${ae}confirmation.header`)),
|
|
4441
|
-
children: u(l(`${ae}confirmation.message`)),
|
|
4442
|
-
labelConfirm: u(l(`${ae}confirmation.confirm`)),
|
|
4443
|
-
iconConfirm: Jt,
|
|
4444
|
-
mainIcon: Jt,
|
|
4445
|
-
onConfirm: v,
|
|
4446
|
-
onCancel: b
|
|
4447
|
-
}
|
|
4448
|
-
),
|
|
4449
|
-
/* @__PURE__ */ w(
|
|
4450
|
-
sn,
|
|
4451
|
-
{
|
|
4452
|
-
width: "100%",
|
|
4453
|
-
colCount: 4,
|
|
4454
|
-
rowCount: e.length + 1,
|
|
4455
|
-
footer: /* @__PURE__ */ n(
|
|
4456
|
-
ha,
|
|
4111
|
+
),
|
|
4112
|
+
/* @__PURE__ */ w(
|
|
4113
|
+
sn,
|
|
4114
|
+
{
|
|
4115
|
+
width: "100%",
|
|
4116
|
+
colCount: 4,
|
|
4117
|
+
rowCount: e.length + 1,
|
|
4118
|
+
footer: /* @__PURE__ */ n(
|
|
4119
|
+
ga,
|
|
4457
4120
|
{
|
|
4458
4121
|
onClick: (h) => {
|
|
4459
4122
|
h.preventDefault(), t(null);
|
|
4460
4123
|
},
|
|
4461
|
-
icon:
|
|
4124
|
+
icon: wr,
|
|
4462
4125
|
children: u(l(`${ae}footer`))
|
|
4463
4126
|
}
|
|
4464
4127
|
),
|
|
@@ -4468,7 +4131,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4468
4131
|
/* @__PURE__ */ n(ce, { width: "60%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.label`)) }) }),
|
|
4469
4132
|
/* @__PURE__ */ n(ce, { width: "15%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.type`)) }) }),
|
|
4470
4133
|
/* @__PURE__ */ n(ce, { width: "5%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.required`)) }) }),
|
|
4471
|
-
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(
|
|
4134
|
+
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(pa, {}) })
|
|
4472
4135
|
] }) }),
|
|
4473
4136
|
/* @__PURE__ */ n(cn, { children: p.map(
|
|
4474
4137
|
(h) => typeof h != "string" ? /* @__PURE__ */ w(et, { children: [
|
|
@@ -4476,15 +4139,15 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4476
4139
|
/* @__PURE__ */ n(ue, { width: "60%", children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.label }) }),
|
|
4477
4140
|
/* @__PURE__ */ n(ue, { width: "15%", children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.type }) }),
|
|
4478
4141
|
/* @__PURE__ */ n(ue, { width: "5%", children: /* @__PURE__ */ n(
|
|
4479
|
-
|
|
4142
|
+
ma,
|
|
4480
4143
|
{
|
|
4481
4144
|
description: u(
|
|
4482
4145
|
l(`${ae}${h.required ? "required" : "notRequired"}`)
|
|
4483
4146
|
),
|
|
4484
|
-
children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.required ? /* @__PURE__ */ n(Ge, {}) : /* @__PURE__ */ n(
|
|
4147
|
+
children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.required ? /* @__PURE__ */ n(Ge, {}) : /* @__PURE__ */ n(Ra, {}) })
|
|
4485
4148
|
}
|
|
4486
4149
|
) }),
|
|
4487
|
-
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(P, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ w(
|
|
4150
|
+
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(P, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ w(pn, { children: [
|
|
4488
4151
|
/* @__PURE__ */ n(
|
|
4489
4152
|
ye,
|
|
4490
4153
|
{
|
|
@@ -4493,7 +4156,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4493
4156
|
l(`${ae}${h.enabled ? "disable" : "enable"}`)
|
|
4494
4157
|
),
|
|
4495
4158
|
variant: h.enabled ? "success-light" : "tertiary",
|
|
4496
|
-
children: h.enabled ? /* @__PURE__ */ n(
|
|
4159
|
+
children: h.enabled ? /* @__PURE__ */ n(gn, {}) : /* @__PURE__ */ n(La, {}),
|
|
4497
4160
|
style: { minWidth: 50 }
|
|
4498
4161
|
}
|
|
4499
4162
|
),
|
|
@@ -4522,15 +4185,15 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4522
4185
|
}
|
|
4523
4186
|
)
|
|
4524
4187
|
] });
|
|
4525
|
-
},
|
|
4188
|
+
}, xr = ({ onChange: e, initialValue: t, ...a }) => {
|
|
4526
4189
|
const [o, i] = N(
|
|
4527
|
-
|
|
4190
|
+
na(t) ? t.join(";") : ""
|
|
4528
4191
|
);
|
|
4529
4192
|
return /* @__PURE__ */ n(we, { ...a, onChange: (d) => {
|
|
4530
4193
|
const c = d?.target.value ?? "", m = c.split(";").map((p) => p.trim()).filter((p) => !!p.length);
|
|
4531
4194
|
i(c ?? ""), e(m);
|
|
4532
4195
|
}, value: o });
|
|
4533
|
-
}, O = "pages.settings.form.customFields.popup.",
|
|
4196
|
+
}, O = "pages.settings.form.customFields.popup.", Ar = (e) => e.map((t, a) => ({
|
|
4534
4197
|
key: `${t}-${a}`,
|
|
4535
4198
|
metadatas: {
|
|
4536
4199
|
intlLabel: {
|
|
@@ -4542,13 +4205,13 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4542
4205
|
},
|
|
4543
4206
|
value: t,
|
|
4544
4207
|
label: t
|
|
4545
|
-
})),
|
|
4208
|
+
})), Fr = ({
|
|
4546
4209
|
isEditForm: e,
|
|
4547
4210
|
customField: t,
|
|
4548
4211
|
onSubmit: a,
|
|
4549
4212
|
onClose: o
|
|
4550
4213
|
}) => {
|
|
4551
|
-
const i =
|
|
4214
|
+
const i = Ar(hr), { formatMessage: r } = A(), [d, c] = N(
|
|
4552
4215
|
t ? {
|
|
4553
4216
|
...t
|
|
4554
4217
|
} : {
|
|
@@ -4589,7 +4252,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4589
4252
|
if (I)
|
|
4590
4253
|
return r(l(`${O}${f}.${I}`));
|
|
4591
4254
|
}, h = (f, I) => {
|
|
4592
|
-
const { success: y, data: T, error: L } =
|
|
4255
|
+
const { success: y, data: T, error: L } = hn.safeParse(I);
|
|
4593
4256
|
y ? a(T) : L && p(
|
|
4594
4257
|
L.issues.reduce((z, k) => ({
|
|
4595
4258
|
...z,
|
|
@@ -4731,7 +4394,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4731
4394
|
hint: r(l(`${O}options.description`)),
|
|
4732
4395
|
error: v("options"),
|
|
4733
4396
|
children: /* @__PURE__ */ n(
|
|
4734
|
-
|
|
4397
|
+
xr,
|
|
4735
4398
|
{
|
|
4736
4399
|
name: "options",
|
|
4737
4400
|
onChange: (y) => C("options", y, I),
|
|
@@ -4768,7 +4431,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4768
4431
|
/* @__PURE__ */ n(K, { onClick: (f) => h(f, d), children: r(l("popup.item.form.button.save")) })
|
|
4769
4432
|
] })
|
|
4770
4433
|
] });
|
|
4771
|
-
},
|
|
4434
|
+
}, Nr = ({
|
|
4772
4435
|
isOpen: e,
|
|
4773
4436
|
onClose: t,
|
|
4774
4437
|
onSubmit: a,
|
|
@@ -4800,7 +4463,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4800
4463
|
}
|
|
4801
4464
|
) }),
|
|
4802
4465
|
/* @__PURE__ */ n(
|
|
4803
|
-
|
|
4466
|
+
Fr,
|
|
4804
4467
|
{
|
|
4805
4468
|
isEditForm: i,
|
|
4806
4469
|
customField: o,
|
|
@@ -4811,7 +4474,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4811
4474
|
] })
|
|
4812
4475
|
}
|
|
4813
4476
|
);
|
|
4814
|
-
},
|
|
4477
|
+
}, Rr = () => {
|
|
4815
4478
|
const { formatMessage: e } = A(), {
|
|
4816
4479
|
values: { additionalFields: t },
|
|
4817
4480
|
setFormValueItem: a
|
|
@@ -4841,7 +4504,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4841
4504
|
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: e(l("pages.settings.customFields.title")) }),
|
|
4842
4505
|
/* @__PURE__ */ n(D, { padding: 1 }),
|
|
4843
4506
|
/* @__PURE__ */ n(
|
|
4844
|
-
|
|
4507
|
+
Sr,
|
|
4845
4508
|
{
|
|
4846
4509
|
data: t,
|
|
4847
4510
|
onOpenModal: c,
|
|
@@ -4850,7 +4513,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4850
4513
|
}
|
|
4851
4514
|
),
|
|
4852
4515
|
o && /* @__PURE__ */ n(
|
|
4853
|
-
|
|
4516
|
+
Nr,
|
|
4854
4517
|
{
|
|
4855
4518
|
onClose: () => i(!1),
|
|
4856
4519
|
onSubmit: u,
|
|
@@ -4859,7 +4522,344 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4859
4522
|
}
|
|
4860
4523
|
)
|
|
4861
4524
|
] });
|
|
4862
|
-
},
|
|
4525
|
+
}, Lr = () => {
|
|
4526
|
+
const { formatMessage: e } = A(), { values: t, onChange: a, handleChange: o, restartStatus: i } = Ne();
|
|
4527
|
+
return /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4528
|
+
$,
|
|
4529
|
+
{
|
|
4530
|
+
name: "preferCustomContentTypes",
|
|
4531
|
+
label: e(l("pages.settings.form.preferCustomContentTypes.label")),
|
|
4532
|
+
hint: e(l("pages.settings.form.preferCustomContentTypes.hint")),
|
|
4533
|
+
children: /* @__PURE__ */ n(
|
|
4534
|
+
me,
|
|
4535
|
+
{
|
|
4536
|
+
name: "preferCustomContentTypes",
|
|
4537
|
+
checked: t.preferCustomContentTypes,
|
|
4538
|
+
onChange: (r) => o(r, !t.preferCustomContentTypes, a),
|
|
4539
|
+
onLabel: e(l("components.toggle.enabled")),
|
|
4540
|
+
offLabel: e(l("components.toggle.disabled")),
|
|
4541
|
+
disabled: i.required,
|
|
4542
|
+
width: "100%"
|
|
4543
|
+
}
|
|
4544
|
+
)
|
|
4545
|
+
}
|
|
4546
|
+
) });
|
|
4547
|
+
}, $r = () => {
|
|
4548
|
+
const e = Lt(), t = dt(), { formatMessage: a } = A(), { values: o, onChange: i, handleChange: r, restartStatus: d, setFormValueItem: c, renderError: m } = Ne(), { contentTypes: p, preferCustomContentTypes: u } = o, C = Xe(
|
|
4549
|
+
Object.values(t.data ?? []).filter(
|
|
4550
|
+
({ uid: b }) => yr(b, {
|
|
4551
|
+
allowedContentTypes: e.data?.allowedContentTypes,
|
|
4552
|
+
restrictedContentTypes: e.data?.restrictedContentTypes,
|
|
4553
|
+
preferCustomContentTypes: u,
|
|
4554
|
+
contentTypes: p
|
|
4555
|
+
})
|
|
4556
|
+
).map((b) => {
|
|
4557
|
+
const v = t.data?.find((h) => h.uid === b.uid);
|
|
4558
|
+
if (v) {
|
|
4559
|
+
const { isDisplayed: h, kind: f } = v;
|
|
4560
|
+
return {
|
|
4561
|
+
...b,
|
|
4562
|
+
available: h,
|
|
4563
|
+
isSingle: f === "singleType"
|
|
4564
|
+
};
|
|
4565
|
+
}
|
|
4566
|
+
return b;
|
|
4567
|
+
}),
|
|
4568
|
+
(b) => b.info.displayName
|
|
4569
|
+
);
|
|
4570
|
+
return /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4571
|
+
$,
|
|
4572
|
+
{
|
|
4573
|
+
name: "contentTypes",
|
|
4574
|
+
label: a(l("pages.settings.form.contentTypes.label")),
|
|
4575
|
+
hint: a(l("pages.settings.form.contentTypes.hint")),
|
|
4576
|
+
children: /* @__PURE__ */ n(
|
|
4577
|
+
De,
|
|
4578
|
+
{
|
|
4579
|
+
name: "contentTypes",
|
|
4580
|
+
label: a(l("pages.settings.form.contentTypes.label")),
|
|
4581
|
+
"aria-label": a(l("pages.settings.form.contentTypes.label")),
|
|
4582
|
+
placeholder: a(l("pages.settings.form.contentTypes.placeholder")),
|
|
4583
|
+
value: o.contentTypes,
|
|
4584
|
+
onChange: (b) => {
|
|
4585
|
+
r("contentTypes", b, i);
|
|
4586
|
+
const {
|
|
4587
|
+
contentTypesNameFields: v = [],
|
|
4588
|
+
contentTypesPopulate: h = [],
|
|
4589
|
+
pathDefaultFields: f = []
|
|
4590
|
+
} = o, I = b.filter(
|
|
4591
|
+
(T) => !v.find((L) => L.key === T)
|
|
4592
|
+
) ?? [], y = v.filter(
|
|
4593
|
+
(T) => !b.includes(T.key) || T.key === "default"
|
|
4594
|
+
).map(({ key: T }) => T) ?? [];
|
|
4595
|
+
c("contentTypesNameFields", [
|
|
4596
|
+
...v.filter(
|
|
4597
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4598
|
+
) ?? [],
|
|
4599
|
+
...I.map((T) => ({ key: T, fields: [] }))
|
|
4600
|
+
]), c("contentTypesPopulate", [
|
|
4601
|
+
...h.filter(
|
|
4602
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4603
|
+
) ?? [],
|
|
4604
|
+
...I.map((T) => ({ key: T, fields: [] }))
|
|
4605
|
+
]), c("pathDefaultFields", [
|
|
4606
|
+
...f.filter(
|
|
4607
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4608
|
+
) ?? [],
|
|
4609
|
+
...I.map((T) => ({ key: T, fields: [] }))
|
|
4610
|
+
]);
|
|
4611
|
+
},
|
|
4612
|
+
disabled: d.required,
|
|
4613
|
+
error: m("contentTypes"),
|
|
4614
|
+
withTags: !0,
|
|
4615
|
+
width: "100%",
|
|
4616
|
+
children: C.map((b) => /* @__PURE__ */ n(Ve, { value: b.uid, children: b.info.displayName }, b.uid))
|
|
4617
|
+
}
|
|
4618
|
+
)
|
|
4619
|
+
}
|
|
4620
|
+
) });
|
|
4621
|
+
}, Er = () => {
|
|
4622
|
+
const e = dt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r, renderError: d } = Ne(), c = X(
|
|
4623
|
+
() => a.contentTypes?.map((m) => e.data?.find(({ uid: p }) => p === m)).filter(
|
|
4624
|
+
(m) => m !== void 0
|
|
4625
|
+
) || [],
|
|
4626
|
+
[a.contentTypes, e.data]
|
|
4627
|
+
);
|
|
4628
|
+
return V(() => {
|
|
4629
|
+
a.defaultContentType && (a.contentTypes.includes(a.defaultContentType) || i("defaultContentType", void 0, o));
|
|
4630
|
+
}, [a.contentTypes]), /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4631
|
+
$,
|
|
4632
|
+
{
|
|
4633
|
+
name: "defaultContentType",
|
|
4634
|
+
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
4635
|
+
hint: t(l("pages.settings.form.defaultContentType.hint")),
|
|
4636
|
+
children: /* @__PURE__ */ n(
|
|
4637
|
+
xe,
|
|
4638
|
+
{
|
|
4639
|
+
name: "defaultContentType",
|
|
4640
|
+
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
4641
|
+
"aria-label": t(l("pages.settings.form.defaultContentType.label")),
|
|
4642
|
+
placeholder: t(l("pages.settings.form.defaultContentType.placeholder")),
|
|
4643
|
+
value: a.defaultContentType,
|
|
4644
|
+
onChange: (m) => i("defaultContentType", m, o),
|
|
4645
|
+
onClear: () => i("defaultContentType", void 0, o),
|
|
4646
|
+
disabled: r.required,
|
|
4647
|
+
error: d("defaultContentType"),
|
|
4648
|
+
withTags: !0,
|
|
4649
|
+
width: "100%",
|
|
4650
|
+
children: c.map((m) => /* @__PURE__ */ n(Ae, { value: m.uid, children: m.info.displayName }, m.uid))
|
|
4651
|
+
}
|
|
4652
|
+
)
|
|
4653
|
+
}
|
|
4654
|
+
) });
|
|
4655
|
+
}, Pr = ["relation", "media", "component", "dynamiczone"], Mr = () => {
|
|
4656
|
+
const e = dt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r, renderError: d } = Ne(), {
|
|
4657
|
+
contentTypes: c,
|
|
4658
|
+
contentTypesNameFields: m
|
|
4659
|
+
} = a;
|
|
4660
|
+
return /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: c?.length ? /* @__PURE__ */ n(Ue.Root, { style: { width: "100%" }, children: m.map((p, u) => {
|
|
4661
|
+
const C = e.data?.find(({ uid: f }) => f === p.key), b = C?.attributes ?? {}, v = Object.keys(b).sort(), h = v.filter(
|
|
4662
|
+
(f) => Pr.includes(b[f]?.type)
|
|
4663
|
+
);
|
|
4664
|
+
return C ? /* @__PURE__ */ w(Ue.Item, { value: p.key, children: [
|
|
4665
|
+
/* @__PURE__ */ n(Ue.Header, { children: /* @__PURE__ */ n(Ue.Trigger, { children: C?.info.displayName ?? t(l("pages.settings.form.nameField.default")) }) }),
|
|
4666
|
+
/* @__PURE__ */ n(Ue.Content, { children: /* @__PURE__ */ w(S.Root, { gap: 4, padding: 2, children: [
|
|
4667
|
+
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4668
|
+
$,
|
|
4669
|
+
{
|
|
4670
|
+
name: `contentTypesNameFields[${u}]`,
|
|
4671
|
+
label: t(l("pages.settings.form.nameField.label")),
|
|
4672
|
+
hint: t(
|
|
4673
|
+
l(
|
|
4674
|
+
`pages.settings.form.nameField.${Y(J(a, `contentTypesNameFields[${u}].fields`, [])) ? "empty" : "hint"}`
|
|
4675
|
+
)
|
|
4676
|
+
),
|
|
4677
|
+
children: /* @__PURE__ */ n(
|
|
4678
|
+
De,
|
|
4679
|
+
{
|
|
4680
|
+
name: `contentTypesNameFields[${u}]`,
|
|
4681
|
+
placeholder: t(
|
|
4682
|
+
l("pages.settings.form.nameField.placeholder")
|
|
4683
|
+
),
|
|
4684
|
+
value: J(a, `contentTypesNameFields[${u}].fields`),
|
|
4685
|
+
onChange: (f) => {
|
|
4686
|
+
const I = J(a, "contentTypesNameFields", []).map(
|
|
4687
|
+
(y, T) => T === u ? {
|
|
4688
|
+
...y,
|
|
4689
|
+
fields: f
|
|
4690
|
+
} : y
|
|
4691
|
+
);
|
|
4692
|
+
return i("contentTypesNameFields", I, o);
|
|
4693
|
+
},
|
|
4694
|
+
disabled: r.required,
|
|
4695
|
+
error: d(`contentTypesNameFields[${u}]`),
|
|
4696
|
+
withTags: !0,
|
|
4697
|
+
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4698
|
+
}
|
|
4699
|
+
)
|
|
4700
|
+
}
|
|
4701
|
+
) }),
|
|
4702
|
+
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4703
|
+
$,
|
|
4704
|
+
{
|
|
4705
|
+
name: `contentTypesPopulate[${u - 1}]`,
|
|
4706
|
+
label: t(l("pages.settings.form.populate.label")),
|
|
4707
|
+
hint: t(
|
|
4708
|
+
l(
|
|
4709
|
+
`pages.settings.form.populate.${Y(J(a, `contentTypesPopulate[${u - 1}]fields`, [])) ? "empty" : "hint"}`
|
|
4710
|
+
)
|
|
4711
|
+
),
|
|
4712
|
+
children: /* @__PURE__ */ n(
|
|
4713
|
+
De,
|
|
4714
|
+
{
|
|
4715
|
+
width: "100%",
|
|
4716
|
+
name: `contentTypesPopulate[${u - 1}]`,
|
|
4717
|
+
placeholder: t(
|
|
4718
|
+
l("pages.settings.form.populate.placeholder")
|
|
4719
|
+
),
|
|
4720
|
+
value: J(a, `contentTypesPopulate[${u - 1}].fields`, []),
|
|
4721
|
+
onChange: (f) => {
|
|
4722
|
+
const I = J(a, "contentTypesPopulate", []).map(
|
|
4723
|
+
(y, T) => T === u - 1 ? {
|
|
4724
|
+
...y,
|
|
4725
|
+
fields: f
|
|
4726
|
+
} : y
|
|
4727
|
+
);
|
|
4728
|
+
return i("contentTypesPopulate", I, o);
|
|
4729
|
+
},
|
|
4730
|
+
disabled: r.required,
|
|
4731
|
+
error: d(`contentTypesPopulate[${u - 1}]`),
|
|
4732
|
+
withTags: !0,
|
|
4733
|
+
children: h.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4734
|
+
}
|
|
4735
|
+
)
|
|
4736
|
+
}
|
|
4737
|
+
) }),
|
|
4738
|
+
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4739
|
+
$,
|
|
4740
|
+
{
|
|
4741
|
+
name: `pathDefaultFields[${u - 1}]`,
|
|
4742
|
+
label: t(
|
|
4743
|
+
l("pages.settings.form.pathDefaultFields.label")
|
|
4744
|
+
),
|
|
4745
|
+
hint: t(
|
|
4746
|
+
l(
|
|
4747
|
+
`pages.settings.form.pathDefaultFields.${Y(J(a, `pathDefaultFields[${u - 1}].fields`, [])) ? "empty" : "hint"}`
|
|
4748
|
+
)
|
|
4749
|
+
),
|
|
4750
|
+
children: /* @__PURE__ */ n(
|
|
4751
|
+
De,
|
|
4752
|
+
{
|
|
4753
|
+
name: `pathDefaultFields[${u - 1}]`,
|
|
4754
|
+
width: "100%",
|
|
4755
|
+
placeholder: t(
|
|
4756
|
+
l("pages.settings.form.pathDefaultFields.placeholder")
|
|
4757
|
+
),
|
|
4758
|
+
value: J(a, `pathDefaultFields[${u - 1}].fields`, []),
|
|
4759
|
+
onChange: (f) => {
|
|
4760
|
+
const I = J(a, "pathDefaultFields", []).map((y, T) => T === u - 1 ? {
|
|
4761
|
+
...y,
|
|
4762
|
+
fields: f
|
|
4763
|
+
} : y);
|
|
4764
|
+
return i("pathDefaultFields", I, o);
|
|
4765
|
+
},
|
|
4766
|
+
disabled: r.required,
|
|
4767
|
+
error: d(`pathDefaultFields[${u - 1}]`),
|
|
4768
|
+
withTags: !0,
|
|
4769
|
+
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4770
|
+
}
|
|
4771
|
+
)
|
|
4772
|
+
}
|
|
4773
|
+
) })
|
|
4774
|
+
] }) })
|
|
4775
|
+
] }, p.key) : null;
|
|
4776
|
+
}) }) : null });
|
|
4777
|
+
}, kr = () => {
|
|
4778
|
+
const { formatMessage: e } = A();
|
|
4779
|
+
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4780
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: e(l("pages.settings.general.title")) }),
|
|
4781
|
+
/* @__PURE__ */ n(S.Root, { gap: 4, width: "100%", children: /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
4782
|
+
/* @__PURE__ */ n(Lr, {}),
|
|
4783
|
+
/* @__PURE__ */ n($r, {}),
|
|
4784
|
+
/* @__PURE__ */ n(Er, {}),
|
|
4785
|
+
/* @__PURE__ */ n(Mr, {})
|
|
4786
|
+
] }) }) })
|
|
4787
|
+
] }) });
|
|
4788
|
+
}, qr = oe(ha)`
|
|
4789
|
+
[role='status'] {
|
|
4790
|
+
flex-direction: column;
|
|
4791
|
+
}
|
|
4792
|
+
`, Dr = ({ setIsReloading: e }) => {
|
|
4793
|
+
const { formatMessage: t } = A(), a = Ln(), { restartStatus: o, setRestartStatus: i } = Ne(), r = async () => {
|
|
4794
|
+
a.mutate(void 0, {
|
|
4795
|
+
onSuccess() {
|
|
4796
|
+
e(!0), Rn(!0).then((c) => {
|
|
4797
|
+
c && window.location.reload();
|
|
4798
|
+
});
|
|
4799
|
+
},
|
|
4800
|
+
onError() {
|
|
4801
|
+
i({ required: !1 });
|
|
4802
|
+
}
|
|
4803
|
+
});
|
|
4804
|
+
}, d = () => i({ required: !1 });
|
|
4805
|
+
return o.required ? /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ n(
|
|
4806
|
+
qr,
|
|
4807
|
+
{
|
|
4808
|
+
closeLabel: t(l("pages.settings.actions.restart.alert.cancel")),
|
|
4809
|
+
title: t(l("pages.settings.actions.restart.alert.title")),
|
|
4810
|
+
action: /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(K, { onClick: r, startIcon: /* @__PURE__ */ n(Ea, {}), children: t(l("pages.settings.actions.restart.label")) }) }),
|
|
4811
|
+
onClose: d,
|
|
4812
|
+
children: /* @__PURE__ */ w(ie, { children: [
|
|
4813
|
+
/* @__PURE__ */ n(D, { paddingBottom: 1, children: t(l("pages.settings.actions.restart.alert.description")) }),
|
|
4814
|
+
o.reasons?.map((c, m) => /* @__PURE__ */ n(
|
|
4815
|
+
D,
|
|
4816
|
+
{
|
|
4817
|
+
paddingBottom: 1,
|
|
4818
|
+
children: t(
|
|
4819
|
+
l(`pages.settings.actions.restart.alert.reason.${c}`)
|
|
4820
|
+
)
|
|
4821
|
+
},
|
|
4822
|
+
m
|
|
4823
|
+
))
|
|
4824
|
+
] })
|
|
4825
|
+
}
|
|
4826
|
+
) }) : null;
|
|
4827
|
+
}, Vr = ({ hasSettingsReadPermissions: e }) => {
|
|
4828
|
+
const { formatMessage: t } = A(), a = $n(), { setRestartStatus: o } = Ne(), [i, r] = N(!1), d = async (c) => {
|
|
4829
|
+
r(!1), c && (a.mutate(), o({ required: !0 }));
|
|
4830
|
+
};
|
|
4831
|
+
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4832
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: t(l("pages.settings.restoring.title")) }),
|
|
4833
|
+
/* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
4834
|
+
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(F, { children: t(l("pages.settings.actions.restore.description")) }) }),
|
|
4835
|
+
/* @__PURE__ */ w(S.Item, { col: 12, s: 12, xs: 12, children: [
|
|
4836
|
+
e && /* @__PURE__ */ n(
|
|
4837
|
+
K,
|
|
4838
|
+
{
|
|
4839
|
+
variant: "danger-light",
|
|
4840
|
+
startIcon: /* @__PURE__ */ n(Ge, {}),
|
|
4841
|
+
onClick: () => r(!0),
|
|
4842
|
+
children: t(l("pages.settings.actions.restore.label"))
|
|
4843
|
+
}
|
|
4844
|
+
),
|
|
4845
|
+
/* @__PURE__ */ n(
|
|
4846
|
+
lt,
|
|
4847
|
+
{
|
|
4848
|
+
isVisible: i,
|
|
4849
|
+
header: t(l("pages.settings.actions.restore.confirmation.header")),
|
|
4850
|
+
labelConfirm: t(
|
|
4851
|
+
l("pages.settings.actions.restore.confirmation.confirm")
|
|
4852
|
+
),
|
|
4853
|
+
iconConfirm: /* @__PURE__ */ n(Pa, {}),
|
|
4854
|
+
onConfirm: () => d(!0),
|
|
4855
|
+
onCancel: () => d(!1),
|
|
4856
|
+
children: t(l("pages.settings.actions.restore.confirmation.description"))
|
|
4857
|
+
}
|
|
4858
|
+
)
|
|
4859
|
+
] })
|
|
4860
|
+
] })
|
|
4861
|
+
] }) });
|
|
4862
|
+
}, jr = Qa.omit({ contentTypesNameFields: !0 }).extend({
|
|
4863
4863
|
audienceFieldChecked: g.boolean(),
|
|
4864
4864
|
contentTypesNameFields: g.object({
|
|
4865
4865
|
key: g.string(),
|
|
@@ -4873,8 +4873,8 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4873
4873
|
key: g.string(),
|
|
4874
4874
|
fields: g.string().array()
|
|
4875
4875
|
}).array()
|
|
4876
|
-
}), Yt = new on(),
|
|
4877
|
-
const e = Lt(), t = dt(), a =
|
|
4876
|
+
}), Br = gr, Yt = new on(), Or = () => {
|
|
4877
|
+
const e = Lt(), t = dt(), a = Cr(), o = $n(), i = Ln(), { formatMessage: r } = A(), [d, c] = N({ required: !1 }), [m, p] = N(!1), u = Kn("SettingsPage", (x) => x.permissions), C = X(() => !!u.find(({ action: x }) => x === $e.settings[0].action), [u]), b = X(() => !!u.find(({ action: x }) => x === $e.access[0].action), [u]), v = e.isPending || t.isPending || a.isPending || i.isPending || o.isPending, [h, f] = N({}), [I, y] = N(), T = (x, M, _) => {
|
|
4878
4878
|
if (_) {
|
|
4879
4879
|
let re = x, Q = M;
|
|
4880
4880
|
if (He(x)) {
|
|
@@ -4897,7 +4897,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4897
4897
|
if (J(I, x))
|
|
4898
4898
|
return r(l(x));
|
|
4899
4899
|
}, k = (x, M) => {
|
|
4900
|
-
const { success: _, data: re, error: Q } =
|
|
4900
|
+
const { success: _, data: re, error: Q } = jr.safeParse(M);
|
|
4901
4901
|
_ ? a.mutate(re, {
|
|
4902
4902
|
onSuccess() {
|
|
4903
4903
|
c({ required: !0 }), a.reset();
|
|
@@ -4909,13 +4909,19 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4909
4909
|
}), {})
|
|
4910
4910
|
), console.warn("Invalid form data", Q));
|
|
4911
4911
|
};
|
|
4912
|
-
return
|
|
4912
|
+
return vr({ config: e.data, setFormValue: f }), C ? v || m ? /* @__PURE__ */ n(Te.Loading, {}) : /* @__PURE__ */ n(qe.Root, { children: /* @__PURE__ */ w(Te.Main, { children: [
|
|
4913
4913
|
/* @__PURE__ */ n(Te.Title, { children: r(l("pages.settings.header.title")) }),
|
|
4914
4914
|
/* @__PURE__ */ n(
|
|
4915
4915
|
qe.Header,
|
|
4916
4916
|
{
|
|
4917
4917
|
title: r(l("pages.settings.header.title")),
|
|
4918
|
-
subtitle:
|
|
4918
|
+
subtitle: /* @__PURE__ */ w(P, { direction: "row", gap: 3, alignItems: "center", justifyContent: "space-between", children: [
|
|
4919
|
+
/* @__PURE__ */ n(F, { variant: "epsilon", textColor: "neutral600", tag: "p", children: r(l("pages.settings.header.description")) }),
|
|
4920
|
+
/* @__PURE__ */ n(un, { color: "neutral", minWidth: "fit-content", children: /* @__PURE__ */ w("span", { style: { textTransform: "none" }, children: [
|
|
4921
|
+
"v",
|
|
4922
|
+
Br
|
|
4923
|
+
] }) })
|
|
4924
|
+
] }),
|
|
4919
4925
|
primaryAction: b ? /* @__PURE__ */ n(
|
|
4920
4926
|
K,
|
|
4921
4927
|
{
|
|
@@ -4928,7 +4934,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4928
4934
|
}
|
|
4929
4935
|
),
|
|
4930
4936
|
/* @__PURE__ */ n(qe.Content, { children: /* @__PURE__ */ n(at, { method: "POST", width: "auto", height: "auto", initialValues: h, children: ({ values: x, onChange: M }) => /* @__PURE__ */ n(
|
|
4931
|
-
|
|
4937
|
+
En.Provider,
|
|
4932
4938
|
{
|
|
4933
4939
|
value: {
|
|
4934
4940
|
values: x,
|
|
@@ -4940,20 +4946,20 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4940
4946
|
setFormValueItem: L
|
|
4941
4947
|
},
|
|
4942
4948
|
children: /* @__PURE__ */ w(P, { direction: "column", gap: 4, children: [
|
|
4943
|
-
/* @__PURE__ */ n(
|
|
4944
|
-
/* @__PURE__ */ n(
|
|
4945
|
-
/* @__PURE__ */ n(
|
|
4946
|
-
/* @__PURE__ */ n(
|
|
4947
|
-
/* @__PURE__ */ n(
|
|
4949
|
+
/* @__PURE__ */ n(Dr, { setIsReloading: p }),
|
|
4950
|
+
/* @__PURE__ */ n(kr, {}),
|
|
4951
|
+
/* @__PURE__ */ n(Tr, {}),
|
|
4952
|
+
/* @__PURE__ */ n(Rr, {}),
|
|
4953
|
+
/* @__PURE__ */ n(Vr, { hasSettingsReadPermissions: b })
|
|
4948
4954
|
] })
|
|
4949
4955
|
}
|
|
4950
4956
|
) }) })
|
|
4951
4957
|
] }) }) : /* @__PURE__ */ n(Te.NoPermissions, {});
|
|
4952
4958
|
};
|
|
4953
|
-
function
|
|
4954
|
-
return Yt.invalidateQueries(), /* @__PURE__ */ n(rn, { client: Yt, children: /* @__PURE__ */ n(
|
|
4959
|
+
function zr() {
|
|
4960
|
+
return Yt.invalidateQueries(), /* @__PURE__ */ n(rn, { client: Yt, children: /* @__PURE__ */ n(Or, {}) });
|
|
4955
4961
|
}
|
|
4956
|
-
const
|
|
4962
|
+
const _r = "navigation", en = "Navigation", rl = {
|
|
4957
4963
|
register(e) {
|
|
4958
4964
|
e.createSettingSection(
|
|
4959
4965
|
{
|
|
@@ -4972,7 +4978,7 @@ const Or = "navigation", en = "Navigation", ol = {
|
|
|
4972
4978
|
id: "navigation",
|
|
4973
4979
|
to: de,
|
|
4974
4980
|
Component() {
|
|
4975
|
-
return
|
|
4981
|
+
return zr;
|
|
4976
4982
|
},
|
|
4977
4983
|
permissions: $e.settings
|
|
4978
4984
|
}
|
|
@@ -4993,7 +4999,7 @@ const Or = "navigation", en = "Navigation", ol = {
|
|
|
4993
4999
|
id: de,
|
|
4994
5000
|
initializer: ka,
|
|
4995
5001
|
isReady: !1,
|
|
4996
|
-
name:
|
|
5002
|
+
name: _r
|
|
4997
5003
|
});
|
|
4998
5004
|
},
|
|
4999
5005
|
registerTrads: async function({ locales: e = [] }) {
|
|
@@ -5009,5 +5015,5 @@ const Or = "navigation", en = "Navigation", ol = {
|
|
|
5009
5015
|
}
|
|
5010
5016
|
};
|
|
5011
5017
|
export {
|
|
5012
|
-
|
|
5018
|
+
rl as default
|
|
5013
5019
|
};
|