strapi-plugin-navigation 3.0.0-beta.2 → 3.0.0-beta.4
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 +7 -7
- package/dist/_chunks/{ca-DIZHA0OL.mjs → ca-Catou0wg.mjs} +4 -0
- package/dist/_chunks/{ca-Bjfh0w36.js → ca-DtaqQvTI.js} +4 -0
- package/dist/admin/index.js +486 -308
- package/dist/admin/index.mjs +487 -309
- package/dist/admin/src/api/client.d.ts +4 -2
- package/dist/admin/src/api/validators.d.ts +10 -10
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +78 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemPopup/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationManager/types.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +4 -4
- package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +2 -2
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +1 -1
- package/dist/admin/src/translations/ca.d.ts +4 -0
- package/dist/server/index.js +113 -101
- package/dist/server/index.mjs +113 -101
- package/dist/server/src/content-types/index.d.ts +0 -4
- package/dist/server/src/content-types/navigation/index.d.ts +0 -4
- package/dist/server/src/content-types/navigation/schema.d.ts +0 -4
- package/dist/server/src/controllers/admin.d.ts +10 -10
- package/dist/server/src/controllers/client.d.ts +2 -2
- package/dist/server/src/controllers/validators.d.ts +2 -2
- package/dist/server/src/index.d.ts +7 -11
- package/dist/server/src/repositories/navigation-item.d.ts +8 -4
- package/dist/server/src/repositories/navigation.d.ts +12 -8
- package/dist/server/src/schemas/navigation.d.ts +8 -8
- package/dist/server/src/services/admin/admin.d.ts +2 -2
- package/dist/server/src/services/admin/types.d.ts +2 -2
- package/dist/server/src/services/admin/utils.d.ts +1 -1
- package/dist/server/src/services/client/client.d.ts +1 -1
- package/dist/server/src/services/index.d.ts +7 -7
- package/package.json +7 -8
|
@@ -103,10 +103,6 @@ declare const _default: {
|
|
|
103
103
|
configurable: boolean;
|
|
104
104
|
mappedBy: string;
|
|
105
105
|
};
|
|
106
|
-
localeCode: {
|
|
107
|
-
type: string;
|
|
108
|
-
configurable: boolean;
|
|
109
|
-
};
|
|
110
106
|
};
|
|
111
107
|
};
|
|
112
108
|
lifecycles: Record<string, import("./types").Effect<import("./types").LifeCycleEvent<import("./types").LifeCycleHookName, unknown, Record<string, unknown>>>>;
|
|
@@ -267,21 +263,21 @@ declare const _default: {
|
|
|
267
263
|
}) => {
|
|
268
264
|
config({ viaSettingsPage }: import("./services/admin/types").ConfigInput): Promise<import("./dtos").NavigationPluginConfigDTO>;
|
|
269
265
|
configContentTypes({ viaSettingsPage, }: import("./services/admin/types").ConfigInput): Promise<import("./dtos").ConfigContentTypeDTO[]>;
|
|
270
|
-
get({ ids,
|
|
266
|
+
get({ ids, locale }: import("./services/admin/types").GetInput): Promise<{
|
|
271
267
|
name: string;
|
|
272
268
|
id: number;
|
|
273
269
|
documentId: string;
|
|
274
270
|
slug: string;
|
|
275
|
-
|
|
271
|
+
locale: string;
|
|
276
272
|
visible: boolean;
|
|
277
273
|
items?: import("./schemas").NavigationItemDBSchema[] | undefined;
|
|
278
274
|
}[]>;
|
|
279
|
-
getById({ documentId,
|
|
275
|
+
getById({ documentId, locale }: import("./services/admin/types").GetByIdInput): Promise<{
|
|
280
276
|
name: string;
|
|
281
277
|
id: number;
|
|
282
278
|
documentId: string;
|
|
283
279
|
slug: string;
|
|
284
|
-
|
|
280
|
+
locale: string;
|
|
285
281
|
visible: boolean;
|
|
286
282
|
items?: import("./schemas").NavigationItemDBSchema[] | undefined;
|
|
287
283
|
}>;
|
|
@@ -291,7 +287,7 @@ declare const _default: {
|
|
|
291
287
|
id: number;
|
|
292
288
|
documentId: string;
|
|
293
289
|
slug: string;
|
|
294
|
-
|
|
290
|
+
locale: string;
|
|
295
291
|
visible: boolean;
|
|
296
292
|
items?: import("./schemas").NavigationItemDBSchema[] | undefined;
|
|
297
293
|
}>;
|
|
@@ -304,7 +300,7 @@ declare const _default: {
|
|
|
304
300
|
id: number;
|
|
305
301
|
documentId: string;
|
|
306
302
|
slug: string;
|
|
307
|
-
|
|
303
|
+
locale: string;
|
|
308
304
|
visible: boolean;
|
|
309
305
|
items?: import("./schemas").NavigationItemDBSchema[] | undefined;
|
|
310
306
|
}>;
|
|
@@ -445,7 +441,7 @@ declare const _default: {
|
|
|
445
441
|
id: number;
|
|
446
442
|
documentId: string;
|
|
447
443
|
slug: string;
|
|
448
|
-
|
|
444
|
+
locale: string;
|
|
449
445
|
visible: boolean;
|
|
450
446
|
items?: import("./schemas").NavigationItemDBSchema[] | undefined;
|
|
451
447
|
}[]>;
|
|
@@ -2,9 +2,10 @@ import { Core } from '@strapi/strapi';
|
|
|
2
2
|
import { NavigationItemDBSchema } from '../schemas';
|
|
3
3
|
type NavigationItemRemoveMinimal = Partial<NavigationItemDBSchema> & Pick<NavigationItemDBSchema, 'documentId'>;
|
|
4
4
|
interface FindInput {
|
|
5
|
-
|
|
5
|
+
filters: any;
|
|
6
|
+
locale?: string;
|
|
6
7
|
limit?: number;
|
|
7
|
-
populate?:
|
|
8
|
+
populate?: any;
|
|
8
9
|
order?: Record<string, 'asc' | 'desc'>[];
|
|
9
10
|
}
|
|
10
11
|
export declare const getNavigationItemRepository: (context: {
|
|
@@ -14,8 +15,11 @@ export declare const getNavigationItemRepository: (context: {
|
|
|
14
15
|
documentId: undefined;
|
|
15
16
|
}) | ({
|
|
16
17
|
documentId: string;
|
|
17
|
-
} & Partial<Omit<NavigationItemDBSchema, 'documentId'>>)):
|
|
18
|
-
|
|
18
|
+
} & Partial<Omit<NavigationItemDBSchema, 'documentId'>>)): import("@strapi/types/dist/modules/documents/result/document-engine").Update<any, {
|
|
19
|
+
readonly documentId: string;
|
|
20
|
+
readonly data: NavigationItemDBSchema;
|
|
21
|
+
}>;
|
|
22
|
+
find({ filters, locale, limit, order, populate }: FindInput): Promise<NavigationItemDBSchema[]>;
|
|
19
23
|
count(where: any): Promise<number>;
|
|
20
24
|
remove(item: NavigationItemRemoveMinimal): Promise<any>;
|
|
21
25
|
removeForIds(ids: string[]): Promise<import("@strapi/database/dist/types").CountResult>;
|
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
import { Core } from '@strapi/strapi';
|
|
2
2
|
import { CreateNavigationSchema, NavigationDBSchema, UpdateNavigationSchema } from '../schemas';
|
|
3
3
|
interface FindInput {
|
|
4
|
-
|
|
4
|
+
filters?: any;
|
|
5
5
|
limit?: number;
|
|
6
|
+
locale?: string;
|
|
6
7
|
populate?: any;
|
|
7
8
|
orderBy?: Record<string, string>;
|
|
8
9
|
}
|
|
9
10
|
interface FindOneInput {
|
|
10
|
-
|
|
11
|
+
filters?: any;
|
|
12
|
+
locale?: string;
|
|
11
13
|
populate?: any;
|
|
12
14
|
}
|
|
13
15
|
export declare const getNavigationRepository: (context: {
|
|
14
16
|
strapi: Core.Strapi;
|
|
15
17
|
}) => {
|
|
16
|
-
find({
|
|
18
|
+
find({ filters, locale, limit, orderBy, populate }: FindInput): Promise<{
|
|
17
19
|
name: string;
|
|
18
20
|
id: number;
|
|
19
21
|
documentId: string;
|
|
20
22
|
slug: string;
|
|
21
|
-
|
|
23
|
+
locale: string;
|
|
22
24
|
visible: boolean;
|
|
23
25
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
24
26
|
}[]>;
|
|
25
|
-
findOne({
|
|
27
|
+
findOne({ locale, filters, populate }: FindOneInput): Promise<{
|
|
26
28
|
name: string;
|
|
27
29
|
id: number;
|
|
28
30
|
documentId: string;
|
|
29
31
|
slug: string;
|
|
30
|
-
|
|
32
|
+
locale: string;
|
|
31
33
|
visible: boolean;
|
|
32
34
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
33
35
|
}>;
|
|
34
|
-
save(navigation: CreateNavigationSchema
|
|
36
|
+
save(navigation: (CreateNavigationSchema & {
|
|
37
|
+
locale?: string;
|
|
38
|
+
}) | (Omit<UpdateNavigationSchema, 'items'> & {
|
|
35
39
|
items?: never;
|
|
36
40
|
})): Promise<{
|
|
37
41
|
name: string;
|
|
38
42
|
id: number;
|
|
39
43
|
documentId: string;
|
|
40
44
|
slug: string;
|
|
41
|
-
|
|
45
|
+
locale: string;
|
|
42
46
|
visible: boolean;
|
|
43
47
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
44
48
|
}>;
|
|
@@ -155,7 +155,7 @@ export declare const navigationDBSchema: (withItems: boolean) => z.ZodObject<{
|
|
|
155
155
|
documentId: z.ZodString;
|
|
156
156
|
name: z.ZodString;
|
|
157
157
|
slug: z.ZodString;
|
|
158
|
-
|
|
158
|
+
locale: z.ZodString;
|
|
159
159
|
visible: z.ZodBoolean;
|
|
160
160
|
items: z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many">>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -163,7 +163,7 @@ export declare const navigationDBSchema: (withItems: boolean) => z.ZodObject<{
|
|
|
163
163
|
id: number;
|
|
164
164
|
documentId: string;
|
|
165
165
|
slug: string;
|
|
166
|
-
|
|
166
|
+
locale: string;
|
|
167
167
|
visible: boolean;
|
|
168
168
|
items?: NavigationItemDBSchema[] | undefined;
|
|
169
169
|
}, {
|
|
@@ -171,7 +171,7 @@ export declare const navigationDBSchema: (withItems: boolean) => z.ZodObject<{
|
|
|
171
171
|
id: number;
|
|
172
172
|
documentId: string;
|
|
173
173
|
slug: string;
|
|
174
|
-
|
|
174
|
+
locale: string;
|
|
175
175
|
visible: boolean;
|
|
176
176
|
items?: NavigationItemDBSchema[] | undefined;
|
|
177
177
|
}>;
|
|
@@ -181,10 +181,10 @@ export declare const createNavigationSchema: z.ZodObject<z.objectUtil.extendShap
|
|
|
181
181
|
documentId: z.ZodString;
|
|
182
182
|
name: z.ZodString;
|
|
183
183
|
slug: z.ZodString;
|
|
184
|
-
|
|
184
|
+
locale: z.ZodString;
|
|
185
185
|
visible: z.ZodBoolean;
|
|
186
186
|
items: z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many"> | z.ZodOptional<z.ZodArray<z.ZodType<NavigationItemDBSchema, z.ZodTypeDef, NavigationItemDBSchema>, "many">>;
|
|
187
|
-
}, "id" | "documentId" | "slug" | "
|
|
187
|
+
}, "id" | "documentId" | "slug" | "locale" | "items">, {
|
|
188
188
|
documentId: z.ZodOptional<z.ZodString>;
|
|
189
189
|
id: z.ZodOptional<z.ZodUndefined>;
|
|
190
190
|
}>, "strip", z.ZodTypeAny, {
|
|
@@ -214,7 +214,7 @@ export declare const updateNavigationSchema: z.ZodObject<{
|
|
|
214
214
|
id: z.ZodNumber;
|
|
215
215
|
documentId: z.ZodString;
|
|
216
216
|
slug: z.ZodOptional<z.ZodString>;
|
|
217
|
-
|
|
217
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
218
218
|
visible: z.ZodOptional<z.ZodBoolean>;
|
|
219
219
|
items: z.ZodOptional<z.ZodArray<UpdateNavigationItemSchema, "many">>;
|
|
220
220
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -222,7 +222,7 @@ export declare const updateNavigationSchema: z.ZodObject<{
|
|
|
222
222
|
documentId: string;
|
|
223
223
|
name?: string | undefined;
|
|
224
224
|
slug?: string | undefined;
|
|
225
|
-
|
|
225
|
+
locale?: string | undefined;
|
|
226
226
|
visible?: boolean | undefined;
|
|
227
227
|
items?: Omit<NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
|
|
228
228
|
}, {
|
|
@@ -230,7 +230,7 @@ export declare const updateNavigationSchema: z.ZodObject<{
|
|
|
230
230
|
documentId: string;
|
|
231
231
|
name?: string | undefined;
|
|
232
232
|
slug?: string | undefined;
|
|
233
|
-
|
|
233
|
+
locale?: string | undefined;
|
|
234
234
|
visible?: boolean | undefined;
|
|
235
235
|
items?: Omit<NavigationItemDBSchema, "id" | "documentId" | "items" | "parent">[] | undefined;
|
|
236
236
|
}>;
|
|
@@ -8,8 +8,8 @@ declare const adminService: (context: {
|
|
|
8
8
|
}) => {
|
|
9
9
|
config({ viaSettingsPage }: ConfigInput): Promise<NavigationPluginConfigDTO>;
|
|
10
10
|
configContentTypes({ viaSettingsPage, }: ConfigInput): Promise<ConfigContentTypeDTO[]>;
|
|
11
|
-
get({ ids,
|
|
12
|
-
getById({ documentId,
|
|
11
|
+
get({ ids, locale }: GetInput): Promise<NavigationDBSchema[]>;
|
|
12
|
+
getById({ documentId, locale }: GetByIdInput): Promise<NavigationDBSchema>;
|
|
13
13
|
post({ auditLog, payload }: PostInput): Promise<NavigationDTO>;
|
|
14
14
|
put({ auditLog, payload }: PutInput): Promise<NavigationDBSchema>;
|
|
15
15
|
delete({ auditLog, documentId }: DeleteInput): Promise<void>;
|
|
@@ -5,11 +5,11 @@ export interface ConfigInput {
|
|
|
5
5
|
}
|
|
6
6
|
export interface GetInput {
|
|
7
7
|
ids?: string[];
|
|
8
|
-
|
|
8
|
+
locale?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface GetByIdInput {
|
|
11
11
|
documentId: string;
|
|
12
|
-
|
|
12
|
+
locale?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface PostInput {
|
|
15
15
|
payload: CreateNavigationSchema;
|
|
@@ -18,7 +18,7 @@ export declare const prepareAuditLog: (actions: NavigationAction[]) => string;
|
|
|
18
18
|
type FillCopyContext = {
|
|
19
19
|
master: NavigationDBSchema;
|
|
20
20
|
strapi: Core.Strapi;
|
|
21
|
-
|
|
21
|
+
locale: string;
|
|
22
22
|
entities: Map<string, NavigationItemDTO['related']>;
|
|
23
23
|
};
|
|
24
24
|
export declare const processItems: (context: FillCopyContext) => (item: CreateBranchNavigationItemDTO) => Promise<CreateBranchNavigationItemDTO>;
|
|
@@ -8,21 +8,21 @@ declare const _default: {
|
|
|
8
8
|
}) => {
|
|
9
9
|
config({ viaSettingsPage }: import("./admin/types").ConfigInput): Promise<import("../dtos").NavigationPluginConfigDTO>;
|
|
10
10
|
configContentTypes({ viaSettingsPage, }: import("./admin/types").ConfigInput): Promise<import("../dtos").ConfigContentTypeDTO[]>;
|
|
11
|
-
get({ ids,
|
|
11
|
+
get({ ids, locale }: import("./admin/types").GetInput): Promise<{
|
|
12
12
|
name: string;
|
|
13
13
|
id: number;
|
|
14
14
|
documentId: string;
|
|
15
15
|
slug: string;
|
|
16
|
-
|
|
16
|
+
locale: string;
|
|
17
17
|
visible: boolean;
|
|
18
18
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
19
19
|
}[]>;
|
|
20
|
-
getById({ documentId,
|
|
20
|
+
getById({ documentId, locale }: import("./admin/types").GetByIdInput): Promise<{
|
|
21
21
|
name: string;
|
|
22
22
|
id: number;
|
|
23
23
|
documentId: string;
|
|
24
24
|
slug: string;
|
|
25
|
-
|
|
25
|
+
locale: string;
|
|
26
26
|
visible: boolean;
|
|
27
27
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
28
28
|
}>;
|
|
@@ -32,7 +32,7 @@ declare const _default: {
|
|
|
32
32
|
id: number;
|
|
33
33
|
documentId: string;
|
|
34
34
|
slug: string;
|
|
35
|
-
|
|
35
|
+
locale: string;
|
|
36
36
|
visible: boolean;
|
|
37
37
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
38
38
|
}>;
|
|
@@ -45,7 +45,7 @@ declare const _default: {
|
|
|
45
45
|
id: number;
|
|
46
46
|
documentId: string;
|
|
47
47
|
slug: string;
|
|
48
|
-
|
|
48
|
+
locale: string;
|
|
49
49
|
visible: boolean;
|
|
50
50
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
51
51
|
}>;
|
|
@@ -184,7 +184,7 @@ declare const _default: {
|
|
|
184
184
|
id: number;
|
|
185
185
|
documentId: string;
|
|
186
186
|
slug: string;
|
|
187
|
-
|
|
187
|
+
locale: string;
|
|
188
188
|
visible: boolean;
|
|
189
189
|
items?: import("../schemas").NavigationItemDBSchema[] | undefined;
|
|
190
190
|
}[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-navigation",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "Strapi - Navigation plugin",
|
|
5
5
|
"strapi": {
|
|
6
6
|
"name": "navigation",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@faker-js/faker": "^9.0.3",
|
|
44
|
-
"@paralleldrive/cuid2": "2.2.2",
|
|
45
44
|
"@sindresorhus/slugify": "1.1.0",
|
|
46
45
|
"@tanstack/react-query": "^5.40.0",
|
|
47
46
|
"lodash": "^4.17.21",
|
|
@@ -61,11 +60,11 @@
|
|
|
61
60
|
"@sensinum/strapi-utils": "^1.0.1",
|
|
62
61
|
"@strapi/design-system": "2.0.0-rc.11",
|
|
63
62
|
"@strapi/icons": "2.0.0-rc.11",
|
|
64
|
-
"@strapi/plugin-graphql": "5.
|
|
63
|
+
"@strapi/plugin-graphql": "5.1.1",
|
|
65
64
|
"@strapi/sdk-plugin": "^5.2.6",
|
|
66
|
-
"@strapi/strapi": "^5.
|
|
67
|
-
"@strapi/types": "^5.
|
|
68
|
-
"@strapi/typescript-utils": "^5.
|
|
65
|
+
"@strapi/strapi": "^5.1.1",
|
|
66
|
+
"@strapi/types": "^5.1.1",
|
|
67
|
+
"@strapi/typescript-utils": "^5.1.1",
|
|
69
68
|
"@types/jest": "^29.5.12",
|
|
70
69
|
"@types/koa": "^2.15.0",
|
|
71
70
|
"@types/koa-bodyparser": "^4.3.12",
|
|
@@ -102,8 +101,8 @@
|
|
|
102
101
|
"typescript": "^5.6.2"
|
|
103
102
|
},
|
|
104
103
|
"peerDependencies": {
|
|
105
|
-
"@strapi/sdk-plugin": "^5.2.
|
|
106
|
-
"@strapi/strapi": "^5.
|
|
104
|
+
"@strapi/sdk-plugin": "^5.2.7",
|
|
105
|
+
"@strapi/strapi": "^5.1.1",
|
|
107
106
|
"react": "^18.3.1",
|
|
108
107
|
"react-dom": "^18.3.1",
|
|
109
108
|
"react-router-dom": "^6.26.2",
|