@inventreedb/ui 0.11.2 → 1.4.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 (158) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/.vite/manifest.json +92 -5
  3. package/dist/components/Boundary.js +16 -7
  4. package/dist/components/Boundary.js.map +1 -1
  5. package/dist/components/InvenTreeTable.js +4 -3
  6. package/dist/components/InvenTreeTable.js.map +1 -1
  7. package/dist/components/RowActions.js +3 -2
  8. package/dist/components/RowActions.js.map +1 -1
  9. package/dist/components/StylishText.d.ts +6 -0
  10. package/dist/components/StylishText.js +36 -0
  11. package/dist/components/StylishText.js.map +1 -0
  12. package/dist/components/nav/DetailDrawer.css.d.ts +1 -0
  13. package/dist/components/nav/DetailDrawer.css.js +6 -0
  14. package/dist/components/nav/DetailDrawer.css.js.map +1 -0
  15. package/dist/components/nav/DetailDrawer.d.ts +22 -0
  16. package/dist/components/nav/DetailDrawer.js +66 -0
  17. package/dist/components/nav/DetailDrawer.js.map +1 -0
  18. package/dist/enums/ApiEndpoints.d.ts +1 -0
  19. package/dist/enums/ApiEndpoints.js +1 -0
  20. package/dist/enums/ApiEndpoints.js.map +1 -1
  21. package/dist/enums/ModelInformation.js +1 -0
  22. package/dist/enums/ModelInformation.js.map +1 -1
  23. package/dist/enums/ModelType.d.ts +9 -0
  24. package/dist/enums/ModelType.js.map +1 -1
  25. package/dist/enums/Roles.d.ts +1 -0
  26. package/dist/enums/Roles.js +1 -0
  27. package/dist/enums/Roles.js.map +1 -1
  28. package/dist/functions/Events.js +4 -3
  29. package/dist/functions/Events.js.map +1 -1
  30. package/dist/functions/Navigation.js +5 -2
  31. package/dist/functions/Navigation.js.map +1 -1
  32. package/dist/functions/Plugins.js +4 -2
  33. package/dist/functions/Plugins.js.map +1 -1
  34. package/dist/hooks/MonitorBackgroundTask.js +10 -8
  35. package/dist/hooks/MonitorBackgroundTask.js.map +1 -1
  36. package/dist/hooks/MonitorDataOutput.js +4 -3
  37. package/dist/hooks/MonitorDataOutput.js.map +1 -1
  38. package/dist/hooks/UseFilterSet.js +7 -6
  39. package/dist/hooks/UseFilterSet.js.map +1 -1
  40. package/dist/hooks/UseTable.js +1 -1
  41. package/dist/index.d.ts +5 -1
  42. package/dist/index.js +8 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/node_modules/@mantine/hooks/esm/use-debounced-value/use-debounced-value.js +40 -15
  45. package/dist/node_modules/@mantine/hooks/esm/use-debounced-value/use-debounced-value.js.map +1 -1
  46. package/dist/node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.js +1 -1
  47. package/dist/node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.js.map +1 -1
  48. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/create-storage.js +57 -62
  49. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/create-storage.js.map +1 -1
  50. package/dist/node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.js.map +1 -1
  51. package/dist/node_modules/@mantine/hooks/esm/use-window-event/use-window-event.js +5 -3
  52. package/dist/node_modules/@mantine/hooks/esm/use-window-event/use-window-event.js.map +1 -1
  53. package/dist/node_modules/@mantine/hooks/esm/utils/random-id/random-id.js.map +1 -1
  54. package/dist/node_modules/@remix-run/router/dist/router.js +458 -0
  55. package/dist/node_modules/@remix-run/router/dist/router.js.map +1 -0
  56. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js +2 -2
  57. package/dist/node_modules/@sentry/browser/build/npm/esm/prod/report-dialog.js.map +1 -1
  58. package/dist/node_modules/@sentry/core/build/esm/scope.js +6 -5
  59. package/dist/node_modules/@sentry/core/build/esm/scope.js.map +1 -1
  60. package/dist/node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js +1 -1
  61. package/dist/node_modules/@sentry/core/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
  62. package/dist/node_modules/@sentry/core/build/esm/utils/is.js +1 -1
  63. package/dist/node_modules/@sentry/core/build/esm/utils/is.js.map +1 -1
  64. package/dist/node_modules/@sentry/core/build/esm/utils/misc.js +1 -1
  65. package/dist/node_modules/@sentry/core/build/esm/utils/misc.js.map +1 -1
  66. package/dist/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js +1 -1
  67. package/dist/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js.map +1 -1
  68. package/dist/node_modules/@sentry/core/build/esm/utils/time.js +1 -1
  69. package/dist/node_modules/@sentry/core/build/esm/utils/time.js.map +1 -1
  70. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +6 -0
  71. package/dist/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js.map +1 -1
  72. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +6 -0
  73. package/dist/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js.map +1 -1
  74. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustments.js +6 -0
  75. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustments.js.map +1 -1
  76. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +6 -0
  77. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js.map +1 -1
  78. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +6 -0
  79. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js.map +1 -1
  80. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +14 -0
  81. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js.map +1 -0
  82. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js +6 -0
  83. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheck.js.map +1 -1
  84. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js +6 -0
  85. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleX.js.map +1 -1
  86. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +6 -0
  87. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js.map +1 -1
  88. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js +6 -0
  89. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.js.map +1 -1
  90. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js +6 -0
  91. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.js.map +1 -1
  92. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js +6 -0
  93. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.js.map +1 -1
  94. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js +6 -0
  95. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.js.map +1 -1
  96. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +6 -0
  97. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js.map +1 -1
  98. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +6 -0
  99. package/dist/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js.map +1 -1
  100. package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js +31 -20
  101. package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -1
  102. package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js +27 -17
  103. package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -1
  104. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js +179 -177
  105. package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
  106. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +31 -21
  107. package/dist/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -1
  108. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +1 -1
  109. package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
  110. package/dist/node_modules/@tanstack/react-query/build/modern/suspense.js +1 -1
  111. package/dist/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -1
  112. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +7 -4
  113. package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
  114. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +10 -1
  115. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
  116. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +10 -1
  117. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -1
  118. package/dist/node_modules/react-router/dist/index.js +714 -0
  119. package/dist/node_modules/react-router/dist/index.js.map +1 -0
  120. package/dist/node_modules/react-router-dom/dist/index.js +536 -0
  121. package/dist/node_modules/react-router-dom/dist/index.js.map +1 -0
  122. package/dist/node_modules/zustand/esm/react/shallow.js +13 -0
  123. package/dist/node_modules/zustand/esm/react/shallow.js.map +1 -0
  124. package/dist/node_modules/zustand/esm/vanilla/shallow.js +57 -0
  125. package/dist/node_modules/zustand/esm/vanilla/shallow.js.map +1 -0
  126. package/dist/states/LocalLibState.d.ts +17 -0
  127. package/dist/states/LocalLibState.js +16 -0
  128. package/dist/states/LocalLibState.js.map +1 -0
  129. package/dist/states/StoredTableState.js +2 -1
  130. package/dist/states/StoredTableState.js.map +1 -1
  131. package/dist/states/types.d.ts +3 -0
  132. package/dist/types/Forms.d.ts +13 -6
  133. package/dist/types/Panel.d.ts +26 -0
  134. package/dist/types/Plugins.d.ts +14 -2
  135. package/dist/types/Plugins.js +2 -2
  136. package/dist/types/Plugins.js.map +1 -1
  137. package/dist/types/Rendering.d.ts +53 -0
  138. package/dist/types/Tables.d.ts +5 -1
  139. package/dist/ui.css +4 -0
  140. package/lib/components/Boundary.tsx +6 -3
  141. package/lib/components/RowActions.tsx +2 -2
  142. package/lib/components/StylishText.tsx +46 -0
  143. package/lib/components/nav/DetailDrawer.css.ts +6 -0
  144. package/lib/components/nav/DetailDrawer.tsx +108 -0
  145. package/lib/enums/ApiEndpoints.tsx +1 -0
  146. package/lib/enums/ModelInformation.tsx +1 -0
  147. package/lib/enums/ModelType.tsx +13 -0
  148. package/lib/enums/Roles.tsx +1 -0
  149. package/lib/hooks/UseFilterSet.tsx +8 -8
  150. package/lib/index.ts +16 -0
  151. package/lib/states/LocalLibState.tsx +23 -0
  152. package/lib/states/types.tsx +7 -0
  153. package/lib/types/Forms.tsx +13 -6
  154. package/lib/types/Panel.tsx +30 -0
  155. package/lib/types/Plugins.tsx +20 -1
  156. package/lib/types/Rendering.tsx +60 -0
  157. package/lib/types/Tables.tsx +5 -1
  158. package/package.json +20 -17
