strapi-plugin-navigation 3.0.7-beta.3 → 3.0.7
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/README.md +10 -11
- package/dist/admin/index.js +6 -6
- package/dist/admin/index.mjs +376 -373
- package/dist/server/index.js +34 -35
- package/dist/server/index.mjs +2502 -2573
- package/package.json +8 -9
package/dist/admin/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Sn, { useRef as rt, useEffect as ie, useState as V, useCallback as
|
|
1
|
+
import Sn, { useRef as rt, useEffect as ie, useState as V, useCallback as G, useMemo as ue } from "react";
|
|
2
2
|
import { jsx as t, jsxs as h, Fragment as Re } from "react/jsx-runtime";
|
|
3
3
|
import ke, { useTheme as $n } from "styled-components";
|
|
4
|
-
import { getFetchClient as te, Form as yt, useNotification as ct, Layouts as
|
|
4
|
+
import { getFetchClient as te, Form as yt, useNotification as ct, Layouts as Je, useStrapiApp as Fn, useRBAC as Ln, Page as _e, useAuth as En } from "@strapi/strapi/admin";
|
|
5
5
|
import { useDrop as xn, useDrag as Pn, DndProvider as kn } from "react-dnd";
|
|
6
6
|
import { HTML5Backend as Mn } from "react-dnd-html5-backend";
|
|
7
7
|
import { Routes as Dn, Route as Ot } from "react-router-dom";
|
|
8
|
-
import { Dialog as nt, Flex as
|
|
9
|
-
import { useQuery as Ke,
|
|
10
|
-
import { once as Gn, orderBy as Zn, capitalize as un, get as ce, isEmpty as ge, first as Rt, isObject as lt, isNil as
|
|
11
|
-
import { useIntl as
|
|
12
|
-
import { Field as
|
|
13
|
-
import { Check as dt, WarningCircle as na, Pencil as St, Trash as $t,
|
|
8
|
+
import { Dialog as nt, Flex as H, Typography as q, Button as oe, Modal as de, Grid as C, TextInput as He, Toggle as Pe, Box as ee, Table as an, Thead as on, Tr as gt, Th as Ne, Checkbox as Vt, IconButton as De, Tbody as rn, Td as Ae, Loader as Nt, Tag as qn, Field as jn, SingleSelect as qe, SingleSelectOption as je, Badge as Bn, CardTitle as On, IconButtonGroup as ln, Card as Vn, CardBody as _t, Divider as mt, TextButton as _n, Link as zn, MultiSelect as Xe, MultiSelectOption as Ge, Searchbar as Kn, DesignSystemProvider as sn, Alert as Un, VisuallyHidden as Wn, Tooltip as Hn, TFooter as Qn, Accordion as at, NumberInput as Xn } from "@strapi/design-system";
|
|
9
|
+
import { useQuery as Ke, useMutation as Me, useQueryClient as et, QueryClient as dn, QueryClientProvider as cn } from "@tanstack/react-query";
|
|
10
|
+
import { once as Gn, orderBy as Zn, capitalize as un, get as ce, isEmpty as ge, first as Rt, isObject as lt, isNil as Qe, isString as bt, set as It, sortBy as st, isNumber as zt, isBoolean as Jn, isArray as Yn, pick as ea, isNaN as ta } from "lodash";
|
|
11
|
+
import { useIntl as Q } from "react-intl";
|
|
12
|
+
import { Field as X, usePluginTheme as pn, prefixPluginTranslations as Kt, flattenObject as Ut } from "@sensinum/strapi-utils";
|
|
13
|
+
import { Check as dt, WarningCircle as na, Feather as aa, Pencil as St, Trash as $t, Information as ia, CaretDown as oa, CaretUp as ra, Drag as la, Eye as mn, ArrowClockwise as sa, Earth as da, Cog as ca, Link as ua, Plus as Ft, ArrowRight as pa, Search as ma, ListPlus as ga, Minus as ha, EyeStriked as fa, PriceTag as ya, Play as ba, Typhoon as Ia } from "@strapi/icons";
|
|
14
14
|
import * as i from "zod";
|
|
15
15
|
import { z as d } from "zod";
|
|
16
16
|
import { prop as ht } from "lodash/fp";
|
|
@@ -50,7 +50,7 @@ const we = "navigation", Ca = ({ setPlugin: e }) => {
|
|
|
50
50
|
read: "read",
|
|
51
51
|
update: "update",
|
|
52
52
|
settings: "settings"
|
|
53
|
-
},
|
|
53
|
+
}, We = {
|
|
54
54
|
access: [{ action: Ct(vt.read), subject: null }],
|
|
55
55
|
update: [{ action: Ct(vt.update), subject: null }],
|
|
56
56
|
settings: [{ action: Ct(vt.settings), subject: null }]
|
|
@@ -447,7 +447,7 @@ const ei = i.object({
|
|
|
447
447
|
iconConfirm: S,
|
|
448
448
|
mainIcon: p = ai
|
|
449
449
|
}) => {
|
|
450
|
-
const { formatMessage: f } =
|
|
450
|
+
const { formatMessage: f } = Q();
|
|
451
451
|
return e ? /* @__PURE__ */ t(
|
|
452
452
|
nt.Root,
|
|
453
453
|
{
|
|
@@ -457,7 +457,7 @@ const ei = i.object({
|
|
|
457
457
|
},
|
|
458
458
|
title: o || f(r("components.confirmation.dialog.header", "Confirmation")),
|
|
459
459
|
children: /* @__PURE__ */ h(nt.Content, { children: [
|
|
460
|
-
/* @__PURE__ */ t(nt.Body, { icon: p, children: /* @__PURE__ */ t(
|
|
460
|
+
/* @__PURE__ */ t(nt.Body, { icon: p, children: /* @__PURE__ */ t(H, { justifyContent: "center", children: /* @__PURE__ */ t(q, { id: "dialog-confirm-description", children: a || f(r("components.confirmation.dialog.description")) }) }) }),
|
|
461
461
|
/* @__PURE__ */ h(nt.Footer, { children: [
|
|
462
462
|
/* @__PURE__ */ t(nt.Cancel, { children: /* @__PURE__ */ t(oe, { fullWidth: !0, onClick: s, variant: "tertiary", disabled: n, children: m || f(r("components.confirmation.dialog.button.cancel", "Cancel")) }) }),
|
|
463
463
|
/* @__PURE__ */ t(
|
|
@@ -476,7 +476,7 @@ const ei = i.object({
|
|
|
476
476
|
}
|
|
477
477
|
) : null;
|
|
478
478
|
}, Qt = /* @__PURE__ */ t(Re, {}), ii = ({ onConfirm: e, onCancel: n }) => {
|
|
479
|
-
const { formatMessage: a } =
|
|
479
|
+
const { formatMessage: a } = Q();
|
|
480
480
|
return /* @__PURE__ */ t(
|
|
481
481
|
xt,
|
|
482
482
|
{
|
|
@@ -544,7 +544,7 @@ const ei = i.object({
|
|
|
544
544
|
});
|
|
545
545
|
}, si = () => {
|
|
546
546
|
const e = et(), n = te(), a = ne(n);
|
|
547
|
-
return
|
|
547
|
+
return G(() => {
|
|
548
548
|
e.invalidateQueries({
|
|
549
549
|
queryKey: a.getIndexPrefix()
|
|
550
550
|
});
|
|
@@ -607,9 +607,9 @@ const ei = i.object({
|
|
|
607
607
|
queryFn: n.readConfig
|
|
608
608
|
});
|
|
609
609
|
}, mi = (e) => {
|
|
610
|
-
const [n, a] = V(!1), [l, s] = V(void 0), o =
|
|
610
|
+
const [n, a] = V(!1), [l, s] = V(void 0), o = G(() => {
|
|
611
611
|
a(!1);
|
|
612
|
-
}, [a]), m =
|
|
612
|
+
}, [a]), m = G(() => {
|
|
613
613
|
l && (e(l), a(!1));
|
|
614
614
|
}, [e, l]), b = ue(
|
|
615
615
|
() => n ? /* @__PURE__ */ t(ii, { onConfirm: m, onCancel: o }) : null,
|
|
@@ -650,7 +650,7 @@ const ei = i.object({
|
|
|
650
650
|
(a) => n.availableAudience.find((l) => l.documentId === a)
|
|
651
651
|
) ?? [],
|
|
652
652
|
autoSync: e.autoSync,
|
|
653
|
-
items: e.items?.length ?
|
|
653
|
+
items: e.items?.length ? Ye(e, e.items, n) : e.items,
|
|
654
654
|
related: {
|
|
655
655
|
__type: e.relatedType,
|
|
656
656
|
documentId: e.related
|
|
@@ -671,7 +671,7 @@ const ei = i.object({
|
|
|
671
671
|
uiRouterKey: e.uiRouterKey,
|
|
672
672
|
additionalFields: e.additionalFields,
|
|
673
673
|
autoSync: e.autoSync,
|
|
674
|
-
items: e.items?.length ?
|
|
674
|
+
items: e.items?.length ? Ye(e, e.items, n) : e.items,
|
|
675
675
|
path: "",
|
|
676
676
|
viewId: e.viewId,
|
|
677
677
|
structureId: e.structureId,
|
|
@@ -697,18 +697,18 @@ const ei = i.object({
|
|
|
697
697
|
(a) => n.availableAudience.find((l) => l.documentId === a)
|
|
698
698
|
) ?? [],
|
|
699
699
|
autoSync: e.autoSync,
|
|
700
|
-
items: e.items?.length ?
|
|
700
|
+
items: e.items?.length ? Ye(e, e.items, n) : e.items,
|
|
701
701
|
viewId: e.viewId,
|
|
702
702
|
viewParentId: e.viewParentId,
|
|
703
703
|
structureId: e.structureId,
|
|
704
704
|
removed: e.removed,
|
|
705
705
|
updated: e.updated
|
|
706
|
-
},
|
|
706
|
+
}, Ye = (e, n = [], a) => {
|
|
707
707
|
if (!e.viewParentId) {
|
|
708
708
|
if (e.viewId) {
|
|
709
709
|
const s = n.map((o) => o.viewId === e.viewId ? pt(e, a) : {
|
|
710
710
|
...o,
|
|
711
|
-
items: o.items?.length ?
|
|
711
|
+
items: o.items?.length ? Ye(e, o.items, a) : o.items
|
|
712
712
|
});
|
|
713
713
|
return it(s);
|
|
714
714
|
}
|
|
@@ -737,7 +737,7 @@ const ei = i.object({
|
|
|
737
737
|
}
|
|
738
738
|
return {
|
|
739
739
|
...s,
|
|
740
|
-
items: s.items?.length ?
|
|
740
|
+
items: s.items?.length ? Ye(e, s.items, a) : s.items
|
|
741
741
|
};
|
|
742
742
|
});
|
|
743
743
|
return it(l);
|
|
@@ -822,14 +822,14 @@ const ei = i.object({
|
|
|
822
822
|
isSearchActive: e.isSearchActive,
|
|
823
823
|
path: e.path ?? ""
|
|
824
824
|
};
|
|
825
|
-
}, vn = (e) => e.find(({ isPending: n }) => n),
|
|
825
|
+
}, vn = (e) => e.find(({ isPending: n }) => n), Ze = (e, n) => e.collapsed !== n ? {
|
|
826
826
|
...e,
|
|
827
827
|
collapsed: n,
|
|
828
828
|
updated: !0,
|
|
829
|
-
items: e.items?.map((a) =>
|
|
829
|
+
items: e.items?.map((a) => Ze(a, n))
|
|
830
830
|
} : {
|
|
831
831
|
...e,
|
|
832
|
-
items: e.items?.map((a) =>
|
|
832
|
+
items: e.items?.map((a) => Ze(a, n))
|
|
833
833
|
}, tt = ({ start: e, end: n }) => /* @__PURE__ */ h(de.Footer, { children: [
|
|
834
834
|
/* @__PURE__ */ t(de.Close, { children: Xt(e) }),
|
|
835
835
|
Xt(n)
|
|
@@ -843,7 +843,7 @@ const ei = i.object({
|
|
|
843
843
|
alreadyUsedNames: a = [],
|
|
844
844
|
isLoading: l
|
|
845
845
|
}) => {
|
|
846
|
-
const [s, o] = V({}), [m, b] = V(), { formatMessage: S } =
|
|
846
|
+
const [s, o] = V({}), [m, b] = V(), { formatMessage: S } = Q(), {
|
|
847
847
|
name: p,
|
|
848
848
|
visible: f
|
|
849
849
|
} = s, N = (v, T, c) => {
|
|
@@ -851,7 +851,7 @@ const ei = i.object({
|
|
|
851
851
|
let w = v, F = T;
|
|
852
852
|
if (lt(v)) {
|
|
853
853
|
const { name: _, value: pe } = v.target;
|
|
854
|
-
w = _, F =
|
|
854
|
+
w = _, F = Qe(F) ? pe : F;
|
|
855
855
|
}
|
|
856
856
|
return bt(w) && I(w, F), c(v, F);
|
|
857
857
|
}
|
|
@@ -895,13 +895,13 @@ const ei = i.object({
|
|
|
895
895
|
initialValues: s,
|
|
896
896
|
children: ({ values: v, onChange: T }) => /* @__PURE__ */ h(C.Root, { gap: 5, children: [
|
|
897
897
|
/* @__PURE__ */ t(C.Item, { col: 6, children: /* @__PURE__ */ t(
|
|
898
|
-
|
|
898
|
+
X,
|
|
899
899
|
{
|
|
900
900
|
name: "name",
|
|
901
901
|
label: S(r("popup.navigation.form.name.label", "Name")),
|
|
902
902
|
error: E("name"),
|
|
903
903
|
children: /* @__PURE__ */ t(
|
|
904
|
-
|
|
904
|
+
He,
|
|
905
905
|
{
|
|
906
906
|
name: "name",
|
|
907
907
|
type: "string",
|
|
@@ -916,7 +916,7 @@ const ei = i.object({
|
|
|
916
916
|
}
|
|
917
917
|
) }),
|
|
918
918
|
/* @__PURE__ */ t(C.Item, { col: 6, children: /* @__PURE__ */ t(
|
|
919
|
-
|
|
919
|
+
X,
|
|
920
920
|
{
|
|
921
921
|
name: "visible",
|
|
922
922
|
label: S(r("popup.navigation.form.visible.label", "Visibility")),
|
|
@@ -943,7 +943,7 @@ const ei = i.object({
|
|
|
943
943
|
items: [],
|
|
944
944
|
visible: !1
|
|
945
945
|
}, yi = ({ setState: e, current: n, isLoading: a, alreadyUsedNames: l }) => {
|
|
946
|
-
const s =
|
|
946
|
+
const s = G(
|
|
947
947
|
({ disabled: o, ...m }) => {
|
|
948
948
|
e({
|
|
949
949
|
view: "CREATE",
|
|
@@ -964,7 +964,7 @@ const ei = i.object({
|
|
|
964
964
|
}
|
|
965
965
|
);
|
|
966
966
|
}, bi = ({ onSubmit: e, onReset: n, disabled: a, isLoading: l }) => {
|
|
967
|
-
const { formatMessage: s } =
|
|
967
|
+
const { formatMessage: s } = Q();
|
|
968
968
|
return /* @__PURE__ */ t(
|
|
969
969
|
tt,
|
|
970
970
|
{
|
|
@@ -983,7 +983,7 @@ const ei = i.object({
|
|
|
983
983
|
}
|
|
984
984
|
);
|
|
985
985
|
}, Ii = /* @__PURE__ */ t(St, {}), Ci = /* @__PURE__ */ t($t, {}), Gt = /* @__PURE__ */ t(aa, {}), vi = ({ navigations: e, selected: n, setState: a }) => {
|
|
986
|
-
const l = ut(), s = !!n.length, { formatMessage: o } =
|
|
986
|
+
const l = ut(), s = !!n.length, { formatMessage: o } = Q(), m = Pt(), b = G(
|
|
987
987
|
() => a({
|
|
988
988
|
navigations: e,
|
|
989
989
|
selected: s ? [] : e.map((c) => c),
|
|
@@ -1016,13 +1016,13 @@ const ei = i.object({
|
|
|
1016
1016
|
view: "CACHE_PURGE",
|
|
1017
1017
|
navigations: c
|
|
1018
1018
|
});
|
|
1019
|
-
}, E =
|
|
1019
|
+
}, E = G(N(n), [N]), v = G(I(n), [I]), T = (c) => [c].concat(
|
|
1020
1020
|
e.filter(
|
|
1021
1021
|
(w) => w.documentId === c.documentId && w.locale !== c.locale
|
|
1022
1022
|
)
|
|
1023
1023
|
);
|
|
1024
1024
|
return /* @__PURE__ */ h(Re, { children: [
|
|
1025
|
-
/* @__PURE__ */ t(C.Root, { children: /* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 3, children: s ? /* @__PURE__ */ h(
|
|
1025
|
+
/* @__PURE__ */ t(C.Root, { children: /* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 3, children: s ? /* @__PURE__ */ h(H, { direction: "row", gap: 1, children: [
|
|
1026
1026
|
/* @__PURE__ */ t(ee, { paddingRight: 3, children: o(r("popup.navigation.manage.table.hasSelected"), {
|
|
1027
1027
|
count: n.length
|
|
1028
1028
|
}) }),
|
|
@@ -1036,7 +1036,7 @@ const ei = i.object({
|
|
|
1036
1036
|
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: o(r("popup.navigation.manage.table.name")) }) }),
|
|
1037
1037
|
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: o(r("popup.navigation.manage.table.locale")) }) }),
|
|
1038
1038
|
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: o(r("popup.navigation.manage.table.visibility")) }) }),
|
|
1039
|
-
/* @__PURE__ */ t(Ne, { children: l.data?.isCacheEnabled ? /* @__PURE__ */ t(
|
|
1039
|
+
/* @__PURE__ */ t(Ne, { children: l.data?.isCacheEnabled ? /* @__PURE__ */ t(H, { direction: "row", children: /* @__PURE__ */ t(ee, { paddingLeft: 1, children: /* @__PURE__ */ t(
|
|
1040
1040
|
De,
|
|
1041
1041
|
{
|
|
1042
1042
|
onClick: I([]),
|
|
@@ -1061,7 +1061,7 @@ const ei = i.object({
|
|
|
1061
1061
|
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: c.name }) }),
|
|
1062
1062
|
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: T(c).map(ht("locale")).join(", ") }) }),
|
|
1063
1063
|
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: c.visible ? o(r("popup.navigation.manage.navigation.visible")) : o(r("popup.navigation.manage.navigation.hidden")) }) }),
|
|
1064
|
-
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ h(
|
|
1064
|
+
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ h(H, { width: "100%", direction: "row", alignItems: "center", justifyContent: "flex-end", children: [
|
|
1065
1065
|
/* @__PURE__ */ t(ee, { paddingLeft: 1, children: /* @__PURE__ */ t(
|
|
1066
1066
|
De,
|
|
1067
1067
|
{
|
|
@@ -1100,7 +1100,7 @@ const ei = i.object({
|
|
|
1100
1100
|
navigations: l,
|
|
1101
1101
|
isLoading: s
|
|
1102
1102
|
}) => {
|
|
1103
|
-
const { formatMessage: o } =
|
|
1103
|
+
const { formatMessage: o } = Q();
|
|
1104
1104
|
return /* @__PURE__ */ t(
|
|
1105
1105
|
tt,
|
|
1106
1106
|
{
|
|
@@ -1123,13 +1123,13 @@ const ei = i.object({
|
|
|
1123
1123
|
}
|
|
1124
1124
|
);
|
|
1125
1125
|
}, wi = ({ navigations: e }) => {
|
|
1126
|
-
const { formatMessage: n } =
|
|
1126
|
+
const { formatMessage: n } = Q();
|
|
1127
1127
|
return /* @__PURE__ */ h(C.Root, { children: [
|
|
1128
|
-
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(
|
|
1128
|
+
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(q, { variant: "beta", children: n(r("popup.navigation.manage.delete.header")) }) }) }),
|
|
1129
1129
|
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(q, { variant: "omega", fontWeight: "semiBold", children: Ai(e) }) })
|
|
1130
1130
|
] });
|
|
1131
1131
|
}, Ni = ({ state: e, onSubmit: n, onReset: a, isLoading: l }) => {
|
|
1132
|
-
const { formatMessage: s } =
|
|
1132
|
+
const { formatMessage: s } = Q();
|
|
1133
1133
|
return /* @__PURE__ */ t(
|
|
1134
1134
|
tt,
|
|
1135
1135
|
{
|
|
@@ -1148,7 +1148,7 @@ const ei = i.object({
|
|
|
1148
1148
|
}
|
|
1149
1149
|
);
|
|
1150
1150
|
}, Ai = (e) => e.map(ht("name")).join(", "), Ri = ({ errors: e }) => {
|
|
1151
|
-
const { formatMessage: n } =
|
|
1151
|
+
const { formatMessage: n } = Q(), { toggleNotification: a } = ct();
|
|
1152
1152
|
return ie(() => {
|
|
1153
1153
|
e.map((l) => {
|
|
1154
1154
|
a({
|
|
@@ -1158,7 +1158,7 @@ const ei = i.object({
|
|
|
1158
1158
|
});
|
|
1159
1159
|
}, []), /* @__PURE__ */ t(C.Root, { children: /* @__PURE__ */ t(C.Item, { col: 12, children: n(r("popup.navigation.manage.error.message")) }) });
|
|
1160
1160
|
}, Si = ({ onReset: e }) => {
|
|
1161
|
-
const { formatMessage: n } =
|
|
1161
|
+
const { formatMessage: n } = Q();
|
|
1162
1162
|
return /* @__PURE__ */ t(
|
|
1163
1163
|
tt,
|
|
1164
1164
|
{
|
|
@@ -1176,7 +1176,7 @@ const ei = i.object({
|
|
|
1176
1176
|
navigation: l,
|
|
1177
1177
|
setState: s
|
|
1178
1178
|
}) => {
|
|
1179
|
-
const o = ue(() => n ?? l, [n]), m =
|
|
1179
|
+
const o = ue(() => n ?? l, [n]), m = G(
|
|
1180
1180
|
({ disabled: b, ...S }) => {
|
|
1181
1181
|
s({
|
|
1182
1182
|
view: "EDIT",
|
|
@@ -1198,7 +1198,7 @@ const ei = i.object({
|
|
|
1198
1198
|
}
|
|
1199
1199
|
);
|
|
1200
1200
|
}, Fi = ({ onSubmit: e, onReset: n, disabled: a, isLoading: l }) => {
|
|
1201
|
-
const { formatMessage: s } =
|
|
1201
|
+
const { formatMessage: s } = Q();
|
|
1202
1202
|
return /* @__PURE__ */ t(
|
|
1203
1203
|
tt,
|
|
1204
1204
|
{
|
|
@@ -1217,13 +1217,13 @@ const ei = i.object({
|
|
|
1217
1217
|
}
|
|
1218
1218
|
);
|
|
1219
1219
|
}, Li = ({ navigations: e }) => {
|
|
1220
|
-
const { formatMessage: n } =
|
|
1220
|
+
const { formatMessage: n } = Q();
|
|
1221
1221
|
return /* @__PURE__ */ h(C.Root, { children: [
|
|
1222
|
-
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(
|
|
1222
|
+
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(q, { variant: "beta", children: n(r("popup.navigation.manage.purge.header")) }) }) }),
|
|
1223
1223
|
/* @__PURE__ */ t(C.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ t(q, { variant: "omega", fontWeight: "semiBold", children: xi(e) }) })
|
|
1224
1224
|
] });
|
|
1225
1225
|
}, Ei = ({ onSubmit: e, onReset: n, isLoading: a }) => {
|
|
1226
|
-
const { formatMessage: l } =
|
|
1226
|
+
const { formatMessage: l } = Q();
|
|
1227
1227
|
return /* @__PURE__ */ t(
|
|
1228
1228
|
tt,
|
|
1229
1229
|
{
|
|
@@ -1242,7 +1242,7 @@ const ei = i.object({
|
|
|
1242
1242
|
}
|
|
1243
1243
|
);
|
|
1244
1244
|
}, xi = (e) => e.map(ht("name")).join(", "), Pi = ({ initialState: e, isOpened: n, onClose: a }) => {
|
|
1245
|
-
const { formatMessage: l } =
|
|
1245
|
+
const { formatMessage: l } = Q(), [s, o] = V(e), { toggleNotification: m } = ct(), b = si(), S = di(), p = pi(), f = In(), N = Cn(), I = kt(), E = Pt(), v = ue(
|
|
1246
1246
|
() => st(I.data ?? [], "id"),
|
|
1247
1247
|
[I.data]
|
|
1248
1248
|
), T = vn([
|
|
@@ -1252,8 +1252,8 @@ const ei = i.object({
|
|
|
1252
1252
|
f,
|
|
1253
1253
|
N,
|
|
1254
1254
|
E
|
|
1255
|
-
]), c =
|
|
1256
|
-
const
|
|
1255
|
+
]), c = G(() => o({ view: "INITIAL" }), [o]), w = G(async () => {
|
|
1256
|
+
const D = s.view === "DELETE" ? () => {
|
|
1257
1257
|
S.mutate(
|
|
1258
1258
|
s.navigations.reduce((J, re) => (re.documentId && J.push(re.documentId), J), []),
|
|
1259
1259
|
{
|
|
@@ -1304,7 +1304,7 @@ const ei = i.object({
|
|
|
1304
1304
|
} : () => {
|
|
1305
1305
|
};
|
|
1306
1306
|
try {
|
|
1307
|
-
|
|
1307
|
+
D(), o({ view: "INITIAL" });
|
|
1308
1308
|
} catch (J) {
|
|
1309
1309
|
o({
|
|
1310
1310
|
view: "ERROR",
|
|
@@ -1343,8 +1343,8 @@ const ei = i.object({
|
|
|
1343
1343
|
de.Root,
|
|
1344
1344
|
{
|
|
1345
1345
|
labelledBy: "condition-modal-breadcrumbs",
|
|
1346
|
-
onOpenChange: (
|
|
1347
|
-
|
|
1346
|
+
onOpenChange: (D) => {
|
|
1347
|
+
D || a?.();
|
|
1348
1348
|
},
|
|
1349
1349
|
open: n,
|
|
1350
1350
|
children: /* @__PURE__ */ h(de.Content, { children: [
|
|
@@ -1370,12 +1370,12 @@ const ei = i.object({
|
|
|
1370
1370
|
case "ERROR":
|
|
1371
1371
|
case "CACHE_PURGE":
|
|
1372
1372
|
case "DELETE":
|
|
1373
|
-
return /* @__PURE__ */ h(
|
|
1373
|
+
return /* @__PURE__ */ h(H, { direction: "row", children: [
|
|
1374
1374
|
a ? /* @__PURE__ */ t(Nt, { small: !0 }) : null,
|
|
1375
1375
|
n(r(`popup.navigation.manage.header.${e.view}`))
|
|
1376
1376
|
] });
|
|
1377
1377
|
case "EDIT":
|
|
1378
|
-
return /* @__PURE__ */ h(
|
|
1378
|
+
return /* @__PURE__ */ h(H, { direction: "row", children: [
|
|
1379
1379
|
a ? /* @__PURE__ */ t(Nt, { small: !0 }) : null,
|
|
1380
1380
|
n(r("popup.navigation.manage.header.EDIT"), {
|
|
1381
1381
|
name: e.navigation.name
|
|
@@ -1429,7 +1429,7 @@ const ei = i.object({
|
|
|
1429
1429
|
return Dt(e.state);
|
|
1430
1430
|
}
|
|
1431
1431
|
}, Dt = (e) => (console.warn(`Unknown state "${e?.view}". (${JSON.stringify(e)})`), null), qi = () => {
|
|
1432
|
-
const [e, n] = V(!1), a =
|
|
1432
|
+
const [e, n] = V(!1), a = G(() => n(!0), [n]), l = G(() => n(!1), [n]), s = ue(
|
|
1433
1433
|
() => e ? /* @__PURE__ */ t(Pi, { initialState: { view: "INITIAL" }, isOpened: !0, onClose: l }) : null,
|
|
1434
1434
|
[e, l]
|
|
1435
1435
|
);
|
|
@@ -1454,13 +1454,13 @@ const ei = i.object({
|
|
|
1454
1454
|
locale: p,
|
|
1455
1455
|
currentLocale: f
|
|
1456
1456
|
}) => {
|
|
1457
|
-
const { formatMessage: N } =
|
|
1457
|
+
const { formatMessage: N } = Q(), { openNavigationManagerModal: I, navigationManagerModal: E } = qi(), v = !!p.restLocale, { canUpdate: T } = S, c = ut();
|
|
1458
1458
|
return /* @__PURE__ */ t(Re, { children: /* @__PURE__ */ t(
|
|
1459
|
-
|
|
1459
|
+
Je.Header,
|
|
1460
1460
|
{
|
|
1461
1461
|
title: N(r("header.title", "UI Navigation")),
|
|
1462
1462
|
subtitle: N(r("header.description")),
|
|
1463
|
-
primaryAction: /* @__PURE__ */ h(
|
|
1463
|
+
primaryAction: /* @__PURE__ */ h(H, { direction: "row", size: 2, children: [
|
|
1464
1464
|
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ h(
|
|
1465
1465
|
C.Root,
|
|
1466
1466
|
{
|
|
@@ -1480,7 +1480,7 @@ const ei = i.object({
|
|
|
1480
1480
|
children: N(r("header.action.manage"))
|
|
1481
1481
|
}
|
|
1482
1482
|
) }),
|
|
1483
|
-
/* @__PURE__ */ t(C.Item, { col: T ? 4 : 10, children: /* @__PURE__ */ t(
|
|
1483
|
+
/* @__PURE__ */ t(C.Item, { col: T ? 4 : 10, children: /* @__PURE__ */ t(jn.Root, { width: "100%", children: /* @__PURE__ */ t(
|
|
1484
1484
|
qe,
|
|
1485
1485
|
{
|
|
1486
1486
|
type: "select",
|
|
@@ -1539,15 +1539,15 @@ const ei = i.object({
|
|
|
1539
1539
|
) }),
|
|
1540
1540
|
T && E
|
|
1541
1541
|
] }),
|
|
1542
|
-
secondaryAction: /* @__PURE__ */ t(
|
|
1542
|
+
secondaryAction: /* @__PURE__ */ t(qn, { icon: /* @__PURE__ */ t(ia, { "aria-hidden": !0 }), children: e ? N(r("header.meta"), {
|
|
1543
1543
|
id: e?.documentId,
|
|
1544
1544
|
key: e?.slug
|
|
1545
1545
|
}) : null })
|
|
1546
1546
|
}
|
|
1547
1547
|
) });
|
|
1548
|
-
}, Bi = ({ startActions: e, endActions: n }) => /* @__PURE__ */ h(
|
|
1549
|
-
/* @__PURE__ */ t(
|
|
1550
|
-
/* @__PURE__ */ t(
|
|
1548
|
+
}, Bi = ({ startActions: e, endActions: n }) => /* @__PURE__ */ h(H, { justifyContent: "space-between", width: "100%", children: [
|
|
1549
|
+
/* @__PURE__ */ t(H, { alignItems: "space-between", children: e }),
|
|
1550
|
+
/* @__PURE__ */ t(H, { alignItems: "space-between", children: n })
|
|
1551
1551
|
] }), Oi = ke.div`
|
|
1552
1552
|
border-radius: 50%;
|
|
1553
1553
|
background: #dcdce4;
|
|
@@ -1558,7 +1558,7 @@ const ei = i.object({
|
|
|
1558
1558
|
align-items: center;
|
|
1559
1559
|
margin-right: 8px;
|
|
1560
1560
|
`, Vi = ({ toggle: e, collapsed: n, itemsCount: a }) => /* @__PURE__ */ h(
|
|
1561
|
-
|
|
1561
|
+
H,
|
|
1562
1562
|
{
|
|
1563
1563
|
justifyContent: "space-between",
|
|
1564
1564
|
alignItems: "center",
|
|
@@ -1660,9 +1660,9 @@ const ei = i.object({
|
|
|
1660
1660
|
dragRef: S,
|
|
1661
1661
|
isSearchActive: p
|
|
1662
1662
|
}) => {
|
|
1663
|
-
const { formatMessage: f } =
|
|
1663
|
+
const { formatMessage: f } = Q();
|
|
1664
1664
|
return /* @__PURE__ */ h(Ki, { children: [
|
|
1665
|
-
/* @__PURE__ */ h(
|
|
1665
|
+
/* @__PURE__ */ h(H, { alignItems: "center", children: [
|
|
1666
1666
|
s && /* @__PURE__ */ t(zi, { ref: S, isActive: p }),
|
|
1667
1667
|
/* @__PURE__ */ t(q, { variant: "omega", fontWeight: "bold", children: e }),
|
|
1668
1668
|
/* @__PURE__ */ t(
|
|
@@ -1676,9 +1676,9 @@ const ei = i.object({
|
|
|
1676
1676
|
children: n
|
|
1677
1677
|
}
|
|
1678
1678
|
),
|
|
1679
|
-
/* @__PURE__ */ t(
|
|
1679
|
+
/* @__PURE__ */ t(H, { children: a })
|
|
1680
1680
|
] }),
|
|
1681
|
-
/* @__PURE__ */ h(
|
|
1681
|
+
/* @__PURE__ */ h(H, { alignItems: "center", style: Xi, children: [
|
|
1682
1682
|
l && /* @__PURE__ */ t(wn, { borderColor: "danger200", backgroundColor: "danger100", textColor: "danger600", children: f(r("components.navigationItem.badge.removed")) }),
|
|
1683
1683
|
/* @__PURE__ */ h(ln, { children: [
|
|
1684
1684
|
/* @__PURE__ */ t(
|
|
@@ -1784,7 +1784,7 @@ const ei = i.object({
|
|
|
1784
1784
|
viewParentId: v,
|
|
1785
1785
|
locale: T
|
|
1786
1786
|
}) => {
|
|
1787
|
-
const c = ze(e, !0), { formatMessage: w } =
|
|
1787
|
+
const c = ze(e, !0), { formatMessage: w } = Q(), F = ut(), _ = c.type === "EXTERNAL", pe = c.type === "WRAPPER", D = zt(F.data?.allowedLevels) ? a < F.data.allowedLevels - 1 : !0, J = zt(F.data?.allowedLevels) ? a < F.data.allowedLevels : !0, re = !ge(e.items) && !N, Se = _ ? void 0 : `${l === "/" ? "" : l}/${c.path === "/" ? "" : c.path}`.replace(
|
|
1788
1788
|
"//",
|
|
1789
1789
|
"/"
|
|
1790
1790
|
), $e = bn({
|
|
@@ -1796,17 +1796,17 @@ const ei = i.object({
|
|
|
1796
1796
|
(O) => c.type === "INTERNAL" ? O.documentId === c.related : !1
|
|
1797
1797
|
) ?? { documentId: "", id: 0 }, fe = !!K?.publishedAt, ye = _ ? "" : ft(K, F.data), Fe = le?.info.displayName ?? "", ae = fe ? "success" : "secondary", Le = I.canUpdate, Be = rt(null), ve = rt(null), Te = rt(null), [, Ee] = xn({
|
|
1798
1798
|
accept: `navigation-item_${l}`,
|
|
1799
|
-
hover(O,
|
|
1800
|
-
const
|
|
1801
|
-
if (
|
|
1799
|
+
hover(O, P) {
|
|
1800
|
+
const U = O.order ?? 0, x = e.order ?? 0;
|
|
1801
|
+
if (U === x)
|
|
1802
1802
|
return;
|
|
1803
|
-
const be = ve.current.getBoundingClientRect(), Ue = (be.bottom - be.top) / 2, Oe =
|
|
1803
|
+
const be = ve.current.getBoundingClientRect(), Ue = (be.bottom - be.top) / 2, Oe = P.getClientOffset();
|
|
1804
1804
|
if (!Oe)
|
|
1805
1805
|
return;
|
|
1806
|
-
const Ve = Oe.y - be.top,
|
|
1807
|
-
|
|
1806
|
+
const Ve = Oe.y - be.top, W = Ve > Ue ? (e.order ?? 0) + 0.5 : (e.order ?? 0) - 0.5;
|
|
1807
|
+
U < x && Ve < Ue || U > x && Ve > Ue || p({
|
|
1808
1808
|
item: ze(O, !0),
|
|
1809
|
-
newOrder:
|
|
1809
|
+
newOrder: W
|
|
1810
1810
|
});
|
|
1811
1811
|
},
|
|
1812
1812
|
collect: (O) => ({
|
|
@@ -1818,26 +1818,31 @@ const ei = i.object({
|
|
|
1818
1818
|
collect: (O) => ({
|
|
1819
1819
|
isDragging: O.isDragging()
|
|
1820
1820
|
})
|
|
1821
|
-
}),
|
|
1821
|
+
}), k = {
|
|
1822
1822
|
dragRef: xe(Be),
|
|
1823
1823
|
dropRef: Ee(ve),
|
|
1824
1824
|
previewRef: g(Te)
|
|
1825
1825
|
}, A = (O) => {
|
|
1826
|
-
const
|
|
1827
|
-
return `/admin/content-manager/${
|
|
1828
|
-
}, L =
|
|
1829
|
-
(O) =>
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1826
|
+
const P = le?.kind === "singleType", U = O?.locale ? `?plugins[i18n][locale]=${O?.locale}` : "";
|
|
1827
|
+
return `/admin/content-manager/${P ? "single-types" : "collection-types"}/${le?.uid}${P ? "" : "/" + O?.documentId}${U}`;
|
|
1828
|
+
}, L = G(
|
|
1829
|
+
(O) => {
|
|
1830
|
+
if (!Le)
|
|
1831
|
+
return;
|
|
1832
|
+
const P = (c.items ?? []).reduce((U, { order: x }) => U < x ? x : U, 0);
|
|
1833
|
+
return o(
|
|
1834
|
+
O,
|
|
1835
|
+
c.viewId,
|
|
1836
|
+
D,
|
|
1837
|
+
Se,
|
|
1838
|
+
c.menuAttached,
|
|
1839
|
+
`${E}.${c.items?.length ?? 0}`,
|
|
1840
|
+
P
|
|
1841
|
+
);
|
|
1842
|
+
},
|
|
1838
1843
|
[
|
|
1839
1844
|
c.viewId,
|
|
1840
|
-
|
|
1845
|
+
D,
|
|
1841
1846
|
Se,
|
|
1842
1847
|
c.menuAttached,
|
|
1843
1848
|
E,
|
|
@@ -1846,12 +1851,12 @@ const ei = i.object({
|
|
|
1846
1851
|
]
|
|
1847
1852
|
);
|
|
1848
1853
|
ie(() => {
|
|
1849
|
-
c.isSearchActive &&
|
|
1854
|
+
c.isSearchActive && k.dropRef?.current?.scrollIntoView?.({
|
|
1850
1855
|
behavior: "smooth",
|
|
1851
1856
|
block: "center",
|
|
1852
1857
|
inline: "center"
|
|
1853
1858
|
});
|
|
1854
|
-
}, [c.isSearchActive,
|
|
1859
|
+
}, [c.isSearchActive, k.dropRef.current]);
|
|
1855
1860
|
const B = $n();
|
|
1856
1861
|
return /* @__PURE__ */ h(
|
|
1857
1862
|
Yi,
|
|
@@ -1859,7 +1864,7 @@ const ei = i.object({
|
|
|
1859
1864
|
level: a,
|
|
1860
1865
|
isLast: n,
|
|
1861
1866
|
style: { opacity: se ? 0.2 : 1 },
|
|
1862
|
-
ref:
|
|
1867
|
+
ref: k ? k.dropRef : void 0,
|
|
1863
1868
|
children: [
|
|
1864
1869
|
/* @__PURE__ */ h(
|
|
1865
1870
|
Vn,
|
|
@@ -1875,7 +1880,7 @@ const ei = i.object({
|
|
|
1875
1880
|
},
|
|
1876
1881
|
children: [
|
|
1877
1882
|
c.removed && /* @__PURE__ */ t(Ji, {}),
|
|
1878
|
-
/* @__PURE__ */ h("div", { ref:
|
|
1883
|
+
/* @__PURE__ */ h("div", { ref: k.previewRef, children: [
|
|
1879
1884
|
/* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t(
|
|
1880
1885
|
Zi,
|
|
1881
1886
|
{
|
|
@@ -1884,7 +1889,7 @@ const ei = i.object({
|
|
|
1884
1889
|
icon: _ ? /* @__PURE__ */ t(da, {}) : pe ? /* @__PURE__ */ t(ca, {}) : /* @__PURE__ */ t(ua, {}),
|
|
1885
1890
|
onItemRemove: () => m({ ...e, viewParentId: v }),
|
|
1886
1891
|
onItemEdit: () => {
|
|
1887
|
-
const { __type: O, documentId:
|
|
1892
|
+
const { __type: O, documentId: P } = e.related ?? {};
|
|
1888
1893
|
e.type !== "EXTERNAL" && e.type !== "INTERNAL" && e.type !== "WRAPPER" || S({
|
|
1889
1894
|
item: e.type === "INTERNAL" ? {
|
|
1890
1895
|
...e,
|
|
@@ -1893,13 +1898,13 @@ const ei = i.object({
|
|
|
1893
1898
|
isParentAttachedToMenu: s,
|
|
1894
1899
|
isSearchActive: !1,
|
|
1895
1900
|
relatedType: O ?? "",
|
|
1896
|
-
related:
|
|
1901
|
+
related: P ?? "",
|
|
1897
1902
|
additionalFields: e.additionalFields ?? {},
|
|
1898
1903
|
items: e.items ?? [],
|
|
1899
1904
|
autoSync: e.autoSync ?? !0,
|
|
1900
1905
|
externalPath: void 0,
|
|
1901
1906
|
viewParentId: v,
|
|
1902
|
-
audience: e.audience?.map(({ documentId:
|
|
1907
|
+
audience: e.audience?.map(({ documentId: U }) => U) ?? []
|
|
1903
1908
|
} : e.type === "EXTERNAL" ? {
|
|
1904
1909
|
...e,
|
|
1905
1910
|
type: "EXTERNAL",
|
|
@@ -1913,7 +1918,7 @@ const ei = i.object({
|
|
|
1913
1918
|
autoSync: e.autoSync ?? !0,
|
|
1914
1919
|
externalPath: e.externalPath ?? "",
|
|
1915
1920
|
viewParentId: v,
|
|
1916
|
-
audience: e.audience?.map(({ documentId:
|
|
1921
|
+
audience: e.audience?.map(({ documentId: U }) => U) ?? []
|
|
1917
1922
|
} : {
|
|
1918
1923
|
...e,
|
|
1919
1924
|
type: "WRAPPER",
|
|
@@ -1924,29 +1929,29 @@ const ei = i.object({
|
|
|
1924
1929
|
items: e.items ?? [],
|
|
1925
1930
|
autoSync: e.autoSync ?? !0,
|
|
1926
1931
|
viewParentId: v,
|
|
1927
|
-
audience: e.audience?.map(({ documentId:
|
|
1932
|
+
audience: e.audience?.map(({ documentId: U }) => U) ?? []
|
|
1928
1933
|
},
|
|
1929
1934
|
levelPath: l,
|
|
1930
1935
|
isParentAttachedToMenu: s
|
|
1931
1936
|
});
|
|
1932
1937
|
},
|
|
1933
1938
|
onItemRestore: () => b({ ...e, viewParentId: v }),
|
|
1934
|
-
dragRef:
|
|
1939
|
+
dragRef: k.dragRef,
|
|
1935
1940
|
removed: c.removed,
|
|
1936
1941
|
canUpdate: Le,
|
|
1937
1942
|
isSearchActive: c.isSearchActive
|
|
1938
1943
|
}
|
|
1939
1944
|
) }),
|
|
1940
1945
|
/* @__PURE__ */ t(mt, {}),
|
|
1941
|
-
|
|
1942
|
-
|
|
1946
|
+
/* @__PURE__ */ t(_t, { style: { padding: "8px" }, children: /* @__PURE__ */ h(
|
|
1947
|
+
H,
|
|
1943
1948
|
{
|
|
1944
1949
|
style: { width: "100%" },
|
|
1945
1950
|
direction: "row",
|
|
1946
1951
|
alignItems: "center",
|
|
1947
1952
|
justifyContent: "space-between",
|
|
1948
1953
|
children: [
|
|
1949
|
-
/* @__PURE__ */ h(
|
|
1954
|
+
/* @__PURE__ */ h(H, { children: [
|
|
1950
1955
|
!ge(e.items) && /* @__PURE__ */ t(
|
|
1951
1956
|
Vi,
|
|
1952
1957
|
{
|
|
@@ -1955,7 +1960,7 @@ const ei = i.object({
|
|
|
1955
1960
|
itemsCount: e.items?.length ?? 0
|
|
1956
1961
|
}
|
|
1957
1962
|
),
|
|
1958
|
-
Le &&
|
|
1963
|
+
Le && D && /* @__PURE__ */ t(
|
|
1959
1964
|
_n,
|
|
1960
1965
|
{
|
|
1961
1966
|
disabled: c.removed,
|
|
@@ -1973,14 +1978,14 @@ const ei = i.object({
|
|
|
1973
1978
|
}
|
|
1974
1979
|
)
|
|
1975
1980
|
] }),
|
|
1976
|
-
c.type === "INTERNAL" && c.related && !K.id ? /* @__PURE__ */ h(
|
|
1981
|
+
c.type === "INTERNAL" && c.related && !K.id ? /* @__PURE__ */ h(H, { justifyContent: "center", alignItems: "center", children: [
|
|
1977
1982
|
/* @__PURE__ */ h(q, { variant: "omega", textColor: "neutral600", children: [
|
|
1978
1983
|
Fe,
|
|
1979
1984
|
" / "
|
|
1980
1985
|
] }),
|
|
1981
1986
|
/* @__PURE__ */ t(q, { variant: "omega", textColor: "neutral800", children: w(r("components.navigationItem.related.localeMissing")) })
|
|
1982
1987
|
] }) : null,
|
|
1983
|
-
ye && /* @__PURE__ */ h(
|
|
1988
|
+
ye && /* @__PURE__ */ h(H, { justifyContent: "center", alignItems: "center", children: [
|
|
1984
1989
|
/* @__PURE__ */ t(
|
|
1985
1990
|
wn,
|
|
1986
1991
|
{
|
|
@@ -2112,7 +2117,7 @@ const ei = i.object({
|
|
|
2112
2117
|
value: o,
|
|
2113
2118
|
disabled: m
|
|
2114
2119
|
}) => {
|
|
2115
|
-
const { toggleNotification: b } = ct(), { formatMessage: S } =
|
|
2120
|
+
const { toggleNotification: b } = ct(), { formatMessage: S } = Q(), f = Fn("AdditionalFieldInput", (I) => I.fields).media, N = ue(
|
|
2116
2121
|
() => ({
|
|
2117
2122
|
id: n.name,
|
|
2118
2123
|
name: e || n.name,
|
|
@@ -2137,7 +2142,7 @@ const ei = i.object({
|
|
|
2137
2142
|
);
|
|
2138
2143
|
case "string":
|
|
2139
2144
|
return /* @__PURE__ */ t(
|
|
2140
|
-
|
|
2145
|
+
He,
|
|
2141
2146
|
{
|
|
2142
2147
|
...N,
|
|
2143
2148
|
onChange: (I, E) => s(I, E, l),
|
|
@@ -2146,21 +2151,21 @@ const ei = i.object({
|
|
|
2146
2151
|
);
|
|
2147
2152
|
case "select":
|
|
2148
2153
|
return n.multi ? /* @__PURE__ */ t(
|
|
2149
|
-
|
|
2154
|
+
Xe,
|
|
2150
2155
|
{
|
|
2151
2156
|
...N,
|
|
2152
2157
|
onChange: (I) => s(N.name, I, l),
|
|
2153
|
-
value:
|
|
2158
|
+
value: Qe(o) ? n.multi ? [] : null : o,
|
|
2154
2159
|
multi: n.multi,
|
|
2155
2160
|
withTags: n.multi,
|
|
2156
|
-
children: n.options.map((I, E) => /* @__PURE__ */ t(
|
|
2161
|
+
children: n.options.map((I, E) => /* @__PURE__ */ t(Ge, { value: I, children: I }, `${n.name}-option-${E}`))
|
|
2157
2162
|
}
|
|
2158
2163
|
) : /* @__PURE__ */ t(
|
|
2159
2164
|
qe,
|
|
2160
2165
|
{
|
|
2161
2166
|
...N,
|
|
2162
2167
|
onChange: (I) => s(N.name, I, l),
|
|
2163
|
-
value:
|
|
2168
|
+
value: Qe(o) ? n.multi ? [] : null : o,
|
|
2164
2169
|
multi: n.multi,
|
|
2165
2170
|
withTags: n.multi,
|
|
2166
2171
|
children: n.options.map((I, E) => /* @__PURE__ */ t(je, { value: I, children: I }, `${n.name}-option-${E}`))
|
|
@@ -2187,7 +2192,7 @@ const ei = i.object({
|
|
|
2187
2192
|
submitDisabled: a,
|
|
2188
2193
|
canUpdate: l
|
|
2189
2194
|
}) => {
|
|
2190
|
-
const { formatMessage: s } =
|
|
2195
|
+
const { formatMessage: s } = Q();
|
|
2191
2196
|
return l ? /* @__PURE__ */ h(de.Footer, { children: [
|
|
2192
2197
|
/* @__PURE__ */ t(de.Close, { children: /* @__PURE__ */ t(oe, { onClick: e, variant: "tertiary", children: s(r("popup.item.form.button.cancel")) }) }),
|
|
2193
2198
|
/* @__PURE__ */ t(oe, { onClick: n, disabled: a, children: s(r("popup.item.form.button.save")) })
|
|
@@ -2196,7 +2201,8 @@ const ei = i.object({
|
|
|
2196
2201
|
/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,}$/,
|
|
2197
2202
|
/^tel:(\+\d{1,3})?[\s]?(\(?\d{2,3}\)?)?[\s.-]?(\d{3})?[\s.-]?\d{3,4}$/,
|
|
2198
2203
|
/^#.*/,
|
|
2199
|
-
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})
|
|
2204
|
+
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,
|
|
2205
|
+
/(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?/
|
|
2200
2206
|
], qt = ({ additionalFields: e }) => d.object({
|
|
2201
2207
|
title: d.string(),
|
|
2202
2208
|
autoSync: d.boolean().optional(),
|
|
@@ -2241,8 +2247,7 @@ const ei = i.object({
|
|
|
2241
2247
|
additionalFields: e,
|
|
2242
2248
|
isSingleSelected: n
|
|
2243
2249
|
}) => qt({
|
|
2244
|
-
additionalFields: e
|
|
2245
|
-
isSingleSelected: n
|
|
2250
|
+
additionalFields: e
|
|
2246
2251
|
}).extend({
|
|
2247
2252
|
type: d.literal("INTERNAL"),
|
|
2248
2253
|
path: d.string(),
|
|
@@ -2253,8 +2258,7 @@ const ei = i.object({
|
|
|
2253
2258
|
isSingleSelected: e,
|
|
2254
2259
|
additionalFields: n
|
|
2255
2260
|
}) => qt({
|
|
2256
|
-
additionalFields: n
|
|
2257
|
-
isSingleSelected: e
|
|
2261
|
+
additionalFields: n
|
|
2258
2262
|
}).extend({
|
|
2259
2263
|
type: d.literal("EXTERNAL"),
|
|
2260
2264
|
path: d.string().or(d.null()).optional(),
|
|
@@ -2265,8 +2269,7 @@ const ei = i.object({
|
|
|
2265
2269
|
isSingleSelected: e,
|
|
2266
2270
|
additionalFields: n
|
|
2267
2271
|
}) => qt({
|
|
2268
|
-
additionalFields: n
|
|
2269
|
-
isSingleSelected: e
|
|
2272
|
+
additionalFields: n
|
|
2270
2273
|
}).extend({
|
|
2271
2274
|
type: d.literal("WRAPPER"),
|
|
2272
2275
|
path: d.string().or(d.null()).optional()
|
|
@@ -2365,14 +2368,14 @@ const ei = i.object({
|
|
|
2365
2368
|
permissions: b = {},
|
|
2366
2369
|
currentNavigation: S
|
|
2367
2370
|
}) => {
|
|
2368
|
-
const { formatMessage: p } =
|
|
2371
|
+
const { formatMessage: p } = Q(), [f, N] = V(n), { canUpdate: I } = b, [E, v] = V(!1), [T, c] = V(), [w, F] = V(
|
|
2369
2372
|
{}
|
|
2370
|
-
), [_, pe] = V(),
|
|
2373
|
+
), [_, pe] = V(), D = ut(), J = D.data?.availableAudience ?? [], re = D.data?.contentTypes ?? [], { toggleNotification: Se } = ct(), $e = ci(), he = kt(), le = (u, R, Z) => {
|
|
2371
2374
|
if (Z) {
|
|
2372
2375
|
let j = u, y = R;
|
|
2373
2376
|
if (lt(u)) {
|
|
2374
|
-
const { name:
|
|
2375
|
-
j =
|
|
2377
|
+
const { name: M, value: z } = u.target;
|
|
2378
|
+
j = M, y = Qe(y) ? z : y;
|
|
2376
2379
|
}
|
|
2377
2380
|
return bt(j) && K(j, y), Z(u, y);
|
|
2378
2381
|
}
|
|
@@ -2392,42 +2395,42 @@ const ei = i.object({
|
|
|
2392
2395
|
);
|
|
2393
2396
|
}, fe = (u) => ({
|
|
2394
2397
|
...u,
|
|
2395
|
-
additionalFields:
|
|
2398
|
+
additionalFields: D.data?.additionalFields.reduce((R, Z) => {
|
|
2396
2399
|
const { name: j, type: y } = Z;
|
|
2397
2400
|
if (j in (u.additionalFields ?? {})) {
|
|
2398
|
-
let
|
|
2401
|
+
let M = u.additionalFields[j];
|
|
2399
2402
|
switch (y) {
|
|
2400
2403
|
case "boolean":
|
|
2401
|
-
|
|
2404
|
+
M = Jn(M) ? `${M}` : M;
|
|
2402
2405
|
break;
|
|
2403
2406
|
case "media":
|
|
2404
|
-
|
|
2407
|
+
M = M && JSON.stringify(M);
|
|
2405
2408
|
break;
|
|
2406
2409
|
}
|
|
2407
2410
|
return {
|
|
2408
2411
|
...R,
|
|
2409
|
-
[j]:
|
|
2412
|
+
[j]: M
|
|
2410
2413
|
};
|
|
2411
2414
|
}
|
|
2412
2415
|
return R;
|
|
2413
2416
|
}, {}) || {}
|
|
2414
2417
|
}), ye = (u) => ({
|
|
2415
2418
|
...u,
|
|
2416
|
-
additionalFields:
|
|
2419
|
+
additionalFields: D.data?.additionalFields.reduce((R, Z) => {
|
|
2417
2420
|
const { name: j, type: y } = Z;
|
|
2418
2421
|
if (j in (u.additionalFields ?? {})) {
|
|
2419
|
-
let
|
|
2422
|
+
let M = u.additionalFields[j];
|
|
2420
2423
|
switch (y) {
|
|
2421
2424
|
case "boolean":
|
|
2422
|
-
|
|
2425
|
+
M = M === "true";
|
|
2423
2426
|
break;
|
|
2424
2427
|
case "media":
|
|
2425
|
-
|
|
2428
|
+
M = M && JSON.parse(M);
|
|
2426
2429
|
break;
|
|
2427
2430
|
}
|
|
2428
2431
|
return {
|
|
2429
2432
|
...R,
|
|
2430
|
-
[j]:
|
|
2433
|
+
[j]: M
|
|
2431
2434
|
};
|
|
2432
2435
|
}
|
|
2433
2436
|
return R;
|
|
@@ -2437,13 +2440,13 @@ const ei = i.object({
|
|
|
2437
2440
|
const Z = fe(R), {
|
|
2438
2441
|
success: j,
|
|
2439
2442
|
data: y,
|
|
2440
|
-
error:
|
|
2443
|
+
error: M
|
|
2441
2444
|
} = uo({
|
|
2442
2445
|
isSingleSelected: E,
|
|
2443
|
-
additionalFields:
|
|
2446
|
+
additionalFields: D.data?.additionalFields ?? fo
|
|
2444
2447
|
}).safeParse(Z);
|
|
2445
2448
|
if (j) {
|
|
2446
|
-
const z = y.title.trim() ? y.title.trim() : y.type === "INTERNAL" ?
|
|
2449
|
+
const z = y.title.trim() ? y.title.trim() : y.type === "INTERNAL" ? x(y?.related?.toString(), y.relatedType, E) : "";
|
|
2447
2450
|
N(!0);
|
|
2448
2451
|
const Ie = await mo(
|
|
2449
2452
|
y.type === "INTERNAL" ? {
|
|
@@ -2471,8 +2474,8 @@ const ei = i.object({
|
|
|
2471
2474
|
uiRouterKey: Ie
|
|
2472
2475
|
}
|
|
2473
2476
|
);
|
|
2474
|
-
} else
|
|
2475
|
-
|
|
2477
|
+
} else M && pe(
|
|
2478
|
+
M.issues.reduce((z, Ie) => ({
|
|
2476
2479
|
...z,
|
|
2477
2480
|
[Ie.path.join(".")]: Ie.message
|
|
2478
2481
|
}), {})
|
|
@@ -2485,23 +2488,23 @@ const ei = i.object({
|
|
|
2485
2488
|
} = w, { relatedType: se, related: xe } = w.type === "INTERNAL" ? w : {
|
|
2486
2489
|
related: void 0,
|
|
2487
2490
|
relatedType: void 0
|
|
2488
|
-
}, g = ve === "EXTERNAL",
|
|
2491
|
+
}, g = ve === "EXTERNAL", k = ve === "INTERNAL", A = g ? "externalPath" : "path", L = k && !E && Qe(xe) || f, B = bn({
|
|
2489
2492
|
uid: se ?? "",
|
|
2490
2493
|
locale: m
|
|
2491
|
-
}), O = po(),
|
|
2494
|
+
}), O = po(), P = ue(
|
|
2492
2495
|
() => e.map((u, R) => ({
|
|
2493
2496
|
key: `${u}-${R}`,
|
|
2494
2497
|
value: u,
|
|
2495
2498
|
label: u
|
|
2496
2499
|
})),
|
|
2497
2500
|
[e]
|
|
2498
|
-
),
|
|
2501
|
+
), U = ue(
|
|
2499
2502
|
() => J.map((u) => ({
|
|
2500
2503
|
value: u.documentId ?? 0,
|
|
2501
2504
|
label: u.name ?? " "
|
|
2502
2505
|
})),
|
|
2503
2506
|
[J]
|
|
2504
|
-
),
|
|
2507
|
+
), x = G(
|
|
2505
2508
|
(u, R, Z) => {
|
|
2506
2509
|
let j;
|
|
2507
2510
|
if (Z) {
|
|
@@ -2511,15 +2514,15 @@ const ei = i.object({
|
|
|
2511
2514
|
return re.find((y) => y.uid === R)?.contentTypeName;
|
|
2512
2515
|
} else
|
|
2513
2516
|
j = {
|
|
2514
|
-
...B.data?.find(({ documentId:
|
|
2517
|
+
...B.data?.find(({ documentId: M }) => M === u) || {
|
|
2515
2518
|
documentId: null
|
|
2516
2519
|
},
|
|
2517
2520
|
__collectionUid: R
|
|
2518
2521
|
};
|
|
2519
|
-
return ft(j,
|
|
2522
|
+
return ft(j, D.data);
|
|
2520
2523
|
},
|
|
2521
|
-
[B.data,
|
|
2522
|
-
), Ue = (
|
|
2524
|
+
[B.data, D.data, re]
|
|
2525
|
+
), Ue = (D.data?.contentTypes.length ? ["INTERNAL", "EXTERNAL", "WRAPPER"] : ["EXTERNAL", "WRAPPER"]).map((u) => ({
|
|
2523
2526
|
key: u,
|
|
2524
2527
|
value: u,
|
|
2525
2528
|
label: p(r(`popup.item.form.type.${u.toLowerCase()}.label`))
|
|
@@ -2531,7 +2534,7 @@ const ei = i.object({
|
|
|
2531
2534
|
...u,
|
|
2532
2535
|
__collectionUid: se
|
|
2533
2536
|
},
|
|
2534
|
-
|
|
2537
|
+
D.data
|
|
2535
2538
|
),
|
|
2536
2539
|
u,
|
|
2537
2540
|
!1
|
|
@@ -2545,15 +2548,15 @@ const ei = i.object({
|
|
|
2545
2548
|
(u) => u.label
|
|
2546
2549
|
), Ve = ue(
|
|
2547
2550
|
() => st(
|
|
2548
|
-
|
|
2551
|
+
D.data?.contentTypes?.filter((u) => u.isSingle ? !!(se && [se, Le].includes(u.uid)) : !0).map((u) => ({
|
|
2549
2552
|
key: u.uid,
|
|
2550
2553
|
value: u.uid,
|
|
2551
2554
|
label: u.contentTypeName
|
|
2552
2555
|
})),
|
|
2553
2556
|
(u) => u.label
|
|
2554
2557
|
),
|
|
2555
|
-
[
|
|
2556
|
-
), $ = ge(Oe),
|
|
2558
|
+
[D.data, se]
|
|
2559
|
+
), $ = ge(Oe), W = G(
|
|
2557
2560
|
async (u) => {
|
|
2558
2561
|
u.preventDefault(), u.stopPropagation();
|
|
2559
2562
|
const R = he.data?.find(({ locale: Z }) => Z === T);
|
|
@@ -2566,8 +2569,8 @@ const ei = i.object({
|
|
|
2566
2569
|
{
|
|
2567
2570
|
onSuccess(Z) {
|
|
2568
2571
|
$e.reset();
|
|
2569
|
-
const { type: j, externalPath: y, path:
|
|
2570
|
-
K("type", j), K("externalPath", y ?? void 0), K("path",
|
|
2572
|
+
const { type: j, externalPath: y, path: M, related: z, title: Ie, uiRouterKey: Rn } = Z, { __type: jt, documentId: Bt } = z ?? {};
|
|
2573
|
+
K("type", j), K("externalPath", y ?? void 0), K("path", M ?? void 0), K("title", Ie), K("uiRouterKey", Rn), jt && Bt && (K("related", Bt), K("relatedType", jt));
|
|
2571
2574
|
},
|
|
2572
2575
|
onSettled() {
|
|
2573
2576
|
N(!1);
|
|
@@ -2586,7 +2589,7 @@ const ei = i.object({
|
|
|
2586
2589
|
);
|
|
2587
2590
|
}, [a]), ie(() => {
|
|
2588
2591
|
if (se) {
|
|
2589
|
-
const u =
|
|
2592
|
+
const u = D.data?.contentTypes.find(
|
|
2590
2593
|
(R) => R.uid === se
|
|
2591
2594
|
);
|
|
2592
2595
|
if (u && (v(u.isSingle), u.isSingle && B.data?.length)) {
|
|
@@ -2594,16 +2597,16 @@ const ei = i.object({
|
|
|
2594
2597
|
R && K("related", R.documentId);
|
|
2595
2598
|
}
|
|
2596
2599
|
}
|
|
2597
|
-
}, [se,
|
|
2598
|
-
if (Ee && ve === "INTERNAL" && xe && se &&
|
|
2600
|
+
}, [se, D.data, B.data]), ie(() => {
|
|
2601
|
+
if (Ee && ve === "INTERNAL" && xe && se && D.data) {
|
|
2599
2602
|
const u = B.data?.find((R) => R.documentId === xe);
|
|
2600
2603
|
if (u) {
|
|
2601
|
-
const { contentTypesNameFields: R, pathDefaultFields: Z } =
|
|
2604
|
+
const { contentTypesNameFields: R, pathDefaultFields: Z } = D.data, j = Z[se]?.reduce(
|
|
2602
2605
|
(z, Ie) => z || u?.[Ie],
|
|
2603
2606
|
void 0
|
|
2604
|
-
), y = (R[se] ?? []).concat(R.default ?? []).reduce((z, Ie) => z || u?.[Ie], void 0),
|
|
2605
|
-
j && j !== Be &&
|
|
2606
|
-
|
|
2607
|
+
), y = (R[se] ?? []).concat(R.default ?? []).reduce((z, Ie) => z || u?.[Ie], void 0), M = [];
|
|
2608
|
+
j && j !== Be && M.push({ name: "path", value: j }), y && y !== Te && M.push({ name: "title", value: y }), setTimeout(() => {
|
|
2609
|
+
M.forEach((z) => {
|
|
2607
2610
|
K(z.name, z.value);
|
|
2608
2611
|
});
|
|
2609
2612
|
}, 100);
|
|
@@ -2616,7 +2619,7 @@ const ei = i.object({
|
|
|
2616
2619
|
ve,
|
|
2617
2620
|
xe,
|
|
2618
2621
|
se,
|
|
2619
|
-
|
|
2622
|
+
D.data,
|
|
2620
2623
|
B.data
|
|
2621
2624
|
]), /* @__PURE__ */ h(Re, { children: [
|
|
2622
2625
|
/* @__PURE__ */ t(de.Body, { children: /* @__PURE__ */ t(yt, { method: "POST", initialValues: w, children: ({ values: u, onChange: R }) => {
|
|
@@ -2628,7 +2631,7 @@ const ei = i.object({
|
|
|
2628
2631
|
isExternal: u.type === "EXTERNAL",
|
|
2629
2632
|
current: a,
|
|
2630
2633
|
currentType: u.type,
|
|
2631
|
-
config:
|
|
2634
|
+
config: D.data,
|
|
2632
2635
|
contentTypeItems: B.data,
|
|
2633
2636
|
currentRelated: Z.related,
|
|
2634
2637
|
currentRelatedType: Z.relatedType,
|
|
@@ -2637,7 +2640,7 @@ const ei = i.object({
|
|
|
2637
2640
|
return /* @__PURE__ */ h(Re, { children: [
|
|
2638
2641
|
/* @__PURE__ */ h(C.Root, { gap: 5, paddingBottom: 1, children: [
|
|
2639
2642
|
/* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 8, children: /* @__PURE__ */ t(
|
|
2640
|
-
|
|
2643
|
+
X,
|
|
2641
2644
|
{
|
|
2642
2645
|
name: "type",
|
|
2643
2646
|
label: p(r("popup.item.form.type.label", "Internal link")),
|
|
@@ -2653,13 +2656,13 @@ const ei = i.object({
|
|
|
2653
2656
|
name: "type",
|
|
2654
2657
|
disabled: !I,
|
|
2655
2658
|
width: "100%",
|
|
2656
|
-
children: Ue.map(({ key: y, label:
|
|
2659
|
+
children: Ue.map(({ key: y, label: M, value: z }) => /* @__PURE__ */ t(je, { value: z, children: M }, y))
|
|
2657
2660
|
}
|
|
2658
2661
|
)
|
|
2659
2662
|
}
|
|
2660
2663
|
) }, "title"),
|
|
2661
2664
|
/* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 4, children: /* @__PURE__ */ t(
|
|
2662
|
-
|
|
2665
|
+
X,
|
|
2663
2666
|
{
|
|
2664
2667
|
name: "menuAttached",
|
|
2665
2668
|
label: p(
|
|
@@ -2685,7 +2688,7 @@ const ei = i.object({
|
|
|
2685
2688
|
offLabel: p(
|
|
2686
2689
|
r("popup.item.form.menuAttached.value.no", "no")
|
|
2687
2690
|
),
|
|
2688
|
-
disabled: !I || (
|
|
2691
|
+
disabled: !I || (D.data?.cascadeMenuAttached ? !(a.isMenuAllowedLevel && a.parentAttachedToMenu) : !1),
|
|
2689
2692
|
width: "100%"
|
|
2690
2693
|
}
|
|
2691
2694
|
)
|
|
@@ -2699,7 +2702,7 @@ const ei = i.object({
|
|
|
2699
2702
|
alignItems: "flex-start",
|
|
2700
2703
|
col: u.type === "INTERNAL" ? 8 : 12,
|
|
2701
2704
|
children: /* @__PURE__ */ t(
|
|
2702
|
-
|
|
2705
|
+
X,
|
|
2703
2706
|
{
|
|
2704
2707
|
name: "title",
|
|
2705
2708
|
label: p(r("popup.item.form.title.label", "Title")),
|
|
@@ -2708,12 +2711,12 @@ const ei = i.object({
|
|
|
2708
2711
|
r("popup.item.form.title.placeholder", "e.g. Blog")
|
|
2709
2712
|
),
|
|
2710
2713
|
children: /* @__PURE__ */ t(
|
|
2711
|
-
|
|
2714
|
+
He,
|
|
2712
2715
|
{
|
|
2713
2716
|
type: "string",
|
|
2714
2717
|
disabled: !I || u.autoSync && u.type === "INTERNAL",
|
|
2715
2718
|
name: "title",
|
|
2716
|
-
onChange: (y,
|
|
2719
|
+
onChange: (y, M) => le(y, M, R),
|
|
2717
2720
|
value: u.title
|
|
2718
2721
|
}
|
|
2719
2722
|
)
|
|
@@ -2723,7 +2726,7 @@ const ei = i.object({
|
|
|
2723
2726
|
"title"
|
|
2724
2727
|
),
|
|
2725
2728
|
u.type === "INTERNAL" && /* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 4, children: /* @__PURE__ */ t(
|
|
2726
|
-
|
|
2729
|
+
X,
|
|
2727
2730
|
{
|
|
2728
2731
|
name: "autoSync",
|
|
2729
2732
|
label: p(
|
|
@@ -2744,7 +2747,7 @@ const ei = i.object({
|
|
|
2744
2747
|
) }, "autoSync")
|
|
2745
2748
|
] }),
|
|
2746
2749
|
/* @__PURE__ */ t(C.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ t(
|
|
2747
|
-
|
|
2750
|
+
X,
|
|
2748
2751
|
{
|
|
2749
2752
|
name: A,
|
|
2750
2753
|
label: p(
|
|
@@ -2760,11 +2763,11 @@ const ei = i.object({
|
|
|
2760
2763
|
}) : ""
|
|
2761
2764
|
].join(" "),
|
|
2762
2765
|
children: /* @__PURE__ */ t(
|
|
2763
|
-
|
|
2766
|
+
He,
|
|
2764
2767
|
{
|
|
2765
2768
|
disabled: !I,
|
|
2766
2769
|
name: A,
|
|
2767
|
-
onChange: (y,
|
|
2770
|
+
onChange: (y, M) => le(y, M, R),
|
|
2768
2771
|
value: u[A],
|
|
2769
2772
|
width: "100%"
|
|
2770
2773
|
}
|
|
@@ -2778,7 +2781,7 @@ const ei = i.object({
|
|
|
2778
2781
|
alignItems: "flex-start",
|
|
2779
2782
|
col: u.relatedType && !E ? 6 : 12,
|
|
2780
2783
|
children: /* @__PURE__ */ t(
|
|
2781
|
-
|
|
2784
|
+
X,
|
|
2782
2785
|
{
|
|
2783
2786
|
name: "relatedType",
|
|
2784
2787
|
label: p(
|
|
@@ -2797,9 +2800,9 @@ const ei = i.object({
|
|
|
2797
2800
|
name: "relatedType",
|
|
2798
2801
|
onChange: (y) => le("relatedType", y, R),
|
|
2799
2802
|
value: u.relatedType,
|
|
2800
|
-
disabled: !
|
|
2803
|
+
disabled: !D.data?.contentTypes.length || !I,
|
|
2801
2804
|
width: "100%",
|
|
2802
|
-
children:
|
|
2805
|
+
children: D.data?.contentTypes.map((y) => /* @__PURE__ */ t(je, { value: y.uid, children: y.contentTypeName }, y.uid))
|
|
2803
2806
|
}
|
|
2804
2807
|
)
|
|
2805
2808
|
}
|
|
@@ -2807,7 +2810,7 @@ const ei = i.object({
|
|
|
2807
2810
|
}
|
|
2808
2811
|
),
|
|
2809
2812
|
u.relatedType && !E && /* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 6, children: /* @__PURE__ */ t(
|
|
2810
|
-
|
|
2813
|
+
X,
|
|
2811
2814
|
{
|
|
2812
2815
|
name: "related",
|
|
2813
2816
|
label: p(r("popup.item.form.related.label", "Related")),
|
|
@@ -2828,20 +2831,20 @@ const ei = i.object({
|
|
|
2828
2831
|
options: Oe,
|
|
2829
2832
|
disabled: f || $ || !I,
|
|
2830
2833
|
width: "100%",
|
|
2831
|
-
children: Oe.map(({ key: y, label:
|
|
2834
|
+
children: Oe.map(({ key: y, label: M, value: z }) => /* @__PURE__ */ t(je, { value: z, children: M }, y))
|
|
2832
2835
|
}
|
|
2833
2836
|
)
|
|
2834
2837
|
}
|
|
2835
2838
|
) })
|
|
2836
2839
|
] }),
|
|
2837
|
-
!ge(
|
|
2840
|
+
!ge(D.data?.additionalFields) && /* @__PURE__ */ h(Re, { children: [
|
|
2838
2841
|
/* @__PURE__ */ t(C.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ t(C.Item, { col: 12, lg: 12, children: /* @__PURE__ */ t(mt, { width: "100%" }) }) }),
|
|
2839
2842
|
/* @__PURE__ */ h(C.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: [
|
|
2840
|
-
|
|
2841
|
-
(y,
|
|
2843
|
+
D.data?.additionalFields.map(
|
|
2844
|
+
(y, M) => {
|
|
2842
2845
|
if (y !== "audience")
|
|
2843
2846
|
return /* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 6, children: /* @__PURE__ */ t(
|
|
2844
|
-
|
|
2847
|
+
X,
|
|
2845
2848
|
{
|
|
2846
2849
|
name: `additionalFields.${y.name}`,
|
|
2847
2850
|
label: y.label,
|
|
@@ -2862,26 +2865,26 @@ const ei = i.object({
|
|
|
2862
2865
|
) }, y.name);
|
|
2863
2866
|
}
|
|
2864
2867
|
),
|
|
2865
|
-
|
|
2866
|
-
(y,
|
|
2868
|
+
D.data?.additionalFields.map(
|
|
2869
|
+
(y, M) => {
|
|
2867
2870
|
if (y === "audience")
|
|
2868
2871
|
return /* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ t(
|
|
2869
|
-
|
|
2872
|
+
X,
|
|
2870
2873
|
{
|
|
2871
2874
|
name: "audience",
|
|
2872
2875
|
label: p(r("popup.item.form.audience.label")),
|
|
2873
2876
|
error: ae("audience"),
|
|
2874
|
-
hint: !f && ge(
|
|
2877
|
+
hint: !f && ge(U) ? p(
|
|
2875
2878
|
r("popup.item.form.title.placeholder", "e.g. Blog")
|
|
2876
2879
|
) : void 0,
|
|
2877
2880
|
children: /* @__PURE__ */ t(
|
|
2878
|
-
|
|
2881
|
+
Xe,
|
|
2879
2882
|
{
|
|
2880
2883
|
name: "audience",
|
|
2881
2884
|
value: u.audience,
|
|
2882
2885
|
onChange: (z) => le("audience", z, R),
|
|
2883
2886
|
width: "100%",
|
|
2884
|
-
children:
|
|
2887
|
+
children: U.map(({ value: z, label: Ie }) => /* @__PURE__ */ t(Ge, { value: z, children: Ie }, z))
|
|
2885
2888
|
}
|
|
2886
2889
|
)
|
|
2887
2890
|
}
|
|
@@ -2891,11 +2894,11 @@ const ei = i.object({
|
|
|
2891
2894
|
] }),
|
|
2892
2895
|
/* @__PURE__ */ t(C.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ t(C.Item, { col: 12, lg: 12, children: /* @__PURE__ */ t(mt, { width: "100%" }) }) })
|
|
2893
2896
|
] }),
|
|
2894
|
-
|
|
2897
|
+
P && P.length > 1 && /* @__PURE__ */ t(C.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ h(C.Item, { alignItems: "flex-start", col: 12, children: [
|
|
2895
2898
|
/* @__PURE__ */ t(mt, { marginTop: 5, marginBottom: 5 }),
|
|
2896
2899
|
/* @__PURE__ */ h(C.Root, { gap: 5, children: [
|
|
2897
2900
|
/* @__PURE__ */ t(C.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ t(
|
|
2898
|
-
|
|
2901
|
+
X,
|
|
2899
2902
|
{
|
|
2900
2903
|
name: "i18n.locale",
|
|
2901
2904
|
label: p(
|
|
@@ -2911,7 +2914,7 @@ const ei = i.object({
|
|
|
2911
2914
|
placeholder: p(
|
|
2912
2915
|
r("popup.item.form.i18n.locale.placeholder", "locale")
|
|
2913
2916
|
),
|
|
2914
|
-
children:
|
|
2917
|
+
children: P.map(({ key: y, label: M, value: z }) => /* @__PURE__ */ t(je, { value: z, children: M }, y))
|
|
2915
2918
|
}
|
|
2916
2919
|
)
|
|
2917
2920
|
}
|
|
@@ -2920,7 +2923,7 @@ const ei = i.object({
|
|
|
2920
2923
|
oe,
|
|
2921
2924
|
{
|
|
2922
2925
|
variant: "tertiary",
|
|
2923
|
-
onClick:
|
|
2926
|
+
onClick: W,
|
|
2924
2927
|
disabled: f || !T,
|
|
2925
2928
|
children: p(r("popup.item.form.i18n.locale.button"))
|
|
2926
2929
|
}
|
|
@@ -2944,7 +2947,7 @@ const ei = i.object({
|
|
|
2944
2947
|
isNewItem: e,
|
|
2945
2948
|
canUpdate: n
|
|
2946
2949
|
}) => {
|
|
2947
|
-
const { formatMessage: a } =
|
|
2950
|
+
const { formatMessage: a } = Q();
|
|
2948
2951
|
let l = "view";
|
|
2949
2952
|
return n && (l = e ? "new" : "edit"), /* @__PURE__ */ t(de.Header, { children: /* @__PURE__ */ t(
|
|
2950
2953
|
q,
|
|
@@ -2968,7 +2971,7 @@ const ei = i.object({
|
|
|
2968
2971
|
permissions: b,
|
|
2969
2972
|
currentNavigation: S
|
|
2970
2973
|
}) => {
|
|
2971
|
-
const { formatMessage: p } =
|
|
2974
|
+
const { formatMessage: p } = Q(), f = (E) => {
|
|
2972
2975
|
s(E);
|
|
2973
2976
|
}, N = (E, v, T) => `${gi({
|
|
2974
2977
|
relatedRef: v,
|
|
@@ -3009,7 +3012,7 @@ const ei = i.object({
|
|
|
3009
3012
|
}
|
|
3010
3013
|
);
|
|
3011
3014
|
}, wt = 0, vo = ({ value: e, setValue: n, initialIndex: a = wt }) => {
|
|
3012
|
-
const [l, s] = V(e), [o, m] = V(e), [b, S] = V(a), [p, f] = V(!!e), N = rt(null), { formatMessage: I } =
|
|
3015
|
+
const [l, s] = V(e), [o, m] = V(e), [b, S] = V(a), [p, f] = V(!!e), N = rt(null), { formatMessage: I } = Q();
|
|
3013
3016
|
ie(() => {
|
|
3014
3017
|
p && setTimeout(() => {
|
|
3015
3018
|
N.current?.querySelector("input")?.focus();
|
|
@@ -3025,14 +3028,14 @@ const ei = i.object({
|
|
|
3025
3028
|
index: wt
|
|
3026
3029
|
}));
|
|
3027
3030
|
}, [l, o]);
|
|
3028
|
-
const E =
|
|
3031
|
+
const E = G((c) => {
|
|
3029
3032
|
c.code.toLowerCase() === "enter" && S((w) => w + 1);
|
|
3030
|
-
}, []), v =
|
|
3033
|
+
}, []), v = G(
|
|
3031
3034
|
(c) => {
|
|
3032
3035
|
s(c.target.value);
|
|
3033
3036
|
},
|
|
3034
3037
|
[s]
|
|
3035
|
-
), T =
|
|
3038
|
+
), T = G(() => {
|
|
3036
3039
|
s(""), f(!1);
|
|
3037
3040
|
}, [s, f]);
|
|
3038
3041
|
return p ? /* @__PURE__ */ h("div", { ref: N, children: [
|
|
@@ -3065,22 +3068,22 @@ const ei = i.object({
|
|
|
3065
3068
|
)
|
|
3066
3069
|
] }) : /* @__PURE__ */ t(De, { children: /* @__PURE__ */ t(ma, {}), onClick: () => f(!p) });
|
|
3067
3070
|
}, To = new dn(), wo = () => {
|
|
3068
|
-
const { formatMessage: e } =
|
|
3071
|
+
const { formatMessage: e } = Q(), n = Pt(), [a, l] = V(), [s, o] = V(), [m, b] = V(), [S, p] = V(!1), [f, N] = V(!1), [I, E] = V(), v = ue(
|
|
3069
3072
|
() => ({
|
|
3070
|
-
access:
|
|
3071
|
-
update:
|
|
3073
|
+
access: We.access || We.update,
|
|
3074
|
+
update: We.update
|
|
3072
3075
|
}),
|
|
3073
3076
|
[]
|
|
3074
3077
|
), {
|
|
3075
3078
|
isLoading: T,
|
|
3076
3079
|
allowedActions: { canUpdate: c, canAccess: w }
|
|
3077
|
-
} = Ln(v), F = kt(), _ = ut(), pe = Cn(),
|
|
3080
|
+
} = Ln(v), F = kt(), _ = ut(), pe = Cn(), D = vn([F, { isPending: T }]), J = ui(), [{ value: re, index: Se }, $e] = V({
|
|
3078
3081
|
value: "",
|
|
3079
3082
|
index: 0
|
|
3080
|
-
}), he = ge(re), le = (re || "").toLowerCase(), K = ($,
|
|
3083
|
+
}), he = ge(re), le = (re || "").toLowerCase(), K = ($, W, u) => {
|
|
3081
3084
|
const R = $.reduce((Z, j) => {
|
|
3082
|
-
const y = j.items?.length ? K(j.items ?? [],
|
|
3083
|
-
return
|
|
3085
|
+
const y = j.items?.length ? K(j.items ?? [], W) : [];
|
|
3086
|
+
return W(j) ? [j, ...y, ...Z] : [...y, ...Z];
|
|
3084
3087
|
}, []);
|
|
3085
3088
|
if (u !== void 0) {
|
|
3086
3089
|
const Z = u % R.length;
|
|
@@ -3091,15 +3094,15 @@ const ei = i.object({
|
|
|
3091
3094
|
s?.items.map(($) => ({ ...$ })) ?? [],
|
|
3092
3095
|
($) => ($?.title || "").toLowerCase().includes(le),
|
|
3093
3096
|
le ? Se : void 0
|
|
3094
|
-
), ye =
|
|
3095
|
-
($,
|
|
3096
|
-
b(
|
|
3097
|
+
), ye = G(
|
|
3098
|
+
($, W = {}) => {
|
|
3099
|
+
b(W), p($);
|
|
3097
3100
|
},
|
|
3098
3101
|
[p]
|
|
3099
|
-
), Fe =
|
|
3100
|
-
($,
|
|
3102
|
+
), Fe = G(
|
|
3103
|
+
($, W, u = !0, R = "", Z = !0, j = "0", y = 0) => {
|
|
3101
3104
|
c && ($.preventDefault(), $.stopPropagation(), ye(!0, {
|
|
3102
|
-
viewParentId:
|
|
3105
|
+
viewParentId: W,
|
|
3103
3106
|
isMenuAllowedLevel: u,
|
|
3104
3107
|
levelPath: R,
|
|
3105
3108
|
parentAttachedToMenu: Z,
|
|
@@ -3118,16 +3121,16 @@ const ei = i.object({
|
|
|
3118
3121
|
setI18nCopyModalOpened: Ee,
|
|
3119
3122
|
setI18nCopySourceLocale: se
|
|
3120
3123
|
} = mi(
|
|
3121
|
-
|
|
3124
|
+
G(
|
|
3122
3125
|
($) => {
|
|
3123
|
-
const
|
|
3126
|
+
const W = F.data?.find(
|
|
3124
3127
|
({ locale: u, documentId: R }) => u === $ && R === s?.documentId
|
|
3125
3128
|
);
|
|
3126
|
-
|
|
3129
|
+
W && W.documentId && s?.documentId && J.mutate(
|
|
3127
3130
|
{
|
|
3128
|
-
source:
|
|
3131
|
+
source: W.locale,
|
|
3129
3132
|
target: s.locale,
|
|
3130
|
-
documentId:
|
|
3133
|
+
documentId: W.documentId
|
|
3131
3134
|
},
|
|
3132
3135
|
{
|
|
3133
3136
|
onSuccess(u) {
|
|
@@ -3141,27 +3144,27 @@ const ei = i.object({
|
|
|
3141
3144
|
},
|
|
3142
3145
|
[s]
|
|
3143
3146
|
)
|
|
3144
|
-
), xe =
|
|
3147
|
+
), xe = G(() => {
|
|
3145
3148
|
Te && Ee(!0);
|
|
3146
3149
|
}, [Ee, Te]), g = In(() => {
|
|
3147
3150
|
l({
|
|
3148
3151
|
documentId: s?.documentId,
|
|
3149
3152
|
id: s?.id
|
|
3150
3153
|
}), o(void 0);
|
|
3151
|
-
}),
|
|
3154
|
+
}), k = () => {
|
|
3152
3155
|
s && g.mutate(s);
|
|
3153
3156
|
}, A = ($) => {
|
|
3154
3157
|
$.preventDefault(), $.stopPropagation(), $.target.tagName !== "HTML" && ye(!1);
|
|
3155
3158
|
}, L = ({
|
|
3156
3159
|
item: $,
|
|
3157
|
-
newOrder:
|
|
3160
|
+
newOrder: W
|
|
3158
3161
|
}) => {
|
|
3159
|
-
|
|
3162
|
+
x({
|
|
3160
3163
|
...$,
|
|
3161
|
-
order:
|
|
3164
|
+
order: W
|
|
3162
3165
|
});
|
|
3163
3166
|
}, B = ($) => {
|
|
3164
|
-
|
|
3167
|
+
x(
|
|
3165
3168
|
ze(
|
|
3166
3169
|
{
|
|
3167
3170
|
...$,
|
|
@@ -3171,7 +3174,7 @@ const ei = i.object({
|
|
|
3171
3174
|
)
|
|
3172
3175
|
);
|
|
3173
3176
|
}, O = ($) => {
|
|
3174
|
-
|
|
3177
|
+
x(
|
|
3175
3178
|
ze(
|
|
3176
3179
|
{
|
|
3177
3180
|
...$,
|
|
@@ -3180,8 +3183,8 @@ const ei = i.object({
|
|
|
3180
3183
|
!0
|
|
3181
3184
|
)
|
|
3182
3185
|
);
|
|
3183
|
-
},
|
|
3184
|
-
|
|
3186
|
+
}, P = ($) => {
|
|
3187
|
+
x(
|
|
3185
3188
|
ze(
|
|
3186
3189
|
{
|
|
3187
3190
|
...$,
|
|
@@ -3192,39 +3195,39 @@ const ei = i.object({
|
|
|
3192
3195
|
!0
|
|
3193
3196
|
)
|
|
3194
3197
|
);
|
|
3195
|
-
},
|
|
3198
|
+
}, U = ({
|
|
3196
3199
|
item: $,
|
|
3197
|
-
levelPath:
|
|
3200
|
+
levelPath: W = "",
|
|
3198
3201
|
parentAttachedToMenu: u = !0
|
|
3199
3202
|
}) => {
|
|
3200
3203
|
ye(!0, {
|
|
3201
3204
|
...$,
|
|
3202
|
-
levelPath:
|
|
3205
|
+
levelPath: W,
|
|
3203
3206
|
parentAttachedToMenu: u
|
|
3204
3207
|
});
|
|
3205
|
-
},
|
|
3208
|
+
}, x = ($) => {
|
|
3206
3209
|
if (s && _.data) {
|
|
3207
|
-
const
|
|
3210
|
+
const W = Ye(
|
|
3208
3211
|
$,
|
|
3209
3212
|
s?.items ?? [],
|
|
3210
3213
|
_.data
|
|
3211
3214
|
);
|
|
3212
3215
|
o({
|
|
3213
3216
|
...s,
|
|
3214
|
-
items:
|
|
3217
|
+
items: W
|
|
3215
3218
|
}), N(!0), p(!1);
|
|
3216
3219
|
}
|
|
3217
|
-
}, be = he ? s?.items ?? [] : fe, Ue =
|
|
3220
|
+
}, be = he ? s?.items ?? [] : fe, Ue = G(() => {
|
|
3218
3221
|
s && o({
|
|
3219
3222
|
...s,
|
|
3220
|
-
items: s.items.map(($) =>
|
|
3223
|
+
items: s.items.map(($) => Ze($, !1))
|
|
3221
3224
|
});
|
|
3222
|
-
}, [o, s,
|
|
3225
|
+
}, [o, s, Ze]), Oe = G(() => {
|
|
3223
3226
|
s && o({
|
|
3224
3227
|
...s,
|
|
3225
|
-
items: s.items.map(($) =>
|
|
3228
|
+
items: s.items.map(($) => Ze($, !0))
|
|
3226
3229
|
});
|
|
3227
|
-
}, [o, s,
|
|
3230
|
+
}, [o, s, Ze]), Ve = [
|
|
3228
3231
|
{
|
|
3229
3232
|
onClick: Ue,
|
|
3230
3233
|
type: "submit",
|
|
@@ -3251,7 +3254,7 @@ const ei = i.object({
|
|
|
3251
3254
|
if (!s && F.data?.[0]) {
|
|
3252
3255
|
let $;
|
|
3253
3256
|
a?.documentId && ($ = F.data.find(
|
|
3254
|
-
(
|
|
3257
|
+
(W) => W.documentId === a.documentId && W.id === a.id
|
|
3255
3258
|
)), l(void 0), o($ || Rt(F.data));
|
|
3256
3259
|
}
|
|
3257
3260
|
}, [F.data]), ie(() => {
|
|
@@ -3260,13 +3263,13 @@ const ei = i.object({
|
|
|
3260
3263
|
if (s && I !== s.locale) {
|
|
3261
3264
|
l(void 0);
|
|
3262
3265
|
const $ = F.data?.find(
|
|
3263
|
-
(
|
|
3266
|
+
(W) => W.documentId === s.documentId && W.locale === I
|
|
3264
3267
|
);
|
|
3265
3268
|
$ && $.documentId === s.documentId && $.locale !== s.locale && o($);
|
|
3266
3269
|
}
|
|
3267
3270
|
}, [s, I, F.data]), ie(() => {
|
|
3268
3271
|
!I && n.data?.defaultLocale && E(n.data.defaultLocale);
|
|
3269
|
-
}, [F.data]), !F.data || !n.data ||
|
|
3272
|
+
}, [F.data]), !F.data || !n.data || D ? /* @__PURE__ */ t(_e.Loading, {}) : /* @__PURE__ */ h(Je.Root, { children: [
|
|
3270
3273
|
/* @__PURE__ */ t(_e.Title, { children: e(r("header.title", "UI Navigation")) }),
|
|
3271
3274
|
/* @__PURE__ */ h(_e.Main, { children: [
|
|
3272
3275
|
/* @__PURE__ */ t(
|
|
@@ -3277,19 +3280,19 @@ const ei = i.object({
|
|
|
3277
3280
|
handleCachePurge: () => pe.mutate(void 0),
|
|
3278
3281
|
handleChangeSelection: o,
|
|
3279
3282
|
handleLocalizationSelection: E,
|
|
3280
|
-
handleSave:
|
|
3283
|
+
handleSave: k,
|
|
3281
3284
|
locale: n.data,
|
|
3282
3285
|
structureHasChanged: f,
|
|
3283
3286
|
permissions: { canUpdate: c },
|
|
3284
3287
|
currentLocale: I
|
|
3285
3288
|
}
|
|
3286
3289
|
),
|
|
3287
|
-
/* @__PURE__ */ h(
|
|
3290
|
+
/* @__PURE__ */ h(Je.Content, { children: [
|
|
3288
3291
|
/* @__PURE__ */ t(
|
|
3289
3292
|
Bi,
|
|
3290
3293
|
{
|
|
3291
3294
|
startActions: /* @__PURE__ */ t(vo, { value: re, setValue: $e }),
|
|
3292
|
-
endActions: Ve.map(({ tradId: $, margin:
|
|
3295
|
+
endActions: Ve.map(({ tradId: $, margin: W, ...u }, R) => /* @__PURE__ */ t(ee, { marginLeft: W, children: /* @__PURE__ */ h(oe, { ...u, children: [
|
|
3293
3296
|
" ",
|
|
3294
3297
|
e(r($)),
|
|
3295
3298
|
" "
|
|
@@ -3302,17 +3305,17 @@ const ei = i.object({
|
|
|
3302
3305
|
items: be,
|
|
3303
3306
|
onItemLevelAdd: Fe,
|
|
3304
3307
|
onItemRemove: B,
|
|
3305
|
-
onItemEdit:
|
|
3308
|
+
onItemEdit: U,
|
|
3306
3309
|
onItemRestore: O,
|
|
3307
3310
|
onItemReOrder: L,
|
|
3308
|
-
onItemToggleCollapse:
|
|
3311
|
+
onItemToggleCollapse: P,
|
|
3309
3312
|
displayFlat: !he,
|
|
3310
3313
|
isParentAttachedToMenu: !0,
|
|
3311
3314
|
permissions: { canUpdate: c, canAccess: w },
|
|
3312
3315
|
structurePrefix: "",
|
|
3313
3316
|
locale: I ?? ""
|
|
3314
3317
|
}
|
|
3315
|
-
) : /* @__PURE__ */ h(
|
|
3318
|
+
) : /* @__PURE__ */ h(H, { direction: "column", minHeight: "400px", justifyContent: "center", children: [
|
|
3316
3319
|
/* @__PURE__ */ t(ee, { padding: 4, children: /* @__PURE__ */ t(q, { variant: "beta", textColor: "neutral600", children: e(r("empty.description")) }) }),
|
|
3317
3320
|
c && /* @__PURE__ */ t(
|
|
3318
3321
|
oe,
|
|
@@ -3324,9 +3327,9 @@ const ei = i.object({
|
|
|
3324
3327
|
children: e(r("empty.cta"))
|
|
3325
3328
|
}
|
|
3326
3329
|
),
|
|
3327
|
-
c && ae.length ? /* @__PURE__ */ h(
|
|
3330
|
+
c && ae.length ? /* @__PURE__ */ h(H, { direction: "column", justifyContent: "center", children: [
|
|
3328
3331
|
/* @__PURE__ */ t(ee, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ t(q, { variant: "beta", textColor: "neutral600", children: e(r("view.i18n.fill.cta.header")) }) }),
|
|
3329
|
-
/* @__PURE__ */ h(
|
|
3332
|
+
/* @__PURE__ */ h(H, { direction: "row", justifyContent: "center", alignItems: "center", children: [
|
|
3330
3333
|
/* @__PURE__ */ t(ee, { paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ t(
|
|
3331
3334
|
qe,
|
|
3332
3335
|
{
|
|
@@ -3354,7 +3357,7 @@ const ei = i.object({
|
|
|
3354
3357
|
{
|
|
3355
3358
|
availableLocale: ae,
|
|
3356
3359
|
currentItem: m,
|
|
3357
|
-
onSubmit:
|
|
3360
|
+
onSubmit: x,
|
|
3358
3361
|
onClose: A,
|
|
3359
3362
|
locale: I,
|
|
3360
3363
|
permissions: { canUpdate: c },
|
|
@@ -3383,7 +3386,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3383
3386
|
const [l, s] = V(
|
|
3384
3387
|
Yn(n) ? n.reduce((m, b) => `${m}${b}; `, "") : ""
|
|
3385
3388
|
);
|
|
3386
|
-
return /* @__PURE__ */ t(
|
|
3389
|
+
return /* @__PURE__ */ t(He, { ...a, onChange: (m) => {
|
|
3387
3390
|
const b = m?.target.value ?? "", S = b.split(";").map((p) => p.trim()).filter((p) => !!p.length);
|
|
3388
3391
|
s(b ?? ""), e(S);
|
|
3389
3392
|
}, value: l });
|
|
@@ -3405,7 +3408,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3405
3408
|
onSubmit: a,
|
|
3406
3409
|
onClose: l
|
|
3407
3410
|
}) => {
|
|
3408
|
-
const s = Fo($o), { formatMessage: o } =
|
|
3411
|
+
const s = Fo($o), { formatMessage: o } = Q(), [m, b] = V({}), [S, p] = V(), { type: f } = m;
|
|
3409
3412
|
ie(() => {
|
|
3410
3413
|
n && b({
|
|
3411
3414
|
...n
|
|
@@ -3415,8 +3418,8 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3415
3418
|
if (w) {
|
|
3416
3419
|
let F = T, _ = c;
|
|
3417
3420
|
if (lt(T)) {
|
|
3418
|
-
const { name: pe, value:
|
|
3419
|
-
F = pe, _ =
|
|
3421
|
+
const { name: pe, value: D } = T.target;
|
|
3422
|
+
F = pe, _ = Qe(_) ? D : _;
|
|
3420
3423
|
}
|
|
3421
3424
|
return bt(F) && I(F, _), w(T, _);
|
|
3422
3425
|
}
|
|
@@ -3429,9 +3432,9 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3429
3432
|
return o(r(T));
|
|
3430
3433
|
}, v = (T, c) => {
|
|
3431
3434
|
const { success: w, data: F, error: _ } = gn.safeParse(c);
|
|
3432
|
-
w ? a(c) : _ && p(_.issues.reduce((pe,
|
|
3435
|
+
w ? a(c) : _ && p(_.issues.reduce((pe, D) => ({
|
|
3433
3436
|
...pe,
|
|
3434
|
-
[
|
|
3437
|
+
[D.path.join(".")]: D.message
|
|
3435
3438
|
}), {}));
|
|
3436
3439
|
};
|
|
3437
3440
|
return /* @__PURE__ */ h(Re, { children: [
|
|
@@ -3442,14 +3445,14 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3442
3445
|
initialValues: m,
|
|
3443
3446
|
children: ({ values: T, onChange: c }) => /* @__PURE__ */ h(C.Root, { gap: 5, children: [
|
|
3444
3447
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3445
|
-
|
|
3448
|
+
X,
|
|
3446
3449
|
{
|
|
3447
3450
|
name: "name",
|
|
3448
3451
|
label: o(r(`${me}name.label`)),
|
|
3449
3452
|
hint: o(r(`${me}name.description`)),
|
|
3450
3453
|
error: E("name"),
|
|
3451
3454
|
children: /* @__PURE__ */ t(
|
|
3452
|
-
|
|
3455
|
+
He,
|
|
3453
3456
|
{
|
|
3454
3457
|
name: "name",
|
|
3455
3458
|
value: T.name,
|
|
@@ -3463,14 +3466,14 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3463
3466
|
}
|
|
3464
3467
|
) }, "name"),
|
|
3465
3468
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3466
|
-
|
|
3469
|
+
X,
|
|
3467
3470
|
{
|
|
3468
3471
|
name: "label",
|
|
3469
3472
|
label: o(r(`${me}label.label`)),
|
|
3470
3473
|
hint: o(r(`${me}label.description`)),
|
|
3471
3474
|
error: E("label"),
|
|
3472
3475
|
children: /* @__PURE__ */ t(
|
|
3473
|
-
|
|
3476
|
+
He,
|
|
3474
3477
|
{
|
|
3475
3478
|
name: "label",
|
|
3476
3479
|
value: T.label,
|
|
@@ -3483,7 +3486,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3483
3486
|
}
|
|
3484
3487
|
) }, "label"),
|
|
3485
3488
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3486
|
-
|
|
3489
|
+
X,
|
|
3487
3490
|
{
|
|
3488
3491
|
name: "type",
|
|
3489
3492
|
label: o(r(`${me}type.label`)),
|
|
@@ -3503,7 +3506,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3503
3506
|
) }, "type"),
|
|
3504
3507
|
f === "select" && /* @__PURE__ */ h(Re, { children: [
|
|
3505
3508
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3506
|
-
|
|
3509
|
+
X,
|
|
3507
3510
|
{
|
|
3508
3511
|
name: "multi",
|
|
3509
3512
|
label: o(r(`${me}multi.label`)),
|
|
@@ -3523,7 +3526,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3523
3526
|
}
|
|
3524
3527
|
) }, "multi"),
|
|
3525
3528
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3526
|
-
|
|
3529
|
+
X,
|
|
3527
3530
|
{
|
|
3528
3531
|
name: "options",
|
|
3529
3532
|
label: o(r(`${me}options.label`)),
|
|
@@ -3541,7 +3544,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3541
3544
|
) }, "options")
|
|
3542
3545
|
] }),
|
|
3543
3546
|
/* @__PURE__ */ t(C.Item, { col: 12, children: /* @__PURE__ */ t(
|
|
3544
|
-
|
|
3547
|
+
X,
|
|
3545
3548
|
{
|
|
3546
3549
|
name: "required",
|
|
3547
3550
|
label: o(r(`${me}required.label`)),
|
|
@@ -3575,7 +3578,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3575
3578
|
onSubmit: a,
|
|
3576
3579
|
data: l
|
|
3577
3580
|
}) => {
|
|
3578
|
-
const s = !!l, { formatMessage: o } =
|
|
3581
|
+
const s = !!l, { formatMessage: o } = Q();
|
|
3579
3582
|
return /* @__PURE__ */ t(
|
|
3580
3583
|
de.Root,
|
|
3581
3584
|
{
|
|
@@ -3618,14 +3621,14 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3618
3621
|
onRemoveCustomField: a,
|
|
3619
3622
|
onToggleCustomField: l
|
|
3620
3623
|
}) => {
|
|
3621
|
-
const [s, o] = V(!1), [m, b] = V(null), { toggleNotification: S } = ct(), p = ue(() => st(e, "name"), [e]), { formatMessage: f } =
|
|
3624
|
+
const [s, o] = V(!1), [m, b] = V(null), { toggleNotification: S } = ct(), p = ue(() => st(e, "name"), [e]), { formatMessage: f } = Q(), N = G(
|
|
3622
3625
|
(v) => {
|
|
3623
3626
|
b(v), o(!0);
|
|
3624
3627
|
},
|
|
3625
3628
|
[b, o]
|
|
3626
|
-
), I =
|
|
3629
|
+
), I = G(() => {
|
|
3627
3630
|
b(null), o(!1);
|
|
3628
|
-
}, [b, o]), E =
|
|
3631
|
+
}, [b, o]), E = G(() => {
|
|
3629
3632
|
m === null ? S({
|
|
3630
3633
|
type: "warning",
|
|
3631
3634
|
message: f(r(`${Ce}confirmation.error`))
|
|
@@ -3652,7 +3655,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3652
3655
|
colCount: 4,
|
|
3653
3656
|
rowCount: e.length + 1,
|
|
3654
3657
|
footer: /* @__PURE__ */ t(
|
|
3655
|
-
|
|
3658
|
+
Qn,
|
|
3656
3659
|
{
|
|
3657
3660
|
onClick: (v) => {
|
|
3658
3661
|
v.preventDefault(), n(null);
|
|
@@ -3667,7 +3670,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3667
3670
|
/* @__PURE__ */ t(Ne, { width: "60%", children: /* @__PURE__ */ t(q, { variant: "sigma", textColor: "neutral600", children: f(r(`${Ce}header.label`)) }) }),
|
|
3668
3671
|
/* @__PURE__ */ t(Ne, { width: "15%", children: /* @__PURE__ */ t(q, { variant: "sigma", textColor: "neutral600", children: f(r(`${Ce}header.type`)) }) }),
|
|
3669
3672
|
/* @__PURE__ */ t(Ne, { width: "5%", children: /* @__PURE__ */ t(q, { variant: "sigma", textColor: "neutral600", children: f(r(`${Ce}header.required`)) }) }),
|
|
3670
|
-
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(
|
|
3673
|
+
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(Wn, {}) })
|
|
3671
3674
|
] }) }),
|
|
3672
3675
|
/* @__PURE__ */ t(rn, { children: p.map(
|
|
3673
3676
|
(v) => typeof v != "string" ? /* @__PURE__ */ h(gt, { children: [
|
|
@@ -3675,7 +3678,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3675
3678
|
/* @__PURE__ */ t(Ae, { width: "60%", children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: v.label }) }),
|
|
3676
3679
|
/* @__PURE__ */ t(Ae, { width: "15%", children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: v.type }) }),
|
|
3677
3680
|
/* @__PURE__ */ t(Ae, { width: "5%", children: /* @__PURE__ */ t(
|
|
3678
|
-
|
|
3681
|
+
Hn,
|
|
3679
3682
|
{
|
|
3680
3683
|
description: f(
|
|
3681
3684
|
r(`${Ce}${v.required ? "required" : "notRequired"}`)
|
|
@@ -3683,7 +3686,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3683
3686
|
children: /* @__PURE__ */ t(q, { textColor: "neutral800", children: v.required ? /* @__PURE__ */ t(dt, {}) : /* @__PURE__ */ t(ha, {}) })
|
|
3684
3687
|
}
|
|
3685
3688
|
) }),
|
|
3686
|
-
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(
|
|
3689
|
+
/* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(H, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ h(ln, { children: [
|
|
3687
3690
|
/* @__PURE__ */ t(
|
|
3688
3691
|
De,
|
|
3689
3692
|
{
|
|
@@ -3826,30 +3829,30 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3826
3829
|
shadow: "filterShadow",
|
|
3827
3830
|
padding: 6
|
|
3828
3831
|
}, tn = new dn(), Ko = () => {
|
|
3829
|
-
const e = jo(), n = Vo(), a = _o(), l = Oo(), s = Bo(), { formatMessage: o } =
|
|
3832
|
+
const e = jo(), n = Vo(), a = _o(), l = Oo(), s = Bo(), { formatMessage: o } = Q(), [m, b] = V({ required: !1 }), [S, p] = V(!1), f = En("SettingsPage", (g) => g.permissions), N = ue(() => !!f.find(({ action: g }) => g === We.settings[0].action), [f]), I = ue(() => !!f.find(({ action: g }) => g === We.access[0].action), [f]), E = e.isPending || n.isPending || a.isPending || s.isPending || l.isPending, [v, T] = V({}), [c, w] = V(), [F, _] = V(!1), [pe, D] = V(!1), [J, re] = V(
|
|
3830
3833
|
null
|
|
3831
3834
|
), {
|
|
3832
3835
|
contentTypesNameFields: Se,
|
|
3833
3836
|
contentTypes: $e,
|
|
3834
3837
|
additionalFields: he,
|
|
3835
3838
|
preferCustomContentTypes: le
|
|
3836
|
-
} = v, K = (g,
|
|
3839
|
+
} = v, K = (g, k, A) => {
|
|
3837
3840
|
if (A) {
|
|
3838
|
-
let L = g, B =
|
|
3841
|
+
let L = g, B = k;
|
|
3839
3842
|
if (lt(g)) {
|
|
3840
|
-
const { name: O, value:
|
|
3841
|
-
L = O, B =
|
|
3843
|
+
const { name: O, value: P } = g.target;
|
|
3844
|
+
L = O, B = Qe(B) ? P : B;
|
|
3842
3845
|
}
|
|
3843
3846
|
return bt(L) && fe(L, B), A(g, B);
|
|
3844
3847
|
}
|
|
3845
|
-
}, fe = (g,
|
|
3848
|
+
}, fe = (g, k) => {
|
|
3846
3849
|
T(
|
|
3847
3850
|
(A) => It(
|
|
3848
3851
|
{
|
|
3849
3852
|
...A
|
|
3850
3853
|
},
|
|
3851
3854
|
g,
|
|
3852
|
-
|
|
3855
|
+
k
|
|
3853
3856
|
)
|
|
3854
3857
|
);
|
|
3855
3858
|
}, ye = (g) => {
|
|
@@ -3858,13 +3861,13 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3858
3861
|
}, Fe = (g) => {
|
|
3859
3862
|
re(g), _(!0);
|
|
3860
3863
|
}, ae = (g) => {
|
|
3861
|
-
const
|
|
3864
|
+
const k = he.filter(
|
|
3862
3865
|
(A) => typeof A != "string" ? A.name !== g.name : !0
|
|
3863
3866
|
);
|
|
3864
|
-
fe("additionalFields",
|
|
3867
|
+
fe("additionalFields", k), re(null), _(!1);
|
|
3865
3868
|
}, Le = (g) => {
|
|
3866
|
-
const
|
|
3867
|
-
(L) => typeof L != "string" && g.name === L.name ?
|
|
3869
|
+
const k = { ...g, enabled: !g.enabled }, A = he.map(
|
|
3870
|
+
(L) => typeof L != "string" && g.name === L.name ? k : L
|
|
3868
3871
|
);
|
|
3869
3872
|
fe("additionalFields", A);
|
|
3870
3873
|
}, Be = (g) => {
|
|
@@ -3883,9 +3886,9 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3883
3886
|
contentTypes: $e
|
|
3884
3887
|
})
|
|
3885
3888
|
).map((g) => {
|
|
3886
|
-
const
|
|
3887
|
-
if (
|
|
3888
|
-
const { isDisplayed: A, kind: L } =
|
|
3889
|
+
const k = n.data?.find((A) => A.uid === g.uid);
|
|
3890
|
+
if (k) {
|
|
3891
|
+
const { isDisplayed: A, kind: L } = k;
|
|
3889
3892
|
return {
|
|
3890
3893
|
...g,
|
|
3891
3894
|
available: A,
|
|
@@ -3895,18 +3898,18 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3895
3898
|
return g;
|
|
3896
3899
|
}),
|
|
3897
3900
|
(g) => g.info.displayName
|
|
3898
|
-
), Te = (g,
|
|
3899
|
-
const { success: A, data: L, error: B } = zo.safeParse(
|
|
3901
|
+
), Te = (g, k) => {
|
|
3902
|
+
const { success: A, data: L, error: B } = zo.safeParse(k);
|
|
3900
3903
|
A ? a.mutate(L, {
|
|
3901
3904
|
onSuccess() {
|
|
3902
3905
|
b({ required: !0 }), a.reset();
|
|
3903
3906
|
}
|
|
3904
|
-
}) : B && (w(B.issues.reduce((O,
|
|
3907
|
+
}) : B && (w(B.issues.reduce((O, P) => ({
|
|
3905
3908
|
...O,
|
|
3906
|
-
[
|
|
3909
|
+
[P.path.join(".")]: P.message
|
|
3907
3910
|
}), {})), console.warn("Invalid form data", B));
|
|
3908
3911
|
}, Ee = async (g) => {
|
|
3909
|
-
|
|
3912
|
+
D(!1), g && (l.mutate(), b({ required: !0 }));
|
|
3910
3913
|
}, se = async () => {
|
|
3911
3914
|
s.mutate(void 0, {
|
|
3912
3915
|
onSuccess() {
|
|
@@ -3925,27 +3928,27 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3925
3928
|
additionalFields: e.data.additionalFields.filter((g) => typeof g != "string"),
|
|
3926
3929
|
audienceFieldChecked: e.data.additionalFields.includes("audience"),
|
|
3927
3930
|
contentTypesNameFields: Object.entries(e.data.contentTypesNameFields).map(
|
|
3928
|
-
([g,
|
|
3931
|
+
([g, k]) => ({
|
|
3929
3932
|
key: g,
|
|
3930
|
-
fields:
|
|
3933
|
+
fields: k
|
|
3931
3934
|
})
|
|
3932
3935
|
),
|
|
3933
3936
|
contentTypesPopulate: Object.entries(e.data.contentTypesPopulate).map(
|
|
3934
|
-
([g,
|
|
3937
|
+
([g, k]) => ({
|
|
3935
3938
|
key: g,
|
|
3936
|
-
fields:
|
|
3939
|
+
fields: k
|
|
3937
3940
|
})
|
|
3938
3941
|
),
|
|
3939
|
-
pathDefaultFields: Object.entries(e.data.pathDefaultFields).map(([g,
|
|
3942
|
+
pathDefaultFields: Object.entries(e.data.pathDefaultFields).map(([g, k]) => ({
|
|
3940
3943
|
key: g,
|
|
3941
|
-
fields:
|
|
3944
|
+
fields: k
|
|
3942
3945
|
}))
|
|
3943
3946
|
});
|
|
3944
|
-
}, [e.data]), N ? E || S ? /* @__PURE__ */ t(_e.Loading, {}) : /* @__PURE__ */ h(
|
|
3947
|
+
}, [e.data]), N ? E || S ? /* @__PURE__ */ t(_e.Loading, {}) : /* @__PURE__ */ h(Je.Root, { children: [
|
|
3945
3948
|
/* @__PURE__ */ h(_e.Main, { children: [
|
|
3946
3949
|
/* @__PURE__ */ t(_e.Title, { children: o(r("pages.settings.header.title")) }),
|
|
3947
3950
|
/* @__PURE__ */ t(
|
|
3948
|
-
|
|
3951
|
+
Je.Header,
|
|
3949
3952
|
{
|
|
3950
3953
|
title: o(r("pages.settings.header.title")),
|
|
3951
3954
|
subtitle: o(r("pages.settings.header.description")),
|
|
@@ -3960,12 +3963,12 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3960
3963
|
) : null
|
|
3961
3964
|
}
|
|
3962
3965
|
),
|
|
3963
|
-
/* @__PURE__ */ t(
|
|
3966
|
+
/* @__PURE__ */ t(Je.Content, { children: /* @__PURE__ */ t(
|
|
3964
3967
|
yt,
|
|
3965
3968
|
{
|
|
3966
3969
|
method: "POST",
|
|
3967
3970
|
initialValues: v,
|
|
3968
|
-
children: ({ values: g, onChange:
|
|
3971
|
+
children: ({ values: g, onChange: k }) => /* @__PURE__ */ h(H, { direction: "column", gap: 4, children: [
|
|
3969
3972
|
m.required && /* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ t(
|
|
3970
3973
|
Ro,
|
|
3971
3974
|
{
|
|
@@ -3988,11 +3991,11 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
3988
3991
|
] })
|
|
3989
3992
|
}
|
|
3990
3993
|
) }),
|
|
3991
|
-
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(
|
|
3994
|
+
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(H, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
3992
3995
|
/* @__PURE__ */ t(q, { variant: "delta", as: "h2", children: o(r("pages.settings.general.title")) }),
|
|
3993
3996
|
/* @__PURE__ */ t(C.Root, { gap: 4, width: "100%", children: /* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ h(C.Root, { gap: 4, width: "100%", children: [
|
|
3994
3997
|
/* @__PURE__ */ t(C.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
3995
|
-
|
|
3998
|
+
X,
|
|
3996
3999
|
{
|
|
3997
4000
|
name: "preferCustomContentTypes",
|
|
3998
4001
|
label: o(
|
|
@@ -4006,7 +4009,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4006
4009
|
{
|
|
4007
4010
|
name: "preferCustomContentTypes",
|
|
4008
4011
|
checked: g.preferCustomContentTypes,
|
|
4009
|
-
onChange: (A) => K(A, !g.preferCustomContentTypes,
|
|
4012
|
+
onChange: (A) => K(A, !g.preferCustomContentTypes, k),
|
|
4010
4013
|
onLabel: o(r("components.toggle.enabled")),
|
|
4011
4014
|
offLabel: o(r("components.toggle.disabled")),
|
|
4012
4015
|
disabled: m.required,
|
|
@@ -4016,7 +4019,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4016
4019
|
}
|
|
4017
4020
|
) }),
|
|
4018
4021
|
/* @__PURE__ */ t(C.Item, { col: 8, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4019
|
-
|
|
4022
|
+
X,
|
|
4020
4023
|
{
|
|
4021
4024
|
name: "contentTypes",
|
|
4022
4025
|
label: o(r("pages.settings.form.contentTypes.label")),
|
|
@@ -4024,7 +4027,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4024
4027
|
r("pages.settings.form.contentTypes.hint")
|
|
4025
4028
|
),
|
|
4026
4029
|
children: /* @__PURE__ */ t(
|
|
4027
|
-
|
|
4030
|
+
Xe,
|
|
4028
4031
|
{
|
|
4029
4032
|
name: "contentTypes",
|
|
4030
4033
|
label: o(
|
|
@@ -4038,41 +4041,41 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4038
4041
|
),
|
|
4039
4042
|
value: g.contentTypes,
|
|
4040
4043
|
onChange: (A) => {
|
|
4041
|
-
K("contentTypes", A,
|
|
4044
|
+
K("contentTypes", A, k);
|
|
4042
4045
|
const {
|
|
4043
4046
|
contentTypesNameFields: L = [],
|
|
4044
4047
|
contentTypesPopulate: B = [],
|
|
4045
4048
|
pathDefaultFields: O = []
|
|
4046
|
-
} = g,
|
|
4047
|
-
(
|
|
4048
|
-
(be) => be.key ===
|
|
4049
|
+
} = g, P = A.filter(
|
|
4050
|
+
(x) => !L.find(
|
|
4051
|
+
(be) => be.key === x
|
|
4049
4052
|
)
|
|
4050
|
-
) ?? [],
|
|
4051
|
-
(
|
|
4052
|
-
).map(({ key:
|
|
4053
|
+
) ?? [], U = L.filter(
|
|
4054
|
+
(x) => !A.includes(x.key) || x.key === "default"
|
|
4055
|
+
).map(({ key: x }) => x) ?? [];
|
|
4053
4056
|
fe(
|
|
4054
4057
|
"contentTypesNameFields",
|
|
4055
4058
|
[
|
|
4056
4059
|
...L.filter(
|
|
4057
|
-
({ key:
|
|
4060
|
+
({ key: x }) => !U.includes(x) || x === "default"
|
|
4058
4061
|
) ?? [],
|
|
4059
|
-
...
|
|
4062
|
+
...P.map((x) => ({ key: x, fields: [] }))
|
|
4060
4063
|
]
|
|
4061
4064
|
), fe(
|
|
4062
4065
|
"contentTypesPopulate",
|
|
4063
4066
|
[
|
|
4064
4067
|
...B.filter(
|
|
4065
|
-
({ key:
|
|
4068
|
+
({ key: x }) => !U.includes(x) || x === "default"
|
|
4066
4069
|
) ?? [],
|
|
4067
|
-
...
|
|
4070
|
+
...P.map((x) => ({ key: x, fields: [] }))
|
|
4068
4071
|
]
|
|
4069
4072
|
), fe(
|
|
4070
4073
|
"pathDefaultFields",
|
|
4071
4074
|
[
|
|
4072
4075
|
...O.filter(
|
|
4073
|
-
({ key:
|
|
4076
|
+
({ key: x }) => !U.includes(x) || x === "default"
|
|
4074
4077
|
) ?? [],
|
|
4075
|
-
...
|
|
4078
|
+
...P.map((x) => ({ key: x, fields: [] }))
|
|
4076
4079
|
]
|
|
4077
4080
|
);
|
|
4078
4081
|
},
|
|
@@ -4080,14 +4083,14 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4080
4083
|
error: ye("contentTypes"),
|
|
4081
4084
|
withTags: !0,
|
|
4082
4085
|
width: "100%",
|
|
4083
|
-
children: ve.map((A) => /* @__PURE__ */ t(
|
|
4086
|
+
children: ve.map((A) => /* @__PURE__ */ t(Ge, { value: A.uid, children: A.info.displayName }, A.uid))
|
|
4084
4087
|
}
|
|
4085
4088
|
)
|
|
4086
4089
|
}
|
|
4087
4090
|
) }),
|
|
4088
4091
|
/* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: $e?.length ? /* @__PURE__ */ t(at.Root, { style: { width: "100%" }, children: Se.map((A, L) => {
|
|
4089
4092
|
const B = n.data?.find(
|
|
4090
|
-
({ uid:
|
|
4093
|
+
({ uid: P }) => P === A.key
|
|
4091
4094
|
), O = Object.keys(B?.attributes ?? {}).sort();
|
|
4092
4095
|
return B ? /* @__PURE__ */ h(at.Item, { value: A.key, children: [
|
|
4093
4096
|
/* @__PURE__ */ t(at.Header, { children: /* @__PURE__ */ t(at.Trigger, { children: B?.info.displayName ?? o(
|
|
@@ -4095,7 +4098,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4095
4098
|
) }) }),
|
|
4096
4099
|
/* @__PURE__ */ t(at.Content, { children: /* @__PURE__ */ h(C.Root, { gap: 4, padding: 2, children: [
|
|
4097
4100
|
/* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4098
|
-
|
|
4101
|
+
X,
|
|
4099
4102
|
{
|
|
4100
4103
|
name: `contentTypesNameFields[${L}]`,
|
|
4101
4104
|
label: o(
|
|
@@ -4107,7 +4110,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4107
4110
|
)
|
|
4108
4111
|
),
|
|
4109
4112
|
children: /* @__PURE__ */ t(
|
|
4110
|
-
|
|
4113
|
+
Xe,
|
|
4111
4114
|
{
|
|
4112
4115
|
name: `contentTypesNameFields[${L}]`,
|
|
4113
4116
|
placeholder: o(
|
|
@@ -4116,30 +4119,30 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4116
4119
|
)
|
|
4117
4120
|
),
|
|
4118
4121
|
value: ce(g, `contentTypesNameFields[${L}].fields`),
|
|
4119
|
-
onChange: (
|
|
4120
|
-
const
|
|
4121
|
-
...
|
|
4122
|
-
fields:
|
|
4123
|
-
} :
|
|
4124
|
-
return K("contentTypesNameFields",
|
|
4122
|
+
onChange: (P) => {
|
|
4123
|
+
const U = ce(g, "contentTypesNameFields", []).map((x, be) => be === L ? {
|
|
4124
|
+
...x,
|
|
4125
|
+
fields: P
|
|
4126
|
+
} : x);
|
|
4127
|
+
return K("contentTypesNameFields", U, k);
|
|
4125
4128
|
},
|
|
4126
4129
|
disabled: m.required,
|
|
4127
4130
|
error: ye(`contentTypesNameFields[${L}]`),
|
|
4128
4131
|
withTags: !0,
|
|
4129
|
-
children: O.map((
|
|
4130
|
-
|
|
4132
|
+
children: O.map((P) => /* @__PURE__ */ t(
|
|
4133
|
+
Ge,
|
|
4131
4134
|
{
|
|
4132
|
-
value:
|
|
4133
|
-
children:
|
|
4135
|
+
value: P,
|
|
4136
|
+
children: P
|
|
4134
4137
|
},
|
|
4135
|
-
|
|
4138
|
+
P
|
|
4136
4139
|
))
|
|
4137
4140
|
}
|
|
4138
4141
|
)
|
|
4139
4142
|
}
|
|
4140
4143
|
) }),
|
|
4141
4144
|
/* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4142
|
-
|
|
4145
|
+
X,
|
|
4143
4146
|
{
|
|
4144
4147
|
name: `contentTypesPopulate[${L - 1}]`,
|
|
4145
4148
|
label: o(
|
|
@@ -4151,7 +4154,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4151
4154
|
)
|
|
4152
4155
|
),
|
|
4153
4156
|
children: /* @__PURE__ */ t(
|
|
4154
|
-
|
|
4157
|
+
Xe,
|
|
4155
4158
|
{
|
|
4156
4159
|
width: "100%",
|
|
4157
4160
|
name: `contentTypesPopulate[${L - 1}]`,
|
|
@@ -4161,30 +4164,30 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4161
4164
|
)
|
|
4162
4165
|
),
|
|
4163
4166
|
value: ce(g, `contentTypesPopulate[${L - 1}].fields`, []),
|
|
4164
|
-
onChange: (
|
|
4165
|
-
const
|
|
4166
|
-
...
|
|
4167
|
-
fields:
|
|
4168
|
-
} :
|
|
4169
|
-
return K("contentTypesPopulate",
|
|
4167
|
+
onChange: (P) => {
|
|
4168
|
+
const U = ce(g, "contentTypesPopulate", []).map((x, be) => be === L - 1 ? {
|
|
4169
|
+
...x,
|
|
4170
|
+
fields: P
|
|
4171
|
+
} : x);
|
|
4172
|
+
return K("contentTypesPopulate", U, k);
|
|
4170
4173
|
},
|
|
4171
4174
|
disabled: m.required,
|
|
4172
4175
|
error: ye(`contentTypesPopulate[${L - 1}]`),
|
|
4173
4176
|
withTags: !0,
|
|
4174
|
-
children: O.map((
|
|
4175
|
-
|
|
4177
|
+
children: O.map((P) => /* @__PURE__ */ t(
|
|
4178
|
+
Ge,
|
|
4176
4179
|
{
|
|
4177
|
-
value:
|
|
4178
|
-
children:
|
|
4180
|
+
value: P,
|
|
4181
|
+
children: P
|
|
4179
4182
|
},
|
|
4180
|
-
|
|
4183
|
+
P
|
|
4181
4184
|
))
|
|
4182
4185
|
}
|
|
4183
4186
|
)
|
|
4184
4187
|
}
|
|
4185
4188
|
) }),
|
|
4186
4189
|
/* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4187
|
-
|
|
4190
|
+
X,
|
|
4188
4191
|
{
|
|
4189
4192
|
name: `pathDefaultFields[${L - 1}]`,
|
|
4190
4193
|
label: o(
|
|
@@ -4198,7 +4201,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4198
4201
|
)
|
|
4199
4202
|
),
|
|
4200
4203
|
children: /* @__PURE__ */ t(
|
|
4201
|
-
|
|
4204
|
+
Xe,
|
|
4202
4205
|
{
|
|
4203
4206
|
name: `pathDefaultFields[${L - 1}]`,
|
|
4204
4207
|
width: "100%",
|
|
@@ -4208,23 +4211,23 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4208
4211
|
)
|
|
4209
4212
|
),
|
|
4210
4213
|
value: ce(g, `pathDefaultFields[${L - 1}].fields`, []),
|
|
4211
|
-
onChange: (
|
|
4212
|
-
const
|
|
4213
|
-
...
|
|
4214
|
-
fields:
|
|
4215
|
-
} :
|
|
4216
|
-
return K("pathDefaultFields",
|
|
4214
|
+
onChange: (P) => {
|
|
4215
|
+
const U = ce(g, "pathDefaultFields", []).map((x, be) => be === L - 1 ? {
|
|
4216
|
+
...x,
|
|
4217
|
+
fields: P
|
|
4218
|
+
} : x);
|
|
4219
|
+
return K("pathDefaultFields", U, k);
|
|
4217
4220
|
},
|
|
4218
4221
|
disabled: m.required,
|
|
4219
4222
|
error: ye(`pathDefaultFields[${L - 1}]`),
|
|
4220
4223
|
withTags: !0,
|
|
4221
|
-
children: O.map((
|
|
4222
|
-
|
|
4224
|
+
children: O.map((P) => /* @__PURE__ */ t(
|
|
4225
|
+
Ge,
|
|
4223
4226
|
{
|
|
4224
|
-
value:
|
|
4225
|
-
children:
|
|
4227
|
+
value: P,
|
|
4228
|
+
children: P
|
|
4226
4229
|
},
|
|
4227
|
-
|
|
4230
|
+
P
|
|
4228
4231
|
))
|
|
4229
4232
|
}
|
|
4230
4233
|
)
|
|
@@ -4235,11 +4238,11 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4235
4238
|
}) }) : null })
|
|
4236
4239
|
] }) }) })
|
|
4237
4240
|
] }) }),
|
|
4238
|
-
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(
|
|
4241
|
+
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(H, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4239
4242
|
/* @__PURE__ */ t(q, { variant: "delta", as: "h2", children: o(r("pages.settings.additional.title")) }),
|
|
4240
4243
|
/* @__PURE__ */ h(C.Root, { gap: 4, width: "100%", children: [
|
|
4241
4244
|
/* @__PURE__ */ t(C.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ t(ee, { width: "100%", children: /* @__PURE__ */ t(
|
|
4242
|
-
|
|
4245
|
+
X,
|
|
4243
4246
|
{
|
|
4244
4247
|
name: "allowedLevels",
|
|
4245
4248
|
label: o(r("pages.settings.form.allowedLevels.label")),
|
|
@@ -4256,9 +4259,9 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4256
4259
|
onChange: (A, L) => {
|
|
4257
4260
|
if (lt(A)) {
|
|
4258
4261
|
const B = parseInt(A.target.value);
|
|
4259
|
-
return K(A.target.name, ta(B) ? 0 : B,
|
|
4262
|
+
return K(A.target.name, ta(B) ? 0 : B, k);
|
|
4260
4263
|
}
|
|
4261
|
-
return K(A, L,
|
|
4264
|
+
return K(A, L, k);
|
|
4262
4265
|
},
|
|
4263
4266
|
value: g.allowedLevels,
|
|
4264
4267
|
disabled: m.required
|
|
@@ -4267,7 +4270,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4267
4270
|
}
|
|
4268
4271
|
) }) }),
|
|
4269
4272
|
/* @__PURE__ */ t(C.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4270
|
-
|
|
4273
|
+
X,
|
|
4271
4274
|
{
|
|
4272
4275
|
name: "cascadeMenuAttached",
|
|
4273
4276
|
label: o(
|
|
@@ -4280,7 +4283,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4280
4283
|
width: "100%",
|
|
4281
4284
|
name: "cascadeMenuAttached",
|
|
4282
4285
|
checked: g.cascadeMenuAttached,
|
|
4283
|
-
onChange: (A) => K(A, !g.cascadeMenuAttached,
|
|
4286
|
+
onChange: (A) => K(A, !g.cascadeMenuAttached, k),
|
|
4284
4287
|
onLabel: o(r("components.toggle.enabled")),
|
|
4285
4288
|
offLabel: o(r("components.toggle.disabled")),
|
|
4286
4289
|
disabled: m.required
|
|
@@ -4289,7 +4292,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4289
4292
|
}
|
|
4290
4293
|
) }),
|
|
4291
4294
|
/* @__PURE__ */ t(C.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4292
|
-
|
|
4295
|
+
X,
|
|
4293
4296
|
{
|
|
4294
4297
|
name: "audienceFieldChecked",
|
|
4295
4298
|
label: o(r("pages.settings.form.audience.label")),
|
|
@@ -4299,7 +4302,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4299
4302
|
{
|
|
4300
4303
|
name: "audienceFieldChecked",
|
|
4301
4304
|
checked: g.audienceFieldChecked,
|
|
4302
|
-
onChange: (A) => K(A, !g.audienceFieldChecked,
|
|
4305
|
+
onChange: (A) => K(A, !g.audienceFieldChecked, k),
|
|
4303
4306
|
onLabel: o(r("components.toggle.enabled")),
|
|
4304
4307
|
offLabel: o(r("components.toggle.disabled")),
|
|
4305
4308
|
disabled: m.required,
|
|
@@ -4309,7 +4312,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4309
4312
|
}
|
|
4310
4313
|
) }),
|
|
4311
4314
|
e.data?.isCachePluginEnabled && /* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ t(
|
|
4312
|
-
|
|
4315
|
+
X,
|
|
4313
4316
|
{
|
|
4314
4317
|
name: "isCacheEnabled",
|
|
4315
4318
|
label: o(r("pages.settings.form.cache.label")),
|
|
@@ -4319,7 +4322,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4319
4322
|
{
|
|
4320
4323
|
name: "isCacheEnabled",
|
|
4321
4324
|
checked: g.isCacheEnabled,
|
|
4322
|
-
onChange: (A) => K(A, !g.isCacheEnabled,
|
|
4325
|
+
onChange: (A) => K(A, !g.isCacheEnabled, k),
|
|
4323
4326
|
onLabel: o(r("components.toggle.enabled")),
|
|
4324
4327
|
offLabel: o(r("components.toggle.disabled")),
|
|
4325
4328
|
disabled: m.required,
|
|
@@ -4343,7 +4346,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4343
4346
|
}
|
|
4344
4347
|
)
|
|
4345
4348
|
] }),
|
|
4346
|
-
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(
|
|
4349
|
+
/* @__PURE__ */ t(ee, { ...ot, width: "100%", children: /* @__PURE__ */ h(H, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4347
4350
|
/* @__PURE__ */ t(q, { variant: "delta", as: "h2", children: o(r("pages.settings.restoring.title")) }),
|
|
4348
4351
|
/* @__PURE__ */ h(C.Root, { gap: 4, width: "100%", children: [
|
|
4349
4352
|
/* @__PURE__ */ t(C.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ t(q, { children: o(r("pages.settings.actions.restore.description")) }) }),
|
|
@@ -4353,7 +4356,7 @@ const Ao = () => /* @__PURE__ */ t(kn, { backend: Mn, children: /* @__PURE__ */
|
|
|
4353
4356
|
{
|
|
4354
4357
|
variant: "danger-light",
|
|
4355
4358
|
startIcon: /* @__PURE__ */ t(dt, {}),
|
|
4356
|
-
onClick: () =>
|
|
4359
|
+
onClick: () => D(!0),
|
|
4357
4360
|
children: o(r("pages.settings.actions.restore.label"))
|
|
4358
4361
|
}
|
|
4359
4362
|
) : null,
|
|
@@ -4419,7 +4422,7 @@ const Wo = "navigation", nn = "Navigation", sr = {
|
|
|
4419
4422
|
Component() {
|
|
4420
4423
|
return Uo;
|
|
4421
4424
|
},
|
|
4422
|
-
permissions:
|
|
4425
|
+
permissions: We.settings
|
|
4423
4426
|
}
|
|
4424
4427
|
]
|
|
4425
4428
|
), e.addMenuLink({
|
|
@@ -4432,7 +4435,7 @@ const Wo = "navigation", nn = "Navigation", sr = {
|
|
|
4432
4435
|
Component() {
|
|
4433
4436
|
return Ao;
|
|
4434
4437
|
},
|
|
4435
|
-
permissions:
|
|
4438
|
+
permissions: We.access,
|
|
4436
4439
|
position: 1
|
|
4437
4440
|
}), e.registerPlugin({
|
|
4438
4441
|
id: we,
|