@guillotinaweb/react-gmi 0.29.2-alpha.2 → 0.29.2-alpha.3

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 (69) hide show
  1. package/README.md +2 -1
  2. package/dist/actions/copy_item.d.ts +2 -2
  3. package/dist/actions/move_item.d.ts +2 -2
  4. package/dist/actions/remove_item.d.ts +2 -2
  5. package/dist/components/behaviors/iattachment.d.ts +4 -2
  6. package/dist/components/behaviors/imultiimageorderedattachment.d.ts +3 -1
  7. package/dist/components/behaviors/iworkflow.d.ts +1 -1
  8. package/dist/components/context_toolbar.d.ts +1 -1
  9. package/dist/components/fields/editComponent.d.ts +5 -4
  10. package/dist/components/fields/editableField.d.ts +4 -2
  11. package/dist/components/fields/renderField.d.ts +8 -5
  12. package/dist/components/flash.d.ts +1 -1
  13. package/dist/components/index.d.ts +2 -0
  14. package/dist/components/input/email.d.ts +1 -1
  15. package/dist/components/input/form_builder.d.ts +2 -2
  16. package/dist/components/input/input.d.ts +1 -1
  17. package/dist/components/input/search_input.d.ts +1 -1
  18. package/dist/components/input/search_input_list.d.ts +2 -2
  19. package/dist/components/input/select_vocabulary.d.ts +2 -2
  20. package/dist/components/input/upload.d.ts +1 -2
  21. package/dist/components/pagination.d.ts +1 -1
  22. package/dist/components/panel/permissions.d.ts +1 -1
  23. package/dist/components/panel/permissions_prinperm.d.ts +2 -2
  24. package/dist/components/panel/permissions_prinrole.d.ts +1 -1
  25. package/dist/components/panel/permissions_roleperm.d.ts +1 -1
  26. package/dist/components/path.d.ts +1 -1
  27. package/dist/components/properties_view.d.ts +2 -2
  28. package/dist/components/search_labels.d.ts +1 -1
  29. package/dist/components/search_options_labels.d.ts +1 -1
  30. package/dist/components/search_vocabulary_labels.d.ts +2 -2
  31. package/dist/components/tabs.d.ts +4 -2
  32. package/dist/components/widgets/tags.d.ts +4 -1
  33. package/dist/contexts/index.d.ts +21 -19
  34. package/dist/forms/required_fields.d.ts +2 -3
  35. package/dist/forms/users.d.ts +1 -1
  36. package/dist/hooks/useClickAway.d.ts +2 -1
  37. package/dist/hooks/useConfig.d.ts +4 -2
  38. package/dist/hooks/useCrudContext.d.ts +11 -10
  39. package/dist/hooks/useInput.d.ts +4 -3
  40. package/dist/hooks/useRegistry.d.ts +29 -29
  41. package/dist/hooks/useSetState.d.ts +6 -1
  42. package/dist/hooks/useVocabulary.d.ts +1 -1
  43. package/dist/index.d.ts +0 -2
  44. package/dist/lib/auth.d.ts +14 -19
  45. package/dist/lib/client.d.ts +49 -36
  46. package/dist/lib/helpers.d.ts +10 -18
  47. package/dist/lib/processResponse.d.ts +9 -0
  48. package/dist/lib/rest.d.ts +9 -16
  49. package/dist/lib/utils.d.ts +3 -2
  50. package/dist/lib/validators.d.ts +1 -1
  51. package/dist/locales/generic_messages.d.ts +248 -0
  52. package/dist/models/index.d.ts +5 -5
  53. package/dist/models/sharing.d.ts +5 -5
  54. package/dist/react-gmi.esm.js +1215 -1041
  55. package/dist/react-gmi.esm.js.map +1 -1
  56. package/dist/react-gmi.js +1214 -1041
  57. package/dist/react-gmi.js.map +1 -1
  58. package/dist/react-gmi.modern.js +1182 -983
  59. package/dist/react-gmi.modern.js.map +1 -1
  60. package/dist/react-gmi.umd.js +1214 -1041
  61. package/dist/react-gmi.umd.js.map +1 -1
  62. package/dist/reducers/guillotina.d.ts +22 -8
  63. package/dist/types/global.d.ts +9 -0
  64. package/dist/types/guillotina.d.ts +153 -19
  65. package/dist/views/folder.d.ts +1 -1
  66. package/dist/views/groups.d.ts +1 -1
  67. package/dist/views/item.d.ts +1 -1
  68. package/dist/views/users.d.ts +1 -1
  69. package/package.json +2 -1
