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
|
@@ -9,7 +9,7 @@ export declare const getApiClient: (fetch: ReturnType<typeof getFetchClient>) =>
|
|
|
9
9
|
documentId: string;
|
|
10
10
|
items: import("./validators").NavigationItemSchema[];
|
|
11
11
|
slug: string;
|
|
12
|
-
|
|
12
|
+
locale: string;
|
|
13
13
|
visible: boolean;
|
|
14
14
|
}[]>;
|
|
15
15
|
readAllIndex(): string[];
|
|
@@ -82,6 +82,8 @@ export declare const getApiClient: (fetch: ReturnType<typeof getFetchClient>) =>
|
|
|
82
82
|
isCachePluginEnabled?: boolean | undefined;
|
|
83
83
|
}>;
|
|
84
84
|
readConfigIndex(): string[];
|
|
85
|
+
healthCheck(): Promise<import("@strapi/strapi/admin").FetchResponse<any>>;
|
|
86
|
+
healthCheckIndex(): string[];
|
|
85
87
|
readNavigationItemFromLocale({ source, structureId, target, documentId, }: {
|
|
86
88
|
source: string;
|
|
87
89
|
target: string;
|
|
@@ -182,7 +184,7 @@ export declare const getApiClient: (fetch: ReturnType<typeof getFetchClient>) =>
|
|
|
182
184
|
target: string;
|
|
183
185
|
structureId?: string;
|
|
184
186
|
}): Promise<{
|
|
185
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
187
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
186
188
|
title: string;
|
|
187
189
|
uiRouterKey: string;
|
|
188
190
|
path?: string | null | undefined;
|
|
@@ -18,12 +18,12 @@ export declare const audienceDBSchema: z.ZodObject<{
|
|
|
18
18
|
documentId: string;
|
|
19
19
|
}>;
|
|
20
20
|
export type NavigationItemTypeSchema = z.infer<typeof navigationItemTypeSchema>;
|
|
21
|
-
export declare const navigationItemTypeSchema: z.ZodEnum<["INTERNAL", "EXTERNAL"]>;
|
|
21
|
+
export declare const navigationItemTypeSchema: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
22
22
|
declare const navigationItemBaseSchema: z.ZodObject<{
|
|
23
23
|
id: z.ZodNumber;
|
|
24
24
|
documentId: z.ZodString;
|
|
25
25
|
title: z.ZodString;
|
|
26
|
-
type: z.ZodEnum<["INTERNAL", "EXTERNAL"]>;
|
|
26
|
+
type: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
27
27
|
path: z.ZodString;
|
|
28
28
|
externalPath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
29
29
|
uiRouterKey: z.ZodString;
|
|
@@ -57,7 +57,7 @@ declare const navigationItemBaseSchema: z.ZodObject<{
|
|
|
57
57
|
updated: z.ZodOptional<z.ZodBoolean>;
|
|
58
58
|
}, "strip", z.ZodTypeAny, {
|
|
59
59
|
id: number;
|
|
60
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
60
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
61
61
|
order: number;
|
|
62
62
|
path: string;
|
|
63
63
|
title: string;
|
|
@@ -83,7 +83,7 @@ declare const navigationItemBaseSchema: z.ZodObject<{
|
|
|
83
83
|
updated?: boolean | undefined;
|
|
84
84
|
}, {
|
|
85
85
|
id: number;
|
|
86
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
86
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
87
87
|
order: number;
|
|
88
88
|
path: string;
|
|
89
89
|
title: string;
|
|
@@ -118,7 +118,7 @@ export declare const navigationSchema: z.ZodObject<{
|
|
|
118
118
|
documentId: z.ZodString;
|
|
119
119
|
name: z.ZodString;
|
|
120
120
|
slug: z.ZodString;
|
|
121
|
-
|
|
121
|
+
locale: z.ZodString;
|
|
122
122
|
visible: z.ZodBoolean;
|
|
123
123
|
items: z.ZodArray<z.ZodType<NavigationItemSchema, z.ZodTypeDef, NavigationItemSchema>, "many">;
|
|
124
124
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -127,7 +127,7 @@ export declare const navigationSchema: z.ZodObject<{
|
|
|
127
127
|
documentId: string;
|
|
128
128
|
items: NavigationItemSchema[];
|
|
129
129
|
slug: string;
|
|
130
|
-
|
|
130
|
+
locale: string;
|
|
131
131
|
visible: boolean;
|
|
132
132
|
}, {
|
|
133
133
|
id: number;
|
|
@@ -135,7 +135,7 @@ export declare const navigationSchema: z.ZodObject<{
|
|
|
135
135
|
documentId: string;
|
|
136
136
|
items: NavigationItemSchema[];
|
|
137
137
|
slug: string;
|
|
138
|
-
|
|
138
|
+
locale: string;
|
|
139
139
|
visible: boolean;
|
|
140
140
|
}>;
|
|
141
141
|
export type NavigationItemCustomFieldSelect = z.infer<typeof navigationItemCustomFieldSelect>;
|
|
@@ -1808,17 +1808,17 @@ export declare const i18nCopyItemDetails: z.ZodObject<{
|
|
|
1808
1808
|
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
1809
1809
|
related: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
1810
1810
|
title: z.ZodString;
|
|
1811
|
-
type: z.ZodEnum<["INTERNAL", "EXTERNAL"]>;
|
|
1811
|
+
type: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
|
|
1812
1812
|
uiRouterKey: z.ZodString;
|
|
1813
1813
|
}, "strip", z.ZodTypeAny, {
|
|
1814
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
1814
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
1815
1815
|
title: string;
|
|
1816
1816
|
uiRouterKey: string;
|
|
1817
1817
|
path?: string | null | undefined;
|
|
1818
1818
|
externalPath?: string | null | undefined;
|
|
1819
1819
|
related?: string | null | undefined;
|
|
1820
1820
|
}, {
|
|
1821
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
1821
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
1822
1822
|
title: string;
|
|
1823
1823
|
uiRouterKey: string;
|
|
1824
1824
|
path?: string | null | undefined;
|
|
@@ -17,6 +17,6 @@ type NavigationItemFormProps = {
|
|
|
17
17
|
permissions?: Partial<{
|
|
18
18
|
canUpdate: boolean;
|
|
19
19
|
}>;
|
|
20
|
-
currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | '
|
|
20
|
+
currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | 'locale'>;
|
|
21
21
|
};
|
|
22
22
|
export declare const NavigationItemForm: React.FC<NavigationItemFormProps>;
|
|
@@ -179,6 +179,84 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
179
179
|
levelPath?: string | undefined;
|
|
180
180
|
isMenuAllowedLevel?: boolean | undefined;
|
|
181
181
|
parentAttachedToMenu?: boolean | undefined;
|
|
182
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
183
|
+
title: z.ZodString;
|
|
184
|
+
autoSync: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
removed: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
updated: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
uiRouterKey: z.ZodString;
|
|
188
|
+
levelPath: z.ZodOptional<z.ZodString>;
|
|
189
|
+
isMenuAllowedLevel: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
parentAttachedToMenu: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
viewId: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
structureId: z.ZodOptional<z.ZodString>;
|
|
193
|
+
menuAttached: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
195
|
+
isSearchActive: z.ZodOptional<z.ZodBoolean>;
|
|
196
|
+
viewParentId: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
199
|
+
audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
200
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
201
|
+
items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
202
|
+
additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodOptional<z.ZodString> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
|
|
203
|
+
[x: string]: any;
|
|
204
|
+
}, {
|
|
205
|
+
[x: string]: any;
|
|
206
|
+
}>;
|
|
207
|
+
}, {
|
|
208
|
+
type: z.ZodLiteral<"WRAPPER">;
|
|
209
|
+
path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
210
|
+
}>, "strip", z.ZodTypeAny, {
|
|
211
|
+
type: "WRAPPER";
|
|
212
|
+
title: string;
|
|
213
|
+
additionalFields: {
|
|
214
|
+
[x: string]: any;
|
|
215
|
+
};
|
|
216
|
+
uiRouterKey: string;
|
|
217
|
+
id?: number | undefined;
|
|
218
|
+
order?: number | undefined;
|
|
219
|
+
path?: string | null | undefined;
|
|
220
|
+
audience?: string[] | undefined;
|
|
221
|
+
documentId?: string | undefined;
|
|
222
|
+
menuAttached?: boolean | undefined;
|
|
223
|
+
collapsed?: boolean | undefined;
|
|
224
|
+
autoSync?: boolean | undefined;
|
|
225
|
+
viewId?: number | undefined;
|
|
226
|
+
viewParentId?: number | undefined;
|
|
227
|
+
structureId?: string | undefined;
|
|
228
|
+
removed?: boolean | undefined;
|
|
229
|
+
isSearchActive?: boolean | undefined;
|
|
230
|
+
updated?: boolean | undefined;
|
|
231
|
+
items?: any[] | undefined;
|
|
232
|
+
levelPath?: string | undefined;
|
|
233
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
234
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
type: "WRAPPER";
|
|
237
|
+
title: string;
|
|
238
|
+
additionalFields: {
|
|
239
|
+
[x: string]: any;
|
|
240
|
+
};
|
|
241
|
+
uiRouterKey: string;
|
|
242
|
+
id?: number | undefined;
|
|
243
|
+
order?: number | undefined;
|
|
244
|
+
path?: string | null | undefined;
|
|
245
|
+
audience?: string[] | undefined;
|
|
246
|
+
documentId?: string | undefined;
|
|
247
|
+
menuAttached?: boolean | undefined;
|
|
248
|
+
collapsed?: boolean | undefined;
|
|
249
|
+
autoSync?: boolean | undefined;
|
|
250
|
+
viewId?: number | undefined;
|
|
251
|
+
viewParentId?: number | undefined;
|
|
252
|
+
structureId?: string | undefined;
|
|
253
|
+
removed?: boolean | undefined;
|
|
254
|
+
isSearchActive?: boolean | undefined;
|
|
255
|
+
updated?: boolean | undefined;
|
|
256
|
+
items?: any[] | undefined;
|
|
257
|
+
levelPath?: string | undefined;
|
|
258
|
+
isMenuAllowedLevel?: boolean | undefined;
|
|
259
|
+
parentAttachedToMenu?: boolean | undefined;
|
|
182
260
|
}>]>;
|
|
183
261
|
export declare const fallbackDefaultValues: NavigationItemFormSchema;
|
|
184
262
|
export {};
|
|
@@ -13,7 +13,7 @@ interface Props {
|
|
|
13
13
|
permissions?: {
|
|
14
14
|
canUpdate?: boolean;
|
|
15
15
|
};
|
|
16
|
-
currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | '
|
|
16
|
+
currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | 'locale'>;
|
|
17
17
|
}
|
|
18
18
|
declare const NavigationItemPopUp: FC<Props>;
|
|
19
19
|
export default NavigationItemPopUp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { NavigationSchema } from '../../../../api/validators';
|
|
3
|
-
export type Navigation = Pick<NavigationSchema, 'id' | 'items' | 'name' | '
|
|
3
|
+
export type Navigation = Pick<NavigationSchema, 'id' | 'items' | 'name' | 'locale' | 'visible' | 'documentId' | 'slug'>;
|
|
4
4
|
export type NewNavigation = Omit<Navigation, 'id' | 'documentId' | 'slug'>;
|
|
5
5
|
export type State = InitialState | ListState | EditState | CreateState | DeleteState | PurgeCacheState | ErrorState;
|
|
6
6
|
export type SetState = Dispatch<SetStateAction<State>>;
|
|
@@ -35,13 +35,13 @@ export declare const useNavigations: () => import("@tanstack/react-query").UseQu
|
|
|
35
35
|
documentId: string;
|
|
36
36
|
items: NavigationItemSchema[];
|
|
37
37
|
slug: string;
|
|
38
|
-
|
|
38
|
+
locale: string;
|
|
39
39
|
visible: boolean;
|
|
40
40
|
}[], Error>;
|
|
41
41
|
export declare const useHardReset: () => () => void;
|
|
42
42
|
export declare const useDeleteNavigations: () => import("@tanstack/react-query").UseMutationResult<import("@strapi/strapi/admin").FetchResponse<any>[], Error, string[], unknown>;
|
|
43
43
|
export declare const useCopyNavigationItemI18n: () => import("@tanstack/react-query").UseMutationResult<{
|
|
44
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
44
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
45
45
|
title: string;
|
|
46
46
|
uiRouterKey: string;
|
|
47
47
|
path?: string | null | undefined;
|
|
@@ -63,7 +63,7 @@ export declare const useCreateNavigation: () => import("@tanstack/react-query").
|
|
|
63
63
|
documentId: string;
|
|
64
64
|
items: NavigationItemSchema[];
|
|
65
65
|
slug: string;
|
|
66
|
-
|
|
66
|
+
locale: string;
|
|
67
67
|
visible: boolean;
|
|
68
68
|
}, "id" | "documentId" | "slug">, unknown>;
|
|
69
69
|
export declare const useUpdateNavigation: (onSuccess?: Effect<void>) => import("@tanstack/react-query").UseMutationResult<import("@strapi/strapi/admin").FetchResponse<any>, Error, {
|
|
@@ -72,7 +72,7 @@ export declare const useUpdateNavigation: (onSuccess?: Effect<void>) => import("
|
|
|
72
72
|
documentId: string;
|
|
73
73
|
items: NavigationItemSchema[];
|
|
74
74
|
slug: string;
|
|
75
|
-
|
|
75
|
+
locale: string;
|
|
76
76
|
visible: boolean;
|
|
77
77
|
}, unknown>;
|
|
78
78
|
export declare const usePurgeNavigation: () => import("@tanstack/react-query").UseMutationResult<unknown, Error, string[] | undefined, unknown>;
|
|
@@ -2,7 +2,7 @@ import { ConfigFromServerSchema, NavigationItemSchema, NavigationItemTypeSchema,
|
|
|
2
2
|
import { NavigationItemFormSchema } from '../components/NavigationItemForm';
|
|
3
3
|
export declare const transformItemToViewPayload: (payload: NavigationItemFormSchema, items: ({
|
|
4
4
|
id: number;
|
|
5
|
-
type: "INTERNAL" | "EXTERNAL";
|
|
5
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
6
6
|
order: number;
|
|
7
7
|
path: string;
|
|
8
8
|
title: string;
|
|
@@ -34,7 +34,7 @@ export declare const transformItemToViewPayload: (payload: NavigationItemFormSch
|
|
|
34
34
|
viewId?: number;
|
|
35
35
|
}>;
|
|
36
36
|
export declare const extractRelatedItemLabel: (item: StrapiContentTypeItemSchema, config?: ConfigFromServerSchema) => any;
|
|
37
|
-
export declare const isRelationCorrect: (
|
|
37
|
+
export declare const isRelationCorrect: (item: Partial<NavigationItemFormSchema>) => boolean | undefined;
|
|
38
38
|
export declare const isRelationPublished: ({ relatedRef, relatedType, type, isCollection, }: {
|
|
39
39
|
relatedRef: StrapiContentTypeItemSchema;
|
|
40
40
|
relatedType?: {
|
|
@@ -46,7 +46,7 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
|
|
|
46
46
|
isCacheEnabled?: boolean | undefined;
|
|
47
47
|
isCachePluginEnabled?: boolean | undefined;
|
|
48
48
|
}, Error>;
|
|
49
|
-
export declare const useRestart: () => import("@tanstack/react-query").UseMutationResult<
|
|
49
|
+
export declare const useRestart: () => import("@tanstack/react-query").UseMutationResult<import("@tanstack/react-query").QueryObserverResult<import("@strapi/strapi/admin").FetchResponse<any>, Error>, Error, void, unknown>;
|
|
50
50
|
export declare const useRestoreConfig: () => import("@tanstack/react-query").UseMutationResult<void, Error, void, unknown>;
|
|
51
51
|
export declare const useContentTypes: () => import("@tanstack/react-query").UseQueryResult<{
|
|
52
52
|
kind: "collectionType" | "singleType";
|