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