@mattisvensson/strapi-plugin-webatlas 0.1.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 (94) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +140 -0
  3. package/dist/_chunks/_commonjsHelpers-BxmBWJD2.mjs +33 -0
  4. package/dist/_chunks/_commonjsHelpers-Cq6wktVC.js +32 -0
  5. package/dist/_chunks/en-B4KWt_jN.js +4 -0
  6. package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
  7. package/dist/_chunks/index-B76GOOtR.js +18024 -0
  8. package/dist/_chunks/index-B8hoZtTR.js +47 -0
  9. package/dist/_chunks/index-B8i-28Jt.mjs +774 -0
  10. package/dist/_chunks/index-BFv_JAKx.mjs +6814 -0
  11. package/dist/_chunks/index-CJUhT0VV.js +773 -0
  12. package/dist/_chunks/index-D9yK1vNq.js +6814 -0
  13. package/dist/_chunks/index-DClS2XL-.mjs +47 -0
  14. package/dist/_chunks/index-DbKqIKw_.mjs +17984 -0
  15. package/dist/admin/index.js +4 -0
  16. package/dist/admin/index.mjs +5 -0
  17. package/dist/admin/src/components/CMEditViewAside/Alias.d.ts +5 -0
  18. package/dist/admin/src/components/CMEditViewAside/index.d.ts +2 -0
  19. package/dist/admin/src/components/Initializer.d.ts +5 -0
  20. package/dist/admin/src/components/PluginIcon.d.ts +3 -0
  21. package/dist/admin/src/components/Tooltip.d.ts +3 -0
  22. package/dist/admin/src/components/UI/Center.d.ts +5 -0
  23. package/dist/admin/src/components/URLInfo.d.ts +6 -0
  24. package/dist/admin/src/components/modals/Delete.d.ts +14 -0
  25. package/dist/admin/src/components/modals/NavCreate.d.ts +1 -0
  26. package/dist/admin/src/components/modals/NavEdit.d.ts +7 -0
  27. package/dist/admin/src/components/modals/NavModal.d.ts +15 -0
  28. package/dist/admin/src/components/modals/NavOverview.d.ts +8 -0
  29. package/dist/admin/src/components/modals/externalItem/index.d.ts +9 -0
  30. package/dist/admin/src/components/modals/index.d.ts +12 -0
  31. package/dist/admin/src/components/modals/internalItem/internalItemCreate.d.ts +3 -0
  32. package/dist/admin/src/components/modals/internalItem/internalItemEdit.d.ts +3 -0
  33. package/dist/admin/src/components/modals/useModalSharedLogic.d.ts +2 -0
  34. package/dist/admin/src/components/modals/withModalSharedLogic.d.ts +3 -0
  35. package/dist/admin/src/components/modals/wrapperItem/index.d.ts +9 -0
  36. package/dist/admin/src/contexts/index.d.ts +13 -0
  37. package/dist/admin/src/hooks/index.d.ts +6 -0
  38. package/dist/admin/src/hooks/useAllContentTypes.d.ts +7 -0
  39. package/dist/admin/src/hooks/useAllEntities.d.ts +7 -0
  40. package/dist/admin/src/hooks/useApi.d.ts +15 -0
  41. package/dist/admin/src/hooks/useNavigations.d.ts +5 -0
  42. package/dist/admin/src/hooks/usePluginConfig.d.ts +9 -0
  43. package/dist/admin/src/index.d.ts +12 -0
  44. package/dist/admin/src/pages/Navigation/EmptyNav.d.ts +5 -0
  45. package/dist/admin/src/pages/Navigation/Header.d.ts +6 -0
  46. package/dist/admin/src/pages/Navigation/RouteItem.d.ts +15 -0
  47. package/dist/admin/src/pages/Navigation/SortableRouteItem.d.ts +2 -0
  48. package/dist/admin/src/pages/Navigation/index.d.ts +2 -0
  49. package/dist/admin/src/pages/Routes/index.d.ts +2 -0
  50. package/dist/admin/src/pages/Settings/index.d.ts +2 -0
  51. package/dist/admin/src/utils/countChildren.d.ts +2 -0
  52. package/dist/admin/src/utils/debounce.d.ts +1 -0
  53. package/dist/admin/src/utils/dnd.d.ts +13 -0
  54. package/dist/admin/src/utils/duplicateCheck.d.ts +8 -0
  55. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  56. package/dist/admin/src/utils/index.d.ts +6 -0
  57. package/dist/admin/src/utils/typeChecks.d.ts +3 -0
  58. package/dist/pluginId.d.ts +3 -0
  59. package/dist/server/index.js +1861 -0
  60. package/dist/server/index.mjs +1862 -0
  61. package/dist/server/src/bootstrap.d.ts +5 -0
  62. package/dist/server/src/config/index.d.ts +5 -0
  63. package/dist/server/src/content-types/index.d.ts +189 -0
  64. package/dist/server/src/content-types/navigation/index.d.ts +49 -0
  65. package/dist/server/src/content-types/navigation/schema.d.ts +47 -0
  66. package/dist/server/src/content-types/navitem/index.d.ts +50 -0
  67. package/dist/server/src/content-types/navitem/schema.d.ts +48 -0
  68. package/dist/server/src/content-types/route/index.d.ts +90 -0
  69. package/dist/server/src/content-types/route/schema.d.ts +88 -0
  70. package/dist/server/src/controllers/admin.d.ts +16 -0
  71. package/dist/server/src/controllers/client.d.ts +8 -0
  72. package/dist/server/src/controllers/index.d.ts +24 -0
  73. package/dist/server/src/destroy.d.ts +5 -0
  74. package/dist/server/src/index.d.ts +279 -0
  75. package/dist/server/src/middlewares/index.d.ts +2 -0
  76. package/dist/server/src/policies/index.d.ts +2 -0
  77. package/dist/server/src/register.d.ts +5 -0
  78. package/dist/server/src/routes/admin.d.ts +13 -0
  79. package/dist/server/src/routes/client.d.ts +12 -0
  80. package/dist/server/src/routes/index.d.ts +26 -0
  81. package/dist/server/src/services/admin.d.ts +19 -0
  82. package/dist/server/src/services/client.d.ts +8 -0
  83. package/dist/server/src/services/index.d.ts +26 -0
  84. package/dist/server/src/utils/duplicateCheck.d.ts +1 -0
  85. package/dist/server/src/utils/pluginHelpers.d.ts +6 -0
  86. package/dist/utils/buildStructuredNavigation.d.ts +11 -0
  87. package/dist/utils/cleanRootKeys.d.ts +1 -0
  88. package/dist/utils/extractRouteAndItems.d.ts +2 -0
  89. package/dist/utils/getFullPath.d.ts +1 -0
  90. package/dist/utils/index.d.ts +9 -0
  91. package/dist/utils/populateDeep.d.ts +4 -0
  92. package/dist/utils/removeWaFields.d.ts +1 -0
  93. package/dist/utils/transformToUrl.d.ts +1 -0
  94. package/package.json +102 -0
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+
2
+
3
+ Copyright (c) 2025 PluginPal.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,140 @@
1
+ <div align="center">
2
+ <h1>Strapi Webatlas</h1>
3
+ <p>Navigation and slugs, finally in sync</p>
4
+ </div>
5
+
6
+ ---
7
+
8
+ This plugin bridges the gap between slugs and navigations in Strapi, making URL management and menu building seamless. With automatic slug generation, a clear route overview, and support for multiple navigations, it keeps your content organized and your routes consistent—effortlessly.
9
+
10
+ ---
11
+
12
+ This plugin is still in the early stages of development. Many features are planned but not yet implemented. The plugin is not fully documented. If you find any bugs, please contact me or create an issue.
13
+
14
+ ---
15
+
16
+ ### Table of Contents
17
+
18
+ 1. [💎 Versions](#versions)
19
+ 2. [✨ Features](#features)
20
+ 3. [⏳ Installation](#installation)
21
+ 4. [🖐 Requirements](#requirements)
22
+ 5. [🔧 Configuration](#configuration)
23
+ 6. [🧩 Roadmap](#roadmap)
24
+
25
+ ## 💎 Versions
26
+
27
+ - **Strapi v5** - [v1.x (work in progress)](https://github.com/mattisvensson/strapi-plugin-webatlas/tree/main)
28
+ - **Strapi v4** - [v1.x (Archived – no further updates)](https://github.com/mattisvensson/strapi-plugin-webatlas/tree/main)
29
+
30
+ ## ✨ Features
31
+
32
+ - **🚀 Automatic Slug Generation:** Automatically generate clean, SEO-friendly slugs based on your content fields. No more manual slug writing — just choose the field, and the plugin takes care of the rest. Slugs are unique and easily customizable.
33
+ - **🗺️ Route Overview Page:** Gain a full, centralized overview of all registered routes and their corresponding content entries.
34
+ - **🧭 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
+ - **🧩 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
+ - **🧠 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.
37
+
38
+ ## ⏳ Installation
39
+
40
+ ### Via command line
41
+
42
+ (Use **yarn** to install this plugin within your Strapi project (recommended). [Install yarn with these docs](https://yarnpkg.com/lang/en/docs/install/).)
43
+
44
+ ```bash
45
+ yarn add strapi-plugin-webatlas@latest
46
+ ```
47
+
48
+ After successful installation you've to re-build your Strapi instance. To archive that simply use:
49
+
50
+ ```bash
51
+ yarn build
52
+ yarn develop
53
+ ```
54
+
55
+ **Webatlas** should appear in the **Plugins** section of Strapi sidebar after you run app again.
56
+
57
+ As a next step you must configure your the plugin by the way you want to. See [**Configuration**](#🔧-configuration) section.
58
+
59
+ All done. Enjoy 🎉
60
+
61
+ ## 🖐 Requirements
62
+
63
+ **Minimum environment requirements**
64
+
65
+ - Node.js `>=20.0.0`
66
+ - NPM `>=10.x.x`
67
+
68
+ ## 🔧 Configuration
69
+
70
+ To use a content type with Webatlas, you need to set the plugin options in the content type schema. You can do this by editing the content type's schema file located in `src/api/[content-type]/content-types/[content-type]/schema.json`.
71
+
72
+ Your schema should contain the following:
73
+
74
+ ```json
75
+ {
76
+ // ... other schema properties ...
77
+ "pluginOptions": {
78
+ "webatlas": {
79
+ "active": true
80
+ },
81
+ // ... other plugin options ...
82
+ }
83
+ }
84
+ ```
85
+
86
+ You can then still enable or disable the plugin for each content type in the settings page of the plugin without the need to edit the schema file again or redeploy your Strapi instance.
87
+
88
+ ### Settings page
89
+
90
+ Use the settings page to configure the plugin.
91
+
92
+ - **Enable content types:** Select for which content types the plugin should be available.
93
+
94
+ For each selected content type, you have the following settings:
95
+
96
+ - **Default URL Alias field:** Select a field from which the slug will automatically be generated. For example, use the 'title' field or a dedicated slug field.
97
+ - **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.
98
+ - **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.
99
+
100
+ ## 🧩 Roadmap
101
+
102
+ - v5 compatibility
103
+ - RBAC
104
+ - User action feedback
105
+ - Internationalization
106
+ - Plugin translations
107
+ - Draft and published
108
+ - Route page
109
+ - Filters
110
+ - Nested url structure
111
+ - Entity page
112
+ - Show all routes for entity
113
+ - Add to navigation from entity
114
+ - Settings
115
+ - Navigation settings
116
+ - Max nested items
117
+ - Prevent navigation deletion
118
+ - Navigation page
119
+ - Custom fields for nav items
120
+ - Nested paths through wrapper/external item
121
+ - Move navigation item with children
122
+ - Item search
123
+ - Collapse items
124
+ - Multi action for items
125
+
126
+ ---
127
+
128
+ This plugin is still in the early stages of development. Many features are planned but not yet implemented. The plugin is not fully documented. If you find any bugs, please contact me or create an issue.
129
+
130
+ ---
131
+
132
+ ## 📝 License
133
+
134
+ [MIT License](LICENSE.md) Copyright (c) [Matti Svensson](https://mattisvensson.com/)
135
+
136
+ Webatlas v5 is based on the [plugin boilerplate](https://github.com/pluginpal/strapi-plugin-boilerplate#readme) by [PluginPal](https://www.pluginpal.io/).
137
+
138
+ > Copyright (c) 2025 PluginPal.
139
+ >
140
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -0,0 +1,33 @@
1
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2
+ function getDefaultExportFromCjs(x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
+ }
5
+ function getAugmentedNamespace(n) {
6
+ if (n.__esModule) return n;
7
+ var f = n.default;
8
+ if (typeof f == "function") {
9
+ var a = function a2() {
10
+ if (this instanceof a2) {
11
+ return Reflect.construct(f, arguments, this.constructor);
12
+ }
13
+ return f.apply(this, arguments);
14
+ };
15
+ a.prototype = f.prototype;
16
+ } else a = {};
17
+ Object.defineProperty(a, "__esModule", { value: true });
18
+ Object.keys(n).forEach(function(k) {
19
+ var d = Object.getOwnPropertyDescriptor(n, k);
20
+ Object.defineProperty(a, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function() {
23
+ return n[k];
24
+ }
25
+ });
26
+ });
27
+ return a;
28
+ }
29
+ export {
30
+ getDefaultExportFromCjs as a,
31
+ commonjsGlobal as c,
32
+ getAugmentedNamespace as g
33
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3
+ function getDefaultExportFromCjs(x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
+ }
6
+ function getAugmentedNamespace(n) {
7
+ if (n.__esModule) return n;
8
+ var f = n.default;
9
+ if (typeof f == "function") {
10
+ var a = function a2() {
11
+ if (this instanceof a2) {
12
+ return Reflect.construct(f, arguments, this.constructor);
13
+ }
14
+ return f.apply(this, arguments);
15
+ };
16
+ a.prototype = f.prototype;
17
+ } else a = {};
18
+ Object.defineProperty(a, "__esModule", { value: true });
19
+ Object.keys(n).forEach(function(k) {
20
+ var d = Object.getOwnPropertyDescriptor(n, k);
21
+ Object.defineProperty(a, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function() {
24
+ return n[k];
25
+ }
26
+ });
27
+ });
28
+ return a;
29
+ }
30
+ exports.commonjsGlobal = commonjsGlobal;
31
+ exports.getAugmentedNamespace = getAugmentedNamespace;
32
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const en = {};
4
+ exports.default = en;
@@ -0,0 +1,4 @@
1
+ const en = {};
2
+ export {
3
+ en as default
4
+ };