@inventreedb/ui 0.8.2 → 0.10.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.
- package/CHANGELOG.md +10 -0
- package/dist/.vite/manifest.json +44 -11
- package/dist/components/RowActions.js +4 -4
- package/dist/hooks/MonitorBackgroundTask.d.ts +20 -0
- package/dist/hooks/MonitorBackgroundTask.js +77 -0
- package/dist/hooks/MonitorBackgroundTask.js.map +1 -0
- package/dist/hooks/MonitorDataOutput.d.ts +6 -5
- package/dist/hooks/MonitorDataOutput.js +19 -25
- package/dist/hooks/MonitorDataOutput.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js.map +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
- package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/environmentManager.js +22 -0
- package/dist/node_modules/@tanstack/query-core/build/modern/environmentManager.js.map +1 -0
- package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js +1 -2
- package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js +2 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js +1 -2
- package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js +25 -18
- package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +70 -0
- package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -0
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js +3 -2
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +3 -2
- package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +7 -5
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
- package/dist/types/Forms.d.ts +2 -0
- package/dist/types/Plugins.d.ts +11 -0
- package/dist/types/Plugins.js +3 -3
- package/dist/types/Plugins.js.map +1 -1
- package/lib/hooks/MonitorBackgroundTask.tsx +118 -0
- package/lib/hooks/MonitorDataOutput.tsx +25 -29
- package/lib/index.ts +8 -1
- package/lib/types/Forms.tsx +2 -0
- package/lib/types/Plugins.tsx +10 -0
- package/package.json +31 -28
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
This file contains historical changelog information for the InvenTree UI components library.
|
|
4
4
|
|
|
5
|
+
### 0.10.0 - April 2026
|
|
6
|
+
|
|
7
|
+
Exposes the `importer` object to the plugin context, allow plugins to initialize a data import session using the data importer wizard.
|
|
8
|
+
|
|
9
|
+
### 0.9.0 - March 2026
|
|
10
|
+
|
|
11
|
+
Exposes the `useMonitorBackgroundTask` hook, which allows plugins to monitor the status of a background task and display notifications when the task is complete. This is useful for plugins that offload long-running tasks to the background and want to provide feedback to the user when the task is complete.
|
|
12
|
+
|
|
13
|
+
Renames the `monitorDataOutput` hook to `useMonitorDataOutput` to better reflect the fact that this is a React hook, and to provide a more consistent naming convention for hooks in the library.
|
|
14
|
+
|
|
5
15
|
### 0.8.2 - March 2026
|
|
6
16
|
|
|
7
17
|
Bug fixes for the `monitorDataOutput` hook - https://github.com/inventree/InvenTree/pull/11458
|
package/dist/.vite/manifest.json
CHANGED
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"/home/inventree/src/frontend/node_modules/react/jsx-runtime.js?commonjs-es-import",
|
|
67
67
|
"lib/functions/Events.tsx",
|
|
68
68
|
"lib/functions/Navigation.tsx",
|
|
69
|
-
"node_modules/@tabler/icons-react/dist/esm/icons/
|
|
69
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs",
|
|
70
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.mjs",
|
|
71
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs",
|
|
70
72
|
"node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs",
|
|
71
73
|
"node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs",
|
|
72
|
-
"node_modules/@tabler/icons-react/dist/esm/icons/
|
|
73
|
-
"node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.mjs",
|
|
74
|
-
"node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs"
|
|
74
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.mjs"
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
"lib/components/SearchInput.tsx": {
|
|
@@ -153,6 +153,21 @@
|
|
|
153
153
|
"lib/types/Plugins.tsx"
|
|
154
154
|
]
|
|
155
155
|
},
|
|
156
|
+
"lib/hooks/MonitorBackgroundTask.tsx": {
|
|
157
|
+
"file": "hooks/MonitorBackgroundTask.js",
|
|
158
|
+
"name": "hooks/MonitorBackgroundTask",
|
|
159
|
+
"src": "lib/hooks/MonitorBackgroundTask.tsx",
|
|
160
|
+
"imports": [
|
|
161
|
+
"/home/inventree/src/frontend/node_modules/react/jsx-runtime.js?commonjs-es-import",
|
|
162
|
+
"node_modules/@tanstack/react-query/build/modern/useQuery.js",
|
|
163
|
+
"lib/enums/ApiEndpoints.tsx",
|
|
164
|
+
"lib/functions/Api.tsx",
|
|
165
|
+
"node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.mjs",
|
|
166
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs",
|
|
167
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.mjs",
|
|
168
|
+
"node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.mjs"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
156
171
|
"lib/hooks/MonitorDataOutput.tsx": {
|
|
157
172
|
"file": "hooks/MonitorDataOutput.js",
|
|
158
173
|
"name": "hooks/MonitorDataOutput",
|
|
@@ -189,7 +204,8 @@
|
|
|
189
204
|
"lib/components/YesNoButton.tsx",
|
|
190
205
|
"lib/components/SearchInput.tsx",
|
|
191
206
|
"lib/components/RowActions.tsx",
|
|
192
|
-
"lib/hooks/MonitorDataOutput.tsx"
|
|
207
|
+
"lib/hooks/MonitorDataOutput.tsx",
|
|
208
|
+
"lib/hooks/MonitorBackgroundTask.tsx"
|
|
193
209
|
]
|
|
194
210
|
},
|
|
195
211
|
"lib/types/Plugins.tsx": {
|
|
@@ -300,27 +316,36 @@
|
|
|
300
316
|
"node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs"
|
|
301
317
|
]
|
|
302
318
|
},
|
|
319
|
+
"node_modules/@tanstack/query-core/build/modern/environmentManager.js": {
|
|
320
|
+
"file": "node_modules/@tanstack/query-core/build/modern/environmentManager.js",
|
|
321
|
+
"name": "node_modules/@tanstack/query-core/build/modern/environmentManager",
|
|
322
|
+
"src": "node_modules/@tanstack/query-core/build/modern/environmentManager.js",
|
|
323
|
+
"imports": [
|
|
324
|
+
"node_modules/@tanstack/query-core/build/modern/utils.js"
|
|
325
|
+
]
|
|
326
|
+
},
|
|
303
327
|
"node_modules/@tanstack/query-core/build/modern/focusManager.js": {
|
|
304
328
|
"file": "node_modules/@tanstack/query-core/build/modern/focusManager.js",
|
|
305
329
|
"name": "node_modules/@tanstack/query-core/build/modern/focusManager",
|
|
306
330
|
"src": "node_modules/@tanstack/query-core/build/modern/focusManager.js",
|
|
307
331
|
"imports": [
|
|
308
|
-
"node_modules/@tanstack/query-core/build/modern/subscribable.js"
|
|
309
|
-
"node_modules/@tanstack/query-core/build/modern/utils.js"
|
|
332
|
+
"node_modules/@tanstack/query-core/build/modern/subscribable.js"
|
|
310
333
|
]
|
|
311
334
|
},
|
|
312
335
|
"node_modules/@tanstack/query-core/build/modern/notifyManager.js": {
|
|
313
336
|
"file": "node_modules/@tanstack/query-core/build/modern/notifyManager.js",
|
|
314
337
|
"name": "node_modules/@tanstack/query-core/build/modern/notifyManager",
|
|
315
|
-
"src": "node_modules/@tanstack/query-core/build/modern/notifyManager.js"
|
|
338
|
+
"src": "node_modules/@tanstack/query-core/build/modern/notifyManager.js",
|
|
339
|
+
"imports": [
|
|
340
|
+
"node_modules/@tanstack/query-core/build/modern/timeoutManager.js"
|
|
341
|
+
]
|
|
316
342
|
},
|
|
317
343
|
"node_modules/@tanstack/query-core/build/modern/onlineManager.js": {
|
|
318
344
|
"file": "node_modules/@tanstack/query-core/build/modern/onlineManager.js",
|
|
319
345
|
"name": "node_modules/@tanstack/query-core/build/modern/onlineManager",
|
|
320
346
|
"src": "node_modules/@tanstack/query-core/build/modern/onlineManager.js",
|
|
321
347
|
"imports": [
|
|
322
|
-
"node_modules/@tanstack/query-core/build/modern/subscribable.js"
|
|
323
|
-
"node_modules/@tanstack/query-core/build/modern/utils.js"
|
|
348
|
+
"node_modules/@tanstack/query-core/build/modern/subscribable.js"
|
|
324
349
|
]
|
|
325
350
|
},
|
|
326
351
|
"node_modules/@tanstack/query-core/build/modern/query.js": {
|
|
@@ -337,11 +362,13 @@
|
|
|
337
362
|
"src": "node_modules/@tanstack/query-core/build/modern/queryObserver.js",
|
|
338
363
|
"imports": [
|
|
339
364
|
"node_modules/@tanstack/query-core/build/modern/focusManager.js",
|
|
365
|
+
"node_modules/@tanstack/query-core/build/modern/environmentManager.js",
|
|
340
366
|
"node_modules/@tanstack/query-core/build/modern/notifyManager.js",
|
|
341
367
|
"node_modules/@tanstack/query-core/build/modern/query.js",
|
|
342
368
|
"node_modules/@tanstack/query-core/build/modern/subscribable.js",
|
|
343
369
|
"node_modules/@tanstack/query-core/build/modern/thenable.js",
|
|
344
|
-
"node_modules/@tanstack/query-core/build/modern/utils.js"
|
|
370
|
+
"node_modules/@tanstack/query-core/build/modern/utils.js",
|
|
371
|
+
"node_modules/@tanstack/query-core/build/modern/timeoutManager.js"
|
|
345
372
|
]
|
|
346
373
|
},
|
|
347
374
|
"node_modules/@tanstack/query-core/build/modern/retryer.js": {
|
|
@@ -362,6 +389,11 @@
|
|
|
362
389
|
"name": "node_modules/@tanstack/query-core/build/modern/thenable",
|
|
363
390
|
"src": "node_modules/@tanstack/query-core/build/modern/thenable.js"
|
|
364
391
|
},
|
|
392
|
+
"node_modules/@tanstack/query-core/build/modern/timeoutManager.js": {
|
|
393
|
+
"file": "node_modules/@tanstack/query-core/build/modern/timeoutManager.js",
|
|
394
|
+
"name": "node_modules/@tanstack/query-core/build/modern/timeoutManager",
|
|
395
|
+
"src": "node_modules/@tanstack/query-core/build/modern/timeoutManager.js"
|
|
396
|
+
},
|
|
365
397
|
"node_modules/@tanstack/query-core/build/modern/utils.js": {
|
|
366
398
|
"file": "node_modules/@tanstack/query-core/build/modern/utils.js",
|
|
367
399
|
"name": "node_modules/@tanstack/query-core/build/modern/utils",
|
|
@@ -406,6 +438,7 @@
|
|
|
406
438
|
"name": "node_modules/@tanstack/react-query/build/modern/useBaseQuery",
|
|
407
439
|
"src": "node_modules/@tanstack/react-query/build/modern/useBaseQuery.js",
|
|
408
440
|
"imports": [
|
|
441
|
+
"node_modules/@tanstack/query-core/build/modern/environmentManager.js",
|
|
409
442
|
"node_modules/@tanstack/query-core/build/modern/notifyManager.js",
|
|
410
443
|
"node_modules/@tanstack/query-core/build/modern/utils.js",
|
|
411
444
|
"node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import { cancelEvent } from "../functions/Events.js";
|
|
3
3
|
import { getDetailUrl, navigateToLink } from "../functions/Navigation.js";
|
|
4
|
-
import
|
|
4
|
+
import IconDots from "../node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js";
|
|
5
|
+
import IconCircleX from "../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js";
|
|
6
|
+
import IconTrash from "../node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js";
|
|
5
7
|
import IconCopy from "../node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js";
|
|
6
8
|
import IconEdit from "../node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js";
|
|
7
|
-
import
|
|
8
|
-
import IconCircleX from "../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js";
|
|
9
|
-
import IconDots from "../node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js";
|
|
9
|
+
import IconArrowRight from "../node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js";
|
|
10
10
|
const _i18n = window["LinguiCore"].i18n;
|
|
11
11
|
const ActionIcon = window["MantineCore"].ActionIcon;
|
|
12
12
|
const Menu = window["MantineCore"].Menu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
export type MonitorBackgroundTaskProps = {
|
|
4
|
+
api: AxiosInstance;
|
|
5
|
+
queryClient?: QueryClient;
|
|
6
|
+
title?: string;
|
|
7
|
+
message: string;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
successMessage?: string;
|
|
10
|
+
failureMessage?: string;
|
|
11
|
+
taskId?: string;
|
|
12
|
+
onSuccess?: () => void;
|
|
13
|
+
onFailure?: () => void;
|
|
14
|
+
onComplete?: () => void;
|
|
15
|
+
onError?: (error: Error) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Hook for monitoring a background task running on the server
|
|
19
|
+
*/
|
|
20
|
+
export default function useMonitorBackgroundTask(props: MonitorBackgroundTaskProps): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useQuery } from "../node_modules/@tanstack/react-query/build/modern/useQuery.js";
|
|
3
|
+
import { ApiEndpoints } from "../enums/ApiEndpoints.js";
|
|
4
|
+
import { apiUrl } from "../functions/Api.js";
|
|
5
|
+
import { useDocumentVisibility } from "../node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.js";
|
|
6
|
+
import IconCircleCheck from "../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js";
|
|
7
|
+
import IconCircleX from "../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js";
|
|
8
|
+
import IconExclamationCircle from "../node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js";
|
|
9
|
+
const notifications = window["MantineNotifications"].notifications;
|
|
10
|
+
const showNotification = window["MantineNotifications"].showNotification;
|
|
11
|
+
const useEffect = window["React"].useEffect;
|
|
12
|
+
const useState = window["React"].useState;
|
|
13
|
+
function useMonitorBackgroundTask(props) {
|
|
14
|
+
const visibility = useDocumentVisibility();
|
|
15
|
+
const [tracking, setTracking] = useState(false);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!!props.taskId) {
|
|
18
|
+
setTracking(true);
|
|
19
|
+
showNotification({
|
|
20
|
+
id: `background-task-${props.taskId}`,
|
|
21
|
+
title: props.title,
|
|
22
|
+
message: props.message,
|
|
23
|
+
loading: true,
|
|
24
|
+
autoClose: false,
|
|
25
|
+
withCloseButton: false
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
setTracking(false);
|
|
29
|
+
}
|
|
30
|
+
}, [props.taskId]);
|
|
31
|
+
useQuery({
|
|
32
|
+
enabled: !!props.taskId && tracking && visibility === "visible",
|
|
33
|
+
refetchInterval: 500,
|
|
34
|
+
queryKey: ["background-task", props.taskId],
|
|
35
|
+
queryFn: () => props.api.get(apiUrl(ApiEndpoints.task_overview, props.taskId)).then((response) => {
|
|
36
|
+
const data = response?.data ?? {};
|
|
37
|
+
if (data.complete) {
|
|
38
|
+
setTracking(false);
|
|
39
|
+
props.onComplete?.();
|
|
40
|
+
notifications.update({
|
|
41
|
+
id: `background-task-${props.taskId}`,
|
|
42
|
+
title: props.title,
|
|
43
|
+
loading: false,
|
|
44
|
+
color: data.success ? "green" : "red",
|
|
45
|
+
message: response.data?.success ? props.successMessage ?? props.message : props.failureMessage ?? props.message,
|
|
46
|
+
icon: response.data?.success ? /* @__PURE__ */ jsxRuntimeExports.jsx(IconCircleCheck, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(IconCircleX, {}),
|
|
47
|
+
autoClose: 1e3,
|
|
48
|
+
withCloseButton: true
|
|
49
|
+
});
|
|
50
|
+
if (data.success) {
|
|
51
|
+
props.onSuccess?.();
|
|
52
|
+
} else {
|
|
53
|
+
props.onFailure?.();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return response;
|
|
57
|
+
}).catch((error) => {
|
|
58
|
+
console.error(`Error fetching background task status for task ${props.taskId}:`, error);
|
|
59
|
+
setTracking(false);
|
|
60
|
+
props.onError?.(error);
|
|
61
|
+
notifications.update({
|
|
62
|
+
id: `background-task-${props.taskId}`,
|
|
63
|
+
title: props.title,
|
|
64
|
+
loading: false,
|
|
65
|
+
color: "red",
|
|
66
|
+
message: props.errorMessage ?? props.message,
|
|
67
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconExclamationCircle, { color: "red" }),
|
|
68
|
+
autoClose: 5e3,
|
|
69
|
+
withCloseButton: true
|
|
70
|
+
});
|
|
71
|
+
})
|
|
72
|
+
}, props.queryClient);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
useMonitorBackgroundTask as default
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=MonitorBackgroundTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonitorBackgroundTask.js","sources":["../../lib/hooks/MonitorBackgroundTask.tsx"],"sourcesContent":["import { useDocumentVisibility } from '@mantine/hooks';\nimport { notifications, showNotification } from '@mantine/notifications';\nimport {\n IconCircleCheck,\n IconCircleX,\n IconExclamationCircle\n} from '@tabler/icons-react';\nimport { type QueryClient, useQuery } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport { useEffect, useState } from 'react';\nimport { ApiEndpoints } from '../enums/ApiEndpoints';\nimport { apiUrl } from '../functions/Api';\n\nexport type MonitorBackgroundTaskProps = {\n api: AxiosInstance;\n queryClient?: QueryClient;\n title?: string;\n message: string;\n errorMessage?: string;\n successMessage?: string;\n failureMessage?: string;\n taskId?: string;\n onSuccess?: () => void;\n onFailure?: () => void;\n onComplete?: () => void;\n onError?: (error: Error) => void;\n};\n\n/**\n * Hook for monitoring a background task running on the server\n */\nexport default function useMonitorBackgroundTask(\n props: MonitorBackgroundTaskProps\n) {\n const visibility = useDocumentVisibility();\n\n const [tracking, setTracking] = useState<boolean>(false);\n\n useEffect(() => {\n if (!!props.taskId) {\n setTracking(true);\n showNotification({\n id: `background-task-${props.taskId}`,\n title: props.title,\n message: props.message,\n loading: true,\n autoClose: false,\n withCloseButton: false\n });\n } else {\n setTracking(false);\n }\n }, [props.taskId]);\n\n useQuery(\n {\n enabled: !!props.taskId && tracking && visibility === 'visible',\n refetchInterval: 500,\n queryKey: ['background-task', props.taskId],\n queryFn: () =>\n props.api\n .get(apiUrl(ApiEndpoints.task_overview, props.taskId))\n .then((response) => {\n const data = response?.data ?? {};\n\n if (data.complete) {\n setTracking(false);\n props.onComplete?.();\n\n notifications.update({\n id: `background-task-${props.taskId}`,\n title: props.title,\n loading: false,\n color: data.success ? 'green' : 'red',\n message: response.data?.success\n ? (props.successMessage ?? props.message)\n : (props.failureMessage ?? props.message),\n icon: response.data?.success ? (\n <IconCircleCheck />\n ) : (\n <IconCircleX />\n ),\n autoClose: 1000,\n withCloseButton: true\n });\n\n if (data.success) {\n props.onSuccess?.();\n } else {\n props.onFailure?.();\n }\n }\n\n return response;\n })\n .catch((error) => {\n console.error(\n `Error fetching background task status for task ${props.taskId}:`,\n error\n );\n setTracking(false);\n props.onError?.(error);\n\n notifications.update({\n id: `background-task-${props.taskId}`,\n title: props.title,\n loading: false,\n color: 'red',\n message: props.errorMessage ?? props.message,\n icon: <IconExclamationCircle color='red' />,\n autoClose: 5000,\n withCloseButton: true\n });\n })\n },\n props.queryClient\n );\n}\n"],"names":["useMonitorBackgroundTask","props","visibility","useDocumentVisibility","tracking","setTracking","useState","useEffect","taskId","showNotification","id","title","message","loading","autoClose","withCloseButton","useQuery","enabled","refetchInterval","queryKey","queryFn","api","get","apiUrl","ApiEndpoints","task_overview","then","response","data","complete","onComplete","notifications","update","color","success","successMessage","failureMessage","icon","onSuccess","onFailure","catch","error","console","onError","errorMessage","jsx","queryClient"],"mappings":";;;;;;;;AACA,MAAA,gBAAA,OAAA,sBAAA,EAAA;;AAQA,MAAA,YAAA,OAAA,OAAA,EAAA;;AAsBA,SAAwBA,yBACtBC,OACA;AACA,QAAMC,aAAaC,sBAAAA;AAEnB,QAAM,CAACC,UAAUC,WAAW,IAAIC,SAAkB,KAAK;AAEvDC,YAAU,MAAM;AACd,QAAI,CAAC,CAACN,MAAMO,QAAQ;AAClBH,kBAAY,IAAI;AAChBI,uBAAiB;AAAA,QACfC,IAAI,mBAAmBT,MAAMO,MAAM;AAAA,QACnCG,OAAOV,MAAMU;AAAAA,QACbC,SAASX,MAAMW;AAAAA,QACfC,SAAS;AAAA,QACTC,WAAW;AAAA,QACXC,iBAAiB;AAAA,MAAA,CAClB;AAAA,IACH,OAAO;AACLV,kBAAY,KAAK;AAAA,IACnB;AAAA,EACF,GAAG,CAACJ,MAAMO,MAAM,CAAC;AAEjBQ,WACE;AAAA,IACEC,SAAS,CAAC,CAAChB,MAAMO,UAAUJ,YAAYF,eAAe;AAAA,IACtDgB,iBAAiB;AAAA,IACjBC,UAAU,CAAC,mBAAmBlB,MAAMO,MAAM;AAAA,IAC1CY,SAASA,MACPnB,MAAMoB,IACHC,IAAIC,OAAOC,aAAaC,eAAexB,MAAMO,MAAM,CAAC,EACpDkB,KAAMC,CAAAA,aAAa;AAClB,YAAMC,OAAOD,UAAUC,QAAQ,CAAA;AAE/B,UAAIA,KAAKC,UAAU;AACjBxB,oBAAY,KAAK;AACjBJ,cAAM6B,aAAAA;AAENC,sBAAcC,OAAO;AAAA,UACnBtB,IAAI,mBAAmBT,MAAMO,MAAM;AAAA,UACnCG,OAAOV,MAAMU;AAAAA,UACbE,SAAS;AAAA,UACToB,OAAOL,KAAKM,UAAU,UAAU;AAAA,UAChCtB,SAASe,SAASC,MAAMM,UACnBjC,MAAMkC,kBAAkBlC,MAAMW,UAC9BX,MAAMmC,kBAAkBnC,MAAMW;AAAAA,UACnCyB,MAAMV,SAASC,MAAMM,gDAClB,iBAAA,CAAA,CAAe,0CAEf,aAAA,EAAW;AAAA,UAEdpB,WAAW;AAAA,UACXC,iBAAiB;AAAA,QAAA,CAClB;AAED,YAAIa,KAAKM,SAAS;AAChBjC,gBAAMqC,YAAAA;AAAAA,QACR,OAAO;AACLrC,gBAAMsC,YAAAA;AAAAA,QACR;AAAA,MACF;AAEA,aAAOZ;AAAAA,IACT,CAAC,EACAa,MAAOC,CAAAA,UAAU;AAChBC,cAAQD,MACN,kDAAkDxC,MAAMO,MAAM,KAC9DiC,KACF;AACApC,kBAAY,KAAK;AACjBJ,YAAM0C,UAAUF,KAAK;AAErBV,oBAAcC,OAAO;AAAA,QACnBtB,IAAI,mBAAmBT,MAAMO,MAAM;AAAA,QACnCG,OAAOV,MAAMU;AAAAA,QACbE,SAAS;AAAA,QACToB,OAAO;AAAA,QACPrB,SAASX,MAAM2C,gBAAgB3C,MAAMW;AAAAA,QACrCyB,MAAMQ,kCAAAA,IAAC,uBAAA,EAAsB,OAAM,MAAA,CAAK;AAAA,QACxC/B,WAAW;AAAA,QACXC,iBAAiB;AAAA,MAAA,CAClB;AAAA,IACH,CAAC;AAAA,EAAA,GAEPd,MAAM6C,WACR;AACF;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { AxiosInstance } from 'axios';
|
|
3
|
-
|
|
4
|
-
* Hook for monitoring a data output process running on the server
|
|
5
|
-
*/
|
|
6
|
-
export default function monitorDataOutput({ api, queryClient, title, hostname, id }: {
|
|
3
|
+
export type MonitorDataOutputProps = {
|
|
7
4
|
api: AxiosInstance;
|
|
8
5
|
queryClient?: QueryClient;
|
|
9
6
|
title: string;
|
|
10
7
|
hostname?: string;
|
|
11
8
|
id?: number;
|
|
12
|
-
}
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Hook for monitoring a data output process running on the server
|
|
12
|
+
*/
|
|
13
|
+
export default function useMonitorDataOutput(props: MonitorDataOutputProps): void;
|
|
@@ -11,33 +11,27 @@ const notifications = window["MantineNotifications"].notifications;
|
|
|
11
11
|
const showNotification = window["MantineNotifications"].showNotification;
|
|
12
12
|
const useEffect = window["React"].useEffect;
|
|
13
13
|
const useState = window["React"].useState;
|
|
14
|
-
function
|
|
15
|
-
api,
|
|
16
|
-
queryClient,
|
|
17
|
-
title,
|
|
18
|
-
hostname,
|
|
19
|
-
id
|
|
20
|
-
}) {
|
|
14
|
+
function useMonitorDataOutput(props) {
|
|
21
15
|
const visibility = useDocumentVisibility();
|
|
22
16
|
const [loading, setLoading] = useState(false);
|
|
23
17
|
useEffect(() => {
|
|
24
|
-
if (!!id) {
|
|
18
|
+
if (!!props.id) {
|
|
25
19
|
setLoading(true);
|
|
26
20
|
showNotification({
|
|
27
|
-
id: `data-output-${id}`,
|
|
28
|
-
title,
|
|
21
|
+
id: `data-output-${props.id}`,
|
|
22
|
+
title: props.title,
|
|
29
23
|
loading: true,
|
|
30
24
|
autoClose: false,
|
|
31
25
|
withCloseButton: false,
|
|
32
26
|
message: /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressBar, { size: "lg", value: 0, progressLabel: true })
|
|
33
27
|
});
|
|
34
28
|
} else setLoading(false);
|
|
35
|
-
}, [id, title]);
|
|
29
|
+
}, [props.id, props.title]);
|
|
36
30
|
useQuery({
|
|
37
|
-
enabled: !!id && loading && visibility === "visible",
|
|
31
|
+
enabled: !!props.id && loading && visibility === "visible",
|
|
38
32
|
refetchInterval: 500,
|
|
39
|
-
queryKey: ["data-output", id, title],
|
|
40
|
-
queryFn: () => api.get(apiUrl(ApiEndpoints.data_output, id)).then((response) => {
|
|
33
|
+
queryKey: ["data-output", props.id, props.title],
|
|
34
|
+
queryFn: () => props.api.get(apiUrl(ApiEndpoints.data_output, props.id)).then((response) => {
|
|
41
35
|
const data = response?.data ?? {};
|
|
42
36
|
if (!!data.errors || !!data.error) {
|
|
43
37
|
setLoading(false);
|
|
@@ -48,21 +42,21 @@ function monitorDataOutput({
|
|
|
48
42
|
}
|
|
49
43
|
);
|
|
50
44
|
notifications.update({
|
|
51
|
-
id: `data-output-${id}`,
|
|
45
|
+
id: `data-output-${props.id}`,
|
|
52
46
|
loading: false,
|
|
53
47
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconExclamationCircle, {}),
|
|
54
48
|
autoClose: 2500,
|
|
55
|
-
title,
|
|
49
|
+
title: props.title,
|
|
56
50
|
message: error,
|
|
57
51
|
color: "red"
|
|
58
52
|
});
|
|
59
53
|
} else if (data.complete) {
|
|
60
54
|
setLoading(false);
|
|
61
55
|
notifications.update({
|
|
62
|
-
id: `data-output-${id}`,
|
|
56
|
+
id: `data-output-${props.id}`,
|
|
63
57
|
loading: false,
|
|
64
58
|
autoClose: 2500,
|
|
65
|
-
title,
|
|
59
|
+
title: props.title,
|
|
66
60
|
message: _i18n._(
|
|
67
61
|
/*i18n*/
|
|
68
62
|
{
|
|
@@ -74,13 +68,13 @@ function monitorDataOutput({
|
|
|
74
68
|
});
|
|
75
69
|
if (data.output) {
|
|
76
70
|
const url = data.output;
|
|
77
|
-
const base = hostname ?? window.location.origin;
|
|
71
|
+
const base = props.hostname ?? window.location.origin;
|
|
78
72
|
const downloadUrl = new URL(url, base);
|
|
79
73
|
window.open(downloadUrl.toString(), "_blank");
|
|
80
74
|
}
|
|
81
75
|
} else {
|
|
82
76
|
notifications.update({
|
|
83
|
-
id: `data-output-${id}`,
|
|
77
|
+
id: `data-output-${props.id}`,
|
|
84
78
|
loading: true,
|
|
85
79
|
autoClose: false,
|
|
86
80
|
withCloseButton: false,
|
|
@@ -89,13 +83,13 @@ function monitorDataOutput({
|
|
|
89
83
|
}
|
|
90
84
|
return data;
|
|
91
85
|
}).catch((error) => {
|
|
92
|
-
console.error("Error in
|
|
86
|
+
console.error("Error in useMonitorDataOutput:", error);
|
|
93
87
|
setLoading(false);
|
|
94
88
|
notifications.update({
|
|
95
|
-
id: `data-output-${id}`,
|
|
89
|
+
id: `data-output-${props.id}`,
|
|
96
90
|
loading: false,
|
|
97
91
|
autoClose: 2500,
|
|
98
|
-
title,
|
|
92
|
+
title: props.title,
|
|
99
93
|
message: error.message || _i18n._(
|
|
100
94
|
/*i18n*/
|
|
101
95
|
{
|
|
@@ -106,9 +100,9 @@ function monitorDataOutput({
|
|
|
106
100
|
});
|
|
107
101
|
return {};
|
|
108
102
|
})
|
|
109
|
-
}, queryClient);
|
|
103
|
+
}, props.queryClient);
|
|
110
104
|
}
|
|
111
105
|
export {
|
|
112
|
-
|
|
106
|
+
useMonitorDataOutput as default
|
|
113
107
|
};
|
|
114
108
|
//# sourceMappingURL=MonitorDataOutput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonitorDataOutput.js","sources":["../../lib/hooks/MonitorDataOutput.tsx"],"sourcesContent":["import { t } from '@lingui/core/macro';\nimport { useDocumentVisibility } from '@mantine/hooks';\nimport { notifications, showNotification } from '@mantine/notifications';\nimport { IconCircleCheck, IconExclamationCircle } from '@tabler/icons-react';\nimport { type QueryClient, useQuery } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport { useEffect, useState } from 'react';\nimport { ProgressBar } from '../components/ProgressBar';\nimport { ApiEndpoints } from '../enums/ApiEndpoints';\nimport { apiUrl } from '../functions/Api';\n\
|
|
1
|
+
{"version":3,"file":"MonitorDataOutput.js","sources":["../../lib/hooks/MonitorDataOutput.tsx"],"sourcesContent":["import { t } from '@lingui/core/macro';\nimport { useDocumentVisibility } from '@mantine/hooks';\nimport { notifications, showNotification } from '@mantine/notifications';\nimport { IconCircleCheck, IconExclamationCircle } from '@tabler/icons-react';\nimport { type QueryClient, useQuery } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport { useEffect, useState } from 'react';\nimport { ProgressBar } from '../components/ProgressBar';\nimport { ApiEndpoints } from '../enums/ApiEndpoints';\nimport { apiUrl } from '../functions/Api';\n\nexport type MonitorDataOutputProps = {\n api: AxiosInstance;\n queryClient?: QueryClient;\n title: string;\n hostname?: string;\n id?: number;\n};\n\n/**\n * Hook for monitoring a data output process running on the server\n */\nexport default function useMonitorDataOutput(props: MonitorDataOutputProps) {\n const visibility = useDocumentVisibility();\n\n const [loading, setLoading] = useState<boolean>(false);\n\n useEffect(() => {\n if (!!props.id) {\n setLoading(true);\n showNotification({\n id: `data-output-${props.id}`,\n title: props.title,\n loading: true,\n autoClose: false,\n withCloseButton: false,\n message: <ProgressBar size='lg' value={0} progressLabel />\n });\n } else setLoading(false);\n }, [props.id, props.title]);\n\n useQuery(\n {\n enabled: !!props.id && loading && visibility === 'visible',\n refetchInterval: 500,\n queryKey: ['data-output', props.id, props.title],\n queryFn: () =>\n props.api\n .get(apiUrl(ApiEndpoints.data_output, props.id))\n .then((response) => {\n const data = response?.data ?? {};\n\n if (!!data.errors || !!data.error) {\n setLoading(false);\n\n const error: string =\n data?.error ?? data?.errors?.error ?? t`Process failed`;\n\n notifications.update({\n id: `data-output-${props.id}`,\n loading: false,\n icon: <IconExclamationCircle />,\n autoClose: 2500,\n title: props.title,\n message: error,\n color: 'red'\n });\n } else if (data.complete) {\n setLoading(false);\n notifications.update({\n id: `data-output-${props.id}`,\n loading: false,\n autoClose: 2500,\n title: props.title,\n message: t`Process completed successfully`,\n color: 'green',\n icon: <IconCircleCheck />\n });\n\n if (data.output) {\n const url = data.output;\n const base = props.hostname ?? window.location.origin;\n\n const downloadUrl = new URL(url, base);\n\n window.open(downloadUrl.toString(), '_blank');\n }\n } else {\n notifications.update({\n id: `data-output-${props.id}`,\n loading: true,\n autoClose: false,\n withCloseButton: false,\n message: (\n <ProgressBar\n size='lg'\n maximum={data.total}\n value={data.progress}\n progressLabel={data.total > 0}\n animated\n />\n )\n });\n }\n\n return data;\n })\n .catch((error: Error) => {\n console.error('Error in useMonitorDataOutput:', error);\n setLoading(false);\n notifications.update({\n id: `data-output-${props.id}`,\n loading: false,\n autoClose: 2500,\n title: props.title,\n message: error.message || t`Process failed`,\n color: 'red'\n });\n return {};\n })\n },\n props.queryClient\n );\n}\n"],"names":["useMonitorDataOutput","props","visibility","useDocumentVisibility","loading","setLoading","useState","useEffect","id","showNotification","title","autoClose","withCloseButton","message","useQuery","enabled","refetchInterval","queryKey","queryFn","api","get","apiUrl","ApiEndpoints","data_output","then","response","data","errors","error","_i18n","_","notifications","update","icon","color","complete","output","url","base","hostname","window","location","origin","downloadUrl","URL","open","toString","jsx","total","progress","catch","console","queryClient"],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export { ProgressBar } from './components/ProgressBar';
|
|
|
18
18
|
export { PassFailButton, YesNoButton } from './components/YesNoButton';
|
|
19
19
|
export { SearchInput } from './components/SearchInput';
|
|
20
20
|
export { RowViewAction, RowDuplicateAction, RowEditAction, RowDeleteAction, RowCancelAction, RowActions } from './components/RowActions';
|
|
21
|
-
export { default as
|
|
21
|
+
export { default as useMonitorDataOutput, type MonitorDataOutputProps } from './hooks/MonitorDataOutput';
|
|
22
|
+
export { default as useMonitorBackgroundTask, type MonitorBackgroundTaskProps } from './hooks/MonitorBackgroundTask';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { PassFailButton, YesNoButton } from "./components/YesNoButton.js";
|
|
|
14
14
|
import { SearchInput } from "./components/SearchInput.js";
|
|
15
15
|
import { RowActions, RowCancelAction, RowDeleteAction, RowDuplicateAction, RowEditAction, RowViewAction } from "./components/RowActions.js";
|
|
16
16
|
import { default as default2 } from "./hooks/MonitorDataOutput.js";
|
|
17
|
+
import { default as default3 } from "./hooks/MonitorBackgroundTask.js";
|
|
17
18
|
export {
|
|
18
19
|
ActionButton,
|
|
19
20
|
AddItemButton,
|
|
@@ -44,7 +45,8 @@ export {
|
|
|
44
45
|
getBaseUrl,
|
|
45
46
|
getDetailUrl,
|
|
46
47
|
initPlugin,
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
navigateToLink,
|
|
49
|
+
default3 as useMonitorBackgroundTask,
|
|
50
|
+
default2 as useMonitorDataOutput
|
|
49
51
|
};
|
|
50
52
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defaultAttributes from "./defaultAttributes.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license @tabler/icons-react v3.
|
|
3
|
+
* @license @tabler/icons-react v3.40.0 - MIT
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReactComponent.js","sources":["../../../../../../node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"createReactComponent.js","sources":["../../../../../../node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.mjs';\n\nconst createReactComponent = (type, iconName, iconNamePascal, iconNode) => {\n const Component = forwardRef(\n ({ color = \"currentColor\", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes[type],\n width: size,\n height: size,\n className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(\" \"),\n ...type === \"filled\" ? {\n fill: color\n } : {\n strokeWidth: stroke,\n stroke: color\n },\n ...rest\n },\n [\n title && createElement(\"title\", { key: \"svg-title\" }, title),\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n );\n Component.displayName = `${iconNamePascal}`;\n return Component;\n};\n\nexport { createReactComponent as default };\n//# sourceMappingURL=createReactComponent.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAA,aAAA,OAAA,OAAA,EAAA;;AAGK,MAAC,uBAAuB,CAAC,MAAM,UAAU,gBAAgB,aAAa;AACzE,QAAM,YAAY;AAAA,IAChB,CAAC,EAAE,QAAQ,gBAAgB,OAAO,IAAI,SAAS,GAAG,OAAO,WAAW,UAAU,GAAG,KAAI,GAAI,QAAQ;AAAA,MAC/F;AAAA,MACA;AAAA,QACE;AAAA,QACA,GAAG,kBAAkB,IAAI;AAAA,QACzB,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,WAAW,CAAC,eAAe,eAAe,QAAQ,IAAI,SAAS,EAAE,KAAK,GAAG;AAAA,QACzE,GAEI;AAAA,UACF,aAAa;AAAA,UACb,QAAQ;AAAA,QAClB;AAAA,QACQ,GAAG;AAAA,MACX;AAAA,MACM;AAAA,QACE,SAAS,cAAc,SAAS,EAAE,KAAK,YAAW,GAAI,KAAK;AAAA,QAC3D,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,cAAc,KAAK,KAAK,CAAC;AAAA,QAC3D,GAAG,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ;AAAA,MACzD;AAAA,IACA;AAAA,EACA;AACE,YAAU,cAAc,GAAG,cAAc;AACzC,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultAttributes.js","sources":["../../../../../../node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"defaultAttributes.js","sources":["../../../../../../node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n outline: {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n },\n filled: {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n stroke: \"none\"\n }\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.mjs.map\n"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOG,IAAC,oBAAoB;AAAA,EACtB,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,eAAe;AAAA,IACf,gBAAgB;AAAA,EACpB;AAAA,EACE,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,EACZ;AACA;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import createReactComponent from "../createReactComponent.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license @tabler/icons-react v3.
|
|
3
|
+
* @license @tabler/icons-react v3.40.0 - MIT
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconArrowRight.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"IconArrowRight.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M13 18l6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M13 6l6 6\", \"key\": \"svg-2\" }]];\nconst IconArrowRight = createReactComponent(\"outline\", \"arrow-right\", \"ArrowRight\", __iconNode);\n\nexport { __iconNode, IconArrowRight as default };\n//# sourceMappingURL=IconArrowRight.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,cAAc,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,eAAe,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,aAAa,OAAO,SAAS,CAAC;AAChK,MAAC,iBAAiB,qBAAqB,WAAW,eAAe,cAAc,UAAU;","x_google_ignoreList":[0]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import createReactComponent from "../createReactComponent.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license @tabler/icons-react v3.
|
|
3
|
+
* @license @tabler/icons-react v3.40.0 - MIT
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const __iconNode = [["path", { "d": "
|
|
8
|
+
const __iconNode = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M9 12l2 2l4 -4", "key": "svg-1" }]];
|
|
9
9
|
const IconCircleCheck = createReactComponent("outline", "circle-check", "CircleCheck", __iconNode);
|
|
10
10
|
export {
|
|
11
11
|
__iconNode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconCircleCheck.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"IconCircleCheck.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M9 12l2 2l4 -4\", \"key\": \"svg-1\" }]];\nconst IconCircleCheck = createReactComponent(\"outline\", \"circle-check\", \"CircleCheck\", __iconNode);\n\nexport { __iconNode, IconCircleCheck as default };\n//# sourceMappingURL=IconCircleCheck.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,wCAAwC,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,kBAAkB,OAAO,SAAS,CAAC;AAC7I,MAAC,kBAAkB,qBAAqB,WAAW,gBAAgB,eAAe,UAAU;","x_google_ignoreList":[0]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import createReactComponent from "../createReactComponent.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license @tabler/icons-react v3.
|
|
3
|
+
* @license @tabler/icons-react v3.40.0 - MIT
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const __iconNode = [["path", { "d": "
|
|
8
|
+
const __iconNode = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M10 10l4 4m0 -4l-4 4", "key": "svg-1" }]];
|
|
9
9
|
const IconCircleX = createReactComponent("outline", "circle-x", "CircleX", __iconNode);
|
|
10
10
|
export {
|
|
11
11
|
__iconNode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconCircleX.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"IconCircleX.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10 10l4 4m0 -4l-4 4\", \"key\": \"svg-1\" }]];\nconst IconCircleX = createReactComponent(\"outline\", \"circle-x\", \"CircleX\", __iconNode);\n\nexport { __iconNode, IconCircleX as default };\n//# sourceMappingURL=IconCircleX.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,wCAAwC,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,wBAAwB,OAAO,SAAS,CAAC;AACnJ,MAAC,cAAc,qBAAqB,WAAW,YAAY,WAAW,UAAU;","x_google_ignoreList":[0]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import createReactComponent from "../createReactComponent.js";
|
|
2
2
|
/**
|
|
3
|
-
* @license @tabler/icons-react v3.
|
|
3
|
+
* @license @tabler/icons-react v3.40.0 - MIT
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the MIT license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const __iconNode = [["path", { "d": "M7
|
|
8
|
+
const __iconNode = [["path", { "d": "M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666", "key": "svg-0" }], ["path", { "d": "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", "key": "svg-1" }]];
|
|
9
9
|
const IconCopy = createReactComponent("outline", "copy", "Copy", __iconNode);
|
|
10
10
|
export {
|
|
11
11
|
__iconNode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconCopy.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.
|
|
1
|
+
{"version":3,"file":"IconCopy.js","sources":["../../../../../../../node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.40.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\", \"key\": \"svg-1\" }]];\nconst IconCopy = createReactComponent(\"outline\", \"copy\", \"Copy\", __iconNode);\n\nexport { __iconNode, IconCopy as default };\n//# sourceMappingURL=IconCopy.mjs.map\n"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASK,MAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,KAAK,oKAAoK,OAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,iGAAiG,OAAO,SAAS,CAAC;AACxV,MAAC,WAAW,qBAAqB,WAAW,QAAQ,QAAQ,UAAU;","x_google_ignoreList":[0]}
|