@inventreedb/ui 0.0.2 → 0.0.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.
- package/CHANGELOG.md +9 -1
- package/README.md +18 -7
- package/dist/.vite/manifest.json +125 -0
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/lexer.js +5 -0
- package/dist/_virtual/lexer.js.map +1 -0
- package/dist/_virtual/moo.js +5 -0
- package/dist/_virtual/moo.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/parser2.js +5 -0
- package/dist/_virtual/parser2.js.map +1 -0
- package/dist/enums/ModelInformation.d.ts +20 -0
- package/dist/enums/ModelInformation.js +590 -0
- package/dist/enums/ModelInformation.js.map +1 -0
- package/dist/functions/Events.d.ts +1 -0
- package/dist/functions/Events.js +10 -0
- package/dist/functions/Events.js.map +1 -0
- package/dist/functions/Navigation.d.ts +8 -0
- package/dist/functions/Navigation.js +38 -0
- package/dist/functions/Navigation.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@lingui/core/dist/index.js +405 -0
- package/dist/node_modules/@lingui/core/dist/index.js.map +1 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js +326 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js +74 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js +223 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js.map +1 -0
- package/dist/node_modules/moo/moo.js +539 -0
- package/dist/node_modules/moo/moo.js.map +1 -0
- package/dist/node_modules/unraw/dist/errors.js +39 -0
- package/dist/node_modules/unraw/dist/errors.js.map +1 -0
- package/dist/node_modules/unraw/dist/index.js +112 -0
- package/dist/node_modules/unraw/dist/index.js.map +1 -0
- package/dist/types/Icons.d.ts +5 -0
- package/dist/types/Plugins.js +1 -1
- package/lib/enums/ModelInformation.tsx +279 -0
- package/lib/functions/Events.tsx +6 -0
- package/lib/functions/Navigation.tsx +58 -0
- package/lib/index.ts +6 -0
- package/lib/types/Icons.tsx +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,4 +4,12 @@ This file contains historical changelog information for the InvenTree UI compone
|
|
|
4
4
|
|
|
5
5
|
### 1.0.0 - April 2025
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Published the first version of the UI components API. This allows external plugins to hook into the InvenTree user interface, and provides global access to the following objects:
|
|
8
|
+
|
|
9
|
+
- `window.React`: The core `react` library running on the UI
|
|
10
|
+
- `window.ReactDOM`: The `react-dom` library
|
|
11
|
+
- `window.ReactDOMClient`: The `react-dom/client` library
|
|
12
|
+
- `window.MantineCore`: The `@mantine/core` library
|
|
13
|
+
- `window.MantineNotifications`: The `@mantine/notifications` library
|
|
14
|
+
|
|
15
|
+
All of these components can be "externalized" in the plugin build step.
|
package/README.md
CHANGED
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
User Interface (UI) elements for the [InvenTree](https://inventree.org) web interface.
|
|
4
4
|
|
|
5
|
-
This package provides a public interface allowing plugins to hook into core UI functionality.
|
|
6
5
|
|
|
7
|
-
###
|
|
8
|
-
|
|
9
|
-
...
|
|
6
|
+
### Description
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
This package provides a public interface allowing plugins to hook into core UI functionality. In particular, it defines a set of interface types provided by the InvenTree user interface, to be used by a custom plugin to implement some custom UI feature.
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
This library is intended to be used for creating plugins - any other use is outside of its scope and is not supported.
|
|
14
11
|
|
|
15
12
|
### Plugin Creator
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
This library is intended to be used with the [InvenTree Plugin Creator](https://github.com/inventree/plugin-creator). Read the documentation for the plugin creation tool for more information.
|
|
15
|
+
|
|
16
|
+
The plugin creation tool uses the types provided in this package at build time, but it is intended that most of the major packages are *externalized* - as these are provided as global objects by the core InvenTree UI code.
|
|
17
|
+
|
|
18
|
+
### Installation
|
|
19
|
+
|
|
20
|
+
This should be installed as a part of the plugin creator tool. If you need to install it manually, e.g. using `npm`:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm i @inventreedb/ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Versioning
|
|
27
|
+
|
|
28
|
+
Each change to the plugin API will be described in the [CHANGELOG file](./CHANGELOG.md).
|
package/dist/.vite/manifest.json
CHANGED
|
@@ -1,9 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/lexer.js?commonjs-exports": {
|
|
3
|
+
"file": "_virtual/lexer.js",
|
|
4
|
+
"name": "_virtual/lexer",
|
|
5
|
+
"src": "/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/lexer.js?commonjs-exports"
|
|
6
|
+
},
|
|
7
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-es-import": {
|
|
8
|
+
"file": "_virtual/parser.js",
|
|
9
|
+
"name": "_virtual/parser",
|
|
10
|
+
"src": "/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-es-import",
|
|
11
|
+
"imports": [
|
|
12
|
+
"node_modules/@messageformat/parser/lib/parser.js"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-exports": {
|
|
16
|
+
"file": "_virtual/parser2.js",
|
|
17
|
+
"name": "_virtual/parser",
|
|
18
|
+
"src": "/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-exports"
|
|
19
|
+
},
|
|
20
|
+
"/home/inventree/src/frontend/node_modules/moo/moo.js?commonjs-module": {
|
|
21
|
+
"file": "_virtual/moo.js",
|
|
22
|
+
"name": "_virtual/moo",
|
|
23
|
+
"src": "/home/inventree/src/frontend/node_modules/moo/moo.js?commonjs-module"
|
|
24
|
+
},
|
|
25
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/errors.js?commonjs-exports": {
|
|
26
|
+
"file": "_virtual/errors.js",
|
|
27
|
+
"name": "_virtual/errors",
|
|
28
|
+
"src": "/home/inventree/src/frontend/node_modules/unraw/dist/errors.js?commonjs-exports"
|
|
29
|
+
},
|
|
30
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-es-import": {
|
|
31
|
+
"file": "_virtual/index.js",
|
|
32
|
+
"name": "_virtual/index",
|
|
33
|
+
"src": "/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-es-import",
|
|
34
|
+
"imports": [
|
|
35
|
+
"node_modules/unraw/dist/index.js"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-exports": {
|
|
39
|
+
"file": "_virtual/index2.js",
|
|
40
|
+
"name": "_virtual/index",
|
|
41
|
+
"src": "/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-exports"
|
|
42
|
+
},
|
|
2
43
|
"lib/enums/ApiEndpoints.tsx": {
|
|
3
44
|
"file": "enums/ApiEndpoints.js",
|
|
4
45
|
"name": "enums/ApiEndpoints",
|
|
5
46
|
"src": "lib/enums/ApiEndpoints.tsx"
|
|
6
47
|
},
|
|
48
|
+
"lib/enums/ModelInformation.tsx": {
|
|
49
|
+
"file": "enums/ModelInformation.js",
|
|
50
|
+
"name": "enums/ModelInformation",
|
|
51
|
+
"src": "lib/enums/ModelInformation.tsx",
|
|
52
|
+
"imports": [
|
|
53
|
+
"node_modules/@lingui/core/dist/index.mjs",
|
|
54
|
+
"lib/enums/ApiEndpoints.tsx"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
7
57
|
"lib/enums/ModelType.tsx": {
|
|
8
58
|
"file": "enums/ModelType.js",
|
|
9
59
|
"name": "enums/ModelType",
|
|
@@ -14,6 +64,20 @@
|
|
|
14
64
|
"name": "functions/Api",
|
|
15
65
|
"src": "lib/functions/Api.tsx"
|
|
16
66
|
},
|
|
67
|
+
"lib/functions/Events.tsx": {
|
|
68
|
+
"file": "functions/Events.js",
|
|
69
|
+
"name": "functions/Events",
|
|
70
|
+
"src": "lib/functions/Events.tsx"
|
|
71
|
+
},
|
|
72
|
+
"lib/functions/Navigation.tsx": {
|
|
73
|
+
"file": "functions/Navigation.js",
|
|
74
|
+
"name": "functions/Navigation",
|
|
75
|
+
"src": "lib/functions/Navigation.tsx",
|
|
76
|
+
"imports": [
|
|
77
|
+
"lib/enums/ModelInformation.tsx",
|
|
78
|
+
"lib/functions/Events.tsx"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
17
81
|
"lib/functions/Plugins.tsx": {
|
|
18
82
|
"file": "functions/Plugins.js",
|
|
19
83
|
"name": "functions/Plugins",
|
|
@@ -32,6 +96,7 @@
|
|
|
32
96
|
"lib/enums/ApiEndpoints.tsx",
|
|
33
97
|
"lib/enums/ModelType.tsx",
|
|
34
98
|
"lib/functions/Api.tsx",
|
|
99
|
+
"lib/functions/Navigation.tsx",
|
|
35
100
|
"lib/functions/Plugins.tsx"
|
|
36
101
|
]
|
|
37
102
|
},
|
|
@@ -39,5 +104,65 @@
|
|
|
39
104
|
"file": "types/Plugins.js",
|
|
40
105
|
"name": "types/Plugins",
|
|
41
106
|
"src": "lib/types/Plugins.tsx"
|
|
107
|
+
},
|
|
108
|
+
"node_modules/@lingui/core/dist/index.mjs": {
|
|
109
|
+
"file": "node_modules/@lingui/core/dist/index.js",
|
|
110
|
+
"name": "node_modules/@lingui/core/dist/index",
|
|
111
|
+
"src": "node_modules/@lingui/core/dist/index.mjs",
|
|
112
|
+
"imports": [
|
|
113
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-es-import",
|
|
114
|
+
"node_modules/@lingui/message-utils/dist/compileMessage.mjs"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"node_modules/@lingui/message-utils/dist/compileMessage.mjs": {
|
|
118
|
+
"file": "node_modules/@lingui/message-utils/dist/compileMessage.js",
|
|
119
|
+
"name": "node_modules/@lingui/message-utils/dist/compileMessage",
|
|
120
|
+
"src": "node_modules/@lingui/message-utils/dist/compileMessage.mjs",
|
|
121
|
+
"imports": [
|
|
122
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-es-import"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"node_modules/@messageformat/parser/lib/lexer.js": {
|
|
126
|
+
"file": "node_modules/@messageformat/parser/lib/lexer.js",
|
|
127
|
+
"name": "node_modules/@messageformat/parser/lib/lexer",
|
|
128
|
+
"src": "node_modules/@messageformat/parser/lib/lexer.js",
|
|
129
|
+
"imports": [
|
|
130
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/lexer.js?commonjs-exports",
|
|
131
|
+
"node_modules/moo/moo.js"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"node_modules/@messageformat/parser/lib/parser.js": {
|
|
135
|
+
"file": "node_modules/@messageformat/parser/lib/parser.js",
|
|
136
|
+
"name": "node_modules/@messageformat/parser/lib/parser",
|
|
137
|
+
"src": "node_modules/@messageformat/parser/lib/parser.js",
|
|
138
|
+
"imports": [
|
|
139
|
+
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-exports",
|
|
140
|
+
"node_modules/@messageformat/parser/lib/lexer.js"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"node_modules/moo/moo.js": {
|
|
144
|
+
"file": "node_modules/moo/moo.js",
|
|
145
|
+
"name": "node_modules/moo/moo",
|
|
146
|
+
"src": "node_modules/moo/moo.js",
|
|
147
|
+
"imports": [
|
|
148
|
+
"/home/inventree/src/frontend/node_modules/moo/moo.js?commonjs-module"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"node_modules/unraw/dist/errors.js": {
|
|
152
|
+
"file": "node_modules/unraw/dist/errors.js",
|
|
153
|
+
"name": "node_modules/unraw/dist/errors",
|
|
154
|
+
"src": "node_modules/unraw/dist/errors.js",
|
|
155
|
+
"imports": [
|
|
156
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/errors.js?commonjs-exports"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"node_modules/unraw/dist/index.js": {
|
|
160
|
+
"file": "node_modules/unraw/dist/index.js",
|
|
161
|
+
"name": "node_modules/unraw/dist/index",
|
|
162
|
+
"src": "node_modules/unraw/dist/index.js",
|
|
163
|
+
"imports": [
|
|
164
|
+
"/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-exports",
|
|
165
|
+
"node_modules/unraw/dist/errors.js"
|
|
166
|
+
]
|
|
42
167
|
}
|
|
43
168
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moo.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InvenTreeIconType } from '../types/Icons';
|
|
2
|
+
import { ApiEndpoints } from './ApiEndpoints';
|
|
3
|
+
import { ModelType } from './ModelType';
|
|
4
|
+
export interface ModelInformationInterface {
|
|
5
|
+
label: string;
|
|
6
|
+
label_multiple: string;
|
|
7
|
+
url_overview?: string;
|
|
8
|
+
url_detail?: string;
|
|
9
|
+
api_endpoint: ApiEndpoints;
|
|
10
|
+
admin_url?: string;
|
|
11
|
+
icon: keyof InvenTreeIconType;
|
|
12
|
+
}
|
|
13
|
+
export interface TranslatableModelInformationInterface extends Omit<ModelInformationInterface, 'label' | 'label_multiple'> {
|
|
14
|
+
label: () => string;
|
|
15
|
+
label_multiple: () => string;
|
|
16
|
+
}
|
|
17
|
+
export type ModelDict = {
|
|
18
|
+
[key in keyof typeof ModelType]: TranslatableModelInformationInterface;
|
|
19
|
+
};
|
|
20
|
+
export declare const ModelInformationDict: ModelDict;
|