@@ -4,28 +4,23 @@ export declare class Auth {
4
4
  events: {};
5
5
  url: string;
6
6
  base_url: string;
7
- errors: string;
8
- constructor(url: any);
9
- getUrl(endpoint: any): string;
10
- setAccount(account: any): void;
11
- login(username: any, password: any): Promise<boolean>;
7
+ errors?: string;
8
+ constructor(url: string);
9
+ getUrl(endpoint: string): string;
10
+ setAccount(account: string): void;
11
+ login(username: string, password: string): Promise<boolean>;
12
12
  get isLogged(): boolean;
13
13
  get username(): any;
14
- storeAuth(data: any): void;
14
+ storeAuth(data: {
15
+ token: string;
16
+ exp: number;
17
+ }): void;
15
18
  cleanAuth(): void;
16
19
  logout(): void;
17
20
  refreshToken(): Promise<any>;
18
- willExpire(expiration: any): boolean;
19
- isExpired(expiration: any): boolean;
20
- _getToken(): string[];
21
- getToken(): string;
22
- getHeaders(): {
23
- Accept?: undefined;
24
- 'Content-Type'?: undefined;
25
- Authorization?: undefined;
26
- } | {
27
- Accept: string;
28
- 'Content-Type': string;
29
- Authorization: string;
30
- };
21
+ willExpire(expiration: string): boolean;
22
+ isExpired(expiration: string): boolean;
23
+ _getToken(): (string | null)[];
24
+ getToken(): string | null;
25
+ getHeaders(): HeadersInit;
31
26
  }
@@ -1,59 +1,72 @@
1
1
  import { RestClient } from './rest';
2
- import { LightFile } from '../types/global';
2
+ import { IndexSignature, LightFile } from '../types/global';
3
+ import { ItemModel } from '../models';
4
+ import { Auth } from './auth';
5
+ import { GuillotinaGroup, GuillotinaUser, ReturnSearchCompatible } from '../types/guillotina';
3
6
  export declare class GuillotinaClient {
4
7
  rest: RestClient;
5
8
  pathContainsContainer: boolean;
6
9
  constructor(rest: RestClient, pathContainsContainer: boolean);
7
- getContainerFromPath: (path: any) => string;
8
- clearContainerFromPath: (path: any) => any;
9
- getContext(path: any): Promise<Response>;
10
- get(path: any): Promise<Response>;
11
- getQueryParamsPostresql({ start, pageSize, withDepth }: {
10
+ getContainerFromPath: (path: string) => string;
11
+ clearContainerFromPath: (path: string) => string;
12
+ getContext(path: string): Promise<Response>;
13
+ get(path: string): Promise<Response>;
14
+ getQueryParamsSearchFunction(name: string): ({ start, pageSize, withDepth, }: {
15
+ start?: number | undefined;
16
+ pageSize?: number | undefined;
17
+ path?: string | undefined;
18
+ withDepth?: boolean | undefined;
19
+ }) => string[][];
20
+ getQueryParamsPostresql({ start, pageSize, withDepth, }: {
12
21
  start?: number;
13
22
  pageSize?: number;
23
+ path?: string;
14
24
  withDepth?: boolean;
15
- }): any[];
25
+ }): string[][];
16
26
  getQueryParamsElasticsearch({ start, pageSize, path, withDepth, }: {
17
27
  start?: number;
18
28
  pageSize?: number;
19
- path: any;
29
+ path: string;
20
30
  withDepth?: boolean;
21
- }): any[];
31
+ }): string[][];
22
32
  getItemsColumn(): ({
23
33
  label: string;
24
34
  isSortable: boolean;
25
- child: (m: any) => import("react/jsx-runtime").JSX.Element;
35
+ child: (m: ItemModel) => import("react/jsx-runtime").JSX.Element;
26
36
  key?: undefined;
27
37
  } | {
28
38
  label: string;
29
39
  key: string;
30
40
  isSortable: boolean;
31
- child: (m: any, navigate: any, search: any) => import("react/jsx-runtime").JSX.Element;
41
+ child: (m: ItemModel, _navigate: () => void, search: boolean) => import("react/jsx-runtime").JSX.Element;
32
42
  })[];
