strapi-plugin-navigation 3.3.4 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/index.js +8 -8
- package/dist/admin/index.mjs +570 -575
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
package/dist/admin/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import jn, { useRef as We, useEffect as V, useCallback as
|
|
1
|
+
import jn, { useRef as We, useEffect as V, useCallback as E, useState as N, useMemo as X, createContext as tn, useContext as nn } from "react";
|
|
2
2
|
import { jsx as n, jsxs as w, Fragment as ie } from "react/jsx-runtime";
|
|
3
3
|
import oe, { useTheme as Bn } from "styled-components";
|
|
4
4
|
import { getFetchClient as j, useRBAC as On, useMediaQuery as Pt, useIsMobile as an, useIsTablet as zn, useIsDesktop as _n, Form as at, useNotification as Oe, Layouts as qe, useStrapiApp as Qn, Page as Te, useAuth as Un } from "@strapi/strapi/admin";
|
|
5
5
|
import { useDrop as Kn, useDrag as Wn, DndProvider as Hn } from "react-dnd";
|
|
6
6
|
import { HTML5Backend as Xn } from "react-dnd-html5-backend";
|
|
7
7
|
import { Routes as Gn, Route as Mt } from "react-router-dom";
|
|
8
|
-
import { useQuery as
|
|
9
|
-
import { once as Zn, isEmpty as Y, capitalize as ln, get as J, first as
|
|
8
|
+
import { useQuery as Fe, useMutation as ge, useQueryClient as be, QueryClient as on, QueryClientProvider as rn } from "@tanstack/react-query";
|
|
9
|
+
import { once as Zn, isEmpty as Y, capitalize as ln, get as J, first as Ct, orderBy as Jn, isObject as He, isNil as Be, isString as ot, set as it, sortBy as Xe, isNumber as kt, isBoolean as Yn, isNull as ea, isArray as ta } from "lodash";
|
|
10
10
|
import { useIntl as A } from "react-intl";
|
|
11
|
-
import { Dialog as Qe, Flex as P, Typography as
|
|
12
|
-
import { Check as Ge, WarningCircle as fa, Feather as ya, Pencil as
|
|
11
|
+
import { Dialog as Qe, Flex as P, Typography as F, Button as K, Modal as H, Grid as S, TextInput as we, Toggle as me, Box as D, Table as sn, Thead as dn, Tr as et, Th as ce, Checkbox as qt, IconButton as ye, Tbody as cn, Td as ue, Loader as bt, Tag as na, Field as Dt, SingleSelect as xe, SingleSelectOption as Ae, Badge as aa, CardTitle as oa, IconButtonGroup as un, Card as ia, CardBody as Vt, Divider as tt, TextButton as ra, Link as la, MultiSelect as De, MultiSelectOption as Ve, Textarea as sa, Combobox as pn, ComboboxOption as da, Searchbar as ca, Alert as ua, NumberInput as pa, Accordion as Ue, VisuallyHidden as ma, Tooltip as ga, TFooter as ha } from "@strapi/design-system";
|
|
12
|
+
import { Check as Ge, WarningCircle as fa, Feather as ya, Pencil as vt, Trash as Tt, Information as ba, CaretDown as Ia, CaretUp as Ca, Drag as va, Eye as mn, ArrowClockwise as Ta, Earth as wa, Cog as Sa, Link as xa, Plus as wt, ArrowRight as Aa, Search as Fa, ListPlus as Na, Typhoon as Ra, Play as La, Minus as $a, EyeStriked as Ea, PriceTag as Pa } from "@strapi/icons";
|
|
13
13
|
import * as s from "zod";
|
|
14
14
|
import { z as g } from "zod";
|
|
15
|
-
import { usePluginTheme as Ma, Field as
|
|
15
|
+
import { usePluginTheme as Ma, Field as $, prefixPluginTranslations as jt, flattenObject as Bt } from "@sensinum/strapi-utils";
|
|
16
16
|
import { prop as nt } from "lodash/fp";
|
|
17
17
|
const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
18
18
|
const t = We(e);
|
|
@@ -141,22 +141,22 @@ const de = "navigation", ka = ({ setPlugin: e }) => {
|
|
|
141
141
|
locale: s.string(),
|
|
142
142
|
visible: s.boolean(),
|
|
143
143
|
items: s.array(fn)
|
|
144
|
-
}),
|
|
144
|
+
}), xt = s.object({
|
|
145
145
|
name: s.string({ required_error: "requiredError" }).nonempty("requiredError").refine((e) => !e.includes(" "), { message: "noSpaceError" }),
|
|
146
146
|
label: s.string({ required_error: "requiredError" }).nonempty("requiredError"),
|
|
147
147
|
description: s.string().optional(),
|
|
148
148
|
placeholder: s.string().optional(),
|
|
149
149
|
required: s.boolean().optional(),
|
|
150
150
|
enabled: s.boolean().optional()
|
|
151
|
-
}), Ha =
|
|
151
|
+
}), Ha = xt.extend({
|
|
152
152
|
type: s.literal("select"),
|
|
153
153
|
multi: s.boolean(),
|
|
154
154
|
options: s.array(s.string(), { required_error: "requiredError" }).min(1, { message: "requiredError" })
|
|
155
|
-
}), Xa =
|
|
155
|
+
}), Xa = xt.extend({
|
|
156
156
|
type: s.enum(["boolean", "string"]),
|
|
157
157
|
multi: s.literal(!1).optional(),
|
|
158
158
|
options: s.array(s.string()).max(0).optional()
|
|
159
|
-
}), Ga =
|
|
159
|
+
}), Ga = xt.extend({
|
|
160
160
|
type: s.literal("media"),
|
|
161
161
|
multi: s.literal(!1).optional(),
|
|
162
162
|
options: s.array(s.string()).max(0).optional()
|
|
@@ -440,14 +440,14 @@ const ho = s.object({
|
|
|
440
440
|
items: e.items?.map(rt)
|
|
441
441
|
}), At = () => {
|
|
442
442
|
const e = j(), t = B(e);
|
|
443
|
-
return
|
|
443
|
+
return Fe({
|
|
444
444
|
queryKey: t.readLocaleIndex(),
|
|
445
445
|
queryFn: t.readLocale,
|
|
446
446
|
staleTime: 1 / 0
|
|
447
447
|
});
|
|
448
448
|
}, bn = (e) => {
|
|
449
449
|
const t = j(), a = B(t);
|
|
450
|
-
return
|
|
450
|
+
return Fe({
|
|
451
451
|
queryKey: a.readContentTypeItemsIndex(e),
|
|
452
452
|
queryFn: () => a.readContentTypeItems(e),
|
|
453
453
|
staleTime: 1e3 * 60 * 3,
|
|
@@ -455,7 +455,7 @@ const ho = s.object({
|
|
|
455
455
|
});
|
|
456
456
|
}, bo = () => {
|
|
457
457
|
const e = j(), t = B(e);
|
|
458
|
-
return
|
|
458
|
+
return Fe({
|
|
459
459
|
queryKey: t.readContentTypeIndex(),
|
|
460
460
|
queryFn: () => t.readContentType(),
|
|
461
461
|
staleTime: 1e3 * 60 * 3
|
|
@@ -467,14 +467,14 @@ const ho = s.object({
|
|
|
467
467
|
queryKey: t.readAllIndex()
|
|
468
468
|
});
|
|
469
469
|
};
|
|
470
|
-
},
|
|
470
|
+
}, Co = () => {
|
|
471
471
|
const e = j(), t = B(e), a = be();
|
|
472
472
|
return () => {
|
|
473
473
|
a.resetQueries({
|
|
474
474
|
queryKey: t.readContentTypeIndex()
|
|
475
475
|
});
|
|
476
476
|
};
|
|
477
|
-
},
|
|
477
|
+
}, vo = (e) => {
|
|
478
478
|
const t = j(), a = B(t), o = be();
|
|
479
479
|
return () => {
|
|
480
480
|
o.invalidateQueries({
|
|
@@ -491,9 +491,9 @@ const ho = s.object({
|
|
|
491
491
|
}, wo = () => {
|
|
492
492
|
const e = j(), t = B(e), a = be();
|
|
493
493
|
return () => a.invalidateQueries({ queryKey: t.readLocaleIndex() });
|
|
494
|
-
},
|
|
494
|
+
}, Ft = () => {
|
|
495
495
|
const e = j(), t = B(e);
|
|
496
|
-
return
|
|
496
|
+
return Fe({
|
|
497
497
|
queryKey: t.readAllIndex(),
|
|
498
498
|
queryFn() {
|
|
499
499
|
return t.readAll().then(
|
|
@@ -509,12 +509,12 @@ const ho = s.object({
|
|
|
509
509
|
});
|
|
510
510
|
}, So = () => {
|
|
511
511
|
const e = be(), t = j(), a = B(t);
|
|
512
|
-
return
|
|
512
|
+
return E(() => {
|
|
513
513
|
e.invalidateQueries({
|
|
514
514
|
queryKey: a.getIndexPrefix()
|
|
515
515
|
});
|
|
516
516
|
}, [e, t, a]);
|
|
517
|
-
},
|
|
517
|
+
}, xo = () => {
|
|
518
518
|
const e = j(), t = B(e);
|
|
519
519
|
return ge({
|
|
520
520
|
mutationFn(a) {
|
|
@@ -526,7 +526,7 @@ const ho = s.object({
|
|
|
526
526
|
return ge({
|
|
527
527
|
mutationFn: t.copyNavigationItemLocale
|
|
528
528
|
});
|
|
529
|
-
},
|
|
529
|
+
}, Fo = () => {
|
|
530
530
|
const e = j(), t = B(e), a = be();
|
|
531
531
|
return ge({
|
|
532
532
|
mutationFn: t.copyNavigationLocale,
|
|
@@ -560,7 +560,7 @@ const ho = s.object({
|
|
|
560
560
|
},
|
|
561
561
|
onError: e
|
|
562
562
|
});
|
|
563
|
-
},
|
|
563
|
+
}, Cn = () => {
|
|
564
564
|
const e = j(), t = B(e);
|
|
565
565
|
return ge({
|
|
566
566
|
mutationFn(a) {
|
|
@@ -571,7 +571,7 @@ const ho = s.object({
|
|
|
571
571
|
});
|
|
572
572
|
}, ne = () => {
|
|
573
573
|
const e = j(), t = B(e);
|
|
574
|
-
return
|
|
574
|
+
return Fe({
|
|
575
575
|
queryKey: t.readConfigIndex(),
|
|
576
576
|
queryFn: t.readConfig
|
|
577
577
|
});
|
|
@@ -592,12 +592,12 @@ const ho = s.object({
|
|
|
592
592
|
Qe.Root,
|
|
593
593
|
{
|
|
594
594
|
open: e,
|
|
595
|
-
onOpenChange: (
|
|
596
|
-
!
|
|
595
|
+
onOpenChange: (C) => {
|
|
596
|
+
!C && e && i?.(void 0);
|
|
597
597
|
},
|
|
598
598
|
title: r || u(l("components.confirmation.dialog.header", "Confirmation")),
|
|
599
599
|
children: /* @__PURE__ */ w(Qe.Content, { children: [
|
|
600
|
-
/* @__PURE__ */ n(Qe.Body, { icon: p, children: /* @__PURE__ */ n(P, { justifyContent: "center", children: /* @__PURE__ */ n(
|
|
600
|
+
/* @__PURE__ */ n(Qe.Body, { icon: p, children: /* @__PURE__ */ n(P, { justifyContent: "center", children: /* @__PURE__ */ n(F, { id: "dialog-confirm-description", children: a || u(l("components.confirmation.dialog.description")) }) }) }),
|
|
601
601
|
/* @__PURE__ */ w(Qe.Footer, { children: [
|
|
602
602
|
/* @__PURE__ */ n(Qe.Cancel, { children: /* @__PURE__ */ n(K, { fullWidth: !0, onClick: i, variant: "tertiary", disabled: t, children: d || u(l("components.confirmation.dialog.button.cancel", "Cancel")) }) }),
|
|
603
603
|
/* @__PURE__ */ n(
|
|
@@ -615,7 +615,7 @@ const ho = s.object({
|
|
|
615
615
|
] })
|
|
616
616
|
}
|
|
617
617
|
) : null;
|
|
618
|
-
}, Qt = /* @__PURE__ */ n(ie, {}),
|
|
618
|
+
}, Qt = /* @__PURE__ */ n(ie, {}), Lo = ({ onConfirm: e, onCancel: t }) => {
|
|
619
619
|
const { formatMessage: a } = A();
|
|
620
620
|
return /* @__PURE__ */ n(
|
|
621
621
|
lt,
|
|
@@ -630,13 +630,13 @@ const ho = s.object({
|
|
|
630
630
|
children: a(l("pages.view.actions.i18nCopyItems.confirmation.content"))
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
|
-
},
|
|
634
|
-
const [t, a] = N(!1), [o, i] = N(void 0), r =
|
|
633
|
+
}, $o = (e) => {
|
|
634
|
+
const [t, a] = N(!1), [o, i] = N(void 0), r = E(() => {
|
|
635
635
|
a(!1);
|
|
636
|
-
}, [a]), d =
|
|
636
|
+
}, [a]), d = E(() => {
|
|
637
637
|
o && (e(o), a(!1));
|
|
638
638
|
}, [e, o]), c = X(
|
|
639
|
-
() => t ? /* @__PURE__ */ n(
|
|
639
|
+
() => t ? /* @__PURE__ */ n(Lo, { onConfirm: d, onCancel: r }) : null,
|
|
640
640
|
[t, d, r]
|
|
641
641
|
);
|
|
642
642
|
return X(
|
|
@@ -648,7 +648,7 @@ const ho = s.object({
|
|
|
648
648
|
}),
|
|
649
649
|
[i, a, c, o]
|
|
650
650
|
);
|
|
651
|
-
},
|
|
651
|
+
}, Eo = () => {
|
|
652
652
|
const e = wo(), t = To();
|
|
653
653
|
V(() => {
|
|
654
654
|
e(), t();
|
|
@@ -689,36 +689,36 @@ const ho = s.object({
|
|
|
689
689
|
availableLocales: m
|
|
690
690
|
};
|
|
691
691
|
}, ko = (e) => {
|
|
692
|
-
const [t, a] = N(), [o, i] = N(!1), r =
|
|
692
|
+
const [t, a] = N(), [o, i] = N(!1), r = E(
|
|
693
693
|
(p, u = {}) => {
|
|
694
694
|
a(u), i(p);
|
|
695
695
|
},
|
|
696
696
|
[i]
|
|
697
|
-
), d =
|
|
697
|
+
), d = E(() => {
|
|
698
698
|
r(!1);
|
|
699
|
-
}, [r]), c =
|
|
700
|
-
(p, u,
|
|
699
|
+
}, [r]), c = E(
|
|
700
|
+
(p, u, C = !0, b = "", v = !0, h = "0", f = 0) => {
|
|
701
701
|
e && (p.preventDefault(), p.stopPropagation(), r(!0, {
|
|
702
702
|
viewParentId: u,
|
|
703
|
-
isMenuAllowedLevel:
|
|
703
|
+
isMenuAllowedLevel: C,
|
|
704
704
|
levelPath: b,
|
|
705
|
-
parentAttachedToMenu:
|
|
706
|
-
structureId:
|
|
705
|
+
parentAttachedToMenu: v,
|
|
706
|
+
structureId: h,
|
|
707
707
|
viewId: void 0,
|
|
708
708
|
order: f + 1
|
|
709
709
|
}));
|
|
710
710
|
},
|
|
711
711
|
[r, e]
|
|
712
|
-
), m =
|
|
712
|
+
), m = E(
|
|
713
713
|
({
|
|
714
714
|
item: p,
|
|
715
715
|
levelPath: u = "",
|
|
716
|
-
parentAttachedToMenu:
|
|
716
|
+
parentAttachedToMenu: C = !0
|
|
717
717
|
}) => {
|
|
718
718
|
r(!0, {
|
|
719
719
|
...p,
|
|
720
720
|
levelPath: u,
|
|
721
|
-
parentAttachedToMenu:
|
|
721
|
+
parentAttachedToMenu: C
|
|
722
722
|
});
|
|
723
723
|
},
|
|
724
724
|
[r]
|
|
@@ -730,9 +730,9 @@ const ho = s.object({
|
|
|
730
730
|
closeNavigationItemPopup: d,
|
|
731
731
|
isItemPopupVisible: o
|
|
732
732
|
};
|
|
733
|
-
},
|
|
733
|
+
}, vn = (e, t, a) => {
|
|
734
734
|
const o = e.reduce((i, r) => {
|
|
735
|
-
const d = r.items?.length ?
|
|
735
|
+
const d = r.items?.length ? vn(r.items ?? [], t) : [];
|
|
736
736
|
return t(r) ? [r, ...d, ...i] : [...d, ...i];
|
|
737
737
|
}, []);
|
|
738
738
|
if (a !== void 0) {
|
|
@@ -744,7 +744,7 @@ const ho = s.object({
|
|
|
744
744
|
const [{ value: t, index: a }, o] = N({
|
|
745
745
|
value: "",
|
|
746
746
|
index: 0
|
|
747
|
-
}), i = Y(t), r = (t || "").toLowerCase(), d = i ? [] :
|
|
747
|
+
}), i = Y(t), r = (t || "").toLowerCase(), d = i ? [] : vn(
|
|
748
748
|
e?.items.map((c) => ({ ...c })) ?? [],
|
|
749
749
|
(c) => (c?.title || "").toLowerCase().includes(r),
|
|
750
750
|
r ? a : void 0
|
|
@@ -759,15 +759,15 @@ const ho = s.object({
|
|
|
759
759
|
read: "read",
|
|
760
760
|
update: "update",
|
|
761
761
|
settings: "settings"
|
|
762
|
-
},
|
|
762
|
+
}, $e = {
|
|
763
763
|
access: [{ action: mt(gt.read), subject: null }],
|
|
764
764
|
update: [{ action: mt(gt.update), subject: null }],
|
|
765
765
|
settings: [{ action: mt(gt.settings), subject: null }]
|
|
766
766
|
}, Do = () => {
|
|
767
767
|
const e = X(
|
|
768
768
|
() => ({
|
|
769
|
-
access:
|
|
770
|
-
update:
|
|
769
|
+
access: $e.access || $e.update,
|
|
770
|
+
update: $e.update
|
|
771
771
|
}),
|
|
772
772
|
[]
|
|
773
773
|
), {
|
|
@@ -905,7 +905,7 @@ const ho = s.object({
|
|
|
905
905
|
`${d ? d.uid : r}`,
|
|
906
906
|
c
|
|
907
907
|
), p = (Y(m) ? c : m).map((u) => e[u]).filter((u) => u);
|
|
908
|
-
return
|
|
908
|
+
return Ct(p) || "";
|
|
909
909
|
}, Vo = ({
|
|
910
910
|
relatedRef: e,
|
|
911
911
|
relatedType: t = {},
|
|
@@ -995,27 +995,27 @@ const ho = s.object({
|
|
|
995
995
|
alreadyUsedNames: a = [],
|
|
996
996
|
isLoading: o
|
|
997
997
|
}) => {
|
|
998
|
-
const [i, r] = N({}), [d, c] = N(), { formatMessage: m } = A(), { name: p, visible: u } = i,
|
|
998
|
+
const [i, r] = N({}), [d, c] = N(), { formatMessage: m } = A(), { name: p, visible: u } = i, C = (h, f, I) => {
|
|
999
999
|
if (I) {
|
|
1000
|
-
let
|
|
1001
|
-
if (He(
|
|
1002
|
-
const { name:
|
|
1003
|
-
|
|
1000
|
+
let y = h, T = f;
|
|
1001
|
+
if (He(h)) {
|
|
1002
|
+
const { name: L, value: z } = h.target;
|
|
1003
|
+
y = L, T = Be(T) ? z : T;
|
|
1004
1004
|
}
|
|
1005
|
-
return ot(
|
|
1005
|
+
return ot(y) && b(y, T), I(h, T);
|
|
1006
1006
|
}
|
|
1007
|
-
}, b = (
|
|
1007
|
+
}, b = (h, f) => {
|
|
1008
1008
|
r(
|
|
1009
1009
|
it(
|
|
1010
1010
|
{
|
|
1011
1011
|
...i
|
|
1012
1012
|
},
|
|
1013
|
-
|
|
1013
|
+
h,
|
|
1014
1014
|
f
|
|
1015
1015
|
)
|
|
1016
1016
|
);
|
|
1017
|
-
},
|
|
1018
|
-
const f = J(d,
|
|
1017
|
+
}, v = (h) => {
|
|
1018
|
+
const f = J(d, h);
|
|
1019
1019
|
if (f)
|
|
1020
1020
|
return f;
|
|
1021
1021
|
};
|
|
@@ -1032,26 +1032,26 @@ const ho = s.object({
|
|
|
1032
1032
|
})));
|
|
1033
1033
|
}, []), V(() => {
|
|
1034
1034
|
if (`${p}-${u}` != `${e.name}-${e.visible}`) {
|
|
1035
|
-
const { error:
|
|
1035
|
+
const { error: h } = jo({ alreadyUsedNames: a }).safeParse(i);
|
|
1036
1036
|
t({
|
|
1037
1037
|
...e,
|
|
1038
1038
|
name: p,
|
|
1039
1039
|
visible: u,
|
|
1040
|
-
disabled: !Y(
|
|
1040
|
+
disabled: !Y(h?.issues)
|
|
1041
1041
|
}), c(
|
|
1042
|
-
|
|
1042
|
+
h ? h.issues.reduce((f, I) => ({
|
|
1043
1043
|
...f,
|
|
1044
1044
|
[I.path.join(".")]: I.message
|
|
1045
1045
|
}), {}) : void 0
|
|
1046
1046
|
);
|
|
1047
1047
|
}
|
|
1048
|
-
}, [p, u]), /* @__PURE__ */ n(at, { width: "auto", height: "auto", method: "POST", initialValues: i, children: ({ values:
|
|
1048
|
+
}, [p, u]), /* @__PURE__ */ n(at, { width: "auto", height: "auto", method: "POST", initialValues: i, children: ({ values: h, onChange: f }) => /* @__PURE__ */ w(S.Root, { gap: 5, children: [
|
|
1049
1049
|
/* @__PURE__ */ n(S.Item, { m: 6, xs: 12, children: /* @__PURE__ */ n(
|
|
1050
|
-
|
|
1050
|
+
$,
|
|
1051
1051
|
{
|
|
1052
1052
|
name: "name",
|
|
1053
1053
|
label: m(l("popup.navigation.form.name.label", "Name")),
|
|
1054
|
-
error:
|
|
1054
|
+
error: v("name"),
|
|
1055
1055
|
children: /* @__PURE__ */ n(
|
|
1056
1056
|
we,
|
|
1057
1057
|
{
|
|
@@ -1060,25 +1060,25 @@ const ho = s.object({
|
|
|
1060
1060
|
placeholder: m(
|
|
1061
1061
|
l("popup.navigation.form.name.placeholder", "Navigations's name")
|
|
1062
1062
|
),
|
|
1063
|
-
onChange: (I,
|
|
1064
|
-
value:
|
|
1063
|
+
onChange: (I, y) => C(I, y, f),
|
|
1064
|
+
value: h.name,
|
|
1065
1065
|
disabled: o
|
|
1066
1066
|
}
|
|
1067
1067
|
)
|
|
1068
1068
|
}
|
|
1069
1069
|
) }),
|
|
1070
1070
|
/* @__PURE__ */ n(S.Item, { m: 6, xs: 12, children: /* @__PURE__ */ n(
|
|
1071
|
-
|
|
1071
|
+
$,
|
|
1072
1072
|
{
|
|
1073
1073
|
name: "visible",
|
|
1074
1074
|
label: m(l("popup.navigation.form.visible.label", "Visibility")),
|
|
1075
|
-
error:
|
|
1075
|
+
error: v("visible"),
|
|
1076
1076
|
children: /* @__PURE__ */ n(
|
|
1077
1077
|
me,
|
|
1078
1078
|
{
|
|
1079
1079
|
name: "visible",
|
|
1080
|
-
checked:
|
|
1081
|
-
onChange: (I) =>
|
|
1080
|
+
checked: h.visible,
|
|
1081
|
+
onChange: (I) => C(I, !h.visible, f),
|
|
1082
1082
|
onLabel: m(l("popup.navigation.form.visible.toggle.visible")),
|
|
1083
1083
|
offLabel: m(l("popup.navigation.form.visible.toggle.hidden")),
|
|
1084
1084
|
disabled: o,
|
|
@@ -1093,7 +1093,7 @@ const ho = s.object({
|
|
|
1093
1093
|
items: [],
|
|
1094
1094
|
visible: !1
|
|
1095
1095
|
}, Oo = ({ setState: e, current: t, isLoading: a, alreadyUsedNames: o }) => {
|
|
1096
|
-
const i =
|
|
1096
|
+
const i = E(
|
|
1097
1097
|
({ disabled: r, ...d }) => {
|
|
1098
1098
|
e({
|
|
1099
1099
|
view: "CREATE",
|
|
@@ -1132,18 +1132,18 @@ const ho = s.object({
|
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
);
|
|
1135
|
-
}, _o = /* @__PURE__ */ n(
|
|
1136
|
-
const o = ne(), i = !!t.length, { formatMessage: r } = A(), d = At(), c =
|
|
1135
|
+
}, _o = /* @__PURE__ */ n(vt, {}), Qo = /* @__PURE__ */ n(Tt, {}), Kt = /* @__PURE__ */ n(ya, {}), Uo = ({ navigations: e, selected: t, setState: a }) => {
|
|
1136
|
+
const o = ne(), i = !!t.length, { formatMessage: r } = A(), d = At(), c = E(
|
|
1137
1137
|
() => a({
|
|
1138
1138
|
navigations: e,
|
|
1139
1139
|
selected: i ? [] : e.map((I) => I),
|
|
1140
1140
|
view: "LIST"
|
|
1141
1141
|
}),
|
|
1142
1142
|
[a, e, i]
|
|
1143
|
-
), m = X(() => new Set(t.map(nt("documentId"))), [t]), p = (I,
|
|
1143
|
+
), m = X(() => new Set(t.map(nt("documentId"))), [t]), p = (I, y) => () => {
|
|
1144
1144
|
a({
|
|
1145
1145
|
navigations: e,
|
|
1146
|
-
selected:
|
|
1146
|
+
selected: y ? t.filter(({ documentId: T }) => T !== I.documentId) : t.concat([I]),
|
|
1147
1147
|
view: "LIST"
|
|
1148
1148
|
});
|
|
1149
1149
|
}, u = (I) => () => {
|
|
@@ -1152,11 +1152,11 @@ const ho = s.object({
|
|
|
1152
1152
|
current: I,
|
|
1153
1153
|
navigation: I,
|
|
1154
1154
|
alreadyUsedNames: e.reduce(
|
|
1155
|
-
(
|
|
1155
|
+
(y, { name: T }) => T !== I.name ? y.concat([T]) : y,
|
|
1156
1156
|
[]
|
|
1157
1157
|
)
|
|
1158
1158
|
});
|
|
1159
|
-
},
|
|
1159
|
+
}, C = (I) => () => {
|
|
1160
1160
|
a({
|
|
1161
1161
|
view: "DELETE",
|
|
1162
1162
|
navigations: I
|
|
@@ -1166,9 +1166,9 @@ const ho = s.object({
|
|
|
1166
1166
|
view: "CACHE_PURGE",
|
|
1167
1167
|
navigations: I
|
|
1168
1168
|
});
|
|
1169
|
-
},
|
|
1169
|
+
}, v = E(C(t), [C]), h = E(b(t), [b]), f = (I) => [I].concat(
|
|
1170
1170
|
e.filter(
|
|
1171
|
-
(
|
|
1171
|
+
(y) => y.documentId === I.documentId && y.locale !== I.locale
|
|
1172
1172
|
)
|
|
1173
1173
|
);
|
|
1174
1174
|
return /* @__PURE__ */ w(ie, { children: [
|
|
@@ -1176,16 +1176,16 @@ const ho = s.object({
|
|
|
1176
1176
|
/* @__PURE__ */ n(D, { paddingRight: 3, children: r(l("popup.navigation.manage.table.hasSelected"), {
|
|
1177
1177
|
count: t.length
|
|
1178
1178
|
}) }),
|
|
1179
|
-
/* @__PURE__ */ n(K, { onClick:
|
|
1180
|
-
o.data?.isCacheEnabled ? /* @__PURE__ */ n(K, { onClick:
|
|
1179
|
+
/* @__PURE__ */ n(K, { onClick: v, variant: "tertiary", children: r(l("popup.navigation.manage.button.delete")) }),
|
|
1180
|
+
o.data?.isCacheEnabled ? /* @__PURE__ */ n(K, { onClick: h, variant: "tertiary", children: r(l("popup.navigation.manage.button.purge")) }) : null
|
|
1181
1181
|
] }) : null }) }),
|
|
1182
1182
|
/* @__PURE__ */ w(sn, { rowCount: e.length, colCount: 6, children: [
|
|
1183
1183
|
/* @__PURE__ */ n(dn, { children: /* @__PURE__ */ w(et, { children: [
|
|
1184
1184
|
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(qt, { onCheckedChange: c, check: i }) }),
|
|
1185
|
-
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(
|
|
1186
|
-
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(
|
|
1187
|
-
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(
|
|
1188
|
-
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(
|
|
1185
|
+
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: r(l("popup.navigation.manage.table.id")) }) }),
|
|
1186
|
+
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: r(l("popup.navigation.manage.table.name")) }) }),
|
|
1187
|
+
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: r(l("popup.navigation.manage.table.locale")) }) }),
|
|
1188
|
+
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: r(l("popup.navigation.manage.table.visibility")) }) }),
|
|
1189
1189
|
/* @__PURE__ */ n(ce, { children: o.data?.isCacheEnabled ? /* @__PURE__ */ n(P, { direction: "row", children: /* @__PURE__ */ n(D, { paddingLeft: 1, children: /* @__PURE__ */ n(
|
|
1190
1190
|
ye,
|
|
1191
1191
|
{
|
|
@@ -1207,10 +1207,10 @@ const ho = s.object({
|
|
|
1207
1207
|
checked: m.has(I.documentId)
|
|
1208
1208
|
}
|
|
1209
1209
|
) }),
|
|
1210
|
-
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
|
|
1211
|
-
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
|
|
1212
|
-
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
|
|
1213
|
-
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(
|
|
1210
|
+
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: I.documentId }) }),
|
|
1211
|
+
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: I.name }) }),
|
|
1212
|
+
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: f(I).map(nt("locale")).join(", ") }) }),
|
|
1213
|
+
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: I.visible ? r(l("popup.navigation.manage.navigation.visible")) : r(l("popup.navigation.manage.navigation.hidden")) }) }),
|
|
1214
1214
|
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ w(P, { width: "100%", direction: "row", alignItems: "center", justifyContent: "flex-end", children: [
|
|
1215
1215
|
/* @__PURE__ */ n(D, { paddingLeft: 1, children: /* @__PURE__ */ n(
|
|
1216
1216
|
ye,
|
|
@@ -1224,7 +1224,7 @@ const ho = s.object({
|
|
|
1224
1224
|
/* @__PURE__ */ n(D, { paddingLeft: 1, children: /* @__PURE__ */ n(
|
|
1225
1225
|
ye,
|
|
1226
1226
|
{
|
|
1227
|
-
onClick:
|
|
1227
|
+
onClick: C([I]),
|
|
1228
1228
|
label: r(l("popup.navigation.manage.button.delete")),
|
|
1229
1229
|
noBorder: !0,
|
|
1230
1230
|
children: Qo
|
|
@@ -1275,8 +1275,8 @@ const ho = s.object({
|
|
|
1275
1275
|
}, Wo = ({ navigations: e }) => {
|
|
1276
1276
|
const { formatMessage: t } = A();
|
|
1277
1277
|
return /* @__PURE__ */ w(S.Root, { children: [
|
|
1278
|
-
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(
|
|
1279
|
-
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(
|
|
1278
|
+
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(F, { variant: "beta", children: t(l("popup.navigation.manage.delete.header")) }) }) }),
|
|
1279
|
+
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(F, { variant: "omega", fontWeight: "semiBold", children: Xo(e) }) })
|
|
1280
1280
|
] });
|
|
1281
1281
|
}, Ho = ({ state: e, onSubmit: t, onReset: a, isLoading: o }) => {
|
|
1282
1282
|
const { formatMessage: i } = A();
|
|
@@ -1326,7 +1326,7 @@ const ho = s.object({
|
|
|
1326
1326
|
navigation: o,
|
|
1327
1327
|
setState: i
|
|
1328
1328
|
}) => {
|
|
1329
|
-
const r = X(() => t ?? o, [t]), d =
|
|
1329
|
+
const r = X(() => t ?? o, [t]), d = E(
|
|
1330
1330
|
({ disabled: c, ...m }) => {
|
|
1331
1331
|
i({
|
|
1332
1332
|
view: "EDIT",
|
|
@@ -1369,8 +1369,8 @@ const ho = s.object({
|
|
|
1369
1369
|
}, ei = ({ navigations: e }) => {
|
|
1370
1370
|
const { formatMessage: t } = A();
|
|
1371
1371
|
return /* @__PURE__ */ w(S.Root, { children: [
|
|
1372
|
-
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(
|
|
1373
|
-
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(
|
|
1372
|
+
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(P, { children: /* @__PURE__ */ n(F, { variant: "beta", children: t(l("popup.navigation.manage.purge.header")) }) }) }),
|
|
1373
|
+
/* @__PURE__ */ n(S.Item, { col: 12, paddingBottom: 1, children: /* @__PURE__ */ n(F, { variant: "omega", fontWeight: "semiBold", children: ni(e) }) })
|
|
1374
1374
|
] });
|
|
1375
1375
|
}, ti = ({ onSubmit: e, onReset: t, isLoading: a }) => {
|
|
1376
1376
|
const { formatMessage: o } = A();
|
|
@@ -1392,7 +1392,7 @@ const ho = s.object({
|
|
|
1392
1392
|
}
|
|
1393
1393
|
);
|
|
1394
1394
|
}, ni = (e) => e.map(nt("name")).join(", "), ai = ({ initialState: e, isOpened: t, onClose: a }) => {
|
|
1395
|
-
const { formatMessage: o } = A(), [i, r] = N(e), { toggleNotification: d } = Oe(), c = So(), m =
|
|
1395
|
+
const { formatMessage: o } = A(), [i, r] = N(e), { toggleNotification: d } = Oe(), c = So(), m = xo(), p = No(), u = In({}), C = Cn(), b = Ft(), v = At(), h = X(
|
|
1396
1396
|
() => Xe(b.data ?? [], "id"),
|
|
1397
1397
|
[b.data]
|
|
1398
1398
|
), f = Tn([
|
|
@@ -1400,12 +1400,12 @@ const ho = s.object({
|
|
|
1400
1400
|
b,
|
|
1401
1401
|
p,
|
|
1402
1402
|
u,
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
]), I =
|
|
1403
|
+
C,
|
|
1404
|
+
v
|
|
1405
|
+
]), I = E(() => r({ view: "INITIAL" }), [r]), y = E(async () => {
|
|
1406
1406
|
const k = i.view === "DELETE" ? () => {
|
|
1407
1407
|
m.mutate(
|
|
1408
|
-
i.navigations.reduce((
|
|
1408
|
+
i.navigations.reduce((x, M) => (M.documentId && x.push(M.documentId), x), []),
|
|
1409
1409
|
{
|
|
1410
1410
|
onSuccess: c
|
|
1411
1411
|
}
|
|
@@ -1418,8 +1418,8 @@ const ho = s.object({
|
|
|
1418
1418
|
message: o(l("notification.navigation.submit"))
|
|
1419
1419
|
});
|
|
1420
1420
|
},
|
|
1421
|
-
onError(
|
|
1422
|
-
console.warn(
|
|
1421
|
+
onError(x) {
|
|
1422
|
+
console.warn(x), d({
|
|
1423
1423
|
type: "warning",
|
|
1424
1424
|
message: o(l("notification.navigation.error"), {
|
|
1425
1425
|
errorTitles: ""
|
|
@@ -1435,8 +1435,8 @@ const ho = s.object({
|
|
|
1435
1435
|
message: o(l("notification.navigation.submit"))
|
|
1436
1436
|
});
|
|
1437
1437
|
},
|
|
1438
|
-
onError(
|
|
1439
|
-
console.warn(
|
|
1438
|
+
onError(x) {
|
|
1439
|
+
console.warn(x), d({
|
|
1440
1440
|
type: "warning",
|
|
1441
1441
|
message: o(l("notification.navigation.error"), {
|
|
1442
1442
|
errorTitles: ""
|
|
@@ -1445,8 +1445,8 @@ const ho = s.object({
|
|
|
1445
1445
|
}
|
|
1446
1446
|
});
|
|
1447
1447
|
} : i.view === "CACHE_PURGE" ? () => {
|
|
1448
|
-
|
|
1449
|
-
i.navigations.reduce((
|
|
1448
|
+
C.mutate(
|
|
1449
|
+
i.navigations.reduce((x, M) => (M.documentId && x.push(M.documentId), x), []),
|
|
1450
1450
|
{
|
|
1451
1451
|
onSuccess: c
|
|
1452
1452
|
}
|
|
@@ -1455,10 +1455,10 @@ const ho = s.object({
|
|
|
1455
1455
|
};
|
|
1456
1456
|
try {
|
|
1457
1457
|
k(), r({ view: "INITIAL" });
|
|
1458
|
-
} catch (
|
|
1458
|
+
} catch (x) {
|
|
1459
1459
|
r({
|
|
1460
1460
|
view: "ERROR",
|
|
1461
|
-
errors:
|
|
1461
|
+
errors: x instanceof Error ? [x] : []
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
1464
1464
|
}, [
|
|
@@ -1466,7 +1466,7 @@ const ho = s.object({
|
|
|
1466
1466
|
r,
|
|
1467
1467
|
c,
|
|
1468
1468
|
p,
|
|
1469
|
-
|
|
1469
|
+
C,
|
|
1470
1470
|
u,
|
|
1471
1471
|
m,
|
|
1472
1472
|
d,
|
|
@@ -1476,17 +1476,17 @@ const ho = s.object({
|
|
|
1476
1476
|
V(() => {
|
|
1477
1477
|
(i.view === "INITIAL" || i.view === "LIST") && r({
|
|
1478
1478
|
view: "LIST",
|
|
1479
|
-
navigations:
|
|
1479
|
+
navigations: h,
|
|
1480
1480
|
selected: []
|
|
1481
1481
|
});
|
|
1482
|
-
}, [i.view,
|
|
1483
|
-
const T = oi(i, o, !!f),
|
|
1482
|
+
}, [i.view, h]);
|
|
1483
|
+
const T = oi(i, o, !!f), L = ii(i, r, !!f), z = ri({
|
|
1484
1484
|
state: i,
|
|
1485
1485
|
setState: r,
|
|
1486
1486
|
onClose: a,
|
|
1487
|
-
onSubmit:
|
|
1487
|
+
onSubmit: y,
|
|
1488
1488
|
onReset: I,
|
|
1489
|
-
navigations:
|
|
1489
|
+
navigations: h,
|
|
1490
1490
|
isLoading: !!f
|
|
1491
1491
|
});
|
|
1492
1492
|
return /* @__PURE__ */ n(
|
|
@@ -1498,8 +1498,8 @@ const ho = s.object({
|
|
|
1498
1498
|
},
|
|
1499
1499
|
open: t,
|
|
1500
1500
|
children: /* @__PURE__ */ w(H.Content, { children: [
|
|
1501
|
-
/* @__PURE__ */ n(H.Header, { children: /* @__PURE__ */ n(
|
|
1502
|
-
/* @__PURE__ */ n(H.Body, { children:
|
|
1501
|
+
/* @__PURE__ */ n(H.Header, { children: /* @__PURE__ */ n(F, { variant: "omega", fontWeight: "bold", textColor: "neutral800", as: "h2", children: T }) }),
|
|
1502
|
+
/* @__PURE__ */ n(H.Body, { children: L }),
|
|
1503
1503
|
z
|
|
1504
1504
|
] })
|
|
1505
1505
|
}
|
|
@@ -1570,7 +1570,7 @@ const ho = s.object({
|
|
|
1570
1570
|
return Nt(e.state);
|
|
1571
1571
|
}
|
|
1572
1572
|
}, Nt = (e) => (console.warn(`Unknown state "${e?.view}". (${JSON.stringify(e)})`), null), li = () => {
|
|
1573
|
-
const [e, t] = N(!1), a =
|
|
1573
|
+
const [e, t] = N(!1), a = E(() => t(!0), [t]), o = E(() => t(!1), [t]), i = X(
|
|
1574
1574
|
() => e ? /* @__PURE__ */ n(ai, { initialState: { view: "INITIAL" }, isOpened: !0, onClose: o }) : null,
|
|
1575
1575
|
[e, o]
|
|
1576
1576
|
);
|
|
@@ -1604,9 +1604,9 @@ const ho = s.object({
|
|
|
1604
1604
|
handleCachePurge: m,
|
|
1605
1605
|
permissions: p = {},
|
|
1606
1606
|
locale: u,
|
|
1607
|
-
currentLocale:
|
|
1607
|
+
currentLocale: C
|
|
1608
1608
|
}) => {
|
|
1609
|
-
const { formatMessage: b } = A(), { openNavigationManagerModal:
|
|
1609
|
+
const { formatMessage: b } = A(), { openNavigationManagerModal: v, navigationManagerModal: h } = li(), f = ne(), I = !!u.restLocale?.length, y = f.data?.isCacheEnabled, { canUpdate: T } = p, { isDesktop: L, isMobile: z, isLargeDesktop: k } = Ze();
|
|
1610
1610
|
return /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(
|
|
1611
1611
|
qe.Header,
|
|
1612
1612
|
{
|
|
@@ -1631,14 +1631,14 @@ const ho = s.object({
|
|
|
1631
1631
|
Me,
|
|
1632
1632
|
{
|
|
1633
1633
|
m: 3,
|
|
1634
|
-
xs:
|
|
1634
|
+
xs: y ? 4 : 6,
|
|
1635
1635
|
orderInitial: 3,
|
|
1636
1636
|
orderSmall: 3,
|
|
1637
1637
|
orderMedium: 1,
|
|
1638
1638
|
children: /* @__PURE__ */ n(
|
|
1639
1639
|
K,
|
|
1640
1640
|
{
|
|
1641
|
-
onClick:
|
|
1641
|
+
onClick: v,
|
|
1642
1642
|
startIcon: null,
|
|
1643
1643
|
type: "button",
|
|
1644
1644
|
variant: "secondary",
|
|
@@ -1658,27 +1658,27 @@ const ho = s.object({
|
|
|
1658
1658
|
orderSmall: 1,
|
|
1659
1659
|
orderMedium: 2,
|
|
1660
1660
|
children: /* @__PURE__ */ n(Dt.Root, { width: "100%", children: /* @__PURE__ */ n(
|
|
1661
|
-
|
|
1661
|
+
xe,
|
|
1662
1662
|
{
|
|
1663
1663
|
type: "select",
|
|
1664
1664
|
placeholder: "Change navigation",
|
|
1665
1665
|
name: "navigationSelect",
|
|
1666
|
-
onChange: (
|
|
1666
|
+
onChange: (x) => {
|
|
1667
1667
|
const M = t.find(
|
|
1668
|
-
({ documentId: _ }) =>
|
|
1668
|
+
({ documentId: _ }) => x === _
|
|
1669
1669
|
);
|
|
1670
1670
|
M && r(M);
|
|
1671
1671
|
},
|
|
1672
1672
|
value: e?.documentId,
|
|
1673
1673
|
size: "S",
|
|
1674
1674
|
style: null,
|
|
1675
|
-
children: t.filter(({ locale:
|
|
1675
|
+
children: t.filter(({ locale: x }) => x === C).map(({ documentId: x, name: M }) => /* @__PURE__ */ n(Ae, { value: x, children: M }, x))
|
|
1676
1676
|
}
|
|
1677
1677
|
) })
|
|
1678
1678
|
}
|
|
1679
1679
|
),
|
|
1680
1680
|
I ? /* @__PURE__ */ n(Me, { m: 2, xs: 3, orderInitial: 2, orderSmall: 2, orderMedium: 3, children: /* @__PURE__ */ n(Dt.Root, { width: "100%", children: /* @__PURE__ */ n(
|
|
1681
|
-
|
|
1681
|
+
xe,
|
|
1682
1682
|
{
|
|
1683
1683
|
type: "select",
|
|
1684
1684
|
placeholder: b(
|
|
@@ -1686,16 +1686,16 @@ const ho = s.object({
|
|
|
1686
1686
|
),
|
|
1687
1687
|
name: "navigationLocalizationSelect",
|
|
1688
1688
|
onChange: d,
|
|
1689
|
-
value:
|
|
1689
|
+
value: C,
|
|
1690
1690
|
size: "S",
|
|
1691
|
-
children: [u.defaultLocale, ...u.restLocale].map((
|
|
1691
|
+
children: [u.defaultLocale, ...u.restLocale].map((x) => /* @__PURE__ */ n(Ae, { value: x, children: x }, x))
|
|
1692
1692
|
}
|
|
1693
1693
|
) }) }) : null,
|
|
1694
1694
|
T && /* @__PURE__ */ n(
|
|
1695
1695
|
Me,
|
|
1696
1696
|
{
|
|
1697
1697
|
m: 3,
|
|
1698
|
-
xs:
|
|
1698
|
+
xs: y ? 4 : 6,
|
|
1699
1699
|
orderInitial: 4,
|
|
1700
1700
|
orderSmall: 4,
|
|
1701
1701
|
orderMedium: 4,
|
|
@@ -1713,8 +1713,8 @@ const ho = s.object({
|
|
|
1713
1713
|
)
|
|
1714
1714
|
}
|
|
1715
1715
|
),
|
|
1716
|
-
|
|
1717
|
-
|
|
1716
|
+
y && /* @__PURE__ */ w(ie, { children: [
|
|
1717
|
+
L && /* @__PURE__ */ n(Me, { m: 9, orderInitial: 5, orderSmall: 5, orderMedium: 5 }),
|
|
1718
1718
|
/* @__PURE__ */ n(Me, { m: 3, xs: 4, orderInitial: 6, orderSmall: 6, orderMedium: 6, children: /* @__PURE__ */ n(
|
|
1719
1719
|
K,
|
|
1720
1720
|
{
|
|
@@ -1731,7 +1731,7 @@ const ho = s.object({
|
|
|
1731
1731
|
]
|
|
1732
1732
|
}
|
|
1733
1733
|
) }),
|
|
1734
|
-
T &&
|
|
1734
|
+
T && h
|
|
1735
1735
|
]
|
|
1736
1736
|
}
|
|
1737
1737
|
),
|
|
@@ -1799,8 +1799,8 @@ const ho = s.object({
|
|
|
1799
1799
|
cursor: "pointer",
|
|
1800
1800
|
style: { marginRight: "16px" },
|
|
1801
1801
|
children: [
|
|
1802
|
-
/* @__PURE__ */ n(ui, { children: t ? /* @__PURE__ */ n(Ia, { width: "16px", height: "9px" }) : /* @__PURE__ */ n(
|
|
1803
|
-
!o && /* @__PURE__ */ w(
|
|
1802
|
+
/* @__PURE__ */ n(ui, { children: t ? /* @__PURE__ */ n(Ia, { width: "16px", height: "9px" }) : /* @__PURE__ */ n(Ca, { width: "16px", height: "9px" }) }),
|
|
1803
|
+
!o && /* @__PURE__ */ w(F, { variant: "pi", children: [
|
|
1804
1804
|
a,
|
|
1805
1805
|
" nested ",
|
|
1806
1806
|
a === 1 ? "item" : "items"
|
|
@@ -1877,7 +1877,7 @@ const ho = s.object({
|
|
|
1877
1877
|
}
|
|
1878
1878
|
`, gi = jn.forwardRef((e, t) => {
|
|
1879
1879
|
const { isSmallMobile: a } = Ze();
|
|
1880
|
-
return /* @__PURE__ */ n(mi, { ...e, ref: t, isMobile: a, children: /* @__PURE__ */ n(
|
|
1880
|
+
return /* @__PURE__ */ n(mi, { ...e, ref: t, isMobile: a, children: /* @__PURE__ */ n(va, {}) });
|
|
1881
1881
|
}), hi = oe(oa)`
|
|
1882
1882
|
width: 100%;
|
|
1883
1883
|
|
|
@@ -1889,7 +1889,7 @@ const ho = s.object({
|
|
|
1889
1889
|
> div > * {
|
|
1890
1890
|
margin: 0px ${({ theme: e }) => e.spaces[1]};
|
|
1891
1891
|
}
|
|
1892
|
-
`, fi = /* @__PURE__ */ n(
|
|
1892
|
+
`, fi = /* @__PURE__ */ n(vt, {}), yi = /* @__PURE__ */ n(Tt, {}), bi = /* @__PURE__ */ n(mn, {}), Ii = /* @__PURE__ */ n(Ta, {}), Ci = { zIndex: 2 }, vi = { maxWidth: "425px" }, Ti = ({
|
|
1893
1893
|
title: e,
|
|
1894
1894
|
path: t,
|
|
1895
1895
|
icon: a,
|
|
@@ -1901,26 +1901,26 @@ const ho = s.object({
|
|
|
1901
1901
|
dragRef: m,
|
|
1902
1902
|
isSearchActive: p
|
|
1903
1903
|
}) => {
|
|
1904
|
-
const { formatMessage: u } = A(), { isSmallMobile:
|
|
1904
|
+
const { formatMessage: u } = A(), { isSmallMobile: C } = Ze();
|
|
1905
1905
|
return /* @__PURE__ */ w(hi, { children: [
|
|
1906
1906
|
/* @__PURE__ */ w(P, { alignItems: "center", children: [
|
|
1907
1907
|
i && /* @__PURE__ */ n(gi, { ref: m, isActive: p }),
|
|
1908
|
-
/* @__PURE__ */ n(
|
|
1908
|
+
/* @__PURE__ */ n(F, { variant: "omega", fontWeight: "bold", fontSize: C ? "12px" : "14px", children: e }),
|
|
1909
1909
|
/* @__PURE__ */ n(
|
|
1910
|
-
|
|
1910
|
+
F,
|
|
1911
1911
|
{
|
|
1912
1912
|
variant: "omega",
|
|
1913
1913
|
fontWeight: "bold",
|
|
1914
1914
|
textColor: "neutral500",
|
|
1915
|
-
fontSize:
|
|
1915
|
+
fontSize: C ? "12px" : "14px",
|
|
1916
1916
|
ellipsis: !0,
|
|
1917
|
-
style:
|
|
1917
|
+
style: vi,
|
|
1918
1918
|
children: t
|
|
1919
1919
|
}
|
|
1920
1920
|
),
|
|
1921
1921
|
/* @__PURE__ */ n(P, { children: a })
|
|
1922
1922
|
] }),
|
|
1923
|
-
/* @__PURE__ */ w(P, { alignItems: "center", style:
|
|
1923
|
+
/* @__PURE__ */ w(P, { alignItems: "center", style: Ci, children: [
|
|
1924
1924
|
o && /* @__PURE__ */ n(Sn, { borderColor: "danger200", backgroundColor: "danger100", textColor: "danger600", children: u(l("components.navigationItem.badge.removed")) }),
|
|
1925
1925
|
/* @__PURE__ */ w(un, { children: [
|
|
1926
1926
|
/* @__PURE__ */ n(
|
|
@@ -1936,7 +1936,7 @@ const ho = s.object({
|
|
|
1936
1936
|
)
|
|
1937
1937
|
),
|
|
1938
1938
|
children: i ? fi : bi,
|
|
1939
|
-
isMobile:
|
|
1939
|
+
isMobile: C
|
|
1940
1940
|
}
|
|
1941
1941
|
),
|
|
1942
1942
|
i && /* @__PURE__ */ n(ie, { children: o ? /* @__PURE__ */ n(
|
|
@@ -1949,7 +1949,7 @@ const ho = s.object({
|
|
|
1949
1949
|
),
|
|
1950
1950
|
variant: "success-light",
|
|
1951
1951
|
children: Ii,
|
|
1952
|
-
isMobile:
|
|
1952
|
+
isMobile: C
|
|
1953
1953
|
}
|
|
1954
1954
|
) : /* @__PURE__ */ n(
|
|
1955
1955
|
ht,
|
|
@@ -1961,7 +1961,7 @@ const ho = s.object({
|
|
|
1961
1961
|
l("components.navigationItem.action.remove", "Remove")
|
|
1962
1962
|
),
|
|
1963
1963
|
children: yi,
|
|
1964
|
-
isMobile:
|
|
1964
|
+
isMobile: C
|
|
1965
1965
|
}
|
|
1966
1966
|
) })
|
|
1967
1967
|
] })
|
|
@@ -2018,7 +2018,7 @@ const ho = s.object({
|
|
|
2018
2018
|
border-radius: 0 0 0 100%;
|
|
2019
2019
|
}
|
|
2020
2020
|
`};
|
|
2021
|
-
`,
|
|
2021
|
+
`, xi = ({
|
|
2022
2022
|
item: e,
|
|
2023
2023
|
isLast: t = !1,
|
|
2024
2024
|
level: a = 0,
|
|
@@ -2030,33 +2030,33 @@ const ho = s.object({
|
|
|
2030
2030
|
onItemEdit: m,
|
|
2031
2031
|
onItemReOrder: p,
|
|
2032
2032
|
onItemToggleCollapse: u,
|
|
2033
|
-
onItemSubmit:
|
|
2033
|
+
onItemSubmit: C,
|
|
2034
2034
|
displayChildren: b,
|
|
2035
|
-
permissions:
|
|
2036
|
-
structureId:
|
|
2035
|
+
permissions: v,
|
|
2036
|
+
structureId: h,
|
|
2037
2037
|
viewParentId: f,
|
|
2038
2038
|
locale: I
|
|
2039
2039
|
}) => {
|
|
2040
|
-
const
|
|
2040
|
+
const y = Se(e, !0), { formatMessage: T } = A(), L = ne(), z = an(), k = y.type === "EXTERNAL", x = y.type === "WRAPPER", M = kt(L.data?.allowedLevels) ? a < L.data.allowedLevels - 1 : !0, _ = kt(L.data?.allowedLevels) ? a < L.data.allowedLevels : !0, re = !Y(e.items) && !b, Q = k ? void 0 : `${o === "/" ? "" : o}/${y.path === "/" ? "" : y.path}`.replace(
|
|
2041
2041
|
"//",
|
|
2042
2042
|
"/"
|
|
2043
2043
|
), le = bn({
|
|
2044
|
-
uid:
|
|
2044
|
+
uid: y.type === "INTERNAL" ? y.relatedType ?? "" : "",
|
|
2045
2045
|
locale: I
|
|
2046
2046
|
}), ee = bo().data?.find(
|
|
2047
|
-
(W) =>
|
|
2047
|
+
(W) => y.type === "INTERNAL" ? W.uid === y.relatedType : !1
|
|
2048
2048
|
), _e = ee?.uid.includes("api::"), pe = le.data?.find(
|
|
2049
|
-
(W) =>
|
|
2050
|
-
) ?? { documentId: "", id: 0 }, Re = !!pe?.publishedAt, G = k ? "" : st(pe,
|
|
2049
|
+
(W) => y.type === "INTERNAL" ? W.documentId === y.related : !1
|
|
2050
|
+
) ?? { documentId: "", id: 0 }, Re = !!pe?.publishedAt, G = k ? "" : st(pe, L.data), R = ee?.info.displayName ?? "", Z = Re ? "success" : "secondary", se = v.canUpdate, U = We(null), Le = We(null), Ie = We(null), [, Ce] = Kn({
|
|
2051
2051
|
accept: `navigation-item_${o}`,
|
|
2052
|
-
hover(W,
|
|
2052
|
+
hover(W, ve) {
|
|
2053
2053
|
const te = W.order ?? 0, Pe = e.order ?? 0;
|
|
2054
2054
|
if (te === Pe)
|
|
2055
2055
|
return;
|
|
2056
|
-
const ct =
|
|
2057
|
-
if (
|
|
2056
|
+
const ct = Le.current.getBoundingClientRect(), ut = (ct.bottom - ct.top) / 2, Et = ve.getClientOffset();
|
|
2057
|
+
if (!Et)
|
|
2058
2058
|
return;
|
|
2059
|
-
const pt =
|
|
2059
|
+
const pt = Et.y - ct.top, Vn = pt > ut ? (e.order ?? 0) + 0.5 : (e.order ?? 0) - 0.5;
|
|
2060
2060
|
te < Pe && pt < ut || te > Pe && pt > ut || p({
|
|
2061
2061
|
item: Se(W, !0),
|
|
2062
2062
|
newOrder: Vn
|
|
@@ -2065,66 +2065,66 @@ const ho = s.object({
|
|
|
2065
2065
|
collect: (W) => ({
|
|
2066
2066
|
isOverCurrent: W.isOver({ shallow: !0 })
|
|
2067
2067
|
})
|
|
2068
|
-
}), [{ isDragging:
|
|
2068
|
+
}), [{ isDragging: En }, Pn, Mn] = Wn({
|
|
2069
2069
|
type: `navigation-item_${o}`,
|
|
2070
2070
|
item: () => e,
|
|
2071
2071
|
collect: (W) => ({
|
|
2072
2072
|
isDragging: W.isDragging()
|
|
2073
2073
|
})
|
|
2074
|
-
}),
|
|
2074
|
+
}), Ee = {
|
|
2075
2075
|
dragRef: Pn(U),
|
|
2076
|
-
dropRef:
|
|
2076
|
+
dropRef: Ce(Le),
|
|
2077
2077
|
previewRef: Mn(Ie)
|
|
2078
2078
|
}, kn = (W) => {
|
|
2079
|
-
const
|
|
2080
|
-
return `/admin/content-manager/${
|
|
2081
|
-
}, qn =
|
|
2079
|
+
const ve = ee?.kind === "singleType", te = W?.locale ? `?plugins[i18n][locale]=${W?.locale}` : "";
|
|
2080
|
+
return `/admin/content-manager/${ve ? "single-types" : "collection-types"}/${ee?.uid}${ve ? "" : "/" + W?.documentId}${te}`;
|
|
2081
|
+
}, qn = E(
|
|
2082
2082
|
(W) => {
|
|
2083
2083
|
if (!se)
|
|
2084
2084
|
return;
|
|
2085
|
-
const
|
|
2085
|
+
const ve = (y.items ?? []).reduce((te, { order: Pe }) => te < Pe ? Pe : te, 0);
|
|
2086
2086
|
return r(
|
|
2087
2087
|
W,
|
|
2088
|
-
|
|
2088
|
+
y.viewId,
|
|
2089
2089
|
M,
|
|
2090
2090
|
Q,
|
|
2091
|
-
|
|
2092
|
-
`${
|
|
2093
|
-
|
|
2091
|
+
y.menuAttached,
|
|
2092
|
+
`${h}.${y.items?.length ?? 0}`,
|
|
2093
|
+
ve
|
|
2094
2094
|
);
|
|
2095
2095
|
},
|
|
2096
2096
|
[
|
|
2097
|
-
|
|
2097
|
+
y.viewId,
|
|
2098
2098
|
M,
|
|
2099
2099
|
Q,
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2100
|
+
y.menuAttached,
|
|
2101
|
+
h,
|
|
2102
|
+
y.items,
|
|
2103
2103
|
se
|
|
2104
2104
|
]
|
|
2105
2105
|
);
|
|
2106
2106
|
V(() => {
|
|
2107
|
-
|
|
2107
|
+
y.isSearchActive && Ee.dropRef?.current?.scrollIntoView?.({
|
|
2108
2108
|
behavior: "smooth",
|
|
2109
2109
|
block: "center",
|
|
2110
2110
|
inline: "center"
|
|
2111
2111
|
});
|
|
2112
|
-
}, [
|
|
2113
|
-
const Dn =
|
|
2114
|
-
uid:
|
|
2112
|
+
}, [y.isSearchActive, Ee.dropRef.current]);
|
|
2113
|
+
const Dn = vo({
|
|
2114
|
+
uid: y.type === "INTERNAL" ? y.relatedType ?? "" : "",
|
|
2115
2115
|
locale: I
|
|
2116
2116
|
});
|
|
2117
2117
|
V(() => {
|
|
2118
2118
|
Dn();
|
|
2119
2119
|
}, []);
|
|
2120
|
-
const
|
|
2120
|
+
const $t = Bn();
|
|
2121
2121
|
return /* @__PURE__ */ w(
|
|
2122
2122
|
Si,
|
|
2123
2123
|
{
|
|
2124
2124
|
level: a,
|
|
2125
2125
|
isLast: t,
|
|
2126
|
-
style: { opacity:
|
|
2127
|
-
ref:
|
|
2126
|
+
style: { opacity: En ? 0.2 : 1 },
|
|
2127
|
+
ref: Ee ? Ee.dropRef : void 0,
|
|
2128
2128
|
children: [
|
|
2129
2129
|
/* @__PURE__ */ w(
|
|
2130
2130
|
ia,
|
|
@@ -2134,22 +2134,22 @@ const ho = s.object({
|
|
|
2134
2134
|
zIndex: 1,
|
|
2135
2135
|
position: "relative",
|
|
2136
2136
|
overflow: "hidden",
|
|
2137
|
-
backgroundColor:
|
|
2138
|
-
borderColor:
|
|
2137
|
+
backgroundColor: y.isSearchActive ? $t.colors.secondary100 : void 0,
|
|
2138
|
+
borderColor: y.isSearchActive ? $t.colors.secondary200 : void 0,
|
|
2139
2139
|
transition: "background-color 0.3s ease-in"
|
|
2140
2140
|
},
|
|
2141
2141
|
children: [
|
|
2142
|
-
|
|
2143
|
-
/* @__PURE__ */ w("div", { ref:
|
|
2142
|
+
y.removed && /* @__PURE__ */ n(wi, {}),
|
|
2143
|
+
/* @__PURE__ */ w("div", { ref: Ee.previewRef, children: [
|
|
2144
2144
|
/* @__PURE__ */ n(Vt, { children: /* @__PURE__ */ n(
|
|
2145
2145
|
Ti,
|
|
2146
2146
|
{
|
|
2147
2147
|
title: e.title ?? "",
|
|
2148
|
-
path: k ?
|
|
2149
|
-
icon: k ? /* @__PURE__ */ n(wa, {}) :
|
|
2148
|
+
path: k ? y.externalPath : Q,
|
|
2149
|
+
icon: k ? /* @__PURE__ */ n(wa, {}) : x ? /* @__PURE__ */ n(Sa, {}) : /* @__PURE__ */ n(xa, {}),
|
|
2150
2150
|
onItemRemove: () => d({ ...e, viewParentId: f }),
|
|
2151
2151
|
onItemEdit: () => {
|
|
2152
|
-
const { __type: W, documentId:
|
|
2152
|
+
const { __type: W, documentId: ve } = e.related ?? {};
|
|
2153
2153
|
e.type !== "EXTERNAL" && e.type !== "INTERNAL" && e.type !== "WRAPPER" || m({
|
|
2154
2154
|
item: e.type === "INTERNAL" ? {
|
|
2155
2155
|
...e,
|
|
@@ -2158,7 +2158,7 @@ const ho = s.object({
|
|
|
2158
2158
|
isParentAttachedToMenu: i,
|
|
2159
2159
|
isSearchActive: !1,
|
|
2160
2160
|
relatedType: W ?? "",
|
|
2161
|
-
related:
|
|
2161
|
+
related: ve ?? "",
|
|
2162
2162
|
additionalFields: e.additionalFields ?? {},
|
|
2163
2163
|
items: e.items ?? [],
|
|
2164
2164
|
autoSync: e.autoSync ?? !0,
|
|
@@ -2196,10 +2196,10 @@ const ho = s.object({
|
|
|
2196
2196
|
});
|
|
2197
2197
|
},
|
|
2198
2198
|
onItemRestore: () => c({ ...e, viewParentId: f }),
|
|
2199
|
-
dragRef:
|
|
2200
|
-
removed:
|
|
2199
|
+
dragRef: Ee.dragRef,
|
|
2200
|
+
removed: y.removed,
|
|
2201
2201
|
canUpdate: se,
|
|
2202
|
-
isSearchActive:
|
|
2202
|
+
isSearchActive: y.isSearchActive
|
|
2203
2203
|
}
|
|
2204
2204
|
) }),
|
|
2205
2205
|
/* @__PURE__ */ n(tt, {}),
|
|
@@ -2216,23 +2216,23 @@ const ho = s.object({
|
|
|
2216
2216
|
pi,
|
|
2217
2217
|
{
|
|
2218
2218
|
toggle: () => u({ ...e, viewParentId: f }),
|
|
2219
|
-
collapsed:
|
|
2219
|
+
collapsed: y.collapsed,
|
|
2220
2220
|
itemsCount: e.items?.length ?? 0
|
|
2221
2221
|
}
|
|
2222
2222
|
),
|
|
2223
2223
|
se && M && /* @__PURE__ */ n(
|
|
2224
2224
|
ra,
|
|
2225
2225
|
{
|
|
2226
|
-
disabled:
|
|
2226
|
+
disabled: y.removed,
|
|
2227
2227
|
startIcon: /* @__PURE__ */ n(wt, {}),
|
|
2228
2228
|
onClick: qn,
|
|
2229
2229
|
size: "S",
|
|
2230
2230
|
children: /* @__PURE__ */ n(
|
|
2231
|
-
|
|
2231
|
+
F,
|
|
2232
2232
|
{
|
|
2233
2233
|
variant: "pi",
|
|
2234
2234
|
fontWeight: "bold",
|
|
2235
|
-
textColor:
|
|
2235
|
+
textColor: y.removed ? "neutral600" : "primary600",
|
|
2236
2236
|
fontSize: { initial: "1.1rem", small: "1.2rem" },
|
|
2237
2237
|
children: T(l("components.navigationItem.action.newItem"))
|
|
2238
2238
|
}
|
|
@@ -2240,9 +2240,9 @@ const ho = s.object({
|
|
|
2240
2240
|
}
|
|
2241
2241
|
)
|
|
2242
2242
|
] }),
|
|
2243
|
-
|
|
2243
|
+
y.type === "INTERNAL" && y.related && !pe.id ? /* @__PURE__ */ w(P, { justifyContent: "center", alignItems: "center", children: [
|
|
2244
2244
|
/* @__PURE__ */ w(
|
|
2245
|
-
|
|
2245
|
+
F,
|
|
2246
2246
|
{
|
|
2247
2247
|
variant: "omega",
|
|
2248
2248
|
textColor: "neutral600",
|
|
@@ -2254,7 +2254,7 @@ const ho = s.object({
|
|
|
2254
2254
|
}
|
|
2255
2255
|
),
|
|
2256
2256
|
/* @__PURE__ */ n(
|
|
2257
|
-
|
|
2257
|
+
F,
|
|
2258
2258
|
{
|
|
2259
2259
|
variant: "omega",
|
|
2260
2260
|
textColor: "neutral800",
|
|
@@ -2280,7 +2280,7 @@ const ho = s.object({
|
|
|
2280
2280
|
}
|
|
2281
2281
|
),
|
|
2282
2282
|
/* @__PURE__ */ w(
|
|
2283
|
-
|
|
2283
|
+
F,
|
|
2284
2284
|
{
|
|
2285
2285
|
variant: "omega",
|
|
2286
2286
|
textColor: "neutral600",
|
|
@@ -2292,7 +2292,7 @@ const ho = s.object({
|
|
|
2292
2292
|
}
|
|
2293
2293
|
),
|
|
2294
2294
|
/* @__PURE__ */ n(
|
|
2295
|
-
|
|
2295
|
+
F,
|
|
2296
2296
|
{
|
|
2297
2297
|
variant: "omega",
|
|
2298
2298
|
textColor: "neutral800",
|
|
@@ -2316,19 +2316,19 @@ const ho = s.object({
|
|
|
2316
2316
|
]
|
|
2317
2317
|
}
|
|
2318
2318
|
),
|
|
2319
|
-
re && !
|
|
2320
|
-
|
|
2319
|
+
re && !y.removed && !y.collapsed && /* @__PURE__ */ n(
|
|
2320
|
+
xn,
|
|
2321
2321
|
{
|
|
2322
2322
|
onItemLevelAdd: r,
|
|
2323
2323
|
onItemEdit: m,
|
|
2324
|
-
onItemSubmit:
|
|
2325
|
-
isParentAttachedToMenu:
|
|
2324
|
+
onItemSubmit: C,
|
|
2325
|
+
isParentAttachedToMenu: y.menuAttached,
|
|
2326
2326
|
items: e.items ?? [],
|
|
2327
2327
|
level: a + 1,
|
|
2328
2328
|
levelPath: Q,
|
|
2329
|
-
permissions:
|
|
2330
|
-
structurePrefix:
|
|
2331
|
-
viewParentId:
|
|
2329
|
+
permissions: v,
|
|
2330
|
+
structurePrefix: h,
|
|
2331
|
+
viewParentId: y.viewId,
|
|
2332
2332
|
locale: I
|
|
2333
2333
|
}
|
|
2334
2334
|
)
|
|
@@ -2352,7 +2352,7 @@ const ho = s.object({
|
|
|
2352
2352
|
border-left: 4px solid ${t.colors.neutral300};
|
|
2353
2353
|
}
|
|
2354
2354
|
`};
|
|
2355
|
-
`,
|
|
2355
|
+
`, xn = ({
|
|
2356
2356
|
isParentAttachedToMenu: e = !1,
|
|
2357
2357
|
items: t,
|
|
2358
2358
|
level: a = 0,
|
|
@@ -2364,17 +2364,17 @@ const ho = s.object({
|
|
|
2364
2364
|
permissions: m,
|
|
2365
2365
|
structurePrefix: p,
|
|
2366
2366
|
viewParentId: u,
|
|
2367
|
-
locale:
|
|
2367
|
+
locale: C
|
|
2368
2368
|
}) => {
|
|
2369
2369
|
const b = ({
|
|
2370
2370
|
item: I,
|
|
2371
|
-
newOrder:
|
|
2371
|
+
newOrder: y
|
|
2372
2372
|
}) => {
|
|
2373
2373
|
d({
|
|
2374
2374
|
...I,
|
|
2375
|
-
order:
|
|
2375
|
+
order: y
|
|
2376
2376
|
});
|
|
2377
|
-
},
|
|
2377
|
+
}, v = (I) => {
|
|
2378
2378
|
d(
|
|
2379
2379
|
Se(
|
|
2380
2380
|
{
|
|
@@ -2384,7 +2384,7 @@ const ho = s.object({
|
|
|
2384
2384
|
!0
|
|
2385
2385
|
)
|
|
2386
2386
|
);
|
|
2387
|
-
},
|
|
2387
|
+
}, h = (I) => {
|
|
2388
2388
|
d(
|
|
2389
2389
|
Se(
|
|
2390
2390
|
{
|
|
@@ -2407,30 +2407,30 @@ const ho = s.object({
|
|
|
2407
2407
|
)
|
|
2408
2408
|
);
|
|
2409
2409
|
};
|
|
2410
|
-
return /* @__PURE__ */ n(Ai, { "data-level": a, children: t?.map((I,
|
|
2411
|
-
|
|
2410
|
+
return /* @__PURE__ */ n(Ai, { "data-level": a, children: t?.map((I, y) => /* @__PURE__ */ n(
|
|
2411
|
+
xi,
|
|
2412
2412
|
{
|
|
2413
2413
|
item: I,
|
|
2414
|
-
isLast:
|
|
2414
|
+
isLast: y === t.length - 1,
|
|
2415
2415
|
level: a,
|
|
2416
2416
|
levelPath: o,
|
|
2417
2417
|
isParentAttachedToMenu: e,
|
|
2418
2418
|
onItemLevelAdd: r,
|
|
2419
2419
|
onItemEdit: i,
|
|
2420
2420
|
onItemSubmit: d,
|
|
2421
|
-
onItemRestore:
|
|
2422
|
-
onItemRemove:
|
|
2421
|
+
onItemRestore: h,
|
|
2422
|
+
onItemRemove: v,
|
|
2423
2423
|
onItemReOrder: b,
|
|
2424
2424
|
onItemToggleCollapse: f,
|
|
2425
2425
|
displayChildren: c,
|
|
2426
2426
|
permissions: m,
|
|
2427
|
-
structureId: p ? `${p}.${
|
|
2427
|
+
structureId: p ? `${p}.${y}` : y.toString(),
|
|
2428
2428
|
viewParentId: u,
|
|
2429
|
-
locale:
|
|
2429
|
+
locale: C
|
|
2430
2430
|
},
|
|
2431
|
-
`list-item-${I.viewId ||
|
|
2431
|
+
`list-item-${I.viewId || y}`
|
|
2432
2432
|
)) });
|
|
2433
|
-
},
|
|
2433
|
+
}, Fi = ({
|
|
2434
2434
|
handleCancel: e,
|
|
2435
2435
|
handleSubmit: t,
|
|
2436
2436
|
submitDisabled: a,
|
|
@@ -2498,7 +2498,7 @@ const ho = s.object({
|
|
|
2498
2498
|
externalPath: g.string().nullish(),
|
|
2499
2499
|
relatedType: g.string(),
|
|
2500
2500
|
related: t ? g.string().optional() : g.string()
|
|
2501
|
-
}),
|
|
2501
|
+
}), Li = ({
|
|
2502
2502
|
isSingleSelected: e,
|
|
2503
2503
|
additionalFields: t
|
|
2504
2504
|
}) => Rt({
|
|
@@ -2509,7 +2509,7 @@ const ho = s.object({
|
|
|
2509
2509
|
externalPath: g.string().min(1).refine((a) => Ni.some((o) => o.test(a))),
|
|
2510
2510
|
relatedType: g.string().optional(),
|
|
2511
2511
|
related: g.string().optional()
|
|
2512
|
-
}),
|
|
2512
|
+
}), $i = ({
|
|
2513
2513
|
isSingleSelected: e,
|
|
2514
2514
|
additionalFields: t
|
|
2515
2515
|
}) => Rt({
|
|
@@ -2517,10 +2517,10 @@ const ho = s.object({
|
|
|
2517
2517
|
}).extend({
|
|
2518
2518
|
type: g.literal("WRAPPER"),
|
|
2519
2519
|
path: g.string().or(g.null()).optional()
|
|
2520
|
-
}),
|
|
2521
|
-
|
|
2520
|
+
}), Ei = (e) => g.discriminatedUnion("type", [
|
|
2521
|
+
Li(e),
|
|
2522
2522
|
Ri(e),
|
|
2523
|
-
|
|
2523
|
+
$i(e)
|
|
2524
2524
|
]), Xt = {
|
|
2525
2525
|
autoSync: !0,
|
|
2526
2526
|
type: "INTERNAL",
|
|
@@ -2588,14 +2588,14 @@ const ho = s.object({
|
|
|
2588
2588
|
}, ki = () => {
|
|
2589
2589
|
const { formatMessage: e } = A(), [t, a] = N(
|
|
2590
2590
|
{}
|
|
2591
|
-
), [o, i] = N(), r = (p, u,
|
|
2592
|
-
if (
|
|
2593
|
-
let b = p,
|
|
2591
|
+
), [o, i] = N(), r = (p, u, C) => {
|
|
2592
|
+
if (C) {
|
|
2593
|
+
let b = p, v = u;
|
|
2594
2594
|
if (He(p)) {
|
|
2595
|
-
const { name:
|
|
2596
|
-
b =
|
|
2595
|
+
const { name: h, value: f } = p.target;
|
|
2596
|
+
b = h, v = Be(v) ? f : v;
|
|
2597
2597
|
}
|
|
2598
|
-
return ot(b) && d(b,
|
|
2598
|
+
return ot(b) && d(b, v), C(p, v);
|
|
2599
2599
|
}
|
|
2600
2600
|
}, d = (p, u) => {
|
|
2601
2601
|
a(
|
|
@@ -2660,7 +2660,7 @@ const ho = s.object({
|
|
|
2660
2660
|
return "";
|
|
2661
2661
|
const d = t?.pathDefaultFields[i] ?? [];
|
|
2662
2662
|
if (Y(e) && !Y(d)) {
|
|
2663
|
-
const c = r ?
|
|
2663
|
+
const c = r ? Ct(a ?? []) : a?.find(({ id: p }) => p === o);
|
|
2664
2664
|
return d.map((p) => c?.[p] ?? "").filter((p) => !!p.toString().trim())[0] ?? "";
|
|
2665
2665
|
}
|
|
2666
2666
|
return "";
|
|
@@ -2701,21 +2701,21 @@ const ho = s.object({
|
|
|
2701
2701
|
label: e(l(`popup.item.form.type.${p.toLowerCase()}.label`))
|
|
2702
2702
|
}));
|
|
2703
2703
|
return /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", m: 8, xs: 12, children: /* @__PURE__ */ n(
|
|
2704
|
-
|
|
2704
|
+
$,
|
|
2705
2705
|
{
|
|
2706
2706
|
name: "type",
|
|
2707
2707
|
label: e(l("popup.item.form.type.label", "Internal link")),
|
|
2708
2708
|
error: r("type"),
|
|
2709
2709
|
hint: e(l("popup.item.form.title.placeholder", "e.g. Blog")),
|
|
2710
2710
|
children: /* @__PURE__ */ n(
|
|
2711
|
-
|
|
2711
|
+
xe,
|
|
2712
2712
|
{
|
|
2713
2713
|
onChange: (p) => i("type", p, o),
|
|
2714
2714
|
value: a.type,
|
|
2715
2715
|
name: "type",
|
|
2716
2716
|
disabled: !d,
|
|
2717
2717
|
width: "100%",
|
|
2718
|
-
children: m.map(({ key: p, label: u, value:
|
|
2718
|
+
children: m.map(({ key: p, label: u, value: C }) => /* @__PURE__ */ n(Ae, { value: C, children: u }, p))
|
|
2719
2719
|
}
|
|
2720
2720
|
)
|
|
2721
2721
|
}
|
|
@@ -2723,7 +2723,7 @@ const ho = s.object({
|
|
|
2723
2723
|
}, Bi = ({ current: e }) => {
|
|
2724
2724
|
const { formatMessage: t } = A(), a = ne(), { values: o, onChange: i, handleChange: r, renderError: d, canUpdate: c } = he();
|
|
2725
2725
|
return /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", m: 4, xs: 12, children: /* @__PURE__ */ n(
|
|
2726
|
-
|
|
2726
|
+
$,
|
|
2727
2727
|
{
|
|
2728
2728
|
name: "menuAttached",
|
|
2729
2729
|
label: t(l("popup.item.form.menuAttached.label", "MenuAttached")),
|
|
@@ -2764,7 +2764,7 @@ const ho = s.object({
|
|
|
2764
2764
|
orderInitial: 2,
|
|
2765
2765
|
orderMedium: 1,
|
|
2766
2766
|
children: /* @__PURE__ */ n(
|
|
2767
|
-
|
|
2767
|
+
$,
|
|
2768
2768
|
{
|
|
2769
2769
|
name: "title",
|
|
2770
2770
|
label: e(l("popup.item.form.title.label", "Title")),
|
|
@@ -2803,7 +2803,7 @@ const ho = s.object({
|
|
|
2803
2803
|
orderInitial: 1,
|
|
2804
2804
|
orderMedium: 2,
|
|
2805
2805
|
children: /* @__PURE__ */ n(
|
|
2806
|
-
|
|
2806
|
+
$,
|
|
2807
2807
|
{
|
|
2808
2808
|
name: "autoSync",
|
|
2809
2809
|
label: e(l("popup.item.form.autoSync.label", "Read fields from related")),
|
|
@@ -2829,7 +2829,7 @@ const ho = s.object({
|
|
|
2829
2829
|
current: t,
|
|
2830
2830
|
isSingleSelected: a
|
|
2831
2831
|
}) => {
|
|
2832
|
-
const { formatMessage: o } = A(), i = ne(), { values: r, onChange: d, handleChange: c, renderError: m, canUpdate: p } = he(), u = r.type === "EXTERNAL" ? "externalPath" : "path",
|
|
2832
|
+
const { formatMessage: o } = A(), i = ne(), { values: r, onChange: d, handleChange: c, renderError: m, canUpdate: p } = he(), u = r.type === "EXTERNAL" ? "externalPath" : "path", C = r.type === "INTERNAL" ? r : {
|
|
2833
2833
|
related: void 0,
|
|
2834
2834
|
relatedType: void 0
|
|
2835
2835
|
}, b = Vi({
|
|
@@ -2839,14 +2839,12 @@ const ho = s.object({
|
|
|
2839
2839
|
currentType: r.type,
|
|
2840
2840
|
config: i.data,
|
|
2841
2841
|
contentTypeItems: e,
|
|
2842
|
-
currentRelated:
|
|
2843
|
-
currentRelatedType:
|
|
2842
|
+
currentRelated: C.related,
|
|
2843
|
+
currentRelatedType: C.relatedType,
|
|
2844
2844
|
isSingleSelected: a
|
|
2845
|
-
})
|
|
2846
|
-
({ documentId: h }) => h === v.related
|
|
2847
|
-
), I = y.find((h) => f?.[h]);
|
|
2845
|
+
});
|
|
2848
2846
|
return /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ n(
|
|
2849
|
-
|
|
2847
|
+
$,
|
|
2850
2848
|
{
|
|
2851
2849
|
name: u,
|
|
2852
2850
|
label: o(l(`popup.item.form.${u}.label`, "Path")),
|
|
@@ -2855,17 +2853,14 @@ const ho = s.object({
|
|
|
2855
2853
|
o(l(`popup.item.form.${u}.placeholder`, "e.g. Blog")),
|
|
2856
2854
|
b ? o(l("popup.item.form.type.external.description"), {
|
|
2857
2855
|
value: b
|
|
2858
|
-
}) : "",
|
|
2859
|
-
C ? o(l("popup.item.form.type.internal.source"), {
|
|
2860
|
-
value: I || "id"
|
|
2861
2856
|
}) : ""
|
|
2862
2857
|
].join(" "),
|
|
2863
2858
|
children: /* @__PURE__ */ n(
|
|
2864
2859
|
we,
|
|
2865
2860
|
{
|
|
2866
|
-
disabled:
|
|
2861
|
+
disabled: !p,
|
|
2867
2862
|
name: u,
|
|
2868
|
-
onChange: (
|
|
2863
|
+
onChange: (v, h) => c(v, h, d),
|
|
2869
2864
|
value: (r.type === "EXTERNAL" ? r.externalPath : r.path) || "",
|
|
2870
2865
|
width: "100%"
|
|
2871
2866
|
}
|
|
@@ -2893,7 +2888,7 @@ const ho = s.object({
|
|
|
2893
2888
|
value: r,
|
|
2894
2889
|
disabled: d
|
|
2895
2890
|
}) => {
|
|
2896
|
-
const { toggleNotification: c } = Oe(), { formatMessage: m } = A(), u = Qn("AdditionalFieldInput", (b) => b.fields).media,
|
|
2891
|
+
const { toggleNotification: c } = Oe(), { formatMessage: m } = A(), u = Qn("AdditionalFieldInput", (b) => b.fields).media, C = X(
|
|
2897
2892
|
() => ({
|
|
2898
2893
|
id: t.name,
|
|
2899
2894
|
name: e || t.name,
|
|
@@ -2905,14 +2900,14 @@ const ho = s.object({
|
|
|
2905
2900
|
switch (V(() => {
|
|
2906
2901
|
if (t.type === "media") {
|
|
2907
2902
|
const b = ea(r) ? void 0 : r;
|
|
2908
|
-
i(
|
|
2903
|
+
i(C.name, b, o);
|
|
2909
2904
|
}
|
|
2910
2905
|
}, [r]), t.type) {
|
|
2911
2906
|
case "boolean":
|
|
2912
2907
|
return /* @__PURE__ */ n(
|
|
2913
2908
|
me,
|
|
2914
2909
|
{
|
|
2915
|
-
...
|
|
2910
|
+
...C,
|
|
2916
2911
|
checked: !!r,
|
|
2917
2912
|
onChange: (b) => i(b, !r, o),
|
|
2918
2913
|
onLabel: "true",
|
|
@@ -2924,8 +2919,8 @@ const ho = s.object({
|
|
|
2924
2919
|
return /* @__PURE__ */ n(
|
|
2925
2920
|
sa,
|
|
2926
2921
|
{
|
|
2927
|
-
...
|
|
2928
|
-
onChange: (b,
|
|
2922
|
+
...C,
|
|
2923
|
+
onChange: (b, v) => i(b, v, o),
|
|
2929
2924
|
value: r || Ki
|
|
2930
2925
|
}
|
|
2931
2926
|
);
|
|
@@ -2933,26 +2928,26 @@ const ho = s.object({
|
|
|
2933
2928
|
return t.multi ? /* @__PURE__ */ n(
|
|
2934
2929
|
De,
|
|
2935
2930
|
{
|
|
2936
|
-
...
|
|
2937
|
-
onChange: (b) => i(
|
|
2931
|
+
...C,
|
|
2932
|
+
onChange: (b) => i(C.name, b, o),
|
|
2938
2933
|
value: Be(r) ? t.multi ? [] : null : r,
|
|
2939
2934
|
multi: t.multi,
|
|
2940
2935
|
withTags: t.multi,
|
|
2941
|
-
children: t.options.map((b,
|
|
2936
|
+
children: t.options.map((b, v) => /* @__PURE__ */ n(Ve, { value: b, children: b }, `${t.name}-option-${v}`))
|
|
2942
2937
|
}
|
|
2943
2938
|
) : /* @__PURE__ */ n(
|
|
2944
|
-
|
|
2939
|
+
xe,
|
|
2945
2940
|
{
|
|
2946
|
-
...
|
|
2947
|
-
onChange: (b) => i(
|
|
2941
|
+
...C,
|
|
2942
|
+
onChange: (b) => i(C.name, b, o),
|
|
2948
2943
|
value: Be(r) ? t.multi ? [] : null : r,
|
|
2949
2944
|
multi: t.multi,
|
|
2950
2945
|
withTags: t.multi,
|
|
2951
|
-
children: t.options.map((b,
|
|
2946
|
+
children: t.options.map((b, v) => /* @__PURE__ */ n(Ae, { value: b, children: b }, `${t.name}-option-${v}`))
|
|
2952
2947
|
}
|
|
2953
2948
|
);
|
|
2954
2949
|
case "media":
|
|
2955
|
-
return /* @__PURE__ */ n(u, { ...
|
|
2950
|
+
return /* @__PURE__ */ n(u, { ...C, ...Wi, value: r });
|
|
2956
2951
|
default:
|
|
2957
2952
|
throw c({
|
|
2958
2953
|
type: "warning",
|
|
@@ -2962,7 +2957,7 @@ const ho = s.object({
|
|
|
2962
2957
|
}, Xi = ({ additionalField: e }) => {
|
|
2963
2958
|
const { canUpdate: t, isLoading: a, onChange: o, handleChange: i, renderError: r, values: d } = he();
|
|
2964
2959
|
return /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", s: 6, xs: 12, children: /* @__PURE__ */ n(
|
|
2965
|
-
|
|
2960
|
+
$,
|
|
2966
2961
|
{
|
|
2967
2962
|
name: `additionalFields.${e.name}`,
|
|
2968
2963
|
label: e.label,
|
|
@@ -2992,7 +2987,7 @@ const ho = s.object({
|
|
|
2992
2987
|
[a]
|
|
2993
2988
|
), { isLoading: i, renderError: r, onChange: d, handleChange: c, values: m } = he();
|
|
2994
2989
|
return /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ n(
|
|
2995
|
-
|
|
2990
|
+
$,
|
|
2996
2991
|
{
|
|
2997
2992
|
name: "audience",
|
|
2998
2993
|
label: e(l("popup.item.form.audience.label")),
|
|
@@ -3032,16 +3027,16 @@ const ho = s.object({
|
|
|
3032
3027
|
setIsLoading: o,
|
|
3033
3028
|
setFormValuesItems: i
|
|
3034
3029
|
}) => {
|
|
3035
|
-
const { formatMessage: r } = A(), [d, c] = N(), m = Ao(), p =
|
|
3036
|
-
() => e.map((
|
|
3037
|
-
key: `${
|
|
3038
|
-
value:
|
|
3039
|
-
label:
|
|
3030
|
+
const { formatMessage: r } = A(), [d, c] = N(), m = Ao(), p = Ft(), { canUpdate: u, isLoading: C } = he(), b = X(
|
|
3031
|
+
() => e.map((h, f) => ({
|
|
3032
|
+
key: `${h}-${f}`,
|
|
3033
|
+
value: h,
|
|
3034
|
+
label: h
|
|
3040
3035
|
})),
|
|
3041
3036
|
[e]
|
|
3042
|
-
),
|
|
3043
|
-
async (
|
|
3044
|
-
|
|
3037
|
+
), v = E(
|
|
3038
|
+
async (h) => {
|
|
3039
|
+
h.preventDefault(), h.stopPropagation();
|
|
3045
3040
|
const f = p.data?.find(({ locale: I }) => I === d);
|
|
3046
3041
|
f && (o(!0), m.mutate(
|
|
3047
3042
|
{
|
|
@@ -3052,13 +3047,13 @@ const ho = s.object({
|
|
|
3052
3047
|
{
|
|
3053
3048
|
onSuccess(I) {
|
|
3054
3049
|
m.reset();
|
|
3055
|
-
const { type:
|
|
3050
|
+
const { type: y, externalPath: T, path: L, related: z, title: k, uiRouterKey: x } = I;
|
|
3056
3051
|
i({
|
|
3057
|
-
type:
|
|
3052
|
+
type: y,
|
|
3058
3053
|
externalPath: T,
|
|
3059
|
-
path:
|
|
3054
|
+
path: L,
|
|
3060
3055
|
title: k,
|
|
3061
|
-
uiRouterKey:
|
|
3056
|
+
uiRouterKey: x,
|
|
3062
3057
|
related: z
|
|
3063
3058
|
});
|
|
3064
3059
|
},
|
|
@@ -3074,23 +3069,23 @@ const ho = s.object({
|
|
|
3074
3069
|
/* @__PURE__ */ n(tt, { marginTop: 5, marginBottom: 5 }),
|
|
3075
3070
|
/* @__PURE__ */ w(S.Root, { gap: 5, children: [
|
|
3076
3071
|
/* @__PURE__ */ n(S.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ n(
|
|
3077
|
-
|
|
3072
|
+
$,
|
|
3078
3073
|
{
|
|
3079
3074
|
name: "i18n.locale",
|
|
3080
3075
|
label: r(
|
|
3081
3076
|
l("popup.item.form.i18n.locale.label", "Copy details from")
|
|
3082
3077
|
),
|
|
3083
3078
|
children: /* @__PURE__ */ n(
|
|
3084
|
-
|
|
3079
|
+
xe,
|
|
3085
3080
|
{
|
|
3086
3081
|
name: "i18n.locale",
|
|
3087
3082
|
onChange: c,
|
|
3088
3083
|
value: d,
|
|
3089
|
-
disabled:
|
|
3084
|
+
disabled: C || !u,
|
|
3090
3085
|
placeholder: r(
|
|
3091
3086
|
l("popup.item.form.i18n.locale.placeholder", "locale")
|
|
3092
3087
|
),
|
|
3093
|
-
children: b.map(({ key:
|
|
3088
|
+
children: b.map(({ key: h, label: f, value: I }) => /* @__PURE__ */ n(Ae, { value: I, children: f }, h))
|
|
3094
3089
|
}
|
|
3095
3090
|
)
|
|
3096
3091
|
}
|
|
@@ -3099,14 +3094,14 @@ const ho = s.object({
|
|
|
3099
3094
|
K,
|
|
3100
3095
|
{
|
|
3101
3096
|
variant: "tertiary",
|
|
3102
|
-
onClick:
|
|
3103
|
-
disabled:
|
|
3097
|
+
onClick: v,
|
|
3098
|
+
disabled: C || !d,
|
|
3104
3099
|
children: r(l("popup.item.form.i18n.locale.button"))
|
|
3105
3100
|
}
|
|
3106
3101
|
) }) })
|
|
3107
3102
|
] })
|
|
3108
3103
|
] }, "title") });
|
|
3109
|
-
}, Gt = (e, t) => t ? e.find((a) => a.value === t)?.label ?? "" : "",
|
|
3104
|
+
}, Gt = (e, t) => t ? e.find((a) => a.value === t)?.label ?? "" : "", Fn = ({
|
|
3110
3105
|
name: e,
|
|
3111
3106
|
onClear: t,
|
|
3112
3107
|
onChange: a,
|
|
@@ -3145,42 +3140,42 @@ const ho = s.object({
|
|
|
3145
3140
|
canUpdate: m,
|
|
3146
3141
|
isLoading: p,
|
|
3147
3142
|
renderError: u,
|
|
3148
|
-
setFormValueItem:
|
|
3143
|
+
setFormValueItem: C,
|
|
3149
3144
|
values: b
|
|
3150
|
-
} = he(),
|
|
3145
|
+
} = he(), v = X(
|
|
3151
3146
|
() => Xe(
|
|
3152
|
-
c.data?.contentTypes.map((
|
|
3153
|
-
key:
|
|
3154
|
-
value:
|
|
3155
|
-
label:
|
|
3147
|
+
c.data?.contentTypes.map((h) => ({
|
|
3148
|
+
key: h.uid,
|
|
3149
|
+
value: h.uid,
|
|
3150
|
+
label: h.label
|
|
3156
3151
|
})),
|
|
3157
|
-
(
|
|
3152
|
+
(h) => h.label
|
|
3158
3153
|
),
|
|
3159
3154
|
[c.data, a]
|
|
3160
3155
|
);
|
|
3161
3156
|
return V(() => {
|
|
3162
3157
|
if (!a)
|
|
3163
3158
|
return;
|
|
3164
|
-
const
|
|
3159
|
+
const h = c.data?.contentTypes.find(
|
|
3165
3160
|
(f) => f.uid === a
|
|
3166
3161
|
);
|
|
3167
|
-
if (
|
|
3162
|
+
if (h && (r(h.isSingle), h.isSingle && e?.length)) {
|
|
3168
3163
|
const f = e[0];
|
|
3169
|
-
f &&
|
|
3164
|
+
f && C("related", f.documentId);
|
|
3170
3165
|
}
|
|
3171
3166
|
}, [a, c.data, e]), V(() => {
|
|
3172
|
-
a === "" &&
|
|
3167
|
+
a === "" && C("relatedType", c.data?.defaultContentType);
|
|
3173
3168
|
}, [c.data?.defaultContentType, b.type, a]), /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", m: a && !o ? 6 : 12, xs: 12, children: /* @__PURE__ */ n(
|
|
3174
|
-
|
|
3169
|
+
$,
|
|
3175
3170
|
{
|
|
3176
3171
|
name: "relatedType",
|
|
3177
3172
|
label: d(l("popup.item.form.relatedType.label", "Related Type")),
|
|
3178
3173
|
error: u("relatedType"),
|
|
3179
|
-
hint: !p && Y(
|
|
3174
|
+
hint: !p && Y(v) ? d(
|
|
3180
3175
|
l("popup.item.form.relatedType.empty", "There are no more content types")
|
|
3181
3176
|
) : void 0,
|
|
3182
3177
|
children: /* @__PURE__ */ n(
|
|
3183
|
-
|
|
3178
|
+
Fn,
|
|
3184
3179
|
{
|
|
3185
3180
|
name: "relatedType",
|
|
3186
3181
|
onClear: () => i({
|
|
@@ -3188,13 +3183,13 @@ const ho = s.object({
|
|
|
3188
3183
|
relatedType: void 0,
|
|
3189
3184
|
title: b.autoSync ? "" : b.title
|
|
3190
3185
|
}),
|
|
3191
|
-
onChange: (
|
|
3186
|
+
onChange: (h) => i({
|
|
3192
3187
|
related: void 0,
|
|
3193
|
-
relatedType:
|
|
3188
|
+
relatedType: h,
|
|
3194
3189
|
title: b.autoSync ? "" : b.title
|
|
3195
3190
|
}),
|
|
3196
3191
|
value: a,
|
|
3197
|
-
options:
|
|
3192
|
+
options: v,
|
|
3198
3193
|
disabled: !c.data?.contentTypes.length || !m
|
|
3199
3194
|
}
|
|
3200
3195
|
)
|
|
@@ -3208,7 +3203,7 @@ const ho = s.object({
|
|
|
3208
3203
|
const i = t?.find((p) => p.documentId === e.related);
|
|
3209
3204
|
if (!i)
|
|
3210
3205
|
return;
|
|
3211
|
-
const { contentTypesNameFields: r, pathDefaultFields: d } = o.data, c = (d[e.relatedType]?.reduce((p, u) => p || i?.[u], void 0) || i.id).toString(), m = (r[e.relatedType] ?? []).concat(r.default ?? []).reduce((p, u) => p ? p.toString() : i?.[u], void 0);
|
|
3206
|
+
const { contentTypesNameFields: r, pathDefaultFields: d } = o.data, c = e.path ? e.path : (d[e.relatedType]?.reduce((p, u) => p || i?.[u], void 0) || i.id).toString(), m = (r[e.relatedType] ?? []).concat(r.default ?? []).reduce((p, u) => p ? p.toString() : i?.[u], void 0);
|
|
3212
3207
|
c && e.path, m && e.title, a({
|
|
3213
3208
|
path: c,
|
|
3214
3209
|
title: m
|
|
@@ -3221,46 +3216,46 @@ const ho = s.object({
|
|
|
3221
3216
|
values: o,
|
|
3222
3217
|
setFormValuesItems: i
|
|
3223
3218
|
}) => {
|
|
3224
|
-
const { formatMessage: r } = A(), d = ne(), { canUpdate: c, isLoading: m, handleChange: p, onChange: u, renderError:
|
|
3225
|
-
t?.map((
|
|
3219
|
+
const { formatMessage: r } = A(), d = ne(), { canUpdate: c, isLoading: m, handleChange: p, onChange: u, renderError: C } = he(), b = Xe(
|
|
3220
|
+
t?.map((h) => {
|
|
3226
3221
|
const I = e(
|
|
3227
3222
|
st(
|
|
3228
3223
|
{
|
|
3229
|
-
...
|
|
3224
|
+
...h,
|
|
3230
3225
|
__collectionUid: o.relatedType
|
|
3231
3226
|
},
|
|
3232
3227
|
d.data
|
|
3233
3228
|
),
|
|
3234
|
-
|
|
3229
|
+
h,
|
|
3235
3230
|
!1
|
|
3236
|
-
) + (
|
|
3231
|
+
) + (h?.id ? ` (id: ${h.id})` : "");
|
|
3237
3232
|
return {
|
|
3238
|
-
key:
|
|
3239
|
-
value:
|
|
3233
|
+
key: h?.documentId?.toString(),
|
|
3234
|
+
value: h?.documentId?.toString(),
|
|
3240
3235
|
label: I
|
|
3241
3236
|
};
|
|
3242
3237
|
}) ?? [],
|
|
3243
|
-
(
|
|
3244
|
-
),
|
|
3238
|
+
(h) => h.label
|
|
3239
|
+
), v = Y(b);
|
|
3245
3240
|
return er(o, t, i), !o.relatedType || a ? null : /* @__PURE__ */ n(S.Item, { alignItems: "flex-start", m: 6, xs: 12, children: /* @__PURE__ */ n(
|
|
3246
|
-
|
|
3241
|
+
$,
|
|
3247
3242
|
{
|
|
3248
3243
|
name: "related",
|
|
3249
3244
|
label: r(l("popup.item.form.related.label", "Related")),
|
|
3250
|
-
error:
|
|
3251
|
-
hint: !m &&
|
|
3245
|
+
error: C("related"),
|
|
3246
|
+
hint: !m && v ? r(
|
|
3252
3247
|
l("popup.item.form.related.empty", "There are no more entities"),
|
|
3253
3248
|
{ contentTypeName: o.relatedType }
|
|
3254
3249
|
) : void 0,
|
|
3255
3250
|
children: /* @__PURE__ */ n(
|
|
3256
|
-
|
|
3251
|
+
Fn,
|
|
3257
3252
|
{
|
|
3258
3253
|
name: "related",
|
|
3259
3254
|
onClear: () => p("related", void 0, u),
|
|
3260
|
-
onChange: (
|
|
3255
|
+
onChange: (h) => p("related", h, u),
|
|
3261
3256
|
value: o.related,
|
|
3262
3257
|
options: b,
|
|
3263
|
-
disabled: m ||
|
|
3258
|
+
disabled: m || v || !c
|
|
3264
3259
|
}
|
|
3265
3260
|
)
|
|
3266
3261
|
}
|
|
@@ -3276,15 +3271,15 @@ const ho = s.object({
|
|
|
3276
3271
|
permissions: c = {},
|
|
3277
3272
|
currentNavigation: m
|
|
3278
3273
|
}) => {
|
|
3279
|
-
const { formatMessage: p } = A(), [u,
|
|
3274
|
+
const { formatMessage: p } = A(), [u, C] = N(t), { canUpdate: b } = c, [v, h] = N(!1), f = ne(), I = f.data?.contentTypes ?? [], { toggleNotification: y } = Oe(), {
|
|
3280
3275
|
formValue: T,
|
|
3281
|
-
renderError:
|
|
3276
|
+
renderError: L,
|
|
3282
3277
|
setFormError: z,
|
|
3283
3278
|
handleChange: k,
|
|
3284
|
-
setFormValue:
|
|
3279
|
+
setFormValue: x,
|
|
3285
3280
|
setFormValueItem: M,
|
|
3286
3281
|
setFormValuesItems: _
|
|
3287
|
-
} = ki(), { encodePayload: re, decodePayload: Q } = Mi(), le = T.type === "INTERNAL", fe = le && !T.related && !
|
|
3282
|
+
} = ki(), { encodePayload: re, decodePayload: Q } = Mi(), le = T.type === "INTERNAL", fe = le && !T.related && !v || u, ee = bn({
|
|
3288
3283
|
uid: le ? T.relatedType : "",
|
|
3289
3284
|
locale: d
|
|
3290
3285
|
}), _e = async (G, R) => {
|
|
@@ -3292,15 +3287,15 @@ const ho = s.object({
|
|
|
3292
3287
|
const Z = re(R), {
|
|
3293
3288
|
success: se,
|
|
3294
3289
|
data: U,
|
|
3295
|
-
error:
|
|
3296
|
-
} =
|
|
3297
|
-
isSingleSelected:
|
|
3290
|
+
error: Le
|
|
3291
|
+
} = Ei({
|
|
3292
|
+
isSingleSelected: v,
|
|
3298
3293
|
additionalFields: f.data?.additionalFields ?? nr
|
|
3299
3294
|
}).safeParse(Z);
|
|
3300
3295
|
if (se) {
|
|
3301
|
-
const Ie = U.title.trim() ? U.title.trim() : U.type === "INTERNAL" ? Re(U?.related?.toString(), U.relatedType,
|
|
3302
|
-
|
|
3303
|
-
const
|
|
3296
|
+
const Ie = U.title.trim() ? U.title.trim() : U.type === "INTERNAL" ? Re(U?.related?.toString(), U.relatedType, v) : "";
|
|
3297
|
+
C(!0);
|
|
3298
|
+
const Ce = await qi(
|
|
3304
3299
|
U.type === "INTERNAL" ? {
|
|
3305
3300
|
slugify: pe.mutateAsync,
|
|
3306
3301
|
title: Ie,
|
|
@@ -3308,8 +3303,8 @@ const ho = s.object({
|
|
|
3308
3303
|
relatedType: U.relatedType
|
|
3309
3304
|
} : { slugify: pe.mutateAsync, title: Ie }
|
|
3310
3305
|
);
|
|
3311
|
-
if (pe.reset(),
|
|
3312
|
-
|
|
3306
|
+
if (pe.reset(), C(!1), !Ce) {
|
|
3307
|
+
y({
|
|
3313
3308
|
type: "warning",
|
|
3314
3309
|
message: p(l("popup.item.form.uiRouter.unableToRender"))
|
|
3315
3310
|
});
|
|
@@ -3319,20 +3314,20 @@ const ho = s.object({
|
|
|
3319
3314
|
U.type === "INTERNAL" ? {
|
|
3320
3315
|
...U,
|
|
3321
3316
|
title: Ie,
|
|
3322
|
-
uiRouterKey:
|
|
3317
|
+
uiRouterKey: Ce
|
|
3323
3318
|
} : {
|
|
3324
3319
|
...U,
|
|
3325
3320
|
title: Ie,
|
|
3326
|
-
uiRouterKey:
|
|
3321
|
+
uiRouterKey: Ce
|
|
3327
3322
|
}
|
|
3328
3323
|
);
|
|
3329
|
-
} else
|
|
3330
|
-
|
|
3324
|
+
} else Le && z(
|
|
3325
|
+
Le.issues.reduce((Ie, Ce) => ({
|
|
3331
3326
|
...Ie,
|
|
3332
|
-
[
|
|
3327
|
+
[Ce.path.join(".")]: Ce.message
|
|
3333
3328
|
}), {})
|
|
3334
3329
|
);
|
|
3335
|
-
}, pe = Pi(), Re =
|
|
3330
|
+
}, pe = Pi(), Re = E(
|
|
3336
3331
|
(G, R, Z) => {
|
|
3337
3332
|
let se;
|
|
3338
3333
|
if (Z) {
|
|
@@ -3342,7 +3337,7 @@ const ho = s.object({
|
|
|
3342
3337
|
return I.find((U) => U.uid === R)?.contentTypeName;
|
|
3343
3338
|
} else
|
|
3344
3339
|
se = {
|
|
3345
|
-
...ee.data?.find(({ documentId:
|
|
3340
|
+
...ee.data?.find(({ documentId: Le }) => Le === G) || {
|
|
3346
3341
|
documentId: null
|
|
3347
3342
|
},
|
|
3348
3343
|
__collectionUid: R
|
|
@@ -3352,7 +3347,7 @@ const ho = s.object({
|
|
|
3352
3347
|
[ee.data, f.data, I]
|
|
3353
3348
|
);
|
|
3354
3349
|
return V(() => {
|
|
3355
|
-
|
|
3350
|
+
x(
|
|
3356
3351
|
Q({
|
|
3357
3352
|
...Xt,
|
|
3358
3353
|
...a
|
|
@@ -3366,7 +3361,7 @@ const ho = s.object({
|
|
|
3366
3361
|
values: G,
|
|
3367
3362
|
onChange: R,
|
|
3368
3363
|
handleChange: k,
|
|
3369
|
-
renderError:
|
|
3364
|
+
renderError: L,
|
|
3370
3365
|
setFormValueItem: M,
|
|
3371
3366
|
canUpdate: b,
|
|
3372
3367
|
isLoading: u
|
|
@@ -3385,7 +3380,7 @@ const ho = s.object({
|
|
|
3385
3380
|
{
|
|
3386
3381
|
contentTypeItems: ee.data,
|
|
3387
3382
|
current: a,
|
|
3388
|
-
isSingleSelected:
|
|
3383
|
+
isSingleSelected: v
|
|
3389
3384
|
}
|
|
3390
3385
|
) }),
|
|
3391
3386
|
G.type === "INTERNAL" && /* @__PURE__ */ w(S.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: [
|
|
@@ -3395,9 +3390,9 @@ const ho = s.object({
|
|
|
3395
3390
|
contentTypeItems: ee.data,
|
|
3396
3391
|
current: a,
|
|
3397
3392
|
currentRelatedType: G.relatedType,
|
|
3398
|
-
isSingleSelected:
|
|
3393
|
+
isSingleSelected: v,
|
|
3399
3394
|
setFormValuesItems: _,
|
|
3400
|
-
setIsSingleSelected:
|
|
3395
|
+
setIsSingleSelected: h
|
|
3401
3396
|
}
|
|
3402
3397
|
),
|
|
3403
3398
|
/* @__PURE__ */ n(
|
|
@@ -3406,7 +3401,7 @@ const ho = s.object({
|
|
|
3406
3401
|
appendLabelPublicationStatus: r,
|
|
3407
3402
|
contentTypeItems: ee.data,
|
|
3408
3403
|
values: G,
|
|
3409
|
-
isSingleSelected:
|
|
3404
|
+
isSingleSelected: v,
|
|
3410
3405
|
setFormValuesItems: _
|
|
3411
3406
|
}
|
|
3412
3407
|
)
|
|
@@ -3419,7 +3414,7 @@ const ho = s.object({
|
|
|
3419
3414
|
availableLocale: e,
|
|
3420
3415
|
current: a,
|
|
3421
3416
|
currentNavigation: m,
|
|
3422
|
-
setIsLoading:
|
|
3417
|
+
setIsLoading: C,
|
|
3423
3418
|
setFormValuesItems: _
|
|
3424
3419
|
}
|
|
3425
3420
|
),
|
|
@@ -3428,7 +3423,7 @@ const ho = s.object({
|
|
|
3428
3423
|
}
|
|
3429
3424
|
) }) }),
|
|
3430
3425
|
/* @__PURE__ */ n(
|
|
3431
|
-
|
|
3426
|
+
Fi,
|
|
3432
3427
|
{
|
|
3433
3428
|
handleSubmit: (G) => _e(G, T),
|
|
3434
3429
|
handleCancel: i,
|
|
@@ -3444,7 +3439,7 @@ const ho = s.object({
|
|
|
3444
3439
|
const { formatMessage: a } = A();
|
|
3445
3440
|
let o = "view";
|
|
3446
3441
|
return t && (o = e ? "new" : "edit"), /* @__PURE__ */ n(H.Header, { children: /* @__PURE__ */ n(
|
|
3447
|
-
|
|
3442
|
+
F,
|
|
3448
3443
|
{
|
|
3449
3444
|
variant: "omega",
|
|
3450
3445
|
fontWeight: "bold",
|
|
@@ -3465,19 +3460,19 @@ const ho = s.object({
|
|
|
3465
3460
|
permissions: c,
|
|
3466
3461
|
currentNavigation: m
|
|
3467
3462
|
}) => {
|
|
3468
|
-
const { formatMessage: p } = A(), u = (
|
|
3469
|
-
i(
|
|
3470
|
-
},
|
|
3471
|
-
relatedRef:
|
|
3472
|
-
type:
|
|
3463
|
+
const { formatMessage: p } = A(), u = (v) => {
|
|
3464
|
+
i(v);
|
|
3465
|
+
}, C = (v, h, f) => `${Vo({
|
|
3466
|
+
relatedRef: h,
|
|
3467
|
+
type: h.isSingle ? "INTERNAL" : h.type,
|
|
3473
3468
|
isCollection: f
|
|
3474
|
-
}) ? "" : `[${p(l("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${
|
|
3469
|
+
}) ? "" : `[${p(l("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${v}`, b = !!o.viewId;
|
|
3475
3470
|
return /* @__PURE__ */ n(
|
|
3476
3471
|
H.Root,
|
|
3477
3472
|
{
|
|
3478
3473
|
labelledBy: "condition-modal-breadcrumbs",
|
|
3479
|
-
onOpenChange: (
|
|
3480
|
-
|
|
3474
|
+
onOpenChange: (v) => {
|
|
3475
|
+
v || r({
|
|
3481
3476
|
preventDefault() {
|
|
3482
3477
|
},
|
|
3483
3478
|
stopPropagation() {
|
|
@@ -3496,7 +3491,7 @@ const ho = s.object({
|
|
|
3496
3491
|
isLoading: a,
|
|
3497
3492
|
onSubmit: u,
|
|
3498
3493
|
onCancel: r,
|
|
3499
|
-
appendLabelPublicationStatus:
|
|
3494
|
+
appendLabelPublicationStatus: C,
|
|
3500
3495
|
locale: d,
|
|
3501
3496
|
permissions: c,
|
|
3502
3497
|
currentNavigation: m
|
|
@@ -3506,7 +3501,7 @@ const ho = s.object({
|
|
|
3506
3501
|
}
|
|
3507
3502
|
);
|
|
3508
3503
|
}, ft = 0, lr = ({ value: e, setValue: t, initialIndex: a = ft }) => {
|
|
3509
|
-
const [o, i] = N(e), [r, d] = N(e), [c, m] = N(a), { isSmallMobile: p } = Ze(), [u,
|
|
3504
|
+
const [o, i] = N(e), [r, d] = N(e), [c, m] = N(a), { isSmallMobile: p } = Ze(), [u, C] = N(!!e || p), b = We(null), { formatMessage: v } = A();
|
|
3510
3505
|
V(() => {
|
|
3511
3506
|
u && setTimeout(() => {
|
|
3512
3507
|
b.current?.querySelector("input")?.focus();
|
|
@@ -3522,16 +3517,16 @@ const ho = s.object({
|
|
|
3522
3517
|
index: ft
|
|
3523
3518
|
}));
|
|
3524
3519
|
}, [o, r]);
|
|
3525
|
-
const
|
|
3526
|
-
|
|
3527
|
-
}, []), f =
|
|
3528
|
-
(
|
|
3529
|
-
i(
|
|
3520
|
+
const h = E((y) => {
|
|
3521
|
+
y.code.toLowerCase() === "enter" && m((T) => T + 1);
|
|
3522
|
+
}, []), f = E(
|
|
3523
|
+
(y) => {
|
|
3524
|
+
i(y.target.value);
|
|
3530
3525
|
},
|
|
3531
3526
|
[i]
|
|
3532
|
-
), I =
|
|
3533
|
-
i(""),
|
|
3534
|
-
}, [i,
|
|
3527
|
+
), I = E(() => {
|
|
3528
|
+
i(""), C(!1);
|
|
3529
|
+
}, [i, C]);
|
|
3535
3530
|
return u ? /* @__PURE__ */ w("div", { ref: b, style: { width: "100%" }, children: [
|
|
3536
3531
|
/* @__PURE__ */ n(
|
|
3537
3532
|
ca,
|
|
@@ -3542,46 +3537,46 @@ const ho = s.object({
|
|
|
3542
3537
|
size: "S",
|
|
3543
3538
|
onChange: f,
|
|
3544
3539
|
clearLabel: "Clearing the search",
|
|
3545
|
-
placeholder:
|
|
3540
|
+
placeholder: v(
|
|
3546
3541
|
l("pages.main.search.placeholder", "Type to start searching...")
|
|
3547
3542
|
),
|
|
3548
|
-
onKeyDown:
|
|
3543
|
+
onKeyDown: h,
|
|
3549
3544
|
children: "Search for navigation items"
|
|
3550
3545
|
}
|
|
3551
3546
|
),
|
|
3552
3547
|
/* @__PURE__ */ n(
|
|
3553
|
-
|
|
3548
|
+
F,
|
|
3554
3549
|
{
|
|
3555
3550
|
variant: "pi",
|
|
3556
3551
|
fontColor: "neutral150",
|
|
3557
3552
|
style: { margin: "3px 0 0" },
|
|
3558
3553
|
display: { initial: "none", medium: "inline-block" },
|
|
3559
|
-
children:
|
|
3554
|
+
children: v(
|
|
3560
3555
|
l("pages.main.search.subLabel", "press ENTER to highlight next item")
|
|
3561
3556
|
)
|
|
3562
3557
|
}
|
|
3563
3558
|
)
|
|
3564
|
-
] }) : /* @__PURE__ */ n(ye, { children: /* @__PURE__ */ n(
|
|
3559
|
+
] }) : /* @__PURE__ */ n(ye, { children: /* @__PURE__ */ n(Fa, {}), onClick: () => C(!u) });
|
|
3565
3560
|
}, sr = ({
|
|
3566
3561
|
currentNavigation: e,
|
|
3567
3562
|
setCurrentNavigation: t,
|
|
3568
3563
|
canUpdate: a,
|
|
3569
3564
|
addNewNavigationItem: o
|
|
3570
3565
|
}) => {
|
|
3571
|
-
const { formatMessage: i } = A(), r =
|
|
3566
|
+
const { formatMessage: i } = A(), r = E(() => {
|
|
3572
3567
|
e && t({
|
|
3573
3568
|
...e,
|
|
3574
3569
|
items: e.items.map((p) => ke(p, !1))
|
|
3575
3570
|
});
|
|
3576
|
-
}, [t, e, ke]), d =
|
|
3571
|
+
}, [t, e, ke]), d = E(() => {
|
|
3577
3572
|
e && t({
|
|
3578
3573
|
...e,
|
|
3579
3574
|
items: e.items.map((p) => ke(p, !0))
|
|
3580
3575
|
});
|
|
3581
|
-
}, [t, e, ke]), c =
|
|
3576
|
+
}, [t, e, ke]), c = E(
|
|
3582
3577
|
(p) => {
|
|
3583
3578
|
const u = (e?.items ?? []).reduce(
|
|
3584
|
-
(
|
|
3579
|
+
(C, { order: b }) => Math.max(C, b),
|
|
3585
3580
|
0
|
|
3586
3581
|
);
|
|
3587
3582
|
o(
|
|
@@ -3618,7 +3613,7 @@ const ho = s.object({
|
|
|
3618
3613
|
tradId: "header.action.newItem",
|
|
3619
3614
|
startIcon: /* @__PURE__ */ n(wt, {}),
|
|
3620
3615
|
margin: "8px"
|
|
3621
|
-
}), m.map(({ tradId: p, margin: u, ...
|
|
3616
|
+
}), m.map(({ tradId: p, margin: u, ...C }, b) => /* @__PURE__ */ n(D, { marginLeft: { initial: 0, small: u }, children: /* @__PURE__ */ w(K, { ...C, children: [
|
|
3622
3617
|
" ",
|
|
3623
3618
|
i(l(p)),
|
|
3624
3619
|
" "
|
|
@@ -3631,16 +3626,16 @@ const ho = s.object({
|
|
|
3631
3626
|
currentNavigation: i,
|
|
3632
3627
|
setCurrentNavigation: r
|
|
3633
3628
|
}) => {
|
|
3634
|
-
const d =
|
|
3629
|
+
const d = Fo(), { formatMessage: c } = A(), m = Co(), p = Io(), {
|
|
3635
3630
|
i18nCopyItemsModal: u,
|
|
3636
|
-
i18nCopySourceLocale:
|
|
3631
|
+
i18nCopySourceLocale: C,
|
|
3637
3632
|
setI18nCopyModalOpened: b,
|
|
3638
|
-
setI18nCopySourceLocale:
|
|
3639
|
-
} =
|
|
3640
|
-
|
|
3633
|
+
setI18nCopySourceLocale: v
|
|
3634
|
+
} = $o(
|
|
3635
|
+
E(
|
|
3641
3636
|
(f) => {
|
|
3642
3637
|
const I = o.find(
|
|
3643
|
-
({ locale:
|
|
3638
|
+
({ locale: y, documentId: T }) => y === f && T === i?.documentId
|
|
3644
3639
|
);
|
|
3645
3640
|
I && I.documentId && i?.documentId && d.mutate(
|
|
3646
3641
|
{
|
|
@@ -3649,10 +3644,10 @@ const ho = s.object({
|
|
|
3649
3644
|
documentId: I.documentId
|
|
3650
3645
|
},
|
|
3651
3646
|
{
|
|
3652
|
-
onSuccess(
|
|
3647
|
+
onSuccess(y) {
|
|
3653
3648
|
d.reset(), r({
|
|
3654
|
-
...
|
|
3655
|
-
items:
|
|
3649
|
+
...y.data,
|
|
3650
|
+
items: y.data.items.map(rt)
|
|
3656
3651
|
}), m(), p();
|
|
3657
3652
|
}
|
|
3658
3653
|
}
|
|
@@ -3660,11 +3655,11 @@ const ho = s.object({
|
|
|
3660
3655
|
},
|
|
3661
3656
|
[i]
|
|
3662
3657
|
)
|
|
3663
|
-
),
|
|
3664
|
-
|
|
3665
|
-
}, [b,
|
|
3658
|
+
), h = E(() => {
|
|
3659
|
+
C && b(!0);
|
|
3660
|
+
}, [b, C]);
|
|
3666
3661
|
return /* @__PURE__ */ w(P, { direction: "column", minHeight: "400px", justifyContent: "center", children: [
|
|
3667
|
-
/* @__PURE__ */ n(D, { padding: 4, children: /* @__PURE__ */ n(
|
|
3662
|
+
/* @__PURE__ */ n(D, { padding: 4, children: /* @__PURE__ */ n(F, { variant: "beta", textColor: "neutral600", children: c(l("empty.description")) }) }),
|
|
3668
3663
|
e && /* @__PURE__ */ n(
|
|
3669
3664
|
K,
|
|
3670
3665
|
{
|
|
@@ -3676,13 +3671,13 @@ const ho = s.object({
|
|
|
3676
3671
|
}
|
|
3677
3672
|
),
|
|
3678
3673
|
e && !!a.length && /* @__PURE__ */ w(P, { direction: "column", justifyContent: "center", children: [
|
|
3679
|
-
/* @__PURE__ */ n(D, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ n(
|
|
3674
|
+
/* @__PURE__ */ n(D, { paddingTop: 3, paddingBottom: 3, children: /* @__PURE__ */ n(F, { variant: "beta", textColor: "neutral600", children: c(l("view.i18n.fill.cta.header")) }) }),
|
|
3680
3675
|
/* @__PURE__ */ w(P, { direction: "row", justifyContent: "center", alignItems: "center", children: [
|
|
3681
3676
|
/* @__PURE__ */ n(D, { paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ n(
|
|
3682
|
-
|
|
3677
|
+
xe,
|
|
3683
3678
|
{
|
|
3684
|
-
onChange:
|
|
3685
|
-
value:
|
|
3679
|
+
onChange: v,
|
|
3680
|
+
value: C,
|
|
3686
3681
|
size: "S",
|
|
3687
3682
|
children: a.map((f) => /* @__PURE__ */ n(Ae, { value: f, children: c(l("view.i18n.fill.option"), { locale: f }) }, f))
|
|
3688
3683
|
}
|
|
@@ -3691,8 +3686,8 @@ const ho = s.object({
|
|
|
3691
3686
|
K,
|
|
3692
3687
|
{
|
|
3693
3688
|
variant: "tertiary",
|
|
3694
|
-
onClick:
|
|
3695
|
-
disabled: !
|
|
3689
|
+
onClick: h,
|
|
3690
|
+
disabled: !C,
|
|
3696
3691
|
size: "S",
|
|
3697
3692
|
children: c(l("view.i18n.fill.cta.button"))
|
|
3698
3693
|
}
|
|
@@ -3702,19 +3697,19 @@ const ho = s.object({
|
|
|
3702
3697
|
e && u
|
|
3703
3698
|
] });
|
|
3704
3699
|
}, cr = new on(), ur = () => {
|
|
3705
|
-
const { formatMessage: e } = A(), t =
|
|
3706
|
-
localeData:
|
|
3700
|
+
const { formatMessage: e } = A(), t = Ft(), a = ne(), o = Cn(), { toggleNotification: i } = Oe(), [r, d] = N(), [c, m] = N(), [p, u] = N(!1), { canAccess: C, canUpdate: b, isLoadingForPermissions: v } = Do(), {
|
|
3701
|
+
localeData: h,
|
|
3707
3702
|
currentLocale: f,
|
|
3708
3703
|
isChangeLanguageVisible: I,
|
|
3709
|
-
changeCurrentLocaleAction:
|
|
3704
|
+
changeCurrentLocaleAction: y,
|
|
3710
3705
|
availableLocales: T
|
|
3711
|
-
} = Mo(t.data, u), { searchValue:
|
|
3706
|
+
} = Mo(t.data, u), { searchValue: L, setSearchValue: z, isSearchEmpty: k, filteredList: x } = qo(c), {
|
|
3712
3707
|
activeNavigationItem: M,
|
|
3713
3708
|
addNewNavigationItem: _,
|
|
3714
3709
|
editNavigationItem: re,
|
|
3715
3710
|
closeNavigationItemPopup: Q,
|
|
3716
3711
|
isItemPopupVisible: le
|
|
3717
|
-
} = ko(b), fe = Tn([t, { isPending:
|
|
3712
|
+
} = ko(b), fe = Tn([t, { isPending: v }]), ee = In({
|
|
3718
3713
|
onError: (R) => {
|
|
3719
3714
|
i({
|
|
3720
3715
|
type: "danger",
|
|
@@ -3750,13 +3745,13 @@ const ho = s.object({
|
|
|
3750
3745
|
items: Z
|
|
3751
3746
|
}), u(!0), Q();
|
|
3752
3747
|
}
|
|
3753
|
-
}, G = k ? c?.items ?? [] :
|
|
3748
|
+
}, G = k ? c?.items ?? [] : x;
|
|
3754
3749
|
return V(() => {
|
|
3755
3750
|
if (!c && t.data?.[0]) {
|
|
3756
3751
|
let R;
|
|
3757
3752
|
r?.documentId && (R = t.data.find(
|
|
3758
3753
|
(Z) => Z.documentId === r.documentId && Z.id === r.id
|
|
3759
|
-
)), d(void 0), m(R ||
|
|
3754
|
+
)), d(void 0), m(R || Ct(t.data));
|
|
3760
3755
|
}
|
|
3761
3756
|
}, [t.data, c]), V(() => {
|
|
3762
3757
|
if (c && f !== c.locale) {
|
|
@@ -3766,7 +3761,7 @@ const ho = s.object({
|
|
|
3766
3761
|
);
|
|
3767
3762
|
R && R.documentId === c.documentId && R.locale !== c.locale && m(R);
|
|
3768
3763
|
}
|
|
3769
|
-
}, [c, f, t.data]),
|
|
3764
|
+
}, [c, f, t.data]), Eo(), !t.data || !h || fe ? /* @__PURE__ */ n(Te.Loading, {}) : /* @__PURE__ */ w(qe.Root, { children: [
|
|
3770
3765
|
/* @__PURE__ */ n(Te.Title, { children: e(l("header.title", "UI Navigation")) }),
|
|
3771
3766
|
/* @__PURE__ */ w(Te.Main, { children: [
|
|
3772
3767
|
/* @__PURE__ */ n(
|
|
@@ -3776,9 +3771,9 @@ const ho = s.object({
|
|
|
3776
3771
|
activeNavigation: c,
|
|
3777
3772
|
handleCachePurge: () => o.mutate(void 0),
|
|
3778
3773
|
handleChangeSelection: m,
|
|
3779
|
-
handleLocalizationSelection: p ?
|
|
3774
|
+
handleLocalizationSelection: p ? y.trigger : y.perform,
|
|
3780
3775
|
handleSave: _e,
|
|
3781
|
-
locale:
|
|
3776
|
+
locale: h,
|
|
3782
3777
|
structureHasChanged: p,
|
|
3783
3778
|
isSaving: ee.isPending,
|
|
3784
3779
|
permissions: { canUpdate: b },
|
|
@@ -3789,7 +3784,7 @@ const ho = s.object({
|
|
|
3789
3784
|
/* @__PURE__ */ n(
|
|
3790
3785
|
ci,
|
|
3791
3786
|
{
|
|
3792
|
-
startActions: /* @__PURE__ */ n(lr, { value:
|
|
3787
|
+
startActions: /* @__PURE__ */ n(lr, { value: L, setValue: z }),
|
|
3793
3788
|
endActions: /* @__PURE__ */ n(
|
|
3794
3789
|
sr,
|
|
3795
3790
|
{
|
|
@@ -3802,7 +3797,7 @@ const ho = s.object({
|
|
|
3802
3797
|
}
|
|
3803
3798
|
),
|
|
3804
3799
|
c?.items.length ? /* @__PURE__ */ n(
|
|
3805
|
-
|
|
3800
|
+
xn,
|
|
3806
3801
|
{
|
|
3807
3802
|
items: G,
|
|
3808
3803
|
onItemLevelAdd: _,
|
|
@@ -3810,7 +3805,7 @@ const ho = s.object({
|
|
|
3810
3805
|
onItemSubmit: Re,
|
|
3811
3806
|
displayFlat: !k,
|
|
3812
3807
|
isParentAttachedToMenu: !0,
|
|
3813
|
-
permissions: { canUpdate: b, canAccess:
|
|
3808
|
+
permissions: { canUpdate: b, canAccess: C },
|
|
3814
3809
|
structurePrefix: "",
|
|
3815
3810
|
locale: f ?? ""
|
|
3816
3811
|
}
|
|
@@ -3835,15 +3830,15 @@ const ho = s.object({
|
|
|
3835
3830
|
locale: f,
|
|
3836
3831
|
permissions: { canUpdate: b },
|
|
3837
3832
|
isOpen: le,
|
|
3838
|
-
isLoading:
|
|
3833
|
+
isLoading: v,
|
|
3839
3834
|
currentNavigation: c
|
|
3840
3835
|
}
|
|
3841
3836
|
),
|
|
3842
3837
|
I && /* @__PURE__ */ n(
|
|
3843
3838
|
di,
|
|
3844
3839
|
{
|
|
3845
|
-
onCancel: () =>
|
|
3846
|
-
onConfirm: () =>
|
|
3840
|
+
onCancel: () => y.cancel(),
|
|
3841
|
+
onConfirm: () => y.perform()
|
|
3847
3842
|
}
|
|
3848
3843
|
)
|
|
3849
3844
|
] })
|
|
@@ -3886,9 +3881,9 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3886
3881
|
a
|
|
3887
3882
|
), 100);
|
|
3888
3883
|
});
|
|
3889
|
-
}),
|
|
3884
|
+
}), Lt = () => {
|
|
3890
3885
|
const e = j(), t = B(e);
|
|
3891
|
-
return
|
|
3886
|
+
return Fe({
|
|
3892
3887
|
queryKey: t.readSettingsConfigIndex(),
|
|
3893
3888
|
queryFn() {
|
|
3894
3889
|
return t.readSettingsConfig();
|
|
@@ -3896,7 +3891,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3896
3891
|
staleTime: 1e3 * 60 * 5
|
|
3897
3892
|
});
|
|
3898
3893
|
}, Rn = () => {
|
|
3899
|
-
const e = j(), t = B(e), a =
|
|
3894
|
+
const e = j(), t = B(e), a = Fe({
|
|
3900
3895
|
queryKey: t.healthCheckIndex(),
|
|
3901
3896
|
queryFn: () => t.healthCheck(),
|
|
3902
3897
|
retry: !0,
|
|
@@ -3906,14 +3901,14 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3906
3901
|
return ge({
|
|
3907
3902
|
mutationFn: () => t.restart().then(() => a.refetch())
|
|
3908
3903
|
});
|
|
3909
|
-
},
|
|
3904
|
+
}, Ln = () => {
|
|
3910
3905
|
const e = j(), t = B(e);
|
|
3911
3906
|
return ge({
|
|
3912
3907
|
mutationFn: () => t.restoreConfig()
|
|
3913
3908
|
});
|
|
3914
3909
|
}, dt = () => {
|
|
3915
3910
|
const e = j(), t = B(e);
|
|
3916
|
-
return
|
|
3911
|
+
return Fe({
|
|
3917
3912
|
queryKey: t.readContentTypeIndex(),
|
|
3918
3913
|
queryFn: () => t.readContentType(),
|
|
3919
3914
|
staleTime: 1 / 0
|
|
@@ -3969,12 +3964,12 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3969
3964
|
});
|
|
3970
3965
|
}
|
|
3971
3966
|
}, [e]);
|
|
3972
|
-
},
|
|
3967
|
+
}, Cr = ["string", "boolean", "select", "media"], Je = {
|
|
3973
3968
|
background: "neutral0",
|
|
3974
3969
|
hasRadius: !0,
|
|
3975
3970
|
shadow: "filterShadow",
|
|
3976
3971
|
padding: 6
|
|
3977
|
-
},
|
|
3972
|
+
}, $n = tn({
|
|
3978
3973
|
values: {},
|
|
3979
3974
|
onChange: () => null,
|
|
3980
3975
|
handleChange: () => null,
|
|
@@ -3982,14 +3977,14 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
3982
3977
|
setRestartStatus: () => null,
|
|
3983
3978
|
renderError: () => "",
|
|
3984
3979
|
setFormValueItem: () => null
|
|
3985
|
-
}), Ne = () => nn(
|
|
3986
|
-
const { formatMessage: t } = A(), a =
|
|
3980
|
+
}), Ne = () => nn($n), vr = ({ hasSettingsReadPermissions: e }) => {
|
|
3981
|
+
const { formatMessage: t } = A(), a = Ln(), { setRestartStatus: o } = Ne(), [i, r] = N(!1), d = async (c) => {
|
|
3987
3982
|
r(!1), c && (a.mutate(), o({ required: !0 }));
|
|
3988
3983
|
};
|
|
3989
3984
|
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
3990
|
-
/* @__PURE__ */ n(
|
|
3985
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: t(l("pages.settings.restoring.title")) }),
|
|
3991
3986
|
/* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
3992
|
-
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
3987
|
+
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(F, { children: t(l("pages.settings.actions.restore.description")) }) }),
|
|
3993
3988
|
/* @__PURE__ */ w(S.Item, { col: 12, s: 12, xs: 12, children: [
|
|
3994
3989
|
e && /* @__PURE__ */ n(
|
|
3995
3990
|
K,
|
|
@@ -4039,7 +4034,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4039
4034
|
{
|
|
4040
4035
|
closeLabel: t(l("pages.settings.actions.restart.alert.cancel")),
|
|
4041
4036
|
title: t(l("pages.settings.actions.restart.alert.title")),
|
|
4042
|
-
action: /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(K, { onClick: r, startIcon: /* @__PURE__ */ n(
|
|
4037
|
+
action: /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(K, { onClick: r, startIcon: /* @__PURE__ */ n(La, {}), children: t(l("pages.settings.actions.restart.label")) }) }),
|
|
4043
4038
|
onClose: d,
|
|
4044
4039
|
children: /* @__PURE__ */ w(ie, { children: [
|
|
4045
4040
|
/* @__PURE__ */ n(D, { paddingBottom: 1, children: t(l("pages.settings.actions.restart.alert.description")) }),
|
|
@@ -4057,12 +4052,12 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4057
4052
|
}
|
|
4058
4053
|
) }) : null;
|
|
4059
4054
|
}, Sr = () => {
|
|
4060
|
-
const e =
|
|
4055
|
+
const e = Lt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r } = Ne();
|
|
4061
4056
|
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4062
|
-
/* @__PURE__ */ n(
|
|
4057
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: t(l("pages.settings.additional.title")) }),
|
|
4063
4058
|
/* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
4064
4059
|
/* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(D, { width: "100%", children: /* @__PURE__ */ n(
|
|
4065
|
-
|
|
4060
|
+
$,
|
|
4066
4061
|
{
|
|
4067
4062
|
name: "allowedLevels",
|
|
4068
4063
|
label: t(l("pages.settings.form.allowedLevels.label")),
|
|
@@ -4094,7 +4089,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4094
4089
|
}
|
|
4095
4090
|
) }) }),
|
|
4096
4091
|
/* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4097
|
-
|
|
4092
|
+
$,
|
|
4098
4093
|
{
|
|
4099
4094
|
name: "cascadeMenuAttached",
|
|
4100
4095
|
label: t(l("pages.settings.form.cascadeMenuAttached.label")),
|
|
@@ -4114,7 +4109,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4114
4109
|
}
|
|
4115
4110
|
) }),
|
|
4116
4111
|
/* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4117
|
-
|
|
4112
|
+
$,
|
|
4118
4113
|
{
|
|
4119
4114
|
name: "audienceFieldChecked",
|
|
4120
4115
|
label: t(l("pages.settings.form.audience.label")),
|
|
@@ -4134,7 +4129,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4134
4129
|
}
|
|
4135
4130
|
) }),
|
|
4136
4131
|
e.data?.isCachePluginEnabled && /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4137
|
-
|
|
4132
|
+
$,
|
|
4138
4133
|
{
|
|
4139
4134
|
name: "isCacheEnabled",
|
|
4140
4135
|
label: t(l("pages.settings.form.cache.label")),
|
|
@@ -4155,10 +4150,10 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4155
4150
|
) })
|
|
4156
4151
|
] })
|
|
4157
4152
|
] }) });
|
|
4158
|
-
},
|
|
4153
|
+
}, xr = () => {
|
|
4159
4154
|
const { formatMessage: e } = A(), { values: t, onChange: a, handleChange: o, restartStatus: i } = Ne();
|
|
4160
4155
|
return /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4161
|
-
|
|
4156
|
+
$,
|
|
4162
4157
|
{
|
|
4163
4158
|
name: "preferCustomContentTypes",
|
|
4164
4159
|
label: e(l("pages.settings.form.preferCustomContentTypes.label")),
|
|
@@ -4178,7 +4173,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4178
4173
|
}
|
|
4179
4174
|
) });
|
|
4180
4175
|
}, Ar = () => {
|
|
4181
|
-
const e =
|
|
4176
|
+
const e = Lt(), t = dt(), { formatMessage: a } = A(), { values: o, onChange: i, handleChange: r, restartStatus: d, setFormValueItem: c, renderError: m } = Ne(), { contentTypes: p, preferCustomContentTypes: u } = o, C = Xe(
|
|
4182
4177
|
Object.values(t.data ?? []).filter(
|
|
4183
4178
|
({ uid: b }) => hr(b, {
|
|
4184
4179
|
allowedContentTypes: e.data?.allowedContentTypes,
|
|
@@ -4187,12 +4182,12 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4187
4182
|
contentTypes: p
|
|
4188
4183
|
})
|
|
4189
4184
|
).map((b) => {
|
|
4190
|
-
const
|
|
4191
|
-
if (
|
|
4192
|
-
const { isDisplayed:
|
|
4185
|
+
const v = t.data?.find((h) => h.uid === b.uid);
|
|
4186
|
+
if (v) {
|
|
4187
|
+
const { isDisplayed: h, kind: f } = v;
|
|
4193
4188
|
return {
|
|
4194
4189
|
...b,
|
|
4195
|
-
available:
|
|
4190
|
+
available: h,
|
|
4196
4191
|
isSingle: f === "singleType"
|
|
4197
4192
|
};
|
|
4198
4193
|
}
|
|
@@ -4201,7 +4196,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4201
4196
|
(b) => b.info.displayName
|
|
4202
4197
|
);
|
|
4203
4198
|
return /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4204
|
-
|
|
4199
|
+
$,
|
|
4205
4200
|
{
|
|
4206
4201
|
name: "contentTypes",
|
|
4207
4202
|
label: a(l("pages.settings.form.contentTypes.label")),
|
|
@@ -4217,27 +4212,27 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4217
4212
|
onChange: (b) => {
|
|
4218
4213
|
r("contentTypes", b, i);
|
|
4219
4214
|
const {
|
|
4220
|
-
contentTypesNameFields:
|
|
4221
|
-
contentTypesPopulate:
|
|
4215
|
+
contentTypesNameFields: v = [],
|
|
4216
|
+
contentTypesPopulate: h = [],
|
|
4222
4217
|
pathDefaultFields: f = []
|
|
4223
4218
|
} = o, I = b.filter(
|
|
4224
|
-
(T) => !
|
|
4225
|
-
) ?? [],
|
|
4219
|
+
(T) => !v.find((L) => L.key === T)
|
|
4220
|
+
) ?? [], y = v.filter(
|
|
4226
4221
|
(T) => !b.includes(T.key) || T.key === "default"
|
|
4227
4222
|
).map(({ key: T }) => T) ?? [];
|
|
4228
4223
|
c("contentTypesNameFields", [
|
|
4229
|
-
...
|
|
4230
|
-
({ key: T }) => !
|
|
4224
|
+
...v.filter(
|
|
4225
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4231
4226
|
) ?? [],
|
|
4232
4227
|
...I.map((T) => ({ key: T, fields: [] }))
|
|
4233
4228
|
]), c("contentTypesPopulate", [
|
|
4234
|
-
...
|
|
4235
|
-
({ key: T }) => !
|
|
4229
|
+
...h.filter(
|
|
4230
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4236
4231
|
) ?? [],
|
|
4237
4232
|
...I.map((T) => ({ key: T, fields: [] }))
|
|
4238
4233
|
]), c("pathDefaultFields", [
|
|
4239
4234
|
...f.filter(
|
|
4240
|
-
({ key: T }) => !
|
|
4235
|
+
({ key: T }) => !y.includes(T) || T === "default"
|
|
4241
4236
|
) ?? [],
|
|
4242
4237
|
...I.map((T) => ({ key: T, fields: [] }))
|
|
4243
4238
|
]);
|
|
@@ -4246,12 +4241,12 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4246
4241
|
error: m("contentTypes"),
|
|
4247
4242
|
withTags: !0,
|
|
4248
4243
|
width: "100%",
|
|
4249
|
-
children:
|
|
4244
|
+
children: C.map((b) => /* @__PURE__ */ n(Ve, { value: b.uid, children: b.info.displayName }, b.uid))
|
|
4250
4245
|
}
|
|
4251
4246
|
)
|
|
4252
4247
|
}
|
|
4253
4248
|
) });
|
|
4254
|
-
},
|
|
4249
|
+
}, Fr = () => {
|
|
4255
4250
|
const e = dt(), { formatMessage: t } = A(), { values: a, onChange: o, handleChange: i, restartStatus: r, renderError: d } = Ne(), c = X(
|
|
4256
4251
|
() => a.contentTypes?.map((m) => e.data?.find(({ uid: p }) => p === m)).filter(
|
|
4257
4252
|
(m) => m !== void 0
|
|
@@ -4261,13 +4256,13 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4261
4256
|
return V(() => {
|
|
4262
4257
|
a.defaultContentType && (a.contentTypes.includes(a.defaultContentType) || i("defaultContentType", void 0, o));
|
|
4263
4258
|
}, [a.contentTypes]), /* @__PURE__ */ n(S.Item, { col: 4, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4264
|
-
|
|
4259
|
+
$,
|
|
4265
4260
|
{
|
|
4266
4261
|
name: "defaultContentType",
|
|
4267
4262
|
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
4268
4263
|
hint: t(l("pages.settings.form.defaultContentType.hint")),
|
|
4269
4264
|
children: /* @__PURE__ */ n(
|
|
4270
|
-
|
|
4265
|
+
xe,
|
|
4271
4266
|
{
|
|
4272
4267
|
name: "defaultContentType",
|
|
4273
4268
|
label: t(l("pages.settings.form.defaultContentType.label")),
|
|
@@ -4291,14 +4286,14 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4291
4286
|
contentTypesNameFields: m
|
|
4292
4287
|
} = a;
|
|
4293
4288
|
return /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: c?.length ? /* @__PURE__ */ n(Ue.Root, { style: { width: "100%" }, children: m.map((p, u) => {
|
|
4294
|
-
const
|
|
4289
|
+
const C = e.data?.find(({ uid: f }) => f === p.key), b = C?.attributes ?? {}, v = Object.keys(b).sort(), h = v.filter(
|
|
4295
4290
|
(f) => Nr.includes(b[f]?.type)
|
|
4296
4291
|
);
|
|
4297
|
-
return
|
|
4298
|
-
/* @__PURE__ */ n(Ue.Header, { children: /* @__PURE__ */ n(Ue.Trigger, { children:
|
|
4292
|
+
return C ? /* @__PURE__ */ w(Ue.Item, { value: p.key, children: [
|
|
4293
|
+
/* @__PURE__ */ n(Ue.Header, { children: /* @__PURE__ */ n(Ue.Trigger, { children: C?.info.displayName ?? t(l("pages.settings.form.nameField.default")) }) }),
|
|
4299
4294
|
/* @__PURE__ */ n(Ue.Content, { children: /* @__PURE__ */ w(S.Root, { gap: 4, padding: 2, children: [
|
|
4300
4295
|
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4301
|
-
|
|
4296
|
+
$,
|
|
4302
4297
|
{
|
|
4303
4298
|
name: `contentTypesNameFields[${u}]`,
|
|
4304
4299
|
label: t(l("pages.settings.form.nameField.label")),
|
|
@@ -4317,23 +4312,23 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4317
4312
|
value: J(a, `contentTypesNameFields[${u}].fields`),
|
|
4318
4313
|
onChange: (f) => {
|
|
4319
4314
|
const I = J(a, "contentTypesNameFields", []).map(
|
|
4320
|
-
(
|
|
4321
|
-
...
|
|
4315
|
+
(y, T) => T === u ? {
|
|
4316
|
+
...y,
|
|
4322
4317
|
fields: f
|
|
4323
|
-
} :
|
|
4318
|
+
} : y
|
|
4324
4319
|
);
|
|
4325
4320
|
return i("contentTypesNameFields", I, o);
|
|
4326
4321
|
},
|
|
4327
4322
|
disabled: r.required,
|
|
4328
4323
|
error: d(`contentTypesNameFields[${u}]`),
|
|
4329
4324
|
withTags: !0,
|
|
4330
|
-
children:
|
|
4325
|
+
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4331
4326
|
}
|
|
4332
4327
|
)
|
|
4333
4328
|
}
|
|
4334
4329
|
) }),
|
|
4335
4330
|
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4336
|
-
|
|
4331
|
+
$,
|
|
4337
4332
|
{
|
|
4338
4333
|
name: `contentTypesPopulate[${u - 1}]`,
|
|
4339
4334
|
label: t(l("pages.settings.form.populate.label")),
|
|
@@ -4353,23 +4348,23 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4353
4348
|
value: J(a, `contentTypesPopulate[${u - 1}].fields`, []),
|
|
4354
4349
|
onChange: (f) => {
|
|
4355
4350
|
const I = J(a, "contentTypesPopulate", []).map(
|
|
4356
|
-
(
|
|
4357
|
-
...
|
|
4351
|
+
(y, T) => T === u - 1 ? {
|
|
4352
|
+
...y,
|
|
4358
4353
|
fields: f
|
|
4359
|
-
} :
|
|
4354
|
+
} : y
|
|
4360
4355
|
);
|
|
4361
4356
|
return i("contentTypesPopulate", I, o);
|
|
4362
4357
|
},
|
|
4363
4358
|
disabled: r.required,
|
|
4364
4359
|
error: d(`contentTypesPopulate[${u - 1}]`),
|
|
4365
4360
|
withTags: !0,
|
|
4366
|
-
children:
|
|
4361
|
+
children: h.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4367
4362
|
}
|
|
4368
4363
|
)
|
|
4369
4364
|
}
|
|
4370
4365
|
) }),
|
|
4371
4366
|
/* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ n(
|
|
4372
|
-
|
|
4367
|
+
$,
|
|
4373
4368
|
{
|
|
4374
4369
|
name: `pathDefaultFields[${u - 1}]`,
|
|
4375
4370
|
label: t(
|
|
@@ -4390,16 +4385,16 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4390
4385
|
),
|
|
4391
4386
|
value: J(a, `pathDefaultFields[${u - 1}].fields`, []),
|
|
4392
4387
|
onChange: (f) => {
|
|
4393
|
-
const I = J(a, "pathDefaultFields", []).map((
|
|
4394
|
-
...
|
|
4388
|
+
const I = J(a, "pathDefaultFields", []).map((y, T) => T === u - 1 ? {
|
|
4389
|
+
...y,
|
|
4395
4390
|
fields: f
|
|
4396
|
-
} :
|
|
4391
|
+
} : y);
|
|
4397
4392
|
return i("pathDefaultFields", I, o);
|
|
4398
4393
|
},
|
|
4399
4394
|
disabled: r.required,
|
|
4400
4395
|
error: d(`pathDefaultFields[${u - 1}]`),
|
|
4401
4396
|
withTags: !0,
|
|
4402
|
-
children:
|
|
4397
|
+
children: v.map((f) => /* @__PURE__ */ n(Ve, { value: f, children: f }, f))
|
|
4403
4398
|
}
|
|
4404
4399
|
)
|
|
4405
4400
|
}
|
|
@@ -4407,31 +4402,31 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4407
4402
|
] }) })
|
|
4408
4403
|
] }, p.key) : null;
|
|
4409
4404
|
}) }) : null });
|
|
4410
|
-
},
|
|
4405
|
+
}, Lr = () => {
|
|
4411
4406
|
const { formatMessage: e } = A();
|
|
4412
4407
|
return /* @__PURE__ */ n(D, { ...Je, width: "100%", children: /* @__PURE__ */ w(P, { direction: "column", alignItems: "flex-start", gap: 2, children: [
|
|
4413
|
-
/* @__PURE__ */ n(
|
|
4408
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: e(l("pages.settings.general.title")) }),
|
|
4414
4409
|
/* @__PURE__ */ n(S.Root, { gap: 4, width: "100%", children: /* @__PURE__ */ n(S.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ w(S.Root, { gap: 4, width: "100%", children: [
|
|
4415
|
-
/* @__PURE__ */ n(Fr, {}),
|
|
4416
|
-
/* @__PURE__ */ n(Ar, {}),
|
|
4417
4410
|
/* @__PURE__ */ n(xr, {}),
|
|
4411
|
+
/* @__PURE__ */ n(Ar, {}),
|
|
4412
|
+
/* @__PURE__ */ n(Fr, {}),
|
|
4418
4413
|
/* @__PURE__ */ n(Rr, {})
|
|
4419
4414
|
] }) }) })
|
|
4420
4415
|
] }) });
|
|
4421
|
-
}, Jt = /* @__PURE__ */ n(Pa, {}),
|
|
4416
|
+
}, Jt = /* @__PURE__ */ n(Pa, {}), $r = /* @__PURE__ */ n(wt, {}), ae = "pages.settings.form.customFields.table.", Er = ({
|
|
4422
4417
|
data: e = [],
|
|
4423
4418
|
onOpenModal: t,
|
|
4424
4419
|
onRemoveCustomField: a,
|
|
4425
4420
|
onToggleCustomField: o
|
|
4426
4421
|
}) => {
|
|
4427
|
-
const [i, r] = N(!1), [d, c] = N(null), { toggleNotification: m } = Oe(), p = X(() => Xe(e, "name"), [e]), { formatMessage: u } = A(),
|
|
4428
|
-
(
|
|
4429
|
-
c(
|
|
4422
|
+
const [i, r] = N(!1), [d, c] = N(null), { toggleNotification: m } = Oe(), p = X(() => Xe(e, "name"), [e]), { formatMessage: u } = A(), C = E(
|
|
4423
|
+
(h) => {
|
|
4424
|
+
c(h), r(!0);
|
|
4430
4425
|
},
|
|
4431
4426
|
[c, r]
|
|
4432
|
-
), b =
|
|
4427
|
+
), b = E(() => {
|
|
4433
4428
|
c(null), r(!1);
|
|
4434
|
-
}, [c, r]),
|
|
4429
|
+
}, [c, r]), v = E(() => {
|
|
4435
4430
|
d === null ? m({
|
|
4436
4431
|
type: "warning",
|
|
4437
4432
|
message: u(l(`${ae}confirmation.error`))
|
|
@@ -4447,7 +4442,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4447
4442
|
labelConfirm: u(l(`${ae}confirmation.confirm`)),
|
|
4448
4443
|
iconConfirm: Jt,
|
|
4449
4444
|
mainIcon: Jt,
|
|
4450
|
-
onConfirm:
|
|
4445
|
+
onConfirm: v,
|
|
4451
4446
|
onCancel: b
|
|
4452
4447
|
}
|
|
4453
4448
|
),
|
|
@@ -4460,68 +4455,68 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4460
4455
|
footer: /* @__PURE__ */ n(
|
|
4461
4456
|
ha,
|
|
4462
4457
|
{
|
|
4463
|
-
onClick: (
|
|
4464
|
-
|
|
4458
|
+
onClick: (h) => {
|
|
4459
|
+
h.preventDefault(), t(null);
|
|
4465
4460
|
},
|
|
4466
|
-
icon:
|
|
4461
|
+
icon: $r,
|
|
4467
4462
|
children: u(l(`${ae}footer`))
|
|
4468
4463
|
}
|
|
4469
4464
|
),
|
|
4470
4465
|
children: [
|
|
4471
4466
|
/* @__PURE__ */ n(dn, { children: /* @__PURE__ */ w(et, { children: [
|
|
4472
|
-
/* @__PURE__ */ n(ce, { width: "20%", children: /* @__PURE__ */ n(
|
|
4473
|
-
/* @__PURE__ */ n(ce, { width: "60%", children: /* @__PURE__ */ n(
|
|
4474
|
-
/* @__PURE__ */ n(ce, { width: "15%", children: /* @__PURE__ */ n(
|
|
4475
|
-
/* @__PURE__ */ n(ce, { width: "5%", children: /* @__PURE__ */ n(
|
|
4467
|
+
/* @__PURE__ */ n(ce, { width: "20%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.name`)) }) }),
|
|
4468
|
+
/* @__PURE__ */ n(ce, { width: "60%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.label`)) }) }),
|
|
4469
|
+
/* @__PURE__ */ n(ce, { width: "15%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.type`)) }) }),
|
|
4470
|
+
/* @__PURE__ */ n(ce, { width: "5%", children: /* @__PURE__ */ n(F, { variant: "sigma", textColor: "neutral600", children: u(l(`${ae}header.required`)) }) }),
|
|
4476
4471
|
/* @__PURE__ */ n(ce, { children: /* @__PURE__ */ n(ma, {}) })
|
|
4477
4472
|
] }) }),
|
|
4478
4473
|
/* @__PURE__ */ n(cn, { children: p.map(
|
|
4479
|
-
(
|
|
4480
|
-
/* @__PURE__ */ n(ue, { width: "20%", children: /* @__PURE__ */ n(
|
|
4481
|
-
/* @__PURE__ */ n(ue, { width: "60%", children: /* @__PURE__ */ n(
|
|
4482
|
-
/* @__PURE__ */ n(ue, { width: "15%", children: /* @__PURE__ */ n(
|
|
4474
|
+
(h) => typeof h != "string" ? /* @__PURE__ */ w(et, { children: [
|
|
4475
|
+
/* @__PURE__ */ n(ue, { width: "20%", children: /* @__PURE__ */ n(F, { fontWeight: "semiBold", textColor: "neutral800", children: h.name }) }),
|
|
4476
|
+
/* @__PURE__ */ n(ue, { width: "60%", children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.label }) }),
|
|
4477
|
+
/* @__PURE__ */ n(ue, { width: "15%", children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.type }) }),
|
|
4483
4478
|
/* @__PURE__ */ n(ue, { width: "5%", children: /* @__PURE__ */ n(
|
|
4484
4479
|
ga,
|
|
4485
4480
|
{
|
|
4486
4481
|
description: u(
|
|
4487
|
-
l(`${ae}${
|
|
4482
|
+
l(`${ae}${h.required ? "required" : "notRequired"}`)
|
|
4488
4483
|
),
|
|
4489
|
-
children: /* @__PURE__ */ n(
|
|
4484
|
+
children: /* @__PURE__ */ n(F, { textColor: "neutral800", children: h.required ? /* @__PURE__ */ n(Ge, {}) : /* @__PURE__ */ n($a, {}) })
|
|
4490
4485
|
}
|
|
4491
4486
|
) }),
|
|
4492
4487
|
/* @__PURE__ */ n(ue, { children: /* @__PURE__ */ n(P, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ w(un, { children: [
|
|
4493
4488
|
/* @__PURE__ */ n(
|
|
4494
4489
|
ye,
|
|
4495
4490
|
{
|
|
4496
|
-
onClick: () => o(
|
|
4491
|
+
onClick: () => o(h),
|
|
4497
4492
|
label: u(
|
|
4498
|
-
l(`${ae}${
|
|
4493
|
+
l(`${ae}${h.enabled ? "disable" : "enable"}`)
|
|
4499
4494
|
),
|
|
4500
|
-
variant:
|
|
4501
|
-
children:
|
|
4495
|
+
variant: h.enabled ? "success-light" : "tertiary",
|
|
4496
|
+
children: h.enabled ? /* @__PURE__ */ n(mn, {}) : /* @__PURE__ */ n(Ea, {}),
|
|
4502
4497
|
style: { minWidth: 50 }
|
|
4503
4498
|
}
|
|
4504
4499
|
),
|
|
4505
4500
|
/* @__PURE__ */ n(
|
|
4506
4501
|
ye,
|
|
4507
4502
|
{
|
|
4508
|
-
onClick: () => t(
|
|
4503
|
+
onClick: () => t(h),
|
|
4509
4504
|
label: u(l(`${ae}edit`)),
|
|
4510
|
-
children: /* @__PURE__ */ n(
|
|
4505
|
+
children: /* @__PURE__ */ n(vt, {}),
|
|
4511
4506
|
style: { minWidth: 50 }
|
|
4512
4507
|
}
|
|
4513
4508
|
),
|
|
4514
4509
|
/* @__PURE__ */ n(
|
|
4515
4510
|
ye,
|
|
4516
4511
|
{
|
|
4517
|
-
onClick: () =>
|
|
4512
|
+
onClick: () => C(h),
|
|
4518
4513
|
label: u(l(`${ae}remove`)),
|
|
4519
4514
|
children: /* @__PURE__ */ n(Tt, {}),
|
|
4520
4515
|
style: { minWidth: 50 }
|
|
4521
4516
|
}
|
|
4522
4517
|
)
|
|
4523
4518
|
] }) }) })
|
|
4524
|
-
] },
|
|
4519
|
+
] }, h.name) : null
|
|
4525
4520
|
) })
|
|
4526
4521
|
]
|
|
4527
4522
|
}
|
|
@@ -4553,7 +4548,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4553
4548
|
onSubmit: a,
|
|
4554
4549
|
onClose: o
|
|
4555
4550
|
}) => {
|
|
4556
|
-
const i = Mr(
|
|
4551
|
+
const i = Mr(Cr), { formatMessage: r } = A(), [d, c] = N(
|
|
4557
4552
|
t ? {
|
|
4558
4553
|
...t
|
|
4559
4554
|
} : {
|
|
@@ -4570,14 +4565,14 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4570
4565
|
...t
|
|
4571
4566
|
});
|
|
4572
4567
|
}, [t]);
|
|
4573
|
-
const
|
|
4574
|
-
if (
|
|
4575
|
-
let T = f,
|
|
4568
|
+
const C = (f, I, y) => {
|
|
4569
|
+
if (y) {
|
|
4570
|
+
let T = f, L = I;
|
|
4576
4571
|
if (He(f)) {
|
|
4577
4572
|
const { name: z, value: k } = f.target;
|
|
4578
|
-
T = z,
|
|
4573
|
+
T = z, L = Be(L) ? k : L;
|
|
4579
4574
|
}
|
|
4580
|
-
return ot(T) && b(T,
|
|
4575
|
+
return ot(T) && b(T, L), y(f, L);
|
|
4581
4576
|
}
|
|
4582
4577
|
}, b = (f, I) => {
|
|
4583
4578
|
c(
|
|
@@ -4589,14 +4584,14 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4589
4584
|
I
|
|
4590
4585
|
)
|
|
4591
4586
|
);
|
|
4592
|
-
},
|
|
4587
|
+
}, v = (f) => {
|
|
4593
4588
|
const I = J(m, f);
|
|
4594
4589
|
if (I)
|
|
4595
4590
|
return r(l(`${O}${f}.${I}`));
|
|
4596
|
-
},
|
|
4597
|
-
const { success:
|
|
4598
|
-
|
|
4599
|
-
|
|
4591
|
+
}, h = (f, I) => {
|
|
4592
|
+
const { success: y, data: T, error: L } = gn.safeParse(I);
|
|
4593
|
+
y ? a(T) : L && p(
|
|
4594
|
+
L.issues.reduce((z, k) => ({
|
|
4600
4595
|
...z,
|
|
4601
4596
|
[k.path.join(".")]: k.message
|
|
4602
4597
|
}), {})
|
|
@@ -4605,19 +4600,19 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4605
4600
|
return /* @__PURE__ */ w(ie, { children: [
|
|
4606
4601
|
/* @__PURE__ */ n(H.Body, { children: /* @__PURE__ */ n(at, { method: "POST", width: "auto", height: "auto", initialValues: d, children: ({ values: f, onChange: I }) => /* @__PURE__ */ w(S.Root, { gap: 5, children: [
|
|
4607
4602
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4608
|
-
|
|
4603
|
+
$,
|
|
4609
4604
|
{
|
|
4610
4605
|
name: "name",
|
|
4611
4606
|
label: r(l(`${O}name.label`)),
|
|
4612
4607
|
hint: r(l(`${O}name.description`)),
|
|
4613
|
-
error:
|
|
4608
|
+
error: v("name"),
|
|
4614
4609
|
required: !0,
|
|
4615
4610
|
children: /* @__PURE__ */ n(
|
|
4616
4611
|
we,
|
|
4617
4612
|
{
|
|
4618
4613
|
name: "name",
|
|
4619
4614
|
value: f.name,
|
|
4620
|
-
onChange: (
|
|
4615
|
+
onChange: (y, T) => C(y, T, I),
|
|
4621
4616
|
placeholder: r(l(`${O}name.placeholder`)),
|
|
4622
4617
|
type: "string",
|
|
4623
4618
|
disabled: e,
|
|
@@ -4627,19 +4622,19 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4627
4622
|
}
|
|
4628
4623
|
) }, "name"),
|
|
4629
4624
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4630
|
-
|
|
4625
|
+
$,
|
|
4631
4626
|
{
|
|
4632
4627
|
name: "label",
|
|
4633
4628
|
label: r(l(`${O}label.label`)),
|
|
4634
4629
|
hint: r(l(`${O}label.description`)),
|
|
4635
|
-
error:
|
|
4630
|
+
error: v("label"),
|
|
4636
4631
|
required: !0,
|
|
4637
4632
|
children: /* @__PURE__ */ n(
|
|
4638
4633
|
we,
|
|
4639
4634
|
{
|
|
4640
4635
|
name: "label",
|
|
4641
4636
|
value: f.label,
|
|
4642
|
-
onChange: (
|
|
4637
|
+
onChange: (y, T) => C(y, T, I),
|
|
4643
4638
|
placeholder: r(l(`${O}label.placeholder`)),
|
|
4644
4639
|
type: "string",
|
|
4645
4640
|
width: "100%"
|
|
@@ -4648,18 +4643,18 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4648
4643
|
}
|
|
4649
4644
|
) }, "label"),
|
|
4650
4645
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4651
|
-
|
|
4646
|
+
$,
|
|
4652
4647
|
{
|
|
4653
4648
|
name: "description",
|
|
4654
4649
|
label: r(l(`${O}description.label`)),
|
|
4655
4650
|
hint: r(l(`${O}description.description`)),
|
|
4656
|
-
error:
|
|
4651
|
+
error: v("description"),
|
|
4657
4652
|
children: /* @__PURE__ */ n(
|
|
4658
4653
|
we,
|
|
4659
4654
|
{
|
|
4660
4655
|
name: "description",
|
|
4661
4656
|
value: f.description,
|
|
4662
|
-
onChange: (
|
|
4657
|
+
onChange: (y, T) => C(y, T, I),
|
|
4663
4658
|
placeholder: r(l(`${O}description.placeholder`)),
|
|
4664
4659
|
type: "string",
|
|
4665
4660
|
width: "100%"
|
|
@@ -4668,18 +4663,18 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4668
4663
|
}
|
|
4669
4664
|
) }, "description"),
|
|
4670
4665
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4671
|
-
|
|
4666
|
+
$,
|
|
4672
4667
|
{
|
|
4673
4668
|
name: "placeholder",
|
|
4674
4669
|
label: r(l(`${O}placeholder.label`)),
|
|
4675
4670
|
hint: r(l(`${O}placeholder.description`)),
|
|
4676
|
-
error:
|
|
4671
|
+
error: v("placeholder"),
|
|
4677
4672
|
children: /* @__PURE__ */ n(
|
|
4678
4673
|
we,
|
|
4679
4674
|
{
|
|
4680
4675
|
name: "placeholder",
|
|
4681
4676
|
value: f.placeholder,
|
|
4682
|
-
onChange: (
|
|
4677
|
+
onChange: (y, T) => C(y, T, I),
|
|
4683
4678
|
placeholder: r(l(`${O}placeholder.placeholder`)),
|
|
4684
4679
|
type: "string",
|
|
4685
4680
|
width: "100%"
|
|
@@ -4688,39 +4683,39 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4688
4683
|
}
|
|
4689
4684
|
) }, "placeholder"),
|
|
4690
4685
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4691
|
-
|
|
4686
|
+
$,
|
|
4692
4687
|
{
|
|
4693
4688
|
name: "type",
|
|
4694
4689
|
label: r(l(`${O}type.label`)),
|
|
4695
4690
|
hint: r(l(`${O}type.description`)),
|
|
4696
4691
|
required: !0,
|
|
4697
4692
|
children: /* @__PURE__ */ n(
|
|
4698
|
-
|
|
4693
|
+
xe,
|
|
4699
4694
|
{
|
|
4700
4695
|
name: "type",
|
|
4701
4696
|
value: f.type,
|
|
4702
|
-
onChange: (
|
|
4697
|
+
onChange: (y) => C("type", y, I),
|
|
4703
4698
|
disabled: e,
|
|
4704
4699
|
width: "100%",
|
|
4705
|
-
children: i.map(({ key:
|
|
4700
|
+
children: i.map(({ key: y, label: T, value: L }) => /* @__PURE__ */ n(Ae, { value: L, children: T }, y))
|
|
4706
4701
|
}
|
|
4707
4702
|
)
|
|
4708
4703
|
}
|
|
4709
4704
|
) }, "type"),
|
|
4710
4705
|
u === "select" && /* @__PURE__ */ w(ie, { children: [
|
|
4711
4706
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4712
|
-
|
|
4707
|
+
$,
|
|
4713
4708
|
{
|
|
4714
4709
|
name: "multi",
|
|
4715
4710
|
label: r(l(`${O}multi.label`)),
|
|
4716
4711
|
hint: r(l(`${O}multi.description`)),
|
|
4717
|
-
error:
|
|
4712
|
+
error: v("multi"),
|
|
4718
4713
|
children: /* @__PURE__ */ n(
|
|
4719
4714
|
me,
|
|
4720
4715
|
{
|
|
4721
4716
|
name: "multi",
|
|
4722
4717
|
checked: f.multi,
|
|
4723
|
-
onChange: (
|
|
4718
|
+
onChange: (y) => C(y, !f.multi, I),
|
|
4724
4719
|
onLabel: "true",
|
|
4725
4720
|
offLabel: "false",
|
|
4726
4721
|
width: "100%"
|
|
@@ -4729,17 +4724,17 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4729
4724
|
}
|
|
4730
4725
|
) }, "multi"),
|
|
4731
4726
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4732
|
-
|
|
4727
|
+
$,
|
|
4733
4728
|
{
|
|
4734
4729
|
name: "options",
|
|
4735
4730
|
label: r(l(`${O}options.label`)),
|
|
4736
4731
|
hint: r(l(`${O}options.description`)),
|
|
4737
|
-
error:
|
|
4732
|
+
error: v("options"),
|
|
4738
4733
|
children: /* @__PURE__ */ n(
|
|
4739
4734
|
Pr,
|
|
4740
4735
|
{
|
|
4741
4736
|
name: "options",
|
|
4742
|
-
onChange: (
|
|
4737
|
+
onChange: (y) => C("options", y, I),
|
|
4743
4738
|
initialValue: f.options
|
|
4744
4739
|
}
|
|
4745
4740
|
)
|
|
@@ -4747,19 +4742,19 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4747
4742
|
) }, "options")
|
|
4748
4743
|
] }),
|
|
4749
4744
|
/* @__PURE__ */ n(S.Item, { col: 12, children: /* @__PURE__ */ n(
|
|
4750
|
-
|
|
4745
|
+
$,
|
|
4751
4746
|
{
|
|
4752
4747
|
name: "required",
|
|
4753
4748
|
label: r(l(`${O}required.label`)),
|
|
4754
4749
|
hint: r(l(`${O}required.description`)),
|
|
4755
|
-
error:
|
|
4750
|
+
error: v("required"),
|
|
4756
4751
|
children: /* @__PURE__ */ n(
|
|
4757
4752
|
me,
|
|
4758
4753
|
{
|
|
4759
4754
|
name: "required",
|
|
4760
4755
|
placeholder: r(l(`${O}required.placeholder`)),
|
|
4761
4756
|
checked: f.required,
|
|
4762
|
-
onChange: (
|
|
4757
|
+
onChange: (y) => C(y, !f.required, I),
|
|
4763
4758
|
onLabel: "true",
|
|
4764
4759
|
offLabel: "false",
|
|
4765
4760
|
width: "100%"
|
|
@@ -4770,7 +4765,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4770
4765
|
] }) }) }),
|
|
4771
4766
|
/* @__PURE__ */ w(H.Footer, { children: [
|
|
4772
4767
|
/* @__PURE__ */ n(H.Close, { children: /* @__PURE__ */ n(K, { onClick: o, variant: "tertiary", children: r(l("popup.item.form.button.cancel")) }) }),
|
|
4773
|
-
/* @__PURE__ */ n(K, { onClick: (f) =>
|
|
4768
|
+
/* @__PURE__ */ n(K, { onClick: (f) => h(f, d), children: r(l("popup.item.form.button.save")) })
|
|
4774
4769
|
] })
|
|
4775
4770
|
] });
|
|
4776
4771
|
}, qr = ({
|
|
@@ -4790,7 +4785,7 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4790
4785
|
labelledBy: "custom-field-modal",
|
|
4791
4786
|
children: /* @__PURE__ */ w(H.Content, { children: [
|
|
4792
4787
|
/* @__PURE__ */ n(H.Header, { children: /* @__PURE__ */ n(
|
|
4793
|
-
|
|
4788
|
+
F,
|
|
4794
4789
|
{
|
|
4795
4790
|
variant: "omega",
|
|
4796
4791
|
fontWeight: "bold",
|
|
@@ -4822,31 +4817,31 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4822
4817
|
setFormValueItem: a
|
|
4823
4818
|
} = Ne(), [o, i] = N(!1), [r, d] = N(
|
|
4824
4819
|
null
|
|
4825
|
-
), c = (
|
|
4826
|
-
d(
|
|
4827
|
-
}, m = (
|
|
4820
|
+
), c = (C) => {
|
|
4821
|
+
d(C), i(!0);
|
|
4822
|
+
}, m = (C) => {
|
|
4828
4823
|
const b = t.filter(
|
|
4829
|
-
(
|
|
4824
|
+
(v) => typeof v != "string" ? v.name !== C.name : !0
|
|
4830
4825
|
);
|
|
4831
4826
|
a("additionalFields", b), d(null), i(!1);
|
|
4832
|
-
}, p = (
|
|
4833
|
-
const b = { ...
|
|
4834
|
-
(
|
|
4827
|
+
}, p = (C) => {
|
|
4828
|
+
const b = { ...C, enabled: !C.enabled }, v = t.map(
|
|
4829
|
+
(h) => typeof h != "string" && C.name === h.name ? b : h
|
|
4835
4830
|
);
|
|
4836
|
-
a("additionalFields",
|
|
4837
|
-
}, u = (
|
|
4838
|
-
const
|
|
4839
|
-
(
|
|
4831
|
+
a("additionalFields", v);
|
|
4832
|
+
}, u = (C) => {
|
|
4833
|
+
const v = !!t.find(
|
|
4834
|
+
(h) => typeof h != "string" ? h.name === C.name : !1
|
|
4840
4835
|
) ? t.map(
|
|
4841
|
-
(
|
|
4842
|
-
) : [...t,
|
|
4843
|
-
a("additionalFields",
|
|
4836
|
+
(h) => typeof h != "string" && C.name === h.name ? C : h
|
|
4837
|
+
) : [...t, C];
|
|
4838
|
+
a("additionalFields", v), d(null), i(!1);
|
|
4844
4839
|
};
|
|
4845
4840
|
return /* @__PURE__ */ w(D, { ...Je, width: "100%", children: [
|
|
4846
|
-
/* @__PURE__ */ n(
|
|
4841
|
+
/* @__PURE__ */ n(F, { variant: "delta", as: "h2", children: e(l("pages.settings.customFields.title")) }),
|
|
4847
4842
|
/* @__PURE__ */ n(D, { padding: 1 }),
|
|
4848
4843
|
/* @__PURE__ */ n(
|
|
4849
|
-
|
|
4844
|
+
Er,
|
|
4850
4845
|
{
|
|
4851
4846
|
data: t,
|
|
4852
4847
|
onOpenModal: c,
|
|
@@ -4879,42 +4874,42 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4879
4874
|
fields: g.string().array()
|
|
4880
4875
|
}).array()
|
|
4881
4876
|
}), Yt = new on(), jr = () => {
|
|
4882
|
-
const e =
|
|
4877
|
+
const e = Lt(), t = dt(), a = br(), o = Ln(), i = Rn(), { formatMessage: r } = A(), [d, c] = N({ required: !1 }), [m, p] = N(!1), u = Un("SettingsPage", (x) => x.permissions), C = X(() => !!u.find(({ action: x }) => x === $e.settings[0].action), [u]), b = X(() => !!u.find(({ action: x }) => x === $e.access[0].action), [u]), v = e.isPending || t.isPending || a.isPending || i.isPending || o.isPending, [h, f] = N({}), [I, y] = N(), T = (x, M, _) => {
|
|
4883
4878
|
if (_) {
|
|
4884
|
-
let re =
|
|
4885
|
-
if (He(
|
|
4886
|
-
const { name: le, value: fe } =
|
|
4879
|
+
let re = x, Q = M;
|
|
4880
|
+
if (He(x)) {
|
|
4881
|
+
const { name: le, value: fe } = x.target;
|
|
4887
4882
|
re = le, Q = Be(Q) ? fe : Q;
|
|
4888
4883
|
}
|
|
4889
|
-
return ot(re) &&
|
|
4884
|
+
return ot(re) && L(re, Q), _(x, Q);
|
|
4890
4885
|
}
|
|
4891
|
-
},
|
|
4886
|
+
}, L = (x, M) => {
|
|
4892
4887
|
f(
|
|
4893
4888
|
(_) => it(
|
|
4894
4889
|
{
|
|
4895
4890
|
..._
|
|
4896
4891
|
},
|
|
4897
|
-
|
|
4892
|
+
x,
|
|
4898
4893
|
M
|
|
4899
4894
|
)
|
|
4900
4895
|
);
|
|
4901
|
-
}, z = (
|
|
4902
|
-
if (J(I,
|
|
4903
|
-
return r(l(
|
|
4904
|
-
}, k = (
|
|
4896
|
+
}, z = (x) => {
|
|
4897
|
+
if (J(I, x))
|
|
4898
|
+
return r(l(x));
|
|
4899
|
+
}, k = (x, M) => {
|
|
4905
4900
|
const { success: _, data: re, error: Q } = Vr.safeParse(M);
|
|
4906
4901
|
_ ? a.mutate(re, {
|
|
4907
4902
|
onSuccess() {
|
|
4908
4903
|
c({ required: !0 }), a.reset();
|
|
4909
4904
|
}
|
|
4910
|
-
}) : Q && (
|
|
4905
|
+
}) : Q && (y(
|
|
4911
4906
|
Q.issues.reduce((le, fe) => ({
|
|
4912
4907
|
...le,
|
|
4913
4908
|
[fe.path.join(".")]: fe.message
|
|
4914
4909
|
}), {})
|
|
4915
4910
|
), console.warn("Invalid form data", Q));
|
|
4916
4911
|
};
|
|
4917
|
-
return Ir({ config: e.data, setFormValue: f }),
|
|
4912
|
+
return Ir({ config: e.data, setFormValue: f }), C ? v || m ? /* @__PURE__ */ n(Te.Loading, {}) : /* @__PURE__ */ n(qe.Root, { children: /* @__PURE__ */ w(Te.Main, { children: [
|
|
4918
4913
|
/* @__PURE__ */ n(Te.Title, { children: r(l("pages.settings.header.title")) }),
|
|
4919
4914
|
/* @__PURE__ */ n(
|
|
4920
4915
|
qe.Header,
|
|
@@ -4926,30 +4921,30 @@ const mr = () => /* @__PURE__ */ n(Hn, { backend: Xn, children: /* @__PURE__ */
|
|
|
4926
4921
|
{
|
|
4927
4922
|
startIcon: /* @__PURE__ */ n(Ge, {}),
|
|
4928
4923
|
disabled: d.required,
|
|
4929
|
-
onClick: (
|
|
4924
|
+
onClick: (x) => k(x, h),
|
|
4930
4925
|
children: r(l("pages.settings.actions.submit"))
|
|
4931
4926
|
}
|
|
4932
4927
|
) : null
|
|
4933
4928
|
}
|
|
4934
4929
|
),
|
|
4935
|
-
/* @__PURE__ */ n(qe.Content, { children: /* @__PURE__ */ n(at, { method: "POST", width: "auto", height: "auto", initialValues:
|
|
4936
|
-
|
|
4930
|
+
/* @__PURE__ */ n(qe.Content, { children: /* @__PURE__ */ n(at, { method: "POST", width: "auto", height: "auto", initialValues: h, children: ({ values: x, onChange: M }) => /* @__PURE__ */ n(
|
|
4931
|
+
$n.Provider,
|
|
4937
4932
|
{
|
|
4938
4933
|
value: {
|
|
4939
|
-
values:
|
|
4934
|
+
values: x,
|
|
4940
4935
|
onChange: M,
|
|
4941
4936
|
handleChange: T,
|
|
4942
4937
|
restartStatus: d,
|
|
4943
4938
|
setRestartStatus: c,
|
|
4944
4939
|
renderError: z,
|
|
4945
|
-
setFormValueItem:
|
|
4940
|
+
setFormValueItem: L
|
|
4946
4941
|
},
|
|
4947
4942
|
children: /* @__PURE__ */ w(P, { direction: "column", gap: 4, children: [
|
|
4948
4943
|
/* @__PURE__ */ n(wr, { setIsReloading: p }),
|
|
4949
|
-
/* @__PURE__ */ n(
|
|
4944
|
+
/* @__PURE__ */ n(Lr, {}),
|
|
4950
4945
|
/* @__PURE__ */ n(Sr, {}),
|
|
4951
4946
|
/* @__PURE__ */ n(Dr, {}),
|
|
4952
|
-
/* @__PURE__ */ n(
|
|
4947
|
+
/* @__PURE__ */ n(vr, { hasSettingsReadPermissions: b })
|
|
4953
4948
|
] })
|
|
4954
4949
|
}
|
|
4955
4950
|
) }) })
|
|
@@ -4979,7 +4974,7 @@ const Or = "navigation", en = "Navigation", ol = {
|
|
|
4979
4974
|
Component() {
|
|
4980
4975
|
return Br;
|
|
4981
4976
|
},
|
|
4982
|
-
permissions:
|
|
4977
|
+
permissions: $e.settings
|
|
4983
4978
|
}
|
|
4984
4979
|
]
|
|
4985
4980
|
), e.addMenuLink({
|
|
@@ -4992,7 +4987,7 @@ const Or = "navigation", en = "Navigation", ol = {
|
|
|
4992
4987
|
Component() {
|
|
4993
4988
|
return mr;
|
|
4994
4989
|
},
|
|
4995
|
-
permissions:
|
|
4990
|
+
permissions: $e.access,
|
|
4996
4991
|
position: 1
|
|
4997
4992
|
}), e.registerPlugin({
|
|
4998
4993
|
id: de,
|