@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.
Files changed (69) hide show
  1. package/README.md +2 -3
  2. package/dist/_chunks/{_baseConvert-DVIhGQH6.js.map → _baseConvert-B84_vf8X.js.map} +1 -1
  3. package/dist/_chunks/{_baseConvert-CDjccxdO.mjs.map → _baseConvert-C2SW1VHq.mjs.map} +1 -1
  4. package/dist/_chunks/de-4tL_cJTC.js +104 -0
  5. package/dist/_chunks/de-4tL_cJTC.js.map +1 -0
  6. package/dist/_chunks/de-C8PE3n3B.mjs +104 -0
  7. package/dist/_chunks/de-C8PE3n3B.mjs.map +1 -0
  8. package/dist/_chunks/en-Bg4z3fR7.js +104 -0
  9. package/dist/_chunks/en-Bg4z3fR7.js.map +1 -0
  10. package/dist/_chunks/en-CR1YZvJo.mjs +104 -0
  11. package/dist/_chunks/en-CR1YZvJo.mjs.map +1 -0
  12. package/dist/_chunks/{index-B-ABW-o6.js → index-B0XE_zRP.js} +298 -91
  13. package/dist/_chunks/index-B2Tiv3EK.mjs +92 -0
  14. package/dist/_chunks/{index-HHBjOGX5.mjs → index-B48CGofU.mjs} +70 -30
  15. package/dist/_chunks/{index-HHBjOGX5.mjs.map → index-B48CGofU.mjs.map} +1 -1
  16. package/dist/_chunks/{index-CAjBRbaH.js → index-B85fJxGa.js} +170 -77
  17. package/dist/_chunks/{index-Cs_oxZfX.js → index-BbM9Sn1t.js} +169 -108
  18. package/dist/_chunks/{index-BxuR805w.mjs → index-BocSkZOu.mjs} +57 -17
  19. package/dist/_chunks/{index-D_OdzeaU.mjs → index-C7B8QHDT.mjs} +296 -89
  20. package/dist/_chunks/{index-BjbgWZrg.mjs → index-CCiDvLAC.mjs} +171 -78
  21. package/dist/_chunks/index-CXzNr2cH.mjs +93 -0
  22. package/dist/_chunks/index-CXzNr2cH.mjs.map +1 -0
  23. package/dist/_chunks/{index-kz3NL7uv.js → index-Cd6y6nuf.js} +57 -8
  24. package/dist/_chunks/index-Cd6y6nuf.js.map +1 -0
  25. package/dist/_chunks/{index-CPE1Ne_e.js → index-Cf9ZIBLd.js} +171 -78
  26. package/dist/_chunks/index-Cf9ZIBLd.js.map +1 -0
  27. package/dist/_chunks/{index-yLrZAFVv.mjs → index-D981K4TK.mjs} +172 -79
  28. package/dist/_chunks/index-D981K4TK.mjs.map +1 -0
  29. package/dist/_chunks/{index-Djk_-mU6.js → index-DGb8ESH-.js} +56 -9
  30. package/dist/_chunks/{index-CuMn96qA.js → index-DYiJBXKE.js} +300 -93
  31. package/dist/_chunks/index-DYiJBXKE.js.map +1 -0
  32. package/dist/_chunks/{index-B7vKSyAn.js → index-DjZ3ZaVB.js} +60 -20
  33. package/dist/_chunks/{index-B7vKSyAn.js.map → index-DjZ3ZaVB.js.map} +1 -1
  34. package/dist/_chunks/{index-ChOgKZGK.mjs → index-DkhJl5mF.mjs} +298 -91
  35. package/dist/_chunks/index-DkhJl5mF.mjs.map +1 -0
  36. package/dist/admin/index.js +1 -1
  37. package/dist/admin/index.mjs +1 -1
  38. package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +1 -1
  39. package/dist/admin/src/components/URLInfo.d.ts +2 -1
  40. package/dist/admin/src/components/modals/NavModal.d.ts +2 -1
  41. package/dist/admin/src/utils/getRouteType.d.ts +2 -0
  42. package/dist/admin/src/utils/index.d.ts +2 -1
  43. package/dist/server/index.js +23 -12
  44. package/dist/server/index.js.map +1 -1
  45. package/dist/server/index.mjs +23 -12
  46. package/dist/server/index.mjs.map +1 -1
  47. package/dist/server/src/content-types/index.d.ts +5 -5
  48. package/dist/server/src/content-types/navigation/index.d.ts +1 -1
  49. package/dist/server/src/content-types/navigation/schema.d.ts +1 -1
  50. package/dist/server/src/content-types/navitem/index.d.ts +3 -3
  51. package/dist/server/src/content-types/navitem/schema.d.ts +3 -3
  52. package/dist/server/src/content-types/route/index.d.ts +1 -1
  53. package/dist/server/src/content-types/route/schema.d.ts +1 -1
  54. package/dist/server/src/index.d.ts +5 -5
  55. package/package.json +1 -1
  56. package/dist/_chunks/_baseConvert-CDjccxdO.mjs +0 -859
  57. package/dist/_chunks/_baseConvert-DVIhGQH6.js +0 -858
  58. package/dist/_chunks/en-B4KWt_jN.js +0 -4
  59. package/dist/_chunks/en-B4KWt_jN.js.map +0 -1
  60. package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
  61. package/dist/_chunks/en-Byx4XI2L.mjs.map +0 -1
  62. package/dist/_chunks/index-1VNPebOd.mjs +0 -45
  63. package/dist/_chunks/index-1VNPebOd.mjs.map +0 -1
  64. package/dist/_chunks/index-B5ilx6DT.mjs +0 -44
  65. package/dist/_chunks/index-CPE1Ne_e.js.map +0 -1
  66. package/dist/_chunks/index-ChOgKZGK.mjs.map +0 -1
  67. package/dist/_chunks/index-CuMn96qA.js.map +0 -1
  68. package/dist/_chunks/index-Djk_-mU6.js.map +0 -1
  69. package/dist/_chunks/index-yLrZAFVv.mjs.map +0 -1
