@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.
Files changed (53) hide show
  1. package/README.md +2 -3
  2. package/dist/_chunks/EmptyBox-7D4LrvdH.mjs.map +1 -0
  3. package/dist/_chunks/EmptyBox-DT6D5gcf.js.map +1 -0
  4. package/dist/_chunks/_baseConvert-B84_vf8X.js.map +1 -0
  5. package/dist/_chunks/_baseConvert-C2SW1VHq.mjs.map +1 -0
  6. package/dist/_chunks/de-4tL_cJTC.js +104 -0
  7. package/dist/_chunks/de-4tL_cJTC.js.map +1 -0
  8. package/dist/_chunks/de-C8PE3n3B.mjs +104 -0
  9. package/dist/_chunks/de-C8PE3n3B.mjs.map +1 -0
  10. package/dist/_chunks/en-Bg4z3fR7.js +104 -0
  11. package/dist/_chunks/en-Bg4z3fR7.js.map +1 -0
  12. package/dist/_chunks/en-CR1YZvJo.mjs +104 -0
  13. package/dist/_chunks/en-CR1YZvJo.mjs.map +1 -0
  14. package/dist/_chunks/{index-D4IHmUrH.js → index-B0XE_zRP.js} +298 -91
  15. package/dist/_chunks/index-B2Tiv3EK.mjs +92 -0
  16. package/dist/_chunks/index-B48CGofU.mjs +17170 -0
  17. package/dist/_chunks/index-B48CGofU.mjs.map +1 -0
  18. package/dist/_chunks/{index-DrlYDm6a.js → index-B85fJxGa.js} +165 -76
  19. package/dist/_chunks/{index-DIyVy-8D.js → index-BbM9Sn1t.js} +57 -17
  20. package/dist/_chunks/{index-B_RPO9ty.mjs → index-BocSkZOu.mjs} +57 -17
  21. package/dist/_chunks/{index-uoH_HJQr.mjs → index-C7B8QHDT.mjs} +296 -89
  22. package/dist/_chunks/{index-BMQSVj43.mjs → index-CCiDvLAC.mjs} +166 -77
  23. package/dist/_chunks/index-CXzNr2cH.mjs +93 -0
  24. package/dist/_chunks/index-CXzNr2cH.mjs.map +1 -0
  25. package/dist/_chunks/index-Cd6y6nuf.js +93 -0
  26. package/dist/_chunks/index-Cd6y6nuf.js.map +1 -0
  27. package/dist/_chunks/index-Cf9ZIBLd.js +4195 -0
  28. package/dist/_chunks/index-Cf9ZIBLd.js.map +1 -0
  29. package/dist/_chunks/index-D981K4TK.mjs +4179 -0
  30. package/dist/_chunks/index-D981K4TK.mjs.map +1 -0
  31. package/dist/_chunks/{index-BvXbuF1E.js → index-DGb8ESH-.js} +56 -8
  32. package/dist/_chunks/index-DYiJBXKE.js +10131 -0
  33. package/dist/_chunks/index-DYiJBXKE.js.map +1 -0
  34. package/dist/_chunks/index-DjZ3ZaVB.js +17189 -0
  35. package/dist/_chunks/index-DjZ3ZaVB.js.map +1 -0
  36. package/dist/_chunks/index-DkhJl5mF.mjs +10131 -0
  37. package/dist/_chunks/index-DkhJl5mF.mjs.map +1 -0
  38. package/dist/admin/index.js +1 -1
  39. package/dist/admin/index.js.map +1 -0
  40. package/dist/admin/index.mjs +1 -1
  41. package/dist/admin/index.mjs.map +1 -0
  42. package/dist/admin/src/components/URLInfo.d.ts +2 -1
  43. package/dist/admin/src/components/modals/NavModal.d.ts +2 -1
  44. package/dist/admin/src/utils/getRouteType.d.ts +2 -0
  45. package/dist/admin/src/utils/index.d.ts +2 -1
  46. package/dist/server/index.js +12 -1
  47. package/dist/server/index.js.map +1 -1
  48. package/dist/server/index.mjs +12 -1
  49. package/dist/server/index.mjs.map +1 -1
  50. package/package.json +1 -1
  51. package/dist/_chunks/en-B4KWt_jN.js +0 -4
  52. package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
  53. package/dist/_chunks/index-BMlQpLGa.mjs +0 -44
