strapi-plugin-navigation 3.0.16 → 3.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 (37) hide show
  1. package/README.md +47 -1
  2. package/dist/_chunks/ca-CSdZD9Oe.js +1 -0
  3. package/dist/_chunks/{ca-Jr1amAtF.mjs → ca-htynOC4E.mjs} +20 -3
  4. package/dist/_chunks/en-BuevNT8U.js +1 -0
  5. package/dist/_chunks/{en-DmeenfQT.mjs → en-DU6wb-rd.mjs} +20 -3
  6. package/dist/_chunks/fr-cFTbGuHW.js +1 -0
  7. package/dist/_chunks/{fr-CZx3EMw8.mjs → fr-v8w2-ufp.mjs} +20 -3
  8. package/dist/admin/index.js +341 -354
  9. package/dist/admin/index.mjs +8743 -8597
  10. package/dist/admin/src/api/client.d.ts +13 -1
  11. package/dist/admin/src/api/validators.d.ts +128 -14
  12. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +3 -3
  13. package/dist/admin/src/pages/HomePage/hooks/index.d.ts +14 -3
  14. package/dist/admin/src/pages/SettingsPage/components/CustomFieldForm/index.d.ts +1 -1
  15. package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +43 -1
  16. package/dist/admin/src/schemas/config.d.ts +93 -3
  17. package/dist/admin/src/translations/ca.d.ts +17 -0
  18. package/dist/admin/src/translations/en.d.ts +17 -0
  19. package/dist/admin/src/translations/es.d.ts +17 -0
  20. package/dist/admin/src/translations/fr.d.ts +17 -0
  21. package/dist/admin/src/translations/tr.d.ts +17 -0
  22. package/dist/server/index.js +36 -36
  23. package/dist/server/index.mjs +3331 -3492
  24. package/dist/server/src/config/setup.d.ts +6 -0
  25. package/dist/server/src/controllers/admin.d.ts +875 -2
  26. package/dist/server/src/controllers/client.d.ts +12 -0
  27. package/dist/server/src/controllers/validators.d.ts +2 -2
  28. package/dist/server/src/index.d.ts +885 -0
  29. package/dist/server/src/schemas/config.d.ts +93 -3
  30. package/dist/server/src/schemas/index.d.ts +1296 -2
  31. package/dist/server/src/services/admin/admin.d.ts +1 -0
  32. package/dist/server/src/services/common/common.d.ts +859 -0
  33. package/dist/server/src/services/index.d.ts +884 -0
  34. package/package.json +1 -1
  35. package/dist/_chunks/ca-Gq9Ty_aG.js +0 -1
  36. package/dist/_chunks/en-BP5RWE-N.js +0 -1
  37. package/dist/_chunks/fr-BIJn6QmK.js +0 -1
@@ -25,7 +25,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
25
25
  audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
26
  order: z.ZodOptional<z.ZodNumber>;
27
27
  items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
