@mattisvensson/strapi-plugin-webatlas 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/_chunks/{_baseConvert-DVIhGQH6.js.map → _baseConvert-B84_vf8X.js.map} +1 -1
- package/dist/_chunks/{_baseConvert-CDjccxdO.mjs.map → _baseConvert-C2SW1VHq.mjs.map} +1 -1
- package/dist/_chunks/de-4tL_cJTC.js +104 -0
- package/dist/_chunks/de-4tL_cJTC.js.map +1 -0
- package/dist/_chunks/de-C8PE3n3B.mjs +104 -0
- package/dist/_chunks/de-C8PE3n3B.mjs.map +1 -0
- package/dist/_chunks/en-Bg4z3fR7.js +104 -0
- package/dist/_chunks/en-Bg4z3fR7.js.map +1 -0
- package/dist/_chunks/en-CR1YZvJo.mjs +104 -0
- package/dist/_chunks/en-CR1YZvJo.mjs.map +1 -0
- package/dist/_chunks/{index-B-ABW-o6.js → index-B0XE_zRP.js} +298 -91
- package/dist/_chunks/index-B2Tiv3EK.mjs +92 -0
- package/dist/_chunks/{index-HHBjOGX5.mjs → index-B48CGofU.mjs} +70 -30
- package/dist/_chunks/{index-HHBjOGX5.mjs.map → index-B48CGofU.mjs.map} +1 -1
- package/dist/_chunks/{index-CAjBRbaH.js → index-B85fJxGa.js} +170 -77
- package/dist/_chunks/{index-Cs_oxZfX.js → index-BbM9Sn1t.js} +169 -108
- package/dist/_chunks/{index-BxuR805w.mjs → index-BocSkZOu.mjs} +57 -17
- package/dist/_chunks/{index-D_OdzeaU.mjs → index-C7B8QHDT.mjs} +296 -89
- package/dist/_chunks/{index-BjbgWZrg.mjs → index-CCiDvLAC.mjs} +171 -78
- package/dist/_chunks/index-CXzNr2cH.mjs +93 -0
- package/dist/_chunks/index-CXzNr2cH.mjs.map +1 -0
- package/dist/_chunks/{index-kz3NL7uv.js → index-Cd6y6nuf.js} +57 -8
- package/dist/_chunks/index-Cd6y6nuf.js.map +1 -0
- package/dist/_chunks/{index-CPE1Ne_e.js → index-Cf9ZIBLd.js} +171 -78
- package/dist/_chunks/index-Cf9ZIBLd.js.map +1 -0
- package/dist/_chunks/{index-yLrZAFVv.mjs → index-D981K4TK.mjs} +172 -79
- package/dist/_chunks/index-D981K4TK.mjs.map +1 -0
- package/dist/_chunks/{index-Djk_-mU6.js → index-DGb8ESH-.js} +56 -9
- package/dist/_chunks/{index-CuMn96qA.js → index-DYiJBXKE.js} +300 -93
- package/dist/_chunks/index-DYiJBXKE.js.map +1 -0
- package/dist/_chunks/{index-B7vKSyAn.js → index-DjZ3ZaVB.js} +60 -20
- package/dist/_chunks/{index-B7vKSyAn.js.map → index-DjZ3ZaVB.js.map} +1 -1
- package/dist/_chunks/{index-ChOgKZGK.mjs → index-DkhJl5mF.mjs} +298 -91
- package/dist/_chunks/index-DkhJl5mF.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +1 -1
- package/dist/admin/src/components/URLInfo.d.ts +2 -1
- package/dist/admin/src/components/modals/NavModal.d.ts +2 -1
- package/dist/admin/src/utils/getRouteType.d.ts +2 -0
- package/dist/admin/src/utils/index.d.ts +2 -1
- package/dist/server/index.js +23 -12
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +23 -12
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/content-types/index.d.ts +5 -5
- package/dist/server/src/content-types/navigation/index.d.ts +1 -1
- package/dist/server/src/content-types/navigation/schema.d.ts +1 -1
- package/dist/server/src/content-types/navitem/index.d.ts +3 -3
- package/dist/server/src/content-types/navitem/schema.d.ts +3 -3
- package/dist/server/src/content-types/route/index.d.ts +1 -1
- package/dist/server/src/content-types/route/schema.d.ts +1 -1
- package/dist/server/src/index.d.ts +5 -5
- package/package.json +1 -1
- package/dist/_chunks/_baseConvert-CDjccxdO.mjs +0 -859
- package/dist/_chunks/_baseConvert-DVIhGQH6.js +0 -858
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-B4KWt_jN.js.map +0 -1
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs.map +0 -1
- package/dist/_chunks/index-1VNPebOd.mjs +0 -45
- package/dist/_chunks/index-1VNPebOd.mjs.map +0 -1
- package/dist/_chunks/index-B5ilx6DT.mjs +0 -44
- package/dist/_chunks/index-CPE1Ne_e.js.map +0 -1
- package/dist/_chunks/index-ChOgKZGK.mjs.map +0 -1
- package/dist/_chunks/index-CuMn96qA.js.map +0 -1
- package/dist/_chunks/index-Djk_-mU6.js.map +0 -1
- package/dist/_chunks/index-yLrZAFVv.mjs.map +0 -1
|
@@ -4,9 +4,10 @@ import { Dialog, Typography, Button, Modal, Flex, SingleSelect, SingleSelectOpti
|
|
|
4
4
|
import { useFetchClient, Layouts } from "@strapi/strapi/admin";
|
|
5
5
|
import { useState, useEffect, createContext, useRef, useContext, useReducer, useCallback, useMemo, forwardRef } from "react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
-
import { u as useApi, d as debounce, a as duplicateCheck, t as transformToUrl, U as URLInfo } from "./index-
|
|
7
|
+
import { u as useApi, g as getTranslation, d as debounce, a as duplicateCheck, t as transformToUrl, U as URLInfo } from "./index-D981K4TK.mjs";
|
|
8
|
+
import { useIntl } from "react-intl";
|
|
8
9
|
import { C as Center, E as EmptyBox } from "./EmptyBox-7D4LrvdH.mjs";
|
|
9
|
-
import { c as commonjsGlobal, _ as _baseConvert } from "./_baseConvert-
|
|
10
|
+
import { c as commonjsGlobal, _ as _baseConvert } from "./_baseConvert-C2SW1VHq.mjs";
|
|
10
11
|
import { MeasuringStrategy, DndContext, closestCenter, DragOverlay } from "@dnd-kit/core";
|
|
11
12
|
import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
12
13
|
import { CSS } from "@dnd-kit/utilities";
|
|
@@ -51,6 +52,7 @@ function Delete({ variant, item, fetchNavigations }) {
|
|
|
51
52
|
const itemName = useRef(variant === "NavDelete" ? item.name : item.route.title);
|
|
52
53
|
const closeModalState = useRef(variant === "NavDelete" ? "NavOverview" : "");
|
|
53
54
|
const { setModalType } = useContext(ModalContext);
|
|
55
|
+
const { formatMessage } = useIntl();
|
|
54
56
|
const handleDelete = async () => {
|
|
55
57
|
try {
|
|
56
58
|
if (variant === "NavDelete") await deleteNavigation(item.documentId);
|
|
@@ -63,20 +65,44 @@ function Delete({ variant, item, fetchNavigations }) {
|
|
|
63
65
|
};
|
|
64
66
|
return /* @__PURE__ */ jsx(Dialog.Root, { defaultOpen: true, onClose: () => setModalType(closeModalState.current), children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
65
67
|
/* @__PURE__ */ jsxs(Dialog.Header, { children: [
|
|
66
|
-
|
|
68
|
+
formatMessage({
|
|
69
|
+
id: getTranslation("delete"),
|
|
70
|
+
defaultMessage: "Delete"
|
|
71
|
+
}),
|
|
72
|
+
': "',
|
|
67
73
|
itemName.current,
|
|
68
74
|
'"?'
|
|
69
75
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
/* @__PURE__ */ jsxs(Dialog.Body, { children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(Typography, { textAlign: "center", children: [
|
|
78
|
+
formatMessage({
|
|
79
|
+
id: getTranslation("modal.delete.message.start"),
|
|
80
|
+
defaultMessage: "You are about to delete the following"
|
|
81
|
+
}),
|
|
82
|
+
" ",
|
|
83
|
+
variant === "ItemDelete" ? formatMessage({
|
|
84
|
+
id: getTranslation("modal.delete.message.navItem"),
|
|
85
|
+
defaultMessage: "navigation item"
|
|
86
|
+
}) : formatMessage({
|
|
87
|
+
id: getTranslation("modal.delete.message.navigation"),
|
|
88
|
+
defaultMessage: "navigation"
|
|
89
|
+
})
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "center", fontWeight: "bold", style: { marginTop: 8, marginBottom: 8, fontSize: 20 }, children: itemName.current }),
|
|
92
|
+
/* @__PURE__ */ jsx(Typography, { textAlign: "center", children: formatMessage({
|
|
93
|
+
id: getTranslation("modal.delete.message.end"),
|
|
94
|
+
defaultMessage: "This can not be undone. Are you sure?"
|
|
95
|
+
}) })
|
|
96
|
+
] }),
|
|
77
97
|
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
78
|
-
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { onClick: () => setModalType(closeModalState.current), variant: "tertiary", children:
|
|
79
|
-
|
|
98
|
+
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { onClick: () => setModalType(closeModalState.current), variant: "tertiary", children: formatMessage({
|
|
99
|
+
id: getTranslation("modal.delete.cancelText"),
|
|
100
|
+
defaultMessage: "No, keep"
|
|
101
|
+
}) }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(Dialog.Action, { children: /* @__PURE__ */ jsx(Button, { variant: "danger-light", onClick: () => handleDelete(), startIcon: /* @__PURE__ */ jsx(Trash, {}), children: formatMessage({
|
|
103
|
+
id: getTranslation("modal.delete.confirmText"),
|
|
104
|
+
defaultMessage: "Yes, delete"
|
|
105
|
+
}) }) })
|
|
80
106
|
] })
|
|
81
107
|
] }) });
|
|
82
108
|
}
|
|
@@ -92,9 +118,11 @@ function NavModal({
|
|
|
92
118
|
loading,
|
|
93
119
|
modalToOpen,
|
|
94
120
|
footer,
|
|
95
|
-
currentModalType = null
|
|
121
|
+
currentModalType = null,
|
|
122
|
+
currentModalMode = "create"
|
|
96
123
|
}) {
|
|
97
124
|
const { setModalType } = useContext(ModalContext);
|
|
125
|
+
const { formatMessage } = useIntl();
|
|
98
126
|
return /* @__PURE__ */ jsxs(Modal.Root, { open: true, onOpenChange: () => setModalType(""), children: [
|
|
99
127
|
triggerText && /* @__PURE__ */ jsx(Modal.Trigger, { children: /* @__PURE__ */ jsx(Button, { variant: triggerVariant, children: triggerText }) }),
|
|
100
128
|
/* @__PURE__ */ jsxs(Modal.Content, { children: [
|
|
@@ -111,16 +139,25 @@ function NavModal({
|
|
|
111
139
|
/* @__PURE__ */ jsx(Modal.Footer, { children: footer ? footer : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
140
|
/* @__PURE__ */ jsx(Modal.Close, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", type: "button", children: closeText }) }),
|
|
113
141
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
114
|
-
currentModalType && /* @__PURE__ */ jsxs(
|
|
142
|
+
currentModalType && currentModalMode === "create" && /* @__PURE__ */ jsxs(
|
|
115
143
|
SingleSelect,
|
|
116
144
|
{
|
|
117
145
|
onChange: (value) => setModalType(value),
|
|
118
146
|
placeholder: "Choose item type",
|
|
119
147
|
value: currentModalType || "",
|
|
120
148
|
children: [
|
|
121
|
-
/* @__PURE__ */ jsx(SingleSelectOption, { value: "ItemCreate", children:
|
|
122
|
-
|
|
123
|
-
|
|
149
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "ItemCreate", children: formatMessage({
|
|
150
|
+
id: getTranslation("modal.navModal.internalItem"),
|
|
151
|
+
defaultMessage: "Internal item"
|
|
152
|
+
}) }),
|
|
153
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "WrapperCreate", children: formatMessage({
|
|
154
|
+
id: getTranslation("modal.navModal.wrapperItem"),
|
|
155
|
+
defaultMessage: "Wrapper item"
|
|
156
|
+
}) }),
|
|
157
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "ExternalCreate", children: formatMessage({
|
|
158
|
+
id: getTranslation("modal.navModal.externalItem"),
|
|
159
|
+
defaultMessage: "External item"
|
|
160
|
+
}) })
|
|
124
161
|
]
|
|
125
162
|
}
|
|
126
163
|
),
|
|
@@ -140,6 +177,7 @@ function NavCreate() {
|
|
|
140
177
|
const [name, setName] = useState("");
|
|
141
178
|
const [isActive, setIsActive] = useState(true);
|
|
142
179
|
const [loading, setLoading] = useState(false);
|
|
180
|
+
const { formatMessage } = useIntl();
|
|
143
181
|
const createNavigation = async () => {
|
|
144
182
|
setLoading(true);
|
|
145
183
|
try {
|
|
@@ -155,14 +193,17 @@ function NavCreate() {
|
|
|
155
193
|
return /* @__PURE__ */ jsx(
|
|
156
194
|
NavModal,
|
|
157
195
|
{
|
|
158
|
-
confirmText: "Create",
|
|
159
|
-
closeText: "Cancel",
|
|
160
|
-
titleText: "Create new navigation",
|
|
161
|
-
loadingText: "Creating",
|
|
196
|
+
confirmText: formatMessage({ id: getTranslation("modal.navCreate.confirmText"), defaultMessage: "Create" }),
|
|
197
|
+
closeText: formatMessage({ id: getTranslation("modal.navCreate.closeText"), defaultMessage: "Cancel" }),
|
|
198
|
+
titleText: formatMessage({ id: getTranslation("modal.navCreate.titleText"), defaultMessage: "Create new navigation" }),
|
|
199
|
+
loadingText: formatMessage({ id: getTranslation("modal.navCreate.loadingText"), defaultMessage: "Creating" }),
|
|
162
200
|
onConfirm: createNavigation,
|
|
163
201
|
loading,
|
|
164
202
|
children: /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
165
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
203
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
204
|
+
id: getTranslation("modal.nameField.label"),
|
|
205
|
+
defaultMessage: "Name"
|
|
206
|
+
}) }),
|
|
166
207
|
/* @__PURE__ */ jsx(
|
|
167
208
|
Field.Input,
|
|
168
209
|
{
|
|
@@ -181,6 +222,7 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
181
222
|
const [visible, setVisible] = useState(item.visible);
|
|
182
223
|
const [loading, setLoading] = useState(false);
|
|
183
224
|
const { updateNavigation } = useApi();
|
|
225
|
+
const { formatMessage } = useIntl();
|
|
184
226
|
const updateNav = async () => {
|
|
185
227
|
setLoading(true);
|
|
186
228
|
try {
|
|
@@ -196,20 +238,29 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
196
238
|
return /* @__PURE__ */ jsx(
|
|
197
239
|
NavModal,
|
|
198
240
|
{
|
|
199
|
-
confirmText: "Create",
|
|
200
|
-
closeText: "Cancel",
|
|
201
|
-
titleText:
|
|
202
|
-
loadingText: "
|
|
241
|
+
confirmText: formatMessage({ id: getTranslation("modal.navEdit.confirmText"), defaultMessage: "Create" }),
|
|
242
|
+
closeText: formatMessage({ id: getTranslation("modal.navEdit.closeText"), defaultMessage: "Cancel" }),
|
|
243
|
+
titleText: formatMessage({ id: getTranslation("modal.navEdit.titleText"), defaultMessage: "Edit navigation:" }) + " " + item.name,
|
|
244
|
+
loadingText: formatMessage({ id: getTranslation("modal.navEdit.loadingText"), defaultMessage: "Updating" }),
|
|
203
245
|
onConfirm: updateNav,
|
|
204
246
|
loading,
|
|
205
247
|
modalToOpen: "NavOverview",
|
|
206
248
|
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
207
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setModalType("NavOverview"), variant: "tertiary", children:
|
|
208
|
-
|
|
249
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setModalType("NavOverview"), variant: "tertiary", children: formatMessage({
|
|
250
|
+
id: getTranslation("modal.navEdit.closeText"),
|
|
251
|
+
defaultMessage: "Cancel"
|
|
252
|
+
}) }),
|
|
253
|
+
/* @__PURE__ */ jsx(Button, { children: formatMessage({
|
|
254
|
+
id: getTranslation("modal.navEdit.confirmText"),
|
|
255
|
+
defaultMessage: "Update"
|
|
256
|
+
}) })
|
|
209
257
|
] }),
|
|
210
258
|
children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
|
|
211
259
|
/* @__PURE__ */ jsx(Grid.Item, { s: 12, m: 6, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
212
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
260
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
261
|
+
id: getTranslation("modal.nameField.label"),
|
|
262
|
+
defaultMessage: "Name"
|
|
263
|
+
}) }),
|
|
213
264
|
/* @__PURE__ */ jsx(
|
|
214
265
|
Field.Input,
|
|
215
266
|
{
|
|
@@ -220,8 +271,25 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
220
271
|
)
|
|
221
272
|
] }) }) }),
|
|
222
273
|
/* @__PURE__ */ jsx(Grid.Item, { s: 12, m: 6, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
223
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
224
|
-
|
|
274
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
275
|
+
id: getTranslation("modal.activeField.label"),
|
|
276
|
+
defaultMessage: "Active"
|
|
277
|
+
}) }),
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
Toggle,
|
|
280
|
+
{
|
|
281
|
+
onLabel: formatMessage({
|
|
282
|
+
id: getTranslation("modal.activeField.onLabel"),
|
|
283
|
+
defaultMessage: "Yes"
|
|
284
|
+
}),
|
|
285
|
+
offLabel: formatMessage({
|
|
286
|
+
id: getTranslation("modal.activeField.offLabel"),
|
|
287
|
+
defaultMessage: "No"
|
|
288
|
+
}),
|
|
289
|
+
checked: visible,
|
|
290
|
+
onChange: () => setVisible((prev) => !prev)
|
|
291
|
+
}
|
|
292
|
+
)
|
|
225
293
|
] }) }) })
|
|
226
294
|
] })
|
|
227
295
|
}
|
|
@@ -230,6 +298,7 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
230
298
|
function NavOverview({ navigations, setActionItem }) {
|
|
231
299
|
const { setModalType } = useContext(ModalContext);
|
|
232
300
|
const { selectedNavigation, setSelectedNavigation } = useContext(SelectedNavigationContext);
|
|
301
|
+
const { formatMessage } = useIntl();
|
|
233
302
|
const handleSelect = (nav) => {
|
|
234
303
|
setSelectedNavigation(nav);
|
|
235
304
|
setModalType("");
|
|
@@ -245,18 +314,48 @@ function NavOverview({ navigations, setActionItem }) {
|
|
|
245
314
|
return /* @__PURE__ */ jsx(
|
|
246
315
|
NavModal,
|
|
247
316
|
{
|
|
248
|
-
confirmText:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
317
|
+
confirmText: formatMessage({
|
|
318
|
+
id: getTranslation("modal.navOverview.confirmText"),
|
|
319
|
+
defaultMessage: "New navigation"
|
|
320
|
+
}),
|
|
321
|
+
closeText: formatMessage({
|
|
322
|
+
id: getTranslation("modal.navOverview.closeText"),
|
|
323
|
+
defaultMessage: "Cancel"
|
|
324
|
+
}),
|
|
325
|
+
titleText: formatMessage({
|
|
326
|
+
id: getTranslation("modal.navOverview.titleText"),
|
|
327
|
+
defaultMessage: "Navigation overview"
|
|
328
|
+
}),
|
|
329
|
+
loadingText: formatMessage({
|
|
330
|
+
id: getTranslation("modal.navOverview.loadingText"),
|
|
331
|
+
defaultMessage: "Creating"
|
|
332
|
+
}),
|
|
252
333
|
modalToOpen: "NavCreate",
|
|
253
334
|
children: navigations.length > 0 ? navigations.map((nav, index) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
254
335
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
255
336
|
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: nav.name }),
|
|
256
337
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
257
|
-
/* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(Trash, {}), variant: "danger-light", onClick: () => handleDelete(nav), children:
|
|
258
|
-
|
|
259
|
-
|
|
338
|
+
/* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(Trash, {}), variant: "danger-light", onClick: () => handleDelete(nav), children: formatMessage({
|
|
339
|
+
id: getTranslation("delete"),
|
|
340
|
+
defaultMessage: "Delete"
|
|
341
|
+
}) }),
|
|
342
|
+
/* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(Pencil, {}), variant: "secondary", onClick: () => handleEdit(nav), children: formatMessage({
|
|
343
|
+
id: getTranslation("edit"),
|
|
344
|
+
defaultMessage: "Edit"
|
|
345
|
+
}) }),
|
|
346
|
+
/* @__PURE__ */ jsx(
|
|
347
|
+
Button,
|
|
348
|
+
{
|
|
349
|
+
startIcon: /* @__PURE__ */ jsx(Check, {}),
|
|
350
|
+
variant: "primary",
|
|
351
|
+
onClick: () => handleSelect(nav),
|
|
352
|
+
disabled: selectedNavigation ? selectedNavigation.slug === nav.slug : false,
|
|
353
|
+
children: formatMessage({
|
|
354
|
+
id: getTranslation("select"),
|
|
355
|
+
defaultMessage: "Select"
|
|
356
|
+
})
|
|
357
|
+
}
|
|
358
|
+
)
|
|
260
359
|
] })
|
|
261
360
|
] }, `box-${nav.slug}`),
|
|
262
361
|
navigations.length - 1 !== index && /* @__PURE__ */ jsx(
|
|
@@ -267,7 +366,10 @@ function NavOverview({ navigations, setActionItem }) {
|
|
|
267
366
|
children: /* @__PURE__ */ jsx(Divider, {})
|
|
268
367
|
}
|
|
269
368
|
)
|
|
270
|
-
] }, nav.id)) : /* @__PURE__ */ jsx(Center, { height: 100, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children:
|
|
369
|
+
] }, nav.id)) : /* @__PURE__ */ jsx(Center, { height: 100, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
|
|
370
|
+
id: getTranslation("navigation.page.emptyNavigation"),
|
|
371
|
+
defaultMessage: "You have no navigations yet..."
|
|
372
|
+
}) }) })
|
|
271
373
|
}
|
|
272
374
|
);
|
|
273
375
|
}
|
|
@@ -3523,6 +3625,7 @@ function ExternalItemComponent({
|
|
|
3523
3625
|
selectedNavigation,
|
|
3524
3626
|
parentDocumentId
|
|
3525
3627
|
}) {
|
|
3628
|
+
const { formatMessage } = useIntl();
|
|
3526
3629
|
useEffect(() => {
|
|
3527
3630
|
if (variant !== "ExternalEdit" || !item) return;
|
|
3528
3631
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -3558,20 +3661,27 @@ function ExternalItemComponent({
|
|
|
3558
3661
|
return /* @__PURE__ */ jsx(
|
|
3559
3662
|
NavModal,
|
|
3560
3663
|
{
|
|
3561
|
-
confirmText: variant === "ExternalCreate" ? "Add" : "Save",
|
|
3562
|
-
closeText: "Cancel",
|
|
3563
|
-
titleText: variant === "ExternalCreate" ? "Create new external item" : `Edit external route "${navItemState.title}"
|
|
3564
|
-
loadingText: variant === "ExternalCreate" ? "Adding" : "Saving",
|
|
3664
|
+
confirmText: variant === "ExternalCreate" ? formatMessage({ id: getTranslation("add"), defaultMessage: "Add" }) : formatMessage({ id: getTranslation("save"), defaultMessage: "Save" }),
|
|
3665
|
+
closeText: formatMessage({ id: getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
3666
|
+
titleText: variant === "ExternalCreate" ? formatMessage({ id: getTranslation("modal.externalItem.titleText.create"), defaultMessage: "Create new external item" }) : formatMessage({ id: getTranslation("modal.externalItem.titleText.edit"), defaultMessage: `Edit external route "${navItemState.title}"` }),
|
|
3667
|
+
loadingText: variant === "ExternalCreate" ? formatMessage({ id: getTranslation("modal.externalItem.loadingText.create"), defaultMessage: "Adding" }) : formatMessage({ id: getTranslation("modal.externalItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
3565
3668
|
onConfirm: addItem,
|
|
3566
3669
|
modalToOpen: "",
|
|
3567
3670
|
currentModalType: "ExternalCreate",
|
|
3671
|
+
currentModalMode: variant === "ExternalCreate" ? "create" : "edit",
|
|
3568
3672
|
children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 8, children: [
|
|
3569
3673
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3570
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3674
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3675
|
+
id: getTranslation("modal.item.titleField.label"),
|
|
3676
|
+
defaultMessage: "Title"
|
|
3677
|
+
}) }),
|
|
3571
3678
|
/* @__PURE__ */ jsx(
|
|
3572
3679
|
Field.Input,
|
|
3573
3680
|
{
|
|
3574
|
-
placeholder:
|
|
3681
|
+
placeholder: formatMessage({
|
|
3682
|
+
id: getTranslation("modal.item.titleField.placeholder"),
|
|
3683
|
+
defaultMessage: "e.g. About us"
|
|
3684
|
+
}),
|
|
3575
3685
|
name: "title",
|
|
3576
3686
|
value: navItemState.title || "",
|
|
3577
3687
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -3580,13 +3690,18 @@ function ExternalItemComponent({
|
|
|
3580
3690
|
)
|
|
3581
3691
|
] }) }) }),
|
|
3582
3692
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3583
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3693
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3694
|
+
id: getTranslation("modal.item.routeField.label"),
|
|
3695
|
+
defaultMessage: "Path"
|
|
3696
|
+
}) }),
|
|
3584
3697
|
/* @__PURE__ */ jsx(
|
|
3585
3698
|
Field.Input,
|
|
3586
3699
|
{
|
|
3587
3700
|
required: true,
|
|
3588
|
-
placeholder:
|
|
3589
|
-
|
|
3701
|
+
placeholder: formatMessage({
|
|
3702
|
+
id: getTranslation("modal.externalItem.routeField.placeholder"),
|
|
3703
|
+
defaultMessage: "e.g. https://example.com"
|
|
3704
|
+
}),
|
|
3590
3705
|
name: "slug",
|
|
3591
3706
|
value: path?.value || "",
|
|
3592
3707
|
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value })
|
|
@@ -3624,6 +3739,7 @@ function ItemCreateComponent({
|
|
|
3624
3739
|
parentId
|
|
3625
3740
|
}) {
|
|
3626
3741
|
const [loading, setLoading] = useState(false);
|
|
3742
|
+
const { formatMessage } = useIntl();
|
|
3627
3743
|
useEffect(() => {
|
|
3628
3744
|
if (!entities) return;
|
|
3629
3745
|
setAvailableEntities(entities);
|
|
@@ -3687,10 +3803,10 @@ function ItemCreateComponent({
|
|
|
3687
3803
|
return /* @__PURE__ */ jsxs(
|
|
3688
3804
|
NavModal,
|
|
3689
3805
|
{
|
|
3690
|
-
confirmText: "Add",
|
|
3691
|
-
closeText: "Cancel",
|
|
3692
|
-
titleText: "Add new navigation item",
|
|
3693
|
-
loadingText: "Creating",
|
|
3806
|
+
confirmText: formatMessage({ id: getTranslation("add"), defaultMessage: "Add" }),
|
|
3807
|
+
closeText: formatMessage({ id: getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
3808
|
+
titleText: formatMessage({ id: getTranslation("modal.internalItem.titleText.create"), defaultMessage: "Add new navigation item" }),
|
|
3809
|
+
loadingText: formatMessage({ id: getTranslation("modal.internalItem.loadingText.create"), defaultMessage: "Creating" }),
|
|
3694
3810
|
onConfirm: addItem,
|
|
3695
3811
|
loading,
|
|
3696
3812
|
modalToOpen: "",
|
|
@@ -3698,12 +3814,18 @@ function ItemCreateComponent({
|
|
|
3698
3814
|
children: [
|
|
3699
3815
|
/* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
|
|
3700
3816
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3701
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3817
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3818
|
+
id: getTranslation("modal.internalItem.contentType.label"),
|
|
3819
|
+
defaultMessage: "Content Type"
|
|
3820
|
+
}) }),
|
|
3702
3821
|
/* @__PURE__ */ jsx(
|
|
3703
3822
|
SingleSelect,
|
|
3704
3823
|
{
|
|
3705
3824
|
value: selectedContentType ? selectedContentType.label : "",
|
|
3706
|
-
placeholder:
|
|
3825
|
+
placeholder: formatMessage({
|
|
3826
|
+
id: getTranslation("modal.internalItem.contentType.placeholder"),
|
|
3827
|
+
defaultMessage: "Select a content type"
|
|
3828
|
+
}),
|
|
3707
3829
|
onChange: (value) => {
|
|
3708
3830
|
const [contentType] = availableEntities.filter((group) => group.label === value);
|
|
3709
3831
|
if (contentType) {
|
|
@@ -3717,12 +3839,18 @@ function ItemCreateComponent({
|
|
|
3717
3839
|
)
|
|
3718
3840
|
] }) }) }),
|
|
3719
3841
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3720
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3842
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3843
|
+
id: getTranslation("modal.internalItem.entity.label"),
|
|
3844
|
+
defaultMessage: "Entity"
|
|
3845
|
+
}) }),
|
|
3721
3846
|
/* @__PURE__ */ jsx(
|
|
3722
3847
|
SingleSelect,
|
|
3723
3848
|
{
|
|
3724
3849
|
value: selectedEntity ? selectedEntity.id : "",
|
|
3725
|
-
placeholder:
|
|
3850
|
+
placeholder: formatMessage({
|
|
3851
|
+
id: getTranslation("modal.internalItem.entity.placeholder"),
|
|
3852
|
+
defaultMessage: "Select an entity"
|
|
3853
|
+
}),
|
|
3726
3854
|
onChange: (value) => {
|
|
3727
3855
|
const flatEntities = availableEntities.flatMap((group) => group.entities);
|
|
3728
3856
|
const route = flatEntities.find((route2) => route2.id === Number(value));
|
|
@@ -3744,11 +3872,17 @@ function ItemCreateComponent({
|
|
|
3744
3872
|
/* @__PURE__ */ jsx(Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsx(Divider, {}) }),
|
|
3745
3873
|
/* @__PURE__ */ jsxs(Grid.Root, { gap: 4, paddingBottom: 6, children: [
|
|
3746
3874
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3747
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3875
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3876
|
+
id: getTranslation("modal.item.titleField.label"),
|
|
3877
|
+
defaultMessage: "Title"
|
|
3878
|
+
}) }),
|
|
3748
3879
|
/* @__PURE__ */ jsx(
|
|
3749
3880
|
Field.Input,
|
|
3750
3881
|
{
|
|
3751
|
-
placeholder:
|
|
3882
|
+
placeholder: formatMessage({
|
|
3883
|
+
id: getTranslation("modal.item.titleField.placeholder"),
|
|
3884
|
+
defaultMessage: "e.g. About us"
|
|
3885
|
+
}),
|
|
3752
3886
|
name: "title",
|
|
3753
3887
|
value: navItemState.title || "",
|
|
3754
3888
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -3758,13 +3892,18 @@ function ItemCreateComponent({
|
|
|
3758
3892
|
] }) }) }),
|
|
3759
3893
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
|
|
3760
3894
|
/* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
3761
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
3895
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
3896
|
+
id: getTranslation("modal.item.routeField.label"),
|
|
3897
|
+
defaultMessage: "Route"
|
|
3898
|
+
}) }),
|
|
3762
3899
|
/* @__PURE__ */ jsx(
|
|
3763
3900
|
Field.Input,
|
|
3764
3901
|
{
|
|
3765
3902
|
required: true,
|
|
3766
|
-
placeholder:
|
|
3767
|
-
|
|
3903
|
+
placeholder: formatMessage({
|
|
3904
|
+
id: getTranslation("modal.item.routeField.placeholder"),
|
|
3905
|
+
defaultMessage: "e.g. about/"
|
|
3906
|
+
}),
|
|
3768
3907
|
name: "slug",
|
|
3769
3908
|
value: path?.value || "",
|
|
3770
3909
|
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
@@ -9282,6 +9421,7 @@ function ItemEditComponent({
|
|
|
9282
9421
|
debouncedCheckUrl,
|
|
9283
9422
|
setModalType
|
|
9284
9423
|
}) {
|
|
9424
|
+
const { formatMessage } = useIntl();
|
|
9285
9425
|
useEffect(() => {
|
|
9286
9426
|
dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: item.route.fullPath });
|
|
9287
9427
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -9340,17 +9480,21 @@ function ItemEditComponent({
|
|
|
9340
9480
|
return /* @__PURE__ */ jsxs(
|
|
9341
9481
|
NavModal,
|
|
9342
9482
|
{
|
|
9343
|
-
confirmText: "Save",
|
|
9344
|
-
closeText: "Cancel",
|
|
9345
|
-
titleText:
|
|
9346
|
-
loadingText: "Saving",
|
|
9483
|
+
confirmText: formatMessage({ id: getTranslation("save"), defaultMessage: "Save" }),
|
|
9484
|
+
closeText: formatMessage({ id: getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
9485
|
+
titleText: `${formatMessage({ id: getTranslation("edit"), defaultMessage: "Edit" })} ${selectedContentType.label} "${item.route.title}"`,
|
|
9486
|
+
loadingText: formatMessage({ id: getTranslation("modal.internalItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
9347
9487
|
onConfirm: updateItem,
|
|
9348
9488
|
modalToOpen: "",
|
|
9349
9489
|
currentModalType: "ItemCreate",
|
|
9490
|
+
currentModalMode: "edit",
|
|
9350
9491
|
children: [
|
|
9351
9492
|
/* @__PURE__ */ jsxs(Grid.Root, { gap: 8, children: [
|
|
9352
9493
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
9353
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
9494
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
9495
|
+
id: getTranslation("modal.internalItem.contentType.label"),
|
|
9496
|
+
defaultMessage: "Content Type"
|
|
9497
|
+
}) }),
|
|
9354
9498
|
/* @__PURE__ */ jsx(
|
|
9355
9499
|
Field.Input,
|
|
9356
9500
|
{
|
|
@@ -9360,7 +9504,10 @@ function ItemEditComponent({
|
|
|
9360
9504
|
)
|
|
9361
9505
|
] }) }) }),
|
|
9362
9506
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
9363
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
9507
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
9508
|
+
id: getTranslation("modal.internalItem.entity.label"),
|
|
9509
|
+
defaultMessage: "Entity"
|
|
9510
|
+
}) }),
|
|
9364
9511
|
/* @__PURE__ */ jsx(
|
|
9365
9512
|
Field.Input,
|
|
9366
9513
|
{
|
|
@@ -9373,11 +9520,18 @@ function ItemEditComponent({
|
|
|
9373
9520
|
/* @__PURE__ */ jsx(Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsx(Divider, {}) }),
|
|
9374
9521
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 8, paddingBottom: 6, children: [
|
|
9375
9522
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
9376
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
9523
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
9524
|
+
id: getTranslation("modal.item.titleField.label"),
|
|
9525
|
+
defaultMessage: "Title"
|
|
9526
|
+
}) }),
|
|
9377
9527
|
/* @__PURE__ */ jsx(
|
|
9378
9528
|
Field.Input,
|
|
9379
9529
|
{
|
|
9380
|
-
placeholder:
|
|
9530
|
+
placeholder: formatMessage({
|
|
9531
|
+
id: getTranslation("modal.item.titleField.placeholder"),
|
|
9532
|
+
defaultMessage: "e.g. About us"
|
|
9533
|
+
}),
|
|
9534
|
+
name: "title",
|
|
9381
9535
|
value: navItemState.title || "",
|
|
9382
9536
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
9383
9537
|
required: true
|
|
@@ -9386,11 +9540,17 @@ function ItemEditComponent({
|
|
|
9386
9540
|
] }) }) }),
|
|
9387
9541
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxs(Box, { width: "100%", children: [
|
|
9388
9542
|
/* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
9389
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
9543
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
9544
|
+
id: getTranslation("modal.item.routeField.label"),
|
|
9545
|
+
defaultMessage: "Route"
|
|
9546
|
+
}) }),
|
|
9390
9547
|
/* @__PURE__ */ jsx(
|
|
9391
9548
|
Field.Input,
|
|
9392
9549
|
{
|
|
9393
|
-
placeholder:
|
|
9550
|
+
placeholder: formatMessage({
|
|
9551
|
+
id: getTranslation("modal.item.routeField.placeholder"),
|
|
9552
|
+
defaultMessage: "e.g. about/"
|
|
9553
|
+
}),
|
|
9394
9554
|
value: path.value || "",
|
|
9395
9555
|
onChange: (e) => handlePathChange(e.target.value),
|
|
9396
9556
|
onBlur: (e) => {
|
|
@@ -9422,6 +9582,7 @@ function WrapperItemComponent({
|
|
|
9422
9582
|
selectedNavigation,
|
|
9423
9583
|
parentDocumentId
|
|
9424
9584
|
}) {
|
|
9585
|
+
const { formatMessage } = useIntl();
|
|
9425
9586
|
useEffect(() => {
|
|
9426
9587
|
if (variant !== "WrapperEdit" || !item) return;
|
|
9427
9588
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -9457,19 +9618,26 @@ function WrapperItemComponent({
|
|
|
9457
9618
|
return /* @__PURE__ */ jsx(
|
|
9458
9619
|
NavModal,
|
|
9459
9620
|
{
|
|
9460
|
-
confirmText: variant === "WrapperCreate" ? "Add" : "Save",
|
|
9461
|
-
closeText: "Cancel",
|
|
9462
|
-
titleText: variant === "WrapperCreate" ? "Create new wrapper item" :
|
|
9463
|
-
loadingText: variant === "WrapperCreate" ? "Adding" : "Saving",
|
|
9621
|
+
confirmText: variant === "WrapperCreate" ? formatMessage({ id: getTranslation("add"), defaultMessage: "Add" }) : formatMessage({ id: getTranslation("save"), defaultMessage: "Save" }),
|
|
9622
|
+
closeText: formatMessage({ id: getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
9623
|
+
titleText: variant === "WrapperCreate" ? formatMessage({ id: getTranslation("modal.wrapperItem.titleText.create"), defaultMessage: "Create new wrapper item" }) : formatMessage({ id: getTranslation("modal.wrapperItem.titleText.edit"), defaultMessage: "Edit wrapper item:" }) + ` "${navItemState.title}"`,
|
|
9624
|
+
loadingText: variant === "WrapperCreate" ? formatMessage({ id: getTranslation("modal.wrapperItem.loadingText.create"), defaultMessage: "Adding" }) : formatMessage({ id: getTranslation("modal.wrapperItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
9464
9625
|
onConfirm: addItem,
|
|
9465
9626
|
modalToOpen: "",
|
|
9466
9627
|
currentModalType: "WrapperCreate",
|
|
9628
|
+
currentModalMode: variant === "WrapperCreate" ? "create" : "edit",
|
|
9467
9629
|
children: /* @__PURE__ */ jsx(Grid.Root, { gap: 8, children: /* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(Field.Root, { children: [
|
|
9468
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
9630
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
9631
|
+
id: getTranslation("modal.wrapperItem.titleField.label"),
|
|
9632
|
+
defaultMessage: "Title"
|
|
9633
|
+
}) }),
|
|
9469
9634
|
/* @__PURE__ */ jsx(
|
|
9470
9635
|
Field.Input,
|
|
9471
9636
|
{
|
|
9472
|
-
placeholder:
|
|
9637
|
+
placeholder: formatMessage({
|
|
9638
|
+
id: getTranslation("modal.wrapperItem.titleField.placeholder"),
|
|
9639
|
+
defaultMessage: "e.g. About us"
|
|
9640
|
+
}),
|
|
9473
9641
|
name: "title",
|
|
9474
9642
|
value: navItemState.title || "",
|
|
9475
9643
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -9484,13 +9652,20 @@ const WrapperItem = withModalSharedLogic(WrapperItemComponent);
|
|
|
9484
9652
|
function Header({ navigations }) {
|
|
9485
9653
|
const { setModalType } = useContext(ModalContext);
|
|
9486
9654
|
const { selectedNavigation, setSelectedNavigation } = useContext(SelectedNavigationContext);
|
|
9655
|
+
const { formatMessage } = useIntl();
|
|
9487
9656
|
return /* @__PURE__ */ jsxs(Flex, { gap: 4, children: [
|
|
9488
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => setModalType("NavOverview"), children:
|
|
9657
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => setModalType("NavOverview"), children: formatMessage({
|
|
9658
|
+
id: getTranslation("manage"),
|
|
9659
|
+
defaultMessage: "Manage"
|
|
9660
|
+
}) }),
|
|
9489
9661
|
/* @__PURE__ */ jsx(
|
|
9490
9662
|
SingleSelect,
|
|
9491
9663
|
{
|
|
9492
9664
|
value: selectedNavigation ? selectedNavigation.slug : "",
|
|
9493
|
-
placeholder:
|
|
9665
|
+
placeholder: formatMessage({
|
|
9666
|
+
id: getTranslation("navigation.page.selectNavigation"),
|
|
9667
|
+
defaultMessage: "Select Navigation"
|
|
9668
|
+
}),
|
|
9494
9669
|
onChange: (value) => {
|
|
9495
9670
|
const navItem = navigations.find((nav) => nav.slug === value);
|
|
9496
9671
|
if (navItem) {
|
|
@@ -9560,6 +9735,7 @@ const RouteItem = forwardRef(({ item, setParentId, setActionItem, ghost, depth,
|
|
|
9560
9735
|
if (!item || !item.route) return null;
|
|
9561
9736
|
const { setModalType } = useContext(ModalContext);
|
|
9562
9737
|
const { get } = useFetchClient();
|
|
9738
|
+
const { formatMessage } = useIntl();
|
|
9563
9739
|
const [itemStatus, setItemStatus] = useState({
|
|
9564
9740
|
status: "published",
|
|
9565
9741
|
variant: "primary",
|
|
@@ -9672,9 +9848,18 @@ const RouteItem = forwardRef(({ item, setParentId, setActionItem, ghost, depth,
|
|
|
9672
9848
|
/* @__PURE__ */ jsxs(Flex, { direction: "row", gap: 4, children: [
|
|
9673
9849
|
type === "internal" && /* @__PURE__ */ jsx(Status, { variant: itemStatus.variant, size: "S", children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: itemStatus.textColor, children: itemStatus.status }) }),
|
|
9674
9850
|
/* @__PURE__ */ jsxs(SimpleMenu, { label: "Notifications", tag: IconButton, icon: /* @__PURE__ */ jsx(More, {}), children: [
|
|
9675
|
-
/* @__PURE__ */ jsx(MenuItem, { onClick: () => handleEdit(), children:
|
|
9676
|
-
|
|
9677
|
-
|
|
9851
|
+
/* @__PURE__ */ jsx(MenuItem, { onClick: () => handleEdit(), children: formatMessage({
|
|
9852
|
+
id: getTranslation("edit"),
|
|
9853
|
+
defaultMessage: "Edit"
|
|
9854
|
+
}) }),
|
|
9855
|
+
/* @__PURE__ */ jsx(MenuItem, { onClick: () => handleAddChildren(), children: formatMessage({
|
|
9856
|
+
id: getTranslation("navigation.page.navItem.addChildren"),
|
|
9857
|
+
defaultMessage: "Add children"
|
|
9858
|
+
}) }),
|
|
9859
|
+
/* @__PURE__ */ jsx(MenuItem, { onClick: () => handleDelete(), children: /* @__PURE__ */ jsx(Typography, { textColor: "danger600", children: formatMessage({
|
|
9860
|
+
id: getTranslation("delete"),
|
|
9861
|
+
defaultMessage: "Delete"
|
|
9862
|
+
}) }) })
|
|
9678
9863
|
] })
|
|
9679
9864
|
] })
|
|
9680
9865
|
] })
|
|
@@ -9729,6 +9914,7 @@ const Navigation = () => {
|
|
|
9729
9914
|
const [activeId, setActiveId] = useState(null);
|
|
9730
9915
|
const [overId, setOverId] = useState(null);
|
|
9731
9916
|
const [offsetLeft, setOffsetLeft] = useState(0);
|
|
9917
|
+
const { formatMessage } = useIntl();
|
|
9732
9918
|
if (!navigations) return null;
|
|
9733
9919
|
useEffect(() => {
|
|
9734
9920
|
if (modalType === "NavOverview" || modalType === "") {
|
|
@@ -9841,21 +10027,33 @@ const Navigation = () => {
|
|
|
9841
10027
|
/* @__PURE__ */ jsx(
|
|
9842
10028
|
Layouts.Header,
|
|
9843
10029
|
{
|
|
9844
|
-
title:
|
|
9845
|
-
|
|
10030
|
+
title: formatMessage({
|
|
10031
|
+
id: getTranslation("navigation.page.title"),
|
|
10032
|
+
defaultMessage: "Navigation"
|
|
10033
|
+
}) + (selectedNavigation ? `: ${selectedNavigation.name}` : ""),
|
|
10034
|
+
subtitle: /* @__PURE__ */ jsx(Typography, { textColor: "neutral500", children: selectedNavigation ? `ID: ${selectedNavigation.id} | DocumentID : ${selectedNavigation.documentId}` : formatMessage({
|
|
10035
|
+
id: getTranslation("navigation.page.subtitle.noNavigationSelected"),
|
|
10036
|
+
defaultMessage: "No navigation selected"
|
|
10037
|
+
}) }),
|
|
9846
10038
|
primaryAction: /* @__PURE__ */ jsx(Header, { navigations })
|
|
9847
10039
|
}
|
|
9848
10040
|
),
|
|
9849
10041
|
/* @__PURE__ */ jsxs(Layouts.Content, { children: [
|
|
9850
|
-
/* @__PURE__ */ jsxs(Flex, { gap: 4, paddingBottom: 6, justifyContent: "flex-end", children: [
|
|
9851
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsx(Plus, {}), onClick: () => setModalType("ItemCreate"), children:
|
|
10042
|
+
selectedNavigation && /* @__PURE__ */ jsxs(Flex, { gap: 4, paddingBottom: 6, justifyContent: "flex-end", children: [
|
|
10043
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsx(Plus, {}), onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
10044
|
+
id: getTranslation("navigation.page.newItemButton"),
|
|
10045
|
+
defaultMessage: "New Item"
|
|
10046
|
+
}) }),
|
|
9852
10047
|
/* @__PURE__ */ jsx(
|
|
9853
10048
|
Button,
|
|
9854
10049
|
{
|
|
9855
10050
|
startIcon: /* @__PURE__ */ jsx(Check, {}),
|
|
9856
10051
|
onClick: () => saveOrder(),
|
|
9857
10052
|
disabled: JSON.stringify(navigationItems) === JSON.stringify(initialNavigationItems),
|
|
9858
|
-
children:
|
|
10053
|
+
children: formatMessage({
|
|
10054
|
+
id: getTranslation("save"),
|
|
10055
|
+
defaultMessage: "Save"
|
|
10056
|
+
})
|
|
9859
10057
|
}
|
|
9860
10058
|
)
|
|
9861
10059
|
] }),
|
|
@@ -9896,12 +10094,21 @@ const Navigation = () => {
|
|
|
9896
10094
|
}
|
|
9897
10095
|
) }),
|
|
9898
10096
|
navigations?.length === 0 && /* @__PURE__ */ jsxs(Center, { height: 400, children: [
|
|
9899
|
-
/* @__PURE__ */ jsx(EmptyBox, { msg:
|
|
9900
|
-
|
|
10097
|
+
/* @__PURE__ */ jsx(EmptyBox, { msg: formatMessage({
|
|
10098
|
+
id: getTranslation("navigation.page.emptyNavigation"),
|
|
10099
|
+
defaultMessage: "You have no navigations yet..."
|
|
10100
|
+
}) }),
|
|
10101
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => setModalType("NavCreate"), children: formatMessage({
|
|
10102
|
+
id: getTranslation("navigation.page.createNewNavigation"),
|
|
10103
|
+
defaultMessage: "Create new navigation"
|
|
10104
|
+
}) })
|
|
9901
10105
|
] }),
|
|
9902
10106
|
navigationItems?.length === 0 && /* @__PURE__ */ jsxs(Center, { height: 400, children: [
|
|
9903
10107
|
/* @__PURE__ */ jsx(EmptyBox, { msg: "Your navigation is empty..." }),
|
|
9904
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children:
|
|
10108
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
10109
|
+
id: getTranslation("navigation.page.createNewItem"),
|
|
10110
|
+
defaultMessage: "Create new item"
|
|
10111
|
+
}) })
|
|
9905
10112
|
] })
|
|
9906
10113
|
] })
|
|
9907
10114
|
] }),
|
|
@@ -9921,4 +10128,4 @@ const Navigation = () => {
|
|
|
9921
10128
|
export {
|
|
9922
10129
|
Navigation as default
|
|
9923
10130
|
};
|
|
9924
|
-
//# sourceMappingURL=index-
|
|
10131
|
+
//# sourceMappingURL=index-DkhJl5mF.mjs.map
|