@elliemae/ds-utilities 3.22.0-next.26 → 3.22.0-next.27

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 (109) hide show
  1. package/dist/cjs/addComponentIfNotExists.js.map +1 -1
  2. package/dist/cjs/algorithms/crossTypeSort.js.map +1 -1
  3. package/dist/cjs/capitalize.js.map +1 -1
  4. package/dist/cjs/compose.js.map +3 -3
  5. package/dist/cjs/deprecated/deprecatedMsg.js.map +1 -1
  6. package/dist/cjs/deprecated/index.js.map +1 -1
  7. package/dist/cjs/deprecated/reactTypesUtility.js.map +1 -1
  8. package/dist/cjs/deprecated/scrollingTimer.js.map +1 -1
  9. package/dist/cjs/deprecated/useParentElement.js.map +1 -1
  10. package/dist/cjs/deprecated/useSetRef.js.map +1 -1
  11. package/dist/cjs/deprecated/useUncontrolled.js.map +1 -1
  12. package/dist/cjs/deprecated/useWindowSize.js.map +1 -1
  13. package/dist/cjs/getComponentFromProps.js.map +1 -1
  14. package/dist/cjs/getHighlightedRerendersStyle.js.map +3 -3
  15. package/dist/cjs/hooks/index.js.map +1 -1
  16. package/dist/cjs/hooks/useCallbackAfterRender.js.map +1 -1
  17. package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +1 -1
  18. package/dist/cjs/hooks/useControlledUncontrolledState.js.map +1 -1
  19. package/dist/cjs/hooks/useDerivedStateFromProps.js.map +1 -1
  20. package/dist/cjs/hooks/useDimensions.js.map +1 -1
  21. package/dist/cjs/hooks/useExecutionTimer.js.map +1 -1
  22. package/dist/cjs/hooks/useExpandState.js.map +1 -1
  23. package/dist/cjs/hooks/useFocusTrap.js.map +1 -1
  24. package/dist/cjs/hooks/useHeadlessTooltip.js.map +3 -3
  25. package/dist/cjs/hooks/useHotkeys.js.map +1 -1
  26. package/dist/cjs/hooks/useHoverHandlersDelay.js.map +1 -1
  27. package/dist/cjs/hooks/useIsMobile.js.map +1 -1
  28. package/dist/cjs/hooks/useIsShowingEllipsis.js.map +1 -1
  29. package/dist/cjs/hooks/useMakeMutable.js.map +1 -1
  30. package/dist/cjs/hooks/useNativeIntersectionObserver.js.map +1 -1
  31. package/dist/cjs/hooks/useNativeResizeObserver.js.map +1 -1
  32. package/dist/cjs/hooks/useOnBlurOut.js.map +1 -1
  33. package/dist/cjs/hooks/useOnElementResize.js.map +1 -1
  34. package/dist/cjs/hooks/useOnFirstFocusIn.js.map +1 -1
  35. package/dist/cjs/hooks/useOnSpecificFocus.js.map +1 -1
  36. package/dist/cjs/hooks/usePrevious.js.map +1 -1
  37. package/dist/cjs/hooks/useResizeObserver.js.map +1 -1
  38. package/dist/cjs/hooks/useShouldRecalculate.js.map +1 -1
  39. package/dist/cjs/hooks/useSideEffectSyntheticEvent.js.map +1 -1
  40. package/dist/cjs/hooks/useTrackElement.js.map +1 -1
  41. package/dist/cjs/hooks/useWindowScrollerList.js.map +1 -1
  42. package/dist/cjs/index.js.map +1 -1
  43. package/dist/cjs/objectUtilities.js.map +1 -1
  44. package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +1 -1
  45. package/dist/cjs/operators.js.map +1 -1
  46. package/dist/cjs/platform.js.map +1 -1
  47. package/dist/cjs/props-helpers/index.js.map +1 -1
  48. package/dist/cjs/reactTypesUtility.js.map +1 -1
  49. package/dist/cjs/system.js.map +1 -1
  50. package/dist/cjs/timeUtils.js.map +1 -1
  51. package/dist/cjs/utils.js.map +3 -3
  52. package/dist/cjs/validations.js.map +1 -1
  53. package/dist/esm/addComponentIfNotExists.js.map +1 -1
  54. package/dist/esm/algorithms/crossTypeSort.js.map +1 -1
  55. package/dist/esm/capitalize.js.map +1 -1
  56. package/dist/esm/compose.js.map +3 -3
  57. package/dist/esm/deprecated/deprecatedMsg.js.map +1 -1
  58. package/dist/esm/deprecated/index.js.map +1 -1
  59. package/dist/esm/deprecated/reactTypesUtility.js.map +1 -1
  60. package/dist/esm/deprecated/scrollingTimer.js.map +1 -1
  61. package/dist/esm/deprecated/useParentElement.js.map +1 -1
  62. package/dist/esm/deprecated/useSetRef.js.map +1 -1
  63. package/dist/esm/deprecated/useUncontrolled.js.map +1 -1
  64. package/dist/esm/deprecated/useWindowSize.js.map +1 -1
  65. package/dist/esm/getComponentFromProps.js.map +1 -1
  66. package/dist/esm/getHighlightedRerendersStyle.js.map +3 -3
  67. package/dist/esm/hooks/index.js.map +1 -1
  68. package/dist/esm/hooks/useCallbackAfterRender.js.map +1 -1
  69. package/dist/esm/hooks/useCancellableDelayedCallback.js.map +1 -1
  70. package/dist/esm/hooks/useControlledUncontrolledState.js.map +1 -1
  71. package/dist/esm/hooks/useDerivedStateFromProps.js.map +1 -1
  72. package/dist/esm/hooks/useDimensions.js.map +1 -1
  73. package/dist/esm/hooks/useExecutionTimer.js.map +1 -1
  74. package/dist/esm/hooks/useExpandState.js.map +1 -1
  75. package/dist/esm/hooks/useFocusTrap.js.map +1 -1
  76. package/dist/esm/hooks/useHeadlessTooltip.js.map +3 -3
  77. package/dist/esm/hooks/useHotkeys.js.map +1 -1
  78. package/dist/esm/hooks/useHoverHandlersDelay.js.map +1 -1
  79. package/dist/esm/hooks/useIsMobile.js.map +1 -1
  80. package/dist/esm/hooks/useIsShowingEllipsis.js.map +1 -1
  81. package/dist/esm/hooks/useMakeMutable.js.map +1 -1
  82. package/dist/esm/hooks/useNativeIntersectionObserver.js.map +1 -1
  83. package/dist/esm/hooks/useNativeResizeObserver.js.map +1 -1
  84. package/dist/esm/hooks/useOnBlurOut.js.map +1 -1
  85. package/dist/esm/hooks/useOnElementResize.js.map +1 -1
  86. package/dist/esm/hooks/useOnFirstFocusIn.js.map +1 -1
  87. package/dist/esm/hooks/useOnSpecificFocus.js.map +1 -1
  88. package/dist/esm/hooks/usePrevious.js.map +1 -1
  89. package/dist/esm/hooks/useResizeObserver.js.map +1 -1
  90. package/dist/esm/hooks/useShouldRecalculate.js.map +1 -1
  91. package/dist/esm/hooks/useSideEffectSyntheticEvent.js.map +1 -1
  92. package/dist/esm/hooks/useTrackElement.js.map +1 -1
  93. package/dist/esm/hooks/useWindowScrollerList.js.map +1 -1
  94. package/dist/esm/index.js.map +1 -1
  95. package/dist/esm/objectUtilities.js.map +1 -1
  96. package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +1 -1
  97. package/dist/esm/operators.js.map +1 -1
  98. package/dist/esm/platform.js.map +1 -1
  99. package/dist/esm/props-helpers/index.js.map +1 -1
  100. package/dist/esm/reactTypesUtility.js.map +1 -1
  101. package/dist/esm/system.js.map +1 -1
  102. package/dist/esm/timeUtils.js.map +1 -1
  103. package/dist/esm/utils.js.map +3 -3
  104. package/dist/esm/validations.js.map +1 -1
  105. package/dist/types/compose.d.ts +0 -1
  106. package/dist/types/getHighlightedRerendersStyle.d.ts +0 -1
  107. package/dist/types/hooks/useHeadlessTooltip.d.ts +0 -1
  108. package/dist/types/utils.d.ts +0 -1
  109. package/package.json +9 -9
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/addComponentIfNotExists.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/addComponentIfNotExists.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { render } from 'react-dom';\n\ninterface AppendComponentIfNotExistConfigT {\n Component: React.FC;\n parentVisibility?: string;\n uidSelector: string;\n tagName: string;\n}\n\n// appendComponentIfNotExist is a function that appends a component to the DOM if it does not exist\n// it returns the element appended\n//\nexport const appendComponentIfNotExist = async (props: AppendComponentIfNotExistConfigT) => {\n const { Component, parentVisibility = 'hidden', uidSelector, tagName = 'span' } = props;\n\n // if elementAttached exists we return it\n const elementAttached = document.getElementById(uidSelector);\n if (elementAttached) return elementAttached;\n const rootElement = document.createElement(tagName);\n rootElement.style.visibility = parentVisibility;\n\n // we wait for the component to be rendered and then we return the element appended\n const element = await new Promise<HTMLElement>((resolve) => {\n render(<Component />, document.body.appendChild(rootElement));\n requestAnimationFrame(() => {\n resolve(document.getElementById(uidSelector) as HTMLElement);\n });\n });\n return element;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuBZ;AAvBX,uBAAuB;AAYhB,MAAM,4BAA4B,OAAO,UAA4C;AAC1F,QAAM,EAAE,WAAW,mBAAmB,UAAU,aAAa,UAAU,OAAO,IAAI;AAGlF,QAAM,kBAAkB,SAAS,eAAe,WAAW;AAC3D,MAAI;AAAiB,WAAO;AAC5B,QAAM,cAAc,SAAS,cAAc,OAAO;AAClD,cAAY,MAAM,aAAa;AAG/B,QAAM,UAAU,MAAM,IAAI,QAAqB,CAAC,YAAY;AAC1D,iCAAO,4CAAC,aAAU,GAAI,SAAS,KAAK,YAAY,WAAW,CAAC;AAC5D,0BAAsB,MAAM;AAC1B,cAAQ,SAAS,eAAe,WAAW,CAAgB;AAAA,IAC7D,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/algorithms/crossTypeSort.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/algorithms/crossTypeSort.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["type ComparisonTerm = string | number | null | undefined;\ntype Direction = 'ASC' | 'DESC';\ntype SortCB = Required<Parameters<(typeof Array.prototype)['sort']>>[0];\ntype SortingHelper = (a: ComparisonTerm, b: ComparisonTerm, direction?: Direction) => ReturnType<SortCB> | false;\n\nconst canBeParsedAsNumber = (val: ComparisonTerm): val is string => !Number.isNaN(parseFloat(val as string));\n\nconst numberSort: SortingHelper = (a, b, direction = 'ASC') => {\n if (canBeParsedAsNumber(a) && canBeParsedAsNumber(b)) {\n const aAsNum = parseFloat(a);\n const bAsNum = parseFloat(b);\n if (direction === 'ASC') return aAsNum - bAsNum;\n else return bAsNum - aAsNum;\n }\n if (canBeParsedAsNumber(a)) return direction === 'ASC' ? -1 : 1;\n if (canBeParsedAsNumber(b)) return direction === 'ASC' ? 1 : -1;\n return false;\n};\nconst voidishSort: SortingHelper = (a, b) => {\n // voids are always sorted the same way no matter the direction since it's more ux intuitive\n // order of execution matters, this ensure the order '-' , '', null, undefined\n if (a === undefined) return 1;\n if (b === undefined) return -1;\n if (a === null) return 1;\n if (b === null) return -1;\n if (a === '') return 1;\n if (b === '') return -1;\n if (a === '-') return 1;\n if (b === '-') return -1;\n return false;\n};\nconst stringSort: SortingHelper = (a, b, direction = 'ASC') => {\n if (typeof a === 'string' && typeof b === 'string')\n return direction === 'ASC'\n ? a.localeCompare(b, undefined, { numeric: true })\n : b.localeCompare(a, undefined, { numeric: true });\n return false;\n};\n\nexport const crossTypeSort = (\n a: ComparisonTerm,\n b: ComparisonTerm,\n direction: Direction = 'ASC',\n): ReturnType<SortCB> => {\n if (a === b) return 0;\n const voidishSorted = voidishSort(a, b, direction);\n if (voidishSorted !== false) return voidishSorted;\n\n const numberSorted = numberSort(a, b, direction);\n if (numberSorted !== false) return numberSorted;\n\n const stringSorted = stringSort(a, b, direction);\n if (stringSorted !== false) return stringSorted;\n return -1;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,MAAM,sBAAsB,CAAC,QAAuC,CAAC,OAAO,MAAM,WAAW,GAAa,CAAC;AAE3G,MAAM,aAA4B,CAAC,GAAG,GAAG,YAAY,UAAU;AAC7D,MAAI,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,GAAG;AACpD,UAAM,SAAS,WAAW,CAAC;AAC3B,UAAM,SAAS,WAAW,CAAC;AAC3B,QAAI,cAAc;AAAO,aAAO,SAAS;AAAA;AACpC,aAAO,SAAS;AAAA,EACvB;AACA,MAAI,oBAAoB,CAAC;AAAG,WAAO,cAAc,QAAQ,KAAK;AAC9D,MAAI,oBAAoB,CAAC;AAAG,WAAO,cAAc,QAAQ,IAAI;AAC7D,SAAO;AACT;AACA,MAAM,cAA6B,CAAC,GAAG,MAAM;AAG3C,MAAI,MAAM;AAAW,WAAO;AAC5B,MAAI,MAAM;AAAW,WAAO;AAC5B,MAAI,MAAM;AAAM,WAAO;AACvB,MAAI,MAAM;AAAM,WAAO;AACvB,MAAI,MAAM;AAAI,WAAO;AACrB,MAAI,MAAM;AAAI,WAAO;AACrB,MAAI,MAAM;AAAK,WAAO;AACtB,MAAI,MAAM;AAAK,WAAO;AACtB,SAAO;AACT;AACA,MAAM,aAA4B,CAAC,GAAG,GAAG,YAAY,UAAU;AAC7D,MAAI,OAAO,MAAM,YAAY,OAAO,MAAM;AACxC,WAAO,cAAc,QACjB,EAAE,cAAc,GAAG,QAAW,EAAE,SAAS,KAAK,CAAC,IAC/C,EAAE,cAAc,GAAG,QAAW,EAAE,SAAS,KAAK,CAAC;AACrD,SAAO;AACT;AAEO,MAAM,gBAAgB,CAC3B,GACA,GACA,YAAuB,UACA;AACvB,MAAI,MAAM;AAAG,WAAO;AACpB,QAAM,gBAAgB,YAAY,GAAG,GAAG,SAAS;AACjD,MAAI,kBAAkB;AAAO,WAAO;AAEpC,QAAM,eAAe,WAAW,GAAG,GAAG,SAAS;AAC/C,MAAI,iBAAiB;AAAO,WAAO;AAEnC,QAAM,eAAe,WAAW,GAAG,GAAG,SAAS;AAC/C,MAAI,iBAAiB;AAAO,WAAO;AACnC,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/capitalize.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/capitalize.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/compose.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n\nexport const compose = (...funcs: UnknownFunctionT[]): UnknownFunctionT => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(\n (a, b) =>\n (...args) =>\n a(b(...args)),\n );\n};\n\nexport default compose;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,UAAU,IAAI,UAAgD;AACzE,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,CAAC,QAAQ;AAAA,EAClB;AAEA,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,MAAM,CAAC;AAAA,EAChB;AAEA,SAAO,MAAM;AAAA,IACX,CAAC,GAAG,MACF,IAAI,SACF,EAAE,EAAE,GAAG,IAAI,CAAC;AAAA,EAClB;AACF;AAEA,IAAO,kBAAQ;",
3
+ "sources": ["../../src/compose.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n\nexport const compose = (...funcs: UnknownFunctionT[]): UnknownFunctionT => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(\n (a, b) =>\n (...args) =>\n a(b(...args)),\n );\n};\n\nexport default compose;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADYhB,MAAM,UAAU,IAAI,UAAgD;AACzE,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,CAAC,QAAQ;AAAA,EAClB;AAEA,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,MAAM,CAAC;AAAA,EAChB;AAEA,SAAO,MAAM;AAAA,IACX,CAAC,GAAG,MACF,IAAI,SACF,EAAE,EAAE,GAAG,IAAI,CAAC;AAAA,EAClB;AACF;AAEA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/deprecatedMsg.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/deprecatedMsg.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export const deprecatedMsg = 'is going to be deprecated, please consider removing it from your project';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,gBAAgB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export * from './reactTypesUtility.js';\nexport * from './scrollingTimer.js';\nexport * from './useParentElement.js';\nexport * from './useSetRef.js';\nexport * from './useUncontrolled.js';\nexport * from './useWindowSize.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAc,mCAAd;AACA,+BAAc,gCADd;AAEA,+BAAc,kCAFd;AAGA,+BAAc,2BAHd;AAIA,+BAAc,iCAJd;AAKA,+BAAc,+BALd;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/reactTypesUtility.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/reactTypesUtility.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport { deprecatedMsg } from './deprecatedMsg.js';\n\nexport function isClassComponent(component: any) {\n console.warn(`isClassComponent ${deprecatedMsg}`);\n return !!(typeof component === 'function' && !!component.prototype.isReactComponent);\n}\n\nexport function isFunctionComponent(component: any) {\n console.warn(`isFunctionComponent ${deprecatedMsg}`);\n return typeof component === 'function' && String(component).includes('return React.createElement');\n}\n\nexport function isReactComponent(component: any) {\n console.warn(`isReactComponent ${deprecatedMsg}`);\n return !!(isClassComponent(component) || isFunctionComponent(component));\n}\n\nexport function isElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isElement ${deprecatedMsg}`);\n return React.isValidElement(element);\n}\n\nexport function isCompositeTypeElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isCompositeTypeElement ${deprecatedMsg}`);\n return isElement(element) && typeof element?.type === 'function';\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAkB;AAClB,2BAA8B;AAEvB,SAAS,iBAAiB,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,oCAAe;AAChD,SAAO,CAAC,EAAE,OAAO,cAAc,cAAc,CAAC,CAAC,UAAU,UAAU;AACrE;AAEO,SAAS,oBAAoB,WAAgB;AAClD,UAAQ,KAAK,uBAAuB,oCAAe;AACnD,SAAO,OAAO,cAAc,cAAc,OAAO,SAAS,EAAE,SAAS,4BAA4B;AACnG;AAEO,SAAS,iBAAiB,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,oCAAe;AAChD,SAAO,CAAC,EAAE,iBAAiB,SAAS,KAAK,oBAAoB,SAAS;AACxE;AAEO,SAAS,UAAU,SAAqD;AAC7E,UAAQ,KAAK,aAAa,oCAAe;AACzC,SAAO,aAAAA,QAAM,eAAe,OAAO;AACrC;AAEO,SAAS,uBAAuB,SAAqD;AAC1F,UAAQ,KAAK,0BAA0B,oCAAe;AACtD,SAAO,UAAU,OAAO,KAAK,OAAO,SAAS,SAAS;AACxD;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/scrollingTimer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/scrollingTimer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable func-names */\nimport { deprecatedMsg } from './deprecatedMsg.js';\n\nexport const resetTimer = (func: (...args: unknown[]) => unknown) => {\n console.warn(`resetTimer ${deprecatedMsg}`);\n let timeout: NodeJS.Timeout | null;\n return function (this: any, ...args: unknown[]) {\n const lastCall = () => {\n timeout = null;\n func.apply(this, args);\n };\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(lastCall, 300);\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,2BAA8B;AAEvB,MAAM,aAAa,CAAC,SAA0C;AACnE,UAAQ,KAAK,cAAc,oCAAe;AAC1C,MAAI;AACJ,SAAO,YAAwB,MAAiB;AAC9C,UAAM,WAAW,MAAM;AACrB,gBAAU;AACV,WAAK,MAAM,MAAM,IAAI;AAAA,IACvB;AAEA,QAAI;AAAS,mBAAa,OAAO;AACjC,cAAU,WAAW,UAAU,GAAG;AAAA,EACpC;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/useParentElement.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/useParentElement.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type React from 'react';\nimport { useEffect, useState } from 'react';\n\nexport const useParentElement = (ref: React.RefObject<HTMLElement>) => {\n const [parent, setParent] = useState<ParentNode | null>(ref.current);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n if (ref.current) setParent(ref.current.parentNode);\n });\n return parent;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AAE7B,MAAM,mBAAmB,CAAC,QAAsC;AACrE,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAA4B,IAAI,OAAO;AAGnE,8BAAU,MAAM;AACd,QAAI,IAAI;AAAS,gBAAU,IAAI,QAAQ,UAAU;AAAA,EACnD,CAAC;AACD,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/useSetRef.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/useSetRef.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console, @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport { useCallback, useRef } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg.js';\n\nexport const useSetRef = (initial: unknown) => {\n console.warn(`useSetRef ${deprecatedMsg}`);\n const ref = useRef(initial);\n const setRef = useCallback((node) => {\n ref.current = node;\n }, []);\n return [ref, setRef];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAoC;AACpC,2BAA8B;AAEvB,MAAM,YAAY,CAAC,YAAqB;AAC7C,UAAQ,KAAK,aAAa,oCAAe;AACzC,QAAM,UAAM,qBAAO,OAAO;AAC1B,QAAM,aAAS,0BAAY,CAAC,SAAS;AACnC,QAAI,UAAU;AAAA,EAChB,GAAG,CAAC,CAAC;AACL,SAAO,CAAC,KAAK,MAAM;AACrB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/useUncontrolled.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/useUncontrolled.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useUncontrolled as useUncontrolledImplementation } from 'uncontrollable';\nimport { deprecatedMsg } from './deprecatedMsg.js';\n\nexport const useUncontrolled = (...args: any[]) => {\n console.warn(`useUncontrolled ${deprecatedMsg}`);\n return useUncontrolledImplementation(...args);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,4BAAiE;AACjE,2BAA8B;AAEvB,MAAM,kBAAkB,IAAI,SAAgB;AACjD,UAAQ,KAAK,mBAAmB,oCAAe;AAC/C,aAAO,sBAAAA,iBAA8B,GAAG,IAAI;AAC9C;",
6
6
  "names": ["useUncontrolledImplementation"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/deprecated/useWindowSize.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/deprecated/useWindowSize.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console */\nimport { useLayoutEffect, useState } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg.js';\n\nconst noop = () => {};\n\nexport const useWindowSize = () => {\n console.warn(`useWindowSize ${deprecatedMsg}`);\n const [size, setSize] = useState([0, 0]);\n useLayoutEffect(() => {\n if (!window) return noop;\n function updateSize() {\n setSize([window.innerWidth, window.innerHeight]);\n }\n window.addEventListener('resize', updateSize);\n window.addEventListener('orientationchange', updateSize);\n updateSize();\n return () => {\n window.removeEventListener('resize', updateSize);\n window.removeEventListener('orientationchange', updateSize);\n };\n }, []);\n if (!window) return noop;\n return size;\n};\n\nexport default useWindowSize;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0C;AAC1C,2BAA8B;AAE9B,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,gBAAgB,MAAM;AACjC,UAAQ,KAAK,iBAAiB,oCAAe;AAC7C,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC,GAAG,CAAC,CAAC;AACvC,oCAAgB,MAAM;AACpB,QAAI,CAAC;AAAQ,aAAO;AACpB,aAAS,aAAa;AACpB,cAAQ,CAAC,OAAO,YAAY,OAAO,WAAW,CAAC;AAAA,IACjD;AACA,WAAO,iBAAiB,UAAU,UAAU;AAC5C,WAAO,iBAAiB,qBAAqB,UAAU;AACvD,eAAW;AACX,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,UAAU;AAC/C,aAAO,oBAAoB,qBAAqB,UAAU;AAAA,IAC5D;AAAA,EACF,GAAG,CAAC,CAAC;AACL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;AAEA,IAAO,wBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/getComponentFromProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/getComponentFromProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-nested-ternary, @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nexport const getComponentFromProps = (\n Component: React.ReactElement<PropsWithChildren<unknown>> | React.ComponentType<unknown>,\n props: Record<string, unknown>,\n children = [],\n) => {\n if (!Component) return null;\n const componentChildren =\n typeof Component !== 'function' && Component.props\n ? Array.isArray(Component.props.children)\n ? Component.props.children\n : [Component.props.children]\n : null;\n return typeof Component === 'function' ? (\n <Component {...props}>{children}</Component>\n ) : (\n React.cloneElement(\n Component,\n {\n ...Component.props,\n ...props,\n },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n componentChildren ? [...componentChildren, ...children] : [...children],\n )\n );\n};\n\nexport default getComponentFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBnB;AAfJ,mBAAkB;AAEX,MAAM,wBAAwB,CACnC,WACA,OACA,WAAW,CAAC,MACT;AACH,MAAI,CAAC;AAAW,WAAO;AACvB,QAAM,oBACJ,OAAO,cAAc,cAAc,UAAU,QACzC,MAAM,QAAQ,UAAU,MAAM,QAAQ,IACpC,UAAU,MAAM,WAChB,CAAC,UAAU,MAAM,QAAQ,IAC3B;AACN,SAAO,OAAO,cAAc,aAC1B,4CAAC,aAAW,GAAG,OAAQ,UAAS,IAEhC,aAAAA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,MACE,GAAG,UAAU;AAAA,MACb,GAAG;AAAA,IACL;AAAA;AAAA,IAEA,oBAAoB,CAAC,GAAG,mBAAmB,GAAG,QAAQ,IAAI,CAAC,GAAG,QAAQ;AAAA,EACxE;AAEJ;AAEA,IAAO,gCAAQ;",
6
6
  "names": ["React"]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/getHighlightedRerendersStyle.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type React from 'react';\n\n// a strict type definition for rgb color strings\ntype RGBColorString = `rgb(${number}, ${number}, ${number})`;\n\n/**\n * This function returns a random color string in the format \"rgb(r, g, b)\"\n * This is meant to be used in conjunction with the getHighlightedRerendersStyle function.\n * This is not meant to be used in production, just a development tool.\n *\n * @returns {string} the random color string\n * @example\n * const color = getRandomColor(); // returns 'rgb(255, 255, 255)'\n * const color = getRandomColor(); // returns 'rgb(0, 0, 0)'\n * const color = getRandomColor(); // returns 'rgb(255, 0, 0)'\n * const color = getRandomColor(); // returns 'rgb(0, 255, 0)'\n * // etc...\n */\n\nconst getRandomColor = (): RGBColorString => {\n // generate random values for r, g, and b between 0 and 255\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n\n // return the color string in the format \"rgb(r, g, b)\"\n return `rgb(${r}, ${g}, ${b})`;\n};\n\n// type definition for getReadableColor\n\ntype GetReadableColor = (rgbColorString: RGBColorString) => RGBColorString;\n/**\n * This function returns a readable color for the input color string.\n * This is meant to be used in conjunction with the getHighlightedRerendersStyle function.\n * This is not meant to be used in production, just a development tool.\n *\n * @param {RGBColorString} rgbColorString the rgb color string to get a readable color for\n * @returns {RGBColorString} the readable color string\n * @example\n * const textColor = getReadableColor('rgb(255, 255, 255)'); // returns 'rgb(0, 0, 0)'\n * const textColor = getReadableColor('rgb(0, 0, 0)'); // returns 'rgb(255, 255, 255)'\n * const textColor = getReadableColor('rgb(255, 0, 0)'); // returns 'rgb(255, 255, 255)'\n * const textColor = getReadableColor('rgb(0, 255, 0)'); // returns 'rgb(0, 0, 0)'\n * // etc...\n */\nconst getReadableColor: GetReadableColor = (rgbColorString) => {\n // if the input color string is not in the correct format, throw an error\n if (!rgbColorString.match(/^rgb\\(\\d+, \\d+, \\d+\\)$/)) {\n throw new Error(\n `The input color string \"${rgbColorString}\" is not in the correct format. The correct format is \"rgb(r, g, b)\" where r, g, and b are integers between 0 and 255.`,\n );\n }\n // extract the r, g, and b values from the string\n const [r, g, b] = rgbColorString.match(/\\d+/g)?.map((numStr) => parseInt(numStr)) ?? [0, 0, 0];\n\n // calculate the relative luminance of the input color using the sRGB color space\n const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n\n // calculate the luminance of black and white colors\n const blackLuminance = 0;\n const whiteLuminance = 1;\n\n // calculate the luminance differences between the input color and black and white\n const luminanceDiffBlack = Math.abs(luminance - blackLuminance);\n const luminanceDiffWhite = Math.abs(luminance - whiteLuminance);\n\n // determine whether the input color is closer to black or white\n const textColor =\n luminanceDiffBlack > luminanceDiffWhite\n ? 'rgb(0, 0, 0)' // use white text for lighter colors\n : 'rgb(255, 255, 255)'; // use black text for darker colors\n\n // return the text color string\n return textColor;\n};\n// type definition for getHighlightedRerendersStyle\n// this function returns an object with the style properties for the highlighted rerenders\n\ntype GetHighlightedRerendersStyle = () => Partial<React.CSSProperties>;\n/**\n * This function returns an object with the style properties for highlighting rerenders.\n * this is meant to be invoked each time a component rerenders to get a new color combination\n * this is not meant to be used in production, just a development tool.\n *\n * @returns {Partial<React.CSSProperties>} an object with the style properties for the highlighted rerenders\n */\nexport const getHighlightedRerendersStyle: GetHighlightedRerendersStyle = () => {\n const randColor = getRandomColor();\n return {\n backgroundColor: randColor,\n color: getReadableColor(randColor),\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmBvB,MAAM,iBAAiB,MAAsB;AAE3C,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACxC,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACxC,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AAGxC,SAAO,OAAO,MAAM,MAAM;AAC5B;AAmBA,MAAM,mBAAqC,CAAC,mBAAmB;AAE7D,MAAI,CAAC,eAAe,MAAM,wBAAwB,GAAG;AACnD,UAAM,IAAI;AAAA,MACR,2BAA2B;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,eAAe,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAG7F,QAAM,aAAa,SAAS,IAAI,SAAS,IAAI,SAAS,KAAK;AAG3D,QAAM,iBAAiB;AACvB,QAAM,iBAAiB;AAGvB,QAAM,qBAAqB,KAAK,IAAI,YAAY,cAAc;AAC9D,QAAM,qBAAqB,KAAK,IAAI,YAAY,cAAc;AAG9D,QAAM,YACJ,qBAAqB,qBACjB,iBACA;AAGN,SAAO;AACT;AAYO,MAAM,+BAA6D,MAAM;AAC9E,QAAM,YAAY,eAAe;AACjC,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,OAAO,iBAAiB,SAAS;AAAA,EACnC;AACF;",
3
+ "sources": ["../../src/getHighlightedRerendersStyle.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type React from 'react';\n\n// a strict type definition for rgb color strings\ntype RGBColorString = `rgb(${number}, ${number}, ${number})`;\n\n/**\n * This function returns a random color string in the format \"rgb(r, g, b)\"\n * This is meant to be used in conjunction with the getHighlightedRerendersStyle function.\n * This is not meant to be used in production, just a development tool.\n * @returns {string} the random color string\n * @example\n * const color = getRandomColor(); // returns 'rgb(255, 255, 255)'\n * const color = getRandomColor(); // returns 'rgb(0, 0, 0)'\n * const color = getRandomColor(); // returns 'rgb(255, 0, 0)'\n * const color = getRandomColor(); // returns 'rgb(0, 255, 0)'\n * // etc...\n */\n\nconst getRandomColor = (): RGBColorString => {\n // generate random values for r, g, and b between 0 and 255\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n\n // return the color string in the format \"rgb(r, g, b)\"\n return `rgb(${r}, ${g}, ${b})`;\n};\n\n// type definition for getReadableColor\n\ntype GetReadableColor = (rgbColorString: RGBColorString) => RGBColorString;\n/**\n * This function returns a readable color for the input color string.\n * This is meant to be used in conjunction with the getHighlightedRerendersStyle function.\n * This is not meant to be used in production, just a development tool.\n * @param {RGBColorString} rgbColorString the rgb color string to get a readable color for\n * @returns {RGBColorString} the readable color string\n * @example\n * const textColor = getReadableColor('rgb(255, 255, 255)'); // returns 'rgb(0, 0, 0)'\n * const textColor = getReadableColor('rgb(0, 0, 0)'); // returns 'rgb(255, 255, 255)'\n * const textColor = getReadableColor('rgb(255, 0, 0)'); // returns 'rgb(255, 255, 255)'\n * const textColor = getReadableColor('rgb(0, 255, 0)'); // returns 'rgb(0, 0, 0)'\n * // etc...\n */\nconst getReadableColor: GetReadableColor = (rgbColorString) => {\n // if the input color string is not in the correct format, throw an error\n if (!rgbColorString.match(/^rgb\\(\\d+, \\d+, \\d+\\)$/)) {\n throw new Error(\n `The input color string \"${rgbColorString}\" is not in the correct format. The correct format is \"rgb(r, g, b)\" where r, g, and b are integers between 0 and 255.`,\n );\n }\n // extract the r, g, and b values from the string\n const [r, g, b] = rgbColorString.match(/\\d+/g)?.map((numStr) => parseInt(numStr)) ?? [0, 0, 0];\n\n // calculate the relative luminance of the input color using the sRGB color space\n const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n\n // calculate the luminance of black and white colors\n const blackLuminance = 0;\n const whiteLuminance = 1;\n\n // calculate the luminance differences between the input color and black and white\n const luminanceDiffBlack = Math.abs(luminance - blackLuminance);\n const luminanceDiffWhite = Math.abs(luminance - whiteLuminance);\n\n // determine whether the input color is closer to black or white\n const textColor =\n luminanceDiffBlack > luminanceDiffWhite\n ? 'rgb(0, 0, 0)' // use white text for lighter colors\n : 'rgb(255, 255, 255)'; // use black text for darker colors\n\n // return the text color string\n return textColor;\n};\n// type definition for getHighlightedRerendersStyle\n// this function returns an object with the style properties for the highlighted rerenders\n\ntype GetHighlightedRerendersStyle = () => Partial<React.CSSProperties>;\n/**\n * This function returns an object with the style properties for highlighting rerenders.\n * this is meant to be invoked each time a component rerenders to get a new color combination\n * this is not meant to be used in production, just a development tool.\n * @returns {Partial<React.CSSProperties>} an object with the style properties for the highlighted rerenders\n */\nexport const getHighlightedRerendersStyle: GetHighlightedRerendersStyle = () => {\n const randColor = getRandomColor();\n return {\n backgroundColor: randColor,\n color: getReadableColor(randColor),\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBvB,MAAM,iBAAiB,MAAsB;AAE3C,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACxC,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AACxC,QAAM,IAAI,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG;AAGxC,SAAO,OAAO,MAAM,MAAM;AAC5B;AAkBA,MAAM,mBAAqC,CAAC,mBAAmB;AAE7D,MAAI,CAAC,eAAe,MAAM,wBAAwB,GAAG;AACnD,UAAM,IAAI;AAAA,MACR,2BAA2B;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,eAAe,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAG7F,QAAM,aAAa,SAAS,IAAI,SAAS,IAAI,SAAS,KAAK;AAG3D,QAAM,iBAAiB;AACvB,QAAM,iBAAiB;AAGvB,QAAM,qBAAqB,KAAK,IAAI,YAAY,cAAc;AAC9D,QAAM,qBAAqB,KAAK,IAAI,YAAY,cAAc;AAG9D,QAAM,YACJ,qBAAqB,qBACjB,iBACA;AAGN,SAAO;AACT;AAWO,MAAM,+BAA6D,MAAM;AAC9E,QAAM,YAAY,eAAe;AACjC,SAAO;AAAA,IACL,iBAAiB;AAAA,IACjB,OAAO,iBAAiB,SAAS;AAAA,EACnC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\n\nexport { useCallbackAfterRender } from './useCallbackAfterRender.js';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback.js';\nexport { useControlledUncontrolledState } from './useControlledUncontrolledState.js';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\nexport { useExecutionTimer } from './useExecutionTimer.js';\nexport { useExpandState } from './useExpandState.js';\nexport { useFocusTrap, UseFocusTrapWithSchema } from './useFocusTrap.js';\nexport { useHeadlessTooltip } from './useHeadlessTooltip.js';\nexport { useHotkeys } from './useHotkeys.js';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay.js';\nexport { useIsMobile } from './useIsMobile.js';\nexport { useIsShowingEllipsis } from './useIsShowingEllipsis.js';\nexport { useMakeMutable, useLatestValueReferenciallyStable } from './useMakeMutable.js';\nexport { useNativeIntersectionObserver } from './useNativeIntersectionObserver.js';\nexport { useNativeResizeObserver } from './useNativeResizeObserver.js';\nexport { useOnBlurOut, UseOnBlurOutWithSchema } from './useOnBlurOut.js';\nexport { useOnElementResize } from './useOnElementResize.js';\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema } from './useOnFirstFocusIn.js';\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema } from './useOnSpecificFocus.js';\nexport { usePrevious } from './usePrevious.js';\nexport { useResizeObserver } from './useResizeObserver.js';\nexport { useShouldRecalculate } from './useShouldRecalculate.js';\nexport { useSideEffectSyntheticEvent } from './useSideEffectSyntheticEvent.js';\nexport { useTrackElement } from './useTrackElement.js';\nexport { useWindowScrollerList } from './useWindowScrollerList.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsC;AACtC,8BAA0C;AAC1C,gCAA6C;AAE7C,oCAAuC;AACvC,2CAA8C;AAC9C,4CAA+C;AAC/C,sCAAyC;AACzC,+BAAkC;AAClC,4BAA+B;AAC/B,0BAAqD;AACrD,gCAAmC;AACnC,wBAA2B;AAC3B,mCAAsC;AACtC,yBAA4B;AAC5B,kCAAqC;AACrC,4BAAkE;AAClE,2CAA8C;AAC9C,qCAAwC;AACxC,0BAAqD;AACrD,gCAAmC;AACnC,+BAA+D;AAC/D,gCAAiE;AACjE,yBAA4B;AAC5B,+BAAkC;AAClC,kCAAqC;AACrC,yCAA4C;AAC5C,6BAAgC;AAChC,mCAAsC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useCallbackAfterRender.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useCallbackAfterRender.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useRef, useLayoutEffect, useMemo, useEffect } from 'react';\n\ntype Callback = (callback: () => void) => void;\n\n// Inspired in https://github.com/ryuuji3/react-hooks/blob/4b183d61c30abf17efeab2240f8ff652a5dbb8e2/packages/use-callback-after-render/src/hooks/useCallbackAfterRender.ts\nexport const useCallbackAfterRender = (isLayout = false): Callback => {\n const lastRun = useRef<(() => void) | null>(null);\n\n const effect = useMemo(() => (isLayout ? useLayoutEffect : useEffect), [isLayout]);\n\n effect(() => {\n lastRun.current?.();\n lastRun.current = null;\n });\n\n return (callback) => {\n lastRun.current = callback; // schedule callback after render\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4D;AAKrD,MAAM,yBAAyB,CAAC,WAAW,UAAoB;AACpE,QAAM,cAAU,qBAA4B,IAAI;AAEhD,QAAM,aAAS,sBAAQ,MAAO,WAAW,+BAAkB,wBAAY,CAAC,QAAQ,CAAC;AAEjF,SAAO,MAAM;AACX,YAAQ,UAAU;AAClB,YAAQ,UAAU;AAAA,EACpB,CAAC;AAED,SAAO,CAAC,aAAa;AACnB,YAAQ,UAAU;AAAA,EACpB;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useCancellableDelayedCallback.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useCancellableDelayedCallback.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useCallback, useRef } from 'react';\n\ntype Callback = (...args: unknown[]) => unknown;\n\nexport const useCancellableDelayedCallback = (cb: Callback, delay: number) => {\n const timeoutRef = useRef<NodeJS.Timeout>();\n const cancel = useCallback(() => {\n const timeoutId = timeoutRef.current;\n if (timeoutId) {\n timeoutRef.current = undefined;\n clearTimeout(timeoutId);\n }\n }, [timeoutRef]);\n const delayedCb: Callback = useCallback(\n (...args) => {\n timeoutRef.current = setTimeout(() => cb(...args), delay);\n },\n [cb, delay],\n );\n\n return [delayedCb, cancel];\n};\n\nexport default useCancellableDelayedCallback;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAI7B,MAAM,gCAAgC,CAAC,IAAc,UAAkB;AAC5E,QAAM,iBAAa,qBAAuB;AAC1C,QAAM,aAAS,0BAAY,MAAM;AAC/B,UAAM,YAAY,WAAW;AAC7B,QAAI,WAAW;AACb,iBAAW,UAAU;AACrB,mBAAa,SAAS;AAAA,IACxB;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AACf,QAAM,gBAAsB;AAAA,IAC1B,IAAI,SAAS;AACX,iBAAW,UAAU,WAAW,MAAM,GAAG,GAAG,IAAI,GAAG,KAAK;AAAA,IAC1D;AAAA,IACA,CAAC,IAAI,KAAK;AAAA,EACZ;AAEA,SAAO,CAAC,WAAW,MAAM;AAC3B;AAEA,IAAO,wCAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useControlledUncontrolledState.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useControlledUncontrolledState.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\n\nexport function useControlledUncontrolledState<T = unknown>(config: {\n defaultState: T;\n controlledState?: T;\n onChange?: (newState: T) => void;\n}): [T, (newVal: T) => void] {\n const { defaultState, controlledState, onChange } = config;\n const [state, setState] = React.useState<T>(defaultState);\n // due to javascript \"falsy\" crazy bonanza,\n // we are gonna use Object.hasOwnProperty to check if controlledState should be used\n // this covers scenarios such as `controlledState=undefined`/`controlledState=null`/`controlledState=false`/`controlledState=0`/`controlledState=''`\n // where we want to use the controlledState but we want the value to be the falsy value itself...\n const shouldUseControlledState = Object.hasOwnProperty.call(config, 'controlledState');\n const finalState = React.useMemo(() => {\n if (shouldUseControlledState) return controlledState as T;\n return state;\n }, [shouldUseControlledState, controlledState, state]);\n const finalSetState = React.useCallback(\n (newVal: T) => {\n setState(newVal);\n if (onChange) onChange(newVal);\n },\n [onChange],\n );\n return [finalState, finalSetState];\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAEX,SAAS,+BAA4C,QAI/B;AAC3B,QAAM,EAAE,cAAc,iBAAiB,SAAS,IAAI;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAI,aAAAA,QAAM,SAAY,YAAY;AAKxD,QAAM,2BAA2B,OAAO,eAAe,KAAK,QAAQ,iBAAiB;AACrF,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM;AACrC,QAAI;AAA0B,aAAO;AACrC,WAAO;AAAA,EACT,GAAG,CAAC,0BAA0B,iBAAiB,KAAK,CAAC;AACrD,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,WAAc;AACb,eAAS,MAAM;AACf,UAAI;AAAU,iBAAS,MAAM;AAAA,IAC/B;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AACA,SAAO,CAAC,YAAY,aAAa;AACnC;",
6
6
  "names": ["React"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useDerivedStateFromProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useDerivedStateFromProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type React from 'react';\nimport { useRef, useState } from 'react';\nimport { isEqual, isFunction } from '../utils.js';\n\ninterface ShouldUpdateArg {\n prop: unknown;\n prevProp: unknown;\n stateValue: unknown;\n}\n\ntype OnUpdateT<T> = (prop: T, prevProp?: T | Record<string, never>) => T;\n\ninterface OptionsT<T> {\n onUpdate?: OnUpdateT<T>;\n shouldUpdate?: (arg: ShouldUpdateArg) => boolean;\n updateOnStateChange?: boolean;\n}\n\nconst defaultPropUpdateOnChange = <T,>(prop: T) => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }: ShouldUpdateArg) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate<T>(onUpdate: OnUpdateT<T>, setState: React.Dispatch<React.SetStateAction<T>>) {\n return (state: React.SetStateAction<T>) => {\n setState((prevState: T) => onUpdate(isFunction(state) ? state(prevState) : state, prevState));\n };\n}\n\nexport const useDerivedStateFromProps = <T,>(\n prop: T,\n options: OptionsT<T> = {},\n): [T, React.Dispatch<React.SetStateAction<T>>] => {\n const {\n onUpdate = defaultPropUpdateOnChange as OnUpdateT<T>,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange ? setStateWithUpdate(onUpdate, setState) : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAiC;AACjC,mBAAoC;AAgBpC,MAAM,4BAA4B,CAAK,SAAY;AAEnD,SAAS,oBAAoB,EAAE,MAAM,UAAU,WAAW,GAAoB;AAC5E,SAAO,KAAC,sBAAQ,MAAM,QAAQ,KAAK,KAAC,sBAAQ,MAAM,UAAU;AAC9D;AAEA,SAAS,mBAAsB,UAAwB,UAAmD;AACxG,SAAO,CAAC,UAAmC;AACzC,aAAS,CAAC,cAAiB,aAAS,yBAAW,KAAK,IAAI,MAAM,SAAS,IAAI,OAAO,SAAS,CAAC;AAAA,EAC9F;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,UAAuB,CAAC,MACyB;AACjD,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,sBAAsB;AAAA,EACxB,IAAI;AAEJ,QAAM,CAAC,YAAY,QAAQ,QAAI,uBAAS,SAAS,MAAM,CAAC,CAAC,CAAC;AAC1D,QAAM,iBAAiB,sBAAsB,mBAAmB,UAAU,QAAQ,IAAI;AACtF,QAAM,eAAW,qBAAO,IAAI;AAE5B,MACE,aAAa;AAAA,IACX;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,EACF,CAAC,GACD;AACA,UAAM,WAAW,SAAS,MAAM,SAAS,OAAO;AAChD,aAAS,QAAQ;AAAA,EACnB;AACA,WAAS,UAAU;AACnB,SAAO,CAAC,YAAY,cAAc;AACpC;AAEA,IAAO,mCAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useDimensions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useDimensions.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useState } from 'react';\nimport ResizeObserver from 'resize-observer-polyfill';\n\nexport const useDimensions = (domNode: HTMLElement) => {\n const [dimensions, setDimensions] = useState<DOMRectReadOnly>();\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => setDimensions(entry.contentRect));\n if (domNode) {\n resizeObserver.observe(domNode);\n return () => resizeObserver.unobserve(domNode);\n }\n\n return undefined;\n }, [domNode]);\n\n return dimensions;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,sCAA2B;AAEpB,MAAM,gBAAgB,CAAC,YAAyB;AACrD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAA0B;AAE9D,8BAAU,MAAM;AACd,UAAM,iBAAiB,IAAI,gCAAAA,QAAe,CAAC,CAAC,KAAK,MAAM,cAAc,MAAM,WAAW,CAAC;AACvF,QAAI,SAAS;AACX,qBAAe,QAAQ,OAAO;AAC9B,aAAO,MAAM,eAAe,UAAU,OAAO;AAAA,IAC/C;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO;AACT;",
6
6
  "names": ["ResizeObserver"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useExecutionTimer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useExecutionTimer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useRef } from 'react';\n\ntype Callback = (...args: unknown[]) => unknown;\n\nexport const useExecutionTimer = (startFn: Callback, cleanFn: Callback, delayTime: number) => {\n const startTimer = useRef<NodeJS.Timeout>();\n const closeTimer = useRef<NodeJS.Timeout>();\n\n const startFunction: Callback = (...args) => {\n if (closeTimer.current) clearTimeout(closeTimer.current);\n startTimer.current = setTimeout(() => startFn(...args), delayTime);\n };\n\n const cleanFunction: Callback = (...args) => {\n if (startTimer.current) clearTimeout(startTimer.current);\n closeTimer.current = setTimeout(() => cleanFn(...args), 30);\n };\n return [startFunction, cleanFunction];\n};\n\nexport default useExecutionTimer;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAuB;AAIhB,MAAM,oBAAoB,CAAC,SAAmB,SAAmB,cAAsB;AAC5F,QAAM,iBAAa,qBAAuB;AAC1C,QAAM,iBAAa,qBAAuB;AAE1C,QAAM,gBAA0B,IAAI,SAAS;AAC3C,QAAI,WAAW;AAAS,mBAAa,WAAW,OAAO;AACvD,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS;AAAA,EACnE;AAEA,QAAM,gBAA0B,IAAI,SAAS;AAC3C,QAAI,WAAW;AAAS,mBAAa,WAAW,OAAO;AACvD,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE;AAAA,EAC5D;AACA,SAAO,CAAC,eAAe,aAAa;AACtC;AAEA,IAAO,4BAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useExpandState.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useExpandState.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useMemo } from 'react';\nimport { isFunction } from '../utils.js';\nimport { useDerivedStateFromProps } from './useDerivedStateFromProps.js';\n\ntype ItemT = Record<string, string>;\ninterface UseExpandStateArg {\n items?: ItemT[];\n itemKey?: keyof ItemT;\n expanded?: Record<string, boolean>;\n onExpand: (item: ItemT) => void;\n onExpandChange: (nextState: Record<string, boolean>, item?: ItemT) => void;\n onExpandAll: (nextState: Record<string, boolean>) => void;\n onToggleExpand: (item: ItemT) => void;\n onCollapse: (item: ItemT) => void;\n}\n\nconst toggleStateInObject = <T,>(obj: Record<string, T>, key: string, value: T) => {\n const nextObj = { ...obj };\n if (nextObj[key]) {\n delete nextObj[key];\n } else {\n nextObj[key] = value;\n }\n return nextObj;\n};\n\nconst noop = () => null;\n\nexport const useExpandState = ({\n items = [],\n itemKey = 'id',\n expanded: expandedProp = {},\n onExpand,\n onExpandChange = noop,\n onExpandAll = noop,\n onToggleExpand,\n onCollapse,\n}: UseExpandStateArg) => {\n const [expanded, setExpanded] = useDerivedStateFromProps(expandedProp);\n\n const isExpandedAll = useMemo(() => Object.keys(expanded).length === items.length, [expanded, items]);\n\n const toggleExpandAll = (stateData = true) => {\n setExpanded(() => {\n const nextState: Record<string, boolean> = {};\n if (!isExpandedAll) {\n items.forEach((item) => {\n nextState[item[itemKey]] = stateData;\n });\n }\n onExpandChange(nextState);\n onExpandAll(nextState);\n return nextState;\n });\n };\n\n const expand = (item: ItemT, stateData = true) => {\n if (!item) return;\n if (isFunction(onExpand)) {\n onExpand(item);\n }\n setExpanded((prevState) => {\n const key = item[itemKey];\n const nextState = { ...prevState, [key]: stateData };\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const toggleExpand = (item: ItemT, stateData = true) => {\n if (isFunction(onToggleExpand)) {\n onToggleExpand(item);\n }\n setExpanded((prevState) => {\n const key = item[itemKey];\n const nextState = toggleStateInObject(prevState, key, stateData);\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const collapse = (item: ItemT) => {\n if (isFunction(onCollapse)) {\n onCollapse(item);\n }\n setExpanded((prevState) => {\n const nextState = { ...prevState };\n delete nextState[item[itemKey]];\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n return {\n state: { expanded, isExpandedAll },\n actions: {\n expand,\n toggleExpandAll,\n toggleExpand,\n collapse,\n },\n setExpanded,\n };\n};\n\nexport default useExpandState;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,mBAA2B;AAC3B,sCAAyC;AAczC,MAAM,sBAAsB,CAAK,KAAwB,KAAa,UAAa;AACjF,QAAM,UAAU,EAAE,GAAG,IAAI;AACzB,MAAI,QAAQ,GAAG,GAAG;AAChB,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;AAEA,MAAM,OAAO,MAAM;AAEZ,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAQ,CAAC;AAAA,EACT,UAAU;AAAA,EACV,UAAU,eAAe,CAAC;AAAA,EAC1B;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,CAAC,UAAU,WAAW,QAAI,0DAAyB,YAAY;AAErE,QAAM,oBAAgB,sBAAQ,MAAM,OAAO,KAAK,QAAQ,EAAE,WAAW,MAAM,QAAQ,CAAC,UAAU,KAAK,CAAC;AAEpG,QAAM,kBAAkB,CAAC,YAAY,SAAS;AAC5C,gBAAY,MAAM;AAChB,YAAM,YAAqC,CAAC;AAC5C,UAAI,CAAC,eAAe;AAClB,cAAM,QAAQ,CAAC,SAAS;AACtB,oBAAU,KAAK,OAAO,CAAC,IAAI;AAAA,QAC7B,CAAC;AAAA,MACH;AACA,qBAAe,SAAS;AACxB,kBAAY,SAAS;AACrB,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,SAAS,CAAC,MAAa,YAAY,SAAS;AAChD,QAAI,CAAC;AAAM;AACX,YAAI,yBAAW,QAAQ,GAAG;AACxB,eAAS,IAAI;AAAA,IACf;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,MAAM,KAAK,OAAO;AACxB,YAAM,YAAY,EAAE,GAAG,WAAW,CAAC,GAAG,GAAG,UAAU;AACnD,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,eAAe,CAAC,MAAa,YAAY,SAAS;AACtD,YAAI,yBAAW,cAAc,GAAG;AAC9B,qBAAe,IAAI;AAAA,IACrB;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,MAAM,KAAK,OAAO;AACxB,YAAM,YAAY,oBAAoB,WAAW,KAAK,SAAS;AAC/D,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,WAAW,CAAC,SAAgB;AAChC,YAAI,yBAAW,UAAU,GAAG;AAC1B,iBAAW,IAAI;AAAA,IACjB;AACA,gBAAY,CAAC,cAAc;AACzB,YAAM,YAAY,EAAE,GAAG,UAAU;AACjC,aAAO,UAAU,KAAK,OAAO,CAAC;AAC9B,qBAAe,WAAW,IAAI;AAC9B,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,UAAU,cAAc;AAAA,IACjC,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useFocusTrap.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useFocusTrap.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { describe, PropTypes } from '../props-helpers/index.js';\n\nconst useFocusTrapProps: { [index: string]: string } = {\n firstElementRef: 'object',\n lastElementRef: 'object',\n onKeyDown: 'function',\n};\n\nconst getVariableType = (arg: unknown): string => {\n if (Array.isArray(arg)) return 'array';\n if (arg === null) return 'null';\n if (arg === undefined) return 'undefined';\n return typeof arg;\n};\n\nconst throwTypeError = (validPropKey: string, invalidProp: unknown): void => {\n throw new Error(\n `Warning: You are trying to pass a not valid \"${validPropKey}\" property to use a useFocusTrap hook, please provide a valid type.\n\n Received: ${getVariableType(invalidProp)}\n Expected: ${useFocusTrapProps[validPropKey]}\n `,\n );\n};\n\nconst throwRequiredError = (validPropKey: string): void => {\n throw new Error(\n `Warning: Please provide a \"${validPropKey}\" property to use a useFocusTrap hook, this property is required.`,\n );\n};\n\nconst validateProps = (componentProps: Record<string, unknown>): void => {\n if (componentProps.firstElementRef === undefined) {\n throwRequiredError('firstElementRef');\n }\n if (componentProps.lastElementRef === undefined) {\n throwRequiredError('lastElementRef');\n }\n if (componentProps.firstElementRef && typeof componentProps.firstElementRef !== 'object') {\n throwTypeError('firstElementRef', componentProps.firstElementRef);\n }\n if (componentProps.lastElementRef && typeof componentProps.lastElementRef !== 'object') {\n throwTypeError('lastElementRef', componentProps.lastElementRef);\n }\n if (componentProps.onKeyDown && typeof componentProps.onKeyDown !== 'function') {\n throwTypeError('onKeyDown', componentProps.onKeyDown);\n }\n};\n\nconst propTypes = {\n firstElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the first element in the focus trap.',\n ).isRequired,\n lastElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the second element in the focus trap.',\n ).isRequired,\n onKeyDown: PropTypes.func.description('Optional onKeyDown callback.'),\n} as WeakValidationMap<unknown>;\n\ntype UseFocusTrapFunctionT = <T extends HTMLElement = HTMLElement, K extends HTMLElement = HTMLElement>({\n firstElementRef,\n lastElementRef,\n onKeyDown,\n}: {\n firstElementRef: React.MutableRefObject<T | null>;\n lastElementRef: React.MutableRefObject<K | null>;\n onKeyDown?: React.KeyboardEventHandler;\n}) => React.KeyboardEventHandler;\n\ninterface UseFocusTrapT extends UseFocusTrapFunctionT {\n displayName: 'useFocusTrap';\n}\n\nconst useFocusTrap: UseFocusTrapT = (props) => {\n // We need to investigate how to validate references with useValidateTypescriptPropTypes.\n useEffect(() => validateProps(props), [props]);\n\n const { firstElementRef, lastElementRef, onKeyDown } = props;\n\n return useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n // we need to check all the condition before preventing default\n // because we want last-element/first-element tab/shift-tab to keep working\n\n if (e.key === 'Tab' && !e.shiftKey && e.target === lastElementRef.current && firstElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n firstElementRef.current.focus();\n }\n if (e.key === 'Tab' && e.shiftKey && e.target === firstElementRef.current && lastElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n lastElementRef.current.focus();\n }\n },\n [firstElementRef, lastElementRef, onKeyDown],\n );\n};\n\nuseFocusTrap.displayName = 'useFocusTrap';\nconst UseFocusTrapWithSchema = describe(useFocusTrap);\n\nUseFocusTrapWithSchema.propTypes = propTypes;\n\nexport { useFocusTrap, UseFocusTrapWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAuC;AACvC,2BAAoC;AAEpC,MAAM,oBAAiD;AAAA,EACrD,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AACb;AAEA,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ,GAAG;AAAG,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAChB;AAEA,MAAM,iBAAiB,CAAC,cAAsB,gBAA+B;AAC3E,QAAM,IAAI;AAAA,IACR,gDAAgD;AAAA;AAAA,cAEtC,gBAAgB,WAAW;AAAA,cAC3B,kBAAkB,YAAY;AAAA;AAAA,EAE1C;AACF;AAEA,MAAM,qBAAqB,CAAC,iBAA+B;AACzD,QAAM,IAAI;AAAA,IACR,8BAA8B;AAAA,EAChC;AACF;AAEA,MAAM,gBAAgB,CAAC,mBAAkD;AACvE,MAAI,eAAe,oBAAoB,QAAW;AAChD,uBAAmB,iBAAiB;AAAA,EACtC;AACA,MAAI,eAAe,mBAAmB,QAAW;AAC/C,uBAAmB,gBAAgB;AAAA,EACrC;AACA,MAAI,eAAe,mBAAmB,OAAO,eAAe,oBAAoB,UAAU;AACxF,mBAAe,mBAAmB,eAAe,eAAe;AAAA,EAClE;AACA,MAAI,eAAe,kBAAkB,OAAO,eAAe,mBAAmB,UAAU;AACtF,mBAAe,kBAAkB,eAAe,cAAc;AAAA,EAChE;AACA,MAAI,eAAe,aAAa,OAAO,eAAe,cAAc,YAAY;AAC9E,mBAAe,aAAa,eAAe,SAAS;AAAA,EACtD;AACF;AAEA,MAAM,YAAY;AAAA,EAChB,iBAAiB,+BAAU,UAAU,CAAC,+BAAU,MAAM,CAAC,IAAI,CAAC,GAAG,+BAAU,IAAI,CAAC,EAAE;AAAA,IAC9E;AAAA,EACF,EAAE;AAAA,EACF,gBAAgB,+BAAU,UAAU,CAAC,+BAAU,MAAM,CAAC,IAAI,CAAC,GAAG,+BAAU,IAAI,CAAC,EAAE;AAAA,IAC7E;AAAA,EACF,EAAE;AAAA,EACF,WAAW,+BAAU,KAAK,YAAY,8BAA8B;AACtE;AAgBA,MAAM,eAA8B,CAAC,UAAU;AAE7C,8BAAU,MAAM,cAAc,KAAK,GAAG,CAAC,KAAK,CAAC;AAE7C,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,IAAI;AAEvD,aAAO;AAAA,IACL,CAAC,MAAM;AACL,UAAI;AAAW,kBAAU,CAAC;AAI1B,UAAI,EAAE,QAAQ,SAAS,CAAC,EAAE,YAAY,EAAE,WAAW,eAAe,WAAW,gBAAgB,SAAS;AACpG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,wBAAgB,QAAQ,MAAM;AAAA,MAChC;AACA,UAAI,EAAE,QAAQ,SAAS,EAAE,YAAY,EAAE,WAAW,gBAAgB,WAAW,eAAe,SAAS;AACnG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,uBAAe,QAAQ,MAAM;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,gBAAgB,SAAS;AAAA,EAC7C;AACF;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,+BAAS,YAAY;AAEpD,uBAAuB,YAAY;",
6
6
  "names": []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useHeadlessTooltip.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\n\n// This function is a custom hook that adds a keyboard event listener to the document\n// calls the specified function when a key is pressed.\nconst useGlobalKeyboardListener = (func: ({ key }: { key: string }) => void) => {\n React.useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n\nexport type LatestOpenInteraction = '' | 'onFocus' | 'onMouseEnter';\nexport type UseHeadlessTooltipConfig = {\n hasFocus?: boolean;\n isHovering?: boolean;\n latestOpenInteraction?: LatestOpenInteraction;\n onOpen?: () => void;\n onClose?: () => void;\n};\n\nconst useControlledState = <T>(controlledValue?: T, defaultVal?: T) => {\n const [internalValue, setInternalValue] = React.useState<T | null>(defaultVal ?? null);\n const val = React.useMemo(() => {\n if (controlledValue !== undefined) return controlledValue;\n return internalValue;\n }, [controlledValue, internalValue]);\n return [val, setInternalValue] as const;\n};\n\n/**\n * A custom hook that provides logic for a headless tooltip. This hook can be used in a controlled or uncontrolled way.\n *\n * @param {UseHeadlessTooltipConfig} config - The configuration object for the hook.\n * @param {boolean} config.hasFocus - Whether or not the trigger element has focus. If this is not provided, the hook will track focus internally.\n * @param {boolean} config.isHovering - Whether or not the mouse is hovering over the trigger element. If this is not provided, the hook will track hover internally.\n * @param {LatestOpenInteraction} config.latestOpenInteraction - Whether or not the mouse is hovering over the trigger element. If this is not provided, the hook will track hover internally.\n * @param {Function} config.onOpen - A callback that will be invoked when the tooltip is opened.\n * @param {Function} config.onClose - A callback that will be invoked when the tooltip is closed.\n * @returns {object} - An object containing the following properties:\n *\n * {boolean} hasFocus - Whether or not the trigger element has focus.\n *\n * {boolean} isHovering - Whether or not the mouse is hovering over the trigger element.\n *\n * {'' | 'onFocus' | 'onMouseEnter'} latestOpenInteraction - which was the last operation that is used to control if the tooltip should show or not.\n *\n * {string} finalLatestOpenInteraction - The most recent interaction that caused the tooltip to open.\n *\n * {HTMLDivElement} referenceElement - The trigger element.\n *\n * {function} setReferenceElement - A function that sets the trigger element.\n *\n * {boolean} shouldShowPopover - Whether or not the tooltip is visible.\n *\n * {function} showTooltip - A function that opens the tooltip.\n *\n * {function} hideTooltip - A function that closes the tooltip.\n *\n * {function} onFocus - A function that should be invoked when the trigger element receives focus.\n *\n * {function} onBlur - A function that should be invoked when the trigger element loses focus.\n *\n * {function} onMouseEnter - A function that should be invoked when the mouse enters the trigger element.\n *\n * {function} onMouseLeave - A function that should be invoked when the mouse leaves the trigger element.\n * @example\n * const tooltipHelpers = useHeadlessTooltip({\n * hasFocus: true,\n * isHovering: false,\n * onOpen: () => console.log('tooltip opened'),\n * onClose: () => console.log('tooltip closed'),\n * });\n * ...\n * <div>\n * <button\n * ref={tooltipHelpers.setReferenceElement}\n * onMouseEnter={tooltipHelpers.onMouseEnter}\n * onMouseLeave={tooltipHelpers.onMouseLeave}\n * onPointerEnter={tooltipHelpers.onMouseEnter}\n * onPointerLeave={tooltipHelpers.onMouseLeave}\n * onFocus={tooltipHelpers.onFocus}\n * onBlur={tooltipHelpers.onBlur}\n * >hello</button>\n * <DSPopperJS\n * referenceElement={tooltipHelpers.referenceElement}\n * shouldShowPopover={tooltipHelpers.shouldShowPopover}\n * >\n * <div>Tooltip content</div>\n * </DSPopperJS>\n * </div>\n */\nexport const useHeadlessTooltip = (config?: UseHeadlessTooltipConfig) => {\n // Extract the configuration values or set default values if they are not provided.\n const { hasFocus, isHovering, latestOpenInteraction, onOpen = () => {}, onClose = () => {} } = config ?? {};\n\n // this pattern is basically a way to allow usage of the hook in a controlled or uncontrolled way.\n const [finalHasFocus, setInternalHasFocus] = useControlledState<boolean>(hasFocus, false);\n const [finalIsHovering, setInternalIsHovering] = useControlledState<boolean>(isHovering, false);\n const [finalLatestOpenInteraction, setLatestOpenInteraction] = useControlledState<string>(latestOpenInteraction, '');\n\n // end of controlled/uncontrolled pattern\n\n // Set up state variables for the tooltip's visibility and the most recent interaction that caused it to open.\n // The most recent interaction is used to determine whether or not to close the tooltip when the user\n // moves the mouse away from the trigger element.\n const [referenceElement, setReferenceElement] = React.useState<HTMLDivElement | null>(null);\n const [shouldShowPopover, setShouldShowPopover] = React.useState<boolean>(false);\n\n // memoized versions of the show and hide functions\n // those include the callbacks to allow \"controlled\" usage of the hook\n const showTooltip = React.useCallback(() => {\n setShouldShowPopover(true);\n onOpen();\n }, [onOpen]);\n\n const hideTooltip = React.useCallback(() => {\n setShouldShowPopover(false);\n onClose();\n }, [onClose]);\n\n const trackLatestKeyboardInteraction = React.useCallback(() => {\n if (!shouldShowPopover) {\n setLatestOpenInteraction('onFocus');\n }\n }, [setLatestOpenInteraction, shouldShowPopover]);\n\n const trackLatestMouseInteraction = React.useCallback(() => {\n if (!shouldShowPopover) {\n setLatestOpenInteraction('onMouseEnter');\n }\n }, [setLatestOpenInteraction, shouldShowPopover]);\n\n // following here are the event handlers that are used to control the tooltip's visibility logic\n const onFocus = React.useCallback(() => {\n setInternalHasFocus(true); // uncontrolled usage tracking\n trackLatestKeyboardInteraction();\n if (!shouldShowPopover) {\n showTooltip();\n }\n }, [setInternalHasFocus, shouldShowPopover, showTooltip, trackLatestKeyboardInteraction]);\n\n const onBlur = React.useCallback(() => {\n setInternalHasFocus(false); // uncontrolled usage tracking\n // blur may triggered via keyboard navigation or mouse interaction\n // every time the mouse is hovering, we want to keep the tooltip open\n // but if the mouse is not hovering, we want to close the tooltip only if the last interaction was via keyboard\n // e.g if the user keyboard navigates to the trigger element and then moves the mouse away, we want to keep the tooltip open\n if (!finalIsHovering || finalLatestOpenInteraction === 'onFocus') hideTooltip();\n }, [setInternalHasFocus, finalIsHovering, finalLatestOpenInteraction, hideTooltip]);\n\n const onMouseEnter = React.useCallback(() => {\n setInternalIsHovering(true); // uncontrolled usage tracking\n // kind of debouncing the mouse enter event to reduce the avarge O() notation of the function\n // even if this is continually invoked, it will be O(1) and controlled callbacks will be invoked only once\n trackLatestMouseInteraction();\n if (!shouldShowPopover) {\n showTooltip();\n }\n }, [setInternalIsHovering, shouldShowPopover, showTooltip, trackLatestMouseInteraction]);\n\n const onMouseLeave = React.useCallback(() => {\n setInternalIsHovering(false); // uncontrolled usage tracking\n // mouse leave may be triggered via keyboard navigation or mouse interaction\n // every time the trigger element has focus, we want to keep the tooltip open\n // but if the trigger element does not have focus, we want to close the tooltip only if the last interaction was via mouse\n // e.g if the user keyboard navigates to the trigger element and then moves the mouse away, we want to keep the tooltip open\n if (!finalHasFocus || finalLatestOpenInteraction === 'onMouseEnter') hideTooltip();\n }, [setInternalIsHovering, finalHasFocus, finalLatestOpenInteraction, hideTooltip]);\n\n const handleEscKey = React.useCallback(\n ({ key }: { key: string }) => {\n // accessibility standard: pressing escape should close the tooltip\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n // accessibilty standard: pressing escape should close the tooltip no matter where the focus is\n useGlobalKeyboardListener(handleEscKey);\n\n return React.useMemo(\n () => ({\n hasFocus: finalHasFocus,\n isHovering: finalIsHovering,\n latestOpenInteraction: finalLatestOpenInteraction,\n referenceElement,\n setReferenceElement,\n shouldShowPopover,\n showTooltip,\n hideTooltip,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n }),\n [\n finalHasFocus,\n finalIsHovering,\n finalLatestOpenInteraction,\n referenceElement,\n shouldShowPopover,\n showTooltip,\n hideTooltip,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "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",
3
+ "sources": ["../../../src/hooks/useHeadlessTooltip.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\n\n// This function is a custom hook that adds a keyboard event listener to the document\n// calls the specified function when a key is pressed.\nconst useGlobalKeyboardListener = (func: ({ key }: { key: string }) => void) => {\n React.useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n\nexport type LatestOpenInteraction = '' | 'onFocus' | 'onMouseEnter';\nexport type UseHeadlessTooltipConfig = {\n hasFocus?: boolean;\n isHovering?: boolean;\n latestOpenInteraction?: LatestOpenInteraction;\n onOpen?: () => void;\n onClose?: () => void;\n};\n\nconst useControlledState = <T>(controlledValue?: T, defaultVal?: T) => {\n const [internalValue, setInternalValue] = React.useState<T | null>(defaultVal ?? null);\n const val = React.useMemo(() => {\n if (controlledValue !== undefined) return controlledValue;\n return internalValue;\n }, [controlledValue, internalValue]);\n return [val, setInternalValue] as const;\n};\n\n/**\n * A custom hook that provides logic for a headless tooltip. This hook can be used in a controlled or uncontrolled way.\n * @param {UseHeadlessTooltipConfig} config - The configuration object for the hook.\n * @param {boolean} config.hasFocus - Whether or not the trigger element has focus. If this is not provided, the hook will track focus internally.\n * @param {boolean} config.isHovering - Whether or not the mouse is hovering over the trigger element. If this is not provided, the hook will track hover internally.\n * @param {LatestOpenInteraction} config.latestOpenInteraction - Whether or not the mouse is hovering over the trigger element. If this is not provided, the hook will track hover internally.\n * @param {Function} config.onOpen - A callback that will be invoked when the tooltip is opened.\n * @param {Function} config.onClose - A callback that will be invoked when the tooltip is closed.\n * @returns {object} - An object containing the following properties:\n *\n * {boolean} hasFocus - Whether or not the trigger element has focus.\n *\n * {boolean} isHovering - Whether or not the mouse is hovering over the trigger element.\n *\n * {'' | 'onFocus' | 'onMouseEnter'} latestOpenInteraction - which was the last operation that is used to control if the tooltip should show or not.\n *\n * {string} finalLatestOpenInteraction - The most recent interaction that caused the tooltip to open.\n *\n * {HTMLDivElement} referenceElement - The trigger element.\n *\n * {function} setReferenceElement - A function that sets the trigger element.\n *\n * {boolean} shouldShowPopover - Whether or not the tooltip is visible.\n *\n * {function} showTooltip - A function that opens the tooltip.\n *\n * {function} hideTooltip - A function that closes the tooltip.\n *\n * {function} onFocus - A function that should be invoked when the trigger element receives focus.\n *\n * {function} onBlur - A function that should be invoked when the trigger element loses focus.\n *\n * {function} onMouseEnter - A function that should be invoked when the mouse enters the trigger element.\n *\n * {function} onMouseLeave - A function that should be invoked when the mouse leaves the trigger element.\n * @example\n * const tooltipHelpers = useHeadlessTooltip({\n * hasFocus: true,\n * isHovering: false,\n * onOpen: () => console.log('tooltip opened'),\n * onClose: () => console.log('tooltip closed'),\n * });\n * ...\n * <div>\n * <button\n * ref={tooltipHelpers.setReferenceElement}\n * onMouseEnter={tooltipHelpers.onMouseEnter}\n * onMouseLeave={tooltipHelpers.onMouseLeave}\n * onPointerEnter={tooltipHelpers.onMouseEnter}\n * onPointerLeave={tooltipHelpers.onMouseLeave}\n * onFocus={tooltipHelpers.onFocus}\n * onBlur={tooltipHelpers.onBlur}\n * >hello</button>\n * <DSPopperJS\n * referenceElement={tooltipHelpers.referenceElement}\n * shouldShowPopover={tooltipHelpers.shouldShowPopover}\n * >\n * <div>Tooltip content</div>\n * </DSPopperJS>\n * </div>\n */\nexport const useHeadlessTooltip = (config?: UseHeadlessTooltipConfig) => {\n // Extract the configuration values or set default values if they are not provided.\n const { hasFocus, isHovering, latestOpenInteraction, onOpen = () => {}, onClose = () => {} } = config ?? {};\n\n // this pattern is basically a way to allow usage of the hook in a controlled or uncontrolled way.\n const [finalHasFocus, setInternalHasFocus] = useControlledState<boolean>(hasFocus, false);\n const [finalIsHovering, setInternalIsHovering] = useControlledState<boolean>(isHovering, false);\n const [finalLatestOpenInteraction, setLatestOpenInteraction] = useControlledState<string>(latestOpenInteraction, '');\n\n // end of controlled/uncontrolled pattern\n\n // Set up state variables for the tooltip's visibility and the most recent interaction that caused it to open.\n // The most recent interaction is used to determine whether or not to close the tooltip when the user\n // moves the mouse away from the trigger element.\n const [referenceElement, setReferenceElement] = React.useState<HTMLDivElement | null>(null);\n const [shouldShowPopover, setShouldShowPopover] = React.useState<boolean>(false);\n\n // memoized versions of the show and hide functions\n // those include the callbacks to allow \"controlled\" usage of the hook\n const showTooltip = React.useCallback(() => {\n setShouldShowPopover(true);\n onOpen();\n }, [onOpen]);\n\n const hideTooltip = React.useCallback(() => {\n setShouldShowPopover(false);\n onClose();\n }, [onClose]);\n\n const trackLatestKeyboardInteraction = React.useCallback(() => {\n if (!shouldShowPopover) {\n setLatestOpenInteraction('onFocus');\n }\n }, [setLatestOpenInteraction, shouldShowPopover]);\n\n const trackLatestMouseInteraction = React.useCallback(() => {\n if (!shouldShowPopover) {\n setLatestOpenInteraction('onMouseEnter');\n }\n }, [setLatestOpenInteraction, shouldShowPopover]);\n\n // following here are the event handlers that are used to control the tooltip's visibility logic\n const onFocus = React.useCallback(() => {\n setInternalHasFocus(true); // uncontrolled usage tracking\n trackLatestKeyboardInteraction();\n if (!shouldShowPopover) {\n showTooltip();\n }\n }, [setInternalHasFocus, shouldShowPopover, showTooltip, trackLatestKeyboardInteraction]);\n\n const onBlur = React.useCallback(() => {\n setInternalHasFocus(false); // uncontrolled usage tracking\n // blur may triggered via keyboard navigation or mouse interaction\n // every time the mouse is hovering, we want to keep the tooltip open\n // but if the mouse is not hovering, we want to close the tooltip only if the last interaction was via keyboard\n // e.g if the user keyboard navigates to the trigger element and then moves the mouse away, we want to keep the tooltip open\n if (!finalIsHovering || finalLatestOpenInteraction === 'onFocus') hideTooltip();\n }, [setInternalHasFocus, finalIsHovering, finalLatestOpenInteraction, hideTooltip]);\n\n const onMouseEnter = React.useCallback(() => {\n setInternalIsHovering(true); // uncontrolled usage tracking\n // kind of debouncing the mouse enter event to reduce the avarge O() notation of the function\n // even if this is continually invoked, it will be O(1) and controlled callbacks will be invoked only once\n trackLatestMouseInteraction();\n if (!shouldShowPopover) {\n showTooltip();\n }\n }, [setInternalIsHovering, shouldShowPopover, showTooltip, trackLatestMouseInteraction]);\n\n const onMouseLeave = React.useCallback(() => {\n setInternalIsHovering(false); // uncontrolled usage tracking\n // mouse leave may be triggered via keyboard navigation or mouse interaction\n // every time the trigger element has focus, we want to keep the tooltip open\n // but if the trigger element does not have focus, we want to close the tooltip only if the last interaction was via mouse\n // e.g if the user keyboard navigates to the trigger element and then moves the mouse away, we want to keep the tooltip open\n if (!finalHasFocus || finalLatestOpenInteraction === 'onMouseEnter') hideTooltip();\n }, [setInternalIsHovering, finalHasFocus, finalLatestOpenInteraction, hideTooltip]);\n\n const handleEscKey = React.useCallback(\n ({ key }: { key: string }) => {\n // accessibility standard: pressing escape should close the tooltip\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n // accessibilty standard: pressing escape should close the tooltip no matter where the focus is\n useGlobalKeyboardListener(handleEscKey);\n\n return React.useMemo(\n () => ({\n hasFocus: finalHasFocus,\n isHovering: finalIsHovering,\n latestOpenInteraction: finalLatestOpenInteraction,\n referenceElement,\n setReferenceElement,\n shouldShowPopover,\n showTooltip,\n hideTooltip,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n }),\n [\n finalHasFocus,\n finalIsHovering,\n finalLatestOpenInteraction,\n referenceElement,\n shouldShowPopover,\n showTooltip,\n hideTooltip,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "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",
6
6
  "names": ["React"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useHotkeys.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useHotkeys.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { KeyHandler } from 'hotkeys-js';\nimport hotkeys from 'hotkeys-js';\nimport { useCallback, useEffect } from 'react';\n\ntype Options = {\n scope?: string;\n element?: HTMLElement | null;\n keyup?: boolean | null;\n keydown?: boolean | null;\n splitKey?: string;\n};\ninterface UseHotKeysArg {\n keys: string;\n options?: Options;\n handler: KeyHandler;\n}\n\nexport const useHotkeys = ({ keys, handler, options = {} }: UseHotKeysArg, deps: unknown[] = []) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const memoizedCallback = useCallback(handler, deps);\n\n useEffect(() => {\n hotkeys(keys, options, memoizedCallback);\n\n return () => hotkeys.unbind(keys);\n }, [keys, memoizedCallback, options]);\n};\n\nexport default useHotkeys;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAAoB;AACpB,mBAAuC;AAehC,MAAM,aAAa,CAAC,EAAE,MAAM,SAAS,UAAU,CAAC,EAAE,GAAkB,OAAkB,CAAC,MAAM;AAElG,QAAM,uBAAmB,0BAAY,SAAS,IAAI;AAElD,8BAAU,MAAM;AACd,0BAAAA,SAAQ,MAAM,SAAS,gBAAgB;AAEvC,WAAO,MAAM,kBAAAA,QAAQ,OAAO,IAAI;AAAA,EAClC,GAAG,CAAC,MAAM,kBAAkB,OAAO,CAAC;AACtC;AAEA,IAAO,qBAAQ;",
6
6
  "names": ["hotkeys"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useHoverHandlersDelay.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useHoverHandlersDelay.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useCallback, useRef } from 'react';\n\ninterface UseHoverHandlersDelayArg {\n onMouseOver: () => void;\n onMouseLeave: () => void;\n hideDelay?: number;\n showDelay?: number;\n}\n\nexport const useHoverHandlersDelay = ({\n onMouseOver,\n onMouseLeave,\n hideDelay = 300,\n showDelay = 300,\n}: UseHoverHandlersDelayArg) => {\n const hideTimer = useRef<NodeJS.Timeout>();\n const showTimer = useRef<NodeJS.Timeout>();\n\n const delayedHide = useCallback(() => {\n if (showTimer.current) clearTimeout(showTimer.current);\n hideTimer.current = setTimeout(onMouseLeave, hideDelay);\n }, [hideDelay, onMouseLeave]);\n\n const delayedShow = useCallback(() => {\n if (hideTimer.current) clearTimeout(hideTimer.current);\n showTimer.current = setTimeout(onMouseOver, showDelay);\n }, [onMouseOver, showDelay]);\n\n return {\n onMouseOver: delayedShow,\n onMouseLeave: delayedHide,\n };\n};\n\nexport default useHoverHandlersDelay;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAS7B,MAAM,wBAAwB,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AACd,MAAgC;AAC9B,QAAM,gBAAY,qBAAuB;AACzC,QAAM,gBAAY,qBAAuB;AAEzC,QAAM,kBAAc,0BAAY,MAAM;AACpC,QAAI,UAAU;AAAS,mBAAa,UAAU,OAAO;AACrD,cAAU,UAAU,WAAW,cAAc,SAAS;AAAA,EACxD,GAAG,CAAC,WAAW,YAAY,CAAC;AAE5B,QAAM,kBAAc,0BAAY,MAAM;AACpC,QAAI,UAAU;AAAS,mBAAa,UAAU,OAAO;AACrD,cAAU,UAAU,WAAW,aAAa,SAAS;AAAA,EACvD,GAAG,CAAC,aAAa,SAAS,CAAC;AAE3B,SAAO;AAAA,IACL,aAAa;AAAA,IACb,cAAc;AAAA,EAChB;AACF;AAEA,IAAO,gCAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useIsMobile.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useIsMobile.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useState, useEffect } from 'react';\nimport { getDefaultTheme } from '@elliemae/pui-theme';\nimport type { Theme } from '@elliemae/pui-theme';\n\nconst theme = getDefaultTheme() as Theme;\n\nconst isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nexport const useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,uBAAgC;AAGhC,MAAM,YAAQ,kCAAgB;AAE9B,MAAM,WAAW,MAAe;AAC9B,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,OAAO,MAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useIsShowingEllipsis.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useIsShowingEllipsis.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useState, useMemo } from 'react';\n\nexport const useIsShowingEllipsis = <T extends HTMLElement | null = HTMLElement | null>() => {\n const [element, setElement] = useState<T>();\n\n const [isShowingEllipsis, setIsShowingEllipsis] = useState(false);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (element) {\n setIsShowingEllipsis(element.scrollWidth > element.clientWidth);\n resizeObserver.observe(element);\n }\n return () => {\n if (element) {\n resizeObserver.unobserve(element);\n }\n };\n }, [resizeObserver, element]);\n\n return { setElement, isShowingEllipsis };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAEtC,MAAM,uBAAuB,MAAyD;AAC3F,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAY;AAE1C,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAS,KAAK;AAEhE,QAAM,qBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,UAAI,QAAQ,QAAQ;AAClB,cAAM,CAAC,gBAAgB,IAAI;AAC3B,cAAM,KAAK,iBAAiB;AAC5B,6BAAqB,IAAI,cAAc,IAAI,WAAW;AAAA,MACxD;AAAA,IACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AAEA,8BAAU,MAAM;AACd,QAAI,SAAS;AACX,2BAAqB,QAAQ,cAAc,QAAQ,WAAW;AAC9D,qBAAe,QAAQ,OAAO;AAAA,IAChC;AACA,WAAO,MAAM;AACX,UAAI,SAAS;AACX,uBAAe,UAAU,OAAO;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,gBAAgB,OAAO,CAAC;AAE5B,SAAO,EAAE,YAAY,kBAAkB;AACzC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useMakeMutable.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useMakeMutable.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type React from 'react';\nimport { useRef, useEffect } from 'react';\ntype UseMakeMutable = <T>(referenceVar: T) => React.MutableRefObject<T>;\n\n/**\n * For specific scenarios we need to be able to read the latest value of a variable at execution time without triggering dependency updates on useEffect/useCallback/useMemo\n * This is a custom hook that allows us to do that, with a performance overhead of a useEffect and a memory overhead of a ref.\n * @param {any} referenceVar - the value to be made \"referentially stable\", this works with primitive values and values by reference\n * @returns {object} - an object with a \"current\" property that holds the latest value of the variable passed as argument\n * @property {any} current - the latest value of the variable passed as argument\n * @example\n * const Comp = ({ value }) => {\n * const latestValueRef = useMakeMutable(value);\n * React.useEffect(() => {\n * console.log(latestValueRef.current); // this will log 'hola' at the time of execution\n * }, []);\n * latestValueRef.current = 'hola'; // this will update the latest value of \"value\" at the time of execution\n * ...\n * return <div>...</div>\n * }\n */\nexport const useMakeMutable: UseMakeMutable = (referenceVar) => {\n const mutable = useRef(referenceVar);\n useEffect(() => {\n mutable.current = referenceVar;\n }, [referenceVar]);\n return mutable;\n};\n\n/**\n * For specific scenarios we need to be able to read the latest value of a variable at execution time without triggering dependency updates on useEffect/useCallback/useMemo\n * This is a custom hook that allows us to do that, with a performance overhead of a useEffect and a memory overhead of a ref.\n * N.B. this is the same as useMakeMutable, but with a more explicit name.\n * @param {any} referenceVar - the value to be made \"referentially stable\", this works with primitive values and values by reference\n * @returns {object} - an object with a \"current\" property that holds the latest value of the variable passed as argument\n * @property {any} current - the latest value of the variable passed as argument\n * @example\n * const Comp = ({ value }) => {\n * const latestValueRef = useLatestValueReferenciallyStable(value);\n * React.useEffect(() => {\n * console.log(latestValueRef.current); // this will log 'hola' at the time of execution\n * }, []);\n * latestValueRef.current = 'hola'; // this will update the latest value of \"value\" at the time of execution\n * ...\n * return <div>...</div>\n * }\n */\nexport const useLatestValueReferenciallyStable = useMakeMutable;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkC;AAoB3B,MAAM,iBAAiC,CAAC,iBAAiB;AAC9D,QAAM,cAAU,qBAAO,YAAY;AACnC,8BAAU,MAAM;AACd,YAAQ,UAAU;AAAA,EACpB,GAAG,CAAC,YAAY,CAAC;AACjB,SAAO;AACT;AAoBO,MAAM,oCAAoC;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useNativeIntersectionObserver.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useNativeIntersectionObserver.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useMemo } from 'react';\n\n// Custom hook to use the intersection observer api,\n// to observe changes in the position of an **UNIQUE** element\n// Will trigger the callback with the boundingClientRect of the element\n// the intersection ratio, the intersection rect, if it is intersecting\n// and the html element itself, so you can query for extra information\nexport const useNativeIntersectionObserver = <T extends HTMLElement>(\n el: T | null,\n callback: (entry: Omit<IntersectionObserverEntry, 'target'> & { target: T }) => void,\n) => {\n const intersectionObserver = useMemo(\n () =>\n new IntersectionObserver((entries) => {\n const entry = entries[0]; // We will only observe one element\n\n const target = entry.target as T;\n\n callback({\n boundingClientRect: entry.boundingClientRect,\n intersectionRatio: entry.intersectionRatio,\n intersectionRect: entry.intersectionRect,\n isIntersecting: entry.isIntersecting,\n rootBounds: entry.rootBounds,\n target,\n time: entry.time,\n });\n }),\n [callback],\n );\n\n useEffect(() => {\n if (el) intersectionObserver.observe(el);\n return () => intersectionObserver.disconnect();\n }, [el, intersectionObserver]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmC;AAO5B,MAAM,gCAAgC,CAC3C,IACA,aACG;AACH,QAAM,2BAAuB;AAAA,IAC3B,MACE,IAAI,qBAAqB,CAAC,YAAY;AACpC,YAAM,QAAQ,QAAQ,CAAC;AAEvB,YAAM,SAAS,MAAM;AAErB,eAAS;AAAA,QACP,oBAAoB,MAAM;AAAA,QAC1B,mBAAmB,MAAM;AAAA,QACzB,kBAAkB,MAAM;AAAA,QACxB,gBAAgB,MAAM;AAAA,QACtB,YAAY,MAAM;AAAA,QAClB;AAAA,QACA,MAAM,MAAM;AAAA,MACd,CAAC;AAAA,IACH,CAAC;AAAA,IACH,CAAC,QAAQ;AAAA,EACX;AAEA,8BAAU,MAAM;AACd,QAAI;AAAI,2BAAqB,QAAQ,EAAE;AACvC,WAAO,MAAM,qBAAqB,WAAW;AAAA,EAC/C,GAAG,CAAC,IAAI,oBAAoB,CAAC;AAC/B;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useNativeResizeObserver.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useNativeResizeObserver.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useMemo } from 'react';\n\n// Custom hook to use the resize observer api,\n// to observe changes in the size of an **UNIQUE** element\n// Will trigger the callback with the contentRect,\n// which contains width, height, top, bottom, etc of the element,\n// and the html element itself, so you can query for offsetWidth, etc\nexport const useNativeResizeObserver = <T extends HTMLElement>(\n el: T | null,\n callback: (entry: { contentRect: DOMRectReadOnly; target: T }) => void,\n) => {\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n const entry = entries[0]; // We will only observe one element\n\n const contentRect = entry.contentRect;\n\n const target = entry.target as T;\n\n callback({ contentRect, target });\n }),\n [callback],\n );\n\n useEffect(() => {\n if (el) resizeObserver.observe(el);\n return () => resizeObserver.disconnect();\n }, [el, resizeObserver]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmC;AAO5B,MAAM,0BAA0B,CACrC,IACA,aACG;AACH,QAAM,qBAAiB;AAAA,IACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,YAAM,QAAQ,QAAQ,CAAC;AAEvB,YAAM,cAAc,MAAM;AAE1B,YAAM,SAAS,MAAM;AAErB,eAAS,EAAE,aAAa,OAAO,CAAC;AAAA,IAClC,CAAC;AAAA,IACH,CAAC,QAAQ;AAAA,EACX;AAEA,8BAAU,MAAM;AACd,QAAI;AAAI,qBAAe,QAAQ,EAAE;AACjC,WAAO,MAAM,eAAe,WAAW;AAAA,EACzC,GAAG,CAAC,IAAI,cAAc,CAAC;AACzB;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useOnBlurOut.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useOnBlurOut.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { useCallback } from 'react';\nimport { describe, PropTypes } from '../props-helpers/index.js';\n\nconst propTypes = {\n onBlur: PropTypes.func\n .description('The function to be invoked when focus exits the wrapping container')\n .signature('((e: React.FocusEvent, ...args: unknown[]) => void)').isRequired,\n} as WeakValidationMap<unknown>;\n\ntype OnBlurCb = (e: React.FocusEvent, ...args: unknown[]) => void;\ntype UseOnBlurOut = ({ onBlur }: { onBlur: OnBlurCb }) => OnBlurCb;\nconst useOnBlurOut: UseOnBlurOut = ({ onBlur }) =>\n useCallback<OnBlurCb>(\n (e, ...args) => {\n const { currentTarget } = e;\n // Give browser time to focus the next element\n requestAnimationFrame(() => {\n // Check if the new focused element is a child of the original container\n if (!currentTarget.contains(document.activeElement)) {\n onBlur(e, ...args);\n }\n });\n },\n [onBlur],\n );\n\nconst UseOnBlurOutWithSchema = describe(useOnBlurOut);\nUseOnBlurOutWithSchema.propTypes = propTypes;\n\nexport { useOnBlurOut, UseOnBlurOutWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA4B;AAC5B,2BAAoC;AAEpC,MAAM,YAAY;AAAA,EAChB,QAAQ,+BAAU,KACf,YAAY,oEAAoE,EAChF,UAAU,qDAAqD,EAAE;AACtE;AAIA,MAAM,eAA6B,CAAC,EAAE,OAAO,UAC3C;AAAA,EACE,CAAC,MAAM,SAAS;AACd,UAAM,EAAE,cAAc,IAAI;AAE1B,0BAAsB,MAAM;AAE1B,UAAI,CAAC,cAAc,SAAS,SAAS,aAAa,GAAG;AACnD,eAAO,GAAG,GAAG,IAAI;AAAA,MACnB;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EACA,CAAC,MAAM;AACT;AAEF,MAAM,6BAAyB,+BAAS,YAAY;AACpD,uBAAuB,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useOnElementResize.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useOnElementResize.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type React from 'react';\nimport { useState, useEffect, useRef, useMemo } from 'react';\n\n// Custom hook to track dimension of a component\n// Taken and modified from https://stackoverflow.com/a/60218754\nexport const useOnElementResize = <T extends HTMLElement>(\n targetRef: React.RefObject<T>,\n): Record<'width' | 'height', number> => {\n const [width, setWidth] = useState(targetRef.current?.offsetWidth ?? 0);\n const [height, setHeight] = useState(targetRef.current?.offsetHeight ?? 0);\n const observer = useRef<ResizeObserver>();\n\n useEffect(() => {\n function outputsize() {\n setWidth(targetRef.current?.offsetWidth ?? 0);\n setHeight(targetRef.current?.offsetHeight ?? 0);\n }\n\n observer.current = new ResizeObserver(outputsize);\n const el = targetRef.current as Element | null;\n if (el) observer.current.observe(el);\n\n return () => {\n if (el) observer.current?.disconnect();\n };\n }, [targetRef]);\n\n return useMemo(\n () => ({\n width,\n height,\n }),\n [width, height],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAqD;AAI9C,MAAM,qBAAqB,CAChC,cACuC;AACvC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAS,UAAU,SAAS,eAAe,CAAC;AACtE,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,UAAU,SAAS,gBAAgB,CAAC;AACzE,QAAM,eAAW,qBAAuB;AAExC,8BAAU,MAAM;AACd,aAAS,aAAa;AACpB,eAAS,UAAU,SAAS,eAAe,CAAC;AAC5C,gBAAU,UAAU,SAAS,gBAAgB,CAAC;AAAA,IAChD;AAEA,aAAS,UAAU,IAAI,eAAe,UAAU;AAChD,UAAM,KAAK,UAAU;AACrB,QAAI;AAAI,eAAS,QAAQ,QAAQ,EAAE;AAEnC,WAAO,MAAM;AACX,UAAI;AAAI,iBAAS,SAAS,WAAW;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,OAAO,MAAM;AAAA,EAChB;AACF;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useOnFirstFocusIn.ts", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useOnFirstFocusIn.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { useCallback, useMemo, useRef } from 'react';\nimport { describe, PropTypes } from '../props-helpers/index.js';\n\nconst propTypes = {\n onFirstFocusCb: PropTypes.func\n .description('The function to be invoked when focus enters the wrapping container for the first time')\n .signature('((e: React.FocusEvent, ...args: unknown[]) => void)').isRequired,\n onBlurCb: PropTypes.func\n .description('Optional onBlur function to be invoked along the returned onBlur handler')\n .signature('((e: React.FocusEvent, ...args: unknown[]) => void)'),\n} as WeakValidationMap<unknown>;\n\ntype OnBlurCb = (e: React.FocusEvent, ...args: unknown[]) => void;\ntype OnFirstFocusCb = (e: React.FocusEvent, ...args: unknown[]) => void;\ntype UseFirstFocusIn = ({ onFirstFocus, onBlur }: { onFirstFocus: OnFirstFocusCb; onBlur: OnBlurCb }) => {\n onFirstFocus: OnFirstFocusCb;\n onBlur: OnBlurCb;\n};\n\nconst useOnFirstFocusIn: UseFirstFocusIn = ({ onFirstFocus, onBlur }) => {\n const mutableDidChildBlur = useRef(false);\n const onFirstFocusHelper = useCallback<OnFirstFocusCb>(\n (e, ...args) => {\n const { currentTarget } = e;\n // Give browser time to focus the next element\n requestAnimationFrame(() => {\n const isChildFocus = currentTarget.contains(document.activeElement);\n const isFirstFocus = isChildFocus && !mutableDidChildBlur.current;\n if (isFirstFocus) {\n onFirstFocus(e, ...args);\n }\n });\n },\n [onFirstFocus],\n );\n const onBlurHelper = useCallback<OnBlurCb>(\n (e, ...args) => {\n onBlur?.(e, ...args);\n const { currentTarget } = e;\n // Give browser time to focus the next element\n requestAnimationFrame(() => {\n const isChildBlur = currentTarget.contains(document.activeElement);\n mutableDidChildBlur.current = isChildBlur;\n });\n },\n [onBlur],\n );\n return useMemo(\n () => ({\n onFirstFocus: onFirstFocusHelper,\n onBlur: onBlurHelper,\n }),\n [onFirstFocusHelper, onBlurHelper],\n );\n};\n\nconst UseOnFirstFocusInWithSchema = describe(useOnFirstFocusIn);\nUseOnFirstFocusInWithSchema.propTypes = propTypes;\n\nexport { useOnFirstFocusIn, UseOnFirstFocusInWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA6C;AAC7C,2BAAoC;AAEpC,MAAM,YAAY;AAAA,EAChB,gBAAgB,+BAAU,KACvB,YAAY,wFAAwF,EACpG,UAAU,qDAAqD,EAAE;AAAA,EACpE,UAAU,+BAAU,KACjB,YAAY,0EAA0E,EACtF,UAAU,qDAAqD;AACpE;AASA,MAAM,oBAAqC,CAAC,EAAE,cAAc,OAAO,MAAM;AACvE,QAAM,0BAAsB,qBAAO,KAAK;AACxC,QAAM,yBAAqB;AAAA,IACzB,CAAC,MAAM,SAAS;AACd,YAAM,EAAE,cAAc,IAAI;AAE1B,4BAAsB,MAAM;AAC1B,cAAM,eAAe,cAAc,SAAS,SAAS,aAAa;AAClE,cAAM,eAAe,gBAAgB,CAAC,oBAAoB;AAC1D,YAAI,cAAc;AAChB,uBAAa,GAAG,GAAG,IAAI;AAAA,QACzB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AACA,QAAM,mBAAe;AAAA,IACnB,CAAC,MAAM,SAAS;AACd,eAAS,GAAG,GAAG,IAAI;AACnB,YAAM,EAAE,cAAc,IAAI;AAE1B,4BAAsB,MAAM;AAC1B,cAAM,cAAc,cAAc,SAAS,SAAS,aAAa;AACjE,4BAAoB,UAAU;AAAA,MAChC,CAAC;AAAA,IACH;AAAA,IACA,CAAC,MAAM;AAAA,EACT;AACA,aAAO;AAAA,IACL,OAAO;AAAA,MACL,cAAc;AAAA,MACd,QAAQ;AAAA,IACV;AAAA,IACA,CAAC,oBAAoB,YAAY;AAAA,EACnC;AACF;AAEA,MAAM,kCAA8B,+BAAS,iBAAiB;AAC9D,4BAA4B,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useOnSpecificFocus.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useOnSpecificFocus.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport { useCallback } from 'react';\nimport { describe, PropTypes } from '../props-helpers/index.js';\n\nconst propTypes = {\n onFocus: PropTypes.func\n .description(\n 'The function to be invoked when focusing specifically the element attached to (ignoring child focus events)',\n )\n .signature('((e: React.FocusEvent, ...args: unknown[]) => void)').isRequired,\n} as WeakValidationMap<unknown>;\n\ntype OnFocusCb = (e: React.FocusEvent, ...args: unknown[]) => void;\ntype UseOnBlurOut = ({ onFocus }: { onFocus: OnFocusCb }) => OnFocusCb;\nconst useOnSpecificFocus: UseOnBlurOut = ({ onFocus }) =>\n useCallback<OnFocusCb>(\n (e, ...args) => {\n const { currentTarget, target } = e;\n if (currentTarget === target && document.activeElement === currentTarget) onFocus(e, ...args);\n },\n [onFocus],\n );\nconst UseOnSpecificFocusWithSchema = describe(useOnSpecificFocus);\nUseOnSpecificFocusWithSchema.propTypes = propTypes;\n\nexport { useOnSpecificFocus, UseOnSpecificFocusWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA4B;AAC5B,2BAAoC;AAEpC,MAAM,YAAY;AAAA,EAChB,SAAS,+BAAU,KAChB;AAAA,IACC;AAAA,EACF,EACC,UAAU,qDAAqD,EAAE;AACtE;AAIA,MAAM,qBAAmC,CAAC,EAAE,QAAQ,UAClD;AAAA,EACE,CAAC,MAAM,SAAS;AACd,UAAM,EAAE,eAAe,OAAO,IAAI;AAClC,QAAI,kBAAkB,UAAU,SAAS,kBAAkB;AAAe,cAAQ,GAAG,GAAG,IAAI;AAAA,EAC9F;AAAA,EACA,CAAC,OAAO;AACV;AACF,MAAM,mCAA+B,+BAAS,kBAAkB;AAChE,6BAA6B,YAAY;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/usePrevious.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/usePrevious.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useRef } from 'react';\n\nexport const usePrevious = (value: unknown) => {\n const ref = useRef<unknown>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n\nexport default usePrevious;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAE3B,MAAM,cAAc,CAAC,UAAmB;AAC7C,QAAM,UAAM,qBAAgB;AAE5B,8BAAU,MAAM;AACd,QAAI,UAAU;AAAA,EAChB,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO,IAAI;AACb;AAEA,IAAO,sBAAQ;",
6
6
  "names": []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/hooks/useResizeObserver.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../../src/hooks/useResizeObserver.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useEffect, useMemo, useState } from 'react';\nimport raf from 'raf';\nimport ResizeObserver from 'resize-observer-polyfill';\n\ntype HandlerT = (measures: { width: number; height: number }, element: Element) => void;\n\nexport const useResizeObserver = (handler: HandlerT, el: HTMLElement) => {\n const [node, setRef] = useState(el);\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) return;\n if (!entries.length) return;\n const entry = entries[0];\n\n // execute on the next animation frame\n raf(() =>\n handler(\n {\n width: (entry.target as HTMLElement).offsetWidth,\n height: (entry.target as HTMLElement).offsetHeight,\n },\n entry.target,\n ),\n );\n }),\n [handler],\n );\n\n const htmlEl = el || node;\n\n useEffect(() => {\n if (htmlEl) resizeObserver.observe(htmlEl);\n return () => htmlEl && resizeObserver.unobserve(htmlEl);\n }, [htmlEl, resizeObserver]);\n\n return [setRef];\n};\n\nexport default useResizeObserver;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,iBAAgB;AAChB,sCAA2B;AAIpB,MAAM,oBAAoB,CAAC,SAAmB,OAAoB;AACvE,QAAM,CAAC,MAAM,MAAM,QAAI,uBAAS,EAAE;AAElC,QAAM,qBAAiB;AAAA,IACrB,MACE,IAAI,gCAAAA,QAAe,CAAC,YAAY;AAC9B,UAAI,CAAC,MAAM,QAAQ,OAAO;AAAG;AAC7B,UAAI,CAAC,QAAQ;AAAQ;AACrB,YAAM,QAAQ,QAAQ,CAAC;AAGvB,qBAAAC;AAAA,QAAI,MACF;AAAA,UACE;AAAA,YACE,OAAQ,MAAM,OAAuB;AAAA,YACrC,QAAS,MAAM,OAAuB;AAAA,UACxC;AAAA,UACA,MAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF,CAAC;AAAA,IACH,CAAC,OAAO;AAAA,EACV;AAEA,QAAM,SAAS,MAAM;AAErB,8BAAU,MAAM;AACd,QAAI;AAAQ,qBAAe,QAAQ,MAAM;AACzC,WAAO,MAAM,UAAU,eAAe,UAAU,MAAM;AAAA,EACxD,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,SAAO,CAAC,MAAM;AAChB;AAEA,IAAO,4BAAQ;",
6
6
  "names": ["ResizeObserver", "raf"]