strapi-plugin-navigation 3.1.0 → 3.2.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.
Files changed (80) hide show
  1. package/README.md +11 -6
  2. package/dist/_chunks/ca-BQn7S09g.js +1 -0
  3. package/dist/_chunks/{ca-htynOC4E.mjs → ca-RyBP-sbV.mjs} +5 -0
  4. package/dist/_chunks/{en-DU6wb-rd.mjs → en-DBw_pmms.mjs} +5 -0
  5. package/dist/_chunks/en-DO98mdcm.js +1 -0
  6. package/dist/_chunks/fr-CjFMUCWK.js +1 -0
  7. package/dist/_chunks/{fr-v8w2-ufp.mjs → fr-CnAHMC1C.mjs} +5 -0
  8. package/dist/admin/index.js +310 -310
  9. package/dist/admin/index.mjs +10400 -10240
  10. package/dist/admin/src/api/client.d.ts +2 -0
  11. package/dist/admin/src/api/validators.d.ts +9 -3
  12. package/dist/admin/src/pages/HomePage/components/NavigationContentHeader/ManageNavigationItems/index.d.ts +10 -0
  13. package/dist/admin/src/pages/HomePage/components/{Search → NavigationContentHeader/Search}/index.d.ts +1 -1
  14. package/dist/admin/src/pages/HomePage/components/NavigationEmptyState/index.d.ts +12 -0
  15. package/dist/admin/src/pages/HomePage/components/{AdditionalFieldInput → NavigationItemForm/components/AdditionalFields/AdditionalFieldInput}/index.d.ts +1 -1
  16. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/AudienceField/index.d.ts +1 -0
  17. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/CustomFieldsField/index.d.ts +7 -0
  18. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AdditionalFields/index.d.ts +1 -0
  19. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/AttachToMenuField/index.d.ts +7 -0
  20. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/CopyFromLocales/index.d.ts +12 -0
  21. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/NavigationItemTypeField/index.d.ts +1 -0
  22. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/PathField/index.d.ts +10 -0
  23. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/ReadFieldsFromRelatedField/index.d.ts +1 -0
  24. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedEntityField/hooks.d.ts +3 -0
  25. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedEntityField/index.d.ts +13 -0
  26. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/RelatedTypeField/index.d.ts +13 -0
  27. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/components/TitleField/index.d.ts +1 -0
  28. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/context/NavigationItemFormContext.d.ts +14 -0
  29. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +92 -3
  30. package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/hooks.d.ts +259 -0
  31. package/dist/admin/src/pages/HomePage/components/NavigationItemList/index.d.ts +2 -5
  32. package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/index.d.ts +2 -0
  33. package/dist/admin/src/pages/HomePage/hooks/index.d.ts +7 -169
  34. package/dist/admin/src/pages/HomePage/hooks/useAPI.d.ts +162 -0
  35. package/dist/admin/src/pages/HomePage/hooks/useI18nCopyNavigationItemsModal.d.ts +8 -0
  36. package/dist/admin/src/pages/HomePage/hooks/useInvalidateQueries.d.ts +1 -0
  37. package/dist/admin/src/pages/HomePage/hooks/useLocales.d.ts +19 -0
  38. package/dist/admin/src/pages/HomePage/hooks/useNavigationItemPopup.d.ts +93 -0
  39. package/dist/admin/src/pages/HomePage/hooks/useSearch.d.ts +11 -0
  40. package/dist/admin/src/pages/HomePage/hooks/useSettingsPermissions.d.ts +5 -0
  41. package/dist/admin/src/pages/HomePage/utils/appendViewId.d.ts +2 -0
  42. package/dist/admin/src/pages/HomePage/utils/parsers.d.ts +1 -1
  43. package/dist/admin/src/pages/SettingsPage/common/const.d.ts +6 -0
  44. package/dist/admin/src/pages/SettingsPage/components/AdditionalSettingsPanel/index.d.ts +1 -0
  45. package/dist/admin/src/pages/SettingsPage/components/{CustomFieldForm → CustomFieldsPanel/CustomFieldForm}/index.d.ts +2 -2
  46. package/dist/admin/src/pages/SettingsPage/components/{CustomFieldModal → CustomFieldsPanel/CustomFieldModal}/index.d.ts +2 -2
  47. package/dist/admin/src/pages/SettingsPage/components/{CustomFieldTable → CustomFieldsPanel/CustomFieldTable}/index.d.ts +2 -2
  48. package/dist/admin/src/pages/SettingsPage/components/CustomFieldsPanel/index.d.ts +1 -0
  49. package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/ContentTypesField/index.d.ts +1 -0
  50. package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/ContentTypesSettings/index.d.ts +1 -0
  51. package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/DefaultContentTypeField/index.d.ts +1 -0
  52. package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/PreferCustomContentTypeField/index.d.ts +1 -0
  53. package/dist/admin/src/pages/SettingsPage/components/GeneralSettingsPanel/index.d.ts +1 -0
  54. package/dist/admin/src/pages/SettingsPage/components/RestartPanel/index.d.ts +6 -0
  55. package/dist/admin/src/pages/SettingsPage/components/RestorePanel/index.d.ts +6 -0
  56. package/dist/admin/src/pages/SettingsPage/context/index.d.ts +15 -0
  57. package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +2 -408
  58. package/dist/admin/src/pages/SettingsPage/hooks/useAPI.d.ts +131 -0
  59. package/dist/admin/src/pages/SettingsPage/hooks/useInitialConfig.d.ts +8 -0
  60. package/dist/admin/src/pages/SettingsPage/schemas/index.d.ts +282 -0
  61. package/dist/admin/src/schemas/config.d.ts +3 -0
  62. package/dist/admin/src/translations/ca.d.ts +5 -0
  63. package/dist/admin/src/translations/en.d.ts +5 -0
  64. package/dist/admin/src/translations/es.d.ts +5 -0
  65. package/dist/admin/src/translations/fr.d.ts +5 -0
  66. package/dist/admin/src/translations/tr.d.ts +5 -0
  67. package/dist/server/index.js +37 -37
  68. package/dist/server/index.mjs +2685 -2638
  69. package/dist/server/src/config/index.d.ts +1 -0
  70. package/dist/server/src/config/setup.d.ts +1 -0
  71. package/dist/server/src/controllers/admin.d.ts +7 -0
  72. package/dist/server/src/index.d.ts +8 -0
  73. package/dist/server/src/schemas/config.d.ts +3 -0
  74. package/dist/server/src/schemas/index.d.ts +9 -0
  75. package/dist/server/src/services/common/common.d.ts +6 -0
  76. package/dist/server/src/services/index.d.ts +7 -0
  77. package/package.json +9 -2
  78. package/dist/_chunks/ca-CSdZD9Oe.js +0 -1
  79. package/dist/_chunks/en-BuevNT8U.js +0 -1
  80. package/dist/_chunks/fr-cFTbGuHW.js +0 -1