@@ -1 +1 @@
1
- {"version":3,"file":"UseFilterSet.js","sources":["../../lib/hooks/UseFilterSet.tsx"],"sourcesContent":["import { useLocalStorage } from '@mantine/hooks';\nimport { useCallback, useMemo } from 'react';\nimport type { FilterSetState, TableFilter } from '../types/Filters';\n\nexport default function useFilterSet(\n filterKey: string,\n initialFilters?: TableFilter[]\n): FilterSetState {\n // Array of active filters (saved to local storage)\n const [storedFilters, setStoredFilters] = useLocalStorage<\n TableFilter[] | null\n >({\n key: `inventree-filterset-${filterKey}`,\n defaultValue: null,\n sync: false,\n getInitialValueInEffect: false\n });\n\n const activeFilters: TableFilter[] = useMemo(() => {\n if (storedFilters == null) {\n // If there are no stored filters, set initial values\n const filters = initialFilters || [];\n setStoredFilters(filters);\n return filters;\n }\n return storedFilters || [];\n }, [storedFilters]);\n\n // Callback to clear all active filters from the table\n const clearActiveFilters = useCallback(() => {\n setStoredFilters([]);\n }, []);\n\n const setActiveFilters = useCallback(\n (filters: TableFilter[]) => {\n setStoredFilters(filters);\n },\n [setStoredFilters]\n );\n\n return {\n filterKey,\n activeFilters,\n setActiveFilters,\n clearActiveFilters\n };\n}\n"],"names":["useFilterSet","filterKey","initialFilters","storedFilters","setStoredFilters","useLocalStorage","key","defaultValue","sync","getInitialValueInEffect","activeFilters","useMemo","filters","clearActiveFilters","useCallback","setActiveFilters"],"mappings":";AACA,MAAA,cAAA,OAAA,OAAA,EAAA;;AAGA,SAAwBA,aACtBC,WACAC,gBACgB;AAEhB,QAAM,CAACC,eAAeC,gBAAgB,IAAIC,gBAExC;AAAA,IACAC,KAAK,uBAAuBL,SAAS;AAAA,IACrCM,cAAc;AAAA,IACdC,MAAM;AAAA,IACNC,yBAAyB;AAAA,EAAA,CAC1B;AAED,QAAMC,gBAA+BC,QAAQ,MAAM;AACjD,QAAIR,iBAAiB,MAAM;AAEzB,YAAMS,UAAUV,kBAAkB,CAAA;AAClCE,uBAAiBQ,OAAO;AACxB,aAAOA;AAAAA,IACT;AACA,WAAOT,iBAAiB,CAAA;AAAA,EAC1B,GAAG,CAACA,aAAa,CAAC;AAGlB,QAAMU,qBAAqBC,YAAY,MAAM;AAC3CV,qBAAiB,CAAA,CAAE;AAAA,EACrB,GAAG,CAAA,CAAE;AAEL,QAAMW,mBAAmBD,YACvB,CAACF,YAA2B;AAC1BR,qBAAiBQ,OAAO;AAAA,EAC1B,GACA,CAACR,gBAAgB,CACnB;AAEA,SAAO;AAAA,IACLH;AAAAA,IACAS;AAAAA,IACAK;AAAAA,IACAF;AAAAA,EAAAA;AAEJ;"}
1
+ {"version":3,"file":"UseFilterSet.js","sources":["../../lib/hooks/UseFilterSet.tsx"],"sourcesContent":["import { useLocalStorage } from '@mantine/hooks';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport type { FilterSetState, TableFilter } from '../types/Filters';\n\nexport default function useFilterSet(\n filterKey: string,\n initialFilters?: TableFilter[]\n): FilterSetState {\n // Array of active filters (saved to local storage)\n const [storedFilters, setStoredFilters] = useLocalStorage<\n TableFilter[] | null\n >({\n key: `inventree-filterset-${filterKey}`,\n defaultValue: null,\n sync: false,\n getInitialValueInEffect: false\n });\n\n useEffect(() => {\n if (storedFilters == null) {\n setStoredFilters(initialFilters || []);\n }\n }, [storedFilters, initialFilters, setStoredFilters]);\n\n const activeFilters: TableFilter[] = useMemo(() => {\n return storedFilters ?? initialFilters ?? [];\n }, [storedFilters, initialFilters]);\n\n // Callback to clear all active filters from the table\n const clearActiveFilters = useCallback(() => {\n setStoredFilters([]);\n }, []);\n\n const setActiveFilters = useCallback(\n (filters: TableFilter[]) => {\n setStoredFilters(filters);\n },\n [setStoredFilters]\n );\n\n return {\n filterKey,\n activeFilters,\n setActiveFilters,\n clearActiveFilters\n };\n}\n"],"names":["useFilterSet","filterKey","initialFilters","storedFilters","setStoredFilters","useLocalStorage","key","defaultValue","sync","getInitialValueInEffect","useEffect","activeFilters","useMemo","clearActiveFilters","useCallback","setActiveFilters","filters"],"mappings":";AACA,MAAA,cAAA,OAAA,OAAA,EAAA;;;AAGA,SAAwBA,aACtBC,WACAC,gBACgB;AAEhB,QAAM,CAACC,eAAeC,gBAAgB,IAAIC,gBAExC;AAAA,IACAC,KAAK,uBAAuBL,SAAS;AAAA,IACrCM,cAAc;AAAA,IACdC,MAAM;AAAA,IACNC,yBAAyB;AAAA,EAAA,CAC1B;AAEDC,YAAU,MAAM;AACd,QAAIP,iBAAiB,MAAM;AACzBC,uBAAiBF,kBAAkB,EAAE;AAAA,IACvC;AAAA,EACF,GAAG,CAACC,eAAeD,gBAAgBE,gBAAgB,CAAC;AAEpD,QAAMO,gBAA+BC,QAAQ,MAAM;AACjD,WAAOT,iBAAiBD,kBAAkB,CAAA;AAAA,EAC5C,GAAG,CAACC,eAAeD,cAAc,CAAC;AAGlC,QAAMW,qBAAqBC,YAAY,MAAM;AAC3CV,qBAAiB,CAAA,CAAE;AAAA,EACrB,GAAG,CAAA,CAAE;AAEL,QAAMW,mBAAmBD,YACvB,CAACE,YAA2B;AAC1BZ,qBAAiBY,OAAO;AAAA,EAC1B,GACA,CAACZ,gBAAgB,CACnB;AAEA,SAAO;AAAA,IACLH;AAAAA,IACAU;AAAAA,IACAI;AAAAA,IACAF;AAAAA,EAAAA;AAEJ;"}
@@ -1,5 +1,5 @@
1
- import useFilterSet from "./UseFilterSet.js";
2
1
  import { randomId } from "../node_modules/@mantine/hooks/esm/utils/random-id/random-id.js";