33
- applyCompat(data: any): any;
34
- search(path: string, params: string | string[][], container?: boolean, prepare?: boolean): Promise<any>;
35
- canido(path: any, permissions: any): Promise<Response>;
36
- createObject(path: any, data: any): Promise<Response>;
37
- cleanPath(path: any): string;
38
- delete(path: any, data: any): Promise<Response>;
39
- create(path: any, data: any): Promise<Response>;
40
- post(path: any, data: any): Promise<Response>;
41
- patch(path: any, data: any): Promise<Response>;
42
- upload(path: any, file: any): Promise<Response>;
43
- download(path: any): Promise<Response>;
44
- getTypeSchema(path: any, name: any): Promise<any>;
45
- getAddons(path: any): Promise<Response>;
46
- installAddon(path: any, key: any): Promise<Response>;
47
- removeAddon(path: any, key: any): Promise<Response>;
48
- getGroups(path: any): Promise<Response>;
49
- getUsers(path: any): Promise<Response>;
50
- getPrincipals(path: any): Promise<{
51
- groups: any;
52
- users: any;
43
+ applyCompat<T>(data: {
44
+ items: T[];
45
+ items_total: number;
46
+ }): ReturnSearchCompatible<T>;
47
+ search<T>(path: string, params: string | IndexSignature<string>, container?: boolean, prepare?: boolean, signal?: AbortSignal): Promise<ReturnSearchCompatible<T>>;
48
+ canido(path: string, permissions: string | string[]): Promise<Response>;
49
+ createObject(path: string, data: unknown): Promise<Response>;
50
+ cleanPath(path: string): string;
51
+ delete(path: string, data: unknown): Promise<Response>;
52
+ create(path: string, data: unknown): Promise<Response>;
53
+ post(path: string, data: unknown): Promise<Response>;
54
+ patch(path: string, data: unknown): Promise<Response>;
55
+ upload(path: string, file: LightFile): Promise<Response>;
56
+ download(path: string): Promise<Response>;
57
+ getTypeSchema(path: string, name: string): Promise<any>;
58
+ getAddons(path: string): Promise<Response>;
59
+ installAddon(path: string, key: string): Promise<Response>;
60
+ removeAddon(path: string, key: string): Promise<Response>;
61
+ getGroups(path: string): Promise<Response>;
62
+ getUsers(path: string): Promise<Response>;
63
+ getPrincipals(path: string): Promise<{
64
+ groups: GuillotinaGroup[];
65
+ users: GuillotinaUser[];
53
66
  }>;
54
- getRoles(path: any): Promise<Response>;
55
- getAllPermissions(path: any): Promise<any[]>;
56
- getTypes(path: any): Promise<any>;
67
+ getRoles(path: string): Promise<Response>;
68
+ getAllPermissions(path: string): Promise<string[]>;
69
+ getTypes(path: string): Promise<any>;
57
70
  }
58
- export declare function getClient(url: any, container: any, auth: any): GuillotinaClient;
59
- export declare const lightFileReader: (file: any) => Promise<LightFile>;
71
+ export declare function getClient(url: string, container: string, auth: Auth): GuillotinaClient;
72
+ export declare const lightFileReader: (file: File) => Promise<LightFile>;
@@ -1,23 +1,15 @@
1
- export declare const classnames: (classNames: any) => any;
1
+ import { IntlShape } from 'react-intl';
2
+ import { IndexSignature } from '../types/global';
3
+ export declare const classnames: (classNames: (string | boolean)[]) => string;
2
4
  export declare const noop: () => void;
