@fluentui/react-positioning 9.23.0 → 9.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/dist/index.d.cts +419 -0
  3. package/lib/PositioningConfigurationContext.js +1 -1
  4. package/lib/createArrowStyles.js +1 -1
  5. package/lib/createPositionManager.js +6 -6
  6. package/lib/createPositionManager.js.map +1 -1
  7. package/lib/createSlideStyles.js +2 -2
  8. package/lib/createSlideStyles.js.map +1 -1
  9. package/lib/hooks/useSafeZoneArea/SafeZoneArea.js +9 -9
  10. package/lib/hooks/useSafeZoneArea/SafeZoneArea.js.map +1 -1
  11. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.js +2 -2
  12. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.js.map +1 -1
  13. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.raw.js +2 -2
  14. package/lib/hooks/useSafeZoneArea/useSafeZoneArea.js +4 -4
  15. package/lib/hooks/useSafeZoneArea/useSafeZoneArea.js.map +1 -1
  16. package/lib/index.js +10 -10
  17. package/lib/index.js.map +1 -1
  18. package/lib/middleware/coverTarget.js +1 -1
  19. package/lib/middleware/coverTarget.js.map +1 -1
  20. package/lib/middleware/flip.js +2 -2
  21. package/lib/middleware/flip.js.map +1 -1
  22. package/lib/middleware/index.js +7 -7
  23. package/lib/middleware/index.js.map +1 -1
  24. package/lib/middleware/intersecting.js +1 -1
  25. package/lib/middleware/maxSize.js +3 -3
  26. package/lib/middleware/maxSize.js.map +1 -1
  27. package/lib/middleware/offset.js +2 -2
  28. package/lib/middleware/offset.js.map +1 -1
  29. package/lib/middleware/shift.js +2 -2
  30. package/lib/middleware/shift.js.map +1 -1
  31. package/lib/usePositioning.js +6 -6
  32. package/lib/usePositioning.js.map +1 -1
  33. package/lib/usePositioningMouseTarget.js +2 -2
  34. package/lib/usePositioningMouseTarget.js.map +1 -1
  35. package/lib/usePositioningOptions.js +8 -8
  36. package/lib/usePositioningOptions.js.map +1 -1
  37. package/lib/usePositioningSlideDirection.js +3 -3
  38. package/lib/usePositioningSlideDirection.js.map +1 -1
  39. package/lib/utils/devtools.js +3 -3
  40. package/lib/utils/devtools.js.map +1 -1
  41. package/lib/utils/fromFloatingUIPlacement.js +1 -1
  42. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  43. package/lib/utils/getBoundary.js +1 -1
  44. package/lib/utils/getBoundary.js.map +1 -1
  45. package/lib/utils/getFloatingUIOffset.js +1 -1
  46. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  47. package/lib/utils/hasAutoFocusFilter.js +1 -1
  48. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  49. package/lib/utils/index.js +16 -16
  50. package/lib/utils/index.js.map +1 -1
  51. package/lib/utils/listScrollParents.js +1 -1
  52. package/lib/utils/listScrollParents.js.map +1 -1
  53. package/lib/utils/toggleScrollListener.js +2 -2
  54. package/lib/utils/toggleScrollListener.js.map +1 -1
  55. package/lib/utils/useCallbackRef.js +2 -2
  56. package/lib/utils/writeContainerupdates.js +1 -1
  57. package/lib/utils/writeContainerupdates.js.map +1 -1
  58. package/lib-commonjs/{createPositionManager.js → createPositionManager.cjs} +7 -7
  59. package/lib-commonjs/{createPositionManager.js.map → createPositionManager.cjs.map} +1 -1
  60. package/lib-commonjs/{createSlideStyles.js → createSlideStyles.cjs} +1 -1
  61. package/lib-commonjs/{createSlideStyles.js.map → createSlideStyles.cjs.map} +1 -1
  62. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.js → SafeZoneArea.cjs} +5 -5
  63. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.js.map → SafeZoneArea.cjs.map} +1 -1
  64. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.cjs.map +1 -0
  65. package/lib-commonjs/hooks/useSafeZoneArea/{useSafeZoneArea.js → useSafeZoneArea.cjs} +2 -2
  66. package/lib-commonjs/hooks/useSafeZoneArea/{useSafeZoneArea.js.map → useSafeZoneArea.cjs.map} +1 -1
  67. package/lib-commonjs/{index.js → index.cjs} +10 -10
  68. package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
  69. package/lib-commonjs/middleware/{coverTarget.js → coverTarget.cjs} +1 -1
  70. package/lib-commonjs/middleware/{coverTarget.js.map → coverTarget.cjs.map} +1 -1
  71. package/lib-commonjs/middleware/{flip.js → flip.cjs} +1 -1
  72. package/lib-commonjs/middleware/{flip.js.map → flip.cjs.map} +1 -1
  73. package/lib-commonjs/middleware/{index.js → index.cjs} +7 -7
  74. package/lib-commonjs/middleware/{index.js.map → index.cjs.map} +1 -1
  75. package/lib-commonjs/middleware/{maxSize.js → maxSize.cjs} +3 -3
  76. package/lib-commonjs/middleware/{maxSize.js.map → maxSize.cjs.map} +1 -1
  77. package/lib-commonjs/middleware/{offset.js → offset.cjs} +1 -1
  78. package/lib-commonjs/middleware/{offset.js.map → offset.cjs.map} +1 -1
  79. package/lib-commonjs/middleware/{shift.js → shift.cjs} +1 -1
  80. package/lib-commonjs/middleware/{shift.js.map → shift.cjs.map} +1 -1
  81. package/lib-commonjs/{usePositioning.js → usePositioning.cjs} +8 -8
  82. package/lib-commonjs/{usePositioning.js.map → usePositioning.cjs.map} +1 -1
  83. package/lib-commonjs/{usePositioningMouseTarget.js → usePositioningMouseTarget.cjs} +1 -1
  84. package/lib-commonjs/{usePositioningMouseTarget.js.map → usePositioningMouseTarget.cjs.map} +1 -1
  85. package/lib-commonjs/{usePositioningOptions.js → usePositioningOptions.cjs} +15 -15
  86. package/lib-commonjs/{usePositioningOptions.js.map → usePositioningOptions.cjs.map} +1 -1
  87. package/lib-commonjs/{usePositioningSlideDirection.js → usePositioningSlideDirection.cjs} +1 -1
  88. package/lib-commonjs/{usePositioningSlideDirection.js.map → usePositioningSlideDirection.cjs.map} +1 -1
  89. package/lib-commonjs/utils/{devtools.js → devtools.cjs} +2 -2
  90. package/lib-commonjs/utils/{devtools.js.map → devtools.cjs.map} +1 -1
  91. package/lib-commonjs/utils/{fromFloatingUIPlacement.js → fromFloatingUIPlacement.cjs} +1 -1
  92. package/lib-commonjs/utils/{fromFloatingUIPlacement.js.map → fromFloatingUIPlacement.cjs.map} +1 -1
  93. package/lib-commonjs/utils/{getBoundary.js → getBoundary.cjs} +1 -1
  94. package/lib-commonjs/utils/{getBoundary.js.map → getBoundary.cjs.map} +1 -1
  95. package/lib-commonjs/utils/{getFloatingUIOffset.js → getFloatingUIOffset.cjs} +1 -1
  96. package/lib-commonjs/utils/{getFloatingUIOffset.js.map → getFloatingUIOffset.cjs.map} +1 -1
  97. package/lib-commonjs/utils/{hasAutoFocusFilter.js → hasAutoFocusFilter.cjs} +1 -1
  98. package/lib-commonjs/utils/{hasAutoFocusFilter.js.map → hasAutoFocusFilter.cjs.map} +1 -1
  99. package/lib-commonjs/utils/{index.js → index.cjs} +16 -16
  100. package/lib-commonjs/utils/{index.js.map → index.cjs.map} +1 -1
  101. package/lib-commonjs/utils/{listScrollParents.js → listScrollParents.cjs} +1 -1
  102. package/lib-commonjs/utils/{listScrollParents.js.map → listScrollParents.cjs.map} +1 -1
  103. package/lib-commonjs/utils/{toggleScrollListener.js → toggleScrollListener.cjs} +1 -1
  104. package/lib-commonjs/utils/{toggleScrollListener.js.map → toggleScrollListener.cjs.map} +1 -1
  105. package/lib-commonjs/utils/{writeContainerupdates.js → writeContainerupdates.cjs} +1 -1
  106. package/lib-commonjs/utils/{writeContainerupdates.js.map → writeContainerupdates.cjs.map} +1 -1
  107. package/package.json +16 -10
  108. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.js.map +0 -1
  109. /package/lib-commonjs/{PositioningConfigurationContext.js → PositioningConfigurationContext.cjs} +0 -0
  110. /package/lib-commonjs/{PositioningConfigurationContext.js.map → PositioningConfigurationContext.cjs.map} +0 -0
  111. /package/lib-commonjs/{constants.js → constants.cjs} +0 -0
  112. /package/lib-commonjs/{constants.js.map → constants.cjs.map} +0 -0
  113. /package/lib-commonjs/{createArrowStyles.js → createArrowStyles.cjs} +0 -0
  114. /package/lib-commonjs/{createArrowStyles.js.map → createArrowStyles.cjs.map} +0 -0
  115. /package/lib-commonjs/{createVirtualElementFromClick.js → createVirtualElementFromClick.cjs} +0 -0
  116. /package/lib-commonjs/{createVirtualElementFromClick.js.map → createVirtualElementFromClick.cjs.map} +0 -0
  117. /package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.styles.js → SafeZoneArea.styles.cjs} +0 -0
  118. /package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.styles.raw.js → SafeZoneArea.styles.raw.cjs} +0 -0
  119. /package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.styles.raw.js.map → SafeZoneArea.styles.raw.cjs.map} +0 -0
  120. /package/lib-commonjs/hooks/useSafeZoneArea/{computeOutsideClipPath.js → computeOutsideClipPath.cjs} +0 -0
  121. /package/lib-commonjs/hooks/useSafeZoneArea/{computeOutsideClipPath.js.map → computeOutsideClipPath.cjs.map} +0 -0
  122. /package/lib-commonjs/hooks/useSafeZoneArea/{createSafeZoneAreaStateStore.js → createSafeZoneAreaStateStore.cjs} +0 -0
  123. /package/lib-commonjs/hooks/useSafeZoneArea/{createSafeZoneAreaStateStore.js.map → createSafeZoneAreaStateStore.cjs.map} +0 -0
  124. /package/lib-commonjs/hooks/useSafeZoneArea/{getMouseAnchor.js → getMouseAnchor.cjs} +0 -0
  125. /package/lib-commonjs/hooks/useSafeZoneArea/{getMouseAnchor.js.map → getMouseAnchor.cjs.map} +0 -0
  126. /package/lib-commonjs/hooks/useSafeZoneArea/{getRectCorners.js → getRectCorners.cjs} +0 -0
  127. /package/lib-commonjs/hooks/useSafeZoneArea/{getRectCorners.js.map → getRectCorners.cjs.map} +0 -0
  128. /package/lib-commonjs/hooks/useSafeZoneArea/{pointsToSvgPath.js → pointsToSvgPath.cjs} +0 -0
  129. /package/lib-commonjs/hooks/useSafeZoneArea/{pointsToSvgPath.js.map → pointsToSvgPath.cjs.map} +0 -0
  130. /package/lib-commonjs/hooks/useSafeZoneArea/{types.js → types.cjs} +0 -0
  131. /package/lib-commonjs/hooks/useSafeZoneArea/{types.js.map → types.cjs.map} +0 -0
  132. /package/lib-commonjs/middleware/{intersecting.js → intersecting.cjs} +0 -0
  133. /package/lib-commonjs/middleware/{intersecting.js.map → intersecting.cjs.map} +0 -0
  134. /package/lib-commonjs/middleware/{matchTargetSize.js → matchTargetSize.cjs} +0 -0
  135. /package/lib-commonjs/middleware/{matchTargetSize.js.map → matchTargetSize.cjs.map} +0 -0
  136. /package/lib-commonjs/{types.js → types.cjs} +0 -0
  137. /package/lib-commonjs/{types.js.map → types.cjs.map} +0 -0
  138. /package/lib-commonjs/utils/{createResizeObserver.js → createResizeObserver.cjs} +0 -0
  139. /package/lib-commonjs/utils/{createResizeObserver.js.map → createResizeObserver.cjs.map} +0 -0
  140. /package/lib-commonjs/utils/{debounce.js → debounce.cjs} +0 -0
  141. /package/lib-commonjs/utils/{debounce.js.map → debounce.cjs.map} +0 -0
  142. /package/lib-commonjs/utils/{getReactFiberFromNode.js → getReactFiberFromNode.cjs} +0 -0
  143. /package/lib-commonjs/utils/{getReactFiberFromNode.js.map → getReactFiberFromNode.cjs.map} +0 -0
  144. /package/lib-commonjs/utils/{getScrollParent.js → getScrollParent.cjs} +0 -0
  145. /package/lib-commonjs/utils/{getScrollParent.js.map → getScrollParent.cjs.map} +0 -0
  146. /package/lib-commonjs/utils/{mergeArrowOffset.js → mergeArrowOffset.cjs} +0 -0
  147. /package/lib-commonjs/utils/{mergeArrowOffset.js.map → mergeArrowOffset.cjs.map} +0 -0
  148. /package/lib-commonjs/utils/{normalizeAutoSize.js → normalizeAutoSize.cjs} +0 -0
  149. /package/lib-commonjs/utils/{normalizeAutoSize.js.map → normalizeAutoSize.cjs.map} +0 -0
  150. /package/lib-commonjs/utils/{parseFloatingUIPlacement.js → parseFloatingUIPlacement.cjs} +0 -0
  151. /package/lib-commonjs/utils/{parseFloatingUIPlacement.js.map → parseFloatingUIPlacement.cjs.map} +0 -0
  152. /package/lib-commonjs/utils/{resolvePositioningShorthand.js → resolvePositioningShorthand.cjs} +0 -0
  153. /package/lib-commonjs/utils/{resolvePositioningShorthand.js.map → resolvePositioningShorthand.cjs.map} +0 -0
  154. /package/lib-commonjs/utils/{toFloatingUIPadding.js → toFloatingUIPadding.cjs} +0 -0
  155. /package/lib-commonjs/utils/{toFloatingUIPadding.js.map → toFloatingUIPadding.cjs.map} +0 -0
  156. /package/lib-commonjs/utils/{toFloatingUIPlacement.js → toFloatingUIPlacement.cjs} +0 -0
  157. /package/lib-commonjs/utils/{toFloatingUIPlacement.js.map → toFloatingUIPlacement.cjs.map} +0 -0
  158. /package/lib-commonjs/utils/{useCallbackRef.js → useCallbackRef.cjs} +0 -0
  159. /package/lib-commonjs/utils/{useCallbackRef.js.map → useCallbackRef.cjs.map} +0 -0
  160. /package/lib-commonjs/utils/{writeArrowUpdates.js → writeArrowUpdates.cjs} +0 -0
  161. /package/lib-commonjs/utils/{writeArrowUpdates.js.map → writeArrowUpdates.cjs.map} +0 -0
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "getFloatingUIOffset", {
8
8
  return getFloatingUIOffset;
9
9
  }