2
+ import useFilterSet from "./UseFilterSet.js";
3
3
  const useCallback = window["React"].useCallback;
4
4
  const useMemo = window["React"].useMemo;
5
5
  const useState = window["React"].useState;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,8 @@ export { ModelType } from './enums/ModelType';
4
4
  export type { ModelDict } from './enums/ModelInformation';
5
5
  export { UserRoles, UserPermissions } from './enums/Roles';
6
6
  export type { InvenTreePluginContext, InvenTreeFormsContext, InvenTreeTablesContext, ImporterDrawerContext, PluginVersion, StockAdjustmentFormsContext } from './types/Plugins';
7
- export type { RowAction, RowViewProps, TableColumn, TableColumnProps, InvenTreeTableProps, InvenTreeTableRenderProps } from './types/Tables';
7
+ export type { PanelIndicatorType, PanelType, PanelGroupType } from './types/Panel';
8
+ export type { RowAction, RowViewProps, TableColumn, TableColumnProps, TableState, InvenTreeTableProps, InvenTreeTableRenderProps } from './types/Tables';
8
9
  export type { TableFilterChoice, TableFilterType, TableFilter, FilterSetState } from './types/Filters';
9
10
  export type { ApiFormFieldChoice, ApiFormFieldHeader, ApiFormFieldType, ApiFormFieldSet, ApiFormProps, ApiFormModalProps, BulkEditApiFormModalProps } from './types/Forms';
10
11
  export type { UseModalProps, UseModalReturn } from './types/Modals';
@@ -31,4 +32,7 @@ export { default as useMonitorDataOutput, type MonitorDataOutputProps } from './
31
32
  export { default as useMonitorBackgroundTask, type MonitorBackgroundTaskProps } from './hooks/MonitorBackgroundTask';
32
33
  export { default as useFilterSet } from './hooks/UseFilterSet';
33
34
  export { default as useTable, type TableStateExtraProps } from './hooks/UseTable';
35
+ export { type DrawerProps, DetailDrawer, DetailDrawerLink, DetailDrawerComponent } from './components/nav/DetailDrawer';
36
+ export { StylishText } from './components/StylishText';
34
37
  export { type StoredTableStateProps, useStoredTableState } from './states/StoredTableState';
38
+ export { useLocalLibState } from './states/LocalLibState';
package/dist/index.js CHANGED
@@ -25,7 +25,10 @@ import { default as default3 } from "./hooks/MonitorDataOutput.js";
25
25
  import { default as default4 } from "./hooks/MonitorBackgroundTask.js";
26
26
  import { default as default5 } from "./hooks/UseFilterSet.js";
27
27
  import { default as default6 } from "./hooks/UseTable.js";
28
+ import { DetailDrawer, DetailDrawerComponent, DetailDrawerLink } from "./components/nav/DetailDrawer.js";
29
+ import { StylishText } from "./components/StylishText.js";
28
30
  import { useStoredTableState } from "./states/StoredTableState.js";
