@fluentui/react-positioning 0.0.0-nightly-20230529-0417.1 → 0.0.0-nightly-20230531-0416.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 (131) hide show
  1. package/CHANGELOG.json +9 -9
  2. package/CHANGELOG.md +7 -7
  3. package/lib/constants.js +0 -1
  4. package/lib/constants.js.map +1 -1
  5. package/lib/createArrowStyles.js +47 -55
  6. package/lib/createArrowStyles.js.map +1 -1
  7. package/lib/createPositionManager.js +95 -110
  8. package/lib/createPositionManager.js.map +1 -1
  9. package/lib/createVirtualElementFromClick.js +18 -19
  10. package/lib/createVirtualElementFromClick.js.map +1 -1
  11. package/lib/index.js +0 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/middleware/coverTarget.js +26 -32
  14. package/lib/middleware/coverTarget.js.map +1 -1
  15. package/lib/middleware/flip.js +22 -32
  16. package/lib/middleware/flip.js.map +1 -1
  17. package/lib/middleware/index.js +0 -1
  18. package/lib/middleware/index.js.map +1 -1
  19. package/lib/middleware/intersecting.js +16 -17
  20. package/lib/middleware/intersecting.js.map +1 -1
  21. package/lib/middleware/maxSize.js +25 -34
  22. package/lib/middleware/maxSize.js.map +1 -1
  23. package/lib/middleware/offset.js +3 -5
  24. package/lib/middleware/offset.js.map +1 -1
  25. package/lib/middleware/shift.js +21 -30
  26. package/lib/middleware/shift.js.map +1 -1
  27. package/lib/types.js +0 -1
  28. package/lib/types.js.map +1 -1
  29. package/lib/usePositioning.js +188 -156
  30. package/lib/usePositioning.js.map +1 -1
  31. package/lib/usePositioningMouseTarget.js +24 -23
  32. package/lib/usePositioningMouseTarget.js.map +1 -1
  33. package/lib/utils/debounce.js +13 -14
  34. package/lib/utils/debounce.js.map +1 -1
  35. package/lib/utils/fromFloatingUIPlacement.js +23 -28
  36. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  37. package/lib/utils/getBoundary.js +14 -16
  38. package/lib/utils/getBoundary.js.map +1 -1
  39. package/lib/utils/getFloatingUIOffset.js +16 -27
  40. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  41. package/lib/utils/getReactFiberFromNode.js +36 -37
  42. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  43. package/lib/utils/getScrollParent.js +35 -42
  44. package/lib/utils/getScrollParent.js.map +1 -1
  45. package/lib/utils/hasAutoFocusFilter.js +9 -11
  46. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  47. package/lib/utils/index.js +0 -1
  48. package/lib/utils/index.js.map +1 -1
  49. package/lib/utils/mergeArrowOffset.js +24 -25
  50. package/lib/utils/mergeArrowOffset.js.map +1 -1
  51. package/lib/utils/parseFloatingUIPlacement.js +6 -7
  52. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  53. package/lib/utils/resolvePositioningShorthand.js +55 -56
  54. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  55. package/lib/utils/toFloatingUIPadding.js +16 -21
  56. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  57. package/lib/utils/toFloatingUIPlacement.js +25 -27
  58. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  59. package/lib/utils/toggleScrollListener.js +12 -14
  60. package/lib/utils/toggleScrollListener.js.map +1 -1
  61. package/lib/utils/useCallbackRef.js +30 -32
  62. package/lib/utils/useCallbackRef.js.map +1 -1
  63. package/lib/utils/writeArrowUpdates.js +10 -17
  64. package/lib/utils/writeArrowUpdates.js.map +1 -1
  65. package/lib/utils/writeContainerupdates.js +37 -47
  66. package/lib/utils/writeContainerupdates.js.map +1 -1
  67. package/lib-commonjs/constants.js +1 -3
  68. package/lib-commonjs/constants.js.map +1 -1
  69. package/lib-commonjs/createArrowStyles.js +1 -3
  70. package/lib-commonjs/createArrowStyles.js.map +1 -1
  71. package/lib-commonjs/createPositionManager.js +1 -3
  72. package/lib-commonjs/createPositionManager.js.map +1 -1
  73. package/lib-commonjs/createVirtualElementFromClick.js +1 -3
  74. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  75. package/lib-commonjs/index.js +0 -3
  76. package/lib-commonjs/index.js.map +1 -1
  77. package/lib-commonjs/middleware/coverTarget.js +1 -3
  78. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  79. package/lib-commonjs/middleware/flip.js +1 -3
  80. package/lib-commonjs/middleware/flip.js.map +1 -1
  81. package/lib-commonjs/middleware/index.js +0 -3
  82. package/lib-commonjs/middleware/index.js.map +1 -1
  83. package/lib-commonjs/middleware/intersecting.js +1 -3
  84. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  85. package/lib-commonjs/middleware/maxSize.js +1 -3
  86. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  87. package/lib-commonjs/middleware/offset.js +1 -3
  88. package/lib-commonjs/middleware/offset.js.map +1 -1
  89. package/lib-commonjs/middleware/shift.js +1 -3
  90. package/lib-commonjs/middleware/shift.js.map +1 -1
  91. package/lib-commonjs/types.js +0 -3
  92. package/lib-commonjs/types.js.map +1 -1
  93. package/lib-commonjs/usePositioning.js +1 -3
  94. package/lib-commonjs/usePositioning.js.map +1 -1
  95. package/lib-commonjs/usePositioningMouseTarget.js +1 -3
  96. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  97. package/lib-commonjs/utils/debounce.js +1 -3
  98. package/lib-commonjs/utils/debounce.js.map +1 -1
  99. package/lib-commonjs/utils/fromFloatingUIPlacement.js +1 -3
  100. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  101. package/lib-commonjs/utils/getBoundary.js +1 -3
  102. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  103. package/lib-commonjs/utils/getFloatingUIOffset.js +1 -3
  104. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  105. package/lib-commonjs/utils/getReactFiberFromNode.js +1 -3
  106. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  107. package/lib-commonjs/utils/getScrollParent.js +1 -3
  108. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  109. package/lib-commonjs/utils/hasAutoFocusFilter.js +1 -3
  110. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  111. package/lib-commonjs/utils/index.js +0 -3
  112. package/lib-commonjs/utils/index.js.map +1 -1
  113. package/lib-commonjs/utils/mergeArrowOffset.js +1 -3
  114. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  115. package/lib-commonjs/utils/parseFloatingUIPlacement.js +1 -3
  116. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  117. package/lib-commonjs/utils/resolvePositioningShorthand.js +1 -3
  118. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  119. package/lib-commonjs/utils/toFloatingUIPadding.js +1 -3
  120. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  121. package/lib-commonjs/utils/toFloatingUIPlacement.js +1 -3
  122. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  123. package/lib-commonjs/utils/toggleScrollListener.js +1 -3
  124. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  125. package/lib-commonjs/utils/useCallbackRef.js +1 -3
  126. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  127. package/lib-commonjs/utils/writeArrowUpdates.js +1 -3
  128. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  129. package/lib-commonjs/utils/writeContainerupdates.js +1 -3
  130. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  131. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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 */\nfunction 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//# sourceMappingURL=hasAutoFocusFilter.js.map"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_getReactFiberFromNode","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAiBcA;;aAAAA;;uCAhBsB;AACtC;;;;;CAKC,GACD,SAASC,iBAAiBC,IAAI,EAAE;IAC9B,gJAAgJ;IAChJ,MAAMC,yBAAyBD,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK,WAAWF,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK;IAC1I,IAAID,wBAAwB;QAC1B,IAAIE;QACJ,OAAO,CAAC,CAAE,CAAA,AAACA,CAAAA,0BAAyBC,IAAAA,4CAAqB,EAACJ,KAAI,MAAO,IAAI,IAAIG,4BAA2B,KAAK,IAAI,KAAK,IAAIA,wBAAuBE,YAAY,CAACC,SAAS,AAAD;IACxK,CAAC;IACD,OAAO,KAAK;AACd;AACO,SAASR,mBAAmBE,IAAI,EAAE;IACvC,OAAOD,iBAAiBC,QAAQO,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACnF,EACA,8CAA8C"}
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;;aAAAA;;uCAfsB;AACtC;;;;;CAKC,GAAG,SAASC,iBAAiBC,IAAI,EAAE;IAChC,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,IAAI,IAAIG,4BAA2B,KAAK,IAAI,KAAK,IAAIA,wBAAuBE,YAAY,CAACC,SAAS,AAAD;IAC1K,CAAC;IACD,OAAO,KAAK;AAChB;AACO,SAASR,mBAAmBE,IAAI,EAAE;IACrC,OAAOD,iBAAiBC,QAAQO,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACrF"}
@@ -18,6 +18,3 @@ _exportStar(require("./toggleScrollListener"), exports);
18
18
  _exportStar(require("./hasAutoFocusFilter"), exports);
