strapi-plugin-navigation 2.2.11 → 2.2.13

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 (45) hide show
  1. package/README.md +1 -1
  2. package/admin/src/components/AdditionalFieldInput/types.d.ts +3 -3
  3. package/admin/src/components/ConfirmationDialog/index.d.ts +10 -10
  4. package/admin/src/components/EmptyView/index.js +2 -0
  5. package/admin/src/components/Item/index.d.ts +15 -15
  6. package/admin/src/components/NavigationItemList/index.d.ts +11 -11
  7. package/admin/src/index.d.ts +5 -7
  8. package/admin/src/index.js +9 -17
  9. package/admin/src/pages/DataManagerProvider/index.d.ts +1 -1
  10. package/admin/src/pages/DataManagerProvider/index.js +18 -4
  11. package/admin/src/pages/DataManagerProvider/reducer.d.ts +15 -15
  12. package/admin/src/pages/SettingsPage/types.d.ts +8 -8
  13. package/admin/src/pages/SettingsPage/utils/functions.d.ts +0 -2
  14. package/admin/src/pages/View/components/NavigationHeader/index.js +2 -0
  15. package/admin/src/pages/View/components/NavigationItemForm/types.d.ts +8 -8
  16. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.d.ts +9 -9
  17. package/admin/src/pages/View/components/NavigationItemPopup/index.d.ts +11 -11
  18. package/admin/src/pages/View/components/NavigationManager/Footer/index.d.ts +1 -1
  19. package/admin/src/pages/View/components/NavigationManager/types.d.ts +3 -3
  20. package/admin/src/pages/View/index.d.ts +1 -1
  21. package/admin/src/pages/View/index.js +3 -0
  22. package/admin/src/permissions.d.ts +3 -3
  23. package/admin/src/translations/ca.json +197 -0
  24. package/admin/src/translations/en.json +2 -1
  25. package/admin/src/translations/fr.json +2 -1
  26. package/admin/src/translations/index.d.ts +2 -0
  27. package/admin/src/translations/index.js +2 -0
  28. package/admin/src/utils/functions.d.ts +2 -2
  29. package/package.json +4 -4
  30. package/server/config/setupStrategy.js +11 -0
  31. package/server/i18n/graphQLEnhancers.d.ts +1 -1
  32. package/server/i18n/types.d.ts +11 -11
  33. package/server/i18n/utils.d.ts +2 -2
  34. package/server/services/admin.js +1 -1
  35. package/server/services/common.js +16 -9
  36. package/server/utils/functions.d.ts +2 -1
  37. package/server/utils/functions.js +16 -1
  38. package/tsconfig.tsbuildinfo +1 -1
  39. package/types/config.d.ts +8 -8
  40. package/types/contentTypes.d.ts +20 -20
  41. package/types/controllers.d.ts +2 -2
  42. package/types/graphQL.d.ts +1 -1
  43. package/types/i18n.d.ts +2 -2
  44. package/types/services.d.ts +2 -2
  45. package/types/utils.d.ts +21 -21
