@mattisvensson/strapi-plugin-webatlas 0.2.6 → 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/EmptyBox-7D4LrvdH.mjs.map +1 -0
- package/dist/_chunks/EmptyBox-DT6D5gcf.js.map +1 -0
- package/dist/_chunks/_baseConvert-B84_vf8X.js.map +1 -0
- package/dist/_chunks/_baseConvert-C2SW1VHq.mjs.map +1 -0
- 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-D4IHmUrH.js → index-B0XE_zRP.js} +298 -91
- package/dist/_chunks/index-B2Tiv3EK.mjs +92 -0
- package/dist/_chunks/index-B48CGofU.mjs +17170 -0
- package/dist/_chunks/index-B48CGofU.mjs.map +1 -0
- package/dist/_chunks/{index-DrlYDm6a.js → index-B85fJxGa.js} +165 -76
- package/dist/_chunks/{index-DIyVy-8D.js → index-BbM9Sn1t.js} +57 -17
- package/dist/_chunks/{index-B_RPO9ty.mjs → index-BocSkZOu.mjs} +57 -17
- package/dist/_chunks/{index-uoH_HJQr.mjs → index-C7B8QHDT.mjs} +296 -89
- package/dist/_chunks/{index-BMQSVj43.mjs → index-CCiDvLAC.mjs} +166 -77
- package/dist/_chunks/index-CXzNr2cH.mjs +93 -0
- package/dist/_chunks/index-CXzNr2cH.mjs.map +1 -0
- package/dist/_chunks/index-Cd6y6nuf.js +93 -0
- package/dist/_chunks/index-Cd6y6nuf.js.map +1 -0
- package/dist/_chunks/index-Cf9ZIBLd.js +4195 -0
- package/dist/_chunks/index-Cf9ZIBLd.js.map +1 -0
- package/dist/_chunks/index-D981K4TK.mjs +4179 -0
- package/dist/_chunks/index-D981K4TK.mjs.map +1 -0
- package/dist/_chunks/{index-BvXbuF1E.js → index-DGb8ESH-.js} +56 -8
- package/dist/_chunks/index-DYiJBXKE.js +10131 -0
- package/dist/_chunks/index-DYiJBXKE.js.map +1 -0
- package/dist/_chunks/index-DjZ3ZaVB.js +17189 -0
- package/dist/_chunks/index-DjZ3ZaVB.js.map +1 -0
- package/dist/_chunks/index-DkhJl5mF.mjs +10131 -0
- package/dist/_chunks/index-DkhJl5mF.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/index.mjs.map +1 -0
- 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 +12 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +12 -1
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/_chunks/index-BMlQpLGa.mjs +0 -44
|
@@ -6,7 +6,8 @@ const designSystem = require("@strapi/design-system");
|
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const ReactDOM = require("react-dom");
|
|
9
|
-
const index = require("./index-
|
|
9
|
+
const index = require("./index-B85fJxGa.js");
|
|
10
|
+
const reactIntl = require("react-intl");
|
|
10
11
|
const EmptyBox = require("./EmptyBox-DT6D5gcf.js");
|
|
11
12
|
const _baseConvert = require("./_baseConvert-B84_vf8X.js");
|
|
12
13
|
const core = require("@dnd-kit/core");
|
|
@@ -53,6 +54,7 @@ function Delete({ variant, item, fetchNavigations }) {
|
|
|
53
54
|
const itemName = React.useRef(variant === "NavDelete" ? item.name : item.route.title);
|
|
54
55
|
const closeModalState = React.useRef(variant === "NavDelete" ? "NavOverview" : "");
|
|
55
56
|
const { setModalType } = React.useContext(ModalContext);
|
|
57
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
56
58
|
const handleDelete = async () => {
|
|
57
59
|
try {
|
|
58
60
|
if (variant === "NavDelete") await deleteNavigation(item.documentId);
|
|
@@ -65,20 +67,44 @@ function Delete({ variant, item, fetchNavigations }) {
|
|
|
65
67
|
};
|
|
66
68
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { defaultOpen: true, onClose: () => setModalType(closeModalState.current), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
|
67
69
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Header, { children: [
|
|
68
|
-
|
|
70
|
+
formatMessage({
|
|
71
|
+
id: index.getTranslation("delete"),
|
|
72
|
+
defaultMessage: "Delete"
|
|
73
|
+
}),
|
|
74
|
+
': "',
|
|
69
75
|
itemName.current,
|
|
70
76
|
'"?'
|
|
71
77
|
] }),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Body, { children: [
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { textAlign: "center", children: [
|
|
80
|
+
formatMessage({
|
|
81
|
+
id: index.getTranslation("modal.delete.message.start"),
|
|
82
|
+
defaultMessage: "You are about to delete the following"
|
|
83
|
+
}),
|
|
84
|
+
" ",
|
|
85
|
+
variant === "ItemDelete" ? formatMessage({
|
|
86
|
+
id: index.getTranslation("modal.delete.message.navItem"),
|
|
87
|
+
defaultMessage: "navigation item"
|
|
88
|
+
}) : formatMessage({
|
|
89
|
+
id: index.getTranslation("modal.delete.message.navigation"),
|
|
90
|
+
defaultMessage: "navigation"
|
|
91
|
+
})
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", fontWeight: "bold", style: { marginTop: 8, marginBottom: 8, fontSize: 20 }, children: itemName.current }),
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", children: formatMessage({
|
|
95
|
+
id: index.getTranslation("modal.delete.message.end"),
|
|
96
|
+
defaultMessage: "This can not be undone. Are you sure?"
|
|
97
|
+
}) })
|
|
98
|
+
] }),
|
|
79
99
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
|
80
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => setModalType(closeModalState.current), variant: "tertiary", children:
|
|
81
|
-
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => setModalType(closeModalState.current), variant: "tertiary", children: formatMessage({
|
|
101
|
+
id: index.getTranslation("modal.delete.cancelText"),
|
|
102
|
+
defaultMessage: "No, keep"
|
|
103
|
+
}) }) }),
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "danger-light", onClick: () => handleDelete(), startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}), children: formatMessage({
|
|
105
|
+
id: index.getTranslation("modal.delete.confirmText"),
|
|
106
|
+
defaultMessage: "Yes, delete"
|
|
107
|
+
}) }) })
|
|
82
108
|
] })
|
|
83
109
|
] }) });
|
|
84
110
|
}
|
|
@@ -94,9 +120,11 @@ function NavModal({
|
|
|
94
120
|
loading,
|
|
95
121
|
modalToOpen,
|
|
96
122
|
footer,
|
|
97
|
-
currentModalType = null
|
|
123
|
+
currentModalType = null,
|
|
124
|
+
currentModalMode = "create"
|
|
98
125
|
}) {
|
|
99
126
|
const { setModalType } = React.useContext(ModalContext);
|
|
127
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
100
128
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Root, { open: true, onOpenChange: () => setModalType(""), children: [
|
|
101
129
|
triggerText && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: triggerVariant, children: triggerText }) }),
|
|
102
130
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
|
@@ -113,16 +141,25 @@ function NavModal({
|
|
|
113
141
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Footer, { children: footer ? footer : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
114
142
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", type: "button", children: closeText }) }),
|
|
115
143
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
116
|
-
currentModalType && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
144
|
+
currentModalType && currentModalMode === "create" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
117
145
|
designSystem.SingleSelect,
|
|
118
146
|
{
|
|
119
147
|
onChange: (value) => setModalType(value),
|
|
120
148
|
placeholder: "Choose item type",
|
|
121
149
|
value: currentModalType || "",
|
|
122
150
|
children: [
|
|
123
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "ItemCreate", children:
|
|
124
|
-
|
|
125
|
-
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "ItemCreate", children: formatMessage({
|
|
152
|
+
id: index.getTranslation("modal.navModal.internalItem"),
|
|
153
|
+
defaultMessage: "Internal item"
|
|
154
|
+
}) }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "WrapperCreate", children: formatMessage({
|
|
156
|
+
id: index.getTranslation("modal.navModal.wrapperItem"),
|
|
157
|
+
defaultMessage: "Wrapper item"
|
|
158
|
+
}) }),
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "ExternalCreate", children: formatMessage({
|
|
160
|
+
id: index.getTranslation("modal.navModal.externalItem"),
|
|
161
|
+
defaultMessage: "External item"
|
|
162
|
+
}) })
|
|
126
163
|
]
|
|
127
164
|
}
|
|
128
165
|
),
|
|
@@ -142,6 +179,7 @@ function NavCreate() {
|
|
|
142
179
|
const [name, setName] = React.useState("");
|
|
143
180
|
const [isActive, setIsActive] = React.useState(true);
|
|
144
181
|
const [loading, setLoading] = React.useState(false);
|
|
182
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
145
183
|
const createNavigation = async () => {
|
|
146
184
|
setLoading(true);
|
|
147
185
|
try {
|
|
@@ -157,14 +195,17 @@ function NavCreate() {
|
|
|
157
195
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
158
196
|
NavModal,
|
|
159
197
|
{
|
|
160
|
-
confirmText: "Create",
|
|
161
|
-
closeText: "Cancel",
|
|
162
|
-
titleText: "Create new navigation",
|
|
163
|
-
loadingText: "Creating",
|
|
198
|
+
confirmText: formatMessage({ id: index.getTranslation("modal.navCreate.confirmText"), defaultMessage: "Create" }),
|
|
199
|
+
closeText: formatMessage({ id: index.getTranslation("modal.navCreate.closeText"), defaultMessage: "Cancel" }),
|
|
200
|
+
titleText: formatMessage({ id: index.getTranslation("modal.navCreate.titleText"), defaultMessage: "Create new navigation" }),
|
|
201
|
+
loadingText: formatMessage({ id: index.getTranslation("modal.navCreate.loadingText"), defaultMessage: "Creating" }),
|
|
164
202
|
onConfirm: createNavigation,
|
|
165
203
|
loading,
|
|
166
204
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
167
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
206
|
+
id: index.getTranslation("modal.nameField.label"),
|
|
207
|
+
defaultMessage: "Name"
|
|
208
|
+
}) }),
|
|
168
209
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
169
210
|
designSystem.Field.Input,
|
|
170
211
|
{
|
|
@@ -183,6 +224,7 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
183
224
|
const [visible, setVisible] = React.useState(item.visible);
|
|
184
225
|
const [loading, setLoading] = React.useState(false);
|
|
185
226
|
const { updateNavigation } = index.useApi();
|
|
227
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
186
228
|
const updateNav = async () => {
|
|
187
229
|
setLoading(true);
|
|
188
230
|
try {
|
|
@@ -198,20 +240,29 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
198
240
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
241
|
NavModal,
|
|
200
242
|
{
|
|
201
|
-
confirmText: "Create",
|
|
202
|
-
closeText: "Cancel",
|
|
203
|
-
titleText:
|
|
204
|
-
loadingText: "
|
|
243
|
+
confirmText: formatMessage({ id: index.getTranslation("modal.navEdit.confirmText"), defaultMessage: "Create" }),
|
|
244
|
+
closeText: formatMessage({ id: index.getTranslation("modal.navEdit.closeText"), defaultMessage: "Cancel" }),
|
|
245
|
+
titleText: formatMessage({ id: index.getTranslation("modal.navEdit.titleText"), defaultMessage: "Edit navigation:" }) + " " + item.name,
|
|
246
|
+
loadingText: formatMessage({ id: index.getTranslation("modal.navEdit.loadingText"), defaultMessage: "Updating" }),
|
|
205
247
|
onConfirm: updateNav,
|
|
206
248
|
loading,
|
|
207
249
|
modalToOpen: "NavOverview",
|
|
208
250
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
209
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => setModalType("NavOverview"), variant: "tertiary", children:
|
|
210
|
-
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => setModalType("NavOverview"), variant: "tertiary", children: formatMessage({
|
|
252
|
+
id: index.getTranslation("modal.navEdit.closeText"),
|
|
253
|
+
defaultMessage: "Cancel"
|
|
254
|
+
}) }),
|
|
255
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { children: formatMessage({
|
|
256
|
+
id: index.getTranslation("modal.navEdit.confirmText"),
|
|
257
|
+
defaultMessage: "Update"
|
|
258
|
+
}) })
|
|
211
259
|
] }),
|
|
212
260
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
213
261
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { s: 12, m: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
214
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
262
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
263
|
+
id: index.getTranslation("modal.nameField.label"),
|
|
264
|
+
defaultMessage: "Name"
|
|
265
|
+
}) }),
|
|
215
266
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
216
267
|
designSystem.Field.Input,
|
|
217
268
|
{
|
|
@@ -222,8 +273,25 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
222
273
|
)
|
|
223
274
|
] }) }) }),
|
|
224
275
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { s: 12, m: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
225
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
226
|
-
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
277
|
+
id: index.getTranslation("modal.activeField.label"),
|
|
278
|
+
defaultMessage: "Active"
|
|
279
|
+
}) }),
|
|
280
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
281
|
+
designSystem.Toggle,
|
|
282
|
+
{
|
|
283
|
+
onLabel: formatMessage({
|
|
284
|
+
id: index.getTranslation("modal.activeField.onLabel"),
|
|
285
|
+
defaultMessage: "Yes"
|
|
286
|
+
}),
|
|
287
|
+
offLabel: formatMessage({
|
|
288
|
+
id: index.getTranslation("modal.activeField.offLabel"),
|
|
289
|
+
defaultMessage: "No"
|
|
290
|
+
}),
|
|
291
|
+
checked: visible,
|
|
292
|
+
onChange: () => setVisible((prev) => !prev)
|
|
293
|
+
}
|
|
294
|
+
)
|
|
227
295
|
] }) }) })
|
|
228
296
|
] })
|
|
229
297
|
}
|
|
@@ -232,6 +300,7 @@ function NavEdit({ item, fetchNavigations }) {
|
|
|
232
300
|
function NavOverview({ navigations, setActionItem }) {
|
|
233
301
|
const { setModalType } = React.useContext(ModalContext);
|
|
234
302
|
const { selectedNavigation, setSelectedNavigation } = React.useContext(SelectedNavigationContext);
|
|
303
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
235
304
|
const handleSelect = (nav) => {
|
|
236
305
|
setSelectedNavigation(nav);
|
|
237
306
|
setModalType("");
|
|
@@ -247,21 +316,51 @@ function NavOverview({ navigations, setActionItem }) {
|
|
|
247
316
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
248
317
|
NavModal,
|
|
249
318
|
{
|
|
250
|
-
confirmText:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
319
|
+
confirmText: formatMessage({
|
|
320
|
+
id: index.getTranslation("modal.navOverview.confirmText"),
|
|
321
|
+
defaultMessage: "New navigation"
|
|
322
|
+
}),
|
|
323
|
+
closeText: formatMessage({
|
|
324
|
+
id: index.getTranslation("modal.navOverview.closeText"),
|
|
325
|
+
defaultMessage: "Cancel"
|
|
326
|
+
}),
|
|
327
|
+
titleText: formatMessage({
|
|
328
|
+
id: index.getTranslation("modal.navOverview.titleText"),
|
|
329
|
+
defaultMessage: "Navigation overview"
|
|
330
|
+
}),
|
|
331
|
+
loadingText: formatMessage({
|
|
332
|
+
id: index.getTranslation("modal.navOverview.loadingText"),
|
|
333
|
+
defaultMessage: "Creating"
|
|
334
|
+
}),
|
|
254
335
|
modalToOpen: "NavCreate",
|
|
255
|
-
children: navigations.length > 0 ? navigations.map((nav,
|
|
336
|
+
children: navigations.length > 0 ? navigations.map((nav, index$1) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
256
337
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
|
257
338
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: nav.name }),
|
|
258
339
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
259
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}), variant: "danger-light", onClick: () => handleDelete(nav), children:
|
|
260
|
-
|
|
261
|
-
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}), variant: "danger-light", onClick: () => handleDelete(nav), children: formatMessage({
|
|
341
|
+
id: index.getTranslation("delete"),
|
|
342
|
+
defaultMessage: "Delete"
|
|
343
|
+
}) }),
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {}), variant: "secondary", onClick: () => handleEdit(nav), children: formatMessage({
|
|
345
|
+
id: index.getTranslation("edit"),
|
|
346
|
+
defaultMessage: "Edit"
|
|
347
|
+
}) }),
|
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
349
|
+
designSystem.Button,
|
|
350
|
+
{
|
|
351
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
352
|
+
variant: "primary",
|
|
353
|
+
onClick: () => handleSelect(nav),
|
|
354
|
+
disabled: selectedNavigation ? selectedNavigation.slug === nav.slug : false,
|
|
355
|
+
children: formatMessage({
|
|
356
|
+
id: index.getTranslation("select"),
|
|
357
|
+
defaultMessage: "Select"
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
)
|
|
262
361
|
] })
|
|
263
362
|
] }, `box-${nav.slug}`),
|
|
264
|
-
navigations.length - 1 !==
|
|
363
|
+
navigations.length - 1 !== index$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
265
364
|
designSystem.Box,
|
|
266
365
|
{
|
|
267
366
|
paddingTop: 2,
|
|
@@ -269,7 +368,10 @@ function NavOverview({ navigations, setActionItem }) {
|
|
|
269
368
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {})
|
|
270
369
|
}
|
|
271
370
|
)
|
|
272
|
-
] }, nav.id)) : /* @__PURE__ */ jsxRuntime.jsx(EmptyBox.Center, { height: 100, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children:
|
|
371
|
+
] }, nav.id)) : /* @__PURE__ */ jsxRuntime.jsx(EmptyBox.Center, { height: 100, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
|
372
|
+
id: index.getTranslation("navigation.page.emptyNavigation"),
|
|
373
|
+
defaultMessage: "You have no navigations yet..."
|
|
374
|
+
}) }) })
|
|
273
375
|
}
|
|
274
376
|
);
|
|
275
377
|
}
|
|
@@ -3525,6 +3627,7 @@ function ExternalItemComponent({
|
|
|
3525
3627
|
selectedNavigation,
|
|
3526
3628
|
parentDocumentId
|
|
3527
3629
|
}) {
|
|
3630
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
3528
3631
|
React.useEffect(() => {
|
|
3529
3632
|
if (variant !== "ExternalEdit" || !item) return;
|
|
3530
3633
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -3560,20 +3663,27 @@ function ExternalItemComponent({
|
|
|
3560
3663
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3561
3664
|
NavModal,
|
|
3562
3665
|
{
|
|
3563
|
-
confirmText: variant === "ExternalCreate" ? "Add" : "Save",
|
|
3564
|
-
closeText: "Cancel",
|
|
3565
|
-
titleText: variant === "ExternalCreate" ? "Create new external item" : `Edit external route "${navItemState.title}"
|
|
3566
|
-
loadingText: variant === "ExternalCreate" ? "Adding" : "Saving",
|
|
3666
|
+
confirmText: variant === "ExternalCreate" ? formatMessage({ id: index.getTranslation("add"), defaultMessage: "Add" }) : formatMessage({ id: index.getTranslation("save"), defaultMessage: "Save" }),
|
|
3667
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
3668
|
+
titleText: variant === "ExternalCreate" ? formatMessage({ id: index.getTranslation("modal.externalItem.titleText.create"), defaultMessage: "Create new external item" }) : formatMessage({ id: index.getTranslation("modal.externalItem.titleText.edit"), defaultMessage: `Edit external route "${navItemState.title}"` }),
|
|
3669
|
+
loadingText: variant === "ExternalCreate" ? formatMessage({ id: index.getTranslation("modal.externalItem.loadingText.create"), defaultMessage: "Adding" }) : formatMessage({ id: index.getTranslation("modal.externalItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
3567
3670
|
onConfirm: addItem,
|
|
3568
3671
|
modalToOpen: "",
|
|
3569
3672
|
currentModalType: "ExternalCreate",
|
|
3673
|
+
currentModalMode: variant === "ExternalCreate" ? "create" : "edit",
|
|
3570
3674
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 8, children: [
|
|
3571
3675
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3572
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3676
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3677
|
+
id: index.getTranslation("modal.item.titleField.label"),
|
|
3678
|
+
defaultMessage: "Title"
|
|
3679
|
+
}) }),
|
|
3573
3680
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3574
3681
|
designSystem.Field.Input,
|
|
3575
3682
|
{
|
|
3576
|
-
placeholder:
|
|
3683
|
+
placeholder: formatMessage({
|
|
3684
|
+
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
3685
|
+
defaultMessage: "e.g. About us"
|
|
3686
|
+
}),
|
|
3577
3687
|
name: "title",
|
|
3578
3688
|
value: navItemState.title || "",
|
|
3579
3689
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -3582,13 +3692,18 @@ function ExternalItemComponent({
|
|
|
3582
3692
|
)
|
|
3583
3693
|
] }) }) }),
|
|
3584
3694
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3585
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3695
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3696
|
+
id: index.getTranslation("modal.item.routeField.label"),
|
|
3697
|
+
defaultMessage: "Path"
|
|
3698
|
+
}) }),
|
|
3586
3699
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3587
3700
|
designSystem.Field.Input,
|
|
3588
3701
|
{
|
|
3589
3702
|
required: true,
|
|
3590
|
-
placeholder:
|
|
3591
|
-
|
|
3703
|
+
placeholder: formatMessage({
|
|
3704
|
+
id: index.getTranslation("modal.externalItem.routeField.placeholder"),
|
|
3705
|
+
defaultMessage: "e.g. https://example.com"
|
|
3706
|
+
}),
|
|
3592
3707
|
name: "slug",
|
|
3593
3708
|
value: path?.value || "",
|
|
3594
3709
|
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value })
|
|
@@ -3626,6 +3741,7 @@ function ItemCreateComponent({
|
|
|
3626
3741
|
parentId
|
|
3627
3742
|
}) {
|
|
3628
3743
|
const [loading, setLoading] = React.useState(false);
|
|
3744
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
3629
3745
|
React.useEffect(() => {
|
|
3630
3746
|
if (!entities) return;
|
|
3631
3747
|
setAvailableEntities(entities);
|
|
@@ -3689,10 +3805,10 @@ function ItemCreateComponent({
|
|
|
3689
3805
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3690
3806
|
NavModal,
|
|
3691
3807
|
{
|
|
3692
|
-
confirmText: "Add",
|
|
3693
|
-
closeText: "Cancel",
|
|
3694
|
-
titleText: "Add new navigation item",
|
|
3695
|
-
loadingText: "Creating",
|
|
3808
|
+
confirmText: formatMessage({ id: index.getTranslation("add"), defaultMessage: "Add" }),
|
|
3809
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
3810
|
+
titleText: formatMessage({ id: index.getTranslation("modal.internalItem.titleText.create"), defaultMessage: "Add new navigation item" }),
|
|
3811
|
+
loadingText: formatMessage({ id: index.getTranslation("modal.internalItem.loadingText.create"), defaultMessage: "Creating" }),
|
|
3696
3812
|
onConfirm: addItem,
|
|
3697
3813
|
loading,
|
|
3698
3814
|
modalToOpen: "",
|
|
@@ -3700,12 +3816,18 @@ function ItemCreateComponent({
|
|
|
3700
3816
|
children: [
|
|
3701
3817
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
3702
3818
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3703
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3819
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3820
|
+
id: index.getTranslation("modal.internalItem.contentType.label"),
|
|
3821
|
+
defaultMessage: "Content Type"
|
|
3822
|
+
}) }),
|
|
3704
3823
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3705
3824
|
designSystem.SingleSelect,
|
|
3706
3825
|
{
|
|
3707
3826
|
value: selectedContentType ? selectedContentType.label : "",
|
|
3708
|
-
placeholder:
|
|
3827
|
+
placeholder: formatMessage({
|
|
3828
|
+
id: index.getTranslation("modal.internalItem.contentType.placeholder"),
|
|
3829
|
+
defaultMessage: "Select a content type"
|
|
3830
|
+
}),
|
|
3709
3831
|
onChange: (value) => {
|
|
3710
3832
|
const [contentType] = availableEntities.filter((group) => group.label === value);
|
|
3711
3833
|
if (contentType) {
|
|
@@ -3719,12 +3841,18 @@ function ItemCreateComponent({
|
|
|
3719
3841
|
)
|
|
3720
3842
|
] }) }) }),
|
|
3721
3843
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3722
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3844
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3845
|
+
id: index.getTranslation("modal.internalItem.entity.label"),
|
|
3846
|
+
defaultMessage: "Entity"
|
|
3847
|
+
}) }),
|
|
3723
3848
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3724
3849
|
designSystem.SingleSelect,
|
|
3725
3850
|
{
|
|
3726
3851
|
value: selectedEntity ? selectedEntity.id : "",
|
|
3727
|
-
placeholder:
|
|
3852
|
+
placeholder: formatMessage({
|
|
3853
|
+
id: index.getTranslation("modal.internalItem.entity.placeholder"),
|
|
3854
|
+
defaultMessage: "Select an entity"
|
|
3855
|
+
}),
|
|
3728
3856
|
onChange: (value) => {
|
|
3729
3857
|
const flatEntities = availableEntities.flatMap((group) => group.entities);
|
|
3730
3858
|
const route = flatEntities.find((route2) => route2.id === Number(value));
|
|
@@ -3746,11 +3874,17 @@ function ItemCreateComponent({
|
|
|
3746
3874
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
|
|
3747
3875
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, paddingBottom: 6, children: [
|
|
3748
3876
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3749
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3877
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3878
|
+
id: index.getTranslation("modal.item.titleField.label"),
|
|
3879
|
+
defaultMessage: "Title"
|
|
3880
|
+
}) }),
|
|
3750
3881
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3751
3882
|
designSystem.Field.Input,
|
|
3752
3883
|
{
|
|
3753
|
-
placeholder:
|
|
3884
|
+
placeholder: formatMessage({
|
|
3885
|
+
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
3886
|
+
defaultMessage: "e.g. About us"
|
|
3887
|
+
}),
|
|
3754
3888
|
name: "title",
|
|
3755
3889
|
value: navItemState.title || "",
|
|
3756
3890
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -3760,13 +3894,18 @@ function ItemCreateComponent({
|
|
|
3760
3894
|
] }) }) }),
|
|
3761
3895
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
3762
3896
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
3763
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
3897
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
3898
|
+
id: index.getTranslation("modal.item.routeField.label"),
|
|
3899
|
+
defaultMessage: "Route"
|
|
3900
|
+
}) }),
|
|
3764
3901
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3765
3902
|
designSystem.Field.Input,
|
|
3766
3903
|
{
|
|
3767
3904
|
required: true,
|
|
3768
|
-
placeholder:
|
|
3769
|
-
|
|
3905
|
+
placeholder: formatMessage({
|
|
3906
|
+
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
3907
|
+
defaultMessage: "e.g. about/"
|
|
3908
|
+
}),
|
|
3770
3909
|
name: "slug",
|
|
3771
3910
|
value: path?.value || "",
|
|
3772
3911
|
onChange: (e) => dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: e.target.value }),
|
|
@@ -9284,6 +9423,7 @@ function ItemEditComponent({
|
|
|
9284
9423
|
debouncedCheckUrl,
|
|
9285
9424
|
setModalType
|
|
9286
9425
|
}) {
|
|
9426
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
9287
9427
|
React.useEffect(() => {
|
|
9288
9428
|
dispatchPath({ type: "NO_TRANSFORM_AND_CHECK", payload: item.route.fullPath });
|
|
9289
9429
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -9342,17 +9482,21 @@ function ItemEditComponent({
|
|
|
9342
9482
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9343
9483
|
NavModal,
|
|
9344
9484
|
{
|
|
9345
|
-
confirmText: "Save",
|
|
9346
|
-
closeText: "Cancel",
|
|
9347
|
-
titleText:
|
|
9348
|
-
loadingText: "Saving",
|
|
9485
|
+
confirmText: formatMessage({ id: index.getTranslation("save"), defaultMessage: "Save" }),
|
|
9486
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
9487
|
+
titleText: `${formatMessage({ id: index.getTranslation("edit"), defaultMessage: "Edit" })} ${selectedContentType.label} "${item.route.title}"`,
|
|
9488
|
+
loadingText: formatMessage({ id: index.getTranslation("modal.internalItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
9349
9489
|
onConfirm: updateItem,
|
|
9350
9490
|
modalToOpen: "",
|
|
9351
9491
|
currentModalType: "ItemCreate",
|
|
9492
|
+
currentModalMode: "edit",
|
|
9352
9493
|
children: [
|
|
9353
9494
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 8, children: [
|
|
9354
9495
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
9355
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
9496
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
9497
|
+
id: index.getTranslation("modal.internalItem.contentType.label"),
|
|
9498
|
+
defaultMessage: "Content Type"
|
|
9499
|
+
}) }),
|
|
9356
9500
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9357
9501
|
designSystem.Field.Input,
|
|
9358
9502
|
{
|
|
@@ -9362,7 +9506,10 @@ function ItemEditComponent({
|
|
|
9362
9506
|
)
|
|
9363
9507
|
] }) }) }),
|
|
9364
9508
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
9365
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
9509
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
9510
|
+
id: index.getTranslation("modal.internalItem.entity.label"),
|
|
9511
|
+
defaultMessage: "Entity"
|
|
9512
|
+
}) }),
|
|
9366
9513
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9367
9514
|
designSystem.Field.Input,
|
|
9368
9515
|
{
|
|
@@ -9375,11 +9522,18 @@ function ItemEditComponent({
|
|
|
9375
9522
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, paddingTop: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
|
|
9376
9523
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 8, paddingBottom: 6, children: [
|
|
9377
9524
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, alignItems: "baseline", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
9378
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
9525
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
9526
|
+
id: index.getTranslation("modal.item.titleField.label"),
|
|
9527
|
+
defaultMessage: "Title"
|
|
9528
|
+
}) }),
|
|
9379
9529
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9380
9530
|
designSystem.Field.Input,
|
|
9381
9531
|
{
|
|
9382
|
-
placeholder:
|
|
9532
|
+
placeholder: formatMessage({
|
|
9533
|
+
id: index.getTranslation("modal.item.titleField.placeholder"),
|
|
9534
|
+
defaultMessage: "e.g. About us"
|
|
9535
|
+
}),
|
|
9536
|
+
name: "title",
|
|
9383
9537
|
value: navItemState.title || "",
|
|
9384
9538
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
9385
9539
|
required: true
|
|
@@ -9388,11 +9542,17 @@ function ItemEditComponent({
|
|
|
9388
9542
|
] }) }) }),
|
|
9389
9543
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { width: "100%", children: [
|
|
9390
9544
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
9391
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
9545
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
9546
|
+
id: index.getTranslation("modal.item.routeField.label"),
|
|
9547
|
+
defaultMessage: "Route"
|
|
9548
|
+
}) }),
|
|
9392
9549
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9393
9550
|
designSystem.Field.Input,
|
|
9394
9551
|
{
|
|
9395
|
-
placeholder:
|
|
9552
|
+
placeholder: formatMessage({
|
|
9553
|
+
id: index.getTranslation("modal.item.routeField.placeholder"),
|
|
9554
|
+
defaultMessage: "e.g. about/"
|
|
9555
|
+
}),
|
|
9396
9556
|
value: path.value || "",
|
|
9397
9557
|
onChange: (e) => handlePathChange(e.target.value),
|
|
9398
9558
|
onBlur: (e) => {
|
|
@@ -9424,6 +9584,7 @@ function WrapperItemComponent({
|
|
|
9424
9584
|
selectedNavigation,
|
|
9425
9585
|
parentDocumentId
|
|
9426
9586
|
}) {
|
|
9587
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
9427
9588
|
React.useEffect(() => {
|
|
9428
9589
|
if (variant !== "WrapperEdit" || !item) return;
|
|
9429
9590
|
dispatchItemState({ type: "SET_TITLE", payload: item.route.title });
|
|
@@ -9459,19 +9620,26 @@ function WrapperItemComponent({
|
|
|
9459
9620
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9460
9621
|
NavModal,
|
|
9461
9622
|
{
|
|
9462
|
-
confirmText: variant === "WrapperCreate" ? "Add" : "Save",
|
|
9463
|
-
closeText: "Cancel",
|
|
9464
|
-
titleText: variant === "WrapperCreate" ? "Create new wrapper item" :
|
|
9465
|
-
loadingText: variant === "WrapperCreate" ? "Adding" : "Saving",
|
|
9623
|
+
confirmText: variant === "WrapperCreate" ? formatMessage({ id: index.getTranslation("add"), defaultMessage: "Add" }) : formatMessage({ id: index.getTranslation("save"), defaultMessage: "Save" }),
|
|
9624
|
+
closeText: formatMessage({ id: index.getTranslation("cancel"), defaultMessage: "Cancel" }),
|
|
9625
|
+
titleText: variant === "WrapperCreate" ? formatMessage({ id: index.getTranslation("modal.wrapperItem.titleText.create"), defaultMessage: "Create new wrapper item" }) : formatMessage({ id: index.getTranslation("modal.wrapperItem.titleText.edit"), defaultMessage: "Edit wrapper item:" }) + ` "${navItemState.title}"`,
|
|
9626
|
+
loadingText: variant === "WrapperCreate" ? formatMessage({ id: index.getTranslation("modal.wrapperItem.loadingText.create"), defaultMessage: "Adding" }) : formatMessage({ id: index.getTranslation("modal.wrapperItem.loadingText.edit"), defaultMessage: "Saving" }),
|
|
9466
9627
|
onConfirm: addItem,
|
|
9467
9628
|
modalToOpen: "",
|
|
9468
9629
|
currentModalType: "WrapperCreate",
|
|
9630
|
+
currentModalMode: variant === "WrapperCreate" ? "create" : "edit",
|
|
9469
9631
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 8, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
9470
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children:
|
|
9632
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
9633
|
+
id: index.getTranslation("modal.wrapperItem.titleField.label"),
|
|
9634
|
+
defaultMessage: "Title"
|
|
9635
|
+
}) }),
|
|
9471
9636
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9472
9637
|
designSystem.Field.Input,
|
|
9473
9638
|
{
|
|
9474
|
-
placeholder:
|
|
9639
|
+
placeholder: formatMessage({
|
|
9640
|
+
id: index.getTranslation("modal.wrapperItem.titleField.placeholder"),
|
|
9641
|
+
defaultMessage: "e.g. About us"
|
|
9642
|
+
}),
|
|
9475
9643
|
name: "title",
|
|
9476
9644
|
value: navItemState.title || "",
|
|
9477
9645
|
onChange: (e) => dispatchItemState({ type: "SET_TITLE", payload: e.target.value }),
|
|
@@ -9486,13 +9654,20 @@ const WrapperItem = withModalSharedLogic(WrapperItemComponent);
|
|
|
9486
9654
|
function Header({ navigations }) {
|
|
9487
9655
|
const { setModalType } = React.useContext(ModalContext);
|
|
9488
9656
|
const { selectedNavigation, setSelectedNavigation } = React.useContext(SelectedNavigationContext);
|
|
9657
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
9489
9658
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, children: [
|
|
9490
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: () => setModalType("NavOverview"), children:
|
|
9659
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: () => setModalType("NavOverview"), children: formatMessage({
|
|
9660
|
+
id: index.getTranslation("manage"),
|
|
9661
|
+
defaultMessage: "Manage"
|
|
9662
|
+
}) }),
|
|
9491
9663
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9492
9664
|
designSystem.SingleSelect,
|
|
9493
9665
|
{
|
|
9494
9666
|
value: selectedNavigation ? selectedNavigation.slug : "",
|
|
9495
|
-
placeholder:
|
|
9667
|
+
placeholder: formatMessage({
|
|
9668
|
+
id: index.getTranslation("navigation.page.selectNavigation"),
|
|
9669
|
+
defaultMessage: "Select Navigation"
|
|
9670
|
+
}),
|
|
9496
9671
|
onChange: (value) => {
|
|
9497
9672
|
const navItem = navigations.find((nav) => nav.slug === value);
|
|
9498
9673
|
if (navItem) {
|
|
@@ -9562,6 +9737,7 @@ const RouteItem = React.forwardRef(({ item, setParentId, setActionItem, ghost, d
|
|
|
9562
9737
|
if (!item || !item.route) return null;
|
|
9563
9738
|
const { setModalType } = React.useContext(ModalContext);
|
|
9564
9739
|
const { get } = admin.useFetchClient();
|
|
9740
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
9565
9741
|
const [itemStatus, setItemStatus] = React.useState({
|
|
9566
9742
|
status: "published",
|
|
9567
9743
|
variant: "primary",
|
|
@@ -9674,9 +9850,18 @@ const RouteItem = React.forwardRef(({ item, setParentId, setActionItem, ghost, d
|
|
|
9674
9850
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "row", gap: 4, children: [
|
|
9675
9851
|
type === "internal" && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { variant: itemStatus.variant, size: "S", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: itemStatus.textColor, children: itemStatus.status }) }),
|
|
9676
9852
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.SimpleMenu, { label: "Notifications", tag: designSystem.IconButton, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {}), children: [
|
|
9677
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: () => handleEdit(), children:
|
|
9678
|
-
|
|
9679
|
-
|
|
9853
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: () => handleEdit(), children: formatMessage({
|
|
9854
|
+
id: index.getTranslation("edit"),
|
|
9855
|
+
defaultMessage: "Edit"
|
|
9856
|
+
}) }),
|
|
9857
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: () => handleAddChildren(), children: formatMessage({
|
|
9858
|
+
id: index.getTranslation("navigation.page.navItem.addChildren"),
|
|
9859
|
+
defaultMessage: "Add children"
|
|
9860
|
+
}) }),
|
|
9861
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: () => handleDelete(), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", children: formatMessage({
|
|
9862
|
+
id: index.getTranslation("delete"),
|
|
9863
|
+
defaultMessage: "Delete"
|
|
9864
|
+
}) }) })
|
|
9680
9865
|
] })
|
|
9681
9866
|
] })
|
|
9682
9867
|
] })
|
|
@@ -9731,6 +9916,7 @@ const Navigation = () => {
|
|
|
9731
9916
|
const [activeId, setActiveId] = React.useState(null);
|
|
9732
9917
|
const [overId, setOverId] = React.useState(null);
|
|
9733
9918
|
const [offsetLeft, setOffsetLeft] = React.useState(0);
|
|
9919
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
9734
9920
|
if (!navigations) return null;
|
|
9735
9921
|
React.useEffect(() => {
|
|
9736
9922
|
if (modalType === "NavOverview" || modalType === "") {
|
|
@@ -9843,21 +10029,33 @@ const Navigation = () => {
|
|
|
9843
10029
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9844
10030
|
admin.Layouts.Header,
|
|
9845
10031
|
{
|
|
9846
|
-
title:
|
|
9847
|
-
|
|
10032
|
+
title: formatMessage({
|
|
10033
|
+
id: index.getTranslation("navigation.page.title"),
|
|
10034
|
+
defaultMessage: "Navigation"
|
|
10035
|
+
}) + (selectedNavigation ? `: ${selectedNavigation.name}` : ""),
|
|
10036
|
+
subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral500", children: selectedNavigation ? `ID: ${selectedNavigation.id} | DocumentID : ${selectedNavigation.documentId}` : formatMessage({
|
|
10037
|
+
id: index.getTranslation("navigation.page.subtitle.noNavigationSelected"),
|
|
10038
|
+
defaultMessage: "No navigation selected"
|
|
10039
|
+
}) }),
|
|
9848
10040
|
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(Header, { navigations })
|
|
9849
10041
|
}
|
|
9850
10042
|
),
|
|
9851
10043
|
/* @__PURE__ */ jsxRuntime.jsxs(admin.Layouts.Content, { children: [
|
|
9852
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, paddingBottom: 6, justifyContent: "flex-end", children: [
|
|
9853
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}), onClick: () => setModalType("ItemCreate"), children:
|
|
10044
|
+
selectedNavigation && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, paddingBottom: 6, justifyContent: "flex-end", children: [
|
|
10045
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}), onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
10046
|
+
id: index.getTranslation("navigation.page.newItemButton"),
|
|
10047
|
+
defaultMessage: "New Item"
|
|
10048
|
+
}) }),
|
|
9854
10049
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9855
10050
|
designSystem.Button,
|
|
9856
10051
|
{
|
|
9857
10052
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
9858
10053
|
onClick: () => saveOrder(),
|
|
9859
10054
|
disabled: JSON.stringify(navigationItems) === JSON.stringify(initialNavigationItems),
|
|
9860
|
-
children:
|
|
10055
|
+
children: formatMessage({
|
|
10056
|
+
id: index.getTranslation("save"),
|
|
10057
|
+
defaultMessage: "Save"
|
|
10058
|
+
})
|
|
9861
10059
|
}
|
|
9862
10060
|
)
|
|
9863
10061
|
] }),
|
|
@@ -9898,12 +10096,21 @@ const Navigation = () => {
|
|
|
9898
10096
|
}
|
|
9899
10097
|
) }),
|
|
9900
10098
|
navigations?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(EmptyBox.Center, { height: 400, children: [
|
|
9901
|
-
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox.EmptyBox, { msg:
|
|
9902
|
-
|
|
10099
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox.EmptyBox, { msg: formatMessage({
|
|
10100
|
+
id: index.getTranslation("navigation.page.emptyNavigation"),
|
|
10101
|
+
defaultMessage: "You have no navigations yet..."
|
|
10102
|
+
}) }),
|
|
10103
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "primary", onClick: () => setModalType("NavCreate"), children: formatMessage({
|
|
10104
|
+
id: index.getTranslation("navigation.page.createNewNavigation"),
|
|
10105
|
+
defaultMessage: "Create new navigation"
|
|
10106
|
+
}) })
|
|
9903
10107
|
] }),
|
|
9904
10108
|
navigationItems?.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(EmptyBox.Center, { height: 400, children: [
|
|
9905
10109
|
/* @__PURE__ */ jsxRuntime.jsx(EmptyBox.EmptyBox, { msg: "Your navigation is empty..." }),
|
|
9906
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children:
|
|
10110
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "primary", onClick: () => setModalType("ItemCreate"), children: formatMessage({
|
|
10111
|
+
id: index.getTranslation("navigation.page.createNewItem"),
|
|
10112
|
+
defaultMessage: "Create new item"
|
|
10113
|
+
}) })
|
|
9907
10114
|
] })
|
|
9908
10115
|
] })
|
|
9909
10116
|
] }),
|