@mattisvensson/strapi-plugin-webatlas 0.12.0 → 0.12.1

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.
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const icons = require("@strapi/icons");
7
- const index = require("./index-BYytQZfK.js");
7
+ const index = require("./index-CsKnBzp6.js");
8
8
  require("@strapi/strapi/admin");
9
9
  const Input = React.forwardRef((props, ref) => {
10
10
  const { attribute, disabled, placeholder, label, name, onChange, required, value, hint } = props;
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useEffect } from "react";
3
3
  import { Field, Combobox, ComboboxOption, Box } from "@strapi/design-system";
4
4
  import { ExternalLink, Link } from "@strapi/icons";
5
- import { u as useApi } from "./index-Ckaev6xU.mjs";
5
+ import { u as useApi } from "./index-ByxM39aL.mjs";
6
6
  import "@strapi/strapi/admin";
7
7
  const Input = forwardRef((props, ref) => {
8
8
  const { attribute, disabled, placeholder, label, name, onChange, required, value, hint } = props;
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Button, Flex, Typography, Box } from "@strapi/design-system";
3
3
  import { Page, Layouts } from "@strapi/strapi/admin";
4
- import { f as PLUGIN_NAME, g as getTranslation } from "./index-Ckaev6xU.mjs";
4
+ import { f as PLUGIN_NAME, g as getTranslation } from "./index-ByxM39aL.mjs";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Check } from "@strapi/icons";
7
7
  function PageWrapper({
@@ -2,7 +2,7 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const designSystem = require("@strapi/design-system");
4
4
  const admin = require("@strapi/strapi/admin");
5
- const index = require("./index-BYytQZfK.js");
5
+ const index = require("./index-CsKnBzp6.js");
6
6
  const reactIntl = require("react-intl");
7
7
  const icons = require("@strapi/icons");
8
8
  function PageWrapper({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const React = require("react");
3
- const index = require("./index-BYytQZfK.js");
3
+ const index = require("./index-CsKnBzp6.js");
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const icons = require("@strapi/icons");
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from "react";
2
- import { u as useApi, i as isAbortError } from "./index-Ckaev6xU.mjs";
2
+ import { u as useApi, i as isAbortError } from "./index-ByxM39aL.mjs";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Badge, Flex, Typography } from "@strapi/design-system";
5
5
  import { WarningCircle } from "@strapi/icons";
@@ -4,13 +4,13 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const index = require("./index-BYytQZfK.js");
8
- const WarningBox = require("./WarningBox-DsBtzhs3.js");
7
+ const index = require("./index-CsKnBzp6.js");
8
+ const WarningBox = require("./WarningBox-BZ3BZ5fR.js");
9
9
  const FullLoader = require("./FullLoader-C4hXFaLP.js");
10
10
  const reactIntl = require("react-intl");
11
11
  require("@strapi/icons/symbols");
12
12
  const icons = require("@strapi/icons");
13
- const SettingTitle = require("./SettingTitle-CBcBCh1h.js");
13
+ const SettingTitle = require("./SettingTitle-Ib_0AvoZ.js");
14
14
  function getRouteSourceFields(contentType) {
15
15
  if (!contentType?.attributes) return [];
16
16
  return Object.entries(contentType.attributes).filter(
@@ -7,11 +7,11 @@ const designSystem = require("@strapi/design-system");
7
7
  const React = require("react");
8
8
  const ReactDOM = require("react-dom");
9
9
  const reactIntl = require("react-intl");
10
- const index = require("./index-BYytQZfK.js");
10
+ const index = require("./index-CsKnBzp6.js");
11
11
  const FullLoader = require("./FullLoader-C4hXFaLP.js");
12
12
  const admin = require("@strapi/strapi/admin");
13
13
  const symbols = require("@strapi/icons/symbols");
14
- const WarningBox = require("./WarningBox-DsBtzhs3.js");
14
+ const WarningBox = require("./WarningBox-BZ3BZ5fR.js");
15
15
  const core = require("@dnd-kit/core");
16
16
  const sortable = require("@dnd-kit/sortable");
17
17
  const utilities = require("@dnd-kit/utilities");
@@ -5,11 +5,11 @@ import { Box, Typography, Dialog, Button, Modal, Flex, SingleSelect, SingleSelec
5
5
  import { createContext, useRef, useContext, useState, useMemo, useReducer, useCallback, useEffect, forwardRef } from "react";
6
6
  import { createPortal } from "react-dom";
7
7
  import { useIntl } from "react-intl";
8
- import { u as useApi, g as getTranslation, i as isAbortError, P as PLUGIN_ID, d as debounce, a as duplicateCheck, T as Tooltip, b as PathInfo, c as usePluginConfig, p as pluginPermissions } from "./index-Ckaev6xU.mjs";
8
+ import { u as useApi, g as getTranslation, i as isAbortError, P as PLUGIN_ID, d as debounce, a as duplicateCheck, T as Tooltip, b as PathInfo, c as usePluginConfig, p as pluginPermissions } from "./index-ByxM39aL.mjs";
9
9
  import { u as useErrorMessage, C as Center, F as FullLoader } from "./FullLoader-BTZzPY8g.mjs";
10
10
  import { useNotification, useFetchClient, Page, Layouts } from "@strapi/strapi/admin";
11
11
  import { EmptyDocuments } from "@strapi/icons/symbols";
12
- import { u as useAllEntities, W as WarningBox } from "./WarningBox-CMQuE_Ov.mjs";
12
+ import { u as useAllEntities, W as WarningBox } from "./WarningBox-CXEmXfVx.mjs";
13
13
  import { MeasuringStrategy, DndContext, DragOverlay, closestCenter } from "@dnd-kit/core";
14
14
  import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
15
15
  import { CSS } from "@dnd-kit/utilities";
@@ -2,13 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useReducer, useRef, useMemo } from "react";
3
3
  import { Box, Accordion, Field, SingleSelect, SingleSelectOption, Grid, Typography, Link } from "@strapi/design-system";
4
4
  import { useNotification, Page } from "@strapi/strapi/admin";
5
- import { g as getTranslation, T as Tooltip, c as usePluginConfig, e as useAllContentTypes, p as pluginPermissions, f as PLUGIN_NAME, h as PLUGIN_VERSION } from "./index-Ckaev6xU.mjs";
6
- import { W as WarningBox, u as useAllEntities } from "./WarningBox-CMQuE_Ov.mjs";
5
+ import { g as getTranslation, T as Tooltip, c as usePluginConfig, e as useAllContentTypes, p as pluginPermissions, f as PLUGIN_NAME, h as PLUGIN_VERSION } from "./index-ByxM39aL.mjs";
6
+ import { W as WarningBox, u as useAllEntities } from "./WarningBox-CXEmXfVx.mjs";
7
7
  import { u as useErrorMessage, F as FullLoader } from "./FullLoader-BTZzPY8g.mjs";
8
8
  import { useIntl } from "react-intl";
9
9
  import "@strapi/icons/symbols";
10
10
  import { ExternalLink } from "@strapi/icons";
11
- import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-DTXdYICP.mjs";
11
+ import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-0mKlA80i.mjs";
12
12
  function getRouteSourceFields(contentType) {
13
13
  if (!contentType?.attributes) return [];
14
14
  return Object.entries(contentType.attributes).filter(
@@ -52,7 +52,7 @@ function transformToUrl(input, replaceSlash = true) {
52
52
  input = input.replace(/-+/g, "-");
53
53
  return input;
54
54
  }
55
- const version = "0.12.0";
55
+ const version = "0.12.1";
56
56
  const strapi = { "name": "webatlas", "displayName": "Webatlas" };
57
57
  const pluginPkg = {
58
58
  version,
@@ -4188,7 +4188,7 @@ const index = {
4188
4188
  id: `${PLUGIN_ID}.link.paths`,
4189
4189
  defaultMessage: "Paths"
4190
4190
  },
4191
- Component: () => import("./index-l4-tTCw9.mjs"),
4191
+ Component: () => import("./index-PD3gcnXA.mjs"),
4192
4192
  permissions: [pluginPermissions["page.routes"][0]]
4193
4193
  });
4194
4194
  app.addMenuLink({
@@ -4198,7 +4198,7 @@ const index = {
4198
4198
  id: `${PLUGIN_ID}.link.navigation`,
4199
4199
  defaultMessage: "Navigation"
4200
4200
  },
4201
- Component: () => import("./index-Do9dOMP-.mjs"),
4201
+ Component: () => import("./index-BY6JLZrD.mjs"),
4202
4202
  permissions: [pluginPermissions["page.navigation"][0]]
4203
4203
  });
4204
4204
  app.addSettingsLink(
@@ -4216,7 +4216,7 @@ const index = {
4216
4216
  },
4217
4217
  id: `${PLUGIN_ID}-general`,
4218
4218
  to: `${PLUGIN_ID}/general`,
4219
- Component: () => import("./index-aSdHc104.mjs"),
4219
+ Component: () => import("./index-Bym1mXg1.mjs"),
4220
4220
  permissions: [pluginPermissions["settings.general"][0]]
4221
4221
  }
4222
4222
  );
@@ -4227,7 +4227,7 @@ const index = {
4227
4227
  },
4228
4228
  id: `${PLUGIN_ID}-navigation`,
4229
4229
  to: `${PLUGIN_ID}/navigation`,
4230
- Component: () => import("./index-DuwTQMlZ.mjs"),
4230
+ Component: () => import("./index-CNCyng5O.mjs"),
4231
4231
  permissions: [pluginPermissions["settings.navigation"][0]]
4232
4232
  });
4233
4233
  app.customFields.register({
@@ -4243,7 +4243,7 @@ const index = {
4243
4243
  defaultMessage: "Select a route"
4244
4244
  },
4245
4245
  components: {
4246
- Input: async () => import("./RoutePicker-h2yWGB6S.mjs").then((module) => ({
4246
+ Input: async () => import("./RoutePicker-IRZiHKFi.mjs").then((module) => ({
4247
4247
  default: module.default
4248
4248
  }))
4249
4249
  },
@@ -4,12 +4,12 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const index = require("./index-BYytQZfK.js");
7
+ const index = require("./index-CsKnBzp6.js");
8
8
  const FullLoader = require("./FullLoader-C4hXFaLP.js");
9
9
  const reactIntl = require("react-intl");
10
10
  require("@strapi/icons/symbols");
11
11
  require("@strapi/icons");
12
- const SettingTitle = require("./SettingTitle-CBcBCh1h.js");
12
+ const SettingTitle = require("./SettingTitle-Ib_0AvoZ.js");
13
13
  function reducer(newConfig, action) {
14
14
  switch (action.type) {
15
15
  case "SET_MAX_DEPTH":
@@ -2,12 +2,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useReducer, useState, useRef, useEffect } from "react";
3
3
  import { Field } from "@strapi/design-system";
4
4
  import { useNotification, Page } from "@strapi/strapi/admin";
5
- import { c as usePluginConfig, g as getTranslation, p as pluginPermissions } from "./index-Ckaev6xU.mjs";
5
+ import { c as usePluginConfig, g as getTranslation, p as pluginPermissions } from "./index-ByxM39aL.mjs";
6
6
  import { u as useErrorMessage, F as FullLoader } from "./FullLoader-BTZzPY8g.mjs";
7
7
  import { useIntl } from "react-intl";
8
8
  import "@strapi/icons/symbols";
9
9
  import "@strapi/icons";
10
- import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-DTXdYICP.mjs";
10
+ import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-0mKlA80i.mjs";
11
11
  function reducer(newConfig, action) {
12
12
  switch (action.type) {
13
13
  case "SET_MAX_DEPTH":
@@ -70,7 +70,7 @@ function transformToUrl(input, replaceSlash = true) {
70
70
  input = input.replace(/-+/g, "-");
71
71
  return input;
72
72
  }
73
- const version = "0.12.0";
73
+ const version = "0.12.1";
74
74
  const strapi = { "name": "webatlas", "displayName": "Webatlas" };
75
75
  const pluginPkg = {
76
76
  version,
@@ -4206,7 +4206,7 @@ const index = {
4206
4206
  id: `${PLUGIN_ID}.link.paths`,
4207
4207
  defaultMessage: "Paths"
4208
4208
  },
4209
- Component: () => Promise.resolve().then(() => require("./index-BZBUZWp1.js")),
4209
+ Component: () => Promise.resolve().then(() => require("./index-DNBXz42q.js")),
4210
4210
  permissions: [pluginPermissions["page.routes"][0]]
4211
4211
  });
4212
4212
  app.addMenuLink({
@@ -4216,7 +4216,7 @@ const index = {
4216
4216
  id: `${PLUGIN_ID}.link.navigation`,
4217
4217
  defaultMessage: "Navigation"
4218
4218
  },
4219
- Component: () => Promise.resolve().then(() => require("./index-Bn_SWdWd.js")),
4219
+ Component: () => Promise.resolve().then(() => require("./index-BPUJTNed.js")),
4220
4220
  permissions: [pluginPermissions["page.navigation"][0]]
4221
4221
  });
4222
4222
  app.addSettingsLink(
@@ -4234,7 +4234,7 @@ const index = {
4234
4234
  },
4235
4235
  id: `${PLUGIN_ID}-general`,
4236
4236
  to: `${PLUGIN_ID}/general`,
4237
- Component: () => Promise.resolve().then(() => require("./index-GZ_b2eve.js")),
4237
+ Component: () => Promise.resolve().then(() => require("./index-88JTX1Mj.js")),
4238
4238
  permissions: [pluginPermissions["settings.general"][0]]
4239
4239
  }
4240
4240
  );
@@ -4245,7 +4245,7 @@ const index = {
4245
4245
  },
4246
4246
  id: `${PLUGIN_ID}-navigation`,
4247
4247
  to: `${PLUGIN_ID}/navigation`,
4248
- Component: () => Promise.resolve().then(() => require("./index-CaFjiS4j.js")),
4248
+ Component: () => Promise.resolve().then(() => require("./index-CEJBltoJ.js")),
4249
4249
  permissions: [pluginPermissions["settings.navigation"][0]]
4250
4250
  });
4251
4251
  app.customFields.register({
@@ -4261,7 +4261,7 @@ const index = {
4261
4261
  defaultMessage: "Select a route"
4262
4262
  },
4263
4263
  components: {
4264
- Input: async () => Promise.resolve().then(() => require("./RoutePicker-mEHRtXQ9.js")).then((module2) => ({
4264
+ Input: async () => Promise.resolve().then(() => require("./RoutePicker-C3_tzz9U.js")).then((module2) => ({
4265
4265
  default: module2.default
4266
4266
  }))
4267
4267
  },
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const index = require("./index-BYytQZfK.js");
5
+ const index = require("./index-CsKnBzp6.js");
6
6
  const FullLoader = require("./FullLoader-C4hXFaLP.js");
7
7
  const admin = require("@strapi/strapi/admin");
8
8
  const designSystem = require("@strapi/design-system");
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect, useMemo } from "react";
3
- import { g as getTranslation, u as useApi, d as debounce, p as pluginPermissions, i as isAbortError } from "./index-Ckaev6xU.mjs";
3
+ import { g as getTranslation, u as useApi, d as debounce, p as pluginPermissions, i as isAbortError } from "./index-ByxM39aL.mjs";
4
4
  import { u as useErrorMessage, F as FullLoader } from "./FullLoader-BTZzPY8g.mjs";
5
5
  import { Page, Layouts, useNotification } from "@strapi/strapi/admin";
6
6
  import { Grid, Box, Field, Thead, Tr, Th, Typography, VisuallyHidden, Td, Flex, LinkButton, Table, Tbody, EmptyStateLayout } from "@strapi/design-system";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const index = require("./index-BYytQZfK.js");
3
+ const index = require("./index-CsKnBzp6.js");
4
4
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { j } from "./index-Ckaev6xU.mjs";
1
+ import { j } from "./index-ByxM39aL.mjs";
2
2
  export {
3
3
  j as default
4
4
  };
@@ -5263,7 +5263,8 @@ function documentMiddleware(strapi2, enabledContentTypes, config2) {
5263
5263
  let rawPath = transformedSlug;
5264
5264
  if (!isOverride) rawPath = parent ? `${parent.path}/${transformedSlug}` : transformedSlug;
5265
5265
  const validatedPath = await duplicateCheck(rawPath, relatedRoute?.documentId ?? null);
5266
- const title = context.params.data[ctSettings?.routeSourceField]?.trim() || slug;
5266
+ const sourceValue = ctSettings?.routeSourceField ? context.params.data[ctSettings.routeSourceField]?.trim() : void 0;
5267
+ const title = sourceValue || relatedRoute?.title || slug;
5267
5268
  const canonicalPath = isOverride ? relatedRoute.path : await buildCanonicalPath(transformToUrl(title), parent?.documentId);
5268
5269
  const routeBlacklist = await getRouteBlacklist();
5269
5270
  assertPathAllowed(rawPath, routeBlacklist);
@@ -5261,7 +5261,8 @@ function documentMiddleware(strapi2, enabledContentTypes, config2) {
5261
5261
  let rawPath = transformedSlug;
5262
5262
  if (!isOverride) rawPath = parent ? `${parent.path}/${transformedSlug}` : transformedSlug;
5263
5263
  const validatedPath = await duplicateCheck(rawPath, relatedRoute?.documentId ?? null);
5264
- const title = context.params.data[ctSettings?.routeSourceField]?.trim() || slug;
5264
+ const sourceValue = ctSettings?.routeSourceField ? context.params.data[ctSettings.routeSourceField]?.trim() : void 0;
5265
+ const title = sourceValue || relatedRoute?.title || slug;
5265
5266
  const canonicalPath = isOverride ? relatedRoute.path : await buildCanonicalPath(transformToUrl(title), parent?.documentId);
5266
5267
  const routeBlacklist = await getRouteBlacklist();
5267
5268
  assertPathAllowed(rawPath, routeBlacklist);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mattisvensson/strapi-plugin-webatlas",
3
3
  "description": "A strapi plugin to manage URL routes and navigations.",
4
4
  "license": "MIT",
5
- "version": "0.12.0",
5
+ "version": "0.12.1",
6
6
  "keywords": [
7
7
  "strapi",
8
8
  "plugin",