31
+ import { useLocalLibState } from "./states/LocalLibState.js";
29
32
  export {
30
33
  ActionButton,
31
34
  AddItemButton,
@@ -35,6 +38,9 @@ export {
35
38
  CopyButton,
36
39
  CopyableCell,
37
40
  DefaultFallback,
41
+ DetailDrawer,
42
+ DetailDrawerComponent,
43
+ DetailDrawerLink,
38
44
  INVENTREE_MANTINE_VERSION,
39
45
  INVENTREE_PLUGIN_VERSION,
40
46
  INVENTREE_REACT_DOM_VERSION,
@@ -50,6 +56,7 @@ export {
50
56
  RowEditAction,
51
57
  RowViewAction,
52
58
  SearchInput,
59
+ StylishText,
53
60
  TableColumnSelect,
54
61
  UserPermissions,
55
62
  UserRoles,
@@ -72,6 +79,7 @@ export {
72
79
  shortenString,
73
80
  showTimeoutNotification,
74
81
  default5 as useFilterSet,
82
+ useLocalLibState,
75
83
  default4 as useMonitorBackgroundTask,
76
84
  default3 as useMonitorDataOutput,
77
85
  useStoredTableState,
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,32 +1,57 @@
1
- const useState = window["React"].useState;
2
- const useRef = window["React"].useRef;
3
1
  const useCallback = window["React"].useCallback;
4
2
  const useEffect = window["React"].useEffect;
3
+ const useRef = window["React"].useRef;
4
+ const useState = window["React"].useState;
5
5
  function useDebouncedValue(value, wait, options = { leading: false }) {
6
6
  const [_value, setValue] = useState(value);
7
7
  const mountedRef = useRef(false);
8
8
  const timeoutRef = useRef(null);
9
9
  const cooldownRef = useRef(false);
10
- const cancel = useCallback(() => window.clearTimeout(timeoutRef.current), []);
10
+ const latestValueRef = useRef(value);
11
+ latestValueRef.current = value;
12
+ const cancel = useCallback(() => {
13
+ window.clearTimeout(timeoutRef.current);
14
+ timeoutRef.current = null;
15
+ cooldownRef.current = false;
16
+ }, []);
17
+ const flush = useCallback(() => {
18
+ if (timeoutRef.current) {
19
+ cancel();
20
+ cooldownRef.current = false;
21
+ setValue(latestValueRef.current);
22
+ }
23
+ }, []);
11
24
  useEffect(() => {
12
- if (mountedRef.current) {
13
- if (!cooldownRef.current && options.leading) {
14
- cooldownRef.current = true;
25
+ if (mountedRef.current) if (!cooldownRef.current && options.leading) {
26
+ cooldownRef.current = true;
27
+ setValue(value);
28
+ timeoutRef.current = window.setTimeout(() => {
29
+ cooldownRef.current = false;
30
+ }, wait);
31
+ } else {
32
+ cancel();
33
+ timeoutRef.current = window.setTimeout(() => {
34
+ cooldownRef.current = false;
15
35
  setValue(value);
16
- } else {
17
- cancel();
18
- timeoutRef.current = window.setTimeout(() => {
19
- cooldownRef.current = false;
20
- setValue(value);
21
- }, wait);
22
- }
36
+ }, wait);
23
37
  }
24
- }, [value, options.leading, wait]);
38
+ }, [
39
+ value,
40
+ options.leading,
41
+ wait
42
+ ]);
25
43
  useEffect(() => {
26
44
  mountedRef.current = true;
27
45
  return cancel;
28
46
  }, []);
29
- return [_value, cancel];
47
+ return [
48
+ _value,
49
+ cancel,
50
+ {
51
+ cancel,
52
+ flush
53
+ }
54
+ ];
30
55
  }
31
56
  export {
32
57
  useDebouncedValue
@@ -1 +1 @@
1
- {"version":3,"file":"use-debounced-value.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-debounced-value/use-debounced-value.mjs"],"sourcesContent":["'use client';\nimport { useState, useRef, useCallback, useEffect } from 'react';\n\nfunction useDebouncedValue(value, wait, options = { leading: false }) {\n const [_value, setValue] = useState(value);\n const mountedRef = useRef(false);\n const timeoutRef = useRef(null);\n const cooldownRef = useRef(false);\n const cancel = useCallback(() => window.clearTimeout(timeoutRef.current), []);\n useEffect(() => {\n if (mountedRef.current) {\n if (!cooldownRef.current && options.leading) {\n cooldownRef.current = true;\n setValue(value);\n } else {\n cancel();\n timeoutRef.current = window.setTimeout(() => {\n cooldownRef.current = false;\n setValue(value);\n }, wait);\n }\n }\n }, [value, options.leading, wait]);\n useEffect(() => {\n mountedRef.current = true;\n return cancel;\n }, []);\n return [_value, cancel];\n}\n\nexport { useDebouncedValue };\n//# sourceMappingURL=use-debounced-value.mjs.map\n"],"names":[],"mappings":"AACA,MAAA,WAAA,OAAA,OAAA,EAAA;;;;AAEA,SAAS,kBAAkB,OAAO,MAAM,UAAU,EAAE,SAAS,SAAS;AACpE,QAAM,CAAC,QAAQ,QAAQ,IAAI,SAAS,KAAK;AACzC,QAAM,aAAa,OAAO,KAAK;AAC/B,QAAM,aAAa,OAAO,IAAI;AAC9B,QAAM,cAAc,OAAO,KAAK;AAChC,QAAM,SAAS,YAAY,MAAM,OAAO,aAAa,WAAW,OAAO,GAAG,EAAE;AAC5E,YAAU,MAAM;AACd,QAAI,WAAW,SAAS;AACtB,UAAI,CAAC,YAAY,WAAW,QAAQ,SAAS;AAC3C,oBAAY,UAAU;AACtB,iBAAS,KAAK;AAAA,MAChB,OAAO;AACL,eAAM;AACN,mBAAW,UAAU,OAAO,WAAW,MAAM;AAC3C,sBAAY,UAAU;AACtB,mBAAS,KAAK;AAAA,QAChB,GAAG,IAAI;AAAA,MACT;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,QAAQ,SAAS,IAAI,CAAC;AACjC,YAAU,MAAM;AACd,eAAW,UAAU;AACrB,WAAO;AAAA,EACT,GAAG,CAAA,CAAE;AACL,SAAO,CAAC,QAAQ,MAAM;AACxB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"use-debounced-value.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-debounced-value/use-debounced-value.mjs"],"sourcesContent":["\"use client\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n//#region packages/@mantine/hooks/src/use-debounced-value/use-debounced-value.ts\nfunction useDebouncedValue(value, wait, options = { leading: false }) {\n\tconst [_value, setValue] = useState(value);\n\tconst mountedRef = useRef(false);\n\tconst timeoutRef = useRef(null);\n\tconst cooldownRef = useRef(false);\n\tconst latestValueRef = useRef(value);\n\tlatestValueRef.current = value;\n\tconst cancel = useCallback(() => {\n\t\twindow.clearTimeout(timeoutRef.current);\n\t\ttimeoutRef.current = null;\n\t\tcooldownRef.current = false;\n\t}, []);\n\tconst flush = useCallback(() => {\n\t\tif (timeoutRef.current) {\n\t\t\tcancel();\n\t\t\tcooldownRef.current = false;\n\t\t\tsetValue(latestValueRef.current);\n\t\t}\n\t}, []);\n\tuseEffect(() => {\n\t\tif (mountedRef.current) if (!cooldownRef.current && options.leading) {\n\t\t\tcooldownRef.current = true;\n\t\t\tsetValue(value);\n\t\t\ttimeoutRef.current = window.setTimeout(() => {\n\t\t\t\tcooldownRef.current = false;\n\t\t\t}, wait);\n\t\t} else {\n\t\t\tcancel();\n\t\t\ttimeoutRef.current = window.setTimeout(() => {\n\t\t\t\tcooldownRef.current = false;\n\t\t\t\tsetValue(value);\n\t\t\t}, wait);\n\t\t}\n\t}, [\n\t\tvalue,\n\t\toptions.leading,\n\t\twait\n\t]);\n\tuseEffect(() => {\n\t\tmountedRef.current = true;\n\t\treturn cancel;\n\t}, []);\n\treturn [\n\t\t_value,\n\t\tcancel,\n\t\t{\n\t\t\tcancel,\n\t\t\tflush\n\t\t}\n\t];\n}\n//#endregion\nexport { useDebouncedValue };\n\n//# sourceMappingURL=use-debounced-value.mjs.map"],"names":[],"mappings":"AACA,MAAA,cAAA,OAAA,OAAA,EAAA;;;;AAEA,SAAS,kBAAkB,OAAO,MAAM,UAAU,EAAE,SAAS,SAAS;AACrE,QAAM,CAAC,QAAQ,QAAQ,IAAI,SAAS,KAAK;AACzC,QAAM,aAAa,OAAO,KAAK;AAC/B,QAAM,aAAa,OAAO,IAAI;AAC9B,QAAM,cAAc,OAAO,KAAK;AAChC,QAAM,iBAAiB,OAAO,KAAK;AACnC,iBAAe,UAAU;AACzB,QAAM,SAAS,YAAY,MAAM;AAChC,WAAO,aAAa,WAAW,OAAO;AACtC,eAAW,UAAU;AACrB,gBAAY,UAAU;AAAA,EACvB,GAAG,CAAA,CAAE;AACL,QAAM,QAAQ,YAAY,MAAM;AAC/B,QAAI,WAAW,SAAS;AACvB,aAAM;AACN,kBAAY,UAAU;AACtB,eAAS,eAAe,OAAO;AAAA,IAChC;AAAA,EACD,GAAG,CAAA,CAAE;AACL,YAAU,MAAM;AACf,QAAI,WAAW,QAAS,KAAI,CAAC,YAAY,WAAW,QAAQ,SAAS;AACpE,kBAAY,UAAU;AACtB,eAAS,KAAK;AACd,iBAAW,UAAU,OAAO,WAAW,MAAM;AAC5C,oBAAY,UAAU;AAAA,MACvB,GAAG,IAAI;AAAA,IACR,OAAO;AACN,aAAM;AACN,iBAAW,UAAU,OAAO,WAAW,MAAM;AAC5C,oBAAY,UAAU;AACtB,iBAAS,KAAK;AAAA,MACf,GAAG,IAAI;AAAA,IACR;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,EACF,CAAE;AACD,YAAU,MAAM;AACf,eAAW,UAAU;AACrB,WAAO;AAAA,EACR,GAAG,CAAA,CAAE;AACL,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,IACH;AAAA,EACA;AACA;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
- const useState = window["React"].useState;
2
1
  const useEffect = window["React"].useEffect;
2
+ const useState = window["React"].useState;
3
3
  function useDocumentVisibility() {
4
4
  const [documentVisibility, setDocumentVisibility] = useState("visible");
5
5
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"use-document-visibility.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.mjs"],"sourcesContent":["'use client';\nimport { useState, useEffect } from 'react';\n\nfunction useDocumentVisibility() {\n const [documentVisibility, setDocumentVisibility] = useState(\"visible\");\n useEffect(() => {\n setDocumentVisibility(document.visibilityState);\n const listener = () => setDocumentVisibility(document.visibilityState);\n document.addEventListener(\"visibilitychange\", listener);\n return () => document.removeEventListener(\"visibilitychange\", listener);\n }, []);\n return documentVisibility;\n}\n\nexport { useDocumentVisibility };\n//# sourceMappingURL=use-document-visibility.mjs.map\n"],"names":[],"mappings":"AACA,MAAA,WAAA,OAAA,OAAA,EAAA;;AAEA,SAAS,wBAAwB;AAC/B,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,SAAS;AACtE,YAAU,MAAM;AACd,0BAAsB,SAAS,eAAe;AAC9C,UAAM,WAAW,MAAM,sBAAsB,SAAS,eAAe;AACrE,aAAS,iBAAiB,oBAAoB,QAAQ;AACtD,WAAO,MAAM,SAAS,oBAAoB,oBAAoB,QAAQ;AAAA,EACxE,GAAG,CAAA,CAAE;AACL,SAAO;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"use-document-visibility.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-document-visibility/use-document-visibility.mjs"],"sourcesContent":["\"use client\";\nimport { useEffect, useState } from \"react\";\n//#region packages/@mantine/hooks/src/use-document-visibility/use-document-visibility.ts\nfunction useDocumentVisibility() {\n\tconst [documentVisibility, setDocumentVisibility] = useState(\"visible\");\n\tuseEffect(() => {\n\t\tsetDocumentVisibility(document.visibilityState);\n\t\tconst listener = () => setDocumentVisibility(document.visibilityState);\n\t\tdocument.addEventListener(\"visibilitychange\", listener);\n\t\treturn () => document.removeEventListener(\"visibilitychange\", listener);\n\t}, []);\n\treturn documentVisibility;\n}\n//#endregion\nexport { useDocumentVisibility };\n\n//# sourceMappingURL=use-document-visibility.mjs.map"],"names":[],"mappings":"AACA,MAAA,YAAA,OAAA,OAAA,EAAA;;AAEA,SAAS,wBAAwB;AAChC,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,SAAS;AACtE,YAAU,MAAM;AACf,0BAAsB,SAAS,eAAe;AAC9C,UAAM,WAAW,MAAM,sBAAsB,SAAS,eAAe;AACrE,aAAS,iBAAiB,oBAAoB,QAAQ;AACtD,WAAO,MAAM,SAAS,oBAAoB,oBAAoB,QAAQ;AAAA,EACvE,GAAG,CAAA,CAAE;AACL,SAAO;AACR;","x_google_ignoreList":[0]}
@@ -1,7 +1,7 @@
1
1
  import { useWindowEvent } from "../use-window-event/use-window-event.js";
2
2
  const useCallback = window["React"].useCallback;
3
- const useState = window["React"].useState;
4
3
  const useEffect = window["React"].useEffect;
4
+ const useState = window["React"].useState;
5
5
  function serializeJSON(value, hookName = "use-local-storage") {
6
6
  try {
7
7
  return JSON.stringify(value);
@@ -36,91 +36,86 @@ function createStorageHandler(type) {
36
36
  try {
37
37
  window[type].removeItem(key);
38
38
  } catch (error) {
39
- console.warn(
40
- "use-local-storage: Failed to remove value from storage, localStorage is blocked"
41
- );
39
+ console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked");
42
40
  }
43
41
  };
44
- return { getItem, setItem, removeItem };
42
+ return {
43
+ getItem,
44
+ setItem,
45
+ removeItem
46
+ };
45
47
  }
46
48
  function createStorage(type, hookName) {
47
49
  const eventName = "mantine-local-storage";
48
50
  const { getItem, setItem, removeItem } = createStorageHandler(type);
49
- return function useStorage({
50
- key,
51
- defaultValue,
52
- getInitialValueInEffect = true,
53
- sync = true,
54
- deserialize = deserializeJSON,
55
- serialize = (value) => serializeJSON(value, hookName)
56
- }) {
57
- const readStorageValue = useCallback(
58
- (skipStorage) => {
59
- let storageBlockedOrSkipped;
60
- try {
61
- storageBlockedOrSkipped = typeof window === "undefined" || !(type in window) || window[type] === null || !!skipStorage;
62
- } catch (_e) {
63
- storageBlockedOrSkipped = true;
64
- }
65
- if (storageBlockedOrSkipped) {
66
- return defaultValue;
67
- }
68
- const storageValue = getItem(key);
69
- return storageValue !== null ? deserialize(storageValue) : defaultValue;
70
- },
71
- [key, defaultValue]
72
- );
51
+ return function useStorage({ key, defaultValue, getInitialValueInEffect = true, sync = true, deserialize = deserializeJSON, serialize = (value) => serializeJSON(value, hookName) }) {
52
+ const readStorageValue = useCallback((skipStorage) => {
53
+ let storageBlockedOrSkipped;
54
+ try {
55
+ storageBlockedOrSkipped = typeof window === "undefined" || !(type in window) || window[type] === null || !!skipStorage;
56
+ } catch (_e) {
57
+ storageBlockedOrSkipped = true;
58
+ }
59
+ if (storageBlockedOrSkipped) return defaultValue;
60
+ const storageValue = getItem(key);
61
+ return storageValue !== null ? deserialize(storageValue) : defaultValue;
62
+ }, [key, defaultValue]);
73
63
  const [value, setValue] = useState(readStorageValue(getInitialValueInEffect));
74
- const setStorageValue = useCallback(
75
- (val) => {
76
- if (val instanceof Function) {
77
- setValue((current) => {
78
- const result = val(current);
79
- setItem(key, serialize(result));
80
- queueMicrotask(() => {
81
- window.dispatchEvent(
82
- new CustomEvent(eventName, { detail: { key, value: val(current) } })
83
- );
84
- });
85
- return result;
86
- });
87
- } else {
88
- setItem(key, serialize(val));
89
- window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: val } }));
90
- setValue(val);
91
- }
92
- },
93
- [key]
94
- );
64
+ const setStorageValue = useCallback((val) => {
65
+ if (val instanceof Function) setValue((current) => {
66
+ const result = val(current);
67
+ setItem(key, serialize(result));
68
+ queueMicrotask(() => {
69
+ window.dispatchEvent(new CustomEvent(eventName, { detail: {
70
+ key,
71
+ value: result
72
+ } }));
73
+ });
74
+ return result;
75
+ });
76
+ else {
77
+ setItem(key, serialize(val));
78
+ window.dispatchEvent(new CustomEvent(eventName, { detail: {
79
+ key,
80
+ value: val
81
+ } }));
82
+ setValue(val);
83
+ }
84
+ }, [key]);
95
85
  const removeStorageValue = useCallback(() => {
96
86
  removeItem(key);
97
87
  setValue(defaultValue);
98
- window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: defaultValue } }));
88
+ window.dispatchEvent(new CustomEvent(eventName, { detail: {
89
+ key,
90
+ value: defaultValue
91
+ } }));
99
92
  }, [key, defaultValue]);