19
19
  _exportStar(require("./writeArrowUpdates"), exports);
20
20
  _exportStar(require("./writeContainerupdates"), exports);
21
- //# sourceMappingURL=index.js.map
22
-
23
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
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';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
@@ -42,6 +42,4 @@ const addArrowOffset = (offset, arrowHeight)=>{
42
42
  ...offset,
43
43
  mainAxis: ((_offset_mainAxis = offset.mainAxis) !== null && _offset_mainAxis !== void 0 ? _offset_mainAxis : 0) + arrowHeight
44
44
  };
45
- }; //# sourceMappingURL=mergeArrowOffset.js.map
46
-
47
- //# sourceMappingURL=mergeArrowOffset.js.map
45
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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//# sourceMappingURL=mergeArrowOffset.js.map"],"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","_offset_mainAxis"],"mappings":"AAAA;;;;;;;;CAQC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,iBAAiBC,UAAU,EAAEC,WAAW,EAAE;IAC3D,IAAI,OAAOD,eAAe,UAAU;QAClC,OAAOE,eAAeF,YAAYC;IACpC,CAAC;IACD,IAAI,OAAOD,eAAe,YAAYA,eAAe,IAAI,EAAE;QACzD,OAAOE,eAAeF,YAAYC;IACpC,CAAC;IACD,IAAI,OAAOD,eAAe,YAAY;QACpC,OAAOG,CAAAA,eAAgB;YACrB,MAAMC,SAASJ,WAAWG;YAC1B,OAAOD,eAAeE,QAAQH;QAChC;IACF,CAAC;IACD,OAAO;QACLI,UAAUJ;IACZ;AACF;AACA,MAAMC,iBAAiB,CAACE,QAAQH,cAAgB;IAC9C,IAAI,OAAOG,WAAW,UAAU;QAC9B,OAAO;YACLC,UAAUD,SAASH;QACrB;IACF,CAAC;IACD,IAAIK;IACJ,OAAO;QACL,GAAGF,MAAM;QACTC,UAAU,AAAC,CAAA,AAACC,CAAAA,mBAAmBF,OAAOC,QAAQ,AAAD,MAAO,IAAI,IAAIC,qBAAqB,KAAK,IAAIA,mBAAmB,CAAC,AAAD,IAAKL;IACpH;AACF,GACA,4CAA4C"}
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;;aAAAA;;AAAT,SAASA,iBAAiBC,UAAU,EAAEC,WAAW,EAAE;IAC1D,IAAI,OAAOD,eAAe,UAAU;QAChC,OAAOE,eAAeF,YAAYC;IACtC,CAAC;IACD,IAAI,OAAOD,eAAe,YAAYA,eAAe,IAAI,EAAE;QACvD,OAAOE,eAAeF,YAAYC;IACtC,CAAC;IACD,IAAI,OAAOD,eAAe,YAAY;QAClC,OAAO,CAACG,eAAe;YACnB,MAAMC,SAASJ,WAAWG;YAC1B,OAAOD,eAAeE,QAAQH;QAClC;IACJ,CAAC;IACD,OAAO;QACHI,UAAUJ;IACd;AACJ;AACA,MAAMC,iBAAiB,CAACE,QAAQH,cAAc;IAC1C,IAAI,OAAOG,WAAW,UAAU;QAC5B,OAAO;YACHC,UAAUD,SAASH;QACvB;IACJ,CAAC;IACD,IAAIK;IACJ,OAAO;QACH,GAAGF,MAAM;QACTC,UAAU,AAAC,CAAA,AAACC,CAAAA,mBAAmBF,OAAOC,QAAQ,AAAD,MAAO,IAAI,IAAIC,qBAAqB,KAAK,IAAIA,mBAAmB,CAAC,AAAD,IAAKL;IACtH;AACJ"}
@@ -17,6 +17,4 @@ function parseFloatingUIPlacement(placement) {
17
17
  side: tokens[0],
18
18
  alignment: tokens[1]
19
19
  };
