@mattisvensson/strapi-plugin-webatlas 0.11.0 → 0.11.2

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 (50) hide show
  1. package/README.md +14 -8
  2. package/dist/admin/{FullLoader-CrPED_dY.mjs → FullLoader-Btjb2W2p.mjs} +4 -2
  3. package/dist/admin/{FullLoader-Cmsf8xS6.js → FullLoader-Da2n70bJ.js} +4 -2
  4. package/dist/admin/{SettingTitle-BjE_2u6R.js → SettingTitle-B0quw3f8.js} +5 -3
  5. package/dist/admin/{SettingTitle-B1IaU3qs.mjs → SettingTitle-HMfQOJnK.mjs} +5 -3
  6. package/dist/admin/de-B5pRvs13.mjs +0 -1
  7. package/dist/admin/de-CqU1FU8C.js +0 -1
  8. package/dist/admin/en-BE-zzIv8.mjs +0 -1
  9. package/dist/admin/en-C7I90FwV.js +0 -1
  10. package/dist/admin/{index-Cf9j0bn2.mjs → index-9_HhKDUC.mjs} +31 -59
  11. package/dist/admin/{index-DCYCtKrj.mjs → index-B79ELMEC.mjs} +220 -215
  12. package/dist/admin/{index-JLpXBQVL.js → index-BEVoxEAm.js} +31 -59
  13. package/dist/admin/index-Bmg-ERct.mjs +243 -0
  14. package/dist/admin/{index-AVI3QJ0R.js → index-C8YjuuOx.js} +496 -354
  15. package/dist/admin/{index-Yq-QR8t0.js → index-Cx_mktdk.js} +220 -215
  16. package/dist/admin/{index-BbnlyBrZ.mjs → index-Cz_k_jjp.mjs} +41 -31
  17. package/dist/admin/{index-D8bG0YFB.js → index-D2hB1vTw.js} +41 -31
  18. package/dist/admin/index-YdWxpvOH.js +243 -0
  19. package/dist/admin/{index-BIEUXWe7.mjs → index-oEJT_mvw.mjs} +496 -354
  20. package/dist/admin/index.js +1 -2
  21. package/dist/admin/index.mjs +1 -2
  22. package/dist/admin/src/index.d.ts +12 -0
  23. package/dist/server/index.js +174 -145
  24. package/dist/server/index.mjs +174 -145
  25. package/dist/server/src/index.d.ts +305 -0
  26. package/package.json +108 -108
  27. package/dist/admin/FullLoader-Cmsf8xS6.js.map +0 -1
  28. package/dist/admin/FullLoader-CrPED_dY.mjs.map +0 -1
  29. package/dist/admin/SettingTitle-B1IaU3qs.mjs.map +0 -1
  30. package/dist/admin/SettingTitle-BjE_2u6R.js.map +0 -1
  31. package/dist/admin/de-B5pRvs13.mjs.map +0 -1
  32. package/dist/admin/de-CqU1FU8C.js.map +0 -1
  33. package/dist/admin/en-BE-zzIv8.mjs.map +0 -1
  34. package/dist/admin/en-C7I90FwV.js.map +0 -1
  35. package/dist/admin/index-AVI3QJ0R.js.map +0 -1
  36. package/dist/admin/index-B90eSO4a.js +0 -219
  37. package/dist/admin/index-B90eSO4a.js.map +0 -1
  38. package/dist/admin/index-BIEUXWe7.mjs.map +0 -1
  39. package/dist/admin/index-BbnlyBrZ.mjs.map +0 -1
  40. package/dist/admin/index-Cf9j0bn2.mjs.map +0 -1
  41. package/dist/admin/index-D8bG0YFB.js.map +0 -1
  42. package/dist/admin/index-DCYCtKrj.mjs.map +0 -1
  43. package/dist/admin/index-JLpXBQVL.js.map +0 -1
  44. package/dist/admin/index-Y_PYIiRA.mjs +0 -219
  45. package/dist/admin/index-Y_PYIiRA.mjs.map +0 -1
  46. package/dist/admin/index-Yq-QR8t0.js.map +0 -1
  47. package/dist/admin/index.js.map +0 -1
  48. package/dist/admin/index.mjs.map +0 -1
  49. package/dist/server/index.js.map +0 -1
  50. package/dist/server/index.mjs.map +0 -1
package/README.md CHANGED
@@ -27,10 +27,11 @@ This plugin is still in the early stages of development. Many features are plann
27
27
 