@@ -10,7 +10,7 @@ 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-BMQSVj43.mjs";
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-CCiDvLAC.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;
@@ -16957,6 +16957,7 @@ const Settings = () => {
16957
16957
  const { contentTypes: allContentTypesData } = useAllContentTypes();
16958
16958
  const allContentTypes = allContentTypesData?.filter((ct) => ct.pluginOptions?.webatlas?.active === true);
16959
16959
  const [initialState2, setInitialState] = useState(config || { selectedContentTypes: [] });
16960
+ const { formatMessage } = useIntl();
16960
16961
  function reducer2(settingsState2, action) {
16961
16962
  let updatedContentTypes;
16962
16963
  switch (action.type) {
@@ -16999,8 +17000,11 @@ const Settings = () => {
16999
17000
  /* @__PURE__ */ jsx(
17000
17001
  Layouts.Header,
17001
17002
  {
17002
- title: "Routes",
17003
- subtitle: "Settings",
17003
+ title: PLUGIN_NAME,
17004
+ subtitle: formatMessage({
17005
+ id: getTranslation("settings.page.subtitle"),
17006
+ defaultMessage: "Settings"
17007
+ }),
17004
17008
  primaryAction: /* @__PURE__ */ jsx(
17005
17009
  Button,
17006
17010
  {
@@ -17008,7 +17012,10 @@ const Settings = () => {
17008
17012
  startIcon: /* @__PURE__ */ jsx(Check, {}),
17009
17013
  onClick: save,
17010
17014
  disabled: JSON.stringify(settingsState) === JSON.stringify(initialState2) || settingsState.selectedContentTypes.find((cta) => !cta.default) !== void 0,
17011
- children: "Save"
17015
+ children: formatMessage({
17016
+ id: getTranslation("save"),
17017
+ defaultMessage: "Save"
17018
+ })
17012
17019
  }
17013
17020
  )
17014
17021
  }
@@ -17030,13 +17037,22 @@ const Settings = () => {
17030
17037
  Field.Root,
17031
17038
  {
17032
17039
  name: "selectedContentTypes",
17033
- hint: "Select the content types you want to enable the Webatlas plugin for.",
17040
+ hint: formatMessage({
17041
+ id: getTranslation("settings.page.enabledContentTypes.hint"),
17042
+ defaultMessage: "Select the content types for which you want to enable URL aliases"
17043
+ }),
17034
17044
  children: [
17035
- /* @__PURE__ */ jsx(Field.Label, { children: "Enabled Content Types" }),
17045
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
17046
+ id: getTranslation("settings.page.enabledContentTypes"),
17047
+ defaultMessage: "Enabled Content Types"
17048
+ }) }),
17036
17049
  /* @__PURE__ */ jsx(
17037
17050
  MultiSelect,
17038
17051
  {
17039
- placeholder: "Select Content Types",
17052
+ placeholder: formatMessage({
17053
+ id: getTranslation("settings.page.enabledContentTypes.placeholder"),
17054
+ defaultMessage: "Select content types..."
17055
+ }),
17040
17056
  onClear: () => dispatch({ type: "SET_SELECTED_CONTENT_TYPES", payload: [] }),
17041
17057
  value: [...settingsState.selectedContentTypes.map((ct) => ct.uid)],
17042
17058
  onChange: (value) => dispatch({
@@ -17056,8 +17072,11 @@ const Settings = () => {
17056
17072
  }
17057
17073
  ),
17058
17074
  settingsState.selectedContentTypes && settingsState.selectedContentTypes.length > 0 && /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Field.Root, { name: "selectedContentTypesAccordion", children: [
17059
- /* @__PURE__ */ jsx(Field.Label, { children: "Enabled Content Types Settings" }),
17060
- /* @__PURE__ */ jsx(Accordion.Root, { label: "Content Type settings", children: settingsState.selectedContentTypes?.map((contentType) => {
17075
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
17076
+ id: getTranslation("settings.page.contentTypeSettings"),
17077
+ defaultMessage: "Content Type settings"
17078
+ }) }),
17079
+ /* @__PURE__ */ jsx(Accordion.Root, { children: settingsState.selectedContentTypes?.map((contentType) => {
17061
17080
  const ct = allContentTypes?.find((item) => item.uid === contentType.uid);
17062
17081
  if (!ct) return null;
17063
17082
  return /* @__PURE__ */ jsx(
@@ -17071,11 +17090,20 @@ const Settings = () => {
17071
17090
  Field.Root,
17072
17091
  {
17073
17092
  name: "selectedContentTypes",
17074
- 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".',
17075
- error: !contentType.default && "Please select a default field",
17093
+ hint: formatMessage({
17094
+ id: getTranslation("settings.page.defaultField.hint"),
17095
+ 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".'
17096
+ }),
17097
+ error: !contentType.default && formatMessage({
17098
+ id: getTranslation("settings.page.defaultField.error"),
17099
+ defaultMessage: "Please select a default field"
17100
+ }),
17076
17101
  required: true,
17077
17102
  children: [
17078
- /* @__PURE__ */ jsx(Field.Label, { children: "Default URL Alias field" }),
17103
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
17104
+ id: getTranslation("settings.page.defaultField"),
17105
+ defaultMessage: "Default URL Alias field"
17106
+ }) }),
17079
17107
  /* @__PURE__ */ jsx(
17080
17108
  SingleSelect,
17081
17109
  {
@@ -17084,7 +17112,7 @@ const Settings = () => {
17084
17112
  value: contentType?.default || "",
17085
17113
  onChange: (value) => dispatch({ type: "SET_DEFAULT_FIELD", payload: { ctUid: ct.uid, field: value } }),
17086
17114
  children: Object.entries(ct.attributes).map(([key], index) => {
17087
- if (key === "id" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy") return null;
17115
+ if (key === "id" || key === "documentId" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy" || key === "webatlas_path" || key === "webatlas_override") return null;
17088
17116
  return /* @__PURE__ */ jsx(SingleSelectOption, { value: key, children: key }, index);
17089
17117
  })
17090
17118
  }
@@ -17097,11 +17125,20 @@ const Settings = () => {
17097
17125
  Field.Root,
17098
17126
  {
17099
17127
  name: "urlAliasPattern",
17100
- 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.',
17128
+ hint: formatMessage({
17129
+ id: getTranslation("settings.page.urlAliasPattern.hint"),
17130
+ 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.'
17131
+ }),
17101
17132
  children: [
17102
17133
  /* @__PURE__ */ jsxs(Field.Label, { children: [
17103
- "URL Alias pattern",
17104
- /* @__PURE__ */ jsx(Tooltip, { description: "Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded." })
17134
+ formatMessage({
17135
+ id: getTranslation("settings.page.urlAliasPattern"),
17136
+ defaultMessage: "URL Alias Pattern"
17137
+ }),
17138
+ /* @__PURE__ */ jsx(Tooltip, { description: formatMessage({
17139
+ id: getTranslation("settings.page.urlAliasPattern.tooltip"),
17140
+ defaultMessage: "Leading and trailing slashes will be removed. Spaces will be replaced with hyphens. Special characters will be encoded."
17141
+ }) })
17105
17142
  ] }),
17106
17143
  /* @__PURE__ */ jsx(
17107
17144
  Field.Input,
@@ -17110,7 +17147,10 @@ const Settings = () => {
17110
17147
  onChange: (e2) => dispatch({ type: "SET_PATTERN", payload: { ctUid: ct.uid, pattern: e2.target.value } }),
17111
17148
  disabled: !contentType.default,
17112
17149
  type: "text",
17113
- placeholder: "e.g. blog"
17150
+ placeholder: formatMessage({
17151
+ id: getTranslation("settings.page.urlAliasPattern.placeholder"),
17152
+ defaultMessage: "e.g. blog"
17153
+ })
17114
17154
  }
17115
17155
  ),
17116
17156
  /* @__PURE__ */ jsx(Field.Hint, {})