20
- } //# sourceMappingURL=parseFloatingUIPlacement.js.map
21
-
22
- //# sourceMappingURL=parseFloatingUIPlacement.js.map
20
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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//# sourceMappingURL=parseFloatingUIPlacement.js.map"],"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment"],"mappings":"AAAA;;;;;CAKC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,yBAAyBC,SAAS,EAAE;IACrD,MAAMC,SAASD,UAAUE,KAAK,CAAC;IAC/B,OAAO;QACLC,MAAMF,MAAM,CAAC,EAAE;QACfG,WAAWH,MAAM,CAAC,EAAE;IACtB;AACF,EACA,oDAAoD"}
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;;aAAAA;;AAAT,SAASA,yBAAyBC,SAAS,EAAE;IACpD,MAAMC,SAASD,UAAUE,KAAK,CAAC;IAC/B,OAAO;QACHC,MAAMF,MAAM,CAAC,EAAE;QACfG,WAAWH,MAAM,CAAC,EAAE;IACxB;AACJ"}
@@ -65,6 +65,4 @@ function resolvePositioningShorthand(shorthand) {
65
65
  return shorthandLookup[shorthand];
66
66
  }
67
67
  return shorthand;
68
- } //# sourceMappingURL=resolvePositioningShorthand.js.map
69
-
70
- //# sourceMappingURL=resolvePositioningShorthand.js.map
68
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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//# sourceMappingURL=resolvePositioningShorthand.js.map"],"names":["resolvePositioningShorthand","shorthandLookup","above","position","align","below","before","after","shorthand","undefined"],"mappings":"AAAA,uDAAuD;;;;;+BAmDvCA;;aAAAA;;AAlDhB,MAAMC,kBAAkB;IACtBC,OAAO;QACLC,UAAU;QACVC,OAAO;IACT;IACA,eAAe;QACbD,UAAU;QACVC,OAAO;IACT;IACA,aAAa;QACXD,UAAU;QACVC,OAAO;IACT;IACAC,OAAO;QACLF,UAAU;QACVC,OAAO;IACT;IACA,eAAe;QACbD,UAAU;QACVC,OAAO;IACT;IACA,aAAa;QACXD,UAAU;QACVC,OAAO;IACT;IACAE,QAAQ;QACNH,UAAU;QACVC,OAAO;IACT;IACA,cAAc;QACZD,UAAU;QACVC,OAAO;IACT;IACA,iBAAiB;QACfD,UAAU;QACVC,OAAO;IACT;IACAG,OAAO;QACLJ,UAAU;QACVC,OAAO;IACT;IACA,aAAa;QACXD,UAAU;QACVC,OAAO;IACT;IACA,gBAAgB;QACdD,UAAU;QACVC,OAAO;IACT;AACF;AACO,SAASJ,4BAA4BQ,SAAS,EAAE;IACrD,IAAIA,cAAcC,aAAaD,cAAc,IAAI,EAAE;QACjD,OAAO,CAAC;IACV,CAAC;IACD,IAAI,OAAOA,cAAc,UAAU;QACjC,OAAOP,eAAe,CAACO,UAAU;IACnC,CAAC;IACD,OAAOA;AACT,EACA,uDAAuD"}
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;;aAAAA;;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,EAAE;IACnD,IAAIA,cAAcC,aAAaD,cAAc,IAAI,EAAE;QAC/C,OAAO,CAAC;IACZ,CAAC;IACD,IAAI,OAAOA,cAAc,UAAU;QAC/B,OAAOP,eAAe,CAACO,UAAU;IACrC,CAAC;IACD,OAAOA;AACX"}
@@ -23,6 +23,4 @@ function toFloatingUIPadding(padding, isRtl) {
23
23
  paddingObject.right = padding[right];
24
24
  }