28
28
  - **Strapi v5** - [v0.x.x (work in progress - beta)](https://github.com/mattisvensson/strapi-plugin-webatlas/releases)
29
29
  - **Strapi v4** - not supported
30
+
30
31
  ## ✨ Features
31
32
 
32
33
  - **🚀 Automatic Slug Generation:** Automatically generate clean, SEO-friendly slugs based on your content fields and the route hierarchy. No more manual slug writing — just choose the field, place it under a different route and the plugin takes care of the rest. Slugs are unique and easily customizable.
33
- - **🗺️ Route Hierarchy and Overview:** Create a hierarchical structure for your routes and gain a full, centralized overview of all registered routes and their corresponding content entries.
34
+ - **🗺️ Route Hierarchy and Overview:** Create a hierarchical structure for your routes and gain a full, centralized overview of all registered routes and their corresponding content entries.
34
35
  - **🧭 Multiple Navigations** Support for creating and managing multiple navigation structures. Whether it's a main menu, footer links, or a custom mobile drawer — organize your content into any number of navigations with drag-and-drop sorting, nested items, and visibility toggles.
35
36
  - **🧩 Composable Component Integration** Use plugin-generated slugs and navigations directly in your frontend. Fetch routes and navigation data by slug and with a consistent API response, optimized for dynamic rendering.
36
37
  - **🧠 Conflict Detection & Validation** Webatlas prevents slug collisions and helps avoid route conflicts by validating changes in real time. Get clear error messages and automatic suggestions when something doesn’t align.
@@ -38,13 +39,16 @@ This plugin is still in the early stages of development. Many features are plann
38
39
  ## ⏳ Installation
39
40
 
40
41
  ### Via command line
42
+
41
43
  Install Webatlas via command line with a package manager of your choice.
42
44
  Using NPM:
45
+
43
46
  ```bash
44
47
  npm install @mattisvensson/strapi-plugin-webatlas@beta
45
48
  ```
46
49
 
47
50
  Using Yarn:
51
+
48
52
  ```bash
49
53
  yarn add @mattisvensson/strapi-plugin-webatlas@beta
50
54
  ```
@@ -66,13 +70,13 @@ Your schema should contain the following:
66
70
 
67
71
  ```json
68
72
  {
69
- // ... other schema properties ...
70
- "pluginOptions": {
71
- "webatlas": {
72
- "enabled": true
73
- },
74
- // ... other plugin options ...
75
- }
73
+ // ... other schema properties ...
74
+ "pluginOptions": {
75
+ "webatlas": {
76
+ "enabled": true
77
+ }
78
+ // ... other plugin options ...
79
+ }
76
80
  }
77
81
  ```
78
82
 
@@ -107,6 +111,7 @@ Webatlas provides two API endpoints. One to fetch routes and one to fetch naviga
107
111
  `GET /api/webatlas/path`
108
112
 
109
113
  Query parameters:
114
+
110
115
  - `slug` (string, required): The slug/path to fetch the route for. This can either be the generated path from webatlas, the uId path or the canonical path.
111
116
  - `populate` (string, optional): Comma-separated list of relations to populate. Use `deep` to populate all relations in any depth.
112
117
  - `populateDeepDepth` (string, optional): Depth for deep population.
@@ -120,6 +125,7 @@ The response contains the entity's content type and a `webatlas` object with add
120
125
  `GET /api/webatlas/navigation`
121
126
 
122
127
  One of these query parameters (`documentId`, `slug`, `name`, or `id`) are mandatory to fetch a navigation. If you provide multiple, `documentId` has the highest priority, followed by `slug`, `name` and `id`.
128
+
123
129
  - `documentId` (string, optional): The document ID of the navigation to fetch.
124
130
  - `slug` (string, optional): The slug of the navigation to fetch.
125
131
  - `name` (string, optional): The name of the navigation to fetch.
@@ -1,6 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Flex, Loader } from "@strapi/design-system";
3
- function Center({ height = 400, children }) {
3
+ function Center({
4
+ height = 400,
5
+ children
6
+ }) {
4
7
  return /* @__PURE__ */ jsx(Flex, { direction: "column", minHeight: `${height}px`, justifyContent: "center", children });
5
8
  }
6
9
  function FullLoader({ height }) {
@@ -10,4 +13,3 @@ export {
10
13
  Center as C,
11
14
  FullLoader as F
12
15
  };
13
- //# sourceMappingURL=FullLoader-CrPED_dY.mjs.map
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const designSystem = require("@strapi/design-system");
4
- function Center({ height = 400, children }) {
4
+ function Center({
5
+ height = 400,
6
+ children
7
+ }) {
5
8
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", minHeight: `${height}px`, justifyContent: "center", children });
6
9
  }
7
10
  function FullLoader({ height }) {
@@ -9,4 +12,3 @@ function FullLoader({ height }) {
9
12
  }
10
13
  exports.Center = Center;
11
14
  exports.FullLoader = FullLoader;
12
- //# sourceMappingURL=FullLoader-Cmsf8xS6.js.map
@@ -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-Yq-QR8t0.js");
5
+ const index = require("./index-Cx_mktdk.js");
6
6
  const reactIntl = require("react-intl");
7
7
  const icons = require("@strapi/icons");
8
8
  function PageWrapper({
@@ -38,7 +38,10 @@ function PageWrapper({
38
38
  /* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children }) })
39
39
  ] });
40
40
  }
41
- function ContentBox({ title, children }) {
41
+ function ContentBox({
42
+ title,
43
+ children
44
+ }) {
42
45
  return /* @__PURE__ */ jsxRuntime.jsxs(
43
46
  designSystem.Flex,
44
47
  {
@@ -65,4 +68,3 @@ function SettingTitle({ children }) {
65
68
  exports.ContentBox = ContentBox;
66
69
  exports.PageWrapper = PageWrapper;
67
70
  exports.SettingTitle = SettingTitle;
68
- //# sourceMappingURL=SettingTitle-BjE_2u6R.js.map
@@ -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-DCYCtKrj.mjs";
4
+ import { f as PLUGIN_NAME, g as getTranslation } from "./index-B79ELMEC.mjs";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Check } from "@strapi/icons";
7
7
  function PageWrapper({
@@ -37,7 +37,10 @@ function PageWrapper({
37
37
  /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children }) })
38
38
  ] });
39
39
  }
40
- function ContentBox({ title, children }) {
40
+ function ContentBox({
41
+ title,
42
+ children
43
+ }) {
41
44
  return /* @__PURE__ */ jsxs(
42
45
  Flex,
43
46
  {
@@ -66,4 +69,3 @@ export {
66
69
  PageWrapper as P,
67
70
  SettingTitle as S
68
71
  };
69
- //# sourceMappingURL=SettingTitle-B1IaU3qs.mjs.map
@@ -126,4 +126,3 @@ const de = {
126
126
  export {
127
127
  de as default
128
128
  };
129
- //# sourceMappingURL=de-B5pRvs13.mjs.map
@@ -126,4 +126,3 @@ const de = {
126
126
  "webatlas.settings.section.navigation": "Navigation"
127
127
  };
128
128
  exports.default = de;
129
- //# sourceMappingURL=de-CqU1FU8C.js.map
@@ -126,4 +126,3 @@ const en = {
126
126
  export {
127
127
  en as default
128
128
  };
129
- //# sourceMappingURL=en-BE-zzIv8.mjs.map
@@ -126,4 +126,3 @@ const en = {
126
126
  "webatlas.settings.section.navigation": "Navigation"
127
127
  };
128
128
  exports.default = en;
129
- //# sourceMappingURL=en-C7I90FwV.js.map
@@ -1,10 +1,10 @@
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 } from "./index-DCYCtKrj.mjs";
3
+ import { g as getTranslation, u as useApi, d as debounce, p as pluginPermissions } from "./index-B79ELMEC.mjs";
4
4
  import { Page, Layouts, useNotification } from "@strapi/strapi/admin";
5
5
  import { Grid, Box, Field, Thead, Tr, Th, Typography, VisuallyHidden, Td, Flex, LinkButton, Table, Tbody, EmptyStateLayout } from "@strapi/design-system";
6
6
  import "@strapi/icons/symbols";
7
- import { F as FullLoader } from "./FullLoader-CrPED_dY.mjs";
7
+ import { F as FullLoader } from "./FullLoader-Btjb2W2p.mjs";
8
8
  import { useIntl } from "react-intl";
9
9
  import { useSearchParams } from "react-router-dom";
10
10
  import { Cross, ChevronDown, Pencil } from "@strapi/icons";
@@ -73,8 +73,15 @@ function SearchInput({
73
73
  "button",
74
74
  {
75
75
  type: "button",
76
- onClick: () => handleSearchChange({ target: { value: "" } }),
77
- style: { color: "inherit", background: "none", border: "none", cursor: "pointer" },
76
+ onClick: () => handleSearchChange({
77
+ target: { value: "" }
78
+ }),
79
+ style: {
80
+ color: "inherit",
81
+ background: "none",
82
+ border: "none",
83
+ cursor: "pointer"
84
+ },
78
85
  "aria-label": "Clear search",
79
86
  children: /* @__PURE__ */ jsx(Cross, {})
80
87
  }
@@ -125,25 +132,11 @@ function TableHeader({
125
132
  function TableRow({ route }) {
126
133
  const { formatMessage } = useIntl();
127
134
  return /* @__PURE__ */ jsxs(Tr, { children: [
128
- [route.title, route.canonicalPath, route.path].map((field, index) => /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
129
- Typography,
130
- {
131
- title: field,
132
- textColor: "neutral800",
133
- children: field || "-"
134
- }
135
- ) }, index)),
136
- /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
137
- Typography,
138
- {
139
- title: route.type,
140
- textColor: "neutral800",
141
- children: formatMessage({
142
- id: getTranslation(`path.type.${route.type}`),
143
- defaultMessage: "-"
144
- })
145
- }
146
- ) }),
135
+ [route.title, route.canonicalPath, route.path].map((field, index) => /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { title: field, textColor: "neutral800", children: field || "-" }) }, index)),
136
+ /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { title: route.type, textColor: "neutral800", children: formatMessage({
137
+ id: getTranslation(`path.type.${route.type}`),
138
+ defaultMessage: "-"
139
+ }) }) }),
147
140
  /* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Flex, { gap: 2, justifyContent: "end", children: route.type === "internal" && /* @__PURE__ */ jsx(
148
141
  LinkButton,
149
142
  {
@@ -165,26 +158,19 @@ function PathTable({
165
158
  }) {
166
159
  const { formatMessage } = useIntl();
167
160
  const TABLE_COL_COUNT = 5;
168
- return /* @__PURE__ */ jsxs(
169
- Table,
170
- {
171
- colCount: TABLE_COL_COUNT,
172
- rowCount: routes.length,
173
- children: [
174
- /* @__PURE__ */ jsx(TableHeader, { sortKey, handleSort }),
175
- /* @__PURE__ */ jsx(Tbody, { children: routes.length > 0 ? routes.map((route) => /* @__PURE__ */ jsx(TableRow, { route }, route.id)) : /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: TABLE_COL_COUNT, children: /* @__PURE__ */ jsx(
176
- EmptyStateLayout,
177
- {
178
- shadow: "none",
179
- content: formatMessage({
180
- id: getTranslation("paths.page.emptyPaths"),
181
- defaultMessage: "No paths found"
182
- })
183
- }
184
- ) }) }) })
185
- ]
186
- }
187
- );
161
+ return /* @__PURE__ */ jsxs(Table, { colCount: TABLE_COL_COUNT, rowCount: routes.length, children: [
162
+ /* @__PURE__ */ jsx(TableHeader, { sortKey, handleSort }),
163
+ /* @__PURE__ */ jsx(Tbody, { children: routes.length > 0 ? routes.map((route) => /* @__PURE__ */ jsx(TableRow, { route }, route.id)) : /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: TABLE_COL_COUNT, children: /* @__PURE__ */ jsx(
164
+ EmptyStateLayout,
165
+ {
166
+ shadow: "none",
167
+ content: formatMessage({
168
+ id: getTranslation("paths.page.emptyPaths"),
169
+ defaultMessage: "No paths found"
170
+ })
171
+ }
172
+ ) }) }) })
173
+ ] });
188
174
  }
189
175
  const Paths = () => {
190
176
  const { getAllRoutes } = useApi();
@@ -249,24 +235,10 @@ const Paths = () => {
249
235
  return /* @__PURE__ */ jsx(PageWrapper, { children: /* @__PURE__ */ jsx(FullLoader, {}) });
250
236
  }
251
237
  return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions["page.routes"], children: /* @__PURE__ */ jsxs(PageWrapper, { children: [
252
- /* @__PURE__ */ jsx(
253
- SearchInput,
254
- {
255
- handleSearchChange,
256
- searchQuery
257
- }
258
- ),
259
- /* @__PURE__ */ jsx(
260
- PathTable,
261
- {
262
- routes: sortedRoutes,
263
- sortKey,
264
- handleSort
265
- }
266
- )
238
+ /* @__PURE__ */ jsx(SearchInput, { handleSearchChange, searchQuery }),
239
+ /* @__PURE__ */ jsx(PathTable, { routes: sortedRoutes, sortKey, handleSort })
267
240
  ] }) });
268
241
  };
269
242
  export {
270
243
  Paths as default
271
244
  };
272
- //# sourceMappingURL=index-Cf9j0bn2.mjs.map