100
93
  useWindowEvent("storage", (event) => {
101
94
  if (sync) {
102
- if (event.storageArea === window[type] && event.key === key) {
103
- setValue(deserialize(event.newValue ?? void 0));
104
- }
95
+ if (event.storageArea === window[type] && event.key === key) setValue(deserialize(event.newValue ?? void 0));
105
96
  }
106
97
  });
107
98
  useWindowEvent(eventName, (event) => {
108
99
  if (sync) {
109
- if (event.detail.key === key) {
110
- setValue(event.detail.value);
111
- }
100
+ if (event.detail.key === key) setValue(event.detail.value);
112
101
  }
113
102
  });
114
103
  useEffect(() => {
115
- if (defaultValue !== void 0 && value === void 0) {
116
- setStorageValue(defaultValue);
117
- }
118
- }, [defaultValue, value, setStorageValue]);
104
+ if (defaultValue !== void 0 && value === void 0) setStorageValue(defaultValue);
105
+ }, [
106
+ defaultValue,
107
+ value,
108
+ setStorageValue
109
+ ]);
119
110
  useEffect(() => {
120
111
  const val = readStorageValue();
121
112
  val !== void 0 && setStorageValue(val);
122
113
  }, [key]);
123
- return [value === void 0 ? defaultValue : value, setStorageValue, removeStorageValue];
114
+ return [
115
+ value === void 0 ? defaultValue : value,
116
+ setStorageValue,
117
+ removeStorageValue
118
+ ];
124
119
  };
