@guillotinaweb/react-gmi 0.27.0 → 0.28.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 (126) hide show
  1. package/dist/actions/add_item.d.ts +5 -1
  2. package/dist/actions/change_pass.d.ts +1 -1
  3. package/dist/actions/copy_item.d.ts +6 -1
  4. package/dist/actions/copy_items.d.ts +6 -1
  5. package/dist/actions/index.d.ts +2 -2
  6. package/dist/actions/move_item.d.ts +6 -1
  7. package/dist/actions/move_items.d.ts +6 -1
  8. package/dist/actions/remove_item.d.ts +6 -1
  9. package/dist/actions/remove_items.d.ts +6 -1
  10. package/dist/components/Link.d.ts +10 -6
  11. package/dist/components/TdLink.d.ts +10 -5
  12. package/dist/components/behavior_view.d.ts +8 -5
  13. package/dist/components/behaviors/iattachment.d.ts +9 -4
  14. package/dist/components/behaviors/idublincore.d.ts +10 -4
  15. package/dist/components/behaviors/iimageattachment.d.ts +9 -4
  16. package/dist/components/behaviors/imultiattachment.d.ts +11 -4
  17. package/dist/components/behaviors/imultiimageattachment.d.ts +11 -4
  18. package/dist/components/behaviors/imultiimageorderedattachment.d.ts +9 -4
  19. package/dist/components/behaviors/iworkflow.d.ts +1 -1
  20. package/dist/components/context_toolbar.d.ts +7 -5
  21. package/dist/components/error_boundary.d.ts +6 -4
  22. package/dist/components/error_zone.d.ts +16 -13
  23. package/dist/components/fields/downloadField.d.ts +11 -4
  24. package/dist/components/fields/editComponent.d.ts +14 -2
  25. package/dist/components/fields/editableField.d.ts +10 -8
  26. package/dist/components/fields/renderField.d.ts +31 -21
  27. package/dist/components/flash.d.ts +1 -1
  28. package/dist/components/guillotina.d.ts +12 -5
  29. package/dist/components/index.d.ts +54 -54
  30. package/dist/components/input/button.d.ts +12 -10
  31. package/dist/components/input/checkbox.d.ts +18 -17
  32. package/dist/components/input/dropdown.d.ts +15 -10
  33. package/dist/components/input/email.d.ts +9 -5
  34. package/dist/components/input/form.d.ts +13 -20
  35. package/dist/components/input/form_builder.d.ts +15 -12
  36. package/dist/components/input/index.d.ts +11 -1
  37. package/dist/components/input/input.d.ts +26 -1
  38. package/dist/components/input/input_list.d.ts +9 -2
  39. package/dist/components/input/password.d.ts +8 -4
  40. package/dist/components/input/search_input.d.ts +21 -36
  41. package/dist/components/input/search_input_list.d.ts +21 -35
  42. package/dist/components/input/select.d.ts +25 -1
  43. package/dist/components/input/select_vocabulary.d.ts +15 -1
  44. package/dist/components/input/textarea.d.ts +15 -1
  45. package/dist/components/input/upload.d.ts +9 -5
  46. package/dist/components/item.d.ts +23 -13
  47. package/dist/components/layout.d.ts +9 -5
  48. package/dist/components/login.d.ts +10 -7
  49. package/dist/components/modal.d.ts +24 -14
  50. package/dist/components/notallowed.d.ts +1 -1
  51. package/dist/components/notfound.d.ts +1 -1
  52. package/dist/components/pagination.d.ts +8 -6
  53. package/dist/components/panel/actions.d.ts +1 -1
  54. package/dist/components/panel/addons.d.ts +1 -1
  55. package/dist/components/panel/behaviors.d.ts +1 -1
  56. package/dist/components/panel/index.d.ts +4 -1
  57. package/dist/components/panel/items.d.ts +1 -1
  58. package/dist/components/panel/permissions.d.ts +7 -5
  59. package/dist/components/panel/permissions_prinperm.d.ts +17 -6
  60. package/dist/components/panel/permissions_prinrole.d.ts +17 -6
  61. package/dist/components/panel/permissions_roleperm.d.ts +17 -6
  62. package/dist/components/panel/properties.d.ts +1 -1
  63. package/dist/components/path.d.ts +1 -1
  64. package/dist/components/properties_view.d.ts +7 -2
  65. package/dist/components/search_labels.d.ts +5 -1
  66. package/dist/components/search_options_labels.d.ts +9 -1
  67. package/dist/components/search_vocabulary_labels.d.ts +6 -1
  68. package/dist/components/selected_items_actions.d.ts +17 -12
  69. package/dist/components/tabs.d.ts +10 -11
  70. package/dist/components/ui/delete.d.ts +8 -5
  71. package/dist/components/ui/icon.d.ts +7 -5
  72. package/dist/components/ui/index.d.ts +6 -6
  73. package/dist/components/ui/loading.d.ts +6 -3
  74. package/dist/components/ui/notification.d.ts +7 -4
  75. package/dist/components/ui/table.d.ts +8 -5
  76. package/dist/components/ui/tag.d.ts +9 -7
  77. package/dist/components/widgets/index.d.ts +1 -1
  78. package/dist/components/widgets/tags.d.ts +10 -8
  79. package/dist/contexts/index.d.ts +54 -13
  80. package/dist/forms/base.d.ts +12 -7
  81. package/dist/forms/required_fields.d.ts +12 -8
  82. package/dist/forms/users.d.ts +13 -5
  83. package/dist/hooks/useClickAway.d.ts +1 -1
  84. package/dist/hooks/useConfig.d.ts +17 -17
  85. package/dist/hooks/useCrudContext.d.ts +20 -1
  86. package/dist/hooks/useInput.d.ts +10 -7
  87. package/dist/hooks/useLocation.d.ts +2 -1
  88. package/dist/hooks/useMountedState.d.ts +1 -1
  89. package/dist/hooks/useRegistry.d.ts +61 -106
  90. package/dist/hooks/useRemoteField.d.ts +2 -1
  91. package/dist/hooks/useSetState.d.ts +1 -1
  92. package/dist/hooks/useVocabulary.d.ts +8 -1
  93. package/dist/index.d.ts +29 -29
  94. package/dist/lib/auth.d.ts +31 -31
  95. package/dist/lib/client.d.ts +59 -57
  96. package/dist/lib/helpers.d.ts +24 -24
  97. package/dist/lib/rest.d.ts +23 -22
  98. package/dist/lib/search.d.ts +2 -2
  99. package/dist/lib/search.test.d.ts +1 -1
  100. package/dist/lib/utils.d.ts +4 -3
  101. package/dist/lib/validators.d.ts +12 -12
  102. package/dist/locales/generic_messages.d.ts +370 -370
  103. package/dist/models/index.d.ts +17 -17
  104. package/dist/models/sharing.d.ts +12 -9
  105. package/dist/react-gmi.esm.js +3865 -3278
  106. package/dist/react-gmi.esm.js.map +1 -1
  107. package/dist/react-gmi.js +3864 -3276
  108. package/dist/react-gmi.js.map +1 -1
  109. package/dist/react-gmi.modern.js +3627 -3129
  110. package/dist/react-gmi.modern.js.map +1 -1
  111. package/dist/react-gmi.umd.js +3867 -3280
  112. package/dist/react-gmi.umd.js.map +1 -1
  113. package/dist/reducers/guillotina.d.ts +29 -19
  114. package/dist/setupTests.d.ts +1 -1
  115. package/dist/types/global.d.ts +8 -0
  116. package/dist/types/guillotina.d.ts +121 -0
  117. package/dist/views/application.d.ts +13 -17
  118. package/dist/views/base.d.ts +5 -1
  119. package/dist/views/container.d.ts +1 -1
  120. package/dist/views/folder.d.ts +1 -1
  121. package/dist/views/groups.d.ts +3 -3
  122. package/dist/views/item.d.ts +1 -1
  123. package/dist/views/users.d.ts +3 -3
  124. package/package.json +13 -6
  125. package/dist/hooks/useAsync.d.ts +0 -3
  126. package/dist/hooks/useAsyncFn.d.ts +0 -5