3
5
  export declare const generateUID: (prefix?: string) => string;
4
- export declare const toQueryString: (params: string[][]) => string;
5
- export declare function base64ToArrayBuffer(base64: any): Uint8Array;
6
- export declare function stringToSlug(str: any): any;
7
- export declare function sleep(ms: any): Promise<void>;
8
- export declare const getActionsObject: (intl: any, multiple?: boolean) => {
9
- DELETE: {
10
- text: any;
11
- perms: string[];
12
- action: string;
13
- };
14
- MOVE: {
15
- text: any;
16
- perms: string[];
17
- action: string;
18
- };
19
- COPY: {
20
- text: any;
6
+ export declare const toQueryString: (params: IndexSignature<string>) => string;
7
+ export declare function base64ToArrayBuffer(base64: string): Uint8Array;
8
+ export declare function stringToSlug(str: string): string;
9
+ export declare function sleep(ms: number): Promise<void>;
10
+ export declare const getActionsObject: (intl: IntlShape, multiple?: boolean) => {
11
+ [key: string]: {
12
+ text: string;
21
13
  perms: string[];
22
14
  action: string;
23
15
  };
@@ -0,0 +1,9 @@
1
+ interface IResponse<T = unknown> {
2
+ loading?: boolean;
3
+ isError: boolean;
4
+ errorMessage?: string;
5
+ result?: T;
6
+ response?: unknown;
7
+ }
8
+ export declare function processResponse<T>(res: Response, ready_body?: boolean): Promise<IResponse<T>>;
9
+ export {};
@@ -1,23 +1,16 @@
1
+ import { LightFile } from '../types/global';
1
2
  import { Auth } from './auth';
2
3
  export declare class RestClient {
3
4
  url: string;
4
5
  container: string;
5
6
  auth: Auth;
6
7
  constructor(url: string, container: string, auth: Auth);
7
- request(path: any, data?: any, headers?: any): Promise<Response>;
8
- getHeaders(): {
9
- Accept?: undefined;
10
- 'Content-Type'?: undefined;
11
- Authorization?: undefined;
12
- } | {
13
- Accept: string;
14
- 'Content-Type': string;
15
- Authorization: string;
16
- };
17
- post(path: any, data: any): Promise<Response>;
18
- get(path: any): Promise<Response>;
19
- put(path: any, data: any): Promise<Response>;
20
- patch(path: any, data: any): Promise<Response>;
21
- upload(path: any, data: any): Promise<Response>;
22
- delete(path: any, data?: any): Promise<Response>;
8
+ request(path: string, data?: RequestInit, headers?: HeadersInit, signal?: AbortSignal): Promise<Response>;
9
+ getHeaders(): HeadersInit;
10
+ post(path: string, data: unknown): Promise<Response>;
11
+ get(path: string, signal?: AbortSignal): Promise<Response>;
12
+ put(path: string, data: unknown): Promise<Response>;
13
+ patch(path: string, data: unknown): Promise<Response>;
14
+ upload(path: string, data: LightFile): Promise<Response>;
15
+ delete(path: string, data: unknown): Promise<Response>;
23
16
  }
@@ -1,4 +1,5 @@
1
1
  import { IndexSignature } from '../types/global';
2
2
  export declare const formatDate: (str: string) => string;
3
- export declare const get: <T>(obj: IndexSignature, path: string | string[], defValue: any) => T;
4
- export declare function getNewId(id?: string): any;
3
+ export declare const get: <T>(obj: IndexSignature, path: string | string[], defValue: T) => T;
4
+ export declare function getNewId(id?: string): string;
5
+ export declare function debounce<T extends unknown[], U>(callback: (...args: T) => PromiseLike<U> | U, wait: number): (...args: T) => Promise<U>;
@@ -9,4 +9,4 @@ export declare const isEmail: (value?: string) => boolean;
9
9
  export declare const isURL: (value?: string) => boolean;
10
10
  export declare const isHexColor: (value?: string) => boolean;
11
11
  export declare const isNumber: (value?: string) => boolean;
12
- export declare const notEmpty: (value: any) => boolean;
12
+ export declare const notEmpty: (value: string) => boolean;
@@ -0,0 +1,248 @@
1
+ export declare const genericMessages: {
2
+ loading: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ };
6
+ remove: {
7
+ id: string;
8
+ defaultMessage: string;
9
+ };
10
+ install: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ };
14
+ delete: {
15
+ id: string;
16
+ defaultMessage: string;
17
+ };
18
+ move_to: {
19
+ id: string;
20
+ defaultMessage: string;
21
+ };
22
+ copy_to: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ };
26
+ behaviors: {
27
+ id: string;
28
+ defaultMessage: string;
29
+ };
30
+ static: {
31
+ id: string;
32
+ defaultMessage: string;
33
+ };
34
+ disable: {
35
+ id: string;
36
+ defaultMessage: string;
37
+ };
38
+ enable: {
39
+ id: string;
40
+ defaultMessage: string;
41
+ };
42
+ enabled: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ };
46
+ available: {
47
+ id: string;
48
+ defaultMessage: string;
49
+ };
50
+ invalid_form_data: {
51
+ id: string;
52
+ defaultMessage: string;
53
+ };
54
+ invalid_form: {
55
+ id: string;
56
+ defaultMessage: string;
57
+ };
58
+ select_principal: {
59
+ id: string;
60
+ defaultMessage: string;
61
+ };
62
+ select_role: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ };
66
+ select_permissions: {
67
+ id: string;
68
+ defaultMessage: string;
69
+ };
70
+ operation: {
71
+ id: string;
72
+ defaultMessage: string;
73
+ };
74
+ save: {
75
+ id: string;
76
+ defaultMessage: string;
77
+ };
78
+ choose: {
79
+ id: string;
80
+ defaultMessage: string;
81
+ };
82
+ property: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ };
86
+ value: {
87
+ id: string;
88
+ defaultMessage: string;
89
+ };
90
+ create: {
91
+ id: string;
92
+ defaultMessage: string;
93
+ };
94
+ upload: {
95
+ id: string;
96
+ defaultMessage: string;
97
+ };
98
+ image: {
99
+ id: string;
100
+ defaultMessage: string;
101
+ };
102
+ error_provide_key_name: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ };
106
+ mandatory_field: {
107
+ id: string;
108
+ defaultMessage: string;
109
+ };
110
+ error_in_field: {
111
+ id: string;
112
+ defaultMessage: string;
113
+ };
114
+ field_updated: {
115
+ id: string;
116
+ defaultMessage: string;
117
+ };
118
+ field_deleted: {
119
+ id: string;
120
+ defaultMessage: string;
121
+ };
122
+ can_not_delete_field: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ };
126
+ cancel: {
127
+ id: string;
128
+ defaultMessage: string;
129
+ };
130
+ open: {
131
+ id: string;
132
+ defaultMessage: string;
133
+ };
134
+ download: {
135
+ id: string;
136
+ defaultMessage: string;
137
+ };
138
+ search: {
139
+ id: string;
140
+ defaultMessage: string;
141
+ };
142
+ no_results: {
143
+ id: string;
144
+ defaultMessage: string;
145
+ };
146
+ load_more: {
147
+ id: string;
148
+ defaultMessage: string;
149
+ };
150
+ add_type: {
151
+ id: string;
152
+ defaultMessage: string;
153
+ };
154
+ confirm: {
155
+ id: string;
156
+ defaultMessage: string;
157
+ };
158
+ field_is_required: {
159
+ id: string;
160
+ defaultMessage: string;
161
+ };
162
+ title: {
163
+ id: string;
164
+ defaultMessage: string;
165
+ };
166
+ add: {
167
+ id: string;
168
+ defaultMessage: string;
169
+ };
170
+ not_implemented: {
171
+ id: string;
172
+ defaultMessage: string;
173
+ };
174
+ failed_to_update: {
175
+ id: string;
176
+ defaultMessage: string;
177
+ };
178
+ add_user: {
179
+ id: string;
180
+ defaultMessage: string;
181
+ };
182
+ role: {
183
+ id: string;
184
+ defaultMessage: string;
185
+ };
186
+ setting: {
187
+ id: string;
188
+ defaultMessage: string;
189
+ };
190
+ permission: {
191
+ id: string;
192
+ defaultMessage: string;
193
+ };
194
+ };
195
+ export declare const genericFileMessages: {
196
+ error_file_key_name: {
197
+ id: string;
198
+ defaultMessage: string;
199
+ };
200
+ error_upload_file: {
201
+ id: string;
202
+ defaultMessage: string;
203
+ };
204
+ error_upload_file_size: {
205
+ id: string;
206
+ defaultMessage: string;
207
+ };
208
+ image_uploaded: {
209
+ id: string;
210
+ defaultMessage: string;
211
+ };
212
+ file_uploaded: {
213
+ id: string;
214
+ defaultMessage: string;
215
+ };
216
+ failed_delete_file: {
217
+ id: string;
218
+ defaultMessage: string;
219
+ };
220
+ image_deleted: {
221
+ id: string;
222
+ defaultMessage: string;
223
+ };
224
+ confirm_message_delete_file: {
225
+ id: string;
226
+ defaultMessage: string;
227
+ };
228
+ confirm_message_delete_image: {
229
+ id: string;
230
+ defaultMessage: string;
231
+ };
232
+ no_images_uploaded: {
233
+ id: string;
234
+ defaultMessage: string;
235
+ };
236
+ no_files_uploaded: {
237
+ id: string;
238
+ defaultMessage: string;
239
+ };
240
+ upload_an_image: {
241
+ id: string;
242
+ defaultMessage: string;
243
+ };
244
+ upload_a_file: {
245
+ id: string;
246
+ defaultMessage: string;
247
+ };
248
+ };
@@ -1,12 +1,12 @@
1
- import { SearchItem } from '../types/guillotina';
1
+ import { GuillotinaCommonObject, SearchItem } from '../types/guillotina';
2
2
  export * from './sharing';