10
10
  });
11
- const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement");
11
+ const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement.cjs");
12
12
  function getFloatingUIOffset(rawOffset) {
13
13
  if (!rawOffset) {
14
14
  return rawOffset;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareState } 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: MiddlewareState) => 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":["fromFloatingUIPlacement","getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","positionedRect","targetRect"],"mappings":";;;;+BAuCgBC;;;;;;yCArCwB,4BAA4B;AAqC7D,6BACLC,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,OAAGR,gDAAAA,EAAwBM;QACxD,OAAOJ,UAAU;YAAEO,gBAAgBL;YAAUM,YAAYL;YAAWE;YAAUC;QAAU;IAC1F;AACF"}
1
+ {"version":3,"sources":["../src/utils/getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareState } 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: MiddlewareState) => 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":["fromFloatingUIPlacement","getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","positionedRect","targetRect"],"mappings":";;;;+BAuCgBC;;;;;;yCArCwB,+BAA4B;AAqC7D,6BACLC,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,OAAGR,gDAAAA,EAAwBM;QACxD,OAAOJ,UAAU;YAAEO,gBAAgBL;YAAUM,YAAYL;YAAWE;YAAUC;QAAU;IAC1F;AACF"}
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "hasAutofocusFilter", {
11
11
  return hasAutofocusFilter;
12
12
  }
13
13
  });