25
25
  return paddingObject;
26
- } //# sourceMappingURL=toFloatingUIPadding.js.map
27
-
28
- //# sourceMappingURL=toFloatingUIPadding.js.map
26
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/toFloatingUIPadding.js"],"sourcesContent":["export function toFloatingUIPadding(padding, isRtl) {\n if (typeof padding === 'number') {\n return padding;\n }\n const {\n start,\n end,\n ...verticalPadding\n } = 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//# sourceMappingURL=toFloatingUIPadding.js.map"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":";;;;+BAAgBA;;aAAAA;;AAAT,SAASA,oBAAoBC,OAAO,EAAEC,KAAK,EAAE;IAClD,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT,CAAC;IACD,MAAM,EACJE,MAAK,EACLC,IAAG,EACH,GAAGC,iBACJ,GAAGJ;IACJ,MAAMK,gBAAgBD;IACtB,MAAME,OAAOL,QAAQ,QAAQ,OAAO;IACpC,MAAMM,QAAQN,QAAQ,UAAU,KAAK;IACrC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC,CAAC;IACD,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC,CAAC;IACD,OAAOF;AACT,EACA,+CAA+C"}
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;;aAAAA;;AAAT,SAASA,oBAAoBC,OAAO,EAAEC,KAAK,EAAE;IAChD,IAAI,OAAOD,YAAY,UAAU;QAC7B,OAAOA;IACX,CAAC;IACD,MAAM,EAAEE,MAAK,EAAGC,IAAG,EAAG,GAAGC,iBAAiB,GAAGJ;IAC7C,MAAMK,gBAAgBD;IACtB,MAAME,OAAOL,QAAQ,QAAQ,OAAO;IACpC,MAAMM,QAAQN,QAAQ,UAAU,KAAK;IACrC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACfD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACtC,CAAC;IACD,IAAIN,OAAO,CAACO,MAAM,EAAE;QAChBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACxC,CAAC;IACD,OAAOF;AACX"}
@@ -34,6 +34,4 @@ const toFloatingUIPlacement = (align, position, rtl)=>{
34
34
  return `${computedPosition}-${computedAlignment}`;
35
35
  }
36
36
  return computedPosition;
37
- }; //# sourceMappingURL=toFloatingUIPlacement.js.map
38
-
39
- //# sourceMappingURL=toFloatingUIPlacement.js.map
37
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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 */\nexport 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//# sourceMappingURL=toFloatingUIPlacement.js.map"],"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":";;;;+BAwBaA;;aAAAA;;AAxBb,MAAMC,iBAAiBC,CAAAA,MAAQ,CAAA;QAC7BC,OAAO;QACPC,OAAO;QACPC,QAAQH,MAAM,UAAU,MAAM;QAC9BI,OAAOJ,MAAM,SAAS,OAAO;IAC/B,CAAA;AACA,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMK,kBAAkB,IAAO,CAAA;QAC7BC,OAAO;QACPC,KAAK;QACLC,KAAK;QACLC,QAAQ;QACRC,QAAQC;IACV,CAAA;AACA,MAAMC,sBAAsB,CAACC,GAAGC,IAAM;IACpC,MAAMC,uBAAuBF,MAAM,WAAWA,MAAM;IACpD,MAAMG,oBAAoBF,MAAM,SAASA,MAAM;IAC/C,OAAOC,wBAAwBC,qBAAqB,CAACD,wBAAwB,CAACC;AAChF;AAKO,MAAMlB,wBAAwB,CAACmB,OAAOC,UAAUlB,MAAQ;IAC7D,MAAMmB,YAAYP,oBAAoBM,UAAUD,SAAS,WAAWA,KAAK;IACzE,MAAMG,mBAAmBF,YAAYnB,eAAeC,IAAI,CAACkB,SAAS;IAClE,MAAMG,oBAAoBF,aAAad,iBAAiB,CAACc,UAAU;IACnE,IAAIC,oBAAoBC,mBAAmB;QACzC,OAAO,CAAC,EAAED,iBAAiB,CAAC,EAAEC,kBAAkB,CAAC;IACnD,CAAC;IACD,OAAOD;AACT,GACA,iDAAiD"}
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;;aAAAA;;AAvBjB,MAAMC,iBAAiB,CAACC,MAAO,CAAA;QACvBC,OAAO;QACPC,OAAO;QACPC,QAAQH,MAAM,UAAU,MAAM;QAC9BI,OAAOJ,MAAM,SAAS,OAAO;IACjC,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,IAAI;IAChC,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,MAAM;IAC7D,MAAMmB,YAAYP,oBAAoBM,UAAUD,SAAS,WAAWA,KAAK;IACzE,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,CAAC;IACD,OAAOD;AACX"}
@@ -20,6 +20,4 @@ function toggleScrollListener(next, prev, handler) {
20
20
  const scrollParent = (0, _getScrollParent.getScrollParent)(next);
21
21
  scrollParent.addEventListener('scroll', handler);
22
22
  }