28
- 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, {
28
+ additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
29
29
  [x: string]: any;
30
30
  }, {
31
31
  [x: string]: any;
@@ -112,7 +112,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
112
112
  audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
113
113
  order: z.ZodOptional<z.ZodNumber>;
114
114
  items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
115
- 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, {
115
+ additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
116
116
  [x: string]: any;
117
117
  }, {
118
118
  [x: string]: any;
@@ -199,7 +199,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
199
199
  audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
200
200
  order: z.ZodOptional<z.ZodNumber>;
201
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, {
202
+ additionalFields: z.ZodObject<Record<string, z.ZodString | z.ZodOptional<z.ZodString> | z.ZodBoolean | z.ZodOptional<z.ZodBoolean> | z.ZodArray<z.ZodString, "many"> | z.ZodOptional<z.ZodArray<z.ZodString, "many">> | z.ZodAny | z.ZodOptional<z.ZodAny>>, "strip", z.ZodTypeAny, {
203
203
  [x: string]: any;
204
204
  }, {
205
205
  [x: string]: any;
@@ -31,6 +31,8 @@ export declare const useContentTypes: () => import("@tanstack/react-query").UseQ
31
31
  }[], Error>;
32
32
  export declare const useResetNavigations: () => () => void;
33
33
  export declare const useResetContentTypes: () => () => void;
34
+ export declare const useInvalidateNavigations: () => () => void;
35
+ export declare const useInvalidateLocale: () => () => Promise<void>;
34
36
  export declare const useNavigations: () => import("@tanstack/react-query").UseQueryResult<{
35
37
  id: number;
36
38
  name: string;
@@ -71,7 +73,10 @@ export declare const useCreateNavigation: () => import("@tanstack/react-query").
71
73
  locale: string;
72
74
  visible: boolean;
73
75
  }, "id" | "documentId" | "slug">, unknown>;
74
- export declare const useUpdateNavigation: (onSuccess?: Effect<NavigationSchema>) => import("@tanstack/react-query").UseMutationResult<{
76
+ export declare const useUpdateNavigation: ({ onError, onSuccess, }: {
77
+ onSuccess?: Effect<NavigationSchema>;
78
+ onError?: Effect<unknown>;
79
+ }) => import("@tanstack/react-query").UseMutationResult<{
75
80
  id: number;
76
81
  name: string;
77
82
  documentId: string;
@@ -79,7 +84,7 @@ export declare const useUpdateNavigation: (onSuccess?: Effect<NavigationSchema>)
79
84
  slug: string;
80
85
  locale: string;
81
86
  visible: boolean;
82
- }, Error, {
87
+ }, unknown, {
83
88
  id: number;
84
89
  name: string;
85
90
  documentId: string;
@@ -94,16 +99,20 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
94
99
  name: string;
95
100
  type: "string" | "boolean";
96
101
  label: string;
102
+ placeholder?: string | undefined;
97
103
  required?: boolean | undefined;
98
104
  options?: string[] | undefined;
105
+ description?: string | undefined;
99
106
  enabled?: boolean | undefined;
100
107
  multi?: false | undefined;
101
108
  } | {
102
109
  name: string;
103
110
  type: "media";
104
111
  label: string;
112
+ placeholder?: string | undefined;
105
113
  required?: boolean | undefined;
106
114
  options?: string[] | undefined;
115
+ description?: string | undefined;
107
116
  enabled?: boolean | undefined;
108
117
  multi?: false | undefined;
109
118
  } | {
@@ -112,7 +121,9 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
112
121
  label: string;
113
122
  options: string[];
114
123
  multi: boolean;
124
+ placeholder?: string | undefined;
115
125
  required?: boolean | undefined;
126
+ description?: string | undefined;
116
127
  enabled?: boolean | undefined;
117
128
  })[];
118
129
  allowedLevels: number;
@@ -125,11 +136,11 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
125
136
  contentTypes: {
126
137
  name: string;
127
138
  label: string;
139
+ description: string;
128
140
  visible: boolean;
129
141
  uid: string;
130
142
  draftAndPublish: boolean;
131
143
  isSingle: boolean;
132
- description: string;
133
144
  collectionName: string;
134
145
  contentTypeName: string;
135
146
  labelSingular: string;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { NavigationItemCustomField } from '../../../../schemas';
3
3
  import { Effect, VoidEffect } from '../../../../types';
4
4
  interface ICustomFieldFormProps {
5
- customField: Partial<NavigationItemCustomField>;
5
+ customField: NavigationItemCustomField | null;
6
6
  isEditForm: boolean;
7
7
  onSubmit: Effect<NavigationItemCustomField>;
8
8
  onClose: VoidEffect;
@@ -5,16 +5,20 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
5
5
  name: string;
6
6
  type: "string" | "boolean";
7
7
  label: string;
8
+ placeholder?: string | undefined;
8
9
  required?: boolean | undefined;
9
10
  options?: string[] | undefined;
11
+ description?: string | undefined;
10
12
  enabled?: boolean | undefined;
11
13
  multi?: false | undefined;
12
14
  } | {
13
15
  name: string;
14
16
  type: "media";
15
17
  label: string;
18
+ placeholder?: string | undefined;
16
19
  required?: boolean | undefined;
17
20
  options?: string[] | undefined;
21
+ description?: string | undefined;
18
22
  enabled?: boolean | undefined;
19
23
  multi?: false | undefined;
20
24
  } | {
@@ -23,7 +27,9 @@ export declare const useConfig: () => import("@tanstack/react-query").UseQueryRe
23
27
  label: string;
24
28
  options: string[];
25
29
  multi: boolean;
30
+ placeholder?: string | undefined;
26
31
  required?: boolean | undefined;
32
+ description?: string | undefined;
27
33
  enabled?: boolean | undefined;
28
34
  })[];
29
35
  allowedLevels: number;
@@ -68,22 +74,28 @@ export declare const useSaveConfig: () => import("@tanstack/react-query").UseMut
68
74
  label: string;
69
75
  options: string[];
70
76
  multi: boolean;
77
+ placeholder?: string | undefined;
71
78
  required?: boolean | undefined;
79
+ description?: string | undefined;
72
80
  enabled?: boolean | undefined;
73
81
  } | {
74
82
  name: string;
75
83
  type: "string" | "boolean";
76
84
  label: string;
85
+ placeholder?: string | undefined;
77
86
  required?: boolean | undefined;
78
87
  options?: string[] | undefined;
88
+ description?: string | undefined;
79
89
  enabled?: boolean | undefined;
80
90
  multi?: false | undefined;
81
91
  } | {
82
92
  name: string;
83
93
  type: "media";
84
94
  label: string;
95
+ placeholder?: string | undefined;
85
96
  required?: boolean | undefined;
86
97
  options?: string[] | undefined;
98
+ description?: string | undefined;
87
99
  enabled?: boolean | undefined;
88
100
  multi?: false | undefined;
89
101
  })[];
@@ -118,9 +130,11 @@ export declare const useSaveConfig: () => import("@tanstack/react-query").UseMut
118
130
  }, unknown>;
