@mattisvensson/strapi-plugin-webatlas 0.1.6 → 0.2.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.
Files changed (29) hide show
  1. package/README.md +32 -5
  2. package/dist/_chunks/EmptyBox-7D4LrvdH.mjs +16 -0
  3. package/dist/_chunks/EmptyBox-DT6D5gcf.js +15 -0
  4. package/dist/_chunks/_baseConvert-B84_vf8X.js +864 -0
  5. package/dist/_chunks/_baseConvert-C2SW1VHq.mjs +865 -0
  6. package/dist/_chunks/{index-B3GOkpFO.js → index-B2j5uojM.js} +3140 -32
  7. package/dist/_chunks/{index-DWbEC3_A.mjs → index-BDU-lYsm.mjs} +14 -844
  8. package/dist/_chunks/{index-BoTOXEX8.mjs → index-BwErs0UT.mjs} +4 -7
  9. package/dist/_chunks/{index-DDVtOWSL.js → index-DC0vflKd.js} +4 -7
  10. package/dist/_chunks/{index-DfHrvxDY.js → index-DOVsVqnP.js} +39 -28
  11. package/dist/_chunks/{index-q4x-lnlr.js → index-DU_hn0uc.js} +30 -860
  12. package/dist/_chunks/{index-DL3LkD8O.mjs → index-Doc1ry3x.mjs} +3136 -28
  13. package/dist/_chunks/{index-lOv9Po4g.mjs → index-c7q9J79y.mjs} +39 -28
  14. package/dist/admin/index.js +1 -1
  15. package/dist/admin/index.mjs +1 -1
  16. package/dist/admin/src/{pages/Navigation/EmptyNav.d.ts → components/UI/EmptyBox.d.ts} +1 -1
  17. package/dist/admin/src/components/UI/index.d.ts +3 -0
  18. package/dist/admin/src/hooks/useApi.d.ts +1 -1
  19. package/dist/server/index.js +4246 -272
  20. package/dist/server/index.mjs +4246 -272
  21. package/dist/server/src/controllers/admin.d.ts +2 -1
  22. package/dist/server/src/controllers/index.d.ts +2 -1
  23. package/dist/server/src/index.d.ts +5 -3
  24. package/dist/server/src/services/admin.d.ts +2 -1
  25. package/dist/server/src/services/client.d.ts +1 -1
  26. package/dist/server/src/services/index.d.ts +3 -2
  27. package/package.json +1 -1
  28. package/dist/_chunks/_commonjsHelpers-BxmBWJD2.mjs +0 -33
  29. package/dist/_chunks/_commonjsHelpers-Cq6wktVC.js +0 -32
package/README.md CHANGED
@@ -20,7 +20,8 @@ This plugin is still in the early stages of development. Many features are plann
20
20
  3. [⏳ Installation](#installation)
21
21
  4. [🖐 Requirements](#requirements)
22
22
  5. [🔧 Configuration](#configuration)
23
- 6. [🧩 Roadmap](#roadmap)
23
+ 6. [📖 Usage](#usage)
24
+ 7. [🧩 Roadmap](#roadmap)
24
25
 
25
26
  ## 💎 Versions
26
27
 
@@ -40,12 +41,12 @@ This plugin is still in the early stages of development. Many features are plann
40
41
  Install Webatlas via command line with a package manager of your choice.
41
42
  Using NPM:
42
43
  ```bash
43
- npm install strapi-plugin-webatlas@beta
44
+ npm install @mattisvensson/strapi-plugin-webatlas@beta
44
45
  ```
45
46
 
46
47
  Using Yarn:
47
48
  ```bash
48
- yarn add strapi-plugin-webatlas@beta
49
+ yarn add @mattisvensson/strapi-plugin-webatlas@beta
49
50
  ```
50
51
 
51
52
  As a next step you must configure your the plugin by the way you want to. See [**Configuration**](#🔧-configuration) section.
@@ -56,8 +57,8 @@ All done. Enjoy 🎉
56
57
 
57
58
  **Minimum environment requirements**
58
59
 
60
+ - Strapi `>=5.0.0`
59
61
  - Node.js `>=20.0.0`
60
- - NPM `>=10.x.x`
61
62
 
62
63
  ## 🔧 Configuration
63
64
 
@@ -91,13 +92,39 @@ For each selected content type, you have the following settings:
91
92
  - **URL Alias pattern:** Create a default pattern for the slug. For example, when creating a 'news' content type and you want your url structure to be like '/news/some-title' for all entities, enter 'news' in this setting field. The slug will automatically be appended to this string.
92
93
  - **URL Alias API field:** Allows you to append the current URL (slug) of an entity to a specific field. This is especially useful when working with components like a "teaser"—for example, you can store the slug in a hidden field within the teaser component. This way, you can fetch just the teaser via the API while still having access to its full URL.
93
94
 
95
+ ## 📖 Usage
96
+
97
+ Webatlas provides two API endpoints. One to fetch routes and one to fetch navigations.
98
+
99
+ ### Fetch route
100
+
101
+ `GET /api/webatlas/path`
102
+
103
+ Query parameters:
104
+ - `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 documentId path.
105
+ - `populate` (string, optional): Comma-separated list of relations to populate. Use `deep` to populate all relations in any depth.
106
+ - `populateDeepDepth` (string, optional): Depth for deep population.
107
+ - `fields` (string, optional): Comma-separated list of fields to include in the response.
108
+ - `status` (string, optional): `draft` or `published`. Default is `published`. Returns the draft or published version of the entity.
109
+
110
+ ### Fetch navigation
111
+
112
+ `GET /api/webatlas/navigation`
113
+
114
+ One of these query parameters are mandatory to fetch a navigation. If you provide multiple, `documentId` has the highest priority, followed by `name` and `id`.
115
+ - `documentId` (string, optional): The document ID of the navigation to fetch.
116
+ - `name` (string, optional): The name of the navigation to fetch.
117
+ - `id` (string, optional): The ID of the navigation to fetch.
118
+
119
+ Optional parameters:
120
+ - `variant` (string, optional): `nested` or `flat`.The variant of the navigation to fetch. Default is `nested`.
121
+
94
122
  ## 🧩 Roadmap
95
123
 
96
124
  - RBAC
97
125
  - User action feedback
98
126
  - Internationalization
99
127
  - Plugin translations
100
- - Draft and published
101
128
  - Route page
102
129
  - Filters
103
130
  - Nested url structure
@@ -0,0 +1,16 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { Flex, Box, Typography } from "@strapi/design-system";
3
+ import { EmptyDocuments } from "@strapi/icons/symbols";
4
+ function Center({ height = 400, children }) {
5
+ return /* @__PURE__ */ jsx(Flex, { direction: "column", minHeight: `${height}px`, justifyContent: "center", children });
6
+ }
7
+ function EmptyBox({ msg }) {
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ /* @__PURE__ */ jsx(EmptyDocuments, { width: "10rem", height: "6rem" }),
10
+ /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral600", children: msg }) })
11
+ ] });
12
+ }
13
+ export {
14
+ Center as C,
15
+ EmptyBox as E
16
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const designSystem = require("@strapi/design-system");
4
+ const symbols = require("@strapi/icons/symbols");
5
+ function Center({ height = 400, children }) {
6
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", minHeight: `${height}px`, justifyContent: "center", children });
7
+ }
8
+ function EmptyBox({ msg }) {
9
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10
+ /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "10rem", height: "6rem" }),
11
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral600", children: msg }) })
12
+ ] });
13
+ }
14
+ exports.Center = Center;
15
+ exports.EmptyBox = EmptyBox;