14
- const _getReactFiberFromNode = require("./getReactFiberFromNode");
14
+ const _getReactFiberFromNode = require("./getReactFiberFromNode.cjs");
15
15
  /**
16
16
  * Detects if a passed HTML node has "autoFocus" prop on a React's fiber. Is needed as React handles autofocus behavior
17
17
  * in React DOM and will not pass "autoFocus" to an actual HTML.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/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): number {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["getReactFiberFromNode","hasAutofocusProp","node","isAutoFocusableElement","nodeName","pendingProps","autoFocus","hasAutofocusFilter","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;;;;;;;uCAEoC,0BAA0B;AAEhE;;;;;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;YACjBH;QAAT,OAAO,CAAC,CAAA,CAAA,CAACA,8BAAAA,4CAAAA,EAAsBE,KAAAA,MAAAA,QAAtBF,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAA6BK,YAAY,CAACC,SAAAA,AAAS;IAC9D;IAEA,OAAO;AACT;AAEO,SAASC,mBAAmBL,IAAU;IAC3C,OAAOD,iBAAiBC,QAAQM,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACnF"}
1
+ {"version":3,"sources":["../src/utils/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): number {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["getReactFiberFromNode","hasAutofocusProp","node","isAutoFocusableElement","nodeName","pendingProps","autoFocus","hasAutofocusFilter","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;;;;;;;uCAEoC,6BAA0B;AAEhE;;;;;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;YACjBH;QAAT,OAAO,CAAC,CAAA,CAAA,CAACA,8BAAAA,4CAAAA,EAAsBE,KAAAA,MAAAA,QAAtBF,4BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,wBAA6BK,YAAY,CAACC,SAAAA,AAAS;IAC9D;IAEA,OAAO;AACT;AAEO,SAASC,mBAAmBL,IAAU;IAC3C,OAAOD,iBAAiBC,QAAQM,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACnF"}
@@ -64,19 +64,19 @@ _export(exports, {
64
64
  return _writeContainerupdates.writeContainerUpdates;
65
65
  }
66
66
  });
67
- const _parseFloatingUIPlacement = require("./parseFloatingUIPlacement");
68
- const _getBoundary = require("./getBoundary");
69
- const _getReactFiberFromNode = require("./getReactFiberFromNode");
70
- const _getScrollParent = require("./getScrollParent");
71
- const _mergeArrowOffset = require("./mergeArrowOffset");
72
- const _toFloatingUIPadding = require("./toFloatingUIPadding");
73
- const _toFloatingUIPlacement = require("./toFloatingUIPlacement");
74
- const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement");
75
- const _resolvePositioningShorthand = require("./resolvePositioningShorthand");
76
- const _useCallbackRef = require("./useCallbackRef");
77
- const _debounce = require("./debounce");
78
- const _toggleScrollListener = require("./toggleScrollListener");
79
- const _hasAutoFocusFilter = require("./hasAutoFocusFilter");
80
- const _writeArrowUpdates = require("./writeArrowUpdates");
81
- const _writeContainerupdates = require("./writeContainerupdates");
82
- const _normalizeAutoSize = require("./normalizeAutoSize");
67
+ const _parseFloatingUIPlacement = require("./parseFloatingUIPlacement.cjs");
68
+ const _getBoundary = require("./getBoundary.cjs");
69
+ const _getReactFiberFromNode = require("./getReactFiberFromNode.cjs");
70
+ const _getScrollParent = require("./getScrollParent.cjs");
71
+ const _mergeArrowOffset = require("./mergeArrowOffset.cjs");
72
+ const _toFloatingUIPadding = require("./toFloatingUIPadding.cjs");
73
+ const _toFloatingUIPlacement = require("./toFloatingUIPlacement.cjs");
74
+ const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement.cjs");
75
+ const _resolvePositioningShorthand = require("./resolvePositioningShorthand.cjs");
76
+ const _useCallbackRef = require("./useCallbackRef.cjs");
77
+ const _debounce = require("./debounce.cjs");
78
+ const _toggleScrollListener = require("./toggleScrollListener.cjs");
79
+ const _hasAutoFocusFilter = require("./hasAutoFocusFilter.cjs");
80
+ const _writeArrowUpdates = require("./writeArrowUpdates.cjs");
81
+ const _writeContainerupdates = require("./writeContainerupdates.cjs");
82
+ const _normalizeAutoSize = require("./normalizeAutoSize.cjs");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\nexport { getBoundary } from './getBoundary';\nexport type { Fiber, HookType } from './getReactFiberFromNode';\nexport { getReactFiberFromNode } from './getReactFiberFromNode';\nexport { getParentNode, getScrollParent, hasScrollParent } from './getScrollParent';\nexport { mergeArrowOffset } from './mergeArrowOffset';\nexport { toFloatingUIPadding } from './toFloatingUIPadding';\nexport { toFloatingUIPlacement } from './toFloatingUIPlacement';\nexport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\nexport { resolvePositioningShorthand } from './resolvePositioningShorthand';\nexport { useCallbackRef } from './useCallbackRef';\nexport { debounce } from './debounce';\nexport { toggleScrollListener } from './toggleScrollListener';\nexport { hasAutofocusFilter } from './hasAutoFocusFilter';\nexport { writeArrowUpdates } from './writeArrowUpdates';\nexport { writeContainerUpdates } from './writeContainerupdates';\nexport { normalizeAutoSize } from './normalizeAutoSize';\n"],"names":["parseFloatingUIPlacement","getBoundary","getReactFiberFromNode","getParentNode","getScrollParent","hasScrollParent","mergeArrowOffset","toFloatingUIPadding","toFloatingUIPlacement","fromFloatingUIPlacement","resolvePositioningShorthand","useCallbackRef","debounce","toggleScrollListener","hasAutofocusFilter","writeArrowUpdates","writeContainerUpdates","normalizeAutoSize"],"mappings":";;;;;;;;;;;IAWSY;iCAAQ;;2BAHe;eAAvBH;;;eAPAR,wBAAW;;;eAGXE,8BAAa;;;eADbD,4CAAqB;;mBACS;eAAfE;;IASfU;qDAAkB;;;eATcT,gCAAe;;IAC/CC;iDAAgB;;;eAWhBW,oCAAiB;;;eAhBjBjB,kDAAwB;;+BASG;eAA3BU;;;eAHAH,wCAAmB;;;eACnBC,4CAAqB;;;eAKrBK,0CAAoB;;;eAFpBF,8BAAc;;;eAIdI,oCAAiB;;;eACjBC,4CAAqB;;;0CAfW,6BAA6B;6BAC1C,gBAAgB;uCAEN,0BAA0B;iCACA,oBAAoB;kCACnD,qBAAqB;qCAClB,wBAAwB;uCACtB,0BAA0B;yCACxB,4BAA4B;6CACxB,gCAAgC;gCAC7C,mBAAmB;0BACzB,aAAa;sCACD,yBAAyB;oCAC3B,uBAAuB;mCACxB,sBAAsB;uCAClB,0BAA0B;mCAC9B,sBAAsB"}
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\nexport { getBoundary } from './getBoundary';\nexport type { Fiber, HookType } from './getReactFiberFromNode';\nexport { getReactFiberFromNode } from './getReactFiberFromNode';\nexport { getParentNode, getScrollParent, hasScrollParent } from './getScrollParent';\nexport { mergeArrowOffset } from './mergeArrowOffset';\nexport { toFloatingUIPadding } from './toFloatingUIPadding';\nexport { toFloatingUIPlacement } from './toFloatingUIPlacement';\nexport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\nexport { resolvePositioningShorthand } from './resolvePositioningShorthand';\nexport { useCallbackRef } from './useCallbackRef';\nexport { debounce } from './debounce';\nexport { toggleScrollListener } from './toggleScrollListener';\nexport { hasAutofocusFilter } from './hasAutoFocusFilter';\nexport { writeArrowUpdates } from './writeArrowUpdates';\nexport { writeContainerUpdates } from './writeContainerupdates';\nexport { normalizeAutoSize } from './normalizeAutoSize';\n"],"names":["parseFloatingUIPlacement","getBoundary","getReactFiberFromNode","getParentNode","getScrollParent","hasScrollParent","mergeArrowOffset","toFloatingUIPadding","toFloatingUIPlacement","fromFloatingUIPlacement","resolvePositioningShorthand","useCallbackRef","debounce","toggleScrollListener","hasAutofocusFilter","writeArrowUpdates","writeContainerUpdates","normalizeAutoSize"],"mappings":";;;;;;;;;;;IAWSY;iCAAQ;;2BAHe;eAAvBH;;;eAPAR,wBAAW;;;eAGXE,8BAAa;;;eADbD,4CAAqB;;mBACS;eAAfE;;IASfU;qDAAkB;;;eATcT,gCAAe;;IAC/CC;iDAAgB;;;eAWhBW,oCAAiB;;;eAhBjBjB,kDAAwB;;+BASG;eAA3BU;;;eAHAH,wCAAmB;;;eACnBC,4CAAqB;;;eAKrBK,0CAAoB;;;eAFpBF,8BAAc;;;eAIdI,oCAAiB;;;eACjBC,4CAAqB;;;0CAfW,gCAA6B;6BAC1C,mBAAgB;uCAEN,6BAA0B;iCACA,uBAAoB;kCACnD,wBAAqB;qCAClB,2BAAwB;uCACtB,6BAA0B;yCACxB,+BAA4B;6CACxB,mCAAgC;gCAC7C,sBAAmB;0BACzB,gBAAa;sCACD,4BAAyB;oCAC3B,0BAAuB;mCACxB,yBAAsB;uCAClB,6BAA0B;mCAC9B,yBAAsB"}
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "listScrollParents", {
8
8
  return listScrollParents;
9
9
  }
10
10
  });
11
- const _getScrollParent = require("./getScrollParent");
11
+ const _getScrollParent = require("./getScrollParent.cjs");
12
12
  function listScrollParents(node) {
13
13
  const scrollParents = [];
14
14
  let cur = node;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/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":["getScrollParent","listScrollParents","node","scrollParents","cur","scrollParent","ownerDocument","body","push","nodeName","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAEgBC;;;;;;iCAFgB,oBAAoB;AAE7C,2BAA2BC,IAAiB;IACjD,MAAMC,gBAA+B,EAAE;IAEvC,IAAIC,MAA0BF;IAC9B,MAAOE,IAAK;QACV,MAAMC,mBAAeL,gCAAAA,EAAgBI;QAErC,IAAIF,KAAKI,aAAa,CAACC,IAAI,KAAKF,cAAc;YAC5CF,cAAcK,IAAI,CAACH;YACnB;QACF;QAEA,IAAIA,aAAaI,QAAQ,KAAK,UAAUJ,iBAAiBH,KAAKI,aAAa,CAACC,IAAI,EAAE;YAChF,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,KAAK,CACX;YAEJ;YACA;QACF;QAEAX,cAAcK,IAAI,CAACH;QACnBD,MAAMC;IACR;IAEA,OAAOF;AACT"}
1
+ {"version":3,"sources":["../src/utils/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":["getScrollParent","listScrollParents","node","scrollParents","cur","scrollParent","ownerDocument","body","push","nodeName","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAEgBC;;;;;;iCAFgB,uBAAoB;AAE7C,2BAA2BC,IAAiB;IACjD,MAAMC,gBAA+B,EAAE;IAEvC,IAAIC,MAA0BF;IAC9B,MAAOE,IAAK;QACV,MAAMC,mBAAeL,gCAAAA,EAAgBI;QAErC,IAAIF,KAAKI,aAAa,CAACC,IAAI,KAAKF,cAAc;YAC5CF,cAAcK,IAAI,CAACH;YACnB;QACF;QAEA,IAAIA,aAAaI,QAAQ,KAAK,UAAUJ,iBAAiBH,KAAKI,aAAa,CAACC,IAAI,EAAE;YAChF,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,KAAK,CACX;YAEJ;YACA;QACF;QAEAX,cAAcK,IAAI,CAACH;QACnBD,MAAMC;IACR;IAEA,OAAOF;AACT"}
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "toggleScrollListener", {
9
9
  }
10
10
  });
11
11
  const _reactutilities = require("@fluentui/react-utilities");
12
- const _getScrollParent = require("./getScrollParent");
12
+ const _getScrollParent = require("./getScrollParent.cjs");
13
13
  function toggleScrollListener(next, prev, handler) {
14
14
  if (next === prev) {
15
15
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/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): void {\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":["isHTMLElement","getScrollParent","toggleScrollListener","next","prev","handler","prevScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAUgBE;;;;;;gCAVc,4BAA4B;iCAE1B,oBAAoB;AAQ7C,8BACLC,IAAoD,EACpDC,IAAoD,EACpDC,OAAsB;IAEtB,IAAIF,SAASC,MAAM;QACjB;IACF;IAEA,QAAIJ,6BAAAA,EAAcI,OAAO;QACvB,MAAME,uBAAmBL,gCAAAA,EAAgBG;QACzCE,iBAAiBC,mBAAmB,CAAC,UAAUF;IACjD;IACA,QAAIL,6BAAAA,EAAcG,OAAO;QACvB,MAAMK,mBAAeP,gCAAAA,EAAgBE;QACrCK,aAAaC,gBAAgB,CAAC,UAAUJ;IAC1C;AACF"}
1
+ {"version":3,"sources":["../src/utils/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): void {\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":["isHTMLElement","getScrollParent","toggleScrollListener","next","prev","handler","prevScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAUgBE;;;;;;gCAVc,4BAA4B;iCAE1B,uBAAoB;AAQ7C,8BACLC,IAAoD,EACpDC,IAAoD,EACpDC,OAAsB;IAEtB,IAAIF,SAASC,MAAM;QACjB;IACF;IAEA,QAAIJ,6BAAAA,EAAcI,OAAO;QACvB,MAAME,uBAAmBL,gCAAAA,EAAgBG;QACzCE,iBAAiBC,mBAAmB,CAAC,UAAUF;IACjD;IACA,QAAIL,6BAAAA,EAAcG,OAAO;QACvB,MAAMK,mBAAeP,gCAAAA,EAAgBE;QACrCK,aAAaC,gBAAgB,CAAC,UAAUJ;IAC1C;AACF"}
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "writeContainerUpdates", {
8
8
  return writeContainerUpdates;
9
9
  }
10
10
  });
11
- const _constants = require("../constants");
11
+ const _constants = require("../constants.cjs");
12
12
  function writeContainerUpdates(options) {
13
13
  var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;
14
14
  const { container, placement, middlewareData, strategy, lowPPI, coordinates, useTransform = true } = options;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@floating-ui/dom';\nimport {\n DATA_POSITIONING_ESCAPED,\n DATA_POSITIONING_HIDDEN,\n DATA_POSITIONING_INTERSECTING,\n DATA_POSITIONING_PLACEMENT,\n} from '../constants';\n\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options: {\n container: HTMLElement | null;\n placement: Placement;\n middlewareData: MiddlewareData;\n /**\n * Layer acceleration can disable subpixel rendering which causes slightly\n * blurry text on low PPI displays, so we want to use 2D transforms\n * instead\n */\n lowPPI: boolean;\n strategy: Strategy;\n coordinates: Coords;\n useTransform?: boolean;\n}): void {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates, useTransform = true } = options;\n if (!container) {\n return;\n }\n container.setAttribute(DATA_POSITIONING_PLACEMENT, placement);\n container.removeAttribute(DATA_POSITIONING_INTERSECTING);\n if (middlewareData.intersectionObserver.intersecting) {\n container.setAttribute(DATA_POSITIONING_INTERSECTING, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if (middlewareData.hide?.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if (middlewareData.hide?.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\n\n // Round so that the coordinates land on device pixels.\n // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like\n // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.\n // See https://github.com/microsoft/fluentui/issues/26764 for more info.\n const devicePixelRatio = container.ownerDocument.defaultView?.devicePixelRatio || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n\n Object.assign(container.style, {\n position: strategy,\n });\n\n if (useTransform) {\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n });\n return;\n }\n\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n}\n"],"names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","middlewareData","container","placement","strategy","lowPPI","coordinates","useTransform","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAWgBI;;;;;;2BALT,eAAe;AAKf,+BAA+BC,OAarC;QAYKC,sBAKAA,uBAQqBC;IAxBzB,MAAM,EAAEA,SAAS,EAAEC,SAAS,EAAEF,cAAc,EAAEG,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,eAAe,IAAI,EAAE,GAAGP;IACrG,IAAI,CAACE,WAAW;QACd;IACF;IACAA,UAAUM,YAAY,CAACV,qCAAAA,EAA4BK;IACnDD,UAAUO,eAAe,CAACZ,wCAAAA;IAC1B,IAAII,eAAeS,oBAAoB,CAACC,YAAY,EAAE;QACpDT,UAAUM,YAAY,CAACX,wCAAAA,EAA+B;IACxD;IAEAK,UAAUO,eAAe,CAACd,mCAAAA;IAC1B,IAAA,CAAIM,uBAAAA,eAAeW,IAAAA,AAAI,MAAA,QAAnBX,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAqBY,OAAO,EAAE;QAChCX,UAAUM,YAAY,CAACb,mCAAAA,EAA0B;IACnD;IAEAO,UAAUO,eAAe,CAACb,kCAAAA;IAC1B,IAAA,CAAIK,wBAAAA,eAAeW,IAAAA,AAAI,MAAA,QAAnBX,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAqBa,eAAe,EAAE;QACxCZ,UAAUM,YAAY,CAACZ,kCAAAA,EAAyB;IAClD;IAEA,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAMmB,mBAAmBb,CAAAA,CAAAA,uCAAAA,UAAUc,aAAa,CAACC,WAAAA,AAAW,MAAA,QAAnCf,yCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qCAAqCa,gBAAAA,AAAgB,KAAI;IAClF,MAAMG,IAAIC,KAAKC,KAAK,CAACd,YAAYY,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAACd,YAAYe,CAAC,GAAGN,oBAAoBA;IAEzDO,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;QAC7BC,UAAUrB;IACZ;IAEA,IAAIG,cAAc;QAChBe,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;YAC7BE,WAAWrB,SAAS,CAAC,UAAU,EAAEa,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACpF;QACA;IACF;IAEAC,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;QAC7BG,MAAM,GAAGT,EAAE,EAAE,CAAC;QACdU,KAAK,GAAGP,EAAE,EAAE,CAAC;IACf;AACF"}
1
+ {"version":3,"sources":["../src/utils/writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@floating-ui/dom';\nimport {\n DATA_POSITIONING_ESCAPED,\n DATA_POSITIONING_HIDDEN,\n DATA_POSITIONING_INTERSECTING,\n DATA_POSITIONING_PLACEMENT,\n} from '../constants';\n\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options: {\n container: HTMLElement | null;\n placement: Placement;\n middlewareData: MiddlewareData;\n /**\n * Layer acceleration can disable subpixel rendering which causes slightly\n * blurry text on low PPI displays, so we want to use 2D transforms\n * instead\n */\n lowPPI: boolean;\n strategy: Strategy;\n coordinates: Coords;\n useTransform?: boolean;\n}): void {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates, useTransform = true } = options;\n if (!container) {\n return;\n }\n container.setAttribute(DATA_POSITIONING_PLACEMENT, placement);\n container.removeAttribute(DATA_POSITIONING_INTERSECTING);\n if (middlewareData.intersectionObserver.intersecting) {\n container.setAttribute(DATA_POSITIONING_INTERSECTING, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if (middlewareData.hide?.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if (middlewareData.hide?.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\n\n // Round so that the coordinates land on device pixels.\n // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like\n // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.\n // See https://github.com/microsoft/fluentui/issues/26764 for more info.\n const devicePixelRatio = container.ownerDocument.defaultView?.devicePixelRatio || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n\n Object.assign(container.style, {\n position: strategy,\n });\n\n if (useTransform) {\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n });\n return;\n }\n\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n}\n"],"names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","middlewareData","container","placement","strategy","lowPPI","coordinates","useTransform","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAWgBI;;;;;;2BALT,kBAAe;AAKf,+BAA+BC,OAarC;QAYKC,sBAKAA,uBAQqBC;IAxBzB,MAAM,EAAEA,SAAS,EAAEC,SAAS,EAAEF,cAAc,EAAEG,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,eAAe,IAAI,EAAE,GAAGP;IACrG,IAAI,CAACE,WAAW;QACd;IACF;IACAA,UAAUM,YAAY,CAACV,qCAAAA,EAA4BK;IACnDD,UAAUO,eAAe,CAACZ,wCAAAA;IAC1B,IAAII,eAAeS,oBAAoB,CAACC,YAAY,EAAE;QACpDT,UAAUM,YAAY,CAACX,wCAAAA,EAA+B;IACxD;IAEAK,UAAUO,eAAe,CAACd,mCAAAA;IAC1B,IAAA,CAAIM,uBAAAA,eAAeW,IAAAA,AAAI,MAAA,QAAnBX,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAqBY,OAAO,EAAE;QAChCX,UAAUM,YAAY,CAACb,mCAAAA,EAA0B;IACnD;IAEAO,UAAUO,eAAe,CAACb,kCAAAA;IAC1B,IAAA,CAAIK,wBAAAA,eAAeW,IAAAA,AAAI,MAAA,QAAnBX,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAqBa,eAAe,EAAE;QACxCZ,UAAUM,YAAY,CAACZ,kCAAAA,EAAyB;IAClD;IAEA,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAMmB,mBAAmBb,CAAAA,CAAAA,uCAAAA,UAAUc,aAAa,CAACC,WAAAA,AAAW,MAAA,QAAnCf,yCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qCAAqCa,gBAAAA,AAAgB,KAAI;IAClF,MAAMG,IAAIC,KAAKC,KAAK,CAACd,YAAYY,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAACd,YAAYe,CAAC,GAAGN,oBAAoBA;IAEzDO,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;QAC7BC,UAAUrB;IACZ;IAEA,IAAIG,cAAc;QAChBe,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;YAC7BE,WAAWrB,SAAS,CAAC,UAAU,EAAEa,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACpF;QACA;IACF;IAEAC,OAAOC,MAAM,CAACrB,UAAUsB,KAAK,EAAE;QAC7BG,MAAM,GAAGT,EAAE,EAAE,CAAC;QACdU,KAAK,GAAGP,EAAE,EAAE,CAAC;IACf;AACF"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.23.0",
3
+ "version": "9.23.1",
4
4
  "description": "A react wrapper around Popper.js for Fluent UI",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
@@ -14,9 +14,9 @@
14
14
  "dependencies": {
15
15
  "@floating-ui/devtools": "^0.2.3",
16
16
  "@floating-ui/dom": "^1.6.12",
17
- "@fluentui/react-shared-contexts": "^9.26.2",
18
- "@fluentui/react-theme": "^9.2.1",
19
- "@fluentui/react-utilities": "^9.26.5",
17
+ "@fluentui/react-shared-contexts": "^9.26.3",
18
+ "@fluentui/react-theme": "^9.2.2",
19
+ "@fluentui/react-utilities": "^9.26.6",
20
20
  "@griffel/react": "^1.5.32",
21
21
  "@swc/helpers": "^0.5.1",
22
22
  "use-sync-external-store": "^1.2.0"
@@ -34,17 +34,23 @@
34
34
  },
35
35
  "exports": {
36
36
  ".": {
37
- "types": "./dist/index.d.ts",
38
- "node": "./lib-commonjs/index.js",
39
- "import": "./lib/index.js",
40
- "require": "./lib-commonjs/index.js"
37
+ "import": {
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/index.d.cts",
43
+ "default": "./lib-commonjs/index.cjs"
44
+ }
41
45
  },
42
46
  "./package.json": "./package.json"
43
47
  },
44
48
  "files": [
45
49
  "*.md",
46
50
  "dist/*.d.ts",
51
+ "dist/*.d.cts",
47
52
  "lib",
48
53
  "lib-commonjs"
49
- ]
54
+ ],
55
+ "type": "module"
50
56
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["SafeZoneArea.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const useStyles = makeStyles({\n wrapper: {\n display: 'none',\n height: 0,\n width: 0,\n pointerEvents: 'none'\n },\n wrapperActive: {\n display: 'block'\n },\n svg: {\n fill: 'transparent',\n pointerEvents: 'none',\n position: 'fixed',\n top: 0,\n left: 0\n },\n triangle: {\n pointerEvents: 'auto'\n },\n triangleDebug: {\n cursor: 'crosshair',\n fill: `color-mix(in srgb, ${tokens.colorPaletteGreenBackground3} 20%, transparent)`\n },\n rectDebug: {\n fill: `color-mix(in srgb, ${tokens.colorPaletteRedBackground3} 20%, transparent)`\n }\n});\n"],"names":["__styles","tokens","useStyles","wrapper","mc9l5x","Bqenvij","a9b677","Bkecrkj","wrapperActive","svg","Bkfmm31","qhf8xq","Bhzewxz","oyh7mz","triangle","triangleDebug","Bceei9c","rectDebug","d"],"mappings":"AAAA,YAAY;;;;;+BAGCE,SAAS;;;;;;uBAFK,gBAAgB;AAEpC,kBAAe,WAAA,OAAGF,eAAA,EAAA;IAAAG,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,aAAA,EAAA;QAAAJ,MAAA,EAAA;IAAA;IAAAK,GAAA,EAAA;QAAAC,OAAA,EAAA;QAAAH,OAAA,EAAA;QAAAI,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,QAAA,EAAA;QAAAP,OAAA,EAAA;IAAA;IAAAQ,aAAA,EAAA;QAAAC,OAAA,EAAA;QAAAN,OAAA,EAAA;IAAA;IAAAO,SAAA,EAAA;QAAAP,OAAA,EAAA;IAAA;AAAA,GAAA;IAAAQ,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CA2BxB,CAAC"}
File without changes
File without changes
File without changes