@guillotinaweb/react-gmi 0.29.2 → 0.30.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 (70) 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/input/email.d.ts +1 -1
  14. package/dist/components/input/form_builder.d.ts +2 -2
  15. package/dist/components/input/input.d.ts +1 -1
  16. package/dist/components/input/search_input.d.ts +1 -1
  17. package/dist/components/input/search_input_list.d.ts +2 -2
  18. package/dist/components/input/select_vocabulary.d.ts +2 -2
  19. package/dist/components/input/upload.d.ts +1 -2
  20. package/dist/components/pagination.d.ts +1 -1
  21. package/dist/components/panel/permissions.d.ts +1 -1
  22. package/dist/components/panel/permissions_prinperm.d.ts +2 -2
  23. package/dist/components/panel/permissions_prinrole.d.ts +1 -1
  24. package/dist/components/panel/permissions_roleperm.d.ts +1 -1
  25. package/dist/components/path.d.ts +1 -1
  26. package/dist/components/properties_view.d.ts +2 -2
  27. package/dist/components/search_labels.d.ts +1 -1
  28. package/dist/components/search_options_labels.d.ts +1 -1
  29. package/dist/components/search_vocabulary_labels.d.ts +2 -2
  30. package/dist/components/selected_items_actions.d.ts +14 -0
  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/lib/auth.d.ts +14 -19
  44. package/dist/lib/client.d.ts +49 -36
  45. package/dist/lib/helpers.d.ts +10 -18
  46. package/dist/lib/processResponse.d.ts +9 -0
  47. package/dist/lib/rest.d.ts +9 -16
  48. package/dist/lib/utils.d.ts +3 -2
  49. package/dist/lib/validators.d.ts +1 -1
  50. package/dist/locales/generic_messages.d.ts +248 -370
  51. package/dist/models/index.d.ts +5 -5
  52. package/dist/models/sharing.d.ts +5 -5
  53. package/dist/react-gmi.esm.js +1181 -904
  54. package/dist/react-gmi.esm.js.map +1 -1
  55. package/dist/react-gmi.js +1180 -904
  56. package/dist/react-gmi.js.map +1 -1
  57. package/dist/react-gmi.modern.js +1154 -851
  58. package/dist/react-gmi.modern.js.map +1 -1
  59. package/dist/react-gmi.umd.js +1180 -904
  60. package/dist/react-gmi.umd.js.map +1 -1
  61. package/dist/reducers/guillotina.d.ts +22 -8
  62. package/dist/types/global.d.ts +9 -0
  63. package/dist/types/guillotina.d.ts +192 -44
  64. package/dist/views/folder.d.ts +1 -1
  65. package/dist/views/groups.d.ts +1 -1
  66. package/dist/views/item.d.ts +1 -1
  67. package/dist/views/users.d.ts +1 -1
  68. package/package.json +3 -2
  69. package/dist/lib/search.test.d.ts +0 -1
  70. package/dist/setupTests.d.ts +0 -1
@@ -5,22 +5,36 @@ import { GuillotinaCommonObject } from '../types/guillotina';
5
5
  export interface GuillotinaGlobalState {
6
6
  path: string;
7
7
  loading: boolean;
8
- context: GuillotinaCommonObject;
8
+ context?: GuillotinaCommonObject;
9
9
  flash: {
10
- message: string;
11
- type: string;
10
+ message?: string;
11
+ type?: string;
12
12
  };
13
13
  action: {
14
- action: string;
15
- params: IndexSignature;
14
+ action?: string;
15
+ params?: IndexSignature;
16
16
  };
17
17
  permissions: IndexSignature;
18
- errorStatus: number;
18
+ errorStatus?: string;
19
19
  registry: IndexSignature;
20
- refresh: number;
20
+ refresh?: number;
21
21
  }
22
22
  export declare const initialState: GuillotinaGlobalState;
