@inventreedb/ui 0.8.1 → 0.9.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 (56) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/.vite/manifest.json +32 -7
  3. package/dist/components/RowActions.js +4 -4
  4. package/dist/hooks/MonitorBackgroundTask.d.ts +20 -0
  5. package/dist/hooks/MonitorBackgroundTask.js +77 -0
  6. package/dist/hooks/MonitorBackgroundTask.js.map +1 -0
  7. package/dist/hooks/MonitorDataOutput.d.ts +6 -5
  8. package/dist/hooks/MonitorDataOutput.js +21 -26
  9. package/dist/hooks/MonitorDataOutput.js.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +4 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
  14. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js.map +1 -1
  15. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
  16. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js.map +1 -1
  17. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
  18. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js.map +1 -1
  19. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js +2 -2
  20. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js.map +1 -1
  21. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js +2 -2
  22. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js.map +1 -1
  23. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +2 -2
  24. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js.map +1 -1
  25. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js +2 -2
  26. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js.map +1 -1
  27. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js +2 -2
  28. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js.map +1 -1
  29. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js +2 -2
  30. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js.map +1 -1
  31. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js +1 -1
  32. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js.map +1 -1
  33. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
  34. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js.map +1 -1
  35. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
  36. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js.map +1 -1
  37. package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js +2 -1
  38. package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -1
  39. package/dist/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -1
  40. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js +20 -14
  41. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
  42. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +69 -0
  43. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -0
  44. package/dist/node_modules/@tanstack/query-core/build/modern/utils.js +3 -2
  45. package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
  46. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +3 -2
  47. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
  48. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +4 -3
  49. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
  50. package/dist/types/Icons.d.ts +2 -2
  51. package/dist/types/Plugins.js +3 -3
  52. package/lib/hooks/MonitorBackgroundTask.tsx +118 -0
  53. package/lib/hooks/MonitorDataOutput.tsx +27 -30
  54. package/lib/index.ts +8 -1
  55. package/lib/types/Icons.tsx +2 -4
  56. package/package.json +42 -39
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.js","sources":["../../../../../../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js"],"sourcesContent":["\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map"],"names":[],"mappings":";AAGA,MAAA,QAAA,OAAA,OAAA;AAEG,IAAC,kCAAkC,CAAC,SAAS,uBAAuB;AACrE,MAAI,QAAQ,YAAY,QAAQ,gBAAgB,QAAQ,+BAA+B;AACrF,QAAI,CAAC,mBAAmB,WAAW;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AACG,IAAC,6BAA6B,CAAC,uBAAuB;AACvD,QAAM,UAAU,MAAM;AACpB,uBAAmB,WAAU;AAAA,EAC/B,GAAG,CAAC,kBAAkB,CAAC;AACzB;AACG,IAAC,cAAc,CAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SAAO,OAAO,WAAW,CAAC,mBAAmB,QAAO,KAAM,CAAC,OAAO,cAAc,UAAU,YAAY,OAAO,SAAS,UAAU,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AACtL;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"errorBoundaryUtils.js","sources":["../../../../../../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js"],"sourcesContent":["\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n const throwOnError = query?.state.error && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n if (options.suspense || options.experimental_prefetchInRender || throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map"],"names":[],"mappings":";AAGA,MAAA,QAAA,OAAA,OAAA;AAEG,IAAC,kCAAkC,CAAC,SAAS,oBAAoB,UAAU;AAC5E,QAAM,eAAe,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,aAAa,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IAAI,QAAQ;AACrK,MAAI,QAAQ,YAAY,QAAQ,iCAAiC,cAAc;AAC7E,QAAI,CAAC,mBAAmB,WAAW;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AACG,IAAC,6BAA6B,CAAC,uBAAuB;AACvD,QAAM,UAAU,MAAM;AACpB,uBAAmB,WAAU;AAAA,EAC/B,GAAG,CAAC,kBAAkB,CAAC;AACzB;AACG,IAAC,cAAc,CAAC;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,SAAO,OAAO,WAAW,CAAC,mBAAmB,QAAO,KAAM,CAAC,OAAO,cAAc,UAAU,YAAY,OAAO,SAAS,UAAU,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AACtL;","x_google_ignoreList":[0]}
@@ -21,6 +21,7 @@ function useBaseQuery(options, Observer, queryClient) {
21
21
  client.getDefaultOptions().queries?._experimental_beforeQuery?.(
22
22
  defaultedOptions
23
23
  );
24
+ const query = client.getQueryCache().get(defaultedOptions.queryHash);
24
25
  if (process.env.NODE_ENV !== "production") {
25
26
  if (!defaultedOptions.queryFn) {
26
27
  console.error(
@@ -30,7 +31,7 @@ function useBaseQuery(options, Observer, queryClient) {
30
31
  }
31
32
  defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
32
33
  ensureSuspenseTimers(defaultedOptions);
33
- ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
34
+ ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
34
35
  useClearResetErrorBoundary(errorResetBoundary);
35
36
  const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
36
37
  const [observer] = React.useState(
@@ -63,7 +64,7 @@ function useBaseQuery(options, Observer, queryClient) {
63
64
  result,
64
65
  errorResetBoundary,
65
66
  throwOnError: defaultedOptions.throwOnError,
66
- query: client.getQueryCache().get(defaultedOptions.queryHash),
67
+ query,
67
68
  suspense: defaultedOptions.suspense
68
69
  })) {
69
70
  throw result.error;
@@ -78,7 +79,7 @@ function useBaseQuery(options, Observer, queryClient) {
78
79
  fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
79
80
  ) : (
80
81
  // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
81
- client.getQueryCache().get(defaultedOptions.queryHash)?.promise
82
+ query?.promise
82
83
  );
83
84
  promise?.catch(noop).finally(() => {
84
85
  observer.updateResult();
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseQuery.js","sources":["../../../../../../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js"],"sourcesContent":["\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { isServer, noop, notifyManager } from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n} from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const client = useQueryClient(queryClient);\n const defaultedOptions = client.defaultQueryOptions(options);\n client.getDefaultOptions().queries?._experimental_beforeQuery?.(\n defaultedOptions\n );\n if (process.env.NODE_ENV !== \"production\") {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`\n );\n }\n }\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureSuspenseTimers(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n const shouldSubscribe = !isRestoring && options.subscribed !== false;\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n observer.updateResult();\n return unsubscribe;\n },\n [observer, shouldSubscribe]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions);\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash),\n suspense: defaultedOptions.suspense\n })) {\n throw result.error;\n }\n ;\n client.getDefaultOptions().queries?._experimental_afterQuery?.(\n defaultedOptions,\n result\n );\n if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {\n const promise = isNewCacheEntry ? (\n // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n ) : (\n // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n client.getQueryCache().get(defaultedOptions.queryHash)?.promise\n );\n promise?.catch(noop).finally(() => {\n observer.updateResult();\n });\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};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,iBAAgB;AAAA,EACnC;AACE,QAAM,UAAU,MAAM;AACpB,aAAS,WAAW,gBAAgB;AAAA,EACtC,GAAG,CAAC,kBAAkB,QAAQ,CAAC;AAC/B,MAAI,cAAc,kBAAkB,MAAM,GAAG;AAC3C,UAAM,gBAAgB,kBAAkB,UAAU,kBAAkB;AAAA,EACtE;AACA,MAAI,YAAY;AAAA,IACd;AAAA,IACA;AAAA,IACA,cAAc,iBAAiB;AAAA,IAC/B,OAAO,OAAO,cAAa,EAAG,IAAI,iBAAiB,SAAS;AAAA,IAC5D,UAAU,iBAAiB;AAAA,EAC/B,CAAG,GAAG;AACF,UAAM,OAAO;AAAA,EACf;AAEA,SAAO,oBAAoB,SAAS;AAAA,IAClC;AAAA,IACA;AAAA,EACJ;AACE,MAAI,iBAAiB,iCAAiC,CAAC,YAAY,UAAU,QAAQ,WAAW,GAAG;AACjG,UAAM,UAAU;AAAA;AAAA,MAEd,gBAAgB,kBAAkB,UAAU,kBAAkB;AAAA;AAAA;AAAA,MAG9D,OAAO,cAAa,EAAG,IAAI,iBAAiB,SAAS,GAAG;AAAA;AAE1D,aAAS,MAAM,IAAI,EAAE,QAAQ,MAAM;AACjC,eAAS,aAAY;AAAA,IACvB,CAAC;AAAA,EACH;AACA,SAAO,CAAC,iBAAiB,sBAAsB,SAAS,YAAY,MAAM,IAAI;AAChF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useBaseQuery.js","sources":["../../../../../../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js"],"sourcesContent":["\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { isServer, noop, notifyManager } from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n} from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const client = useQueryClient(queryClient);\n const defaultedOptions = client.defaultQueryOptions(options);\n client.getDefaultOptions().queries?._experimental_beforeQuery?.(\n defaultedOptions\n );\n const query = client.getQueryCache().get(defaultedOptions.queryHash);\n if (process.env.NODE_ENV !== \"production\") {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`\n );\n }\n }\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureSuspenseTimers(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n useClearResetErrorBoundary(errorResetBoundary);\n const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n const shouldSubscribe = !isRestoring && options.subscribed !== false;\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n observer.updateResult();\n return unsubscribe;\n },\n [observer, shouldSubscribe]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions);\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense\n })) {\n throw result.error;\n }\n ;\n client.getDefaultOptions().queries?._experimental_afterQuery?.(\n defaultedOptions,\n result\n );\n if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {\n const promise = isNewCacheEntry ? (\n // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n ) : (\n // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n );\n promise?.catch(noop).finally(() => {\n observer.updateResult();\n });\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map"],"names":[],"mappings":";;;;;;;AAGA,MAAA,QAAA,OAAA,OAAA;AAgBA,SAAS,aAAa,SAAS,UAAU,aAAa;AACpD,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;AACzD,YAAM,IAAI;AAAA,QACR;AAAA,MACR;AAAA,IACI;AAAA,EACF;AACA,QAAM,cAAc,eAAc;AAClC,QAAM,qBAAqB,2BAA0B;AACrD,QAAM,SAAS,eAAe,WAAW;AACzC,QAAM,mBAAmB,OAAO,oBAAoB,OAAO;AAC3D,SAAO,oBAAoB,SAAS;AAAA,IAClC;AAAA,EACJ;AACE,QAAM,QAAQ,OAAO,cAAa,EAAG,IAAI,iBAAiB,SAAS;AACnE,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,iBAAiB,SAAS;AAC7B,cAAQ;AAAA,QACN,IAAI,iBAAiB,SAAS;AAAA,MACtC;AAAA,IACI;AAAA,EACF;AACA,mBAAiB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AET,aAAS,MAAM,IAAI,EAAE,QAAQ,MAAM;AACjC,eAAS,aAAY;AAAA,IACvB,CAAC;AAAA,EACH;AACA,SAAO,CAAC,iBAAiB,sBAAsB,SAAS,YAAY,MAAM,IAAI;AAChF;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
- import { Icon, IconProps } from '@tabler/icons-react';
2
- export type TablerIconType = React.ForwardRefExoticComponent<Omit<IconProps, 'ref'> & React.RefAttributes<Icon>>;
1
+ import { IconCircle } from '@tabler/icons-react';
2
+ export type TablerIconType = typeof IconCircle;
3
3
  export type InvenTreeIconType = {
4
4
  [key: string]: TablerIconType;
5
5
  };
@@ -1,8 +1,8 @@
1
- const INVENTREE_PLUGIN_VERSION = "0.8.1";
2
- const INVENTREE_REACT_VERSION = "19.1.2";
1
+ const INVENTREE_PLUGIN_VERSION = "0.9.0";
2
+ const INVENTREE_REACT_VERSION = "19.2.4";
3
3
  const INVENTREE_REACT_DOM_VERSION = (
4
4
  // @ts-ignore
5
- "19.1.2"
5
+ "19.2.4"
6
6
  );
7
7
  const INVENTREE_MANTINE_VERSION = "8.2.7";
8
8
  export {
@@ -0,0 +1,118 @@
1
+ import { useDocumentVisibility } from '@mantine/hooks';
2
+ import { notifications, showNotification } from '@mantine/notifications';
3
+ import {
4
+ IconCircleCheck,
5
+ IconCircleX,
6
+ IconExclamationCircle
7
+ } from '@tabler/icons-react';
8
+ import { type QueryClient, useQuery } from '@tanstack/react-query';
9
+ import type { AxiosInstance } from 'axios';
10
+ import { useEffect, useState } from 'react';
11
+ import { ApiEndpoints } from '../enums/ApiEndpoints';
12
+ import { apiUrl } from '../functions/Api';
13
+
14
+ export type MonitorBackgroundTaskProps = {
15
+ api: AxiosInstance;
16
+ queryClient?: QueryClient;
17
+ title?: string;
18
+ message: string;
19
+ errorMessage?: string;
20
+ successMessage?: string;
21
+ failureMessage?: string;
22
+ taskId?: string;
23
+ onSuccess?: () => void;
24
+ onFailure?: () => void;
25
+ onComplete?: () => void;
26
+ onError?: (error: Error) => void;
27
+ };
28
+
29
+ /**
30
+ * Hook for monitoring a background task running on the server
31
+ */
32
+ export default function useMonitorBackgroundTask(
33
+ props: MonitorBackgroundTaskProps
34
+ ) {
35
+ const visibility = useDocumentVisibility();
36
+
37
+ const [tracking, setTracking] = useState<boolean>(false);
38
+
39
+ useEffect(() => {
40
+ if (!!props.taskId) {
41
+ setTracking(true);
42
+ showNotification({
43
+ id: `background-task-${props.taskId}`,
44
+ title: props.title,
45
+ message: props.message,
46
+ loading: true,
47
+ autoClose: false,
48
+ withCloseButton: false
49
+ });
50
+ } else {
51
+ setTracking(false);
52
+ }
53
+ }, [props.taskId]);
54
+
55
+ useQuery(
56
+ {
57
+ enabled: !!props.taskId && tracking && visibility === 'visible',
58
+ refetchInterval: 500,
59
+ queryKey: ['background-task', props.taskId],
60
+ queryFn: () =>
61
+ props.api
62
+ .get(apiUrl(ApiEndpoints.task_overview, props.taskId))
63
+ .then((response) => {
64
+ const data = response?.data ?? {};
65
+
66
+ if (data.complete) {
67
+ setTracking(false);
68
+ props.onComplete?.();
69
+
70
+ notifications.update({
71
+ id: `background-task-${props.taskId}`,
72
+ title: props.title,
73
+ loading: false,
74
+ color: data.success ? 'green' : 'red',
75
+ message: response.data?.success
76
+ ? (props.successMessage ?? props.message)
77
+ : (props.failureMessage ?? props.message),
78
+ icon: response.data?.success ? (
79
+ <IconCircleCheck />
80
+ ) : (
81
+ <IconCircleX />
82
+ ),
83
+ autoClose: 1000,
84
+ withCloseButton: true
85
+ });
86
+
87
+ if (data.success) {
88
+ props.onSuccess?.();
89
+ } else {
90
+ props.onFailure?.();
91
+ }
92
+ }
93
+
94
+ return response;
95
+ })
96
+ .catch((error) => {
97
+ console.error(
98
+ `Error fetching background task status for task ${props.taskId}:`,
99
+ error
100
+ );
101
+ setTracking(false);
102
+ props.onError?.(error);
103
+
104
+ notifications.update({
105
+ id: `background-task-${props.taskId}`,
106
+ title: props.title,
107
+ loading: false,
108
+ color: 'red',
109
+ message: props.errorMessage ?? props.message,
110
+ icon: <IconExclamationCircle color='red' />,
111
+ autoClose: 5000,
112
+ withCloseButton: true
113
+ });
114
+ })
115
+ },
116
+ props.queryClient
117
+ );
118
+ }
@@ -9,48 +9,44 @@ import { ProgressBar } from '../components/ProgressBar';
9
9
  import { ApiEndpoints } from '../enums/ApiEndpoints';
10
10
  import { apiUrl } from '../functions/Api';
11
11
 
12
- /**
13
- * Hook for monitoring a data output process running on the server
14
- */
15
- export default function monitorDataOutput({
16
- api,
17
- queryClient,
18
- title,
19
- hostname,
20
- id
21
- }: {
12
+ export type MonitorDataOutputProps = {
22
13
  api: AxiosInstance;
23
14
  queryClient?: QueryClient;
24
15
  title: string;
25
16
  hostname?: string;
26
17
  id?: number;
27
- }) {
18
+ };
19
+
20
+ /**
21
+ * Hook for monitoring a data output process running on the server
22
+ */
23
+ export default function useMonitorDataOutput(props: MonitorDataOutputProps) {
28
24
  const visibility = useDocumentVisibility();
29
25
 
30
26
  const [loading, setLoading] = useState<boolean>(false);
31
27
 
32
28
  useEffect(() => {
33
- if (!!id) {
29
+ if (!!props.id) {
34
30
  setLoading(true);
35
31
  showNotification({
36
- id: `data-output-${id}`,
37
- title: title,
32
+ id: `data-output-${props.id}`,
33
+ title: props.title,
38
34
  loading: true,
39
35
  autoClose: false,
40
36
  withCloseButton: false,
41
37
  message: <ProgressBar size='lg' value={0} progressLabel />
42
38
  });
43
39
  } else setLoading(false);
44
- }, [id, title]);
40
+ }, [props.id, props.title]);
45
41
 
46
42
  useQuery(
47
43
  {
48
- enabled: !!id && loading && visibility === 'visible',
44
+ enabled: !!props.id && loading && visibility === 'visible',
49
45
  refetchInterval: 500,
50
- queryKey: ['data-output', id, title],
46
+ queryKey: ['data-output', props.id, props.title],
51
47
  queryFn: () =>
52
- api
53
- .get(apiUrl(ApiEndpoints.data_output, id))
48
+ props.api
49
+ .get(apiUrl(ApiEndpoints.data_output, props.id))
54
50
  .then((response) => {
55
51
  const data = response?.data ?? {};
56
52
 
@@ -61,21 +57,21 @@ export default function monitorDataOutput({
61
57
  data?.error ?? data?.errors?.error ?? t`Process failed`;
62
58
 
63
59
  notifications.update({
64
- id: `data-output-${id}`,
60
+ id: `data-output-${props.id}`,
65
61
  loading: false,
66
62
  icon: <IconExclamationCircle />,
67
63
  autoClose: 2500,
68
- title: title,
64
+ title: props.title,
69
65
  message: error,
70
66
  color: 'red'
71
67
  });
72
68
  } else if (data.complete) {
73
69
  setLoading(false);
74
70
  notifications.update({
75
- id: `data-output-${id}`,
71
+ id: `data-output-${props.id}`,
76
72
  loading: false,
77
73
  autoClose: 2500,
78
- title: title,
74
+ title: props.title,
79
75
  message: t`Process completed successfully`,
80
76
  color: 'green',
81
77
  icon: <IconCircleCheck />
@@ -83,7 +79,7 @@ export default function monitorDataOutput({
83
79
 
84
80
  if (data.output) {
85
81
  const url = data.output;
86
- const base = hostname ?? window.location.hostname;
82
+ const base = props.hostname ?? window.location.origin;
87
83
 
88
84
  const downloadUrl = new URL(url, base);
89
85
 
@@ -91,7 +87,7 @@ export default function monitorDataOutput({
91
87
  }
92
88
  } else {
93
89
  notifications.update({
94
- id: `data-output-${id}`,
90
+ id: `data-output-${props.id}`,
95
91
  loading: true,
96
92
  autoClose: false,
97
93
  withCloseButton: false,
@@ -109,19 +105,20 @@ export default function monitorDataOutput({
109
105
 
110
106
  return data;
111
107
  })
112
- .catch(() => {
108
+ .catch((error: Error) => {
109
+ console.error('Error in useMonitorDataOutput:', error);
113
110
  setLoading(false);
114
111
  notifications.update({
115
- id: `data-output-${id}`,
112
+ id: `data-output-${props.id}`,
116
113
  loading: false,
117
114
  autoClose: 2500,
118
- title: title,
119
- message: t`Process failed`,
115
+ title: props.title,
116
+ message: error.message || t`Process failed`,
120
117
  color: 'red'
121
118
  });
122
119
  return {};
123
120
  })
124
121
  },
125
- queryClient
122
+ props.queryClient
126
123
  );
127
124
  }
package/lib/index.ts CHANGED
@@ -73,4 +73,11 @@ export {
73
73
  } from './components/RowActions';
74
74
 
75
75
  // Shared hooks
76
- export { default as monitorDataOutput } from './hooks/MonitorDataOutput';
76
+ export {
77
+ default as useMonitorDataOutput,
78
+ type MonitorDataOutputProps
79
+ } from './hooks/MonitorDataOutput';
80
+ export {
81
+ default as useMonitorBackgroundTask,
82
+ type MonitorBackgroundTaskProps
83
+ } from './hooks/MonitorBackgroundTask';
@@ -1,8 +1,6 @@
1
- import type { Icon, IconProps } from '@tabler/icons-react';
1
+ import type { IconCircle } from '@tabler/icons-react';
2
2
 
3
- export type TablerIconType = React.ForwardRefExoticComponent<
4
- Omit<IconProps, 'ref'> & React.RefAttributes<Icon>
5
- >;
3
+ export type TablerIconType = typeof IconCircle;
6
4
 
7
5
  export type InvenTreeIconType = {
8
6
  [key: string]: TablerIconType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inventreedb/ui",
3
3
  "description": "UI components for the InvenTree project",
4
- "version": "0.8.1",
4
+ "version": "0.9.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -40,14 +40,15 @@
40
40
  "compile": "lingui compile --typescript"
41
41
  },
42
42
  "dependencies": {
43
- "@codemirror/autocomplete": "6.18.7",
44
- "@codemirror/lang-liquid": "6.3.0",
45
- "@codemirror/language": "6.11.3",
46
- "@codemirror/lint": "6.8.5",
47
- "@codemirror/search": "6.5.11",
48
- "@codemirror/state": "6.5.2",
49
- "@codemirror/theme-one-dark": "6.1.3",
50
- "@codemirror/view": "6.38.2",
43
+ "@codecov/vite-plugin": "^1.9.1",
44
+ "@codemirror/autocomplete": "^6.20.1",
45
+ "@codemirror/lang-liquid": "^6.3.2",
46
+ "@codemirror/language": "^6.12.2",
47
+ "@codemirror/lint": "^6.9.5",
48
+ "@codemirror/search": "^6.6.0",
49
+ "@codemirror/state": "^6.5.4",
50
+ "@codemirror/theme-one-dark": "^6.1.3",
51
+ "@codemirror/view": "6.39.16",
51
52
  "@emotion/react": "^11.13.3",
52
53
  "@fortawesome/fontawesome-svg-core": "^7.0.0",
53
54
  "@fortawesome/free-regular-svg-icons": "^7.0.0",
@@ -58,8 +59,8 @@
58
59
  "@fullcalendar/interaction": "^6.1.15",
59
60
  "@fullcalendar/react": "^6.1.15",
60
61
  "@github/webauthn-json": "^2.1.1",
61
- "@lingui/core": "^5.3.1",
62
- "@lingui/react": "^5.3.1",
62
+ "@lingui/core": "^5.9.2",
63
+ "@lingui/react": "^5.9.2",
63
64
  "@mantine/carousel": "^8.2.7",
64
65
  "@mantine/charts": "^8.2.7",
65
66
  "@mantine/core": "^8.2.7",
@@ -72,14 +73,14 @@
72
73
  "@mantine/spotlight": "^8.2.7",
73
74
  "@mantine/vanilla-extract": "^8.2.7",
74
75
  "@messageformat/date-skeleton": "^1.1.0",
75
- "@sentry/react": "^10.7.0",
76
+ "@sentry/react": "^10.43.0",
76
77
  "@tabler/icons-react": "^3.17.0",
77
78
  "@tanstack/react-query": "^5.56.2",
78
- "@uiw/codemirror-theme-vscode": "4.25.1",
79
- "@uiw/react-codemirror": "4.25.1",
79
+ "@uiw/codemirror-theme-vscode": "4.25.7",
80
+ "@uiw/react-codemirror": "^4.25.7",
80
81
  "@uiw/react-split": "^5.9.3",
81
- "@vanilla-extract/css": "^1.17.1",
82
- "axios": "^1.8.4",
82
+ "@vanilla-extract/css": "^1.18.0",
83
+ "axios": "^1.13.6",
83
84
  "clsx": "^2.1.1",
84
85
  "codemirror": "6.0.2",
85
86
  "dayjs": "^1.11.13",
@@ -91,11 +92,11 @@
91
92
  "mantine-contextmenu": "^8.2.0",
92
93
  "mantine-datatable": "^8.2.0",
93
94
  "qrcode": "^1.5.4",
94
- "react": "^19.1.2",
95
- "react-dom": "^19.1.2",
95
+ "react": "^19.2.4",
96
+ "react-dom": "^19.2.4",
96
97
  "react-grid-layout": "1.4.4",
97
98
  "react-hook-form": "^7.62.0",
98
- "react-is": "^19.1.2",
99
+ "react-is": "^19.2.4",
99
100
  "react-router-dom": "^6.26.2",
100
101
  "react-select": "^5.9.0",
101
102
  "react-simplemde-editor": "^5.2.0",
@@ -105,35 +106,37 @@
105
106
  "zustand": "^5.0.8"
106
107
  },
107
108
  "devDependencies": {
108
- "@babel/core": "^7.26.10",
109
- "@babel/preset-react": "^7.26.3",
110
- "@babel/preset-typescript": "^7.27.0",
111
- "@babel/runtime": "^7.27.0",
112
- "@codecov/vite-plugin": "^1.9.0",
113
- "@lingui/babel-plugin-lingui-macro": "^5.3.1",
114
- "@lingui/cli": "^5.3.1",
115
- "@lingui/macro": "^5.3.1",
116
- "@playwright/test": "1.56.0",
117
- "@types/node": "^24.3.0",
109
+ "@babel/core": "^7.29.0",
110
+ "@babel/preset-react": "^7.28.5",
111
+ "@babel/preset-typescript": "^7.28.5",
112
+ "@babel/runtime": "^7.28.6",
113
+ "@lingui/babel-plugin-lingui-macro": "^5.9.2",
114
+ "@lingui/cli": "^5.9.2",
115
+ "@lingui/macro": "^5.9.2",
116
+ "@playwright/test": "^1.58.2",
117
+ "@types/node": "^25.5.0",
118
118
  "@types/qrcode": "^1.5.5",
119
- "@types/react": "^19.1.10",
120
- "@types/react-dom": "^19.1.7",
119
+ "@types/react": "^19.2.14",
120
+ "@types/react-dom": "^19.2.3",
121
121
  "@types/react-grid-layout": "^1.3.5",
122
122
  "@types/react-router-dom": "^5.3.3",
123
123
  "@types/react-window": "^1.8.8",
124
- "@vanilla-extract/vite-plugin": "^5.1.1",
125
- "@vitejs/plugin-react": "^5.0.2",
124
+ "@vanilla-extract/vite-plugin": "^5.1.4",
125
+ "@vitejs/plugin-react": "^5.2.0",
126
126
  "babel-plugin-macros": "^3.1.0",
127
- "nyc": "^17.1.0",
127
+ "nyc": "^18.0.0",
128
128
  "otpauth": "^9.4.1",
129
129
  "path": "^0.12.7",
130
- "rollup": "^4.0.0",
131
- "rollup-plugin-license": "^3.5.3",
132
- "typescript": "^5.8.2",
130
+ "rollup": "^4.59.0",
131
+ "rollup-plugin-license": "^3.7.0",
132
+ "typescript": "^5.9.3",
133
133
  "vite": "7.1.11",
134
134
  "vite-plugin-babel-macros": "^1.0.6",
135
- "vite-plugin-dts": "^4.5.3",
135
+ "vite-plugin-dts": "^4.5.4",
136
136
  "vite-plugin-externals": "^0.6.2",
137
- "vite-plugin-istanbul": "^6.0.2"
137
+ "vite-plugin-istanbul": "^8.0.0"
138
+ },
139
+ "resolutions": {
140
+ "undici": "^6.24.0"
138
141
  }
139
142
  }