125
120
  }
126
121
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"create-storage.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-local-storage/create-storage.mjs"],"sourcesContent":["'use client';\nimport { useCallback, useState, useEffect } from 'react';\nimport { useWindowEvent } from '../use-window-event/use-window-event.mjs';\n\nfunction serializeJSON(value, hookName = \"use-local-storage\") {\n try {\n return JSON.stringify(value);\n } catch (error) {\n throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`);\n }\n}\nfunction deserializeJSON(value) {\n try {\n return value && JSON.parse(value);\n } catch {\n return value;\n }\n}\nfunction createStorageHandler(type) {\n const getItem = (key) => {\n try {\n return window[type].getItem(key);\n } catch (error) {\n console.warn(\"use-local-storage: Failed to get value from storage, localStorage is blocked\");\n return null;\n }\n };\n const setItem = (key, value) => {\n try {\n window[type].setItem(key, value);\n } catch (error) {\n console.warn(\"use-local-storage: Failed to set value to storage, localStorage is blocked\");\n }\n };\n const removeItem = (key) => {\n try {\n window[type].removeItem(key);\n } catch (error) {\n console.warn(\n \"use-local-storage: Failed to remove value from storage, localStorage is blocked\"\n );\n }\n };\n return { getItem, setItem, removeItem };\n}\nfunction createStorage(type, hookName) {\n const eventName = type === \"localStorage\" ? \"mantine-local-storage\" : \"mantine-session-storage\";\n const { getItem, setItem, removeItem } = createStorageHandler(type);\n return function useStorage({\n key,\n defaultValue,\n getInitialValueInEffect = true,\n sync = true,\n deserialize = deserializeJSON,\n serialize = (value) => serializeJSON(value, hookName)\n }) {\n const readStorageValue = useCallback(\n (skipStorage) => {\n let storageBlockedOrSkipped;\n try {\n storageBlockedOrSkipped = typeof window === \"undefined\" || !(type in window) || window[type] === null || !!skipStorage;\n } catch (_e) {\n storageBlockedOrSkipped = true;\n }\n if (storageBlockedOrSkipped) {\n return defaultValue;\n }\n const storageValue = getItem(key);\n return storageValue !== null ? deserialize(storageValue) : defaultValue;\n },\n [key, defaultValue]\n );\n const [value, setValue] = useState(readStorageValue(getInitialValueInEffect));\n const setStorageValue = useCallback(\n (val) => {\n if (val instanceof Function) {\n setValue((current) => {\n const result = val(current);\n setItem(key, serialize(result));\n queueMicrotask(() => {\n window.dispatchEvent(\n new CustomEvent(eventName, { detail: { key, value: val(current) } })\n );\n });\n return result;\n });\n } else {\n setItem(key, serialize(val));\n window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: val } }));\n setValue(val);\n }\n },\n [key]\n );\n const removeStorageValue = useCallback(() => {\n removeItem(key);\n setValue(defaultValue);\n window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: defaultValue } }));\n }, [key, defaultValue]);\n useWindowEvent(\"storage\", (event) => {\n if (sync) {\n if (event.storageArea === window[type] && event.key === key) {\n setValue(deserialize(event.newValue ?? void 0));\n }\n }\n });\n useWindowEvent(eventName, (event) => {\n if (sync) {\n if (event.detail.key === key) {\n setValue(event.detail.value);\n }\n }\n });\n useEffect(() => {\n if (defaultValue !== void 0 && value === void 0) {\n setStorageValue(defaultValue);\n }\n }, [defaultValue, value, setStorageValue]);\n useEffect(() => {\n const val = readStorageValue();\n val !== void 0 && setStorageValue(val);\n }, [key]);\n return [value === void 0 ? defaultValue : value, setStorageValue, removeStorageValue];\n };\n}\nfunction readValue(type) {\n const { getItem } = createStorageHandler(type);\n return function read({\n key,\n defaultValue,\n deserialize = deserializeJSON\n }) {\n let storageBlockedOrSkipped;\n try {\n storageBlockedOrSkipped = typeof window === \"undefined\" || !(type in window) || window[type] === null;\n } catch (_e) {\n storageBlockedOrSkipped = true;\n }\n if (storageBlockedOrSkipped) {\n return defaultValue;\n }\n const storageValue = getItem(key);\n return storageValue !== null ? deserialize(storageValue) : defaultValue;\n };\n}\n\nexport { createStorage, readValue };\n//# sourceMappingURL=create-storage.mjs.map\n"],"names":[],"mappings":";AACA,MAAA,cAAA,OAAA,OAAA,EAAA;;;AAGA,SAAS,cAAc,OAAO,WAAW,qBAAqB;AAC5D,MAAI;AACF,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,kBAAkB,QAAQ,iCAAiC;AAAA,EAC7E;AACF;AACA,SAAS,gBAAgB,OAAO;AAC9B,MAAI;AACF,WAAO,SAAS,KAAK,MAAM,KAAK;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AACA,SAAS,qBAAqB,MAAM;AAClC,QAAM,UAAU,CAAC,QAAQ;AACvB,QAAI;AACF,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AAC;AACzC,cAAU,MAAM;AACd,YAAM,MAAM,iBAAgB;AAC5B,cAAQ,UAAU,gBAAgB,GAAG;AAAA,IACvC,GAAG,CAAC,GAAG,CAAC;AACR,WAAO,CAAC,UAAU,SAAS,eAAe,OAAO,iBAAiB,kBAAkB;AAAA,EACtF;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"create-storage.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-local-storage/create-storage.mjs"],"sourcesContent":["\"use client\";\nimport { useWindowEvent } from \"../use-window-event/use-window-event.mjs\";\nimport { useCallback, useEffect, useState } from \"react\";\n//#region packages/@mantine/hooks/src/use-local-storage/create-storage.ts\nfunction serializeJSON(value, hookName = \"use-local-storage\") {\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch (error) {\n\t\tthrow new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`);\n\t}\n}\nfunction deserializeJSON(value) {\n\ttry {\n\t\treturn value && JSON.parse(value);\n\t} catch {\n\t\treturn value;\n\t}\n}\nfunction createStorageHandler(type) {\n\tconst getItem = (key) => {\n\t\ttry {\n\t\t\treturn window[type].getItem(key);\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"use-local-storage: Failed to get value from storage, localStorage is blocked\");\n\t\t\treturn null;\n\t\t}\n\t};\n\tconst setItem = (key, value) => {\n\t\ttry {\n\t\t\twindow[type].setItem(key, value);\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"use-local-storage: Failed to set value to storage, localStorage is blocked\");\n\t\t}\n\t};\n\tconst removeItem = (key) => {\n\t\ttry {\n\t\t\twindow[type].removeItem(key);\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"use-local-storage: Failed to remove value from storage, localStorage is blocked\");\n\t\t}\n\t};\n\treturn {\n\t\tgetItem,\n\t\tsetItem,\n\t\tremoveItem\n\t};\n}\nfunction createStorage(type, hookName) {\n\tconst eventName = type === \"localStorage\" ? \"mantine-local-storage\" : \"mantine-session-storage\";\n\tconst { getItem, setItem, removeItem } = createStorageHandler(type);\n\treturn function useStorage({ key, defaultValue, getInitialValueInEffect = true, sync = true, deserialize = deserializeJSON, serialize = (value) => serializeJSON(value, hookName) }) {\n\t\tconst readStorageValue = useCallback((skipStorage) => {\n\t\t\tlet storageBlockedOrSkipped;\n\t\t\ttry {\n\t\t\t\tstorageBlockedOrSkipped = typeof window === \"undefined\" || !(type in window) || window[type] === null || !!skipStorage;\n\t\t\t} catch (_e) {\n\t\t\t\tstorageBlockedOrSkipped = true;\n\t\t\t}\n\t\t\tif (storageBlockedOrSkipped) return defaultValue;\n\t\t\tconst storageValue = getItem(key);\n\t\t\treturn storageValue !== null ? deserialize(storageValue) : defaultValue;\n\t\t}, [key, defaultValue]);\n\t\tconst [value, setValue] = useState(readStorageValue(getInitialValueInEffect));\n\t\tconst setStorageValue = useCallback((val) => {\n\t\t\tif (val instanceof Function) setValue((current) => {\n\t\t\t\tconst result = val(current);\n\t\t\t\tsetItem(key, serialize(result));\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\twindow.dispatchEvent(new CustomEvent(eventName, { detail: {\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue: result\n\t\t\t\t\t} }));\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t});\n\t\t\telse {\n\t\t\t\tsetItem(key, serialize(val));\n\t\t\t\twindow.dispatchEvent(new CustomEvent(eventName, { detail: {\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue: val\n\t\t\t\t} }));\n\t\t\t\tsetValue(val);\n\t\t\t}\n\t\t}, [key]);\n\t\tconst removeStorageValue = useCallback(() => {\n\t\t\tremoveItem(key);\n\t\t\tsetValue(defaultValue);\n\t\t\twindow.dispatchEvent(new CustomEvent(eventName, { detail: {\n\t\t\t\tkey,\n\t\t\t\tvalue: defaultValue\n\t\t\t} }));\n\t\t}, [key, defaultValue]);\n\t\tuseWindowEvent(\"storage\", (event) => {\n\t\t\tif (sync) {\n\t\t\t\tif (event.storageArea === window[type] && event.key === key) setValue(deserialize(event.newValue ?? void 0));\n\t\t\t}\n\t\t});\n\t\tuseWindowEvent(eventName, (event) => {\n\t\t\tif (sync) {\n\t\t\t\tif (event.detail.key === key) setValue(event.detail.value);\n\t\t\t}\n\t\t});\n\t\tuseEffect(() => {\n\t\t\tif (defaultValue !== void 0 && value === void 0) setStorageValue(defaultValue);\n\t\t}, [\n\t\t\tdefaultValue,\n\t\t\tvalue,\n\t\t\tsetStorageValue\n\t\t]);\n\t\tuseEffect(() => {\n\t\t\tconst val = readStorageValue();\n\t\t\tval !== void 0 && setStorageValue(val);\n\t\t}, [key]);\n\t\treturn [\n\t\t\tvalue === void 0 ? defaultValue : value,\n\t\t\tsetStorageValue,\n\t\t\tremoveStorageValue\n\t\t];\n\t};\n}\nfunction readValue(type) {\n\tconst { getItem } = createStorageHandler(type);\n\treturn function read({ key, defaultValue, deserialize = deserializeJSON }) {\n\t\tlet storageBlockedOrSkipped;\n\t\ttry {\n\t\t\tstorageBlockedOrSkipped = typeof window === \"undefined\" || !(type in window) || window[type] === null;\n\t\t} catch (_e) {\n\t\t\tstorageBlockedOrSkipped = true;\n\t\t}\n\t\tif (storageBlockedOrSkipped) return defaultValue;\n\t\tconst storageValue = getItem(key);\n\t\treturn storageValue !== null ? deserialize(storageValue) : defaultValue;\n\t};\n}\n//#endregion\nexport { createStorage, readValue };\n\n//# sourceMappingURL=create-storage.mjs.map"],"names":[],"mappings":";AAEA,MAAA,cAAA,OAAA,OAAA,EAAA;;;AAEA,SAAS,cAAc,OAAO,WAAW,qBAAqB;AAC7D,MAAI;AACH,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B,SAAS,OAAO;AACf,UAAM,IAAI,MAAM,kBAAkB,QAAQ,iCAAiC;AAAA,EAC5E;AACD;AACA,SAAS,gBAAgB,OAAO;AAC/B,MAAI;AACH,WAAO,SAAS,KAAK,MAAM,KAAK;AAAA,EACjC,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AACA,SAAS,qBAAqB,M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B;AAC5B,cAAQ,UAAU,gBAAgB,GAAG;AAAA,IACtC,GAAG,CAAC,GAAG,CAAC;AACR,WAAO;AAAA,MACN,UAAU,SAAS,eAAe;AAAA,MAClC;AAAA,MACA;AAAA,IACH;AAAA,EACC;AACD;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-local-storage.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.mjs"],"sourcesContent":["'use client';\nimport { readValue, createStorage } from './create-storage.mjs';\n\nfunction useLocalStorage(props) {\n return createStorage(\"localStorage\", \"use-local-storage\")(props);\n}\nconst readLocalStorageValue = readValue(\"localStorage\");\n\nexport { readLocalStorageValue, useLocalStorage };\n//# sourceMappingURL=use-local-storage.mjs.map\n"],"names":[],"mappings":";AAGA,SAAS,gBAAgB,OAAO;AAC9B,SAAO,cAAc,gBAAgB,mBAAmB,EAAE,KAAK;AACjE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"use-local-storage.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-local-storage/use-local-storage.mjs"],"sourcesContent":["\"use client\";\nimport { createStorage, readValue } from \"./create-storage.mjs\";\n//#region packages/@mantine/hooks/src/use-local-storage/use-local-storage.ts\nfunction useLocalStorage(props) {\n\treturn createStorage(\"localStorage\", \"use-local-storage\")(props);\n}\nconst readLocalStorageValue = readValue(\"localStorage\");\n//#endregion\nexport { readLocalStorageValue, useLocalStorage };\n\n//# sourceMappingURL=use-local-storage.mjs.map"],"names":[],"mappings":";AAGA,SAAS,gBAAgB,OAAO;AAC/B,SAAO,cAAc,gBAAgB,mBAAmB,EAAE,KAAK;AAChE;","x_google_ignoreList":[0]}
@@ -1,9 +1,11 @@
1
1
  const useEffect = window["React"].useEffect;
