@vuu-ui/vuu-utils 2.1.0-alpha.8 → 2.1.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 (182) hide show
  1. package/cjs/node_modules/@dnd-kit/react/hooks.js +3 -3
  2. package/cjs/packages/vuu-utils/src/ThemeProvider.js +2 -2
  3. package/cjs/packages/vuu-utils/src/ThemeProvider.js.map +1 -1
  4. package/cjs/packages/vuu-utils/src/context-definitions/DataContext.js +1 -0
  5. package/cjs/packages/vuu-utils/src/context-definitions/DataContext.js.map +1 -1
  6. package/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js +9 -6
  7. package/cjs/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -1
  8. package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js +3 -3
  9. package/cjs/packages/vuu-utils/src/data-editing/EditButtons.js.map +1 -1
  10. package/cjs/packages/vuu-utils/src/data-editing/EditTracker.js +4 -1
  11. package/cjs/packages/vuu-utils/src/data-editing/EditTracker.js.map +1 -1
  12. package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js +19 -7
  13. package/cjs/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -1
  14. package/cjs/packages/vuu-utils/src/data-utils.js +15 -0
  15. package/cjs/packages/vuu-utils/src/data-utils.js.map +1 -1
  16. package/cjs/packages/vuu-utils/src/datasource/BaseDataSource.js +1 -0
  17. package/cjs/packages/vuu-utils/src/datasource/BaseDataSource.js.map +1 -1
  18. package/cjs/packages/vuu-utils/src/index.js +1 -0
  19. package/cjs/packages/vuu-utils/src/index.js.map +1 -1
  20. package/esm/packages/vuu-utils/src/ThemeProvider.js +2 -2
  21. package/esm/packages/vuu-utils/src/ThemeProvider.js.map +1 -1
  22. package/esm/packages/vuu-utils/src/context-definitions/DataContext.js +1 -1
  23. package/esm/packages/vuu-utils/src/context-definitions/DataContext.js.map +1 -1
  24. package/esm/packages/vuu-utils/src/context-definitions/WorkspaceContext.js +2 -2
  25. package/esm/packages/vuu-utils/src/context-definitions/WorkspaceContext.js.map +1 -1
  26. package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js +9 -6
  27. package/esm/packages/vuu-utils/src/data-editing/DataEditingProvider.js.map +1 -1
  28. package/esm/packages/vuu-utils/src/data-editing/EditButtons.js +1 -1
  29. package/esm/packages/vuu-utils/src/data-editing/EditTracker.js +4 -1
  30. package/esm/packages/vuu-utils/src/data-editing/EditTracker.js.map +1 -1
  31. package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js +20 -8
  32. package/esm/packages/vuu-utils/src/data-editing/useEditableTable.js.map +1 -1
  33. package/esm/packages/vuu-utils/src/data-utils.js +15 -1
  34. package/esm/packages/vuu-utils/src/data-utils.js.map +1 -1
  35. package/esm/packages/vuu-utils/src/datasource/BaseDataSource.js +1 -0
  36. package/esm/packages/vuu-utils/src/datasource/BaseDataSource.js.map +1 -1
  37. package/esm/packages/vuu-utils/src/feature-utils.js +2 -2
  38. package/esm/packages/vuu-utils/src/feature-utils.js.map +1 -1
  39. package/esm/packages/vuu-utils/src/index.js +1 -1
  40. package/package.json +9 -6
  41. package/types/context-definitions/DataContext.d.ts +3 -0
  42. package/types/data-editing/DataEditingProvider.d.ts +2 -1
  43. package/types/data-editing/EditTracker.d.ts +4 -4
  44. package/types/data-editing/useEditableTable.d.ts +7 -2
  45. package/types/data-utils.d.ts +2 -0
  46. package/types/filters/filter-utils.d.ts +2 -0
  47. package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -492
  48. package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
  49. package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -987
  50. package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +0 -1
  51. package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -130
  52. package/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +0 -1
  53. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -183
  54. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
  55. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -39
  56. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
  57. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js +0 -10
  58. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js.map +0 -1
  59. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js +0 -76
  60. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js.map +0 -1
  61. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js +0 -52
  62. package/cjs/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js.map +0 -1
  63. package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js +0 -59
  64. package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js.map +0 -1
  65. package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js +0 -12
  66. package/cjs/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js.map +0 -1
  67. package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.css.js +0 -6
  68. package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.css.js.map +0 -1
  69. package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.js +0 -96
  70. package/cjs/node_modules/@salt-ds/core/dist-es/button/Button.js.map +0 -1
  71. package/cjs/node_modules/@salt-ds/core/dist-es/button/useButton.js +0 -65
  72. package/cjs/node_modules/@salt-ds/core/dist-es/button/useButton.js.map +0 -1
  73. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js +0 -11
  74. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js.map +0 -1
  75. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js +0 -6
  76. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js.map +0 -1
  77. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js +0 -160
  78. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js.map +0 -1
  79. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js +0 -115
  80. package/cjs/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js.map +0 -1
  81. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js +0 -6
  82. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js.map +0 -1
  83. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js +0 -86
  84. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js.map +0 -1
  85. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js +0 -93
  86. package/cjs/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +0 -1
  87. package/cjs/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js +0 -20
  88. package/cjs/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js.map +0 -1
  89. package/cjs/node_modules/@salt-ds/core/dist-es/utils/createContext.js +0 -14
  90. package/cjs/node_modules/@salt-ds/core/dist-es/utils/createContext.js.map +0 -1
  91. package/cjs/node_modules/@salt-ds/core/dist-es/utils/debounce.js +0 -22
  92. package/cjs/node_modules/@salt-ds/core/dist-es/utils/debounce.js.map +0 -1
  93. package/cjs/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js +0 -6
  94. package/cjs/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js.map +0 -1
  95. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js +0 -52
  96. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js.map +0 -1
  97. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useId.js +0 -45
  98. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useId.js.map +0 -1
  99. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js +0 -8
  100. package/cjs/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js.map +0 -1
  101. package/cjs/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js +0 -233
  102. package/cjs/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js.map +0 -1
  103. package/cjs/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js +0 -35
  104. package/cjs/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js.map +0 -1
  105. package/cjs/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js +0 -22
  106. package/cjs/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js.map +0 -1
  107. package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js +0 -16
  108. package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js.map +0 -1
  109. package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js +0 -75
  110. package/cjs/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js.map +0 -1
  111. package/cjs/node_modules/@salt-ds/window/dist-es/WindowProvider.js +0 -17
  112. package/cjs/node_modules/@salt-ds/window/dist-es/WindowProvider.js.map +0 -1
  113. package/cjs/node_modules/tabbable/dist/index.esm.js +0 -550
  114. package/cjs/node_modules/tabbable/dist/index.esm.js.map +0 -1
  115. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -489
  116. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +0 -1
  117. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -962
  118. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +0 -1
  119. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -114
  120. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +0 -1
  121. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -162
  122. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +0 -1
  123. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -33
  124. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +0 -1
  125. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js +0 -8
  126. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerContext.js.map +0 -1
  127. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js +0 -73
  128. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/AriaAnnouncerProvider.js.map +0 -1
  129. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js +0 -50
  130. package/esm/node_modules/@salt-ds/core/dist-es/aria-announcer/useAriaAnnouncer.js.map +0 -1
  131. package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js +0 -56
  132. package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/BreakpointProvider.js.map +0 -1
  133. package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js +0 -10
  134. package/esm/node_modules/@salt-ds/core/dist-es/breakpoints/Breakpoints.js.map +0 -1
  135. package/esm/node_modules/@salt-ds/core/dist-es/button/Button.css.js +0 -4
  136. package/esm/node_modules/@salt-ds/core/dist-es/button/Button.css.js.map +0 -1
  137. package/esm/node_modules/@salt-ds/core/dist-es/button/Button.js +0 -94
  138. package/esm/node_modules/@salt-ds/core/dist-es/button/Button.js.map +0 -1
  139. package/esm/node_modules/@salt-ds/core/dist-es/button/useButton.js +0 -63
  140. package/esm/node_modules/@salt-ds/core/dist-es/button/useButton.js.map +0 -1
  141. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js +0 -9
  142. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ProviderContext.js.map +0 -1
  143. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js +0 -4
  144. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.css.js.map +0 -1
  145. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js +0 -151
  146. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/SaltProvider.js.map +0 -1
  147. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js +0 -113
  148. package/esm/node_modules/@salt-ds/core/dist-es/salt-provider/ThemeApplicator.js.map +0 -1
  149. package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js +0 -4
  150. package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.css.js.map +0 -1
  151. package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js +0 -84
  152. package/esm/node_modules/@salt-ds/core/dist-es/spinner/Spinner.js.map +0 -1
  153. package/esm/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js +0 -91
  154. package/esm/node_modules/@salt-ds/core/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +0 -1
  155. package/esm/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js +0 -18
  156. package/esm/node_modules/@salt-ds/core/dist-es/utils/createChainedFunction.js.map +0 -1
  157. package/esm/node_modules/@salt-ds/core/dist-es/utils/createContext.js +0 -12
  158. package/esm/node_modules/@salt-ds/core/dist-es/utils/createContext.js.map +0 -1
  159. package/esm/node_modules/@salt-ds/core/dist-es/utils/debounce.js +0 -20
  160. package/esm/node_modules/@salt-ds/core/dist-es/utils/debounce.js.map +0 -1
  161. package/esm/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js +0 -4
  162. package/esm/node_modules/@salt-ds/core/dist-es/utils/makePrefixer.js.map +0 -1
  163. package/esm/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js +0 -50
  164. package/esm/node_modules/@salt-ds/core/dist-es/utils/useFloatingUI/useFloatingUI.js.map +0 -1
  165. package/esm/node_modules/@salt-ds/core/dist-es/utils/useId.js +0 -24
  166. package/esm/node_modules/@salt-ds/core/dist-es/utils/useId.js.map +0 -1
  167. package/esm/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js +0 -6
  168. package/esm/node_modules/@salt-ds/core/dist-es/utils/useIsomorphicLayoutEffect.js.map +0 -1
  169. package/esm/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js +0 -231
  170. package/esm/node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js.map +0 -1
  171. package/esm/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js +0 -32
  172. package/esm/node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js.map +0 -1
  173. package/esm/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js +0 -19
  174. package/esm/node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js.map +0 -1
  175. package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js +0 -14
  176. package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js.map +0 -1
  177. package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js +0 -54
  178. package/esm/node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js.map +0 -1
  179. package/esm/node_modules/@salt-ds/window/dist-es/WindowProvider.js +0 -15
  180. package/esm/node_modules/@salt-ds/window/dist-es/WindowProvider.js.map +0 -1
  181. package/esm/node_modules/tabbable/dist/index.esm.js +0 -546
  182. package/esm/node_modules/tabbable/dist/index.esm.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePreventScroll.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/utils/usePreventScroll.js"],"sourcesContent":["import { createChainedFunction } from './createChainedFunction.js';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';\n\nconst visualViewport = typeof document !== \"undefined\" && window.visualViewport;\nconst nonTextInputTypes = /* @__PURE__ */ new Set([\n \"checkbox\",\n \"radio\",\n \"range\",\n \"color\",\n \"file\",\n \"image\",\n \"button\",\n \"submit\",\n \"reset\"\n]);\nlet preventScrollCount = 0;\nlet restore;\nfunction usePreventScroll(options = {}) {\n const { isDisabled } = options;\n useIsomorphicLayoutEffect(() => {\n if (isDisabled) {\n return;\n }\n preventScrollCount++;\n if (preventScrollCount === 1) {\n if (isIOS()) {\n restore = preventScrollMobileSafari();\n } else {\n restore = preventScrollStandard();\n }\n }\n return () => {\n preventScrollCount--;\n if (preventScrollCount === 0) {\n restore();\n }\n };\n }, [isDisabled]);\n}\nfunction preventScrollStandard() {\n return createChainedFunction(\n setStyle(\n document.documentElement,\n \"paddingRight\",\n `${window.innerWidth - document.documentElement.clientWidth}px`\n ),\n setStyle(document.documentElement, \"overflow\", \"hidden\")\n );\n}\nfunction preventScrollMobileSafari() {\n let scrollable;\n let restoreScrollableStyles;\n const onTouchStart = (e) => {\n scrollable = getScrollParent(e.target, true);\n if (scrollable === document.documentElement && scrollable === document.body) {\n return;\n }\n if (scrollable instanceof HTMLElement && window.getComputedStyle(scrollable).overscrollBehavior === \"auto\") {\n restoreScrollableStyles = setStyle(\n scrollable,\n \"overscrollBehavior\",\n \"contain\"\n );\n }\n };\n const onTouchMove = (e) => {\n if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {\n e.preventDefault();\n return;\n }\n if (scrollable.scrollHeight === scrollable.clientHeight && scrollable.scrollWidth === scrollable.clientWidth) {\n e.preventDefault();\n }\n };\n const onTouchEnd = () => {\n if (restoreScrollableStyles) {\n restoreScrollableStyles();\n }\n };\n const onFocus = (e) => {\n const target = e.target;\n if (willOpenKeyboard(target)) {\n setupStyles();\n target.style.transform = \"translateY(-2000px)\";\n requestAnimationFrame(() => {\n target.style.transform = \"\";\n if (visualViewport) {\n if (visualViewport.height < window.innerHeight) {\n requestAnimationFrame(() => {\n scrollIntoView(target);\n });\n } else {\n visualViewport.addEventListener(\n \"resize\",\n () => scrollIntoView(target),\n { once: true }\n );\n }\n }\n });\n }\n };\n let restoreStyles = null;\n const setupStyles = () => {\n if (restoreStyles) {\n return;\n }\n const onWindowScroll = () => {\n window.scrollTo(0, 0);\n };\n const scrollX = window.pageXOffset;\n const scrollY = window.pageYOffset;\n restoreStyles = createChainedFunction(\n addEvent(window, \"scroll\", onWindowScroll),\n setStyle(\n document.documentElement,\n \"paddingRight\",\n `${window.innerWidth - document.documentElement.clientWidth}px`\n ),\n setStyle(document.documentElement, \"overflow\", \"hidden\"),\n setStyle(document.body, \"marginTop\", `-${scrollY}px`),\n () => {\n window.scrollTo(scrollX, scrollY);\n }\n );\n window.scrollTo(0, 0);\n };\n const removeEvents = createChainedFunction(\n addEvent(document, \"touchstart\", onTouchStart, {\n passive: false,\n capture: true\n }),\n addEvent(document, \"touchmove\", onTouchMove, {\n passive: false,\n capture: true\n }),\n addEvent(document, \"touchend\", onTouchEnd, {\n passive: false,\n capture: true\n }),\n addEvent(document, \"focus\", onFocus, true)\n );\n return () => {\n restoreScrollableStyles == null ? void 0 : restoreScrollableStyles();\n restoreStyles == null ? void 0 : restoreStyles();\n removeEvents();\n };\n}\nfunction setStyle(element, style, value) {\n const cur = element.style[style];\n element.style[style] = value;\n return () => {\n element.style[style] = cur;\n };\n}\nfunction addEvent(target, event, handler, options) {\n target.addEventListener(event, handler, options);\n return () => {\n target.removeEventListener(event, handler, options);\n };\n}\nfunction scrollIntoView(target) {\n const root = document.scrollingElement || document.documentElement;\n let nextTarget = target;\n while (nextTarget && nextTarget !== root) {\n const scrollable = getScrollParent(nextTarget);\n if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== nextTarget) {\n const scrollableTop = scrollable.getBoundingClientRect().top;\n const targetTop = nextTarget.getBoundingClientRect().top;\n if (targetTop > scrollableTop + nextTarget.clientHeight) {\n scrollable.scrollTop += targetTop - scrollableTop;\n }\n }\n nextTarget = scrollable.parentElement;\n }\n}\nfunction willOpenKeyboard(target) {\n return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;\n}\nfunction isScrollable(node, checkForOverflow) {\n if (!node) {\n return false;\n }\n const style = window.getComputedStyle(node);\n let isScrollable2 = /(auto|scroll)/.test(\n style.overflow + style.overflowX + style.overflowY\n );\n if (isScrollable2 && checkForOverflow) {\n isScrollable2 = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n return isScrollable2;\n}\nfunction getScrollParent(node, checkForOverflow) {\n let scrollableNode = node;\n if (isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n while (scrollableNode && !isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n return scrollableNode || document.scrollingElement || document.documentElement;\n}\nfunction testPlatform(re) {\n var _a;\n return typeof window !== \"undefined\" && window.navigator != null ? re.test(\n // @ts-expect-error userAgentData is only supported in Chrome 90+\n ((_a = window.navigator.userAgentData) == null ? void 0 : _a.platform) || window.navigator.platform\n ) : false;\n}\nfunction cached(fn) {\n if (process.env.NODE_ENV === \"test\") {\n return fn;\n }\n let res = null;\n return () => {\n if (res == null) {\n res = fn();\n }\n return res;\n };\n}\nconst isMac = cached(() => testPlatform(/^Mac/i));\nconst isIPhone = cached(() => testPlatform(/^iPhone/i));\nconst isIPad = cached(\n () => testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n isMac() && navigator.maxTouchPoints > 1\n);\nconst isIOS = cached(() => isIPhone() || isIPad());\n\nexport { usePreventScroll };\n//# sourceMapp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AAG,KAAK;AACX;AACA,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;AACvC,IAAI,OAAO,EAAE;AACb;AACA,EAAE,IAAI,GAAG,GAAG,IAAI;AAChB,EAAE,OAAO,MAAM;AACf,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE;AACrB,MAAM,GAAG,GAAG,EAAE,EAAE;AAChB;AACA,IAAI,OAAO,GAAG;AACd,GAAG;AACH;AACA,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;AACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;AACvD,MAAM,MAAM,GAAG,MAAM;AACrB,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC;AAC9B,EAAE,KAAK,EAAE,IAAI,SAAS,CAAC,cAAc,GAAG;AACxC,CAAC;AACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC;;;;","x_google_ignoreList":[0]}
