@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
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Layouts } from "@strapi/strapi/admin";
|
|
4
|
+
import { Table, Thead, Tr, Th, Typography, VisuallyHidden, Tbody, Td, Flex, LinkButton } from "@strapi/design-system";
|
|
5
|
+
import { Pencil } from "@strapi/icons";
|
|
6
|
+
import { u as useApi, g as getTranslation } from "./index-CCiDvLAC.mjs";
|
|
7
|
+
import { C as Center, E as EmptyBox } from "./EmptyBox-7D4LrvdH.mjs";
|
|
8
|
+
import { useIntl } from "react-intl";
|
|
9
|
+
function getRouteType(route) {
|
|
10
|
+
if (route.wrapper) {
|
|
11
|
+
return "wrapper";
|
|
12
|
+
} else if (!route.internal) {
|
|
13
|
+
return "external";
|
|
14
|
+
} else {
|
|
15
|
+
return "internal";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const Routes = () => {
|
|
19
|
+
const { getRoutes } = useApi();
|
|
20
|
+
const { formatMessage } = useIntl();
|
|
21
|
+
const [routes, setRoutes] = useState([]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
async function fetchRoutes() {
|
|
24
|
+
const data = await getRoutes();
|
|
25
|
+
setRoutes(data);
|
|
26
|
+
}
|
|
27
|
+
fetchRoutes();
|
|
28
|
+
}, []);
|
|
29
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Layouts.Header,
|
|
32
|
+
{
|
|
33
|
+
title: formatMessage({
|
|
34
|
+
id: getTranslation("routes.page.title"),
|
|
35
|
+
defaultMessage: "Routes"
|
|
36
|
+
}),
|
|
37
|
+
subtitle: formatMessage({
|
|
38
|
+
id: getTranslation("routes.page.subtitle"),
|
|
39
|
+
defaultMessage: "Overview of all existing routes"
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(Layouts.Content, { children: routes.length === 0 ? /* @__PURE__ */ jsx(Center, { height: 400, children: /* @__PURE__ */ jsx(EmptyBox, { msg: formatMessage({
|
|
44
|
+
id: getTranslation("routes.page.emptyRoutes"),
|
|
45
|
+
defaultMessage: "No routes found"
|
|
46
|
+
}) }) }) : /* @__PURE__ */ jsxs(Table, { colCount: 4, rowCount: routes.length, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "ID" }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: formatMessage({
|
|
50
|
+
id: getTranslation("title"),
|
|
51
|
+
defaultMessage: "Title"
|
|
52
|
+
}) }) }),
|
|
53
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: formatMessage({
|
|
54
|
+
id: getTranslation("route"),
|
|
55
|
+
defaultMessage: "Route"
|
|
56
|
+
}) }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: formatMessage({
|
|
58
|
+
id: getTranslation("routes.page.column.type"),
|
|
59
|
+
defaultMessage: "Type"
|
|
60
|
+
}) }) }),
|
|
61
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(VisuallyHidden, { children: formatMessage({
|
|
62
|
+
id: getTranslation("actions"),
|
|
63
|
+
defaultMessage: "Actions"
|
|
64
|
+
}) }) })
|
|
65
|
+
] }) }),
|
|
66
|
+
/* @__PURE__ */ jsx(Tbody, { children: routes.map((route) => /* @__PURE__ */ jsxs(Tr, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: route.id }) }),
|
|
68
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: route.title }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: route.fullPath }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
|
|
71
|
+
id: getTranslation(`route.type.${getRouteType(route)}`),
|
|
72
|
+
defaultMessage: "-"
|
|
73
|
+
}) }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Flex, { gap: 2, justifyContent: "end", children: route.internal && /* @__PURE__ */ jsx(
|
|
75
|
+
LinkButton,
|
|
76
|
+
{
|
|
77
|
+
variant: "secondary",
|
|
78
|
+
startIcon: /* @__PURE__ */ jsx(Pencil, {}),
|
|
79
|
+
href: `/admin/content-manager/collection-types/${route.relatedContentType}/${route.relatedDocumentId}`,
|
|
80
|
+
children: formatMessage({
|
|
81
|
+
id: getTranslation("edit"),
|
|
82
|
+
defaultMessage: "Edit"
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
) }) })
|
|
86
|
+
] }, route.id)) })
|
|
87
|
+
] }) })
|
|
88
|
+
] });
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
Routes as default
|
|
92
|
+
};
|
|
@@ -4,13 +4,13 @@ import React__default, { useContext, useRef, useCallback, useDebugValue, useMemo
|
|
|
4
4
|
import { ArrowLeft, Eye, EyeStriked, WarningCircle, Filter, CaretDown, Check } from "@strapi/icons";
|
|
5
5
|
import { Link, Alert, Typography, Box, Flex, useCallbackRef, useComposedRefs, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Popover, Button, MultiSelect, MultiSelectOption, Accordion } from "@strapi/design-system";
|
|
6
6
|
import "react-dom/client";
|
|
7
|
-
import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs, _ as _baseConvert,
|
|
7
|
+
import { c as commonjsGlobal, g as getAugmentedNamespace, a as getDefaultExportFromCjs, _ as _baseConvert, r as requirePlaceholder } from "./_baseConvert-C2SW1VHq.mjs";
|
|
8
8
|
import { useLocation, useNavigate, NavLink } from "react-router-dom";
|
|
9
9
|
import { useIntl } from "react-intl";
|
|
10
10
|
import "@strapi/icons/symbols";
|
|
11
11
|
import ReactDOM__default, { unstable_batchedUpdates as unstable_batchedUpdates$1 } from "react-dom";
|
|
12
12
|
import { createGlobalStyle, styled } from "styled-components";
|
|
13
|
-
import { _ as _extends$4, b as usePluginConfig, c as useAllContentTypes, t as transformToUrl, T as Tooltip } from "./index-
|
|
13
|
+
import { _ as _extends$4, b as usePluginConfig, c as useAllContentTypes, t as transformToUrl, P as PLUGIN_NAME, g as getTranslation, T as Tooltip } from "./index-D981K4TK.mjs";
|
|
14
14
|
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
15
15
|
var _freeGlobal = freeGlobal$1;
|
|
16
16
|
var freeGlobal = _freeGlobal;
|
|
@@ -8603,10 +8603,10 @@ function composeArgsRight$2(args, partials, holders, isCurried) {
|
|
|
8603
8603
|
return result;
|
|
8604
8604
|
}
|
|
8605
8605
|
var _composeArgsRight = composeArgsRight$2;
|
|
8606
|
-
function countHolders$1(array2,
|
|
8606
|
+
function countHolders$1(array2, placeholder) {
|
|
8607
8607
|
var length = array2.length, result = 0;
|
|
8608
8608
|
while (length--) {
|
|
8609
|
-
if (array2[length] ===
|
|
8609
|
+
if (array2[length] === placeholder) {
|
|
8610
8610
|
++result;
|
|
8611
8611
|
}
|
|
8612
8612
|
}
|
|
@@ -8845,7 +8845,7 @@ function setWrapToString$2(wrapper, reference, bitmask) {
|
|
|
8845
8845
|
var _setWrapToString = setWrapToString$2;
|
|
8846
8846
|
var isLaziable = require_isLaziable(), setData$1 = _setData, setWrapToString$1 = _setWrapToString;
|
|
8847
8847
|
var WRAP_BIND_FLAG$4 = 1, WRAP_BIND_KEY_FLAG$3 = 2, WRAP_CURRY_BOUND_FLAG$1 = 4, WRAP_CURRY_FLAG$4 = 8, WRAP_PARTIAL_FLAG$1 = 32, WRAP_PARTIAL_RIGHT_FLAG$1 = 64;
|
|
8848
|
-
function createRecurry$2(func2, bitmask, wrapFunc,
|
|
8848
|
+
function createRecurry$2(func2, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
|
|
8849
8849
|
var isCurry = bitmask & WRAP_CURRY_FLAG$4, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials;
|
|
8850
8850
|
bitmask |= isCurry ? WRAP_PARTIAL_FLAG$1 : WRAP_PARTIAL_RIGHT_FLAG$1;
|
|
8851
8851
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$1 : WRAP_PARTIAL_FLAG$1);
|
|
@@ -8868,7 +8868,7 @@ function createRecurry$2(func2, bitmask, wrapFunc, placeholder2, thisArg, partia
|
|
|
8868
8868
|
if (isLaziable(func2)) {
|
|
8869
8869
|
setData$1(result, newData);
|
|
8870
8870
|
}
|
|
8871
|
-
result.placeholder =
|
|
8871
|
+
result.placeholder = placeholder;
|
|
8872
8872
|
return setWrapToString$1(result, func2, bitmask);
|
|
8873
8873
|
}
|
|
8874
8874
|
var _createRecurry = createRecurry$2;
|
|
@@ -8889,11 +8889,11 @@ function reorder$1(array2, indexes) {
|
|
|
8889
8889
|
}
|
|
8890
8890
|
var _reorder = reorder$1;
|
|
8891
8891
|
var PLACEHOLDER$1 = "__lodash_placeholder__";
|
|
8892
|
-
function replaceHolders$3(array2,
|
|
8892
|
+
function replaceHolders$3(array2, placeholder) {
|
|
8893
8893
|
var index = -1, length = array2.length, resIndex = 0, result = [];
|
|
8894
8894
|
while (++index < length) {
|
|
8895
8895
|
var value = array2[index];
|
|
8896
|
-
if (value ===
|
|
8896
|
+
if (value === placeholder || value === PLACEHOLDER$1) {
|
|
8897
8897
|
array2[index] = PLACEHOLDER$1;
|
|
8898
8898
|
result[resIndex++] = index;
|
|
8899
8899
|
}
|
|
@@ -8911,7 +8911,7 @@ function createHybrid$2(func2, bitmask, thisArg, partials, holders, partialsRigh
|
|
|
8911
8911
|
args[index] = arguments[index];
|
|
8912
8912
|
}
|
|
8913
8913
|
if (isCurried) {
|
|
8914
|
-
var
|
|
8914
|
+
var placeholder = getHolder$1(wrapper), holdersCount = countHolders(args, placeholder);
|
|
8915
8915
|
}
|
|
8916
8916
|
if (partials) {
|
|
8917
8917
|
args = composeArgs$1(args, partials, holders, isCurried);
|
|
@@ -8921,7 +8921,7 @@ function createHybrid$2(func2, bitmask, thisArg, partials, holders, partialsRigh
|
|
|
8921
8921
|
}
|
|
8922
8922
|
length -= holdersCount;
|
|
8923
8923
|
if (isCurried && length < arity) {
|
|
8924
|
-
var newHolders = replaceHolders$2(args,
|
|
8924
|
+
var newHolders = replaceHolders$2(args, placeholder);
|
|
8925
8925
|
return createRecurry$1(
|
|
8926
8926
|
func2,
|
|
8927
8927
|
bitmask,
|
|
@@ -8957,11 +8957,11 @@ var apply$2 = _apply, createCtor$1 = _createCtor, createHybrid$1 = _createHybrid
|
|
|
8957
8957
|
function createCurry$1(func2, bitmask, arity) {
|
|
8958
8958
|
var Ctor = createCtor$1(func2);
|
|
8959
8959
|
function wrapper() {
|
|
8960
|
-
var length = arguments.length, args = Array(length), index = length,
|
|
8960
|
+
var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper);
|
|
8961
8961
|
while (index--) {
|
|
8962
8962
|
args[index] = arguments[index];
|
|
8963
8963
|
}
|
|
8964
|
-
var holders = length < 3 && args[0] !==
|
|
8964
|
+
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders$1(args, placeholder);
|
|
8965
8965
|
length -= holders.length;
|
|
8966
8966
|
if (length < arity) {
|
|
8967
8967
|
return createRecurry(
|
|
@@ -9947,7 +9947,7 @@ function requireFlow() {
|
|
|
9947
9947
|
return flow_1;
|
|
9948
9948
|
}
|
|
9949
9949
|
var convert = convert_1, func = convert("flow", requireFlow());
|
|
9950
|
-
func.placeholder =
|
|
9950
|
+
func.placeholder = requirePlaceholder();
|
|
9951
9951
|
var flow = func;
|
|
9952
9952
|
var pipe = flow;
|
|
9953
9953
|
const pipe$1 = /* @__PURE__ */ getDefaultExportFromCjs(pipe);
|
|
@@ -16950,6 +16950,7 @@ const Settings = () => {
|
|
|
16950
16950
|
const { contentTypes: allContentTypesData } = useAllContentTypes();
|
|
16951
16951
|
const allContentTypes = allContentTypesData?.filter((ct) => ct.pluginOptions?.webatlas?.active === true);
|
|
16952
16952
|
const [initialState2, setInitialState] = useState(config || { selectedContentTypes: [] });
|
|
16953
|
+
const { formatMessage } = useIntl();
|
|
16953
16954
|
function reducer2(settingsState2, action) {
|
|
16954
16955
|
let updatedContentTypes;
|
|
16955
16956
|
switch (action.type) {
|
|
@@ -16992,8 +16993,11 @@ const Settings = () => {
|
|
|
16992
16993
|
/* @__PURE__ */ jsx(
|
|
16993
16994
|
Layouts.Header,
|
|
16994
16995
|
{
|
|
16995
|
-
title:
|
|
16996
|
-
subtitle:
|
|
16996
|
+
title: PLUGIN_NAME,
|
|
16997
|
+
subtitle: formatMessage({
|
|
16998
|
+
id: getTranslation("settings.page.subtitle"),
|
|
16999
|
+
defaultMessage: "Settings"
|
|
17000
|
+
}),
|
|
16997
17001
|
primaryAction: /* @__PURE__ */ jsx(
|
|
16998
17002
|
Button,
|
|
16999
17003
|
{
|
|
@@ -17001,7 +17005,10 @@ const Settings = () => {
|
|
|
17001
17005
|
startIcon: /* @__PURE__ */ jsx(Check, {}),
|
|
17002
17006
|
onClick: save,
|
|
17003
17007
|
disabled: JSON.stringify(settingsState) === JSON.stringify(initialState2) || settingsState.selectedContentTypes.find((cta) => !cta.default) !== void 0,
|
|
17004
|
-
children:
|
|
17008
|
+
children: formatMessage({
|
|
17009
|
+
id: getTranslation("save"),
|
|
17010
|
+
defaultMessage: "Save"
|
|
17011
|
+
})
|
|
17005
17012
|
}
|
|
17006
17013
|
)
|
|
17007
17014
|
}
|
|
@@ -17023,13 +17030,22 @@ const Settings = () => {
|
|
|
17023
17030
|
Field.Root,
|
|
17024
17031
|
{
|
|
17025
17032
|
name: "selectedContentTypes",
|
|
17026
|
-
hint:
|
|
17033
|
+
hint: formatMessage({
|
|
17034
|
+
id: getTranslation("settings.page.enabledContentTypes.hint"),
|
|
17035
|
+
defaultMessage: "Select the content types for which you want to enable URL aliases"
|
|
17036
|
+
}),
|
|
17027
17037
|
children: [
|
|
17028
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
17038
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
17039
|
+
id: getTranslation("settings.page.enabledContentTypes"),
|
|
17040
|
+
defaultMessage: "Enabled Content Types"
|
|
17041
|
+
}) }),
|
|
17029
17042
|
/* @__PURE__ */ jsx(
|
|
17030
17043
|
MultiSelect,
|
|
17031
17044
|
{
|
|
17032
|
-
placeholder:
|
|
17045
|
+
placeholder: formatMessage({
|
|
17046
|
+
id: getTranslation("settings.page.enabledContentTypes.placeholder"),
|
|
17047
|
+
defaultMessage: "Select content types..."
|
|
17048
|
+
}),
|
|
17033
17049
|
onClear: () => dispatch({ type: "SET_SELECTED_CONTENT_TYPES", payload: [] }),
|
|
17034
17050
|
value: [...settingsState.selectedContentTypes.map((ct) => ct.uid)],
|
|
17035
17051
|
onChange: (value) => dispatch({
|
|
@@ -17049,8 +17065,11 @@ const Settings = () => {
|
|
|
17049
17065
|
}
|
|
17050
17066
|
),
|
|
17051
17067
|
settingsState.selectedContentTypes && settingsState.selectedContentTypes.length > 0 && /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Field.Root, { name: "selectedContentTypesAccordion", children: [
|
|
17052
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
17053
|
-
|
|
17068
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
17069
|
+
id: getTranslation("settings.page.contentTypeSettings"),
|
|
17070
|
+
defaultMessage: "Content Type settings"
|
|
17071
|
+
}) }),
|
|
17072
|
+
/* @__PURE__ */ jsx(Accordion.Root, { children: settingsState.selectedContentTypes?.map((contentType) => {
|
|
17054
17073
|
const ct = allContentTypes?.find((item) => item.uid === contentType.uid);
|
|
17055
17074
|
if (!ct) return null;
|
|
17056
17075
|
return /* @__PURE__ */ jsx(
|
|
@@ -17064,11 +17083,20 @@ const Settings = () => {
|
|
|
17064
17083
|
Field.Root,
|
|
17065
17084
|
{
|
|
17066
17085
|
name: "selectedContentTypes",
|
|
17067
|
-
hint:
|
|
17068
|
-
|
|
17086
|
+
hint: formatMessage({
|
|
17087
|
+
id: getTranslation("settings.page.defaultField.hint"),
|
|
17088
|
+
defaultMessage: 'The selected field from the content type will be used to generate the URL alias. Use a field that is unique and descriptive, such as a "title" or "name".'
|
|
17089
|
+
}),
|
|
17090
|
+
error: !contentType.default && formatMessage({
|
|
17091
|
+
id: getTranslation("settings.page.defaultField.error"),
|
|
17092
|
+
defaultMessage: "Please select a default field"
|
|
17093
|
+
}),
|
|
17069
17094
|
required: true,
|
|
17070
17095
|
children: [
|
|
17071
|
-
/* @__PURE__ */ jsx(Field.Label, { children:
|
|
17096
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
17097
|
+
id: getTranslation("settings.page.defaultField"),
|
|
17098
|
+
defaultMessage: "Default URL Alias field"
|
|
17099
|
+
}) }),
|
|
17072
17100
|
/* @__PURE__ */ jsx(
|
|
17073
17101
|
SingleSelect,
|
|
17074
17102
|
{
|
|
@@ -17077,7 +17105,7 @@ const Settings = () => {
|
|
|
17077
17105
|
value: contentType?.default || "",
|
|
17078
17106
|
onChange: (value) => dispatch({ type: "SET_DEFAULT_FIELD", payload: { ctUid: ct.uid, field: value } }),
|
|
17079
17107
|
children: Object.entries(ct.attributes).map(([key], index) => {
|
|
17080
|
-
if (key === "id" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy") return null;
|
|
17108
|
+
if (key === "id" || key === "documentId" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy" || key === "webatlas_path" || key === "webatlas_override") return null;
|
|
17081
17109
|
return /* @__PURE__ */ jsx(SingleSelectOption, { value: key, children: key }, index);
|
|
17082
17110
|
})
|
|
17083
17111
|
}
|
|
@@ -17090,11 +17118,20 @@ const Settings = () => {
|
|
|
17090
17118
|
Field.Root,
|
|
17091
17119
|
{
|
|
17092
17120
|
name: "urlAliasPattern",
|
|
17093
|
-
hint:
|
|
17121
|
+
hint: formatMessage({
|
|
17122
|
+
id: getTranslation("settings.page.urlAliasPattern.hint"),
|
|
17123
|
+
defaultMessage: 'The pattern to prepend to the generated URL alias. For example, if you enter "blog" and the value of default field is "My First Post", the generated URL alias will be "blog/my-first-post". Leave empty for no prefix.'
|
|
17124
|
+
}),
|
|
17094
17125
|
children: [
|
|
17095
17126
|
/* @__PURE__ */ jsxs(Field.Label, { children: [
|
|
17096
|
-
|
|
17097
|
-
|
|
17127
|
+
formatMessage({
|
|
17128
|
+
id: getTranslation("settings.page.urlAliasPattern"),
|
|
17129
|
+
defaultMessage: "URL Alias Pattern"
|
|
17130
|
+
}),
|
|
17131
|
+
/* @__PURE__ */ jsx(Tooltip, { description: formatMessage({
|
|
17132
|
+
id: getTranslation("settings.page.urlAliasPattern.tooltip"),
|
|
17133
|
+
defaultMessage: "Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded."
|
|
17134
|
+
}) })
|
|
17098
17135
|
] }),
|
|
17099
17136
|
/* @__PURE__ */ jsx(
|
|
17100
17137
|
Field.Input,
|
|
@@ -17103,7 +17140,10 @@ const Settings = () => {
|
|
|
17103
17140
|
onChange: (e2) => dispatch({ type: "SET_PATTERN", payload: { ctUid: ct.uid, pattern: e2.target.value } }),
|
|
17104
17141
|
disabled: !contentType.default,
|
|
17105
17142
|
type: "text",
|
|
17106
|
-
placeholder:
|
|
17143
|
+
placeholder: formatMessage({
|
|
17144
|
+
id: getTranslation("settings.page.urlAliasPattern.placeholder"),
|
|
17145
|
+
defaultMessage: "e.g. blog"
|
|
17146
|
+
})
|
|
17107
17147
|
}
|
|
17108
17148
|
),
|
|
17109
17149
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
@@ -17127,4 +17167,4 @@ const Settings = () => {
|
|
|
17127
17167
|
export {
|
|
17128
17168
|
Settings as default
|
|
17129
17169
|
};
|
|
17130
|
-
//# sourceMappingURL=index-
|
|
17170
|
+
//# sourceMappingURL=index-B48CGofU.mjs.map
|