2
+ const useEffectEvent = window["React"].useEffectEvent;
2
3
  function useWindowEvent(type, listener, options) {
4
+ const stableListener = useEffectEvent(listener);
3
5
  useEffect(() => {
4
- window.addEventListener(type, listener, options);
5
- return () => window.removeEventListener(type, listener, options);
6
- }, [type, listener]);
6
+ window.addEventListener(type, stableListener, options);
7
+ return () => window.removeEventListener(type, stableListener, options);
8
+ }, [type]);
7
9
  }
8
10
  export {
9
11
  useWindowEvent
@@ -1 +1 @@
1
- {"version":3,"file":"use-window-event.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-window-event/use-window-event.mjs"],"sourcesContent":["'use client';\nimport { useEffect } from 'react';\n\nfunction useWindowEvent(type, listener, options) {\n useEffect(() => {\n window.addEventListener(type, listener, options);\n return () => window.removeEventListener(type, listener, options);\n }, [type, listener]);\n}\n\nexport { useWindowEvent };\n//# sourceMappingURL=use-window-event.mjs.map\n"],"names":[],"mappings":"AACA,MAAA,YAAA,OAAA,OAAA,EAAA;AAEA,SAAS,eAAe,MAAM,UAAU,SAAS;AAC/C,YAAU,MAAM;AACd,WAAO,iBAAiB,MAAM,UAAU,OAAO;AAC/C,WAAO,MAAM,OAAO,oBAAoB,MAAM,UAAU,OAAO;AAAA,EACjE,GAAG,CAAC,MAAM,QAAQ,CAAC;AACrB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"use-window-event.js","sources":["../../../../../../node_modules/@mantine/hooks/esm/use-window-event/use-window-event.mjs"],"sourcesContent":["\"use client\";\nimport { useEffect, useEffectEvent } from \"react\";\n//#region packages/@mantine/hooks/src/use-window-event/use-window-event.ts\nfunction useWindowEvent(type, listener, options) {\n\tconst stableListener = useEffectEvent(listener);\n\tuseEffect(() => {\n\t\twindow.addEventListener(type, stableListener, options);\n\t\treturn () => window.removeEventListener(type, stableListener, options);\n\t}, [type]);\n}\n//#endregion\nexport { useWindowEvent };\n\n//# sourceMappingURL=use-window-event.mjs.map"],"names":[],"mappings":"AACA,MAAA,YAAA,OAAA,OAAA,EAAA;;AAEA,SAAS,eAAe,MAAM,UAAU,SAAS;AAChD,QAAM,iBAAiB,eAAe,QAAQ;AAC9C,YAAU,MAAM;AACf,WAAO,iBAAiB,MAAM,gBAAgB,OAAO;AACrD,WAAO,MAAM,OAAO,oBAAoB,MAAM,gBAAgB,OAAO;AAAA,EACtE,GAAG,CAAC,IAAI,CAAC;AACV;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"random-id.js","sources":["../../../../../../../node_modules/@mantine/hooks/esm/utils/random-id/random-id.mjs"],"sourcesContent":["'use client';\nfunction randomId(prefix = \"mantine-\") {\n return `${prefix}${Math.random().toString(36).slice(2, 11)}`;\n}\n\nexport { randomId };\n//# sourceMappingURL=random-id.mjs.map\n"],"names":[],"mappings":"AACA,SAAS,SAAS,SAAS,YAAY;AACrC,SAAO,GAAG,MAAM,GAAG,KAAK,OAAM,EAAG,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAC5D;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"random-id.js","sources":["../../../../../../../node_modules/@mantine/hooks/esm/utils/random-id/random-id.mjs"],"sourcesContent":["\"use client\";\n//#region packages/@mantine/hooks/src/utils/random-id/random-id.ts\nfunction randomId(prefix = \"mantine-\") {\n\treturn `${prefix}${Math.random().toString(36).slice(2, 11)}`;\n}\n//#endregion\nexport { randomId };\n\n//# sourceMappingURL=random-id.mjs.map"],"names":[],"mappings":"AAEA,SAAS,SAAS,SAAS,YAAY;AACtC,SAAO,GAAG,MAAM,GAAG,KAAK,OAAM,EAAG,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAC3D;","x_google_ignoreList":[0]}