@littlebox/strapi-suite 1.0.33 → 1.0.35
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 +154 -33
- package/dist/_chunks/{App-CXitaGLI.mjs → App-2SwRpCFC.mjs} +214 -27
- package/dist/_chunks/{App-BwtvAoMl.js → App-DBXgA-D1.js} +213 -26
- package/dist/_chunks/{SlugInput-DvuzCwKx.mjs → SlugInput-BcUe-oCY.mjs} +2 -2
- package/dist/_chunks/{SlugInput-0Vo-U5cA.js → SlugInput-CVnNz0al.js} +2 -2
- package/dist/_chunks/{convertToSlug-DGSdTBaK.js → convertToSlug-Btfca6aI.js} +1 -1
- package/dist/_chunks/{convertToSlug-CRnBMJHB.mjs → convertToSlug-q9_W-VMA.mjs} +1 -1
- package/dist/_chunks/{en-Bz6GsXYT.js → en-CGJcJfk1.js} +6 -0
- package/dist/_chunks/{en-RUOaam8y.mjs → en-CRSiVe4w.mjs} +6 -0
- package/dist/_chunks/{index-BBTYu57z.mjs → index-DmkEUACh.mjs} +10 -6
- package/dist/_chunks/{index-BZqSioMv.js → index-Pylfg-hk.js} +7 -3
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/SlugSettingsModal.d.ts +7 -1
- package/dist/admin/src/core/config.d.ts +2 -0
- package/dist/server/index.js +199 -31
- package/dist/server/index.mjs +199 -31
- package/dist/server/src/config/index.d.ts +2 -0
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/controllers/modules/slug.d.ts +1 -0
- package/dist/server/src/index.d.ts +5 -6
- package/dist/server/src/services/index.d.ts +4 -6
- package/dist/server/src/services/modules/slug.d.ts +4 -6
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const reactRouterDom = require("react-router-dom");
|
|
5
5
|
const React = require("react");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-Pylfg-hk.js");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
10
|
const styled = require("styled-components");
|
|
11
11
|
const symbols = require("@strapi/icons/symbols");
|
|
12
|
-
const convertToSlug = require("./convertToSlug-
|
|
12
|
+
const convertToSlug = require("./convertToSlug-Btfca6aI.js");
|
|
13
13
|
const core = require("@dnd-kit/core");
|
|
14
14
|
const sortable = require("@dnd-kit/sortable");
|
|
15
15
|
const modifiers = require("@dnd-kit/modifiers");
|
|
@@ -930,27 +930,60 @@ const ConfirmModal = ({ open, title, text, confirm, cancel }) => {
|
|
|
930
930
|
] }) }) })
|
|
931
931
|
] }) }) });
|
|
932
932
|
};
|
|
933
|
-
const
|
|
933
|
+
const BoxInput$7 = styled__default.default(designSystem.Box)`
|
|
934
|
+
& > div {
|
|
935
|
+
width: 100%;
|
|
936
|
+
}
|
|
937
|
+
`;
|
|
938
|
+
const SlugSettingsModal = ({ open, close, defaultLocale }) => {
|
|
934
939
|
const [module2, setModule] = React.useState(index.config.uuid.modules.slug);
|
|
935
940
|
const [hidden, setHidden] = React.useState(true);
|
|
936
|
-
const [
|
|
941
|
+
const [showDefaultLanguage, setShowDefaultLanguage] = React.useState(true);
|
|
942
|
+
const [selectedContent, setSelectedContent] = React.useState();
|
|
943
|
+
const [selectedStrategy, setSelectedStrategy] = React.useState(index.SLUG_LANGUAGE_STRATEGY);
|
|
944
|
+
const [pages, setPages] = React.useState([]);
|
|
945
|
+
const [saveInProgress, setSaveInProgress] = React.useState(false);
|
|
937
946
|
const { formatMessage } = reactIntl.useIntl();
|
|
938
947
|
const settings = useSettings();
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
948
|
+
function updateSetting(property, value) {
|
|
949
|
+
const updateSetting2 = new UpdateSetting();
|
|
950
|
+
updateSetting2.execute({ property, module: module2, value });
|
|
951
|
+
}
|
|
952
|
+
function handleChangeSelectedContent(value) {
|
|
953
|
+
const page = pages.find((page2) => page2.id == value);
|
|
954
|
+
setSelectedContent(page);
|
|
955
|
+
}
|
|
956
|
+
function save() {
|
|
957
|
+
updateSetting("showDefaultLanguage", showDefaultLanguage);
|
|
958
|
+
updateSetting("homepageContentId", selectedContent?.contentId);
|
|
959
|
+
updateSetting("homepageContentModel", selectedContent?.contentModel);
|
|
960
|
+
updateSetting("homepageSlugStrategy", selectedStrategy);
|
|
961
|
+
close();
|
|
962
|
+
}
|
|
963
|
+
async function fetchSlugs() {
|
|
964
|
+
const fetchSlugs2 = new index.FetchSlugs();
|
|
965
|
+
const outputFetchSlugs = await fetchSlugs2.execute({ locale: defaultLocale.code });
|
|
966
|
+
setPages(outputFetchSlugs);
|
|
947
967
|
}
|
|
968
|
+
React.useEffect(() => {
|
|
969
|
+
if (defaultLocale) {
|
|
970
|
+
fetchSlugs();
|
|
971
|
+
}
|
|
972
|
+
}, [defaultLocale]);
|
|
948
973
|
React.useEffect(() => {
|
|
949
974
|
setHidden(!open);
|
|
950
975
|
}, [open]);
|
|
951
976
|
React.useEffect(() => {
|
|
952
|
-
|
|
953
|
-
|
|
977
|
+
const currentShowDefaultLanguage = settings.provide("slug").showDefaultLanguage;
|
|
978
|
+
const currentHomepageSlugStrategy = settings.provide("slug").homepageSlugStrategy;
|
|
979
|
+
setShowDefaultLanguage(currentShowDefaultLanguage);
|
|
980
|
+
setSelectedStrategy(currentHomepageSlugStrategy);
|
|
981
|
+
}, []);
|
|
982
|
+
React.useEffect(() => {
|
|
983
|
+
const currentHomePage = settings.provide("slug").homepageContentId;
|
|
984
|
+
const page = pages.find((page2) => page2.contentId == currentHomePage);
|
|
985
|
+
setSelectedContent(page);
|
|
986
|
+
}, [pages]);
|
|
954
987
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hidden && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { defaultOpen: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
|
955
988
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { style: { textAlign: "left" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { style: { width: "100%", justifyContent: "space-between" }, children: [
|
|
956
989
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
@@ -960,20 +993,140 @@ const SlugSettingsModal = ({ open, close }) => {
|
|
|
960
993
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { variant: "tertiary", onClick: close, label: "Close", borderWidth: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
|
|
961
994
|
] }) }),
|
|
962
995
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { display: "flex", flexDirection: "column", width: "100%" }, children: [
|
|
963
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
996
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px" }, children: formatMessage({
|
|
964
997
|
id: index.getTranslation(
|
|
965
998
|
`module.${module2}.modal.settings.input.default-language.title`
|
|
966
999
|
),
|
|
967
1000
|
defaultMessage: "Show language slug"
|
|
968
|
-
}) })
|
|
969
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1001
|
+
}) }),
|
|
1002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1003
|
+
designSystem.Typography,
|
|
1004
|
+
{
|
|
1005
|
+
variant: "pi",
|
|
1006
|
+
style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
|
|
1007
|
+
children: formatMessage({
|
|
1008
|
+
id: index.getTranslation(
|
|
1009
|
+
`module.${module2}.modal.settings.input.default-language.description`
|
|
1010
|
+
),
|
|
1011
|
+
defaultMessage: "Show language slug for default language in site url"
|
|
1012
|
+
})
|
|
1013
|
+
}
|
|
1014
|
+
),
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1016
|
+
designSystem.Toggle,
|
|
1017
|
+
{
|
|
1018
|
+
onLabel: "True",
|
|
1019
|
+
offLabel: "False",
|
|
1020
|
+
checked: showDefaultLanguage,
|
|
1021
|
+
onChange: (e) => setShowDefaultLanguage(e.target.checked)
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px", paddingTop: "24px" }, children: formatMessage({
|
|
1025
|
+
id: index.getTranslation(`module.${module2}.modal.settings.input.homepage.title`),
|
|
1026
|
+
defaultMessage: "Home page"
|
|
1027
|
+
}) }),
|
|
1028
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1029
|
+
designSystem.Typography,
|
|
1030
|
+
{
|
|
1031
|
+
variant: "pi",
|
|
1032
|
+
style: { paddingBottom: "5px", color: "#a5a5ba", display: "flex" },
|
|
1033
|
+
children: formatMessage({
|
|
1034
|
+
id: index.getTranslation(
|
|
1035
|
+
`module.${module2}.modal.settings.input.homepage.description`
|
|
1036
|
+
),
|
|
1037
|
+
defaultMessage: "The content that will be rendered as the homepage"
|
|
1038
|
+
})
|
|
1039
|
+
}
|
|
1040
|
+
),
|
|
1041
|
+
/* @__PURE__ */ jsxRuntime.jsx(BoxInput$7, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1042
|
+
designSystem.SingleSelect,
|
|
1043
|
+
{
|
|
1044
|
+
onChange: (value) => handleChangeSelectedContent(value),
|
|
1045
|
+
value: selectedContent?.id,
|
|
1046
|
+
children: pages.map((page, index2) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: page.id, children: page.contentTitle }, index2))
|
|
1047
|
+
}
|
|
1048
|
+
) }),
|
|
1049
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", style: { paddingBottom: "5px", paddingTop: "24px" }, children: formatMessage({
|
|
970
1050
|
id: index.getTranslation(
|
|
971
|
-
`module.${module2}.modal.settings.input.
|
|
1051
|
+
`module.${module2}.modal.settings.input.homepage-strategy.title`
|
|
972
1052
|
),
|
|
973
|
-
defaultMessage: "
|
|
974
|
-
}) })
|
|
975
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
976
|
-
|
|
1053
|
+
defaultMessage: "Home page slug strategy"
|
|
1054
|
+
}) }),
|
|
1055
|
+
/* @__PURE__ */ jsxRuntime.jsx(BoxInput$7, { style: { flex: 1, display: "flex", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1056
|
+
designSystem.SingleSelect,
|
|
1057
|
+
{
|
|
1058
|
+
onChange: (value) => setSelectedStrategy(value),
|
|
1059
|
+
value: selectedStrategy,
|
|
1060
|
+
children: [
|
|
1061
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: index.SLUG_LANGUAGE_STRATEGY, children: "Language" }),
|
|
1062
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: index.SLUG_CONTENT_STRATEGY, children: "Content" })
|
|
1063
|
+
]
|
|
1064
|
+
}
|
|
1065
|
+
) }),
|
|
1066
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1067
|
+
designSystem.Card,
|
|
1068
|
+
{
|
|
1069
|
+
shadow: false,
|
|
1070
|
+
style: {
|
|
1071
|
+
marginTop: "10px",
|
|
1072
|
+
padding: "10px",
|
|
1073
|
+
display: "flex",
|
|
1074
|
+
alignItems: "center"
|
|
1075
|
+
},
|
|
1076
|
+
children: [
|
|
1077
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1078
|
+
"svg",
|
|
1079
|
+
{
|
|
1080
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1081
|
+
width: "24",
|
|
1082
|
+
fill: "none",
|
|
1083
|
+
viewBox: "0 0 24 24",
|
|
1084
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1085
|
+
"path",
|
|
1086
|
+
{
|
|
1087
|
+
fill: "#7b79ff",
|
|
1088
|
+
d: "M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12 12-5.383 12-12S18.617 0 12 0Zm1.154 18.456h-2.308V16.15h2.308v2.307Zm-.23-3.687h-1.847l-.346-9.23h2.538l-.346 9.23Z"
|
|
1089
|
+
}
|
|
1090
|
+
)
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
selectedStrategy === index.SLUG_LANGUAGE_STRATEGY && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1094
|
+
designSystem.Typography,
|
|
1095
|
+
{
|
|
1096
|
+
variant: "pi",
|
|
1097
|
+
style: { color: "#a5a5ba", display: "flex", marginLeft: "10px" },
|
|
1098
|
+
children: formatMessage({
|
|
1099
|
+
id: index.getTranslation(
|
|
1100
|
+
`module.${module2}.modal.settings.input.homepage-strategy.description.language`
|
|
1101
|
+
),
|
|
1102
|
+
defaultMessage: "Use the language slug and ignore the content slug set as the homepage"
|
|
1103
|
+
})
|
|
1104
|
+
}
|
|
1105
|
+
),
|
|
1106
|
+
selectedStrategy === index.SLUG_CONTENT_STRATEGY && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1107
|
+
designSystem.Typography,
|
|
1108
|
+
{
|
|
1109
|
+
variant: "pi",
|
|
1110
|
+
style: { color: "#a5a5ba", display: "flex", marginLeft: "10px" },
|
|
1111
|
+
children: formatMessage({
|
|
1112
|
+
id: index.getTranslation(
|
|
1113
|
+
`module.${module2}.modal.settings.input.homepage-strategy.description.content`
|
|
1114
|
+
),
|
|
1115
|
+
defaultMessage: "Use the slug of the content set as the homepage"
|
|
1116
|
+
})
|
|
1117
|
+
}
|
|
1118
|
+
)
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
] }) }),
|
|
1123
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { style: { justifyContent: "end" }, children: [
|
|
1124
|
+
saveInProgress && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true }),
|
|
1125
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { style: { marginRight: "5px" }, onClick: save, disabled: saveInProgress, children: formatMessage({
|
|
1126
|
+
id: index.getTranslation(`module.${module2}.modal.settings.button.save`),
|
|
1127
|
+
defaultMessage: "Save"
|
|
1128
|
+
}) })
|
|
1129
|
+
] })
|
|
977
1130
|
] }) }) });
|
|
978
1131
|
};
|
|
979
1132
|
const SlugSettingsPage = () => {
|
|
@@ -982,11 +1135,13 @@ const SlugSettingsPage = () => {
|
|
|
982
1135
|
const [filteredRecords, setFilteredRecords] = React.useState([]);
|
|
983
1136
|
const [i18nLocales, setI18nLocales] = React.useState([]);
|
|
984
1137
|
const [currentI18nLocale, setCurrentI18nLocale] = React.useState();
|
|
1138
|
+
const [defaultLocale, setDefaultLocale] = React.useState();
|
|
985
1139
|
const [fetchInProgress, setFetchInProgress] = React.useState(true);
|
|
986
1140
|
const [showConfirmModal, setShowConfirmModal] = React.useState(false);
|
|
987
1141
|
const [showSettingsModal, setShowSettingsModal] = React.useState(false);
|
|
988
1142
|
const [selectedRecords, setSelectedRecords] = React.useState([]);
|
|
989
1143
|
const [searchTerm, setSearchTerm] = React.useState("");
|
|
1144
|
+
const [currentHomePage, setCurrentHomePage] = React.useState();
|
|
990
1145
|
const { formatMessage } = reactIntl.useIntl();
|
|
991
1146
|
const settings = useSettings();
|
|
992
1147
|
async function toggleState(value) {
|
|
@@ -1007,7 +1162,9 @@ const SlugSettingsPage = () => {
|
|
|
1007
1162
|
async function fetchLocales() {
|
|
1008
1163
|
const fetchLocales2 = new convertToSlug.FetchLocales();
|
|
1009
1164
|
const fetchLocalesOutput = await fetchLocales2.execute();
|
|
1165
|
+
const defaultLocale2 = fetchLocalesOutput.find((locale) => locale.isDefault);
|
|
1010
1166
|
setI18nLocales(fetchLocalesOutput);
|
|
1167
|
+
setDefaultLocale(defaultLocale2);
|
|
1011
1168
|
}
|
|
1012
1169
|
async function fetchRecords() {
|
|
1013
1170
|
setFetchInProgress(true);
|
|
@@ -1051,6 +1208,10 @@ const SlugSettingsPage = () => {
|
|
|
1051
1208
|
const parent = records.find((record) => record.contentId === parentId);
|
|
1052
1209
|
return parent?.contentTitle;
|
|
1053
1210
|
}
|
|
1211
|
+
function getCurrentHomePage() {
|
|
1212
|
+
const currentHomePage2 = settings.provide("slug").homepageContentId;
|
|
1213
|
+
setCurrentHomePage(currentHomePage2);
|
|
1214
|
+
}
|
|
1054
1215
|
React.useEffect(() => {
|
|
1055
1216
|
const timer = setTimeout(() => {
|
|
1056
1217
|
if (records.length > 0) {
|
|
@@ -1071,6 +1232,9 @@ const SlugSettingsPage = () => {
|
|
|
1071
1232
|
fetchRecords();
|
|
1072
1233
|
}
|
|
1073
1234
|
}, [currentI18nLocale]);
|
|
1235
|
+
React.useEffect(() => {
|
|
1236
|
+
getCurrentHomePage();
|
|
1237
|
+
}, [settings]);
|
|
1074
1238
|
React.useEffect(() => {
|
|
1075
1239
|
fetchLocales();
|
|
1076
1240
|
}, []);
|
|
@@ -1190,7 +1354,25 @@ const SlugSettingsPage = () => {
|
|
|
1190
1354
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: entry.id }) }),
|
|
1191
1355
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: entry.locale }) }),
|
|
1192
1356
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: entry.slug }) }),
|
|
1193
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.
|
|
1357
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { display: "flex", alignItems: "center" }, children: [
|
|
1358
|
+
entry.contentId === currentHomePage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1359
|
+
designSystem.Box,
|
|
1360
|
+
{
|
|
1361
|
+
style: {
|
|
1362
|
+
display: "flex",
|
|
1363
|
+
alignItems: "center",
|
|
1364
|
+
justifyContent: "center",
|
|
1365
|
+
backgroundColor: "#7b79ff",
|
|
1366
|
+
color: "#fff",
|
|
1367
|
+
borderRadius: "4px",
|
|
1368
|
+
padding: "3px 8px",
|
|
1369
|
+
marginRight: "10px"
|
|
1370
|
+
},
|
|
1371
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", children: "Homepage" })
|
|
1372
|
+
}
|
|
1373
|
+
),
|
|
1374
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: entry.contentTitle })
|
|
1375
|
+
] }) }),
|
|
1194
1376
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { textColor: "neutral800", children: [
|
|
1195
1377
|
!entry.parentContentId && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "--" }),
|
|
1196
1378
|
entry.parentContentId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1288,7 +1470,14 @@ const SlugSettingsPage = () => {
|
|
|
1288
1470
|
}
|
|
1289
1471
|
}
|
|
1290
1472
|
),
|
|
1291
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1474
|
+
SlugSettingsModal,
|
|
1475
|
+
{
|
|
1476
|
+
defaultLocale,
|
|
1477
|
+
open: showSettingsModal,
|
|
1478
|
+
close: () => setShowSettingsModal(false)
|
|
1479
|
+
}
|
|
1480
|
+
)
|
|
1292
1481
|
]
|
|
1293
1482
|
}
|
|
1294
1483
|
);
|
|
@@ -2687,8 +2876,6 @@ function MenuEditItem(props) {
|
|
|
2687
2876
|
setContents(outputFetchSlugs);
|
|
2688
2877
|
}
|
|
2689
2878
|
function dispatchOnChangeEvent(form2) {
|
|
2690
|
-
console.log("dispatchOnChangeEvent:");
|
|
2691
|
-
console.log(form2);
|
|
2692
2879
|
if (!form2 || form2 && isEmpty(form2.title) || form2 && isEmpty(form2.target) || form2 && isEmpty(form2.url) && isEmpty(form2.contentId)) {
|
|
2693
2880
|
props.onCheckEvent(false);
|
|
2694
2881
|
} else {
|
|
@@ -6,8 +6,8 @@ import { useComposedRefs, Field, Box, Typography, TextInput, IconButton, Button
|
|
|
6
6
|
import { Pin, Cross } from "@strapi/icons";
|
|
7
7
|
import { useFocusInputField, unstable_useContentManagerContext } from "@strapi/strapi/admin";
|
|
8
8
|
import styled from "styled-components";
|
|
9
|
-
import { R as Registry, P as PageAttributeUpdated, D as DocumentCustomFieldStarted,
|
|
10
|
-
import { c as convertToSlug, F as FetchLocales } from "./convertToSlug-
|
|
9
|
+
import { R as Registry, P as PageAttributeUpdated, D as DocumentCustomFieldStarted, d as PluginIcon, g as getTranslation, c as config, e as FetchModuleSettings } from "./index-DmkEUACh.mjs";
|
|
10
|
+
import { c as convertToSlug, F as FetchLocales } from "./convertToSlug-q9_W-VMA.mjs";
|
|
11
11
|
const BoxInput = styled(Box)`
|
|
12
12
|
& > div {
|
|
13
13
|
width: 100%;
|
|
@@ -8,8 +8,8 @@ const designSystem = require("@strapi/design-system");
|
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
const admin = require("@strapi/strapi/admin");
|
|
10
10
|
const styled = require("styled-components");
|
|
11
|
-
const index = require("./index-
|
|
12
|
-
const convertToSlug = require("./convertToSlug-
|
|
11
|
+
const index = require("./index-Pylfg-hk.js");
|
|
12
|
+
const convertToSlug = require("./convertToSlug-Btfca6aI.js");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
14
|
function _interopNamespace(e) {
|
|
15
15
|
if (e && e.__esModule) return e;
|
|
@@ -55,6 +55,12 @@ const en = {
|
|
|
55
55
|
"littlebox-strapi-suite.module.slug.modal.settings.title": "Settings",
|
|
56
56
|
"littlebox-strapi-suite.module.slug.modal.settings.input.default-language.title": "Show language slug",
|
|
57
57
|
"littlebox-strapi-suite.module.slug.modal.settings.input.default-language.description": "Show language slug for default language in site url",
|
|
58
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage.title": "Home page",
|
|
59
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage.description": "The content that will be rendered as the homepage",
|
|
60
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.title": "Home page slug strategy",
|
|
61
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.description.language": "Use the language slug and ignore the content slug set as the homepage",
|
|
62
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.description.content": "Use the slug of the content set as the homepage",
|
|
63
|
+
"littlebox-strapi-suite.module.slug.modal.settings.button.save": "Save",
|
|
58
64
|
"littlebox-strapi-suite.module.attribute.name": "Attribute",
|
|
59
65
|
"littlebox-strapi-suite.module.attribute.description": "Effortlessly customize any page with simple and flexible attribute options.",
|
|
60
66
|
"littlebox-strapi-suite.module.attribute.panel.title": "Page Attributes",
|
|
@@ -53,6 +53,12 @@ const en = {
|
|
|
53
53
|
"littlebox-strapi-suite.module.slug.modal.settings.title": "Settings",
|
|
54
54
|
"littlebox-strapi-suite.module.slug.modal.settings.input.default-language.title": "Show language slug",
|
|
55
55
|
"littlebox-strapi-suite.module.slug.modal.settings.input.default-language.description": "Show language slug for default language in site url",
|
|
56
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage.title": "Home page",
|
|
57
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage.description": "The content that will be rendered as the homepage",
|
|
58
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.title": "Home page slug strategy",
|
|
59
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.description.language": "Use the language slug and ignore the content slug set as the homepage",
|
|
60
|
+
"littlebox-strapi-suite.module.slug.modal.settings.input.homepage-strategy.description.content": "Use the slug of the content set as the homepage",
|
|
61
|
+
"littlebox-strapi-suite.module.slug.modal.settings.button.save": "Save",
|
|
56
62
|
"littlebox-strapi-suite.module.attribute.name": "Attribute",
|
|
57
63
|
"littlebox-strapi-suite.module.attribute.description": "Effortlessly customize any page with simple and flexible attribute options.",
|
|
58
64
|
"littlebox-strapi-suite.module.attribute.panel.title": "Page Attributes",
|
|
@@ -2597,6 +2597,8 @@ function makeNodesHash(arr) {
|
|
|
2597
2597
|
return res;
|
|
2598
2598
|
}
|
|
2599
2599
|
const PLUGIN_ID = "littlebox-strapi-suite";
|
|
2600
|
+
const SLUG_LANGUAGE_STRATEGY = "language";
|
|
2601
|
+
const SLUG_CONTENT_STRATEGY = "content";
|
|
2600
2602
|
const config = {
|
|
2601
2603
|
pluginId: PLUGIN_ID,
|
|
2602
2604
|
uuid: {
|
|
@@ -3301,7 +3303,7 @@ const index = {
|
|
|
3301
3303
|
defaultMessage: config.pluginId
|
|
3302
3304
|
},
|
|
3303
3305
|
position: 999,
|
|
3304
|
-
Component: () => import("./App-
|
|
3306
|
+
Component: () => import("./App-2SwRpCFC.mjs")
|
|
3305
3307
|
});
|
|
3306
3308
|
app.customFields.register({
|
|
3307
3309
|
name: "ltbslug",
|
|
@@ -3319,7 +3321,7 @@ const index = {
|
|
|
3319
3321
|
components: {
|
|
3320
3322
|
Input: async () => import(
|
|
3321
3323
|
/* webpackChunkName: "input-slug-component" */
|
|
3322
|
-
"./SlugInput-
|
|
3324
|
+
"./SlugInput-BcUe-oCY.mjs"
|
|
3323
3325
|
)
|
|
3324
3326
|
},
|
|
3325
3327
|
options: {
|
|
@@ -3371,7 +3373,7 @@ const index = {
|
|
|
3371
3373
|
return Promise.all(
|
|
3372
3374
|
locales.map(async (locale) => {
|
|
3373
3375
|
try {
|
|
3374
|
-
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./core/translations/en.json": () => import("./en-
|
|
3376
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./core/translations/en.json": () => import("./en-CRSiVe4w.mjs") }), `./core/translations/${locale}.json`, 4);
|
|
3375
3377
|
return { data, locale };
|
|
3376
3378
|
} catch {
|
|
3377
3379
|
return { data: {}, locale };
|
|
@@ -3398,10 +3400,12 @@ export {
|
|
|
3398
3400
|
FetchSettings as F,
|
|
3399
3401
|
PageAttributeUpdated as P,
|
|
3400
3402
|
Registry as R,
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
+
SLUG_LANGUAGE_STRATEGY as S,
|
|
3404
|
+
SLUG_CONTENT_STRATEGY as a,
|
|
3405
|
+
FetchSlugs as b,
|
|
3403
3406
|
config as c,
|
|
3404
|
-
|
|
3407
|
+
PluginIcon as d,
|
|
3408
|
+
FetchModuleSettings as e,
|
|
3405
3409
|
fetchTemplates as f,
|
|
3406
3410
|
getTranslation as g,
|
|
3407
3411
|
index as i
|
|
@@ -2600,6 +2600,8 @@ function makeNodesHash(arr) {
|
|
|
2600
2600
|
return res;
|
|
2601
2601
|
}
|
|
2602
2602
|
const PLUGIN_ID = "littlebox-strapi-suite";
|
|
2603
|
+
const SLUG_LANGUAGE_STRATEGY = "language";
|
|
2604
|
+
const SLUG_CONTENT_STRATEGY = "content";
|
|
2603
2605
|
const config = {
|
|
2604
2606
|
pluginId: PLUGIN_ID,
|
|
2605
2607
|
uuid: {
|
|
@@ -3304,7 +3306,7 @@ const index = {
|
|
|
3304
3306
|
defaultMessage: config.pluginId
|
|
3305
3307
|
},
|
|
3306
3308
|
position: 999,
|
|
3307
|
-
Component: () => Promise.resolve().then(() => require("./App-
|
|
3309
|
+
Component: () => Promise.resolve().then(() => require("./App-DBXgA-D1.js"))
|
|
3308
3310
|
});
|
|
3309
3311
|
app.customFields.register({
|
|
3310
3312
|
name: "ltbslug",
|
|
@@ -3322,7 +3324,7 @@ const index = {
|
|
|
3322
3324
|
components: {
|
|
3323
3325
|
Input: async () => Promise.resolve().then(() => require(
|
|
3324
3326
|
/* webpackChunkName: "input-slug-component" */
|
|
3325
|
-
"./SlugInput-
|
|
3327
|
+
"./SlugInput-CVnNz0al.js"
|
|
3326
3328
|
))
|
|
3327
3329
|
},
|
|
3328
3330
|
options: {
|
|
@@ -3374,7 +3376,7 @@ const index = {
|
|
|
3374
3376
|
return Promise.all(
|
|
3375
3377
|
locales.map(async (locale) => {
|
|
3376
3378
|
try {
|
|
3377
|
-
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./core/translations/en.json": () => Promise.resolve().then(() => require("./en-
|
|
3379
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./core/translations/en.json": () => Promise.resolve().then(() => require("./en-CGJcJfk1.js")) }), `./core/translations/${locale}.json`, 4);
|
|
3378
3380
|
return { data, locale };
|
|
3379
3381
|
} catch {
|
|
3380
3382
|
return { data: {}, locale };
|
|
@@ -3403,6 +3405,8 @@ exports.FetchSlugs = FetchSlugs;
|
|
|
3403
3405
|
exports.PageAttributeUpdated = PageAttributeUpdated;
|
|
3404
3406
|
exports.PluginIcon = PluginIcon;
|
|
3405
3407
|
exports.Registry = Registry;
|
|
3408
|
+
exports.SLUG_CONTENT_STRATEGY = SLUG_CONTENT_STRATEGY;
|
|
3409
|
+
exports.SLUG_LANGUAGE_STRATEGY = SLUG_LANGUAGE_STRATEGY;
|
|
3406
3410
|
exports.config = config;
|
|
3407
3411
|
exports.fetchTemplates = fetchTemplates;
|
|
3408
3412
|
exports.getTranslation = getTranslation;
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { Output as OutputFetchLocales } from '../core/usecases/fetchLocales';
|
|
2
|
+
interface Props {
|
|
3
|
+
defaultLocale: OutputFetchLocales;
|
|
4
|
+
open: boolean;
|
|
5
|
+
close: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const SlugSettingsModal: ({ open, close, defaultLocale }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
2
8
|
export default SlugSettingsModal;
|