119
131
  export type UiFormSchema = z.infer<typeof uiFormSchema>;
120
132
  export declare const uiFormSchema: z.ZodObject<{
121
- additionalFields: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodUnion<[z.ZodObject<{
133
+ additionalFields: z.ZodArray<z.ZodUnion<[z.ZodLiteral<"audience">, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
122
134
  name: z.ZodEffects<z.ZodString, string, string>;
123
135
  label: z.ZodString;
136
+ description: z.ZodOptional<z.ZodString>;
137
+ placeholder: z.ZodOptional<z.ZodString>;
124
138
  required: z.ZodOptional<z.ZodBoolean>;
125
139
  enabled: z.ZodOptional<z.ZodBoolean>;
126
140
  } & {
@@ -131,21 +145,27 @@ export declare const uiFormSchema: z.ZodObject<{
131
145
  name: string;
132
146
  type: "string" | "boolean";
133
147
  label: string;
148
+ placeholder?: string | undefined;
134
149
  required?: boolean | undefined;
135
150
  options?: string[] | undefined;
151
+ description?: string | undefined;
136
152
  enabled?: boolean | undefined;
137
153
  multi?: false | undefined;
138
154
  }, {
139
155
  name: string;
140
156
  type: "string" | "boolean";
141
157
  label: string;
158
+ placeholder?: string | undefined;
142
159
  required?: boolean | undefined;
143
160
  options?: string[] | undefined;
161
+ description?: string | undefined;
144
162
  enabled?: boolean | undefined;
145
163
  multi?: false | undefined;
146
164
  }>, z.ZodObject<{
147
165
  name: z.ZodEffects<z.ZodString, string, string>;
148
166
  label: z.ZodString;
167
+ description: z.ZodOptional<z.ZodString>;
168
+ placeholder: z.ZodOptional<z.ZodString>;
149
169
  required: z.ZodOptional<z.ZodBoolean>;
150
170
  enabled: z.ZodOptional<z.ZodBoolean>;
151
171
  } & {
@@ -156,21 +176,27 @@ export declare const uiFormSchema: z.ZodObject<{
156
176
  name: string;
157
177
  type: "media";
158
178
  label: string;
179
+ placeholder?: string | undefined;
159
180
  required?: boolean | undefined;
160
181
  options?: string[] | undefined;
182
+ description?: string | undefined;
161
183
  enabled?: boolean | undefined;
162
184
  multi?: false | undefined;
163
185
  }, {
164
186
  name: string;
165
187
  type: "media";
166
188
  label: string;
189
+ placeholder?: string | undefined;
167
190
  required?: boolean | undefined;
168
191
  options?: string[] | undefined;
192
+ description?: string | undefined;
169
193
  enabled?: boolean | undefined;
170
194
  multi?: false | undefined;
171
195
  }>, z.ZodObject<{
172
196
  name: z.ZodEffects<z.ZodString, string, string>;
173
197
  label: z.ZodString;
198
+ description: z.ZodOptional<z.ZodString>;
199
+ placeholder: z.ZodOptional<z.ZodString>;
174
200
  required: z.ZodOptional<z.ZodBoolean>;
175
201
  enabled: z.ZodOptional<z.ZodBoolean>;
176
202
  } & {
@@ -183,7 +209,9 @@ export declare const uiFormSchema: z.ZodObject<{
183
209
  label: string;
184
210
  options: string[];
185
211
  multi: boolean;
212
+ placeholder?: string | undefined;
186
213
  required?: boolean | undefined;
214
+ description?: string | undefined;
187
215
  enabled?: boolean | undefined;
188
216
  }, {
189
217
  name: string;
@@ -191,7 +219,9 @@ export declare const uiFormSchema: z.ZodObject<{
191
219
  label: string;
192
220
  options: string[];
193
221
  multi: boolean;
222
+ placeholder?: string | undefined;
194
223
  required?: boolean | undefined;
224
+ description?: string | undefined;
195
225
  enabled?: boolean | undefined;
196
226
  }>]>]>, "many">;
197
227
  allowedLevels: z.ZodNumber;
@@ -262,22 +292,28 @@ export declare const uiFormSchema: z.ZodObject<{
262
292
  label: string;
263
293
  options: string[];
264
294
  multi: boolean;
295
+ placeholder?: string | undefined;
265
296
  required?: boolean | undefined;
297
+ description?: string | undefined;
266
298
  enabled?: boolean | undefined;
267
299
  } | {
268
300
  name: string;
269
301
  type: "string" | "boolean";
270
302
  label: string;
303
+ placeholder?: string | undefined;
271
304
  required?: boolean | undefined;
272
305
  options?: string[] | undefined;
306
+ description?: string | undefined;
273
307
  enabled?: boolean | undefined;
274
308
  multi?: false | undefined;
275
309
  } | {
276
310
  name: string;
277
311
  type: "media";
278
312
  label: string;
313
+ placeholder?: string | undefined;
279
314
  required?: boolean | undefined;
280
315
  options?: string[] | undefined;
316
+ description?: string | undefined;
281
317
  enabled?: boolean | undefined;
282
318
  multi?: false | undefined;
283
319
  })[];
@@ -316,22 +352,28 @@ export declare const uiFormSchema: z.ZodObject<{
316
352
  label: string;
317
353
  options: string[];
318
354
  multi: boolean;
355
+ placeholder?: string | undefined;
319
356
  required?: boolean | undefined;
357
+ description?: string | undefined;
320
358
  enabled?: boolean | undefined;
321
359
  } | {
322
360
  name: string;
323
361
  type: "string" | "boolean";
324
362
  label: string;
363
+ placeholder?: string | undefined;
325
364
  required?: boolean | undefined;
326
365
  options?: string[] | undefined;
366
+ description?: string | undefined;
327
367
  enabled?: boolean | undefined;
328
368
  multi?: false | undefined;
329
369
  } | {
330
370
  name: string;
331
371
  type: "media";
332
372
  label: string;
373
+ placeholder?: string | undefined;
333
374
  required?: boolean | undefined;
334
375
  options?: string[] | undefined;
376
+ description?: string | undefined;
335
377
  enabled?: boolean | undefined;
336
378
  multi?: false | undefined;
337
379
  })[];