@fluentui/react-positioning 9.15.3 → 9.15.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/index.d.ts +1 -1
  3. package/lib/constants.js.map +1 -1
  4. package/lib/createArrowStyles.js.map +1 -1
  5. package/lib/createPositionManager.js.map +1 -1
  6. package/lib/createSlideStyles.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js.map +1 -1
  8. package/lib/index.js.map +1 -1
  9. package/lib/middleware/coverTarget.js.map +1 -1
  10. package/lib/middleware/flip.js.map +1 -1
  11. package/lib/middleware/index.js.map +1 -1
  12. package/lib/middleware/intersecting.js.map +1 -1
  13. package/lib/middleware/matchTargetSize.js.map +1 -1
  14. package/lib/middleware/maxSize.js.map +1 -1
  15. package/lib/middleware/offset.js.map +1 -1
  16. package/lib/middleware/shift.js.map +1 -1
  17. package/lib/types.js.map +1 -1
  18. package/lib/usePositioning.js +2 -0
  19. package/lib/usePositioning.js.map +1 -1
  20. package/lib/usePositioningMouseTarget.js.map +1 -1
  21. package/lib/utils/createResizeObserver.js.map +1 -1
  22. package/lib/utils/debounce.js.map +1 -1
  23. package/lib/utils/devtools.js.map +1 -1
  24. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  25. package/lib/utils/getBoundary.js.map +1 -1
  26. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  27. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  28. package/lib/utils/getScrollParent.js.map +1 -1
  29. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  30. package/lib/utils/index.js.map +1 -1
  31. package/lib/utils/listScrollParents.js.map +1 -1
  32. package/lib/utils/mergeArrowOffset.js.map +1 -1
  33. package/lib/utils/normalizeAutoSize.js.map +1 -1
  34. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  35. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  36. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  37. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  38. package/lib/utils/toggleScrollListener.js.map +1 -1
  39. package/lib/utils/useCallbackRef.js.map +1 -1
  40. package/lib/utils/writeArrowUpdates.js.map +1 -1
  41. package/lib/utils/writeContainerupdates.js.map +1 -1
  42. package/lib-commonjs/constants.js +3 -3
  43. package/lib-commonjs/constants.js.map +1 -1
  44. package/lib-commonjs/createArrowStyles.js +3 -3
  45. package/lib-commonjs/createArrowStyles.js.map +1 -1
  46. package/lib-commonjs/createPositionManager.js.map +1 -1
  47. package/lib-commonjs/createSlideStyles.js.map +1 -1
  48. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  49. package/lib-commonjs/index.js +9 -9
  50. package/lib-commonjs/index.js.map +1 -1
  51. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  52. package/lib-commonjs/middleware/flip.js.map +1 -1
  53. package/lib-commonjs/middleware/index.js.map +1 -1
  54. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  55. package/lib-commonjs/middleware/matchTargetSize.js +3 -3
  56. package/lib-commonjs/middleware/matchTargetSize.js.map +1 -1
  57. package/lib-commonjs/middleware/maxSize.js +3 -3
  58. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  59. package/lib-commonjs/middleware/offset.js.map +1 -1
  60. package/lib-commonjs/middleware/shift.js.map +1 -1
  61. package/lib-commonjs/types.js.map +1 -1
  62. package/lib-commonjs/usePositioning.js +2 -0
  63. package/lib-commonjs/usePositioning.js.map +1 -1
  64. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  65. package/lib-commonjs/utils/createResizeObserver.js.map +1 -1
  66. package/lib-commonjs/utils/debounce.js.map +1 -1
  67. package/lib-commonjs/utils/devtools.js.map +1 -1
  68. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  69. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  70. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  71. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  72. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  73. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  74. package/lib-commonjs/utils/index.js.map +1 -1
  75. package/lib-commonjs/utils/listScrollParents.js.map +1 -1
  76. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  77. package/lib-commonjs/utils/normalizeAutoSize.js.map +1 -1
  78. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  79. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  80. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  81. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  82. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  83. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  84. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  85. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  86. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["matchTargetSize.js"],"sourcesContent":["export const matchTargetSizeCssVar = '--fui-match-target-size';\nexport function matchTargetSize() {\n return {\n name: 'matchTargetSize',\n fn: async (middlewareArguments)=>{\n const { rects: { reference: referenceRect, floating: floatingRect }, elements: { floating: floatingElement }, middlewareData: { matchTargetSize: { matchTargetSizeAttempt = false } = {} } } = middlewareArguments;\n if (referenceRect.width === floatingRect.width || matchTargetSizeAttempt) {\n return {};\n }\n const { width } = referenceRect;\n floatingElement.style.setProperty(matchTargetSizeCssVar, `${width}px`);\n if (!floatingElement.style.width) {\n floatingElement.style.width = `var(${matchTargetSizeCssVar})`;\n }\n return {\n data: {\n matchTargetSizeAttempt: true\n },\n reset: {\n rects: true\n }\n };\n }\n };\n}\n"],"names":["matchTargetSizeCssVar","matchTargetSize","name","fn","middlewareArguments","rects","reference","referenceRect","floating","floatingRect","elements","floatingElement","middlewareData","matchTargetSizeAttempt","width","style","setProperty","data","reset"],"mappings":";;;;;;;;;;;IAAaA,qBAAqB;eAArBA;;IACGC,eAAe;eAAfA;;;AADT,MAAMD,wBAAwB;AAC9B,SAASC;IACZ,OAAO;QACHC,MAAM;QACNC,IAAI,OAAOC;YACP,MAAM,EAAEC,OAAO,EAAEC,WAAWC,aAAa,EAAEC,UAAUC,YAAY,EAAE,EAAEC,UAAU,EAAEF,UAAUG,eAAe,EAAE,EAAEC,gBAAgB,EAAEX,iBAAiB,EAAEY,yBAAyB,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,GAAGT;YAC/L,IAAIG,cAAcO,KAAK,KAAKL,aAAaK,KAAK,IAAID,wBAAwB;gBACtE,OAAO,CAAC;YACZ;YACA,MAAM,EAAEC,KAAK,EAAE,GAAGP;YAClBI,gBAAgBI,KAAK,CAACC,WAAW,CAAChB,uBAAuB,CAAC,EAAEc,MAAM,EAAE,CAAC;YACrE,IAAI,CAACH,gBAAgBI,KAAK,CAACD,KAAK,EAAE;gBAC9BH,gBAAgBI,KAAK,CAACD,KAAK,GAAG,CAAC,IAAI,EAAEd,sBAAsB,CAAC,CAAC;YACjE;YACA,OAAO;gBACHiB,MAAM;oBACFJ,wBAAwB;gBAC5B;gBACAK,OAAO;oBACHb,OAAO;gBACX;YACJ;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["matchTargetSize.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\n\nexport const matchTargetSizeCssVar = '--fui-match-target-size';\n\nexport function matchTargetSize(): Middleware {\n return {\n name: 'matchTargetSize',\n fn: async middlewareArguments => {\n const {\n rects: { reference: referenceRect, floating: floatingRect },\n elements: { floating: floatingElement },\n middlewareData: { matchTargetSize: { matchTargetSizeAttempt = false } = {} },\n } = middlewareArguments;\n\n if (referenceRect.width === floatingRect.width || matchTargetSizeAttempt) {\n return {};\n }\n\n const { width } = referenceRect;\n floatingElement.style.setProperty(matchTargetSizeCssVar, `${width}px`);\n if (!floatingElement.style.width) {\n floatingElement.style.width = `var(${matchTargetSizeCssVar})`;\n }\n\n return {\n data: { matchTargetSizeAttempt: true },\n reset: {\n rects: true,\n },\n };\n },\n };\n}\n"],"names":["matchTargetSize","matchTargetSizeCssVar","name","fn","middlewareArguments","rects","reference","referenceRect","floating","floatingRect","elements","floatingElement","middlewareData","matchTargetSizeAttempt","width","style","setProperty","data","reset"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIgBA,eAAAA;eAAAA;;IAFHC,qBAAAA;eAAAA;;;AAAN,MAAMA,wBAAwB;AAE9B,SAASD;IACd,OAAO;QACLE,MAAM;QACNC,IAAI,OAAMC;YACR,MAAM,EACJC,OAAO,EAAEC,WAAWC,aAAa,EAAEC,UAAUC,YAAY,EAAE,EAC3DC,UAAU,EAAEF,UAAUG,eAAe,EAAE,EACvCC,gBAAgB,EAAEZ,iBAAiB,EAAEa,yBAAyB,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,EAC7E,GAAGT;YAEJ,IAAIG,cAAcO,KAAK,KAAKL,aAAaK,KAAK,IAAID,wBAAwB;gBACxE,OAAO,CAAC;YACV;YAEA,MAAM,EAAEC,KAAK,EAAE,GAAGP;YAClBI,gBAAgBI,KAAK,CAACC,WAAW,CAACf,uBAAuB,CAAC,EAAEa,MAAM,EAAE,CAAC;YACrE,IAAI,CAACH,gBAAgBI,KAAK,CAACD,KAAK,EAAE;gBAChCH,gBAAgBI,KAAK,CAACD,KAAK,GAAG,CAAC,IAAI,EAAEb,sBAAsB,CAAC,CAAC;YAC/D;YAEA,OAAO;gBACLgB,MAAM;oBAAEJ,wBAAwB;gBAAK;gBACrCK,OAAO;oBACLb,OAAO;gBACT;YACF;QACF;IACF;AACF"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- resetMaxSize: function() {
13
- return resetMaxSize;
14
- },
15
12
  maxSize: function() {
16
13
  return maxSize;
14
+ },
15
+ resetMaxSize: function() {
16
+ return resetMaxSize;
17
17
  }
18
18
  });
19
19
  const _dom = require("@floating-ui/dom");