package/types/config.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { NavigationItemAdditionalField } from "./contentTypes";
2
- export declare type PluginConfigNameFields = Record<string, string[]>;
3
- export declare type PluginConfigPopulate = Record<string, string[]>;
4
- export declare type PluginConfigPathDefaultFields = Record<string, string[]>;
5
- export declare type PluginConfigGraphQL = {
2
+ export type PluginConfigNameFields = Record<string, string[]>;
3
+ export type PluginConfigPopulate = Record<string, string[]>;
4
+ export type PluginConfigPathDefaultFields = Record<string, string[]>;
5
+ export type PluginConfigGraphQL = {
6
6
  navigationItemRelated: string[];
7
7
  };
8
- export declare type NavigationPluginConfig = {
8
+ export type NavigationPluginConfig = {
9
9
  additionalFields: NavigationItemAdditionalField[];
10
10
  contentTypes: string[];
11
11
  contentTypesNameFields: PluginConfigNameFields;
@@ -17,9 +17,9 @@ export declare type NavigationPluginConfig = {
17
17
  pathDefaultFields: PluginConfigPathDefaultFields;
18
18
  cascadeMenuAttached: boolean;
19
19
  };
20
- export declare type StrapiConfig<T> = {
20
+ export type StrapiConfig<T> = {
21
21
  default: T;
22
22
  };
23
- export declare type PluginConfigKeys = keyof NavigationPluginConfig;
24
- export declare type PluginDefaultConfigGetter = (key: PluginConfigKeys) => NavigationPluginConfig[PluginConfigKeys];
23
+ export type PluginConfigKeys = keyof NavigationPluginConfig;
24
+ export type PluginDefaultConfigGetter = (key: PluginConfigKeys) => NavigationPluginConfig[PluginConfigKeys];
25
25
  //# sourceMappingURL=config.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Id, StringMap, TypeResult } from "strapi-typed";
2
2
  import { DateString, ToBeFixed } from "./utils";
3
- export declare type Navigation = {
3
+ export type Navigation = {
4
4
  id: Id;
5
5
  name: string;
6
6
  slug: string;
@@ -11,7 +11,7 @@ export declare type Navigation = {
11
11
  localeCode?: string | null;
12
12
  localizations?: Navigation[] | null;
13
13
  };
14
- export declare type NavigationItem = NavigationItemPartial & {
14
+ export type NavigationItem = NavigationItemPartial & {
15
15
  id?: number;
16
16
  master: number;
17
17
  parent: number | null;
@@ -22,10 +22,10 @@ export declare type NavigationItem = NavigationItemPartial & {
22
22
  updated: boolean;
23
23
  slug?: string;
24
24
  };
25
- export declare type NavigationItemInput = NavigationItemPartial & Omit<NavigationItem, "related"> & {
25
+ export type NavigationItemInput = NavigationItemPartial & Omit<NavigationItem, "related"> & {
26
26
  related: RelatedRefBase[];
27
27
  };
28
- export declare type NavigationItemEntity<RelatedType = NavigationItemRelated> = TypeResult<NavigationItemPartial & EntityDatePartial & {
28
+ export type NavigationItemEntity<RelatedType = NavigationItemRelated> = TypeResult<NavigationItemPartial & EntityDatePartial & {
29
29
  id: number;
30
30
  parent: NavigationItemEntity | null;
31
31
  master: Navigation;
@@ -34,7 +34,7 @@ export declare type NavigationItemEntity<RelatedType = NavigationItemRelated> =
34
34
  related: RelatedType | null;
35
35
  additionalFields: StringMap<string | boolean>;
36
36
  }>;
37
- declare type NavigationItemPartial = {
37
+ type NavigationItemPartial = {
38
38
  path: string | null;
39
39
  title: string;
40
40
  type: NavigationItemType;
@@ -43,25 +43,25 @@ declare type NavigationItemPartial = {
43
43
  order: number;
44
44
  uiRouterKey: string;
45
45
  };
46
- export declare type NestedStructure<T> = T & {
46
+ export type NestedStructure<T> = T & {
47
47
  items: NestedStructure<T>[];
48
48
  };
49
- export declare type RelatedRefBase = {
49
+ export type RelatedRefBase = {
50
50
  refId: number;
51
51
  ref: string;
52
52
  field: string;
53
53
  };
54
- export declare type RelatedRef = RelatedRefBase & {
54
+ export type RelatedRef = RelatedRefBase & {
55
55
  id: Id;
56
56
  __templateName?: string;
57
57
  __contentType?: string;
58
58
  };
59
- export declare type Audience = {
59
+ export type Audience = {
60
60
  id: Id;
61
61
  name: string;
62
62
  key: string;
63
63
  };
64
- export declare type NavigationItemRelated = {
64
+ export type NavigationItemRelated = {
65
65
  id: Id;
66
66
  related_id: string;
67
67
  related_type: string;
@@ -76,31 +76,31 @@ export declare type NavigationItemRelated = {
76
76
  refId?: Id;
77
77
  ref?: string;
78
78
  };
79
- export declare type NavigationItemType = "INTERNAL" | "EXTERNAL" | "WRAPPER";
80
- declare type EntityDatePartial = {
79
+ export type NavigationItemType = "INTERNAL" | "EXTERNAL" | "WRAPPER";
80
+ type EntityDatePartial = {
81
81
  createdAt: DateString;
82
82
  updatedAt: DateString;
83
83
  };
84
- export declare type NotVoid<T> = T extends undefined ? never : T;
85
- export declare type NavigationItemCustomFieldType = 'boolean' | 'string' | 'select';
86
- declare type NavigationItemCustomFieldBase = {
84
+ export type NotVoid<T> = T extends undefined ? never : T;
85
+ export type NavigationItemCustomFieldType = 'boolean' | 'string' | 'select';
86
+ type NavigationItemCustomFieldBase = {
87
87
  name: string;
88
88
  label: string;
89
89
  required: boolean;
90
90
  enabled?: boolean;
91
91
  };
92
- declare type NavigationItemCustomFieldSelect = NavigationItemCustomFieldBase & {
92
+ type NavigationItemCustomFieldSelect = NavigationItemCustomFieldBase & {
93
93
  type: 'select';
94
94
  multi: boolean;
95
95
  options: string[];
96
96
  };
97
- declare type NavigationItemCustomFieldPrimitive = NavigationItemCustomFieldBase & {
97
+ type NavigationItemCustomFieldPrimitive = NavigationItemCustomFieldBase & {
98
98
  type: 'boolean' | 'string';
99
99
  multi: false;
100
100
  options: [];
101
101
  };
102
- export declare type NavigationItemCustomField = NavigationItemCustomFieldPrimitive | NavigationItemCustomFieldSelect;
103
- export declare type NavigationItemAdditionalField = NavigationItemCustomField | 'audience';
104
- export declare type NavigationItemAdditionalFieldValues = Record<string, string | boolean | string[]>;
102
+ export type NavigationItemCustomField = NavigationItemCustomFieldPrimitive | NavigationItemCustomFieldSelect;
103
+ export type NavigationItemAdditionalField = NavigationItemCustomField | 'audience';
104
+ export type NavigationItemAdditionalFieldValues = Record<string, string | boolean | string[]>;
105
105
  export {};
106
106
  //# sourceMappingURL=contentTypes.d.ts.map
@@ -2,7 +2,7 @@ import { StrapiController } from "strapi-typed";
2
2
  import { Navigation, NotVoid } from "./contentTypes";
3
3
  import { IAdminService, IClientService, NavigationService, NavigationServiceName } from "./services";
4
4
  import { AuditLogContext, StrapiControllerContext, ToBeFixed } from "./utils";
5
- declare type ControllerCommonContext = {
5
+ type ControllerCommonContext = {
6
6
  auditLog: AuditLogContext;
7
7
  };
8
8
  export interface IAdminController {
@@ -45,7 +45,7 @@ export interface IClientController {
45
45
  render: (ctx: StrapiControllerContext) => ToBeFixed;
46
46
  renderChild: (ctx: StrapiControllerContext) => ToBeFixed;
47
47
  }
48
- export declare type NavigationController = {
48
+ export type NavigationController = {
49
49
  admin: IAdminController;
50
50
  client: IClientController;
51
51
  };
@@ -1,3 +1,3 @@
1
1
  import { ToBeFixed } from "./utils";
2
- export declare type Nexus = ToBeFixed;
2
+ export type Nexus = ToBeFixed;
3
3
  //# sourceMappingURL=graphQL.d.ts.map
package/types/i18n.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export declare type I18nLocale = {
1
+ export type I18nLocale = {
2
2
  id: number;
3
3
  name: string;
4
4
  code: string;
5
5
  };
6
- export declare type I18nQueryParams = {
6
+ export type I18nQueryParams = {
7
7
  locale?: string;
8
8
  };
9
9
  //# sourceMappingURL=i18n.d.ts.map
@@ -3,8 +3,8 @@ import { NavigationPluginConfig } from "./config";
3
3
  import { Navigation, NavigationItem, NavigationItemCustomField, NavigationItemEntity, NavigationItemInput, NestedStructure, NotVoid, RelatedRef, RelatedRefBase } from "./contentTypes";
4
4
  import { I18nQueryParams } from "./i18n";
5
5
  import { AuditLogContext, ContentTypeEntity, NavigationActions, NavigationActionsPerItem, PopulateQueryParam, RenderType, RFRNavItem, ToBeFixed } from "./utils";
6
- export declare type NavigationServiceName = "common" | "admin" | "client";
7
- export declare type NavigationService = ICommonService | IAdminService | IClientService;
6
+ export type NavigationServiceName = "common" | "admin" | "client";
7
+ export type NavigationService = ICommonService | IAdminService | IClientService;
8
8
  export interface IAdminService {
9
9
  config: (viaSettingsPage?: boolean) => Promise<NavigationPluginConfig>;
10
10
  get: () => Promise<Navigation[]>;
package/types/utils.d.ts CHANGED
@@ -1,31 +1,31 @@
1
1
  import { Id, PopulateClause } from "strapi-typed";
2
2
  import { Navigation, NavigationItem, NavigationItemType, NestedStructure } from "./contentTypes";
3
- export declare type Effect<T> = (value: T) => void;
4
- export declare type VoidEffect = Effect<void>;
5
- export declare type NavigationActionsCategories = 'toCreate' | 'toUpdate' | 'toRemove';
6
- export declare type RenderTypeOptions = Readonly<{
3
+ export type Effect<T> = (value: T) => void;
4
+ export type VoidEffect = Effect<void>;
5
+ export type NavigationActionsCategories = 'toCreate' | 'toUpdate' | 'toRemove';
6
+ export type RenderTypeOptions = Readonly<{
7
7
  FLAT: 'FLAT';
8
8
  TREE: 'TREE';
9
9
  RFR: 'RFR';
10
10
  }>;
11
- export declare type RenderType = keyof RenderTypeOptions;
12
- export declare type StrapiRoutesTypes = 'admin' | 'content-api';
13
- export declare type ToBeFixed = any;
14
- export declare type DateString = string;
15
- export declare type PopulateQueryParam = string | PopulateClause;
16
- export declare type PluginPermissions = {
11
+ export type RenderType = keyof RenderTypeOptions;
12
+ export type StrapiRoutesTypes = 'admin' | 'content-api';
13
+ export type ToBeFixed = any;
14
+ export type DateString = string;
15
+ export type PopulateQueryParam = string | PopulateClause;
16
+ export type PluginPermissions = {
17
17
  canAccess: boolean;
18
18
  canUpdate?: boolean;
19
19
  canUpdateSettings?: boolean;
20
20
  };
21
- export declare type NavigationActions = {
21
+ export type NavigationActions = {
22
22
  create?: boolean;
23
23
  update?: boolean;
24
24
  remove?: boolean;
25
25
  };
26
- export declare type NavigationActionsPerItem = Record<NavigationActionsCategories, NestedStructure<NavigationItem>[]>;
27
- export declare type AuditLogContext = any;
28
- export declare type AuditLogParams = {
26
+ export type NavigationActionsPerItem = Record<NavigationActionsCategories, NestedStructure<NavigationItem>[]>;
27
+ export type AuditLogContext = any;
28
+ export type AuditLogParams = {
29
29
  actionType: string;
30
30
  oldEntity: Navigation;
31
31
  newEntity: Navigation;
@@ -33,10 +33,10 @@ export declare type AuditLogParams = {
33
33
  actionType: "DELETE";
34
34
  entity: Navigation;
35
35
  };
36
- export declare type ContentTypeEntity = {
36
+ export type ContentTypeEntity = {
37
37
  id: Id;
38
38
  } & Record<string, unknown>;
39
- export declare type NestedPath = {
39
+ export type NestedPath = {
40
40
  id: Id;
41
41
  parent?: {
42
42
  id: Id;
@@ -44,25 +44,25 @@ export declare type NestedPath = {
44
44
  };
45
45
  path: string;
46
46
  };
47
- export declare type RFRNavItem = {
47
+ export type RFRNavItem = {
48
48
  label?: string;
49
49
  type: NavigationItemType;
50
50
  page?: string;
51
51
  url?: string;
52
52
  audience?: string[];
53
53
  };
54
- export declare type StrapiRoute = {
54
+ export type StrapiRoute = {
55
55
  method: string;
56
56
  path: string;
57
57
  handler: string;
58
58
  config?: ToBeFixed;
59
59
  };
60
- export declare type StrapiRoutes = {
60
+ export type StrapiRoutes = {
61
61
  type: StrapiRoutesTypes;
62
62
  routes: StrapiRoute[];
63
63
  };
64
- export declare type StrapiControllerContext = any;
65
- export declare type StrapiControllerContextParams = any;
64
+ export type StrapiControllerContext = any;
65
+ export type StrapiControllerContextParams = any;
66
66
  export declare const assertNotEmpty: <T>(value: T | null | undefined, customError?: Error) => asserts value is T;
67
67
  export declare const isNumber: (x: unknown) => boolean;
68
68
  export declare const assertIsNumber: (n: unknown, customError?: Error) => asserts n is number;