strapi-plugin-cm-subnav-stacker 0.0.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.
- package/README.md +101 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/admin/index.js +928 -0
- package/dist/admin/index.mjs +911 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/components/SubNavInjector.d.ts +31 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +84 -0
- package/dist/server/index.mjs +85 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/controller.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +9 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +67 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/content-api.d.ts +9 -0
- package/dist/server/src/routes/index.d.ts +27 -0
- package/dist/server/src/services/index.d.ts +12 -0
- package/dist/server/src/services/service.d.ts +11 -0
- package/package.json +87 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Permission } from '@strapi/strapi/admin';
|
|
3
|
+
interface ContentType {
|
|
4
|
+
uid: string;
|
|
5
|
+
name: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
group: string;
|
|
8
|
+
isDisplayed: boolean;
|
|
9
|
+
href: string;
|
|
10
|
+
kind: 'collectionType' | 'singleType';
|
|
11
|
+
sortOrder: number;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface Window {
|
|
15
|
+
strapiContentTypes?: Array<ContentType>;
|
|
16
|
+
strapiPermissions?: Array<Permission>;
|
|
17
|
+
navObserver?: MutationObserver;
|
|
18
|
+
navigationInitialized?: boolean;
|
|
19
|
+
checkNavigationInterval?: number;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Root Navigation Application
|
|
24
|
+
*/
|
|
25
|
+
declare const NavigationApp: React.FC;
|
|
26
|
+
/**
|
|
27
|
+
* Main function to build stacked navigation
|
|
28
|
+
* (Called from app.tsx bootstrap)
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildNavigation(): Promise<void>;
|
|
31
|
+
export default NavigationApp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLUGIN_ID = "cm-subnav-stacker";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const bootstrap = ({ strapi }) => {
|
|
3
|
+
};
|
|
4
|
+
const destroy = ({ strapi }) => {
|
|
5
|
+
};
|
|
6
|
+
const register = ({ strapi }) => {
|
|
7
|
+
};
|
|
8
|
+
const config = {
|
|
9
|
+
default: {},
|
|
10
|
+
validator() {
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const contentTypes = {};
|
|
14
|
+
const controller = ({ strapi }) => ({
|
|
15
|
+
index(ctx) {
|
|
16
|
+
ctx.body = strapi.plugin("cm-subnav-stacker").service("service").getWelcomeMessage();
|
|
17
|
+
},
|
|
18
|
+
async getConfig(ctx) {
|
|
19
|
+
ctx.body = strapi.plugin("cm-subnav-stacker").service("service").getConfig();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const controllers = {
|
|
23
|
+
controller
|
|
24
|
+
};
|
|
25
|
+
const middlewares = {};
|
|
26
|
+
const policies = {};
|
|
27
|
+
const contentAPIRoutes = [
|
|
28
|
+
{
|
|
29
|
+
method: "GET",
|
|
30
|
+
path: "/",
|
|
31
|
+
// name of the controller file & the method.
|
|
32
|
+
handler: "controller.index",
|
|
33
|
+
config: {
|
|
34
|
+
policies: []
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
const routes = {
|
|
39
|
+
"content-api": {
|
|
40
|
+
type: "content-api",
|
|
41
|
+
routes: contentAPIRoutes
|
|
42
|
+
},
|
|
43
|
+
"cm-subnav-stacker": {
|
|
44
|
+
type: "admin",
|
|
45
|
+
routes: [
|
|
46
|
+
{
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: "/config",
|
|
49
|
+
handler: "controller.getConfig",
|
|
50
|
+
config: {
|
|
51
|
+
auth: false,
|
|
52
|
+
policies: [],
|
|
53
|
+
middlewares: []
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const service = ({ strapi }) => ({
|
|
60
|
+
getWelcomeMessage() {
|
|
61
|
+
return "Welcome to Strapi 🚀";
|
|
62
|
+
},
|
|
63
|
+
getConfig() {
|
|
64
|
+
const delimiter = strapi.plugin("cm-subnav-stacker").config("delimiter");
|
|
65
|
+
const template = strapi.plugin("cm-subnav-stacker").config("template");
|
|
66
|
+
return { delimiter, template };
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const services = {
|
|
70
|
+
service
|
|
71
|
+
};
|
|
72
|
+
const index = {
|
|
73
|
+
register,
|
|
74
|
+
bootstrap,
|
|
75
|
+
destroy,
|
|
76
|
+
config,
|
|
77
|
+
controllers,
|
|
78
|
+
routes,
|
|
79
|
+
services,
|
|
80
|
+
contentTypes,
|
|
81
|
+
policies,
|
|
82
|
+
middlewares
|
|
83
|
+
};
|
|
84
|
+
module.exports = index;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const bootstrap = ({ strapi }) => {
|
|
2
|
+
};
|
|
3
|
+
const destroy = ({ strapi }) => {
|
|
4
|
+
};
|
|
5
|
+
const register = ({ strapi }) => {
|
|
6
|
+
};
|
|
7
|
+
const config = {
|
|
8
|
+
default: {},
|
|
9
|
+
validator() {
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const contentTypes = {};
|
|
13
|
+
const controller = ({ strapi }) => ({
|
|
14
|
+
index(ctx) {
|
|
15
|
+
ctx.body = strapi.plugin("cm-subnav-stacker").service("service").getWelcomeMessage();
|
|
16
|
+
},
|
|
17
|
+
async getConfig(ctx) {
|
|
18
|
+
ctx.body = strapi.plugin("cm-subnav-stacker").service("service").getConfig();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const controllers = {
|
|
22
|
+
controller
|
|
23
|
+
};
|
|
24
|
+
const middlewares = {};
|
|
25
|
+
const policies = {};
|
|
26
|
+
const contentAPIRoutes = [
|
|
27
|
+
{
|
|
28
|
+
method: "GET",
|
|
29
|
+
path: "/",
|
|
30
|
+
// name of the controller file & the method.
|
|
31
|
+
handler: "controller.index",
|
|
32
|
+
config: {
|
|
33
|
+
policies: []
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
const routes = {
|
|
38
|
+
"content-api": {
|
|
39
|
+
type: "content-api",
|
|
40
|
+
routes: contentAPIRoutes
|
|
41
|
+
},
|
|
42
|
+
"cm-subnav-stacker": {
|
|
43
|
+
type: "admin",
|
|
44
|
+
routes: [
|
|
45
|
+
{
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/config",
|
|
48
|
+
handler: "controller.getConfig",
|
|
49
|
+
config: {
|
|
50
|
+
auth: false,
|
|
51
|
+
policies: [],
|
|
52
|
+
middlewares: []
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const service = ({ strapi }) => ({
|
|
59
|
+
getWelcomeMessage() {
|
|
60
|
+
return "Welcome to Strapi 🚀";
|
|
61
|
+
},
|
|
62
|
+
getConfig() {
|
|
63
|
+
const delimiter = strapi.plugin("cm-subnav-stacker").config("delimiter");
|
|
64
|
+
const template = strapi.plugin("cm-subnav-stacker").config("template");
|
|
65
|
+
return { delimiter, template };
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const services = {
|
|
69
|
+
service
|
|
70
|
+
};
|
|
71
|
+
const index = {
|
|
72
|
+
register,
|
|
73
|
+
bootstrap,
|
|
74
|
+
destroy,
|
|
75
|
+
config,
|
|
76
|
+
controllers,
|
|
77
|
+
routes,
|
|
78
|
+
services,
|
|
79
|
+
contentTypes,
|
|
80
|
+
policies,
|
|
81
|
+
middlewares
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
index as default
|
|
85
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => void;
|
|
5
|
+
bootstrap: ({ strapi }: {
|
|
6
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
+
}) => void;
|
|
8
|
+
destroy: ({ strapi }: {
|
|
9
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
10
|
+
}) => void;
|
|
11
|
+
config: {
|
|
12
|
+
default: {};
|
|
13
|
+
validator(): void;
|
|
14
|
+
};
|
|
15
|
+
controllers: {
|
|
16
|
+
controller: ({ strapi }: {
|
|
17
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
18
|
+
}) => {
|
|
19
|
+
index(ctx: any): void;
|
|
20
|
+
getConfig(ctx: any): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
routes: {
|
|
24
|
+
'content-api': {
|
|
25
|
+
type: string;
|
|
26
|
+
routes: {
|
|
27
|
+
method: string;
|
|
28
|
+
path: string;
|
|
29
|
+
handler: string;
|
|
30
|
+
/**
|
|
31
|
+
* Plugin server methods
|
|
32
|
+
*/
|
|
33
|
+
config: {
|
|
34
|
+
policies: any[];
|
|
35
|
+
};
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
'cm-subnav-stacker': {
|
|
39
|
+
type: string;
|
|
40
|
+
routes: {
|
|
41
|
+
method: string;
|
|
42
|
+
path: string;
|
|
43
|
+
handler: string;
|
|
44
|
+
config: {
|
|
45
|
+
auth: boolean;
|
|
46
|
+
policies: any[];
|
|
47
|
+
middlewares: any[];
|
|
48
|
+
};
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
services: {
|
|
53
|
+
service: ({ strapi }: {
|
|
54
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
55
|
+
}) => {
|
|
56
|
+
getWelcomeMessage(): string;
|
|
57
|
+
getConfig(): {
|
|
58
|
+
delimiter: unknown;
|
|
59
|
+
template: unknown;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
contentTypes: {};
|
|
64
|
+
policies: {};
|
|
65
|
+
middlewares: {};
|
|
66
|
+
};
|
|
67
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const routes: {
|
|
2
|
+
'content-api': {
|
|
3
|
+
type: string;
|
|
4
|
+
routes: {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
config: {
|
|
9
|
+
policies: any[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
'cm-subnav-stacker': {
|
|
14
|
+
type: string;
|
|
15
|
+
routes: {
|
|
16
|
+
method: string;
|
|
17
|
+
path: string;
|
|
18
|
+
handler: string;
|
|
19
|
+
config: {
|
|
20
|
+
auth: boolean;
|
|
21
|
+
policies: any[];
|
|
22
|
+
middlewares: any[];
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default routes;
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.0.1",
|
|
3
|
+
"keywords": [],
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package.json": "./package.json",
|
|
7
|
+
"./strapi-admin": {
|
|
8
|
+
"types": "./dist/admin/src/index.d.ts",
|
|
9
|
+
"source": "./admin/src/index.ts",
|
|
10
|
+
"import": "./dist/admin/index.mjs",
|
|
11
|
+
"require": "./dist/admin/index.js",
|
|
12
|
+
"default": "./dist/admin/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./strapi-server": {
|
|
15
|
+
"types": "./dist/server/src/index.d.ts",
|
|
16
|
+
"source": "./server/src/index.ts",
|
|
17
|
+
"import": "./dist/server/index.mjs",
|
|
18
|
+
"require": "./dist/server/index.js",
|
|
19
|
+
"default": "./dist/server/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "strapi-plugin build",
|
|
27
|
+
"watch": "strapi-plugin watch",
|
|
28
|
+
"watch:link": "strapi-plugin watch:link",
|
|
29
|
+
"verify": "strapi-plugin verify",
|
|
30
|
+
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
31
|
+
"test:ts:back": "run -T tsc -p server/tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"js-cookie": "^3.0.5",
|
|
35
|
+
"react-intl": "^7.1.11"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@strapi/design-system": "^2.0.0-rc.30",
|
|
39
|
+
"@strapi/icons": "^2.0.0-rc.30",
|
|
40
|
+
"@strapi/sdk-plugin": "^5.3.2",
|
|
41
|
+
"@strapi/strapi": "5.33.0",
|
|
42
|
+
"@strapi/typescript-utils": "5.33.0",
|
|
43
|
+
"@types/react": "^19.1.10",
|
|
44
|
+
"@types/react-dom": "^19.1.7",
|
|
45
|
+
"prettier": "^3.6.2",
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
|
+
"react-router-dom": "^6.30.1",
|
|
49
|
+
"styled-components": "^6.1.19",
|
|
50
|
+
"typescript": "^5.9.2"
|
|
51
|
+
},
|
|
52
|
+
"optionalDependencies": {
|
|
53
|
+
"@esbuild/darwin-arm64": "^0.20.2",
|
|
54
|
+
"@esbuild/darwin-x64": "^0.20.2",
|
|
55
|
+
"@esbuild/linux-arm64": "^0.20.2",
|
|
56
|
+
"@esbuild/linux-x64": "^0.20.2",
|
|
57
|
+
"@esbuild/win32-x64": "^0.20.2"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@strapi/design-system": "^2.0.0-rc.30",
|
|
61
|
+
"@strapi/icons": "^2.0.0-rc.30",
|
|
62
|
+
"@strapi/sdk-plugin": "^5.3.2",
|
|
63
|
+
"@strapi/strapi": "5.33.0",
|
|
64
|
+
"react": "^18.3.1",
|
|
65
|
+
"react-dom": "^18.3.1",
|
|
66
|
+
"react-router-dom": "^6.30.1",
|
|
67
|
+
"styled-components": "^6.1.19"
|
|
68
|
+
},
|
|
69
|
+
"strapi": {
|
|
70
|
+
"kind": "plugin",
|
|
71
|
+
"name": "cm-subnav-stacker",
|
|
72
|
+
"displayName": "Content Manager Subnavigation Stacker",
|
|
73
|
+
"description": "Automatically groups related content types in the Strapi Content Manager sidebar into collapsible subnavigation sections based on name patterns."
|
|
74
|
+
},
|
|
75
|
+
"name": "strapi-plugin-cm-subnav-stacker",
|
|
76
|
+
"description": "Automatically groups related content types in the Strapi Content Manager sidebar into collapsible subnavigation sections based on name patterns.",
|
|
77
|
+
"license": "MIT",
|
|
78
|
+
"repository": {
|
|
79
|
+
"type": "git",
|
|
80
|
+
"url": "git+ssh://git@github.com/patiparnne/strapi-plugin-cm-subnav-stacker.git"
|
|
81
|
+
},
|
|
82
|
+
"bugs": {
|
|
83
|
+
"url": "https://github.com/patiparnne/strapi-plugin-cm-subnav-stacker/issues"
|
|
84
|
+
},
|
|
85
|
+
"homepage": "https://github.com/patiparnne/strapi-plugin-cm-subnav-stacker#readme",
|
|
86
|
+
"author": "Patiparnne <partyparti@gmail.com>"
|
|
87
|
+
}
|