@@ -1 +1 @@
1
- {"version":3,"sources":["maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\nimport { toFloatingUIPadding } from '../utils';\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */ export const resetMaxSize = (autoSize)=>({\n name: 'resetMaxSize',\n fn ({ middlewareData, elements }) {\n var _middlewareData_resetMaxSize;\n if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {\n return {};\n }\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n return {\n data: {\n maxSizeAlreadyReset: true\n },\n reset: {\n rects: true\n }\n };\n }\n });\nexport function maxSize(autoSize, options) {\n const { container, overflowBoundary, overflowBoundaryPadding, isRtl } = options;\n return size({\n ...overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n },\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n },\n apply ({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply, dimension, availableSize)=>{\n if (!apply) {\n return;\n }\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n }\n });\n}\n"],"names":["resetMaxSize","maxSize","autoSize","name","fn","middlewareData","elements","_middlewareData_resetMaxSize","maxSizeAlreadyReset","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","options","container","overflowBoundary","overflowBoundaryPadding","isRtl","size","padding","toFloatingUIPadding","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":";;;;;;;;;;;IAOiBA,YAAY;eAAZA;;IA4BDC,OAAO;eAAPA;;;qBAnCK;6BACO;uBACQ;AAKzB,MAAMD,eAAe,CAACE,WAAY,CAAA;QACrCC,MAAM;QACNC,IAAI,EAAEC,cAAc,EAAEC,QAAQ,EAAE;YAC5B,IAAIC;YACJ,IAAI,AAACA,CAAAA,+BAA+BF,eAAeL,YAAY,AAAD,MAAO,QAAQO,iCAAiC,KAAK,IAAI,KAAK,IAAIA,6BAA6BC,mBAAmB,EAAE;gBAC9K,OAAO,CAAC;YACZ;YACA,MAAM,EAAEC,aAAa,EAAEC,cAAc,EAAE,GAAGR;YAC1C,IAAIO,eAAe;gBACfH,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C;YACA,IAAIH,gBAAgB;gBAChBJ,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc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GR;YAC1C6B,mBAAmBtB,eAAe,SAASqB;YAC3CC,mBAAmBrB,gBAAgB,UAAUmB;QACjD;IACJ;AACJ"}
1
+ {"version":3,"sources":["maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { NormalizedAutoSize, PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nimport { toFloatingUIPadding } from '../utils';\nexport interface MaxSizeMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding'> {\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */\nexport const resetMaxSize = (autoSize: NormalizedAutoSize): Middleware => ({\n name: 'resetMaxSize',\n fn({ middlewareData, elements }) {\n if (middlewareData.resetMaxSize?.maxSizeAlreadyReset) {\n return {};\n }\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n\n return {\n data: { maxSizeAlreadyReset: true },\n reset: { rects: true },\n };\n },\n});\n\nexport function maxSize(autoSize: NormalizedAutoSize, options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary, overflowBoundaryPadding, isRtl } = options;\n return size({\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply: boolean, dimension: 'width' | 'height', availableSize: number) => {\n if (!apply) {\n return;\n }\n\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n },\n });\n}\n"],"names":["maxSize","resetMaxSize","autoSize","name","fn","middlewareData","elements","maxSizeAlreadyReset","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","options","container","overflowBoundary","overflowBoundaryPadding","isRtl","size","padding","toFloatingUIPadding","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA0CgBA,OAAAA;eAAAA;;IA1BHC,YAAAA;eAAAA;;;qBAhBQ;6BAGO;uBACQ;AAY7B,MAAMA,eAAe,CAACC,WAA8C,CAAA;QACzEC,MAAM;QACNC,IAAG,EAAEC,cAAc,EAAEC,QAAQ,EAAE;gBACzBD;YAAJ,IAAA,AAAIA,CAAAA,+BAAAA,eAAeJ,YAAY,AAAZA,MAAY,QAA3BI,iCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,6BAA6BE,mBAAmB,EAAE;gBACpD,OAAO,CAAC;YACV;YAEA,MAAM,EAAEC,aAAa,EAAEC,cAAc,EAAE,GAAGP;YAC1C,IAAIM,eAAe;gBACjBF,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc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,MAAME,OAAOH,cAAc,UAAU,MAAM;oBAC3C,IAAI,CAACzB,SAASI,QAAQ,CAACC,KAAK,CAACwB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBACjE5B,SAASI,QAAQ,CAACC,KAAK,CAACsB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC1D;gBACF;YACF;YAEA,MAAM,EAAE1B,aAAa,EAAEC,cAAc,EAAE,GAAGP;YAC1C4B,mBAAmBtB,eAAe,SAASqB;YAC3CC,mBAAmBrB,gBAAgB,UAAUmB;QAC/C;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["offset.js"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */ export function offset(offsetValue) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"mappings":";;;;+BAIoBA;;;eAAAA;;;qBAJiB;qCACD;AAGzB,SAASA,OAAOC,WAAW;IAClC,MAAMC,mBAAmBC,IAAAA,wCAAmB,EAACF;IAC7C,OAAOG,IAAAA,WAAU,EAACF;AACtB"}
1
+ {"version":3,"sources":["offset.ts"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue: PositioningOptions['offset']) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BAOgBA;;;eAAAA;;;qBAPqB;qCAED;AAK7B,SAASA,OAAOC,WAAyC;IAC9D,MAAMC,mBAAmBC,IAAAA,wCAAAA,EAAoBF;IAC7C,OAAOG,IAAAA,WAAAA,EAAWF;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["shift.js"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */ export function shift(options) {\n const { hasScrollableElement, disableTether, overflowBoundary, container, overflowBoundaryPadding, isRtl } = options;\n return baseShift({\n ...hasScrollableElement && {\n boundary: 'clippingAncestors'\n },\n ...disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({\n crossAxis: disableTether !== 'all',\n mainAxis: false\n })\n },\n ...overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n },\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n }\n });\n}\n"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"mappings":";;;;+BAIoBA;;;eAAAA;;;qBAJ2B;uBACE;AAGtC,SAASA,MAAMC,OAAO;IAC7B,MAAM,EAAEC,oBAAoB,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,SAAS,EAAEC,uBAAuB,EAAEC,KAAK,EAAE,GAAGN;IAC7G,OAAOO,IAAAA,UAAS,EAAC;QACb,GAAGN,wBAAwB;YACvBO,UAAU;QACd,CAAC;QACD,GAAGN,iBAAiB;YAChBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAU,EAAC;gBAChBF,WAAWP,kBAAkB;gBAC7BU,UAAU;YACd;QACJ,CAAC;QACD,GAAGP,2BAA2B;YAC1BQ,SAASC,IAAAA,0BAAmB,EAACT,yBAAyBC;QAC1D,CAAC;QACD,GAAGH,oBAAoB;YACnBY,aAAa;YACbP,UAAUQ,IAAAA,kBAAW,EAACZ,WAAWD;QACrC,CAAC;IACL;AACJ"}
1
+ {"version":3,"sources":["shift.ts"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions) {\n const { hasScrollableElement, disableTether, overflowBoundary, container, overflowBoundaryPadding, isRtl } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAegBA;;;eAAAA;;;qBAf+B;uBAEE;AAa1C,SAASA,MAAMC,OAA+B;IACnD,MAAM,EAAEC,oBAAoB,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,SAAS,EAAEC,uBAAuB,EAAEC,KAAK,EAAE,GAAGN;IAE7G,OAAOO,IAAAA,UAAAA,EAAU;QACf,GAAIN,wBAAwB;YAAEO,UAAU;QAAoB,CAAC;QAC7D,GAAIN,iBAAiB;YACnBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAAA,EAAW;gBAAEF,WAAWP,kBAAkB;gBAAOU,UAAU;YAAM;QAC5E,CAAC;QACD,GAAIP,2BAA2B;YAAEQ,SAASC,IAAAA,0BAAAA,EAAoBT,yBAAyBC;QAAO,CAAC;QAC/F,GAAIH,oBAAoB;YAAEY,aAAa;YAAMP,UAAUQ,IAAAA,kBAAAA,EAAYZ,WAAWD;QAAkB,CAAC;IACnG;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["types.ts"],"sourcesContent":["import * as React from 'react';\n\ntype Rect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: Rect;\n targetRect: Rect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\nexport type NormalizedAutoSize = { applyMaxWidth: boolean; applyMaxHeight: boolean };\n\nexport type Boundary = HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement | null) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\n/**\n * Internal options for positioning\n */\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: Boundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: Boundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n * @deprecated use `strategy` instead\n */\n positionFixed?: boolean;\n\n /**\n * Specifies the type of CSS position property to use.\n * @default absolute\n */\n strategy?: 'absolute' | 'fixed';\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies styles on the positioned element to fit it within the available space in viewport.\n * - true: set styles for max height/width.\n * - 'height': set styles for max height.\n * - 'width'': set styles for max width.\n * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n\n /**\n * Modifies whether popover is positioned using transform.\n * @default true\n */\n useTransform?: boolean;\n\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n\n /**\n * When set, the positioned element matches the chosen dimension(s) of the target element\n */\n matchTargetSize?: 'width';\n\n /**\n * Called when a position update has finished. Multiple position updates can happen in a single render,\n * since positioning happens outside of the React lifecycle.\n *\n * It's also possible to listen to the custom DOM event `fui-positioningend`\n */\n onPositioningEnd?: () => void;\n\n /**\n * Disables the resize observer that updates position on target or dimension change\n */\n disableUpdateOnResize?: boolean;\n}\n\n/**\n * Public api that allows components using react-positioning to specify positioning options\n */\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n | 'fallbackPositions'\n | 'flipBoundary'\n | 'offset'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'pinned'\n | 'position'\n | 'strategy'\n | 'useTransform'\n | 'matchTargetSize'\n | 'onPositioningEnd'\n | 'disableUpdateOnResize'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -20,6 +20,7 @@ const _devtools = require("@floating-ui/devtools");
20
20
  const _devtools1 = require("./utils/devtools");
21
21
  const _constants = require("./constants");
22
22
  function usePositioning(options) {
23
+ 'use no memo';
23
24
  const managerRef = _react.useRef(null);
24
25
  const targetRef = _react.useRef(null);
25
26
  const overrideTargetRef = _react.useRef(null);
@@ -152,6 +153,7 @@ function usePositioning(options) {
152
153
  };
153
154
  }
154
155
  function usePositioningOptions(options) {
156
+ 'use no memo';
155
157
  const { align, arrowPadding, autoSize: rawAutoSize, coverTarget, flipBoundary, offset, overflowBoundary, pinned, position, unstable_disableTether: disableTether, positionFixed, strategy, overflowBoundaryPadding, fallbackPositions, useTransform, matchTargetSize, disableUpdateOnResize = false } = options;
156
158
  const { dir, targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
157
159
  const isRtl = dir === 'rtl';
@@ -1 +1 @@
1
- {"version":3,"sources":["usePositioning.js"],"sourcesContent":["import { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { useCallbackRef, toFloatingUIPlacement, hasAutofocusFilter, hasScrollParent, normalizeAutoSize } from './utils';\nimport { shift as shiftMiddleware, flip as flipMiddleware, coverTarget as coverTargetMiddleware, maxSize as maxSizeMiddleware, resetMaxSize as resetMaxSizeMiddleware, offset as offsetMiddleware, intersecting as intersectingMiddleware, matchTargetSize as matchTargetSizeMiddleware } from './middleware';\nimport { createPositionManager } from './createPositionManager';\nimport { devtools } from '@floating-ui/devtools';\nimport { devtoolsCallback } from './utils/devtools';\nimport { POSITIONING_END_EVENT } from './constants';\n/**\n * @internal\n */ export function usePositioning(options) {\n const managerRef = React.useRef(null);\n const targetRef = React.useRef(null);\n const overrideTargetRef = React.useRef(null);\n const containerRef = React.useRef(null);\n const arrowRef = React.useRef(null);\n const { enabled = true } = options;\n const resolvePositioningOptions = usePositioningOptions(options);\n const updatePositionManager = React.useCallback(()=>{\n if (managerRef.current) {\n managerRef.current.dispose();\n }\n managerRef.current = null;\n var _overrideTargetRef_current;\n const target = (_overrideTargetRef_current = overrideTargetRef.current) !== null && _overrideTargetRef_current !== void 0 ? _overrideTargetRef_current : targetRef.current;\n if (enabled && canUseDOM() && target && containerRef.current) {\n managerRef.current = createPositionManager({\n container: containerRef.current,\n target,\n arrow: arrowRef.current,\n ...resolvePositioningOptions(containerRef.current, arrowRef.current)\n });\n }\n }, [\n enabled,\n resolvePositioningOptions\n ]);\n const setOverrideTarget = useEventCallback((target)=>{\n overrideTargetRef.current = target;\n updatePositionManager();\n });\n React.useImperativeHandle(options.positioningRef, ()=>({\n updatePosition: ()=>{\n var _managerRef_current;\n return (_managerRef_current = managerRef.current) === null || _managerRef_current === void 0 ? void 0 : _managerRef_current.updatePosition();\n },\n setTarget: (target)=>{\n if (options.target && process.env.NODE_ENV !== 'production') {\n const err = new Error();\n // eslint-disable-next-line no-console\n console.warn('Imperative setTarget should not be used at the same time as target option');\n // eslint-disable-next-line no-console\n console.warn(err.stack);\n }\n setOverrideTarget(target);\n }\n }), [\n options.target,\n setOverrideTarget\n ]);\n useIsomorphicLayoutEffect(()=>{\n var _options_target;\n setOverrideTarget((_options_target = options.target) !== null && _options_target !== void 0 ? _options_target : null);\n }, [\n options.target,\n setOverrideTarget\n ]);\n useIsomorphicLayoutEffect(()=>{\n updatePositionManager();\n }, [\n updatePositionManager\n ]);\n if (process.env.NODE_ENV !== 'production') {\n // This checked should run only in development mode\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(()=>{\n if (containerRef.current) {\n var _contentNode_ownerDocument;\n const contentNode = containerRef.current;\n const treeWalker = (_contentNode_ownerDocument = contentNode.ownerDocument) === null || _contentNode_ownerDocument === void 0 ? void 0 : _contentNode_ownerDocument.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {\n acceptNode: hasAutofocusFilter\n });\n while(treeWalker.nextNode()){\n const node = treeWalker.currentNode;\n // eslint-disable-next-line no-console\n console.warn('<Popper>:', node);\n // eslint-disable-next-line no-console\n console.warn([\n '<Popper>: ^ this node contains \"autoFocus\" prop on a React element. This can break the initial',\n 'positioning of an element and cause a window jump effect. This issue occurs because React polyfills',\n '\"autoFocus\" behavior to solve inconsistencies between different browsers:',\n 'https://github.com/facebook/react/issues/11851#issuecomment-351787078',\n '\\n',\n 'However, \".focus()\" in this case occurs before any other React effects will be executed',\n '(React.useEffect(), componentDidMount(), etc.) and we can not prevent this behavior. If you really',\n 'want to use \"autoFocus\" please add \"position: fixed\" to styles of the element that is wrapped by',\n '\"Popper\".',\n `In general, it's not recommended to use \"autoFocus\" as it may break accessibility aspects:`,\n 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md',\n '\\n',\n 'We suggest to use the \"trapFocus\" prop on Fluent components or a catch \"ref\" and then use',\n '\"ref.current.focus\" in React.useEffect():',\n 'https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element'\n ].join(' '));\n }\n }\n // We run this check once, no need to add deps here\n // TODO: Should be rework to handle options.enabled and contentRef updates\n }, []);\n }\n const setTarget = useCallbackRef(null, (target)=>{\n if (targetRef.current !== target) {\n targetRef.current = target;\n updatePositionManager();\n }\n });\n const onPositioningEnd = useEventCallback(()=>{\n var _options_onPositioningEnd;\n return (_options_onPositioningEnd = options.onPositioningEnd) === null || _options_onPositioningEnd === void 0 ? void 0 : _options_onPositioningEnd.call(options);\n });\n const setContainer = useCallbackRef(null, (container)=>{\n if (containerRef.current !== container) {\n var _containerRef_current;\n (_containerRef_current = containerRef.current) === null || _containerRef_current === void 0 ? void 0 : _containerRef_current.removeEventListener(POSITIONING_END_EVENT, onPositioningEnd);\n container === null || container === void 0 ? void 0 : container.addEventListener(POSITIONING_END_EVENT, onPositioningEnd);\n containerRef.current = container;\n updatePositionManager();\n }\n });\n const setArrow = useCallbackRef(null, (arrow)=>{\n if (arrowRef.current !== arrow) {\n arrowRef.current = arrow;\n updatePositionManager();\n }\n });\n // Let users use callback refs so they feel like 'normal' DOM refs\n return {\n targetRef: setTarget,\n containerRef: setContainer,\n arrowRef: setArrow\n };\n}\nfunction usePositioningOptions(options) {\n const { align, arrowPadding, autoSize: rawAutoSize, coverTarget, flipBoundary, offset, overflowBoundary, pinned, position, unstable_disableTether: disableTether, // eslint-disable-next-line deprecation/deprecation\n positionFixed, strategy, overflowBoundaryPadding, fallbackPositions, useTransform, matchTargetSize, disableUpdateOnResize = false } = options;\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n const positionStrategy = (strategy !== null && strategy !== void 0 ? strategy : positionFixed) ? 'fixed' : 'absolute';\n const autoSize = normalizeAutoSize(rawAutoSize);\n return React.useCallback((container, arrow)=>{\n const hasScrollableElement = hasScrollParent(container);\n const middleware = [\n autoSize && resetMaxSizeMiddleware(autoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({\n container,\n flipBoundary,\n hasScrollableElement,\n isRtl,\n fallbackPositions\n }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether,\n overflowBoundaryPadding,\n isRtl\n }),\n autoSize && maxSizeMiddleware(autoSize, {\n container,\n overflowBoundary,\n overflowBoundaryPadding,\n isRtl\n }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({\n element: arrow,\n padding: arrowPadding\n }),\n hideMiddleware({\n strategy: 'referenceHidden'\n }),\n hideMiddleware({\n strategy: 'escaped'\n }),\n process.env.NODE_ENV !== 'production' && targetDocument && devtools(targetDocument, devtoolsCallback(options))\n ].filter(Boolean);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n return {\n placement,\n middleware,\n strategy: positionStrategy,\n useTransform,\n disableUpdateOnResize\n };\n }, // Options is missing here, but it's not required\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableTether,\n flipBoundary,\n isRtl,\n offset,\n overflowBoundary,\n pinned,\n position,\n positionStrategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n targetDocument,\n disableUpdateOnResize\n ]);\n}\n"],"names":["usePositioning","options","managerRef","React","useRef","targetRef","overrideTargetRef","containerRef","arrowRef","enabled","resolvePositioningOptions","usePositioningOptions","updatePositionManager","useCallback","current","dispose","_overrideTargetRef_current","target","canUseDOM","createPositionManager","container","arrow","setOverrideTarget","useEventCallback","useImperativeHandle","positioningRef","updatePosition","_managerRef_current","setTarget","process","env","NODE_ENV","err","Error","console","warn","stack","useIsomorphicLayoutEffect","_options_target","useEffect","_contentNode_ownerDocument","contentNode","treeWalker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","hasAutofocusFilter","nextNode","node","currentNode","join","useCallbackRef","onPositioningEnd","_options_onPositioningEnd","call","setContainer","_containerRef_current","removeEventListener","POSITIONING_END_EVENT","addEventListener","setArrow","align","arrowPadding","autoSize","rawAutoSize","coverTarget","flipBoundary","offset","overflowBoundary","pinned","position","unstable_disableTether","disableTether","positionFixed","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","matchTargetSize","disableUpdateOnResize","dir","targetDocument","useFluent","isRtl","positionStrategy","normalizeAutoSize","hasScrollableElement","hasScrollParent","middleware","resetMaxSizeMiddleware","matchTargetSizeMiddleware","offsetMiddleware","coverTargetMiddleware","flipMiddleware","shiftMiddleware","maxSizeMiddleware","intersectingMiddleware","arrowMiddleware","element","padding","hideMiddleware","devtools","devtoolsCallback","filter","Boolean","placement","toFloatingUIPlacement"],"mappings":";;;;+BAYoBA;;;eAAAA;;;;qBAZ6C;qCACjB;gCACuB;iEAChD;uBACuF;4BACiL;uCACzP;0BACb;2BACQ;2BACK;AAG3B,SAASA,eAAeC,OAAO;IACtC,MAAMC,aAAaC,OAAMC,MAAM,CAAC;IAChC,MAAMC,YAAYF,OAAMC,MAAM,CAAC;IAC/B,MAAME,oBAAoBH,OAAMC,MAAM,CAAC;IACvC,MAAMG,eAAeJ,OAAMC,MAAM,CAAC;IAClC,MAAMI,WAAWL,OAAMC,MAAM,CAAC;IAC9B,MAAM,EAAEK,UAAU,IAAI,EAAE,GAAGR;IAC3B,MAAMS,4BAA4BC,sBAAsBV;IACxD,MAAMW,wBAAwBT,OAAMU,WAAW,CAAC;QAC5C,IAAIX,WAAWY,OAAO,EAAE;YACpBZ,WAAWY,OAAO,CAACC,OAAO;QAC9B;QACAb,WAAWY,OAAO,GAAG;QACrB,IAAIE;QACJ,MAAMC,SAAS,AAACD,CAAAA,6BAA6BV,kBAAkBQ,OAAO,AAAD,MAAO,QAAQE,+BAA+B,KAAK,IAAIA,6BAA6BX,UAAUS,OAAO;QAC1K,IAAIL,WAAWS,IAAAA,yBAAS,OAAMD,UAAUV,aAAaO,OAAO,EAAE;YAC1DZ,WAAWY,OAAO,GAAGK,IAAAA,4CAAqB,EAAC;gBACvCC,WAAWb,aAAaO,OAAO;gBAC/BG;gBACAI,OAAOb,SAASM,OAAO;gBACvB,GAAGJ,0BAA0BH,aAAaO,OAAO,EAAEN,SAASM,OAAO,CAAC;YACxE;QACJ;IACJ,GAAG;QACCL;QACAC;KACH;IACD,MAAMY,oBAA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ASrC;YACb;YACAsC,IAAAA,SAAc,EAAC;gBACX1B,UAAU;YACd;YACA0B,IAAAA,SAAc,EAAC;gBACX1B,UAAU;YACd;YACA/C,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBoD,kBAAkBoB,IAAAA,kBAAQ,EAACpB,gBAAgBqB,IAAAA,2BAAgB,EAACvG;SACxG,CAACwG,MAAM,CAACC;QACT,MAAMC,YAAYC,IAAAA,4BAAqB,EAAC7C,OAAOS,UAAUa;QACzD,OAAO;YACHsB;YACAjB;YACAd,UAAUU;YACVP;YACAE;QACJ;IACJ,GACA,uDAAuD;IACvD;QACIlB;QACAC;QACAC;QACAE;QACAO;QACAN;QACAiB;QACAhB;QACAC;QACAC;QACAC;QACAc;QACAT;QACAC;QACAC;QACAC;QACAG;QACAF;KACH;AACL"}
1
+ {"version":3,"sources":["usePositioning.ts"],"sourcesContent":["import { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type {\n PositioningOptions,\n PositioningProps,\n PositionManager,\n TargetElement,\n UsePositioningReturn,\n} from './types';\nimport { useCallbackRef, toFloatingUIPlacement, hasAutofocusFilter, hasScrollParent, normalizeAutoSize } from './utils';\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n resetMaxSize as resetMaxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n matchTargetSize as matchTargetSizeMiddleware,\n} from './middleware';\nimport { createPositionManager } from './createPositionManager';\nimport { devtools } from '@floating-ui/devtools';\nimport { devtoolsCallback } from './utils/devtools';\nimport { POSITIONING_END_EVENT } from './constants';\n\n/**\n * @internal\n */\nexport function usePositioning(options: PositioningProps & PositioningOptions): UsePositioningReturn {\n 'use no memo';\n\n const managerRef = React.useRef<PositionManager | null>(null);\n const targetRef = React.useRef<TargetElement | null>(null);\n const overrideTargetRef = React.useRef<TargetElement | null>(null);\n const containerRef = React.useRef<HTMLElement | null>(null);\n const arrowRef = React.useRef<HTMLElement | null>(null);\n\n const { enabled = true } = options;\n const resolvePositioningOptions = usePositioningOptions(options);\n const updatePositionManager = React.useCallback(() => {\n if (managerRef.current) {\n managerRef.current.dispose();\n }\n managerRef.current = null;\n\n const target = overrideTargetRef.current ?? targetRef.current;\n\n if (enabled && canUseDOM() && target && containerRef.current) {\n managerRef.current = createPositionManager({\n container: containerRef.current,\n target,\n arrow: arrowRef.current,\n ...resolvePositioningOptions(containerRef.current, arrowRef.current),\n });\n }\n }, [enabled, resolvePositioningOptions]);\n\n const setOverrideTarget = useEventCallback((target: TargetElement | null) => {\n overrideTargetRef.current = target;\n updatePositionManager();\n });\n\n React.useImperativeHandle(\n options.positioningRef,\n () => ({\n updatePosition: () => managerRef.current?.updatePosition(),\n setTarget: (target: TargetElement | null) => {\n if (options.target && process.env.NODE_ENV !== 'production') {\n const err = new Error();\n // eslint-disable-next-line no-console\n console.warn('Imperative setTarget should not be used at the same time as target option');\n // eslint-disable-next-line no-console\n console.warn(err.stack);\n }\n\n setOverrideTarget(target);\n },\n }),\n [options.target, setOverrideTarget],\n );\n\n useIsomorphicLayoutEffect(() => {\n setOverrideTarget(options.target ?? null);\n }, [options.target, setOverrideTarget]);\n\n useIsomorphicLayoutEffect(() => {\n updatePositionManager();\n }, [updatePositionManager]);\n\n if (process.env.NODE_ENV !== 'production') {\n // This checked should run only in development mode\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (containerRef.current) {\n const contentNode = containerRef.current;\n const treeWalker = contentNode.ownerDocument?.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {\n acceptNode: hasAutofocusFilter,\n });\n\n while (treeWalker.nextNode()) {\n const node = treeWalker.currentNode;\n // eslint-disable-next-line no-console\n console.warn('<Popper>:', node);\n // eslint-disable-next-line no-console\n console.warn(\n [\n '<Popper>: ^ this node contains \"autoFocus\" prop on a React element. This can break the initial',\n 'positioning of an element and cause a window jump effect. This issue occurs because React polyfills',\n '\"autoFocus\" behavior to solve inconsistencies between different browsers:',\n 'https://github.com/facebook/react/issues/11851#issuecomment-351787078',\n '\\n',\n 'However, \".focus()\" in this case occurs before any other React effects will be executed',\n '(React.useEffect(), componentDidMount(), etc.) and we can not prevent this behavior. If you really',\n 'want to use \"autoFocus\" please add \"position: fixed\" to styles of the element that is wrapped by',\n '\"Popper\".',\n `In general, it's not recommended to use \"autoFocus\" as it may break accessibility aspects:`,\n 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md',\n '\\n',\n 'We suggest to use the \"trapFocus\" prop on Fluent components or a catch \"ref\" and then use',\n '\"ref.current.focus\" in React.useEffect():',\n 'https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element',\n ].join(' '),\n );\n }\n }\n // We run this check once, no need to add deps here\n // TODO: Should be rework to handle options.enabled and contentRef updates\n }, []);\n }\n\n const setTarget = useCallbackRef<TargetElement>(null, target => {\n if (targetRef.current !== target) {\n targetRef.current = target;\n updatePositionManager();\n }\n });\n\n const onPositioningEnd = useEventCallback(() => options.onPositioningEnd?.());\n const setContainer = useCallbackRef<HTMLElement | null>(null, container => {\n if (containerRef.current !== container) {\n containerRef.current?.removeEventListener(POSITIONING_END_EVENT, onPositioningEnd);\n container?.addEventListener(POSITIONING_END_EVENT, onPositioningEnd);\n containerRef.current = container;\n updatePositionManager();\n }\n });\n\n const setArrow = useCallbackRef<HTMLElement | null>(null, arrow => {\n if (arrowRef.current !== arrow) {\n arrowRef.current = arrow;\n updatePositionManager();\n }\n });\n\n // Let users use callback refs so they feel like 'normal' DOM refs\n return { targetRef: setTarget, containerRef: setContainer, arrowRef: setArrow };\n}\n\nfunction usePositioningOptions(options: PositioningOptions) {\n 'use no memo';\n\n const {\n align,\n arrowPadding,\n autoSize: rawAutoSize,\n coverTarget,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n unstable_disableTether: disableTether,\n // eslint-disable-next-line deprecation/deprecation\n positionFixed,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n disableUpdateOnResize = false,\n } = options;\n\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n const positionStrategy: Strategy = strategy ?? positionFixed ? 'fixed' : 'absolute';\n const autoSize = normalizeAutoSize(rawAutoSize);\n\n return React.useCallback(\n (container: HTMLElement | null, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const middleware = [\n autoSize && resetMaxSizeMiddleware(autoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether,\n overflowBoundaryPadding,\n isRtl,\n }),\n autoSize && maxSizeMiddleware(autoSize, { container, overflowBoundary, overflowBoundaryPadding, isRtl }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n process.env.NODE_ENV !== 'production' && targetDocument && devtools(targetDocument, devtoolsCallback(options)),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy: positionStrategy,\n useTransform,\n disableUpdateOnResize,\n };\n },\n // Options is missing here, but it's not required\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableTether,\n flipBoundary,\n isRtl,\n offset,\n overflowBoundary,\n pinned,\n position,\n positionStrategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n targetDocument,\n disableUpdateOnResize,\n ],\n );\n}\n"],"names":["usePositioning","options","managerRef","React","useRef","targetRef","overrideTargetRef","containerRef","arrowRef","enabled","resolvePositioningOptions","usePositioningOptions","updatePositionManager","useCallback","current","dispose","target","canUseDOM","createPositionManager","container","arrow","setOverrideTarget","useEventCallback","useImperativeHandle","positioningRef","updatePosition","setTarget","process","env","NODE_ENV","err","Error","console","warn","stack","useIsomorphicLayoutEffect","useEffect","contentNode","treeWalker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","hasAutofocusFilter","nextNode","node","currentNode","join","useCallbackRef","onPositioningEnd","setContainer","removeEventListener","POSITIONING_END_EVENT","addEventListener","setArrow","align","arrowPadding","autoSize","rawAutoSize","coverTarget","flipBoundary","offset","overflowBoundary","pinned","position","unstable_disableTether","disableTether","positionFixed","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","matchTargetSize","disableUpdateOnResize","dir","targetDocument","useFluent","isRtl","positionStrategy","normalizeAutoSize","hasScrollableElement","hasScrollParent","middleware","resetMaxSizeMiddleware","matchTargetSizeMiddleware","offsetMiddleware","coverTargetMiddleware","flipMiddleware","shiftMiddleware","maxSizeMiddleware","intersectingMiddleware","arrowMiddleware","element","padding","hideMiddleware","devtools","devtoolsCallback","filter","Boolean","placement","toFloatingUIPlacement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+BgBA;;;eAAAA;;;;qBA/BiD;qCAEjB;gCACuB;iEAChD;uBAQuF;4BA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AAYC,IAAAA,4BAAAA,EAAsB7C,OAAOS,UAAUa;QAEzD,OAAO;YACLsB;YACAjB;YACAd,UAAUU;YACVP;YACAE;QACF;IACF,GAEA,uDAAuD;IACvD;QACElB;QACAC;QACAC;QACAE;QACAO;QACAN;QACAiB;QACAhB;QACAC;QACAC;QACAC;QACAc;QACAT;QACAC;QACAC;QACAC;QACAG;QACAF;KACD;AAEL"}
@@ -1 +1 @@
1
- {"version":3,"sources":["usePositioningMouseTarget.js"],"sourcesContent":["import * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */ export const usePositioningMouseTarget = (initialState)=>{\n const [virtualElement, setVirtualElement] = React.useState(initialState);\n const setVirtualMouseTarget = (event)=>{\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n let mouseevent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n return [\n virtualElement,\n setVirtualMouseTarget\n ];\n};\n"],"names":["usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","React","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget","createVirtualElementFromClick"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;+CACuB;AASnC,MAAMA,4BAA4B,CAACC;IAC1C,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAACJ;IAC3D,MAAMK,wBAAwB,CAACC;QAC3B,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACvCJ,kBAAkBK;YAClB;QACJ;QACA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAS,GAAI;YAChCD,aAAaF,MAAMI,WAAW;QAClC,OAAO;YACHF,aAAaF;QACjB;QACA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAS,KAAME,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAC9E,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAClB;QACA,MAAMC,gBAAgBC,IAAAA,4DAA6B,EAACT;QACpDN,kBAAkBc;IACtB;IACA,OAAO;QACHf;QACAI;KACH;AACL"}
1
+ {"version":3,"sources":["usePositioningMouseTarget.ts"],"sourcesContent":["import * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n) => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"names":["usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","React","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget","createVirtualElementFromClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;+CACuB;AAYvC,MAAMA,4BAA4B,CACvCC;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAAwCJ;IAElG,MAAMK,wBAA+CC,CAAAA;QACnD,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACzCJ,kBAAkBK;YAClB;QACF;QAEA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAAA,GAAa;YAClCD,aAAaF,MAAMI,WAAW;QAChC,OAAO;YACLF,aAAaF;QACf;QAEA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAAA,KAAeE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAChF,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAChB;QAEA,MAAMC,gBAAgBC,IAAAA,4DAAAA,EAA8BT;QACpDN,kBAAkBc;IACpB;IAEA,OAAO;QAACf;QAAgBI;KAAsB;AAChD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["createResizeObserver.js"],"sourcesContent":["export function createResizeObserver(targetWindow, callback) {\n // https://github.com/jsdom/jsdom/issues/3368\n // Add the polyfill here so it is not needed for all unit tests that leverage positioning\n if (process.env.NODE_ENV === 'test') {\n targetWindow.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n };\n }\n return new targetWindow.ResizeObserver(callback);\n}\n"],"names":["createResizeObserver","targetWindow","callback","process","env","NODE_ENV","ResizeObserver","observe","unobserve","disconnect"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,qBAAqBC,YAAY,EAAEC,QAAQ;IACvD,6CAA6C;IAC7C,yFAAyF;IACzF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACjCJ,aAAaK,cAAc,GAAG,MAAMA;YAChCC,UAAU;YACV,aAAa;YACb;YACAC,YAAY;YACZ,aAAa;YACb;YACAC,aAAa;YACb,aAAa;YACb;QACJ;IACJ;IACA,OAAO,IAAIR,aAAaK,cAAc,CAACJ;AAC3C"}
1
+ {"version":3,"sources":["createResizeObserver.ts"],"sourcesContent":["export function createResizeObserver(targetWindow: Window & typeof globalThis, callback: ResizeObserverCallback) {\n // https://github.com/jsdom/jsdom/issues/3368\n // Add the polyfill here so it is not needed for all unit tests that leverage positioning\n if (process.env.NODE_ENV === 'test') {\n targetWindow.ResizeObserver = class ResizeObserver {\n public observe() {\n // do nothing\n }\n public unobserve() {\n // do nothing\n }\n public disconnect() {\n // do nothing\n }\n };\n }\n\n return new targetWindow.ResizeObserver(callback);\n}\n"],"names":["createResizeObserver","targetWindow","callback","process","env","NODE_ENV","ResizeObserver","observe","unobserve","disconnect"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,qBAAqBC,YAAwC,EAAEC,QAAgC;IAC7G,6CAA6C;IAC7C,yFAAyF;IACzF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACnCJ,aAAaK,cAAc,GAAG,MAAMA;YAC3BC,UAAU;YACf,aAAa;YACf;YACOC,YAAY;YACjB,aAAa;YACf;YACOC,aAAa;YAClB,aAAa;YACf;QACF;IACF;IAEA,OAAO,IAAIR,aAAaK,cAAc,CAACJ;AACzC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["debounce.js"],"sourcesContent":["/**\n * Promise microtask debouncer used by Popper.js v2\n * This is no longer exported in Floating UI (Popper.js v3)\n * https://github.com/floating-ui/floating-ui/blob/v2.x/src/utils/debounce.js\n * @param fn function that will be debounced\n */ export function debounce(fn) {\n let pending;\n return ()=>{\n if (!pending) {\n pending = new Promise((resolve)=>{\n Promise.resolve().then(()=>{\n pending = undefined;\n resolve(fn());\n });\n });\n }\n return pending;\n };\n}\n"],"names":["debounce","fn","pending","Promise","resolve","then","undefined"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAE;IAC3B,IAAIC;IACJ,OAAO;QACH,IAAI,CAACA,SAAS;YACVA,UAAU,IAAIC,QAAQ,CAACC;gBACnBD,QAAQC,OAAO,GAAGC,IAAI,CAAC;oBACnBH,UAAUI;oBACVF,QAAQH;gBACZ;YACJ;QACJ;QACA,OAAOC;IACX;AACJ"}
1
+ {"version":3,"sources":["debounce.ts"],"sourcesContent":["/**\n * Promise microtask debouncer used by Popper.js v2\n * This is no longer exported in Floating UI (Popper.js v3)\n * https://github.com/floating-ui/floating-ui/blob/v2.x/src/utils/debounce.js\n * @param fn function that will be debounced\n */\nexport function debounce<T>(fn: Function): () => Promise<T> {\n let pending: Promise<T> | undefined;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n"],"names":["debounce","fn","pending","Promise","resolve","then","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,SAAYC,EAAY;IACtC,IAAIC;IACJ,OAAO;QACL,IAAI,CAACA,SAAS;YACZA,UAAU,IAAIC,QAAWC,CAAAA;gBACvBD,QAAQC,OAAO,GAAGC,IAAI,CAAC;oBACrBH,UAAUI;oBACVF,QAAQH;gBACV;YACF;QACF;QAEA,OAAOC;IACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["devtools.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { listScrollParents } from './listScrollParents';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\nexport const devtoolsCallback = (options)=>(middlewareState)=>{\n const { elements: { floating, reference } } = middlewareState;\n const scrollParentsSet = new Set();\n if (isHTMLElement(reference)) {\n listScrollParents(reference).forEach((scrollParent)=>scrollParentsSet.add(scrollParent));\n }\n listScrollParents(floating).forEach((scrollParent)=>scrollParentsSet.add(scrollParent));\n const flipBoundaries = Array.isArray(options.flipBoundary) ? options.flipBoundary : isHTMLElement(options.flipBoundary) ? [\n options.flipBoundary\n ] : [];\n const overflowBoundaries = Array.isArray(options.overflowBoundary) ? options.overflowBoundary : isHTMLElement(options.overflowBoundary) ? [\n options.overflowBoundary\n ] : [];\n return {\n type: 'FluentUIMiddleware',\n middlewareState,\n options,\n initialPlacement: fromFloatingUIPlacement(middlewareState.initialPlacement),\n placement: fromFloatingUIPlacement(middlewareState.placement),\n flipBoundaries,\n overflowBoundaries,\n scrollParents: Array.from(scrollParentsSet)\n };\n };\n"],"names":["devtoolsCallback","options","middlewareState","elements","floating","reference","scrollParentsSet","Set","isHTMLElement","listScrollParents","forEach","scrollParent","add","flipBoundaries","Array","isArray","flipBoundary","overflowBoundaries","overflowBoundary","type","initialPlacement","fromFloatingUIPlacement","placement","scrollParents","from"],"mappings":";;;;+BAGaA;;;eAAAA;;;gCAHiB;mCACI;yCACM;AACjC,MAAMA,mBAAmB,CAACC,UAAU,CAACC;QACpC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAAE,GAAGH;QAC9C,MAAMI,mBAAmB,IAAIC;QAC7B,IAAIC,IAAAA,6BAAa,EAACH,YAAY;YAC1BI,IAAAA,oCAAiB,EAACJ,WAAWK,OAAO,CAAC,CAACC,eAAeL,iBAAiBM,GAAG,CAACD;QAC9E;QACAF,IAAAA,oCAAiB,EAACL,UAAUM,OAAO,CAAC,CAACC,eAAeL,iBAAiBM,GAAG,CAACD;QACzE,MAAME,iBAAiBC,MAAMC,OAAO,CAACd,QAAQe,YAAY,IAAIf,QAAQe,YAAY,GAAGR,IAAAA,6BAAa,EAACP,QAAQe,YAAY,IAAI;YACtHf,QAAQe,YAAY;SACvB,GAAG,EAAE;QACN,MAAMC,qBAAqBH,MAAMC,OAAO,CAACd,QAAQiB,gBAAgB,IAAIjB,QAAQiB,gBAAgB,GAAGV,IAAAA,6BAAa,EAACP,QAAQiB,gBAAgB,IAAI;YACtIjB,QAAQiB,gBAAgB;SAC3B,GAAG,EAAE;QACN,OAAO;YACHC,MAAM;YACNjB;YACAD;YACAmB,kBAAkBC,IAAAA,gDAAuB,EAACnB,gBAAgBkB,gBAAgB;YAC1EE,WAAWD,IAAAA,gDAAuB,EAACnB,gBAAgBoB,SAAS;YAC5DT;YACAI;YACAM,eAAeT,MAAMU,IAAI,CAAClB;QAC9B;IACJ"}
1
+ {"version":3,"sources":["devtools.ts"],"sourcesContent":["import type { MiddlewareArguments } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { isHTMLElement } from '@fluentui/react-utilities';\nimport { listScrollParents } from './listScrollParents';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n\nexport const devtoolsCallback = (options: PositioningOptions) => (middlewareState: MiddlewareArguments) => {\n const {\n elements: { floating, reference },\n } = middlewareState;\n const scrollParentsSet = new Set<HTMLElement>();\n if (isHTMLElement(reference)) {\n listScrollParents(reference).forEach(scrollParent => scrollParentsSet.add(scrollParent));\n }\n listScrollParents(floating).forEach(scrollParent => scrollParentsSet.add(scrollParent));\n const flipBoundaries: HTMLElement[] = Array.isArray(options.flipBoundary)\n ? options.flipBoundary\n : isHTMLElement(options.flipBoundary)\n ? [options.flipBoundary]\n : [];\n const overflowBoundaries: HTMLElement[] = Array.isArray(options.overflowBoundary)\n ? options.overflowBoundary\n : isHTMLElement(options.overflowBoundary)\n ? [options.overflowBoundary]\n : [];\n return {\n type: 'FluentUIMiddleware',\n middlewareState,\n options,\n initialPlacement: fromFloatingUIPlacement(middlewareState.initialPlacement),\n placement: fromFloatingUIPlacement(middlewareState.placement),\n flipBoundaries,\n overflowBoundaries,\n scrollParents: Array.from(scrollParentsSet),\n } as const;\n};\n"],"names":["devtoolsCallback","options","middlewareState","elements","floating","reference","scrollParentsSet","Set","isHTMLElement","listScrollParents","forEach","scrollParent","add","flipBoundaries","Array","isArray","flipBoundary","overflowBoundaries","overflowBoundary","type","initialPlacement","fromFloatingUIPlacement","placement","scrollParents","from"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMaA;;;eAAAA;;;gCAJiB;mCACI;yCACM;AAEjC,MAAMA,mBAAmB,CAACC,UAAgC,CAACC;QAChE,MAAM,EACJC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAClC,GAAGH;QACJ,MAAMI,mBAAmB,IAAIC;QAC7B,IAAIC,IAAAA,6BAAAA,EAAcH,YAAY;YAC5BI,IAAAA,oCAAAA,EAAkBJ,WAAWK,OAAO,CAACC,CAAAA,eAAgBL,iBAAiBM,GAAG,CAACD;QAC5E;QACAF,IAAAA,oCAAAA,EAAkBL,UAAUM,OAAO,CAACC,CAAAA,eAAgBL,iBAAiBM,GAAG,CAACD;QACzE,MAAME,iBAAgCC,MAAMC,OAAO,CAACd,QAAQe,YAAY,IACpEf,QAAQe,YAAY,GACpBR,IAAAA,6BAAAA,EAAcP,QAAQe,YAAY,IAClC;YAACf,QAAQe,YAAY;SAAC,GACtB,EAAE;QACN,MAAMC,qBAAoCH,MAAMC,OAAO,CAACd,QAAQiB,gBAAgB,IAC5EjB,QAAQiB,gBAAgB,GACxBV,IAAAA,6BAAAA,EAAcP,QAAQiB,gBAAgB,IACtC;YAACjB,QAAQiB,gBAAgB;SAAC,GAC1B,EAAE;QACN,OAAO;YACLC,MAAM;YACNjB;YACAD;YACAmB,kBAAkBC,IAAAA,gDAAAA,EAAwBnB,gBAAgBkB,gBAAgB;YAC1EE,WAAWD,IAAAA,gDAAAA,EAAwBnB,gBAAgBoB,SAAS;YAC5DT;YACAI;YACAM,eAAeT,MAAMU,IAAI,CAAClB;QAC5B;IACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["fromFloatingUIPlacement.js"],"sourcesContent":["import { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\nconst getPositionMap = ()=>({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before'\n });\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (position)=>{\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end'\n };\n }\n return {\n start: 'top',\n end: 'bottom'\n };\n};\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */ export const fromFloatingUIPlacement = (placement)=>{\n const { side, alignment: floatingUIAlignment } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n return {\n position,\n alignment\n };\n};\n"],"names":["fromFloatingUIPlacement","getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement"],"mappings":";;;;+BAwBiBA;;;eAAAA;;;0CAxBwB;AACzC,MAAMC,iBAAiB,IAAK,CAAA;QACpBC,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,MAAM;IACV,CAAA;AACJ,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMC,kBAAkB,CAACC;IACrB,IAAIA,aAAa,WAAWA,aAAa,SAAS;QAC9C,OAAO;YACHC,OAAO;YACPC,KAAK;QACT;IACJ;IACA,OAAO;QACHD,OAAO;QACPC,KAAK;IACT;AACJ;AAIW,MAAMT,0BAA0B,CAACU;IACxC,MAAM,EAAEC,IAAI,EAAEC,WAAWC,mBAAmB,EAAE,GAAGC,IAAAA,kDAAwB,EAACJ;IAC1E,MAAMH,WAAWN,gBAAgB,CAACU,KAAK;IACvC,MAAMC,YAAYC,uBAAuBP,gBAAgBC,SAAS,CAACM,oBAAoB;IACvF,OAAO;QACHN;QACAK;IACJ;AACJ"}
1
+ {"version":3,"sources":["fromFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Alignment as FloatingUIAlignment, Placement } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\nimport { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\n\nconst getPositionMap = (): Record<Side, Position> => ({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (position: Position): Record<FloatingUIAlignment, Alignment> => {\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end',\n };\n }\n\n return {\n start: 'top',\n end: 'bottom',\n };\n};\n\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const fromFloatingUIPlacement = (placement: Placement): { position: Position; alignment?: Alignment } => {\n const { side, alignment: floatingUIAlignment } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n\n return { position, alignment };\n};\n"],"names":["fromFloatingUIPlacement","getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+BaA;;;eAAAA;;;0CA7B4B;AAEzC,MAAMC,iBAAiB,IAA+B,CAAA;QACpDC,KAAK;QACLC,QAAQ;QACRC,OAAO;QACPC,MAAM;IACR,CAAA;AAEA,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMC,kBAAkB,CAACC;IACvB,IAAIA,aAAa,WAAWA,aAAa,SAAS;QAChD,OAAO;YACLC,OAAO;YACPC,KAAK;QACP;IACF;IAEA,OAAO;QACLD,OAAO;QACPC,KAAK;IACP;AACF;AAMO,MAAMT,0BAA0B,CAACU;IACtC,MAAM,EAAEC,IAAI,EAAEC,WAAWC,mBAAmB,EAAE,GAAGC,IAAAA,kDAAAA,EAAyBJ;IAC1E,MAAMH,WAAWN,gBAAgB,CAACU,KAAK;IACvC,MAAMC,YAAYC,uBAAuBP,gBAAgBC,SAAS,CAACM,oBAAoB;IAEvF,OAAO;QAAEN;QAAUK;IAAU;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["getBoundary.js"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */ export function getBoundary(element, boundary) {\n if (boundary === 'window') {\n return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;\n }\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n if (boundary === 'scrollParent') {\n let boundariesNode = getScrollParent(element);\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;\n }\n return boundariesNode;\n }\n return boundary;\n}\n"],"names":["getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName"],"mappings":";;;;+BAGoBA;;;eAAAA;;;iCAHY;AAGrB,SAASA,YAAYC,OAAO,EAAEC,QAAQ;IAC7C,IAAIA,aAAa,UAAU;QACvB,OAAOD,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQE,aAAa,CAACC,eAAe;IAClG;IACA,IAAIF,aAAa,mBAAmB;QAChC,OAAO;IACX;IACA,IAAIA,aAAa,gBAAgB;QAC7B,IAAIG,iBAAiBC,IAAAA,gCAAe,EAACL;QACrC,IAAII,eAAeE,QAAQ,KAAK,QAAQ;YACpCF,iBAAiBJ,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQE,aAAa,CAACC,eAAe;QAC5G;QACA,OAAOC;IACX;IACA,OAAOH;AACX"}
1
+ {"version":3,"sources":["getBoundary.ts"],"sourcesContent":["import type { Boundary as FloatingUIBoundary } from '@floating-ui/dom';\n\nimport { getScrollParent } from './getScrollParent';\nimport type { Boundary } from '../types';\n\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */\nexport function getBoundary(element: HTMLElement | null, boundary?: Boundary): FloatingUIBoundary | undefined {\n if (boundary === 'window') {\n return element?.ownerDocument!.documentElement;\n }\n\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n\n if (boundary === 'scrollParent') {\n let boundariesNode: HTMLElement | undefined = getScrollParent(element);\n\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element?.ownerDocument!.documentElement;\n }\n\n return boundariesNode;\n }\n\n return boundary;\n}\n"],"names":["getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQgBA;;;eAAAA;;;iCANgB;AAMzB,SAASA,YAAYC,OAA2B,EAAEC,QAAmB;IAC1E,IAAIA,aAAa,UAAU;QACzB,OAAOD,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASE,aAAa,CAAEC,eAAe;IAChD;IAEA,IAAIF,aAAa,mBAAmB;QAClC,OAAO;IACT;IAEA,IAAIA,aAAa,gBAAgB;QAC/B,IAAIG,iBAA0CC,IAAAA,gCAAAA,EAAgBL;QAE9D,IAAII,eAAeE,QAAQ,KAAK,QAAQ;YACtCF,iBAAiBJ,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASE,aAAa,CAAEC,eAAe;QAC1D;QAEA,OAAOC;IACT;IAEA,OAAOH;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["getFloatingUIOffset.js"],"sourcesContent":["import { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */ export function getFloatingUIOffset(rawOffset) {\n if (!rawOffset) {\n return rawOffset;\n }\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n return ({ rects: { floating, reference }, placement })=>{\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({\n positionedRect: floating,\n targetRect: reference,\n position,\n alignment\n });\n };\n}\n"],"names":["getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect"],"mappings":";;;;+BAKoBA;;;eAAAA;;;yCALoB;AAK7B,SAASA,oBAAoBC,SAAS;IAC7C,IAAI,CAACA,WAAW;QACZ,OAAOA;IACX;IACA,IAAI,OAAOA,cAAc,YAAY,OAAOA,cAAc,UAAU;QAChE,OAAOA;IACX;IACA,OAAO,CAAC,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAAEC,SAAS,EAAE;QACjD,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,IAAAA,gDAAuB,EAACH;QACxD,OAAOJ,UAAU;YACbQ,gBAAgBN;YAChBO,YAAYN;YACZE;YACAC;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetValue =\n | number\n | {\n /**\n * The axis that runs along the side of the floating element.\n * @default 0\n */\n mainAxis?: number;\n /**\n * The axis that runs along the alignment of the floating element.\n * @default 0\n */\n crossAxis?: number;\n /**\n * When set to a number, overrides the `crossAxis` value for aligned\n * (non-centered/base) placements and works logically. A positive number\n * will move the floating element in the direction of the opposite edge\n * to the one that is aligned, while a negative number the reverse.\n * @default null\n */\n alignmentAxis?: number | null;\n };\n\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetFunction = (args: MiddlewareArguments) => FloatingUIOffsetValue;\n\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */\nexport function getFloatingUIOffset(\n rawOffset: Offset | undefined,\n): FloatingUIOffsetValue | FloatingUIOffsetFunction | undefined {\n if (!rawOffset) {\n return rawOffset;\n }\n\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n\n return ({ rects: { floating, reference }, placement }) => {\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({ positionedRect: floating, targetRect: reference, position, alignment });\n };\n}\n"],"names":["getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuCgBA;;;eAAAA;;;yCArCwB;AAqCjC,SAASA,oBACdC,SAA6B;IAE7B,IAAI,CAACA,WAAW;QACd,OAAOA;IACT;IAEA,IAAI,OAAOA,cAAc,YAAY,OAAOA,cAAc,UAAU;QAClE,OAAOA;IACT;IAEA,OAAO,CAAC,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAAEC,SAAS,EAAE;QACnD,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,IAAAA,gDAAAA,EAAwBH;QACxD,OAAOJ,UAAU;YAAEQ,gBAAgBN;YAAUO,YAAYN;YAAWE;YAAUC;QAAU;IAC1F;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["getReactFiberFromNode.js"],"sourcesContent":["import * as React from 'react';\nvar WorkTag;\n(function(WorkTag) {\n WorkTag[WorkTag[\"FunctionComponent\"] = 0] = \"FunctionComponent\";\n WorkTag[WorkTag[\"ClassComponent\"] = 1] = \"ClassComponent\";\n WorkTag[WorkTag[\"IndeterminateComponent\"] = 2] = \"IndeterminateComponent\";\n WorkTag[WorkTag[\"HostRoot\"] = 3] = \"HostRoot\";\n WorkTag[WorkTag[\"HostPortal\"] = 4] = \"HostPortal\";\n WorkTag[WorkTag[\"HostComponent\"] = 5] = \"HostComponent\";\n WorkTag[WorkTag[\"HostText\"] = 6] = \"HostText\";\n WorkTag[WorkTag[\"Fragment\"] = 7] = \"Fragment\";\n WorkTag[WorkTag[\"Mode\"] = 8] = \"Mode\";\n WorkTag[WorkTag[\"ContextConsumer\"] = 9] = \"ContextConsumer\";\n WorkTag[WorkTag[\"ContextProvider\"] = 10] = \"ContextProvider\";\n WorkTag[WorkTag[\"ForwardRef\"] = 11] = \"ForwardRef\";\n WorkTag[WorkTag[\"Profiler\"] = 12] = \"Profiler\";\n WorkTag[WorkTag[\"SuspenseComponent\"] = 13] = \"SuspenseComponent\";\n WorkTag[WorkTag[\"MemoComponent\"] = 14] = \"MemoComponent\";\n WorkTag[WorkTag[\"SimpleMemoComponent\"] = 15] = \"SimpleMemoComponent\";\n WorkTag[WorkTag[\"LazyComponent\"] = 16] = \"LazyComponent\";\n WorkTag[WorkTag[\"IncompleteClassComponent\"] = 17] = \"IncompleteClassComponent\";\n WorkTag[WorkTag[\"DehydratedFragment\"] = 18] = \"DehydratedFragment\";\n WorkTag[WorkTag[\"SuspenseListComponent\"] = 19] = \"SuspenseListComponent\";\n WorkTag[WorkTag[\"FundamentalComponent\"] = 20] = \"FundamentalComponent\";\n WorkTag[WorkTag[\"ScopeComponent\"] = 21] = \"ScopeComponent\";\n})(WorkTag || (WorkTag = {}));\nexport function getReactFiberFromNode(elm) {\n if (!elm) {\n return null;\n }\n for(const k in elm){\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["getReactFiberFromNode","W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AG,GAAG,GAAG;IACjDA,OAAO,CAACA,OAAO,CAAC,uBAAuB,GAAG,GAAG,GAAG;IAChDA,OAAO,CAACA,OAAO,CAAC,iBAAiB,GAAG,GAAG,GAAG;AAC9C,CAAA,EAAGA,WAAYA,CAAAA,UAAU,CAAC,CAAA;AACnB,SAASD,sBAAsBE,GAAG;IACrC,IAAI,CAACA,KAAK;QACN,OAAO;IACX;IACA,IAAI,MAAMC,KAAKD,IAAI;QACf,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACjF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACjB;IACJ;IACA,MAAM,IAAIE,MAAM;AACpB"}
1
+ {"version":3,"sources":["getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["getReactFiberFromNode","WorkTag","elm","k","indexOf","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA6PgBA;;;eAAAA;;;;iEA7PO;;UAuElBC,OAAAA;;;;;;;;;;;;;;;;;;;;;;;GAAAA,WAAAA,CAAAA,UAAAA,CAAAA,CAAAA;AAsLE,SAASD,sBAAsBE,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["getScrollParent.js"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */ export const getParentNode = (node)=>{\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || node.host;\n};\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */ const getStyleComputedProperty = (node)=>{\n var _node_ownerDocument;\n if (node.nodeType !== 1) {\n return {};\n }\n const window = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;\n return window.getComputedStyle(node, null);\n};\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */ export const getScrollParent = (node)=>{\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n switch(parentNode.nodeName){\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument.body;\n case '#document':\n return parentNode.body;\n }\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return parentNode;\n }\n return getScrollParent(parentNode);\n};\nexport const hasScrollParent = (node)=>{\n var _scrollParentElement_ownerDocument;\n const scrollParentElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== ((_scrollParentElement_ownerDocument = scrollParentElement.ownerDocument) === null || _scrollParentElement_ownerDocument === void 0 ? void 0 : _scrollParentElement_ownerDocument.body) : false;\n};\n"],"names":["getParentNode","getScrollParent","hasScrollParent","node","nodeName","parentNode","host","getStyleComputedProperty","_node_ownerDocument","nodeType","window","ownerDocument","defaultView","getComputedStyle","document","body","overflow","overflowX","overflowY","test","_scrollParentElement_ownerDocument","scrollParentElement"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;IAAgBA,aAAa;eAAbA;;IAuBAC,eAAe;eAAfA;;IAmBJC,eAAe;eAAfA;;;AA1CF,MAAMF,gBAAgB,CAACG;IAC9B,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC1B,OAAOD;IACX;IACA,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAIF,KAAKG,IAAI;AACvC;AACA;;;;CAIC,GAAG,MAAMC,2BAA2B,CAACJ;IAClC,IAAIK;IACJ,IAAIL,KAAKM,QAAQ,KAAK,GAAG;QACrB,OAAO,CAAC;IACZ;IACA,MAAMC,SAAS,AAACF,CAAAA,sBAAsBL,KAAKQ,aAAa,AAAD,MAAO,QAAQH,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBI,WAAW;IAC/I,OAAOF,OAAOG,gBAAgB,CAACV,MAAM;AACzC;AAKW,MAAMF,kBAAkB,CAACE;IAChC,iFAAiF;IACjF,MAAME,aAAaF,QAAQH,cAAcG;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOS,SAASC,IAAI;IACrC,OAAOV,WAAWD,QAAQ;QACtB,KAAK;QACL,KAAK;YACD,OAAOC,WAAWM,aAAa,CAACI,IAAI;QACxC,KAAK;YACD,OAAOV,WAAWU,IAAI;IAC9B;IACA,uFAAuF;IACvF,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGX,yBAAyBF;IACpE,IAAI,wBAAwBc,IAAI,CAACH,WAAWE,YAAYD,YAAY;QAChE,OAAOZ;IACX;IACA,OAAOJ,gBAAgBI;AAC3B;AACO,MAAMH,kBAAkB,CAACC;IAC5B,IAAIiB;IACJ,MAAMC,sBAAsBpB,gBAAgBE;IAC5C,OAAOkB,sBAAsBA,wBAAyB,CAAA,AAACD,CAAAA,qCAAqCC,oBAAoBV,aAAa,AAAD,MAAO,QAAQS,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCL,IAAI,AAAD,IAAK;AACnP"}
1
+ {"version":3,"sources":["getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nconst getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const window = node.ownerDocument?.defaultView;\n return window!.getComputedStyle(node, null);\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return (parentNode as unknown as Document).body;\n }\n\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow! + overflowY! + overflowX)) {\n return parentNode;\n }\n\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"],"names":["getParentNode","getScrollParent","hasScrollParent","node","nodeName","parentNode","host","getStyleComputedProperty","nodeType","window","ownerDocument","defaultView","getComputedStyle","document","body","overflow","overflowX","overflowY","test","scrollParentElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;CAIC;;;;;;;;;;;IACYA,aAAAA;eAAAA;;IA2BAC,eAAAA;eAAAA;;IAuBAC,eAAAA;eAAAA;;;AAlDN,MAAMF,gBAAgB,CAACG;IAC5B,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC5B,OAAOD;IACT;IACA,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAIF,KAAcG,IAAI;AAC9C;AAEA;;;;CAIC,GACD,MAAMC,2BAA2B,CAACJ;QAKjBA;IAJf,IAAIA,KAAKK,QAAQ,KAAK,GAAG;QACvB,OAAO,CAAC;IACV;IAEA,MAAMC,SAAAA,AAASN,CAAAA,sBAAAA,KAAKO,aAAa,AAAbA,MAAa,QAAlBP,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBQ,WAAW;IAC9C,OAAOF,OAAQG,gBAAgB,CAACT,MAAM;AACxC;AAOO,MAAMF,kBAAkB,CAACE;IAC9B,iFAAiF;IACjF,MAAME,aAAaF,QAAQH,cAAcG;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOQ,SAASC,IAAI;IAErC,OAAQT,WAAWD,QAAQ;QACzB,KAAK;QACL,KAAK;YACH,OAAOC,WAAWK,aAAa,CAAEI,IAAI;QACvC,KAAK;YACH,OAAOT,WAAoCS,IAAI;IACnD;IAEA,uFAAuF;IACvF,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGV,yBAAyBF;IACpE,IAAI,wBAAwBa,IAAI,CAACH,WAAYE,YAAaD,YAAY;QACpE,OAAOX;IACT;IAEA,OAAOJ,gBAAgBI;AACzB;AAEO,MAAMH,kBAAkB,CAACC;QAEuBgB;IADrD,MAAMA,sBAAmClB,gBAAgBE;IACzD,OAAOgB,sBAAsBA,wBAAAA,CAAAA,AAAwBA,CAAAA,qCAAAA,oBAAoBT,aAAa,AAAbA,MAAa,QAAjCS,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCL,IAAI,AAAJA,IAAO;AACjG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["hasAutoFocusFilter.js"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */ function hasAutofocusProp(node) {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';\n if (isAutoFocusableElement) {\n var _getReactFiberFromNode;\n return !!((_getReactFiberFromNode = getReactFiberFromNode(node)) === null || _getReactFiberFromNode === void 0 ? void 0 : _getReactFiberFromNode.pendingProps.autoFocus);\n }\n return false;\n}\nexport function hasAutofocusFilter(node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_getReactFiberFromNode","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAgBcA;;;eAAAA;;;uCAfsB;AACtC;;;;;CAKC,GAAG,SAASC,iBAAiBC,IAAI;IAC9B,gJAAgJ;IAChJ,MAAMC,yBAAyBD,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK,WAAWF,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK;IAC1I,IAAID,wBAAwB;QACxB,IAAIE;QACJ,OAAO,CAAC,CAAE,CAAA,AAACA,CAAAA,0BAAyBC,IAAAA,4CAAqB,EAACJ,KAAI,MAAO,QAAQG,4BAA2B,KAAK,IAAI,KAAK,IAAIA,wBAAuBE,YAAY,CAACC,SAAS,AAAD;IAC1K;IACA,OAAO;AACX;AACO,SAASR,mBAAmBE,IAAI;IACnC,OAAOD,iBAAiBC,QAAQO,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACrF"}
1
+ {"version":3,"sources":["hasAutoFocusFilter.ts"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\n\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */\nfunction hasAutofocusProp(node: Node): boolean {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement =\n node.nodeName === 'BUTTON' ||\n node.nodeName === 'INPUT' ||\n node.nodeName === 'SELECT' ||\n node.nodeName === 'TEXTAREA';\n\n if (isAutoFocusableElement) {\n return !!getReactFiberFromNode(node)?.pendingProps.autoFocus;\n }\n\n return false;\n}\n\nexport function hasAutofocusFilter(node: Node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAyBcA;;;eAAAA;;;uCAvBsB;AAEtC;;;;;CAKC,GACD,SAASC,iBAAiBC,IAAU;IAClC,gJAAgJ;IAChJ,MAAMC,yBACJD,KAAKE,QAAQ,KAAK,YAClBF,KAAKE,QAAQ,KAAK,WAClBF,KAAKE,QAAQ,KAAK,YAClBF,KAAKE,QAAQ,KAAK;IAEpB,IAAID,wBAAwB;YACjBE;QAAT,OAAO,CAAC,CAAA,CAAA,AAACA,CAAAA,0BAAAA,IAAAA,4CAAAA,EAAsBH,KAAAA,MAAAA,QAAtBG,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAA6BC,YAAY,CAACC,SAAS,AAATA;IACrD;IAEA,OAAO;AACT;AAEO,SAASP,mBAAmBE,IAAU;IAC3C,OAAOD,iBAAiBC,QAAQM,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACnF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './parseFloatingUIPlacement';\nexport * from './getBoundary';\nexport * from './getReactFiberFromNode';\nexport * from './getScrollParent';\nexport * from './mergeArrowOffset';\nexport * from './toFloatingUIPadding';\nexport * from './toFloatingUIPlacement';\nexport * from './fromFloatingUIPlacement';\nexport * from './resolvePositioningShorthand';\nexport * from './useCallbackRef';\nexport * from './debounce';\nexport * from './toggleScrollListener';\nexport * from './hasAutoFocusFilter';\nexport * from './writeArrowUpdates';\nexport * from './writeContainerupdates';\nexport * from './normalizeAutoSize';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './parseFloatingUIPlacement';\nexport * from './getBoundary';\nexport * from './getReactFiberFromNode';\nexport * from './getScrollParent';\nexport * from './mergeArrowOffset';\nexport * from './toFloatingUIPadding';\nexport * from './toFloatingUIPlacement';\nexport * from './fromFloatingUIPlacement';\nexport * from './resolvePositioningShorthand';\nexport * from './useCallbackRef';\nexport * from './debounce';\nexport * from './toggleScrollListener';\nexport * from './hasAutoFocusFilter';\nexport * from './writeArrowUpdates';\nexport * from './writeContainerupdates';\nexport * from './normalizeAutoSize';\n"],"names":[],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["listScrollParents.js"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\nexport function listScrollParents(node) {\n const scrollParents = [];\n let cur = node;\n while(cur){\n const scrollParent = getScrollParent(cur);\n if (node.ownerDocument.body === scrollParent) {\n scrollParents.push(scrollParent);\n break;\n }\n if (scrollParent.nodeName === 'BODY' && scrollParent !== node.ownerDocument.body) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('@fluentui/react-positioning: You are comparing two different documents! This is an unexpected error, please report this as a bug to the Fluent UI team ');\n }\n break;\n }\n scrollParents.push(scrollParent);\n cur = scrollParent;\n }\n return scrollParents;\n}\n"],"names":["listScrollParents","node","scrollParents","cur","scrollParent","getScrollParent","ownerDocument","body","push","nodeName","process","env","NODE_ENV","console","error"],"mappings":";;;;+BACgBA;;;eAAAA;;;iCADgB;AACzB,SAASA,kBAAkBC,IAAI;IAClC,MAAMC,gBAAgB,EAAE;IACxB,IAAIC,MAAMF;IACV,MAAME,IAAI;QACN,MAAMC,eAAeC,IAAAA,gCAAe,EAACF;QACrC,IAAIF,KAAKK,aAAa,CAACC,IAAI,KAAKH,cAAc;YAC1CF,cAAcM,IAAI,CAACJ;YACnB;QACJ;QACA,IAAIA,aAAaK,QAAQ,KAAK,UAAUL,iBAAiBH,KAAKK,aAAa,CAACC,IAAI,EAAE;YAC9E,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACvC,sCAAsC;gBACtCC,QAAQC,KAAK,CAAC;YAClB;YACA;QACJ;QACAZ,cAAcM,IAAI,CAACJ;QACnBD,MAAMC;IACV;IACA,OAAOF;AACX"}
1
+ {"version":3,"sources":["listScrollParents.ts"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\n\nexport function listScrollParents(node: HTMLElement): HTMLElement[] {\n const scrollParents: HTMLElement[] = [];\n\n let cur: HTMLElement | null = node;\n while (cur) {\n const scrollParent = getScrollParent(cur);\n\n if (node.ownerDocument.body === scrollParent) {\n scrollParents.push(scrollParent);\n break;\n }\n\n if (scrollParent.nodeName === 'BODY' && scrollParent !== node.ownerDocument.body) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(\n '@fluentui/react-positioning: You are comparing two different documents! This is an unexpected error, please report this as a bug to the Fluent UI team ',\n );\n }\n break;\n }\n\n scrollParents.push(scrollParent);\n cur = scrollParent;\n }\n\n return scrollParents;\n}\n"],"names":["listScrollParents","node","scrollParents","cur","scrollParent","getScrollParent","ownerDocument","body","push","nodeName","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAEgBA;;;eAAAA;;;iCAFgB;AAEzB,SAASA,kBAAkBC,IAAiB;IACjD,MAAMC,gBAA+B,EAAE;IAEvC,IAAIC,MAA0BF;IAC9B,MAAOE,IAAK;QACV,MAAMC,eAAeC,IAAAA,gCAAAA,EAAgBF;QAErC,IAAIF,KAAKK,aAAa,CAACC,IAAI,KAAKH,cAAc;YAC5CF,cAAcM,IAAI,CAACJ;YACnB;QACF;QAEA,IAAIA,aAAaK,QAAQ,KAAK,UAAUL,iBAAiBH,KAAKK,aAAa,CAACC,IAAI,EAAE;YAChF,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,KAAK,CACX;YAEJ;YACA;QACF;QAEAZ,cAAcM,IAAI,CAACJ;QACnBD,MAAMC;IACR;IAEA,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["mergeArrowOffset.js"],"sourcesContent":["/**\n * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the\n * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset\n *\n * @internal\n * @param userOffset - The offset provided by the user\n * @param arrowHeight - The height of the arrow in px\n * @returns User offset augmented with arrow height\n */ export function mergeArrowOffset(userOffset, arrowHeight) {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'function') {\n return (offsetParams)=>{\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n return {\n mainAxis: arrowHeight\n };\n}\nconst addArrowOffset = (offset, arrowHeight)=>{\n if (typeof offset === 'number') {\n return {\n mainAxis: offset + arrowHeight\n };\n }\n var _offset_mainAxis;\n return {\n ...offset,\n mainAxis: ((_offset_mainAxis = offset.mainAxis) !== null && _offset_mainAxis !== void 0 ? _offset_mainAxis : 0) + arrowHeight\n };\n};\n"],"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","_offset_mainAxis"],"mappings":"AAAA;;;;;;;;CAQC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,UAAU,EAAEC,WAAW;IACxD,IAAI,OAAOD,eAAe,UAAU;QAChC,OAAOE,eAAeF,YAAYC;IACtC;IACA,IAAI,OAAOD,eAAe,YAAYA,eAAe,MAAM;QACvD,OAAOE,eAAeF,YAAYC;IACtC;IACA,IAAI,OAAOD,eAAe,YAAY;QAClC,OAAO,CAACG;YACJ,MAAMC,SAASJ,WAAWG;YAC1B,OAAOD,eAAeE,QAAQH;QAClC;IACJ;IACA,OAAO;QACHI,UAAUJ;IACd;AACJ;AACA,MAAMC,iBAAiB,CAACE,QAAQH;IAC5B,IAAI,OAAOG,WAAW,UAAU;QAC5B,OAAO;YACHC,UAAUD,SAASH;QACvB;IACJ;IACA,IAAIK;IACJ,OAAO;QACH,GAAGF,MAAM;QACTC,UAAU,AAAC,CAAA,AAACC,CAAAA,mBAAmBF,OAAOC,QAAQ,AAAD,MAAO,QAAQC,qBAAqB,KAAK,IAAIA,mBAAmB,CAAA,IAAKL;IACtH;AACJ"}
1
+ {"version":3,"sources":["mergeArrowOffset.ts"],"sourcesContent":["import type { Offset, OffsetObject } from '../types';\n\n/**\n * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the\n * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset\n *\n * @internal\n * @param userOffset - The offset provided by the user\n * @param arrowHeight - The height of the arrow in px\n * @returns User offset augmented with arrow height\n */\nexport function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'function') {\n return offsetParams => {\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n\n return { mainAxis: arrowHeight };\n}\n\nconst addArrowOffset = (offset: OffsetObject | number, arrowHeight: number): OffsetObject => {\n if (typeof offset === 'number') {\n return { mainAxis: offset + arrowHeight };\n }\n\n return { ...offset, mainAxis: (offset.mainAxis ?? 0) + arrowHeight };\n};\n"],"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;;;;;CAQC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,UAAqC,EAAEC,WAAmB;IACzF,IAAI,OAAOD,eAAe,UAAU;QAClC,OAAOE,eAAeF,YAAYC;IACpC;IAEA,IAAI,OAAOD,eAAe,YAAYA,eAAe,MAAM;QACzD,OAAOE,eAAeF,YAAYC;IACpC;IAEA,IAAI,OAAOD,eAAe,YAAY;QACpC,OAAOG,CAAAA;YACL,MAAMC,SAASJ,WAAWG;YAC1B,OAAOD,eAAeE,QAAQH;QAChC;IACF;IAEA,OAAO;QAAEI,UAAUJ;IAAY;AACjC;AAEA,MAAMC,iBAAiB,CAACE,QAA+BH;IACrD,IAAI,OAAOG,WAAW,UAAU;QAC9B,OAAO;YAAEC,UAAUD,SAASH;QAAY;IAC1C;QAE+BG;IAA/B,OAAO;QAAE,GAAGA,MAAM;QAAEC,UAAU,AAACD,CAAAA,CAAAA,mBAAAA,OAAOC,QAAQ,AAARA,MAAQ,QAAfD,qBAAAA,KAAAA,IAAAA,mBAAmB,CAAA,IAAKH;IAAY;AACrE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["normalizeAutoSize.js"],"sourcesContent":["/**\n * AutoSizes contains many options from historic implementation.\n * Now options 'always'/'height-always'/'width-always' are obsolete.\n * This function maps them to true/'height'/'width'\n */ export const normalizeAutoSize = (autoSize)=>{\n switch(autoSize){\n case 'always':\n case true:\n return {\n applyMaxWidth: true,\n applyMaxHeight: true\n };\n case 'width-always':\n case 'width':\n return {\n applyMaxWidth: true,\n applyMaxHeight: false\n };\n case 'height-always':\n case 'height':\n return {\n applyMaxWidth: false,\n applyMaxHeight: true\n };\n default:\n return false;\n }\n};\n"],"names":["normalizeAutoSize","autoSize","applyMaxWidth","applyMaxHeight"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA;;;eAAAA;;;AAAN,MAAMA,oBAAoB,CAACC;IAClC,OAAOA;QACH,KAAK;QACL,KAAK;YACD,OAAO;gBACHC,eAAe;gBACfC,gBAAgB;YACpB;QACJ,KAAK;QACL,KAAK;YACD,OAAO;gBACHD,eAAe;gBACfC,gBAAgB;YACpB;QACJ,KAAK;QACL,KAAK;YACD,OAAO;gBACHD,eAAe;gBACfC,gBAAgB;YACpB;QACJ;YACI,OAAO;IACf;AACJ"}
1
+ {"version":3,"sources":["normalizeAutoSize.ts"],"sourcesContent":["import type { NormalizedAutoSize, PositioningOptions } from '../types';\n\n/**\n * AutoSizes contains many options from historic implementation.\n * Now options 'always'/'height-always'/'width-always' are obsolete.\n * This function maps them to true/'height'/'width'\n */\nexport const normalizeAutoSize = (autoSize?: PositioningOptions['autoSize']): NormalizedAutoSize | false => {\n switch (autoSize) {\n case 'always':\n case true:\n return {\n applyMaxWidth: true,\n applyMaxHeight: true,\n };\n\n case 'width-always':\n case 'width':\n return {\n applyMaxWidth: true,\n applyMaxHeight: false,\n };\n\n case 'height-always':\n case 'height':\n return {\n applyMaxWidth: false,\n applyMaxHeight: true,\n };\n\n default:\n return false;\n }\n};\n"],"names":["normalizeAutoSize","autoSize","applyMaxWidth","applyMaxHeight"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;CAIC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,oBAAoB,CAACC;IAChC,OAAQA;QACN,KAAK;QACL,KAAK;YACH,OAAO;gBACLC,eAAe;gBACfC,gBAAgB;YAClB;QAEF,KAAK;QACL,KAAK;YACH,OAAO;gBACLD,eAAe;gBACfC,gBAAgB;YAClB;QAEF,KAAK;QACL,KAAK;YACH,OAAO;gBACLD,eAAe;gBACfC,gBAAgB;YAClB;QAEF;YACE,OAAO;IACX;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["parseFloatingUIPlacement.js"],"sourcesContent":["/**\n * Parses Floating UI placement and returns the different components\n * @param placement - the floating ui placement (i.e. bottom-start)\n *\n * @returns side and alignment components of the placement\n */ export function parseFloatingUIPlacement(placement) {\n const tokens = placement.split('-');\n return {\n side: tokens[0],\n alignment: tokens[1]\n };\n}\n"],"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,yBAAyBC,SAAS;IAClD,MAAMC,SAASD,UAAUE,KAAK,CAAC;IAC/B,OAAO;QACHC,MAAMF,MAAM,CAAC,EAAE;QACfG,WAAWH,MAAM,CAAC,EAAE;IACxB;AACJ"}
1
+ {"version":3,"sources":["parseFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Placement, Alignment } from '@floating-ui/dom';\n\n/**\n * Parses Floating UI placement and returns the different components\n * @param placement - the floating ui placement (i.e. bottom-start)\n *\n * @returns side and alignment components of the placement\n */\nexport function parseFloatingUIPlacement(placement: Placement): { side: Side; alignment: Alignment } {\n const tokens = placement.split('-');\n return {\n side: tokens[0] as Side,\n alignment: tokens[1] as Alignment,\n };\n}\n"],"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA;;;;;CAKC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,yBAAyBC,SAAoB;IAC3D,MAAMC,SAASD,UAAUE,KAAK,CAAC;IAC/B,OAAO;QACLC,MAAMF,MAAM,CAAC,EAAE;QACfG,WAAWH,MAAM,CAAC,EAAE;IACtB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["resolvePositioningShorthand.js"],"sourcesContent":["// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup = {\n above: {\n position: 'above',\n align: 'center'\n },\n 'above-start': {\n position: 'above',\n align: 'start'\n },\n 'above-end': {\n position: 'above',\n align: 'end'\n },\n below: {\n position: 'below',\n align: 'center'\n },\n 'below-start': {\n position: 'below',\n align: 'start'\n },\n 'below-end': {\n position: 'below',\n align: 'end'\n },\n before: {\n position: 'before',\n align: 'center'\n },\n 'before-top': {\n position: 'before',\n align: 'top'\n },\n 'before-bottom': {\n position: 'before',\n align: 'bottom'\n },\n after: {\n position: 'after',\n align: 'center'\n },\n 'after-top': {\n position: 'after',\n align: 'top'\n },\n 'after-bottom': {\n position: 'after',\n align: 'bottom'\n }\n};\nexport function resolvePositioningShorthand(shorthand) {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n return shorthand;\n}\n"],"names":["resolvePositioningShorthand","shorthandLookup","above","position","align","below","before","after","shorthand","undefined"],"mappings":"AAAA,uDAAuD;;;;;+BAmDvCA;;;eAAAA;;;AAlDhB,MAAMC,kBAAkB;IACpBC,OAAO;QACHC,UAAU;QACVC,OAAO;IACX;IACA,eAAe;QACXD,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACAC,OAAO;QACHF,UAAU;QACVC,OAAO;IACX;IACA,eAAe;QACXD,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACAE,QAAQ;QACJH,UAAU;QACVC,OAAO;IACX;IACA,cAAc;QACVD,UAAU;QACVC,OAAO;IACX;IACA,iBAAiB;QACbD,UAAU;QACVC,OAAO;IACX;IACAG,OAAO;QACHJ,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACA,gBAAgB;QACZD,UAAU;QACVC,OAAO;IACX;AACJ;AACO,SAASJ,4BAA4BQ,SAAS;IACjD,IAAIA,cAAcC,aAAaD,cAAc,MAAM;QAC/C,OAAO,CAAC;IACZ;IACA,IAAI,OAAOA,cAAc,UAAU;QAC/B,OAAOP,eAAe,CAACO,UAAU;IACrC;IACA,OAAOA;AACX"}
1
+ {"version":3,"sources":["resolvePositioningShorthand.ts"],"sourcesContent":["import type { PositioningShorthand, PositioningShorthandValue, PositioningProps } from '../types';\n\n// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup: Record<PositioningShorthandValue, Pick<PositioningProps, 'position' | 'align'>> = {\n above: { position: 'above', align: 'center' },\n 'above-start': { position: 'above', align: 'start' },\n 'above-end': { position: 'above', align: 'end' },\n below: { position: 'below', align: 'center' },\n 'below-start': { position: 'below', align: 'start' },\n 'below-end': { position: 'below', align: 'end' },\n before: { position: 'before', align: 'center' },\n 'before-top': { position: 'before', align: 'top' },\n 'before-bottom': { position: 'before', align: 'bottom' },\n after: { position: 'after', align: 'center' },\n 'after-top': { position: 'after', align: 'top' },\n 'after-bottom': { position: 'after', align: 'bottom' },\n};\n\nexport function resolvePositioningShorthand(\n shorthand: PositioningShorthand | undefined | null,\n): Readonly<PositioningProps> {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n\n return shorthand as Readonly<PositioningProps>;\n}\n"],"names":["resolvePositioningShorthand","shorthandLookup","above","position","align","below","before","after","shorthand","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,uDAAuD;;;;;+BAgBvCA;;;eAAAA;;;AAfhB,MAAMC,kBAAmG;IACvGC,OAAO;QAAEC,UAAU;QAASC,OAAO;IAAS;IAC5C,eAAe;QAAED,UAAU;QAASC,OAAO;IAAQ;IACnD,aAAa;QAAED,UAAU;QAASC,OAAO;IAAM;IAC/CC,OAAO;QAAEF,UAAU;QAASC,OAAO;IAAS;IAC5C,eAAe;QAAED,UAAU;QAASC,OAAO;IAAQ;IACnD,aAAa;QAAED,UAAU;QAASC,OAAO;IAAM;IAC/CE,QAAQ;QAAEH,UAAU;QAAUC,OAAO;IAAS;IAC9C,cAAc;QAAED,UAAU;QAAUC,OAAO;IAAM;IACjD,iBAAiB;QAAED,UAAU;QAAUC,OAAO;IAAS;IACvDG,OAAO;QAAEJ,UAAU;QAASC,OAAO;IAAS;IAC5C,aAAa;QAAED,UAAU;QAASC,OAAO;IAAM;IAC/C,gBAAgB;QAAED,UAAU;QAASC,OAAO;IAAS;AACvD;AAEO,SAASJ,4BACdQ,SAAkD;IAElD,IAAIA,cAAcC,aAAaD,cAAc,MAAM;QACjD,OAAO,CAAC;IACV;IAEA,IAAI,OAAOA,cAAc,UAAU;QACjC,OAAOP,eAAe,CAACO,UAAU;IACnC;IAEA,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["toFloatingUIPadding.js"],"sourcesContent":["export function toFloatingUIPadding(padding, isRtl) {\n if (typeof padding === 'number') {\n return padding;\n }\n const { start, end, ...verticalPadding } = padding;\n const paddingObject = verticalPadding;\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,oBAAoBC,OAAO,EAAEC,KAAK;IAC9C,IAAI,OAAOD,YAAY,UAAU;QAC7B,OAAOA;IACX;IACA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAC3C,MAAMK,gBAAgBD;IACtB,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAChC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACfD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACtC;IACA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAChBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACxC;IACA,OAAOF;AACX"}
1
+ {"version":3,"sources":["toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAGgBA;;;eAAAA;;;AAAT,SAASA,oBACdC,OAAmE,EACnEC,KAAc;IAEd,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT;IAEA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAE3C,MAAMK,gBAAqCD;IAE3C,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAEhC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC;IAEA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC;IAEA,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["toFloatingUIPlacement.js"],"sourcesContent":["const getPositionMap = (rtl)=>({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right'\n });\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = ()=>({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined\n });\nconst shouldAlignToCenter = (p, a)=>{\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n return positionedVertically && alignedVertically || !positionedVertically && !alignedVertically;\n};\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */ export const toFloatingUIPlacement = (align, position, rtl)=>{\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n if (computedPosition && computedAlignment) {\n return `${computedPosition}-${computedAlignment}`;\n }\n return computedPosition;\n};\n"],"names":["toFloatingUIPlacement","getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","align","position","alignment","computedPosition","computedAlignment"],"mappings":";;;;+BAuBiBA;;;eAAAA;;;AAvBjB,MAAMC,iBAAiB,CAACC,MAAO,CAAA;QACvBC,OAAO;QACPC,OAAO;QACPC,QAAQH,MAAM,UAAU;QACxBI,OAAOJ,MAAM,SAAS;IAC1B,CAAA;AACJ,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMK,kBAAkB,IAAK,CAAA;QACrBC,OAAO;QACPC,KAAK;QACLC,KAAK;QACLC,QAAQ;QACRC,QAAQC;IACZ,CAAA;AACJ,MAAMC,sBAAsB,CAACC,GAAGC;IAC5B,MAAMC,uBAAuBF,MAAM,WAAWA,MAAM;IACpD,MAAMG,oBAAoBF,MAAM,SAASA,MAAM;IAC/C,OAAOC,wBAAwBC,qBAAqB,CAACD,wBAAwB,CAACC;AAClF;AAIW,MAAMlB,wBAAwB,CAACmB,OAAOC,UAAUlB;IACvD,MAAMmB,YAAYP,oBAAoBM,UAAUD,SAAS,WAAWA;IACpE,MAAMG,mBAAmBF,YAAYnB,eAAeC,IAAI,CAACkB,SAAS;IAClE,MAAMG,oBAAoBF,aAAad,iBAAiB,CAACc,UAAU;IACnE,IAAIC,oBAAoBC,mBAAmB;QACvC,OAAO,CAAC,EAAED,iBAAiB,CAAC,EAAEC,kBAAkB,CAAC;IACrD;IACA,OAAOD;AACX"}
1
+ {"version":3,"sources":["toFloatingUIPlacement.ts"],"sourcesContent":["import type { Placement, Side, Alignment as FloatingUIAlignment } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\n\ntype PlacementPosition = Side;\ntype PlacementAlign = FloatingUIAlignment;\n\nconst getPositionMap = (rtl?: boolean): Record<Position, PlacementPosition> => ({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (): Record<Alignment, PlacementAlign | undefined> => ({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined,\n});\n\nconst shouldAlignToCenter = (p?: Position, a?: Alignment): boolean => {\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n\n return (positionedVertically && alignedVertically) || (!positionedVertically && !alignedVertically);\n};\n\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const toFloatingUIPlacement = (align?: Alignment, position?: Position, rtl?: boolean): Placement | undefined => {\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n\n if (computedPosition && computedAlignment) {\n return `${computedPosition}-${computedAlignment}` as Placement;\n }\n\n return computedPosition;\n};\n"],"names":["toFloatingUIPlacement","getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","align","position","alignment","computedPosition","computedAlignment"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkCaA;;;eAAAA;;;AA5Bb,MAAMC,iBAAiB,CAACC,MAAwD,CAAA;QAC9EC,OAAO;QACPC,OAAO;QACPC,QAAQH,MAAM,UAAU;QACxBI,OAAOJ,MAAM,SAAS;IACxB,CAAA;AAEA,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMK,kBAAkB,IAAsD,CAAA;QAC5EC,OAAO;QACPC,KAAK;QACLC,KAAK;QACLC,QAAQ;QACRC,QAAQC;IACV,CAAA;AAEA,MAAMC,sBAAsB,CAACC,GAAcC;IACzC,MAAMC,uBAAuBF,MAAM,WAAWA,MAAM;IACpD,MAAMG,oBAAoBF,MAAM,SAASA,MAAM;IAE/C,OAAOC,wBAAyBC,qBAAuB,CAACD,wBAAwB,CAACC;AACnF;AAMO,MAAMlB,wBAAwB,CAACmB,OAAmBC,UAAqBlB;IAC5E,MAAMmB,YAAYP,oBAAoBM,UAAUD,SAAS,WAAWA;IAEpE,MAAMG,mBAAmBF,YAAYnB,eAAeC,IAAI,CAACkB,SAAS;IAClE,MAAMG,oBAAoBF,aAAad,iBAAiB,CAACc,UAAU;IAEnE,IAAIC,oBAAoBC,mBAAmB;QACzC,OAAO,CAAC,EAAED,iBAAiB,CAAC,EAAEC,kBAAkB,CAAC;IACnD;IAEA,OAAOD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["toggleScrollListener.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { getScrollParent } from './getScrollParent';\n/**\n * Toggles event listeners for scroll parent.\n * Cleans up the event listeners for the previous element and adds them for the new scroll parent.\n * @param next Next element\n * @param prev Previous element\n */ export function toggleScrollListener(next, prev, handler) {\n if (next === prev) {\n return;\n }\n if (isHTMLElement(prev)) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (isHTMLElement(next)) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"],"names":["toggleScrollListener","next","prev","handler","isHTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAOoBA;;;eAAAA;;;gCAPU;iCACE;AAMrB,SAASA,qBAAqBC,IAAI,EAAEC,IAAI,EAAEC,OAAO;IACxD,IAAIF,SAASC,MAAM;QACf;IACJ;IACA,IAAIE,IAAAA,6BAAa,EAACF,OAAO;QACrB,MAAMG,mBAAmBC,IAAAA,gCAAe,EAACJ;QACzCG,iBAAiBE,mBAAmB,CAAC,UAAUJ;IACnD;IACA,IAAIC,IAAAA,6BAAa,EAACH,OAAO;QACrB,MAAMO,eAAeF,IAAAA,gCAAe,EAACL;QACrCO,aAAaC,gBAAgB,CAAC,UAAUN;IAC5C;AACJ"}
1
+ {"version":3,"sources":["toggleScrollListener.ts"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport type { PositioningVirtualElement } from '../types';\nimport { getScrollParent } from './getScrollParent';\n\n/**\n * Toggles event listeners for scroll parent.\n * Cleans up the event listeners for the previous element and adds them for the new scroll parent.\n * @param next Next element\n * @param prev Previous element\n */\nexport function toggleScrollListener(\n next: HTMLElement | PositioningVirtualElement | null,\n prev: HTMLElement | PositioningVirtualElement | null,\n handler: EventListener,\n) {\n if (next === prev) {\n return;\n }\n\n if (isHTMLElement(prev)) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (isHTMLElement(next)) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"],"names":["toggleScrollListener","next","prev","handler","isHTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUgBA;;;eAAAA;;;gCAVc;iCAEE;AAQzB,SAASA,qBACdC,IAAoD,EACpDC,IAAoD,EACpDC,OAAsB;IAEtB,IAAIF,SAASC,MAAM;QACjB;IACF;IAEA,IAAIE,IAAAA,6BAAAA,EAAcF,OAAO;QACvB,MAAMG,mBAAmBC,IAAAA,gCAAAA,EAAgBJ;QACzCG,iBAAiBE,mBAAmB,CAAC,UAAUJ;IACjD;IACA,IAAIC,IAAAA,6BAAAA,EAAcH,OAAO;QACvB,MAAMO,eAAeF,IAAAA,gCAAAA,EAAgBL;QACrCO,aAAaC,gBAAgB,CAAC,UAAUN;IAC1C;AACF"}