23
- } //# sourceMappingURL=toggleScrollListener.js.map
24
-
25
- //# sourceMappingURL=toggleScrollListener.js.map
23
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/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 */\nexport 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//# sourceMappingURL=toggleScrollListener.js.map"],"names":["toggleScrollListener","next","prev","handler","isHTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAQgBA;;aAAAA;;gCARc;iCACE;AAOzB,SAASA,qBAAqBC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAE;IACxD,IAAIF,SAASC,MAAM;QACjB;IACF,CAAC;IACD,IAAIE,IAAAA,6BAAa,EAACF,OAAO;QACvB,MAAMG,mBAAmBC,IAAAA,gCAAe,EAACJ;QACzCG,iBAAiBE,mBAAmB,CAAC,UAAUJ;IACjD,CAAC;IACD,IAAIC,IAAAA,6BAAa,EAACH,OAAO;QACvB,MAAMO,eAAeF,IAAAA,gCAAe,EAACL;QACrCO,aAAaC,gBAAgB,CAAC,UAAUN;IAC1C,CAAC;AACH,EACA,gDAAgD"}
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;;aAAAA;;gCAPU;iCACE;AAMrB,SAASA,qBAAqBC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAE;IAC1D,IAAIF,SAASC,MAAM;QACf;IACJ,CAAC;IACD,IAAIE,IAAAA,6BAAa,EAACF,OAAO;QACrB,MAAMG,mBAAmBC,IAAAA,gCAAe,EAACJ;QACzCG,iBAAiBE,mBAAmB,CAAC,UAAUJ;IACnD,CAAC;IACD,IAAIC,IAAAA,6BAAa,EAACH,OAAO;QACrB,MAAMO,eAAeF,IAAAA,gCAAe,EAACL;QACrCO,aAAaC,gBAAgB,CAAC,UAAUN;IAC5C,CAAC;AACL"}
@@ -39,6 +39,4 @@ function useCallbackRef(initialValue, callback, skipInitialResolve) {
39
39
  // update callback
40
40
  ref.callback = callback;
41
41
  return ref.facade;
42
- } //# sourceMappingURL=useCallbackRef.js.map
43
-
44
- //# sourceMappingURL=useCallbackRef.js.map
42
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useCallbackRef.js"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n/**\n * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content\n * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via\n * React.useState(), but it will cause re-renders always.\n *\n * https://reactjs.org/docs/hooks-reference.html#useref\n * https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n *\n * @param initialValue - initial ref value\n * @param callback - a callback to run when value changes\n * @param skipInitialResolve - a flag to skip an initial ref report\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n */\nexport function useCallbackRef(initialValue, callback, skipInitialResolve) {\n const isFirst = React.useRef(true);\n const [ref] = React.useState(() => ({\n // value\n value: initialValue,\n // last callback\n callback,\n // \"memoized\" public interface\n facade: {\n get current() {\n return ref.value;\n },\n set current(value) {\n const last = ref.value;\n if (last !== value) {\n ref.value = value;\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n ref.callback(value, last);\n }\n }\n }\n }));\n useIsomorphicLayoutEffect(() => {\n isFirst.current = false;\n }, []);\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n//# sourceMappingURL=useCallbackRef.js.map"],"names":["useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","React","useRef","ref","useState","value","facade","current","last","useIsomorphicLayoutEffect"],"mappings":";;;;+BAmBgBA;;aAAAA;;;6DAnBO;gCACmB;AAkBnC,SAASA,eAAeC,YAAY,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE;IACzE,MAAMC,UAAUC,OAAMC,MAAM,CAAC,IAAI;IACjC,MAAM,CAACC,IAAI,GAAGF,OAAMG,QAAQ,CAAC,IAAO,CAAA;YAClC,QAAQ;YACRC,OAAOR;YACP,gBAAgB;YAChBC;YACA,8BAA8B;YAC9BQ,QAAQ;gBACN,IAAIC,WAAU;oBACZ,OAAOJ,IAAIE,KAAK;gBAClB;gBACA,IAAIE,SAAQF,MAAO;oBACjB,MAAMG,OAAOL,IAAIE,KAAK;oBACtB,IAAIG,SAASH,OAAO;wBAClBF,IAAIE,KAAK,GAAGA;wBACZ,IAAIN,sBAAsBC,QAAQO,OAAO,EAAE;4BACzC;wBACF,CAAC;wBACDJ,IAAIL,QAAQ,CAACO,OAAOG;oBACtB,CAAC;gBACH;YACF;QACF,CAAA;IACAC,IAAAA,yCAAyB,EAAC,IAAM;QAC9BT,QAAQO,OAAO,GAAG,KAAK;IACzB,GAAG,EAAE;IACL,kBAAkB;IAClBJ,IAAIL,QAAQ,GAAGA;IACf,OAAOK,IAAIG,MAAM;AACnB,EACA,0CAA0C"}
1
+ {"version":3,"sources":["useCallbackRef.js"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n/**\n * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content\n * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via\n * React.useState(), but it will cause re-renders always.\n *\n * https://reactjs.org/docs/hooks-reference.html#useref\n * https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n *\n * @param initialValue - initial ref value\n * @param callback - a callback to run when value changes\n * @param skipInitialResolve - a flag to skip an initial ref report\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n */ export function useCallbackRef(initialValue, callback, skipInitialResolve) {\n const isFirst = React.useRef(true);\n const [ref] = React.useState(()=>({\n // value\n value: initialValue,\n // last callback\n callback,\n // \"memoized\" public interface\n facade: {\n get current () {\n return ref.value;\n },\n set current (value){\n const last = ref.value;\n if (last !== value) {\n ref.value = value;\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n ref.callback(value, last);\n }\n }\n }\n }));\n useIsomorphicLayoutEffect(()=>{\n isFirst.current = false;\n }, []);\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n"],"names":["useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","React","useRef","ref","useState","value","facade","current","last","useIsomorphicLayoutEffect"],"mappings":";;;;+BAkBoBA;;aAAAA;;;6DAlBG;gCACmB;AAiB/B,SAASA,eAAeC,YAAY,EAAEC,QAAQ,EAAEC,kBAAkB,EAAE;IAC3E,MAAMC,UAAUC,OAAMC,MAAM,CAAC,IAAI;IACjC,MAAM,CAACC,IAAI,GAAGF,OAAMG,QAAQ,CAAC,IAAK,CAAA;YAC1B,QAAQ;YACRC,OAAOR;YACP,gBAAgB;YAChBC;YACA,8BAA8B;YAC9BQ,QAAQ;gBACJ,IAAIC,WAAW;oBACX,OAAOJ,IAAIE,KAAK;gBACpB;gBACA,IAAIE,SAASF,MAAM;oBACf,MAAMG,OAAOL,IAAIE,KAAK;oBACtB,IAAIG,SAASH,OAAO;wBAChBF,IAAIE,KAAK,GAAGA;wBACZ,IAAIN,sBAAsBC,QAAQO,OAAO,EAAE;4BACvC;wBACJ,CAAC;wBACDJ,IAAIL,QAAQ,CAACO,OAAOG;oBACxB,CAAC;gBACL;YACJ;QACJ,CAAA;IACJC,IAAAA,yCAAyB,EAAC,IAAI;QAC1BT,QAAQO,OAAO,GAAG,KAAK;IAC3B,GAAG,EAAE;IACL,kBAAkB;IAClBJ,IAAIL,QAAQ,GAAGA;IACf,OAAOK,IAAIG,MAAM;AACrB"}
@@ -18,6 +18,4 @@ function writeArrowUpdates(options) {
18
18
  left: `${arrowX}px`,
19
19
  top: `${arrowY}px`
20
20
  });
21
- } //# sourceMappingURL=writeArrowUpdates.js.map
22
-
23
- //# sourceMappingURL=writeArrowUpdates.js.map
21
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/writeArrowUpdates.js"],"sourcesContent":["/**\n * Writes all DOM element updates after position is computed\n */export function writeArrowUpdates(options) {\n const {\n arrow,\n middlewareData\n } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n const {\n x: arrowX,\n y: arrowY\n } = middlewareData.arrow;\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`\n });\n}\n//# sourceMappingURL=writeArrowUpdates.js.map"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top"],"mappings":"AAAA;;CAEC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,kBAAkBC,OAAO,EAAE;IAC5C,MAAM,EACJC,MAAK,EACLC,eAAc,EACf,GAAGF;IACJ,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACnC;IACF,CAAC;IACD,MAAM,EACJE,GAAGC,OAAM,EACTC,GAAGC,OAAM,EACV,GAAGJ,eAAeD,KAAK;IACxBM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACzBC,MAAM,CAAC,EAAEN,OAAO,EAAE,CAAC;QACnBO,KAAK,CAAC,EAAEL,OAAO,EAAE,CAAC;IACpB;AACF,EACA,6CAA6C"}
1
+ {"version":3,"sources":["writeArrowUpdates.js"],"sourcesContent":["/**\n * Writes all DOM element updates after position is computed\n */ export function writeArrowUpdates(options) {\n const { arrow , middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n const { x: arrowX , y: arrowY } = middlewareData.arrow;\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top"],"mappings":"AAAA;;CAEC;;;;+BAAmBA;;aAAAA;;AAAT,SAASA,kBAAkBC,OAAO,EAAE;IAC3C,MAAM,EAAEC,MAAK,EAAGC,eAAc,EAAG,GAAGF;IACpC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACjC;IACJ,CAAC;IACD,MAAM,EAAEE,GAAGC,OAAM,EAAGC,GAAGC,OAAM,EAAG,GAAGJ,eAAeD,KAAK;IACvDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACvBC,MAAM,CAAC,EAAEN,OAAO,EAAE,CAAC;QACnBO,KAAK,CAAC,EAAEL,OAAO,EAAE,CAAC;IACtB;AACJ"}
@@ -46,6 +46,4 @@ function writeContainerUpdates(options) {
46
46
  left: `${x}px`,
47
47
  top: `${y}px`
48
48
  });
49
- } //# sourceMappingURL=writeContainerupdates.js.map
50
-
51
- //# sourceMappingURL=writeContainerupdates.js.map
49
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options) {\n var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;\n const {\n container,\n placement,\n middlewareData,\n strategy,\n lowPPI,\n coordinates,\n useTransform = true\n } = 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 container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\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 = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n Object.assign(container.style, {\n position: strategy\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 Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n}\n//# sourceMappingURL=writeContainerupdates.js.map"],"names":["writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","useTransform","setAttribute","DATA_POSITIONING_PLACEMENT","removeAttribute","DATA_POSITIONING_INTERSECTING","intersectionObserver","intersecting","DATA_POSITIONING_ESCAPED","hide","escaped","DATA_POSITIONING_HIDDEN","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAIgBA;;aAAAA;;2BAJ6G;AAItH,SAASA,sBAAsBC,OAAO,EAAE;IAC7C,IAAIC,sBAAsBC,uBAAuBC;IACjD,MAAM,EACJC,UAAS,EACTC,UAAS,EACTC,eAAc,EACdC,SAAQ,EACRC,OAAM,EACNC,YAAW,EACXC,cAAe,IAAI,CAAA,EACpB,GAAGV;IACJ,IAAI,CAACI,WAAW;QACd;IACF,CAAC;IACDA,UAAUO,YAAY,CAACC,qCAA0B,EAAEP;IACnDD,UAAUS,eAAe,CAACC,wCAA6B;IACvD,IAAIR,eAAeS,oBAAoB,CAACC,YAAY,EAAE;QACpDZ,UAAUO,YAAY,CAACG,wCAA6B,EAAE;IACxD,CAAC;IACDV,UAAUS,eAAe,CAACI,mCAAwB;IAClD,IAAI,AAAChB,CAAAA,uBAAuBK,eAAeY,IAAI,AAAD,MAAO,IAAI,IAAIjB,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBkB,OAAO,EAAE;QACpIf,UAAUO,YAAY,CAACM,mCAAwB,EAAE;IACnD,CAAC;IACDb,UAAUS,eAAe,CAACO,kCAAuB;IACjD,IAAI,AAAClB,CAAAA,wBAAwBI,eAAeY,IAAI,AAAD,MAAO,IAAI,IAAIhB,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBmB,eAAe,EAAE;QAC/IjB,UAAUO,YAAY,CAACS,kCAAuB,EAAE;IAClD,CAAC;IACD,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAME,mBAAmB,AAAC,CAAA,AAACnB,CAAAA,uCAAuCC,UAAUmB,aAAa,CAACC,WAAW,AAAD,MAAO,IAAI,IAAIrB,yCAAyC,KAAK,IAAI,KAAK,IAAIA,qCAAqCmB,gBAAgB,AAAD,KAAM;IACxO,MAAMG,IAAIC,KAAKC,KAAK,CAAClB,YAAYgB,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAAClB,YAAYmB,CAAC,GAAGN,oBAAoBA;IACzDO,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC7BC,UAAUzB;IACZ;IACA,IAAIG,cAAc;QAChBmB,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;YAC7BE,WAAWzB,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACpF;QACA;IACF,CAAC;IACDC,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC7BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACf;AACF,EACA,iDAAiD"}
1
+ {"version":3,"sources":["writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n */ export function writeContainerUpdates(options) {\n var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;\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 container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\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 = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n Object.assign(container.style, {\n position: strategy\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 Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n}\n"],"names":["writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","useTransform","setAttribute","DATA_POSITIONING_PLACEMENT","removeAttribute","DATA_POSITIONING_INTERSECTING","intersectionObserver","intersecting","DATA_POSITIONING_ESCAPED","hide","escaped","DATA_POSITIONING_HIDDEN","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAGoBA;;aAAAA;;2BAHyG;AAGlH,SAASA,sBAAsBC,OAAO,EAAE;IAC/C,IAAIC,sBAAsBC,uBAAuBC;IACjD,MAAM,EAAEC,UAAS,EAAGC,UAAS,EAAGC,eAAc,EAAGC,SAAQ,EAAGC,OAAM,EAAGC,YAAW,EAAGC,cAAc,IAAI,CAAA,EAAG,GAAGV;IAC3G,IAAI,CAACI,WAAW;QACZ;IACJ,CAAC;IACDA,UAAUO,YAAY,CAACC,qCAA0B,EAAEP;IACnDD,UAAUS,eAAe,CAACC,wCAA6B;IACvD,IAAIR,eAAeS,oBAAoB,CAACC,YAAY,EAAE;QAClDZ,UAAUO,YAAY,CAACG,wCAA6B,EAAE;IAC1D,CAAC;IACDV,UAAUS,eAAe,CAACI,mCAAwB;IAClD,IAAI,AAAChB,CAAAA,uBAAuBK,eAAeY,IAAI,AAAD,MAAO,IAAI,IAAIjB,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBkB,OAAO,EAAE;QAClIf,UAAUO,YAAY,CAACM,mCAAwB,EAAE;IACrD,CAAC;IACDb,UAAUS,eAAe,CAACO,kCAAuB;IACjD,IAAI,AAAClB,CAAAA,wBAAwBI,eAAeY,IAAI,AAAD,MAAO,IAAI,IAAIhB,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBmB,eAAe,EAAE;QAC7IjB,UAAUO,YAAY,CAACS,kCAAuB,EAAE;IACpD,CAAC;IACD,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAME,mBAAmB,AAAC,CAAA,AAACnB,CAAAA,uCAAuCC,UAAUmB,aAAa,CAACC,WAAW,AAAD,MAAO,IAAI,IAAIrB,yCAAyC,KAAK,IAAI,KAAK,IAAIA,qCAAqCmB,gBAAgB,AAAD,KAAM;IACxO,MAAMG,IAAIC,KAAKC,KAAK,CAAClB,YAAYgB,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAAClB,YAAYmB,CAAC,GAAGN,oBAAoBA;IACzDO,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC3BC,UAAUzB;IACd;IACA,IAAIG,cAAc;QACdmB,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;YAC3BE,WAAWzB,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACtF;QACA;IACJ,CAAC;IACDC,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC3BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACjB;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "0.0.0-nightly-20230529-0417.1",
3
+ "version": "0.0.0-nightly-20230531-0416.1",
4
4
  "description": "A react wrapper around Popper.js for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@floating-ui/dom": "^1.2.0",
33
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230529-0417.1",
34
- "@fluentui/react-theme": "0.0.0-nightly-20230529-0417.1",
35
- "@fluentui/react-utilities": "0.0.0-nightly-20230529-0417.1",
36
- "@griffel/react": "^1.5.2",
33
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230531-0416.1",
34
+ "@fluentui/react-theme": "0.0.0-nightly-20230531-0416.1",
35
+ "@fluentui/react-utilities": "0.0.0-nightly-20230531-0416.1",
36
+ "@griffel/react": "^1.5.7",
37
37
  "@swc/helpers": "^0.4.14"
38
38
  },
39
39
  "peerDependencies": {