@@ -92,6 +92,7 @@ export declare const getApiClient: (fetch: ReturnType<typeof getFetchClient>) =>
92
92
  preferCustomContentTypes: boolean;
93
93
  allowedContentTypes: string[];
94
94
  restrictedContentTypes: string[];
95
+ defaultContentType?: string | undefined;
95
96
  isCacheEnabled?: boolean | undefined;
96
97
  isCachePluginEnabled?: boolean | undefined;
97
98
  }>;
@@ -157,6 +158,7 @@ export declare const getApiClient: (fetch: ReturnType<typeof getFetchClient>) =>
157
158
  preferCustomContentTypes: boolean;
158
159
  allowedContentTypes: string[];
159
160
  restrictedContentTypes: string[];
161
+ defaultContentType?: string | undefined;
160
162
  isCacheEnabled?: boolean | undefined;
161
163
  isCachePluginEnabled?: boolean | undefined;
162
164
  }>;
@@ -24,7 +24,7 @@ declare const navigationItemBaseSchema: z.ZodObject<{
24
24
  documentId: z.ZodString;
25
25
  title: z.ZodString;
26
26
  type: z.ZodEnum<["INTERNAL", "EXTERNAL", "WRAPPER"]>;
27
- path: z.ZodString;
27
+ path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
28
28
  externalPath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
29
29
  uiRouterKey: z.ZodString;
30
30
  menuAttached: z.ZodBoolean;
@@ -68,12 +68,12 @@ declare const navigationItemBaseSchema: z.ZodObject<{
68
68
  id: number;
69
69
  type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
70
70
  order: number;
71
- path: string;
72
71
  title: string;
73
72
  documentId: string;
74
73
  uiRouterKey: string;
75
74
  menuAttached: boolean;
76
75
  collapsed: boolean;
76
+ path?: string | null | undefined;
77
77
  additionalFields?: Record<string, unknown> | null | undefined;
78
78
  audience?: {
79
79
  id: number;
@@ -97,12 +97,12 @@ declare const navigationItemBaseSchema: z.ZodObject<{
97
97
  id: number;
98
98
  type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
99
99
  order: number;
100
- path: string;
101
100
  title: string;
102
101
  documentId: string;
103
102
  uiRouterKey: string;
104
103
  menuAttached: boolean;
105
104
  collapsed: boolean;
105
+ path?: string | null | undefined;
106
106
  additionalFields?: Record<string, unknown> | null | undefined;
107
107
  audience?: {
108
108
  id: number;
@@ -595,6 +595,7 @@ export declare const configSchema: z.ZodObject<{
595
595
  documentId: string;
596
596
  }>, "many">;
597
597
  contentTypes: z.ZodArray<z.ZodString, "many">;
598
+ defaultContentType: z.ZodOptional<z.ZodString>;
598
599
  contentTypesNameFields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
599
600
  contentTypesPopulate: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
600
601
  gql: z.ZodObject<{
@@ -661,6 +662,7 @@ export declare const configSchema: z.ZodObject<{
661
662
  preferCustomContentTypes: boolean;
662
663
  allowedContentTypes: string[];
663
664
  restrictedContentTypes: string[];
665
+ defaultContentType?: string | undefined;
664
666
  isCacheEnabled?: boolean | undefined;
665
667
  isCachePluginEnabled?: boolean | undefined;
666
668
  }, {
@@ -713,6 +715,7 @@ export declare const configSchema: z.ZodObject<{
713
715
  preferCustomContentTypes: boolean;
714
716
  allowedContentTypes: string[];
715
717
  restrictedContentTypes: string[];
718
+ defaultContentType?: string | undefined;
716
719
  isCacheEnabled?: boolean | undefined;
717
720
  isCachePluginEnabled?: boolean | undefined;
718
721
  }>;
@@ -830,6 +833,7 @@ export declare const configFromServerSchema: z.ZodObject<Omit<{
830
833
  documentId: string;
831
834
  }>, "many">;
832
835
  contentTypes: z.ZodArray<z.ZodString, "many">;
836
+ defaultContentType: z.ZodOptional<z.ZodString>;
833
837
  contentTypesNameFields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
834
838
  contentTypesPopulate: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
835
839
  gql: z.ZodObject<{
@@ -950,6 +954,7 @@ export declare const configFromServerSchema: z.ZodObject<Omit<{
950
954
  preferCustomContentTypes: boolean;
951
955
  allowedContentTypes: string[];
952
956
  restrictedContentTypes: string[];
957
+ defaultContentType?: string | undefined;
953
958
  isCacheEnabled?: boolean | undefined;
954
959
  isCachePluginEnabled?: boolean | undefined;
955
960
  }, {
@@ -1015,6 +1020,7 @@ export declare const configFromServerSchema: z.ZodObject<Omit<{
1015
1020
  preferCustomContentTypes: boolean;
1016
1021
  allowedContentTypes: string[];
1017
1022
  restrictedContentTypes: string[];
1023
+ defaultContentType?: string | undefined;
1018
1024
  isCacheEnabled?: boolean | undefined;
1019
1025
  isCachePluginEnabled?: boolean | undefined;
1020
1026
  }>;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { NavigationSchema } from '../../../../../api/validators';
3
+ type ManageNavigationItemsProps = {
4
+ currentNavigation: NavigationSchema | undefined;
5
+ setCurrentNavigation: (navigation: NavigationSchema) => void;
6
+ canUpdate: boolean;
7
+ addNewNavigationItem: (event: MouseEvent, viewParentId?: number, isMenuAllowedLevel?: boolean, levelPath?: string, parentAttachedToMenu?: boolean, structureId?: string, maxOrder?: number) => void;
8
+ };
9
+ export declare const ManageNavigationItems: React.FC<ManageNavigationItemsProps>;
10
+ export {};
@@ -1,4 +1,4 @@
1
- import { Effect } from '../../../../types';
1
+ import { Effect } from '../../../../../types';
2
2
  interface Props {
3
3
  value: string;
4
4
  setValue: Effect<{
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { NavigationSchema } from '../../../../api/validators';
3
+ type NavigationEmptyStateProps = {
4
+ canUpdate: boolean;
5
+ addNewNavigationItem: any;
6
+ availableLocale: string[];
7
+ availableNavigations: NavigationSchema[];
8
+ currentNavigation: NavigationSchema | undefined;
9
+ setCurrentNavigation: (navigation: NavigationSchema) => void;
10
+ };
11
+ export declare const NavigationEmptyState: React.FC<NavigationEmptyStateProps>;
12
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { NavigationItemCustomField } from '../../../../schemas';
2
+ import { NavigationItemCustomField } from '../../../../../../../schemas';
3
3
  export type AdditionalFieldInputProps = {
4
4
  name?: string;
5
5
  field: NavigationItemCustomField;
@@ -0,0 +1 @@
1
+ export declare const AudienceField: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { NavigationItemCustomField } from '../../../../../../../schemas';
3
+ type CustomFieldsFieldProps = {
4
+ additionalField: NavigationItemCustomField;
5
+ };
6
+ export declare const CustomFieldsField: React.FC<CustomFieldsFieldProps>;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare const AdditionalFields: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { NavigationItemFormSchema } from '../../utils/form';
3
+ type AttachToMenuFieldProps = {
4
+ current: Partial<NavigationItemFormSchema>;
5
+ };
6
+ export declare const AttachToMenuField: React.FC<AttachToMenuFieldProps>;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { NavigationSchema } from '../../../../../../api/validators';
3
+ import { NavigationItemFormSchema } from '../../utils/form';
4
+ type CopyFromLocalesProps = {
5
+ availableLocale: string[];
6
+ current: Partial<NavigationItemFormSchema>;
7
+ currentNavigation: Pick<NavigationSchema, 'id' | 'documentId' | 'locale'>;
8
+ setIsLoading: (isLoading: boolean) => void;
9
+ setFormValuesItems: (values: any) => void;
10
+ };
11
+ export declare const CopyFromLocales: React.FC<CopyFromLocalesProps>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare const NavigationItemTypeField: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { NavigationItemFormSchema } from '../../utils/form';
3
+ import { StrapiContentTypeItemSchema } from 'src/api/validators';
4
+ type PathFieldProps = {
5
+ contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
6
+ current: Partial<NavigationItemFormSchema>;
7
+ isSingleSelected: boolean;
8
+ };
9
+ export declare const PathField: React.FC<PathFieldProps>;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ReadFieldsFromRelatedField: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { NavigationInternalItemFormSchema } from '../../utils/form';
2
+ import { StrapiContentTypeItemSchema } from 'src/api/validators';
3
+ export declare const useChangeFieldsFromRelated: (values: NavigationInternalItemFormSchema, contentTypeItems: StrapiContentTypeItemSchema[] | undefined, setFormValuesItems: (values: any) => void) => void;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { ContentTypeEntity } from '../../types';
3
+ import { StrapiContentTypeItemSchema } from '../../../../../../api/validators';
4
+ import { NavigationInternalItemFormSchema } from '../../utils/form';
5
+ type RelatedEntityFieldProps = {
6
+ appendLabelPublicationStatus: (label: string, entity: ContentTypeEntity, _: boolean) => string;
7
+ contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
8
+ isSingleSelected: boolean;
9
+ values: NavigationInternalItemFormSchema;
10
+ setFormValuesItems: (values: any) => void;
11
+ };
12
+ export declare const RelatedEntityField: React.FC<RelatedEntityFieldProps>;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { NavigationItemFormSchema } from '../../utils/form';
3
+ import { StrapiContentTypeItemSchema } from '../../../../../../api/validators';
4
+ type RelatedTypeFieldProps = {
5
+ contentTypeItems: StrapiContentTypeItemSchema[] | undefined;
6
+ current: Partial<NavigationItemFormSchema>;
7
+ currentRelatedType: string;
8
+ isSingleSelected: boolean;
9
+ setFormValuesItems: (values: any) => void;
10
+ setIsSingleSelected: (isSingle: boolean) => void;
11
+ };
12
+ export declare const RelatedTypeField: React.FC<RelatedTypeFieldProps>;
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare const TitleField: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormChangeEvent } from '../../../../../types';
3
+ import { NavigationItemFormSchema } from '../utils/form';
4
+ export type NavigationItemFormContextType = {
5
+ values: NavigationItemFormSchema;
6
+ onChange: (eventOrPath: React.ChangeEvent<any> | string, value?: any) => void;
7
+ handleChange: (eventOrPath: FormChangeEvent, value?: any, nativeOnChange?: (eventOrPath: FormChangeEvent, value?: any) => void) => void;
8
+ renderError: (field: string, messageKey?: string) => string | undefined;
9
+ setFormValueItem: (path: string, value: any) => void;
10
+ canUpdate: boolean | undefined;
11
+ isLoading: boolean;
12
+ };
13
+ export declare const NavigationItemFormContext: import("react").Context<NavigationItemFormContextType>;
14
+ export declare const useNavigationItemFormContext: () => NavigationItemFormContextType;
@@ -4,6 +4,95 @@ interface FormSchemaBuilderInput {
4
4
  isSingleSelected?: boolean;
5
5
  additionalFields: Array<NavigationItemAdditionalField>;
6
6
  }
7
+ export type NavigationInternalItemFormSchema = z.infer<ReturnType<typeof navigationInternalItemFormSchema>>;
8
+ declare const navigationInternalItemFormSchema: ({ additionalFields, isSingleSelected, }: FormSchemaBuilderInput) => z.ZodObject<{
9
+ title: z.ZodString;
10
+ autoSync: z.ZodOptional<z.ZodBoolean>;
11
+ removed: z.ZodOptional<z.ZodBoolean>;
12
+ updated: z.ZodOptional<z.ZodBoolean>;
13
+ uiRouterKey: z.ZodString;
14
+ levelPath: z.ZodOptional<z.ZodString>;
15
+ isMenuAllowedLevel: z.ZodOptional<z.ZodBoolean>;
16
+ parentAttachedToMenu: z.ZodOptional<z.ZodBoolean>;
17
+ viewId: z.ZodOptional<z.ZodNumber>;
18
+ structureId: z.ZodOptional<z.ZodString>;
19
+ menuAttached: z.ZodOptional<z.ZodBoolean>;
20
+ collapsed: z.ZodOptional<z.ZodBoolean>;
21
+ isSearchActive: z.ZodOptional<z.ZodBoolean>;
22
+ viewParentId: z.ZodOptional<z.ZodNumber>;
23
+ id: z.ZodOptional<z.ZodNumber>;
24
+ documentId: z.ZodOptional<z.ZodString>;
25
+ audience: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
+ order: z.ZodOptional<z.ZodNumber>;
27
+ items: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
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
+ [x: string]: any;
30
+ }, {
31
+ [x: string]: any;
32
+ }>;
33
+ } & {
34
+ type: z.ZodLiteral<"INTERNAL">;
35
+ path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
36
+ externalPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ relatedType: z.ZodString;
38
+ related: z.ZodString | z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ type: "INTERNAL";
41
+ title: string;
42
+ additionalFields: {
43
+ [x: string]: any;
44
+ };
45
+ uiRouterKey: string;
46
+ relatedType: string;
47
+ id?: number | undefined;
48
+ order?: number | undefined;
49
+ path?: string | null | undefined;
50
+ audience?: string[] | undefined;
51
+ documentId?: string | undefined;
52
+ externalPath?: string | null | undefined;
53
+ menuAttached?: boolean | undefined;
54
+ collapsed?: boolean | undefined;
55
+ autoSync?: boolean | undefined;
56
+ related?: string | undefined;
57
+ viewId?: number | undefined;
58
+ viewParentId?: number | undefined;
59
+ structureId?: string | undefined;
60
+ removed?: boolean | undefined;
61
+ isSearchActive?: boolean | undefined;
62
+ updated?: boolean | undefined;
63
+ items?: any[] | undefined;
64
+ levelPath?: string | undefined;
65
+ isMenuAllowedLevel?: boolean | undefined;
66
+ parentAttachedToMenu?: boolean | undefined;
67
+ }, {
68
+ type: "INTERNAL";
69
+ title: string;
70
+ additionalFields: {
71
+ [x: string]: any;
72
+ };
73
+ uiRouterKey: string;
74
+ relatedType: string;
75
+ id?: number | undefined;
76
+ order?: number | undefined;
77
+ path?: string | null | undefined;
78
+ audience?: string[] | undefined;
79
+ documentId?: string | undefined;
80
+ externalPath?: string | null | undefined;
81
+ menuAttached?: boolean | undefined;
82
+ collapsed?: boolean | undefined;
83
+ autoSync?: boolean | undefined;
84
+ related?: string | undefined;
85
+ viewId?: number | undefined;
86
+ viewParentId?: number | undefined;
87
+ structureId?: string | undefined;
88
+ removed?: boolean | undefined;
89
+ isSearchActive?: boolean | undefined;
90
+ updated?: boolean | undefined;
91
+ items?: any[] | undefined;
92
+ levelPath?: string | undefined;
93
+ isMenuAllowedLevel?: boolean | undefined;
94
+ parentAttachedToMenu?: boolean | undefined;
95
+ }>;
7
96
  export type NavigationItemFormSchema = z.infer<ReturnType<typeof navigationItemFormSchema>>;
8
97
  export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) => z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
9
98
  title: z.ZodString;
@@ -119,13 +208,12 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
119
208
  }>;
120
209
  } & {
121
210
  type: z.ZodLiteral<"INTERNAL">;
122
- path: z.ZodString;
211
+ path: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
123
212
  externalPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
213
  relatedType: z.ZodString;
125
214
  related: z.ZodString | z.ZodOptional<z.ZodString>;
126
215
  }, "strip", z.ZodTypeAny, {
127
216
  type: "INTERNAL";
128
- path: string;
129
217
  title: string;
130
218
  additionalFields: {
131
219
  [x: string]: any;
@@ -134,6 +222,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
134
222
  relatedType: string;
135
223
  id?: number | undefined;
136
224
  order?: number | undefined;
225
+ path?: string | null | undefined;
137
226
  audience?: string[] | undefined;
138
227
  documentId?: string | undefined;
139
228
  externalPath?: string | null | undefined;
@@ -153,7 +242,6 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
153
242
  parentAttachedToMenu?: boolean | undefined;
154
243
  }, {
155
244
  type: "INTERNAL";
156
- path: string;
157
245
  title: string;
158
246
  additionalFields: {
159
247
  [x: string]: any;
@@ -162,6 +250,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
162
250
  relatedType: string;
163
251
  id?: number | undefined;
164
252
  order?: number | undefined;
253
+ path?: string | null | undefined;
165
254
  audience?: string[] | undefined;
166
255
  documentId?: string | undefined;
167
256
  externalPath?: string | null | undefined;
@@ -1 +1,260 @@
1
+ /// <reference types="react" />
2
+ import { NavigationItemFormSchema } from './form';
3
+ import { FormChangeEvent, FormItemErrorSchema } from '../../../../../types';
1
4
  export declare const useSlug: () => import("@tanstack/react-query").UseMutationResult<string, Error, string, unknown>;
5
+ export declare const usePayload: () => {
6
+ encodePayload: (values: NavigationItemFormSchema) => NavigationItemFormSchema;
7
+ decodePayload: (values: NavigationItemFormSchema) => NavigationItemFormSchema;
8
+ };
9
+ export declare const useFormValues: () => {
10
+ formValue: {
11
+ type: "EXTERNAL";
12
+ title: string;
13
+ additionalFields: {
14
+ [x: string]: any;
15
+ };
16
+ externalPath: string;
17
+ uiRouterKey: string;
18
+ id?: number | undefined;
19
+ order?: number | undefined;
20
+ path?: string | null | undefined;
21
+ audience?: string[] | undefined;
22
+ documentId?: string | undefined;
23
+ menuAttached?: boolean | undefined;
24
+ collapsed?: boolean | undefined;
25
+ autoSync?: boolean | undefined;
26
+ related?: string | undefined;
27
+ viewId?: number | undefined;
28
+ viewParentId?: number | undefined;
29
+ structureId?: string | undefined;
30
+ removed?: boolean | undefined;
31
+ isSearchActive?: boolean | undefined;
32
+ updated?: boolean | undefined;
33
+ items?: any[] | undefined;
34
+ relatedType?: string | undefined;
35
+ levelPath?: string | undefined;
36
+ isMenuAllowedLevel?: boolean | undefined;
37
+ parentAttachedToMenu?: boolean | undefined;
38
+ } | {
39
+ type: "INTERNAL";
40
+ title: string;
41
+ additionalFields: {
42
+ [x: string]: any;
43
+ };
44
+ uiRouterKey: string;
45
+ relatedType: string;
46
+ id?: number | undefined;
47
+ order?: number | undefined;
48
+ path?: string | null | undefined;
49
+ audience?: string[] | undefined;
50
+ documentId?: string | undefined;
51
+ externalPath?: string | null | undefined;
52
+ menuAttached?: boolean | undefined;
53
+ collapsed?: boolean | undefined;
54
+ autoSync?: boolean | undefined;
55
+ related?: string | undefined;
56
+ viewId?: number | undefined;
57
+ viewParentId?: number | undefined;
58
+ structureId?: string | undefined;
59
+ removed?: boolean | undefined;
60
+ isSearchActive?: boolean | undefined;
61
+ updated?: boolean | undefined;
62
+ items?: any[] | undefined;
63
+ levelPath?: string | undefined;
64
+ isMenuAllowedLevel?: boolean | undefined;
65
+ parentAttachedToMenu?: boolean | undefined;
66
+ } | {
67
+ type: "WRAPPER";
68
+ title: string;
69
+ additionalFields: {
70
+ [x: string]: any;
71
+ };
72
+ uiRouterKey: string;
73
+ id?: number | undefined;
74
+ order?: number | undefined;
75
+ path?: string | null | undefined;
76
+ audience?: string[] | undefined;
77
+ documentId?: string | undefined;
78
+ menuAttached?: boolean | undefined;
79
+ collapsed?: boolean | undefined;
80
+ autoSync?: boolean | undefined;
81
+ viewId?: number | undefined;
82
+ viewParentId?: number | undefined;
83
+ structureId?: string | undefined;
84
+ removed?: boolean | undefined;
85
+ isSearchActive?: boolean | undefined;
86
+ updated?: boolean | undefined;
87
+ items?: any[] | undefined;
88
+ levelPath?: string | undefined;
89
+ isMenuAllowedLevel?: boolean | undefined;
90
+ parentAttachedToMenu?: boolean | undefined;
91
+ };
92
+ renderError: (field: string, messageKey?: string) => string | undefined;
93
+ setFormError: import("react").Dispatch<import("react").SetStateAction<FormItemErrorSchema<{
94
+ type: "EXTERNAL";
95
+ title: string;
96
+ additionalFields: {
97
+ [x: string]: any;
98
+ };
99
+ externalPath: string;
100
+ uiRouterKey: string;
101
+ id?: number | undefined;
102
+ order?: number | undefined;
103
+ path?: string | null | undefined;
104
+ audience?: string[] | undefined;
105
+ documentId?: string | undefined;
106
+ menuAttached?: boolean | undefined;
107
+ collapsed?: boolean | undefined;
108
+ autoSync?: boolean | undefined;
109
+ related?: string | undefined;
110
+ viewId?: number | undefined;
111
+ viewParentId?: number | undefined;
112
+ structureId?: string | undefined;
113
+ removed?: boolean | undefined;
114
+ isSearchActive?: boolean | undefined;
115
+ updated?: boolean | undefined;
116
+ items?: any[] | undefined;
117
+ relatedType?: string | undefined;
118
+ levelPath?: string | undefined;
119
+ isMenuAllowedLevel?: boolean | undefined;
120
+ parentAttachedToMenu?: boolean | undefined;
121
+ } | {
122
+ type: "INTERNAL";
123
+ title: string;
124
+ additionalFields: {
125
+ [x: string]: any;
126
+ };
127
+ uiRouterKey: string;
128
+ relatedType: string;
129
+ id?: number | undefined;
130
+ order?: number | undefined;
131
+ path?: string | null | undefined;
132
+ audience?: string[] | undefined;
133
+ documentId?: string | undefined;
134
+ externalPath?: string | null | undefined;
135
+ menuAttached?: boolean | undefined;
136
+ collapsed?: boolean | undefined;
137
+ autoSync?: boolean | undefined;
138
+ related?: string | undefined;
139
+ viewId?: number | undefined;
140
+ viewParentId?: number | undefined;
141
+ structureId?: string | undefined;
142
+ removed?: boolean | undefined;
143
+ isSearchActive?: boolean | undefined;
144
+ updated?: boolean | undefined;
145
+ items?: any[] | undefined;
146
+ levelPath?: string | undefined;
147
+ isMenuAllowedLevel?: boolean | undefined;
148
+ parentAttachedToMenu?: boolean | undefined;
149
+ } | {
150
+ type: "WRAPPER";
151
+ title: string;
152
+ additionalFields: {
153
+ [x: string]: any;
154
+ };
155
+ uiRouterKey: string;
156
+ id?: number | undefined;
157
+ order?: number | undefined;
158
+ path?: string | null | undefined;
159
+ audience?: string[] | undefined;
160
+ documentId?: string | undefined;
161
+ menuAttached?: boolean | undefined;
162
+ collapsed?: boolean | undefined;
163
+ autoSync?: boolean | undefined;
164
+ viewId?: number | undefined;
165
+ viewParentId?: number | undefined;
166
+ structureId?: string | undefined;
167
+ removed?: boolean | undefined;
168
+ isSearchActive?: boolean | undefined;
169
+ updated?: boolean | undefined;
170
+ items?: any[] | undefined;
171
+ levelPath?: string | undefined;
172
+ isMenuAllowedLevel?: boolean | undefined;
173
+ parentAttachedToMenu?: boolean | undefined;
174
+ }> | undefined>>;
175
+ handleChange: (eventOrPath: FormChangeEvent, value?: any, nativeOnChange?: (eventOrPath: FormChangeEvent, value?: any) => void) => void;
176
+ setFormValue: import("react").Dispatch<import("react").SetStateAction<{
177
+ type: "EXTERNAL";
178
+ title: string;
179
+ additionalFields: {
180
+ [x: string]: any;
181
+ };
182
+ externalPath: string;
183
+ uiRouterKey: string;
184
+ id?: number | undefined;
185
+ order?: number | undefined;
186
+ path?: string | null | undefined;
187
+ audience?: string[] | undefined;
188
+ documentId?: string | undefined;
189
+ menuAttached?: boolean | undefined;
190
+ collapsed?: boolean | undefined;
191
+ autoSync?: boolean | undefined;
192
+ related?: string | undefined;
193
+ viewId?: number | undefined;
194
+ viewParentId?: number | undefined;
195
+ structureId?: string | undefined;
196
+ removed?: boolean | undefined;
197
+ isSearchActive?: boolean | undefined;
198
+ updated?: boolean | undefined;
199
+ items?: any[] | undefined;
200
+ relatedType?: string | undefined;
201
+ levelPath?: string | undefined;
202
+ isMenuAllowedLevel?: boolean | undefined;
203
+ parentAttachedToMenu?: boolean | undefined;
204
+ } | {
205
+ type: "INTERNAL";
206
+ title: string;
207
+ additionalFields: {
208
+ [x: string]: any;
209
+ };
210
+ uiRouterKey: string;
211
+ relatedType: string;
212
+ id?: number | undefined;
213
+ order?: number | undefined;
214
+ path?: string | null | undefined;
215
+ audience?: string[] | undefined;
216
+ documentId?: string | undefined;
217
+ externalPath?: string | null | undefined;
218
+ menuAttached?: boolean | undefined;
219
+ collapsed?: boolean | undefined;
220
+ autoSync?: boolean | undefined;
221
+ related?: string | undefined;
222
+ viewId?: number | undefined;
223
+ viewParentId?: number | undefined;
224
+ structureId?: string | undefined;
225
+ removed?: boolean | undefined;
226
+ isSearchActive?: boolean | undefined;
227
+ updated?: boolean | undefined;
228
+ items?: any[] | undefined;
229
+ levelPath?: string | undefined;
230
+ isMenuAllowedLevel?: boolean | undefined;
231
+ parentAttachedToMenu?: boolean | undefined;
232
+ } | {
233
+ type: "WRAPPER";
234
+ title: string;
235
+ additionalFields: {
236
+ [x: string]: any;
237
+ };
238
+ uiRouterKey: string;
239
+ id?: number | undefined;
240
+ order?: number | undefined;
241
+ path?: string | null | undefined;
242
+ audience?: string[] | undefined;
243
+ documentId?: string | undefined;
244
+ menuAttached?: boolean | undefined;
245
+ collapsed?: boolean | undefined;
246
+ autoSync?: boolean | undefined;
247
+ viewId?: number | undefined;
248
+ viewParentId?: number | undefined;
249
+ structureId?: string | undefined;
250
+ removed?: boolean | undefined;
251
+ isSearchActive?: boolean | undefined;
252
+ updated?: boolean | undefined;
253
+ items?: any[] | undefined;
254
+ levelPath?: string | undefined;
255
+ isMenuAllowedLevel?: boolean | undefined;
256
+ parentAttachedToMenu?: boolean | undefined;
257
+ }>>;
258
+ setFormValueItem: (path: string, value: any) => void;
259
+ setFormValuesItems: (values: any) => void;
260
+ };
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { NavigationItemSchema } from '../../../../api/validators';
3
- import { OnItemCollapseEffect, OnItemEditEffect, OnItemLevelAddEffect, OnItemRemoveEffect, OnItemReorderEffect, OnItemRestoreEffect } from '../NavigationItemListItem';
3
+ import { OnItemEditEffect, OnItemLevelAddEffect, OnItemSubmitEffect } from '../NavigationItemListItem';
4
4
  interface Props {
5
5
  isParentAttachedToMenu?: boolean;
6
6
  items?: Array<NavigationItemSchema>;
@@ -8,10 +8,7 @@ interface Props {
8
8
  levelPath?: string;
9
9
  onItemEdit: OnItemEditEffect;
10
10
  onItemLevelAdd: OnItemLevelAddEffect;
11
- onItemRemove: OnItemRemoveEffect;
12
- onItemRestore: OnItemRestoreEffect;
13
- onItemReOrder: OnItemReorderEffect;
14
- onItemToggleCollapse: OnItemCollapseEffect;
11
+ onItemSubmit: OnItemSubmitEffect;
15
12
  displayFlat?: boolean;
16
13
  permissions: {
17
14
  canUpdate: boolean;