3
3
  export declare class ItemModel {
4
- item: SearchItem;
4
+ item: SearchItem | GuillotinaCommonObject;
5
5
  url: string;
6
- constructor(item: any, url?: string);
7
- get path(): any;
6
+ constructor(item: SearchItem | GuillotinaCommonObject, url?: string);
7
+ get path(): string;
8
8
  get name(): string;
9
- get icon(): any;
9
+ get icon(): string;
10
10
  get fullPath(): string;
11
11
  get id(): string;
12
12
  get uid(): string;
@@ -1,12 +1,12 @@
1
- import { GuillotinaSharingInheritItem, GuillotinaSharingMap } from '../types/guillotina';
1
+ import { GuillotinaSharing, GuillotinaSharingInheritItem, GuillotinaSharingMap } from '../types/guillotina';
2
2
  export declare class Sharing {
3
3
  local: GuillotinaSharingMap;
4
4
  inherit: GuillotinaSharingInheritItem[];
5
- constructor(element: any);
5
+ constructor(element: GuillotinaSharing | undefined);
6
6
  get roles(): string[];
7
- getRole(role: any): import("../types/global").IndexSignature<string>;
7
+ getRole(role: string): import("../types/global").IndexSignature<string>;
8
8
  get principals(): string[];
9
- getPrincipals(principal: any): import("../types/global").IndexSignature<string>;
9
+ getPrincipals(principal: string): import("../types/global").IndexSignature<string>;
10
10
  get prinrole(): string[];
11
- getPrinroles(role: any): import("../types/global").IndexSignature<string>;
11
+ getPrinroles(role: string): import("../types/global").IndexSignature<string>;
12
12
  }