23
- export declare function guillotinaReducer(state: any, action: any): any;
23
+ export declare enum GuillotinaReducerActionTypes {
24
+ SET_PATH = "SET_PATH",
25
+ SET_CONTEXT = "SET_CONTEXT",
26
+ SET_ERROR = "SET_ERROR",
27
+ SET_FLASH = "SET_FLASH",
28
+ CLEAR_FLASH = "CLEAR_FLASH",
29
+ SET_ACTION = "SET_ACTION",
30
+ CLEAR_ACTION = "CLEAR_ACTION",
31
+ REFRESH = "REFRESH",
32
+ APPLY = "APPLY"
33
+ }
34
+ export declare function guillotinaReducer(state: GuillotinaGlobalState, action: {
35
+ type: GuillotinaReducerActionTypes;
36
+ payload: IndexSignature;
37
+ }): GuillotinaGlobalState;
24
38
  export interface IColumn {
25
39
  key: string;
26
40
  label: string;
@@ -1,3 +1,4 @@
1
+ import { GuillotinaFile } from './guillotina';
1
2
  export interface LightFile {
2
3
  filename: string;
3
4
  data: ArrayBuffer | string;
@@ -6,3 +7,11 @@ export interface LightFile {
6
7
  export interface IndexSignature<T = any> {
7
8
  [key: string]: T;
8
9
  }
10
+ export type EditableFieldValue = GuillotinaFile | LightFile | IndexSignature | string | string[] | boolean | Date | undefined | null;
11
+ interface FormElements extends HTMLFormControlsCollection {
12
+ filterInput: HTMLInputElement;
13
+ }
14
+ export interface FilterFormElement extends HTMLFormElement {
15
+ readonly elements: FormElements;
16
+ }
17
+ export {};
@@ -1,12 +1,80 @@
1
+ /// <reference types="react" />
1
2
  import { IndexSignature } from './global';
2
3
  type ItemsPropertyObject = {
3
4
  '@id': string;
4
5
  '@name': string;
5
6
  '@type': string;
6
7
  '@uid': string;
7
- __behaviors__: string[];
8
- '@static_behaviors': string[];
8
+ '@absolute_url': string;
9
+ title: string;
10
+ creation_date: string;
11
+ modification_date: string;
12
+ uuid: string;
13
+ type_name: string;
9
14
  };
15
+ export type GuillotinaCommonObject = {
16
+ type_name: string;
17
+ uuid: string;
18
+ is_folderish: boolean;
19
+ parent: GuillotinaParentObject;
20
+ length: number;
21
+ __behaviors__?: string[];
22
+ '@static_behaviors': string[];
23
+ 'guillotina.behaviors.dublincore.IDublinCore'?: IBehaviorDublinCore;
24
+ 'guillotina.contrib.workflows.interfaces.IWorkflowBehavior'?: IWorkflowBehavior;
25
+ 'guillotina.behaviors.attachment.IAttachment'?: {
26
+ file: GuillotinaFile;
27
+ };
28
+ 'guillotina.behaviors.attachment.IMultiAttachment'?: {
29
+ files: {
30
+ [key: string]: GuillotinaFile;
31
+ };
32
+ };
33
+ 'guillotina.contrib.image.behaviors.IImageAttachment'?: {
34
+ image: GuillotinaFile;
35
+ };
36
+ 'guillotina.contrib.image.behaviors.IMultiImageAttachment'?: {
37
+ images: {
38
+ [key: string]: GuillotinaFile;
39
+ };
40
+ };
41
+ 'guillotina.contrib.image.behaviors.IMultiImageOrderedAttachment'?: {
42
+ images: {
43
+ [key: string]: GuillotinaFile;
44
+ };
45
+ };
46
+ } & ItemsPropertyObject;
47
+ export type SearchItem = {
48
+ id: string;
49
+ parent_uuid: string;
50
+ path: string;
51
+ tid: string;
52
+ description: string;
53
+ access_roles: string[];
54
+ access_users: string[];
55
+ } & ItemsPropertyObject;
56
+ export interface IBehaviorDublinCore {
57
+ title: string;
58
+ description: string | null;
59
+ creation_date: string;
60
+ modification_date: string;
61
+ effective_date: string | null;
62
+ expiration_date: string | null;
63
+ creators: string[];
64
+ tags: string[] | null;
65
+ publisher: string | null;
66
+ contributors: string[];
67
+ }
68
+ export interface IWorkflowBehavior {
69
+ review_state: string;
70
+ history: WorkflowHistory[];
71
+ }
72
+ interface GuillotinaParentObject {
73
+ '@id': string;
74
+ '@name': string;
75
+ '@type': string;
76
+ '@uid': string;
77
+ }
10
78
  export interface GuillotinaSchema {
11
79
  title: string;
12
80
  $schema: string;
@@ -15,6 +83,11 @@ export interface GuillotinaSchema {
15
83
  definitions: Definitions;
16
84
  properties: GuillotinaSchemaProperties;
17
85
  }
86
+ export interface GuillotinaSchemaProperties {
87
+ [key: string]: GuillotinaSchemaProperty | {
88
+ $ref: string;
89
+ }[];
90
+ }
18
91
  export interface Definitions {
19
92
  [key: string]: {
20
93
  type: string;
@@ -24,19 +97,6 @@ export interface Definitions {
24
97
  description: string;
25
98
  };
26
99
  }
27
- export interface GuillotinaItemsProperty {
28
- type: string;
29
- widget?: string;
30
- properties?: GuillotinaSchemaProperties;
31
- vocabulary?: string[];
32
- vocabularyName?: string;
33
- queryCondition?: string;
34
- queryPath?: string;
35
- labelProperty?: string;
36
- typeNameQuery?: string;
37
- items: GuillotinaItemsProperty;
38
- title: string;
39
- }
40
100
  export interface GuillotinaSchemaProperty {
41
101
  type: string;
42
102
  title: string;
@@ -45,29 +105,15 @@ export interface GuillotinaSchemaProperty {
45
105
  description?: string;
46
106
  vocabularyName?: string;
47
107
  vocabulary?: string[];
48
- items?: GuillotinaItemsProperty;
108
+ items?: GuillotinaSchemaProperty;
49
109
  properties?: GuillotinaSchemaProperties;
50
110
  additionalProperties?: GuillotinaSchemaProperties;
51
111
  typeNameQuery?: string;
52
112
  labelProperty?: string;
113
+ enum?: string[];
114
+ queryCondition?: string;
115
+ queryPath?: string;
53
116
  }
54
- export interface GuillotinaSchemaProperties {
55
- [key: string]: GuillotinaSchemaProperty | {
56
- $ref: string;
57
- }[];
58
- }
59
- export type GuillotinaCommonObject = {
60
- creation_date: Date;
61
- modification_date: string;
62
- title: string;
63
- type_name: string;
64
- uuid: string;
65
- 'guillotina.behaviors.attachment.IMultiAttachment'?: {
66
- files: {
67
- [key: string]: GuillotinaFile;
68
- };
69
- };
70
- } & ItemsPropertyObject;
71
117
  export type GuillotinaFile = {
72
118
  filename: string;
73
119
  content_type: string;
@@ -75,17 +121,6 @@ export type GuillotinaFile = {
75
121
  size: number;
76
122
  md5: string;
77
123
  };
78
- export type SearchItem = {
79
- id: string;
80
- parent_uuid: string;
81
- path: string;
82
- tid: string;
83
- uuid: string;
84
- title: string;
85
- type_name: string;
86
- creation_date: string;
87
- modification_date: string;
88
- } & ItemsPropertyObject;
89
124
  export interface GuillotinaVocabulary {
90
125
  '@id': string;
91
126
  items: GuillotinaVocabularyItem[];
@@ -118,4 +153,117 @@ export interface GuillotinaBehaviors {
118
153
  dynamic: string[];
119
154
  available: string[];
120
155
  }
156
+ export interface AllPermissions {
157
+ [key: string]: AllPermissionsItem;
158
+ }
159
+ export interface AllPermissionsItem {
160
+ prinperm?: PrimPerm[];
161
+ prinrole?: Prinrole[];
162
+ roleperm?: Roleperm[];
163
+ perminhe?: Perminhe[];
164
+ }
165
+ export interface Prinrole {
166
+ principal: string;
167
+ role: string;
168
+ setting: Setting;
169
+ }
170
+ export interface Roleperm {
171
+ permission: string;
172
+ role: string;
173
+ setting: Setting;
174
+ }
175
+ export interface PrimPerm {
176
+ principal: string;
177
+ permission: string;
178
+ setting: Setting;
179
+ }
180
+ export interface Perminhe {
181
+ permission: string;
182
+ setting: Setting;
183
+ }
184
+ export declare enum Setting {
185
+ Allow = "Allow",
186
+ AllowSingle = "AllowSingle",
187
+ Deny = "Deny",
188
+ Unset = "Unset"
189
+ }
190
+ export interface Workflow {
191
+ '@id': string;
192
+ history: WorkflowHistory[];
193
+ transitions: Transition[];
194
+ }
195
+ export interface WorkflowHistory {
196
+ actor: string;
197
+ comments: string;
198
+ time: string;
199
+ title: string;
200
+ type: string;
201
+ data: WorkflowHistoryData;
202
+ }
203
+ export interface WorkflowHistoryData {
204
+ action: null;
205
+ review_state: string;
206
+ }
207
+ export interface Transition {
208
+ '@id': string;
209
+ title: string;
210
+ metadata: IndexSignature;
211
+ }
212
+ export interface Addons {
213
+ available: AddonAvailable[];
214
+ installed: string[];
215
+ }
216
+ export interface AddonAvailable {
217
+ id: string;
218
+ title: string;
219
+ dependencies: any[];
220
+ }
221
+ export interface RegistrySchema {
222
+ filters: RegistrySchemaFilter[];
223
+ }
224
+ export interface RegistrySchemaFilter {
225
+ attribute_key: string;
226
+ label: string;
227
+ type: string;
228
+ values?: {
229
+ value: string;
230
+ text: string;
231
+ }[];
232
+ vocabulary?: string;
233
+ input_type?: string;
234
+ }
235
+ export type ReturnSearch<T> = {
236
+ items: T[];
237
+ items_total: number;
238
+ };
239
+ export type ReturnSearchCompatible<T> = {
240
+ member: T[];
241
+ items_count: number;
242
+ items: T[];
243
+ items_total: number;
244
+ };
245
+ export interface ItemColumn {
246
+ label: string;
247
+ key: string;
248
+ isSortable?: boolean;
249
+ child: React.ReactNode;
250
+ }
251
+ export type GuillotinaUser = {
252
+ user_roles: string[];
253
+ user_groups: string[];
254
+ user_permissions: string[];
255
+ fullname: string;
256
+ email: string;
257
+ username: string;
258
+ } & GuillotinaCommonObject;
259
+ export type GuillotinaGroup = {
260
+ user_roles: string[];
261
+ users: string[];
262
+ } & GuillotinaCommonObject;
263
+ export type GuillotinaApplication = {
264
+ databases: string[];
265
+ } & GuillotinaCommonObject;
266
+ export type GuillotinaDatabase = {
267
+ containers: string[];
268
+ } & GuillotinaCommonObject;
121
269
  export {};
@@ -1 +1 @@
1
- export declare function FolderCtx(props: any): import("react/jsx-runtime").JSX.Element;
1
+ export declare function FolderCtx(): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export declare function GroupToolbar(): import("react/jsx-runtime").JSX.Element;
2
- export declare function GroupsCtx(props: any): import("react/jsx-runtime").JSX.Element;
2
+ export declare function GroupsCtx(): import("react/jsx-runtime").JSX.Element;
3
3
  export declare function GroupCtx(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare function ItemCtx(props: any): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ItemCtx(): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export declare function UsersToolbar(): import("react/jsx-runtime").JSX.Element;
2
- export declare function UsersCtx(props: any): import("react/jsx-runtime").JSX.Element;
2
+ export declare function UsersCtx(): import("react/jsx-runtime").JSX.Element;
3
3
  export declare function UserCtx(): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.29.2",
2
+ "version": "0.30.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git@github.com:guillotinaweb/guillotina_react.git"
@@ -37,6 +37,7 @@
37
37
  "@testing-library/user-event": "12.6.0",
38
38
  "@typescript-eslint/eslint-plugin": "^6.18.1",
39
39
  "@typescript-eslint/parser": "^6.18.1",
40
+ "@types/uuid":"9.0.8",
40
41
  "babel-plugin-formatjs": "^10.5.10",
41
42
  "eslint": "^8.56.0",
42
43
  "eslint-plugin-react": "^7.33.2",
@@ -45,7 +46,7 @@
45
46
  "prettier": "2.2.1",
46
47
  "sass": "1.69.5",
47
48
  "serialize-javascript": "5.0.1",
48
- "typescript": "^5.3.3",
49
+ "typescript": "5.4.2",
49
50
  "vitest": "^0.34.6",
50
51
  "@types/react-beautiful-dnd": "13.1.8"
51
52
  },
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};