@@ -5,13 +5,13 @@ const React = require("react");
5
5
  const icons = require("@strapi/icons");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  require("react-dom/client");
8
- const _baseConvert = require("./_baseConvert-DVIhGQH6.js");
8
+ const _baseConvert = require("./_baseConvert-B84_vf8X.js");
9
9
  const reactRouterDom = require("react-router-dom");
10
10
  const reactIntl = require("react-intl");
11
11
  require("@strapi/icons/symbols");
12
12
  const ReactDOM = require("react-dom");
13
13
  const styledComponents = require("styled-components");
14
- const index = require("./index-CPE1Ne_e.js");
14
+ const index = require("./index-Cf9ZIBLd.js");
15
15
  const _interopDefault = (e2) => e2 && e2.__esModule ? e2 : { default: e2 };
16
16
  function _interopNamespace(e2) {
17
17
  if (e2 && e2.__esModule) return e2;
@@ -9968,7 +9968,7 @@ function requireFlow() {
9968
9968
  return flow_1;
9969
9969
  }
9970
9970
  var convert = convert_1, func = convert("flow", requireFlow());
9971
- func.placeholder = _baseConvert.placeholder;
9971
+ func.placeholder = _baseConvert.requirePlaceholder();
9972
9972
  var flow = func;
9973
9973
  var pipe = flow;
9974
9974
  const pipe$1 = /* @__PURE__ */ _baseConvert.getDefaultExportFromCjs(pipe);
@@ -16971,6 +16971,7 @@ const Settings = () => {
16971
16971
  const { contentTypes: allContentTypesData } = index.useAllContentTypes();
16972
16972
  const allContentTypes = allContentTypesData?.filter((ct) => ct.pluginOptions?.webatlas?.active === true);
16973
16973
  const [initialState2, setInitialState] = React.useState(config || { selectedContentTypes: [] });
16974
+ const { formatMessage } = reactIntl.useIntl();
16974
16975
  function reducer2(settingsState2, action) {
16975
16976
  let updatedContentTypes;
16976
16977
  switch (action.type) {
@@ -17013,8 +17014,11 @@ const Settings = () => {
17013
17014
  /* @__PURE__ */ jsxRuntime.jsx(
17014
17015
  Layouts.Header,
17015
17016
  {
17016
- title: "Routes",
17017
- subtitle: "Settings",
17017
+ title: index.PLUGIN_NAME,
17018
+ subtitle: formatMessage({
17019
+ id: index.getTranslation("settings.page.subtitle"),
17020
+ defaultMessage: "Settings"
17021
+ }),
17018
17022
  primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
17019
17023
  designSystem.Button,
17020
17024
  {
@@ -17022,7 +17026,10 @@ const Settings = () => {
17022
17026
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
17023
17027
  onClick: save,
17024
17028
  disabled: JSON.stringify(settingsState) === JSON.stringify(initialState2) || settingsState.selectedContentTypes.find((cta) => !cta.default) !== void 0,
17025
- children: "Save"
17029
+ children: formatMessage({
17030
+ id: index.getTranslation("save"),
17031
+ defaultMessage: "Save"
17032
+ })
17026
17033
  }
17027
17034
  )
17028
17035
  }
@@ -17044,13 +17051,22 @@ const Settings = () => {
17044
17051
  designSystem.Field.Root,
17045
17052
  {
17046
17053
  name: "selectedContentTypes",
17047
- hint: "Select the content types you want to enable the Webatlas plugin for.",
17054
+ hint: formatMessage({
17055
+ id: index.getTranslation("settings.page.enabledContentTypes.hint"),
17056
+ defaultMessage: "Select the content types for which you want to enable URL aliases"
17057
+ }),
17048
17058
  children: [
17049
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Enabled Content Types" }),
17059
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
17060
+ id: index.getTranslation("settings.page.enabledContentTypes"),
17061
+ defaultMessage: "Enabled Content Types"
17062
+ }) }),
17050
17063
  /* @__PURE__ */ jsxRuntime.jsx(
17051
17064
  designSystem.MultiSelect,
17052
17065
  {
17053
- placeholder: "Select Content Types",
17066
+ placeholder: formatMessage({
17067
+ id: index.getTranslation("settings.page.enabledContentTypes.placeholder"),
17068
+ defaultMessage: "Select content types..."
17069
+ }),
17054
17070
  onClear: () => dispatch({ type: "SET_SELECTED_CONTENT_TYPES", payload: [] }),
17055
17071
  value: [...settingsState.selectedContentTypes.map((ct) => ct.uid)],
17056
17072
  onChange: (value) => dispatch({
@@ -17070,8 +17086,11 @@ const Settings = () => {
17070
17086
  }
17071
17087
  ),
17072
17088
  settingsState.selectedContentTypes && settingsState.selectedContentTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "selectedContentTypesAccordion", children: [
17073
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Enabled Content Types Settings" }),
17074
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { label: "Content Type settings", children: settingsState.selectedContentTypes?.map((contentType) => {
17089
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
17090
+ id: index.getTranslation("settings.page.contentTypeSettings"),
17091
+ defaultMessage: "Content Type settings"
17092
+ }) }),
17093
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: settingsState.selectedContentTypes?.map((contentType) => {
17075
17094
  const ct = allContentTypes?.find((item) => item.uid === contentType.uid);
17076
17095
  if (!ct) return null;
17077
17096
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -17085,11 +17104,20 @@ const Settings = () => {
17085
17104
  designSystem.Field.Root,
17086
17105
  {
17087
17106
  name: "selectedContentTypes",
17088
- hint: '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
- error: !contentType.default && "Please select a default field",
17107
+ hint: formatMessage({
17108
+ id: index.getTranslation("settings.page.defaultField.hint"),
17109
+ 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".'
17110
+ }),
17111
+ error: !contentType.default && formatMessage({
17112
+ id: index.getTranslation("settings.page.defaultField.error"),
17113
+ defaultMessage: "Please select a default field"
17114
+ }),
17090
17115
  required: true,
17091
17116
  children: [
17092
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Default URL Alias field" }),
17117
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
17118
+ id: index.getTranslation("settings.page.defaultField"),
17119
+ defaultMessage: "Default URL Alias field"
17120
+ }) }),
17093
17121
  /* @__PURE__ */ jsxRuntime.jsx(
17094
17122
  designSystem.SingleSelect,
17095
17123
  {
@@ -17098,7 +17126,7 @@ const Settings = () => {
17098
17126
  value: contentType?.default || "",
17099
17127
  onChange: (value) => dispatch({ type: "SET_DEFAULT_FIELD", payload: { ctUid: ct.uid, field: value } }),
17100
17128
  children: Object.entries(ct.attributes).map(([key], index2) => {
17101
- if (key === "id" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy") return null;
17129
+ if (key === "id" || key === "documentId" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy" || key === "webatlas_path" || key === "webatlas_override") return null;
17102
17130
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: key, children: key }, index2);
17103
17131
  })
17104
17132
  }
@@ -17111,11 +17139,20 @@ const Settings = () => {
17111
17139
  designSystem.Field.Root,
17112
17140
  {
17113
17141
  name: "urlAliasPattern",
17114
- hint: '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.',
17142
+ hint: formatMessage({
17143
+ id: index.getTranslation("settings.page.urlAliasPattern.hint"),
17144
+ 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.'
17145
+ }),
17115
17146
  children: [
17116
17147
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Label, { children: [
17117
- "URL Alias pattern",
17118
- /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { description: "Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded." })
17148
+ formatMessage({
17149
+ id: index.getTranslation("settings.page.urlAliasPattern"),
17150
+ defaultMessage: "URL Alias Pattern"
17151
+ }),
17152
+ /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { description: formatMessage({
17153
+ id: index.getTranslation("settings.page.urlAliasPattern.tooltip"),
17154
+ defaultMessage: "Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded."
17155
+ }) })
17119
17156
  ] }),
17120
17157
  /* @__PURE__ */ jsxRuntime.jsx(
17121
17158
  designSystem.Field.Input,
@@ -17124,7 +17161,10 @@ const Settings = () => {
17124
17161
  onChange: (e2) => dispatch({ type: "SET_PATTERN", payload: { ctUid: ct.uid, pattern: e2.target.value } }),
17125
17162
  disabled: !contentType.default,
17126
17163
  type: "text",
17127
- placeholder: "e.g. blog"
17164
+ placeholder: formatMessage({
17165
+ id: index.getTranslation("settings.page.urlAliasPattern.placeholder"),
17166
+ defaultMessage: "e.g. blog"
17167
+ })
17128
17168
  }
17129
17169
  ),
17130
17170
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
@@ -17146,4 +17186,4 @@ const Settings = () => {
17146
17186
  ] });
17147
17187
  };
17148
17188
  exports.default = Settings;
17149
- //# sourceMappingURL=index-B7vKSyAn.js.map
17189
+ //# sourceMappingURL=index-DjZ3ZaVB.js.map