@@ -1,19 +1,29 @@
1
- export function guillotinaReducer(state: any, action: any): any;
2
- export namespace initialState {
3
- const path: string;
4
- const loading: boolean;
5
- const context: any;
6
- namespace flash {
7
- const message: any;
8
- const type: any;
9
- }
10
- namespace action {
11
- const action_1: any;
12
- export { action_1 as action };
13
- export const params: any;
14
- }
15
- const permissions: any;
16
- const errorStatus: any;
17
- const registry: {};
18
- const refresh: any;
19
- }
1
+ /// <reference types="react" />
2
+ import { ItemModel } from '../models';
3
+ import { IndexSignature } from '../types/global';
4
+ import { GuillotinaCommonObject } from '../types/guillotina';
5
+ export interface GuillotinaGlobalState {
6
+ path: string;
7
+ loading: boolean;
8
+ context: GuillotinaCommonObject;
9
+ flash: {
10
+ message: string;
11
+ type: string;
12
+ };
13
+ action: {
14
+ action: string;
15
+ params: IndexSignature;
16
+ };
17
+ permissions: IndexSignature;
18
+ errorStatus: number;
19
+ registry: IndexSignature;
20
+ refresh: number;
21
+ }
22
+ export declare const initialState: GuillotinaGlobalState;
23
+ export declare function guillotinaReducer(state: any, action: any): any;
24
+ export interface IColumn {
25
+ key: string;
26
+ label: string;
27
+ isSortable: string;
28
+ child: (model: ItemModel, link: () => void, search: string) => React.ReactElement;
29
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface LightFile {
2
+ filename: string;
3
+ data: ArrayBuffer | string;
4
+ 'content-type': string;
5
+ }
6
+ export interface IndexSignature<T = any> {
7
+ [key: string]: T;
8
+ }
@@ -0,0 +1,121 @@
1
+ import { IndexSignature } from './global';
2
+ type ItemsPropertyObject = {
3
+ '@id': string;
4
+ '@name': string;
5
+ '@type': string;
6
+ '@uid': string;
7
+ __behaviors__: string[];
8
+ '@static_behaviors': string[];
9
+ };
10
+ export interface GuillotinaSchema {
11
+ title: string;
12
+ $schema: string;
13
+ type: string;
14
+ required: string[];
15
+ definitions: Definitions;
16
+ properties: GuillotinaSchemaProperties;
17
+ }
18
+ export interface Definitions {
19
+ [key: string]: {
20
+ type: string;
21
+ properties: GuillotinaSchemaProperties;
22
+ required: string[];
23
+ title: string;
24
+ description: string;
25
+ };
26
+ }
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
+ export interface GuillotinaSchemaProperty {
41
+ type: string;
42
+ title: string;
43
+ widget?: string;
44
+ readonly?: boolean;
45
+ description?: string;
46
+ vocabularyName?: string;
47
+ vocabulary?: string[];
48
+ items?: GuillotinaItemsProperty;
49
+ properties?: GuillotinaSchemaProperties;
50
+ additionalProperties?: GuillotinaSchemaProperties;
51
+ typeNameQuery?: string;
52
+ labelProperty?: string;
53
+ }
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
+ export type GuillotinaFile = {
72
+ filename: string;
73
+ content_type: string;
74
+ extension: string;
75
+ size: number;
76
+ md5: string;
77
+ };
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
+ export interface GuillotinaVocabulary {
90
+ '@id': string;
91
+ items: GuillotinaVocabularyItem[];
92
+ items_total: number;
93
+ }
94
+ export interface GuillotinaVocabularyItem {
95
+ title: string;
96
+ token: string;
97
+ }
98
+ export interface GuillotinaSharing {
99
+ local: GuillotinaSharingMap;
100
+ inherit: GuillotinaSharingInheritItem[];
101
+ }
102
+ export interface GuillotinaSharingInheritItem extends GuillotinaSharingMap {
103
+ '@id': string;
104
+ }
105
+ export interface GuillotinaSharingMap {
106
+ roleperm: {
107
+ [key: string]: IndexSignature<string>;
108
+ };
109
+ prinperm: {
110
+ [key: string]: IndexSignature<string>;
111
+ };
112
+ prinrole: {
113
+ [key: string]: IndexSignature<string>;
114
+ };
115
+ }
116
+ export interface GuillotinaBehaviors {
117
+ static: string[];
118
+ dynamic: string[];
119
+ available: string[];
120
+ }
121
+ export {};
@@ -1,17 +1,13 @@
1
- export function ApplicationCtx(props: any): JSX.Element;
2
- export function DatabaseCtx({ state }: {
3
- state: any;
4
- }): JSX.Element;
5
- export function CreateContainer(props: any): JSX.Element;
6
- export namespace messages {
7
- namespace add_container {
8
- const id: string;
9
- const defaultMessage: string;
10
- }
11
- namespace container_created {
12
- const id_1: string;
13
- export { id_1 as id };
14
- const defaultMessage_1: string;
15
- export { defaultMessage_1 as defaultMessage };
16
- }
17
- }
1
+ export declare function ApplicationCtx(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function DatabaseCtx(): import("react/jsx-runtime").JSX.Element;
3
+ export declare function CreateContainer(): import("react/jsx-runtime").JSX.Element;
4
+ export declare const messages: {
5
+ add_container: {
6
+ id: string;
7
+ defaultMessage: string;
8
+ };
9
+ container_created: {
10
+ id: string;
11
+ defaultMessage: string;
12
+ };
13
+ };
@@ -1 +1,5 @@
1
- export function PanelNotImplemented(props: any): JSX.Element;
1
+ interface Props {
2
+ title: string;
3
+ }
4
+ export declare function PanelNotImplemented(props: Props): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1 +1 @@
1
- export function ContainerCtx(props: any): JSX.Element;
1
+ export declare function ContainerCtx(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export function FolderCtx(props: any): JSX.Element;
1
+ export declare function FolderCtx(props: any): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
- export function GroupToolbar(): JSX.Element;
2
- export function GroupsCtx(props: any): JSX.Element;
3
- export function GroupCtx(): JSX.Element;
1
+ export declare function GroupToolbar(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function GroupsCtx(props: any): import("react/jsx-runtime").JSX.Element;
3
+ export declare function GroupCtx(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export function ItemCtx(props: any): JSX.Element;
1
+ export declare function ItemCtx(props: any): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
- export function UsersToolbar(): JSX.Element;
2
- export function UsersCtx(props: any): JSX.Element;
3
- export function UserCtx(): JSX.Element;
1
+ export declare function UsersToolbar(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function UsersCtx(props: any): import("react/jsx-runtime").JSX.Element;
3
+ export declare function UserCtx(): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.27.0",
2
+ "version": "0.28.1",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git@github.com:guillotinaweb/guillotina_react.git"
@@ -7,7 +7,7 @@
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
- "source": "./src/guillo-gmi/index.js",
10
+ "source": "./src/guillo-gmi/index.ts",
11
11
  "main": "./dist/react-gmi.js",
12
12
  "exports": "./dist/react-gmi.modern.js",
13
13
  "types": "./dist/index.d.ts",
@@ -31,32 +31,39 @@
31
31
  "@babel/cli": "7.12.10",
32
32
  "@babel/core": "7.12.10",
33
33
  "@formatjs/cli": "^6.2.4",
34
+ "@formatjs/ts-transformer": "^3.13.11",
34
35
  "@testing-library/jest-dom": "5.11.6",
35
36
  "@testing-library/react": "11.2.2",
36
37
  "@testing-library/user-event": "12.6.0",
38
+ "@typescript-eslint/eslint-plugin": "^6.18.1",
39
+ "@typescript-eslint/parser": "^6.18.1",
37
40
  "babel-plugin-formatjs": "^10.5.10",
41
+ "eslint": "^8.56.0",
42
+ "eslint-plugin-react": "^7.33.2",
38
43
  "husky": "4.3.6",
39
44
  "microbundle": "0.13.0",
40
45
  "prettier": "2.2.1",
41
46
  "sass": "1.69.5",
42
47
  "serialize-javascript": "5.0.1",
43
- "vitest": "^0.34.6"
48
+ "typescript": "^5.3.3",
49
+ "vitest": "^0.34.6",
50
+ "@types/react-beautiful-dnd": "13.1.8"
44
51
  },
45
52
  "scripts": {
46
- "format": "prettier --write \"src/**/*.js\"",
53
+ "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
47
54
  "format:tests": "prettier --write \"e2e/cypress/**/*.js\"",
48
55
  "format:check": "prettier --check \"src/**/*.js\"",
49
56
  "build": "yarn build:js && yarn build:css",
50
57
  "build:js": "rm -rf ./dist && microbundle --jsx React.createElement --no-compress --sourcemap",
51
- "build:css": "rm -rf ./dist/css && mkdir ./dist/css && sass ./src/guillo-gmi/scss/styles.sass ./dist/css/style.css",
58
+ "build:css": "rm -rf ./dist/css && mkdir -p ./dist/css && sass ./src/guillo-gmi/scss/styles.sass ./dist/css/style.css",
52
59
  "prepublish": "yarn build",
53
60
  "test": "vitest run",
61
+ "lint": "eslint src",
54
62
  "intl-extract": "formatjs extract 'src/**/*.js' --out-file src/guillo-gmi/locales/en.json --id-interpolation-pattern '[sha512:contenthash:base64:6]'",
55
63
  "intl-compile-en": "formatjs compile src/guillo-gmi/locales/en.json --ast --out-file src/guillo-gmi/locales/compiled/en.json",
56
64
  "intl-compile-ca": "formatjs compile src/guillo-gmi/locales/ca.json --ast --out-file src/guillo-gmi/locales/compiled/ca.json",
57
65
  "intl-compile-es": "formatjs compile src/guillo-gmi/locales/es.json --ast --out-file src/guillo-gmi/locales/compiled/es.json",
58
66
  "intl-compile": "npm run intl-compile-en && npm run intl-compile-es && npm run intl-compile-ca"
59
-
60
67
  },
61
68
  "eslintConfig": {
62
69
  "extends": "react-app"
@@ -1,3 +0,0 @@
1
- export default function useAsync(fn: any, deps?: any[]): {
2
- loading: boolean;
3
- } | ((...args: any[]) => any);
@@ -1,5 +0,0 @@
1
- export default function useAsyncFn(fn: any, deps?: any[], initialState?: {
2
- loading: boolean;
3
- }): ({
4
- loading: boolean;
5
- } | ((...args: any[]) => any))[];