@@ -1,32 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createContext, useContext, useState } from 'react';
3
- import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';
4
-
5
- const ViewportContext = createContext(null);
6
- const ViewportProvider = ({ children }) => {
7
- const existingViewport = useContext(ViewportContext);
8
- const [viewport, setViewport] = useState(existingViewport);
9
- const noExistingViewport = existingViewport === null;
10
- const viewportValue = existingViewport || viewport || 0;
11
- useIsomorphicLayoutEffect(() => {
12
- let observer = null;
13
- if (noExistingViewport) {
14
- observer = new ResizeObserver(
15
- (observerEntries) => {
16
- setViewport(observerEntries[0].contentRect.width);
17
- }
18
- );
19
- observer.observe(document.body);
20
- setViewport(document.body.getBoundingClientRect().width);
21
- }
22
- return () => {
23
- if (observer) {
24
- observer.disconnect();
25
- }
26
- };
27
- }, [noExistingViewport]);
28
- return /* @__PURE__ */ jsx(ViewportContext.Provider, { value: viewportValue, children });
29
- };
30
-
31
- export { ViewportContext, ViewportProvider };
32
- //# sourceMappingURL=ViewportProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ViewportProvider.js","sources":["../../../../../../../../node_modules/@salt-ds/core/dist-es/viewport/ViewportProvider.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createContext, useContext, useState } from 'react';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';\n\nconst ViewportContext = createContext(null);\nconst ViewportProvider = ({ children }) => {\n const existingViewport = useContext(ViewportContext);\n const [viewport, setViewport] = useState(existingViewport);\n const noExistingViewport = existingViewport === null;\n const viewportValue = existingViewport || viewport || 0;\n useIsomorphicLayoutEffect(() => {\n let observer = null;\n if (noExistingViewport) {\n observer = new ResizeObserver(\n (observerEntries) => {\n setViewport(observerEntries[0].contentRect.width);\n }\n );\n observer.observe(document.body);\n setViewport(document.body.getBoundingClientRect().width);\n }\n return () => {\n if (observer) {\n observer.disconnect();\n }\n };\n }, [noExistingViewport]);\n return /* @__PURE__ */ jsx(ViewportContext.Provider, { value: viewportValue, children });\n};\nconst useViewport = () => {\n const value = useContext(ViewportContext);\n return value === null ? 0 : value;\n};\n\nexport { ViewportContext, ViewportProvider, useViewport };\n//# sourceMappingURL=ViewportProvider.js.map\n"],"names":[],"mappings":";;;;AAIK,MAAC,eAAe,GAAG,aAAa,CAAC,IAAI;AACrC,MAAC,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK;AAC3C,EAAE,MAAM,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC;AACtD,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC;AAC5D,EAAE,MAAM,kBAAkB,GAAG,gBAAgB,KAAK,IAAI;AACtD,EAAE,MAAM,aAAa,GAAG,gBAAgB,IAAI,QAAQ,IAAI,CAAC;AACzD,EAAE,yBAAyB,CAAC,MAAM;AAClC,IAAI,IAAI,QAAQ,GAAG,IAAI;AACvB,IAAI,IAAI,kBAAkB,EAAE;AAC5B,MAAM,QAAQ,GAAG,IAAI,cAAc;AACnC,QAAQ,CAAC,eAAe,KAAK;AAC7B,UAAU,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3D;AACA,OAAO;AACP,MAAM,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AACrC,MAAM,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;AAC9D;AACA,IAAI,OAAO,MAAM;AACjB,MAAM,IAAI,QAAQ,EAAE;AACpB,QAAQ,QAAQ,CAAC,UAAU,EAAE;AAC7B;AACA,KAAK;AACL,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAC1B,EAAE,uBAAuB,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAC1F;;;;","x_google_ignoreList":[0]}
@@ -1,19 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createContext, useContext } from 'react';
3
-
4
- const StyleInjectionContext = createContext(true);
5
- function useStyleInjection(enableStyleInjection) {
6
- const enableStyleInjectionFromContext = useContext(StyleInjectionContext);
7
- return enableStyleInjection != null ? enableStyleInjection : enableStyleInjectionFromContext;
8
- }
9
- function StyleInjectionProvider(props) {
10
- const { value: enableStyleInjectionProp, children } = props;
11
- const value = useStyleInjection(enableStyleInjectionProp);
12
- return /* @__PURE__ */ jsx(StyleInjectionContext.Provider, {
13
- value,
14
- children
15
- });
16
- }
17
-
18
- export { StyleInjectionProvider, useStyleInjection };
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@salt-ds/styles/dist-es/style-injection-provider/index.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createContext, useContext } from 'react';\n\nconst StyleInjectionContext = createContext(true);\nfunction useStyleInjection(enableStyleInjection) {\n const enableStyleInjectionFromContext = useContext(StyleInjectionContext);\n return enableStyleInjection != null ? enableStyleInjection : enableStyleInjectionFromContext;\n}\nfunction StyleInjectionProvider(props) {\n const { value: enableStyleInjectionProp, children } = props;\n const value = useStyleInjection(enableStyleInjectionProp);\n return /* @__PURE__ */ jsx(StyleInjectionContext.Provider, {\n value,\n children\n });\n}\n\nexport { StyleInjectionProvider, useStyleInjection };\n//# sourceMappingURL=index.js.map\n"],"names":[],"mappings":";;;AAGA,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAAC;AACjD,SAAS,iBAAiB,CAAC,oBAAoB,EAAE;AACjD,EAAE,MAAM,+BAA+B,GAAG,UAAU,CAAC,qBAAqB,CAAC;AAC3E,EAAE,OAAO,oBAAoB,IAAI,IAAI,GAAG,oBAAoB,GAAG,+BAA+B;AAC9F;AACA,SAAS,sBAAsB,CAAC,KAAK,EAAE;AACvC,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE,QAAQ,EAAE,GAAG,KAAK;AAC7D,EAAE,MAAM,KAAK,GAAG,iBAAiB,CAAC,wBAAwB,CAAC;AAC3D,EAAE,uBAAuB,GAAG,CAAC,qBAAqB,CAAC,QAAQ,EAAE;AAC7D,IAAI,KAAK;AACT,IAAI;AACJ,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
@@ -1,14 +0,0 @@
1
- import 'react/jsx-runtime';
2
- import { createContext, useContext } from 'react';
3
-
4
- const InsertionPointContext = createContext(null);
5
- if (process.env.NODE_ENV !== "production") {
6
- InsertionPointContext.displayName = "InsertionPointContext";
7
- }
8
- function useInsertionPoint() {
9
- const value = useContext(InsertionPointContext);
10
- return value;
11
- }
12
-
13
- export { useInsertionPoint };
14
- //# sourceMappingURL=InsertionPointProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InsertionPointProvider.js","sources":["../../../../../../../../node_modules/@salt-ds/styles/dist-es/use-style-injection/InsertionPointProvider.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createContext, useMemo, useContext } from 'react';\n\nconst InsertionPointContext = createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n InsertionPointContext.displayName = \"InsertionPointContext\";\n}\nfunction InsertionPointProvider(props) {\n const { insertionPoint: insertionPointProp, children } = props;\n const value = useMemo(() => insertionPointProp, [insertionPointProp]);\n return /* @__PURE__ */ jsx(InsertionPointContext.Provider, {\n value,\n children\n });\n}\nfunction useInsertionPoint() {\n const value = useContext(InsertionPointContext);\n return value;\n}\n\nexport { InsertionPointProvider, useInsertionPoint };\n//# sourceMappingURL=InsertionPointProvider.js.map\n"],"names":[],"mappings":";;;AAGA,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAAC;AACjD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AAC3C,EAAE,qBAAqB,CAAC,WAAW,GAAG,uBAAuB;AAC7D;AASA,SAAS,iBAAiB,GAAG;AAC7B,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,qBAAqB,CAAC;AACjD,EAAE,OAAO,KAAK;AACd;;;;","x_google_ignoreList":[0]}
@@ -1,54 +0,0 @@
1
- import * as React from 'react';
2
- import { useInsertionPoint } from './InsertionPointProvider.js';
3
- import { useStyleInjection } from '../style-injection-provider/index.js';
4
-
5
- var _a;
6
- const maybeUseInsertionEffect = (_a = React["useInsertionEffect".toString()]) != null ? _a : React.useLayoutEffect;
7
- const windowSheetsMap = /* @__PURE__ */ new WeakMap();
8
- function useComponentCssInjection({
9
- testId,
10
- css,
11
- window: targetWindow
12
- }) {
13
- const styleInjectionEnabled = useStyleInjection();
14
- const insertionPoint = useInsertionPoint();
15
- maybeUseInsertionEffect(() => {
16
- var _a2, _b;
17
- if (!targetWindow || !styleInjectionEnabled) {
18
- return;
19
- }
20
- const sheetsMap = (_a2 = windowSheetsMap.get(targetWindow)) != null ? _a2 : /* @__PURE__ */ new Map();
21
- const styleMap = (_b = sheetsMap.get(css)) != null ? _b : { styleElement: null, count: 0 };
22
- if (styleMap.styleElement == null) {
23
- styleMap.styleElement = targetWindow.document.createElement("style");
24
- styleMap.styleElement.setAttribute("type", "text/css");
25
- styleMap.styleElement.setAttribute("data-salt-style", testId || "");
26
- styleMap.styleElement.textContent = css;
27
- styleMap.count = 1;
28
- targetWindow.document.head.insertBefore(
29
- styleMap.styleElement,
30
- insertionPoint || targetWindow.document.head.firstChild
31
- );
32
- } else {
33
- styleMap.styleElement.textContent = css;
34
- styleMap.count++;
35
- }
36
- sheetsMap.set(css, styleMap);
37
- windowSheetsMap.set(targetWindow, sheetsMap);
38
- return () => {
39
- const sheetsMap2 = windowSheetsMap.get(targetWindow);
40
- const styleMap2 = sheetsMap2 == null ? void 0 : sheetsMap2.get(css);
41
- if (styleMap2 == null ? void 0 : styleMap2.styleElement) {
42
- styleMap2.count--;
43
- if (styleMap2.count < 1) {
44
- targetWindow.document.head.removeChild(styleMap2.styleElement);
45
- styleMap2.styleElement = null;
46
- sheetsMap2 == null ? void 0 : sheetsMap2.delete(css);
47
- }
48
- }
49
- };
50
- }, [testId, css, targetWindow]);
51
- }
52
-
53
- export { useComponentCssInjection };
54
- //# sourceMappingURL=useStyleInjection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useStyleInjection.js","sources":["../../../../../../../../node_modules/@salt-ds/styles/dist-es/use-style-injection/useStyleInjection.js"],"sourcesContent":["import * as React from 'react';\nimport { useInsertionPoint } from './InsertionPointProvider.js';\nimport { useStyleInjection } from '../style-injection-provider/index.js';\n\nvar _a;\nconst maybeUseInsertionEffect = (_a = React[\"useInsertionEffect\".toString()]) != null ? _a : React.useLayoutEffect;\nconst windowSheetsMap = /* @__PURE__ */ new WeakMap();\nfunction useComponentCssInjection({\n testId,\n css,\n window: targetWindow\n}) {\n const styleInjectionEnabled = useStyleInjection();\n const insertionPoint = useInsertionPoint();\n maybeUseInsertionEffect(() => {\n var _a2, _b;\n if (!targetWindow || !styleInjectionEnabled) {\n return;\n }\n const sheetsMap = (_a2 = windowSheetsMap.get(targetWindow)) != null ? _a2 : /* @__PURE__ */ new Map();\n const styleMap = (_b = sheetsMap.get(css)) != null ? _b : { styleElement: null, count: 0 };\n if (styleMap.styleElement == null) {\n styleMap.styleElement = targetWindow.document.createElement(\"style\");\n styleMap.styleElement.setAttribute(\"type\", \"text/css\");\n styleMap.styleElement.setAttribute(\"data-salt-style\", testId || \"\");\n styleMap.styleElement.textContent = css;\n styleMap.count = 1;\n targetWindow.document.head.insertBefore(\n styleMap.styleElement,\n insertionPoint || targetWindow.document.head.firstChild\n );\n } else {\n styleMap.styleElement.textContent = css;\n styleMap.count++;\n }\n sheetsMap.set(css, styleMap);\n windowSheetsMap.set(targetWindow, sheetsMap);\n return () => {\n const sheetsMap2 = windowSheetsMap.get(targetWindow);\n const styleMap2 = sheetsMap2 == null ? void 0 : sheetsMap2.get(css);\n if (styleMap2 == null ? void 0 : styleMap2.styleElement) {\n styleMap2.count--;\n if (styleMap2.count < 1) {\n targetWindow.document.head.removeChild(styleMap2.styleElement);\n styleMap2.styleElement = null;\n sheetsMap2 == null ? void 0 : sheetsMap2.delete(css);\n }\n }\n };\n }, [testId, css, targetWindow]);\n}\n\nexport { useComponentCssInjection };\n//# sourceMappingURL=useStyleInjection.js.map\n"],"names":[],"mappings":";;;;AAIA,IAAI,EAAE;AACN,MAAM,uBAAuB,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,eAAe;AAClH,MAAM,eAAe,mBAAmB,IAAI,OAAO,EAAE;AACrD,SAAS,wBAAwB,CAAC;AAClC,EAAE,MAAM;AACR,EAAE,GAAG;AACL,EAAE,MAAM,EAAE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E;AACtB;AACA,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC;AAChC,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC;AAChD,IAAI,OAAO,MAAM;AACjB,MAAM,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,UAAU,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC;AACzE,MAAM,IAAI,SAAS,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE;AAC/D,QAAQ,SAAS,CAAC,KAAK,EAAE;AACzB,QAAQ,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,EAAE;AACjC,UAAU,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC;AACxE,UAAU,SAAS,CAAC,YAAY,GAAG,IAAI;AACvC,UAAU,UAAU,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;AAC9D;AACA;AACA,KAAK;AACL,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AACjC;;;;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- import 'react/jsx-runtime';
2
- import { createContext, useContext } from 'react';
3
-
4
- const WindowContext = createContext(
5
- typeof window !== "undefined" ? window : null
6
- );
7
- if (process.env.NODE_ENV !== "production") {
8
- WindowContext.displayName = "WindowContext";
9
- }
10
- function useWindow() {
11
- return useContext(WindowContext);
12
- }
13
-
14
- export { useWindow };
15
- //# sourceMappingURL=WindowProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WindowProvider.js","sources":["../../../../../../../node_modules/@salt-ds/window/dist-es/WindowProvider.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { createContext, useContext } from 'react';\n\nconst WindowContext = createContext(\n typeof window !== \"undefined\" ? window : null\n);\nif (process.env.NODE_ENV !== \"production\") {\n WindowContext.displayName = \"WindowContext\";\n}\nfunction WindowProvider(props) {\n const { window: targetWindow, children } = props;\n return /* @__PURE__ */ jsx(WindowContext.Provider, {\n value: targetWindow,\n children\n });\n}\nfunction useWindow() {\n return useContext(WindowContext);\n}\n\nexport { WindowProvider, useWindow };\n//# sourceMappingURL=WindowProvider.js.map\n"],"names":[],"mappings":";;;AAGA,MAAM,aAAa,GAAG,aAAa;AACnC,EAAE,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG;AAC3C,CAAC;AACD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AAC3C,EAAE,aAAa,CAAC,WAAW,GAAG,eAAe;AAC7C;AAQA,SAAS,SAAS,GAAG;AACrB,EAAE,OAAO,UAAU,CAAC,aAAa,CAAC;AAClC;;;;","x_google_ignoreList":[0]}