@fluentui/react-positioning 0.0.0-nightly-20230223-2115.1 → 0.0.0-nightly-20230228-0425.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 (114) hide show
  1. package/CHANGELOG.json +9 -9
  2. package/CHANGELOG.md +7 -7
  3. package/lib/constants.js.map +1 -1
  4. package/lib/createArrowStyles.js.map +1 -1
  5. package/lib/createPositionManager.js +6 -7
  6. package/lib/createPositionManager.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +2 -1
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/middleware/coverTarget.js.map +1 -1
  11. package/lib/middleware/flip.js.map +1 -1
  12. package/lib/middleware/index.js.map +1 -1
  13. package/lib/middleware/intersecting.js.map +1 -1
  14. package/lib/middleware/maxSize.js +6 -7
  15. package/lib/middleware/maxSize.js.map +1 -1
  16. package/lib/middleware/offset.js.map +1 -1
  17. package/lib/middleware/shift.js.map +1 -1
  18. package/lib/types.js +1 -1
  19. package/lib/types.js.map +1 -1
  20. package/lib/usePositioning.js +21 -21
  21. package/lib/usePositioning.js.map +1 -1
  22. package/lib/usePositioningMouseTarget.js.map +1 -1
  23. package/lib/utils/debounce.js +2 -1
  24. package/lib/utils/debounce.js.map +1 -1
  25. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  26. package/lib/utils/getBoundary.js.map +1 -1
  27. package/lib/utils/getFloatingUIOffset.js +7 -8
  28. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  29. package/lib/utils/getReactFiberFromNode.js +0 -1
  30. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  31. package/lib/utils/getScrollParent.js +6 -5
  32. package/lib/utils/getScrollParent.js.map +1 -1
  33. package/lib/utils/hasAutoFocusFilter.js +2 -2
  34. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  35. package/lib/utils/index.js.map +1 -1
  36. package/lib/utils/mergeArrowOffset.js +4 -2
  37. package/lib/utils/mergeArrowOffset.js.map +1 -1
  38. package/lib/utils/parseFloatingUIPlacement.js +2 -1
  39. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  40. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  41. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  42. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  43. package/lib/utils/toggleScrollListener.js.map +1 -1
  44. package/lib/utils/useCallbackRef.js.map +1 -1
  45. package/lib/utils/writeArrowUpdates.js +2 -1
  46. package/lib/utils/writeArrowUpdates.js.map +1 -1
  47. package/lib/utils/writeContainerupdates.js +4 -4
  48. package/lib/utils/writeContainerupdates.js.map +1 -1
  49. package/lib-commonjs/constants.js +7 -18
  50. package/lib-commonjs/constants.js.map +1 -1
  51. package/lib-commonjs/createArrowStyles.js +88 -60
  52. package/lib-commonjs/createArrowStyles.js.map +1 -1
  53. package/lib-commonjs/createPositionManager.js +116 -103
  54. package/lib-commonjs/createPositionManager.js.map +1 -1
  55. package/lib-commonjs/createVirtualElementFromClick.js +26 -27
  56. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  57. package/lib-commonjs/index.js +51 -24
  58. package/lib-commonjs/index.js.map +1 -1
  59. package/lib-commonjs/middleware/coverTarget.js +37 -34
  60. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  61. package/lib-commonjs/middleware/flip.js +22 -20
  62. package/lib-commonjs/middleware/flip.js.map +1 -1
  63. package/lib-commonjs/middleware/index.js +9 -10
  64. package/lib-commonjs/middleware/index.js.map +1 -1
  65. package/lib-commonjs/middleware/intersecting.js +22 -24
  66. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  67. package/lib-commonjs/middleware/maxSize.js +40 -35
  68. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  69. package/lib-commonjs/middleware/offset.js +12 -11
  70. package/lib-commonjs/middleware/offset.js.map +1 -1
  71. package/lib-commonjs/middleware/shift.js +37 -29
  72. package/lib-commonjs/middleware/shift.js.map +1 -1
  73. package/lib-commonjs/types.js +2 -5
  74. package/lib-commonjs/types.js.map +1 -1
  75. package/lib-commonjs/usePositioning.js +161 -195
  76. package/lib-commonjs/usePositioning.js.map +1 -1
  77. package/lib-commonjs/usePositioningMouseTarget.js +37 -34
  78. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  79. package/lib-commonjs/utils/debounce.js +21 -22
  80. package/lib-commonjs/utils/debounce.js.map +1 -1
  81. package/lib-commonjs/utils/fromFloatingUIPlacement.js +35 -30
  82. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  83. package/lib-commonjs/utils/getBoundary.js +22 -21
  84. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  85. package/lib-commonjs/utils/getFloatingUIOffset.js +35 -24
  86. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  87. package/lib-commonjs/utils/getReactFiberFromNode.js +41 -45
  88. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  89. package/lib-commonjs/utils/getScrollParent.js +56 -52
  90. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  91. package/lib-commonjs/utils/hasAutoFocusFilter.js +17 -18
  92. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  93. package/lib-commonjs/utils/index.js +18 -19
  94. package/lib-commonjs/utils/index.js.map +1 -1
  95. package/lib-commonjs/utils/mergeArrowOffset.js +32 -32
  96. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  97. package/lib-commonjs/utils/parseFloatingUIPlacement.js +14 -15
  98. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  99. package/lib-commonjs/utils/resolvePositioningShorthand.js +61 -63
  100. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  101. package/lib-commonjs/utils/toFloatingUIPadding.js +25 -23
  102. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  103. package/lib-commonjs/utils/toFloatingUIPlacement.js +33 -31
  104. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  105. package/lib-commonjs/utils/toggleScrollListener.js +23 -19
  106. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  107. package/lib-commonjs/utils/useCallbackRef.js +53 -39
  108. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  109. package/lib-commonjs/utils/writeArrowUpdates.js +24 -19
  110. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  111. package/lib-commonjs/utils/writeContainerupdates.js +45 -37
  112. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  113. package/package.json +6 -6
  114. package/.swcrc +0 -33
@@ -1,23 +1,28 @@
1
- /**
2
- * Writes all DOM element updates after position is computed
3
- */ "use strict";
1
+ "use strict";
2
+
4
3
  Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "writeArrowUpdates", {
8
- enumerable: true,
9
- get: ()=>writeArrowUpdates
4
+ value: true
10
5
  });
6
+ exports.writeArrowUpdates = void 0;
7
+ /**
8
+ * Writes all DOM element updates after position is computed
9
+ */
11
10
  function writeArrowUpdates(options) {
12
- const { arrow , middlewareData } = options;
13
- if (!middlewareData.arrow || !arrow) {
14
- return;
15
- }
16
- const { x: arrowX , y: arrowY } = middlewareData.arrow;
17
- Object.assign(arrow.style, {
18
- left: `${arrowX}px`,
19
- top: `${arrowY}px`
20
- });
21
- } //# sourceMappingURL=writeArrowUpdates.js.map
22
-
11
+ const {
12
+ arrow,
13
+ middlewareData
14
+ } = options;
15
+ if (!middlewareData.arrow || !arrow) {
16
+ return;
17
+ }
18
+ const {
19
+ x: arrowX,
20
+ y: arrowY
21
+ } = middlewareData.arrow;
22
+ Object.assign(arrow.style, {
23
+ left: `${arrowX}px`,
24
+ top: `${arrowY}px`
25
+ });
26
+ }
27
+ exports.writeArrowUpdates = writeArrowUpdates;
23
28
  //# sourceMappingURL=writeArrowUpdates.js.map
@@ -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,"mappings":";;;;;;AAEA;;;AAGA,SAAgBA,iBAAiB,CAACC,OAAsE;EACtG,MAAM;IAAEC,KAAK;IAAEC;EAAc,CAAE,GAAGF,OAAO;EACzC,IAAI,CAACE,cAAc,CAACD,KAAK,IAAI,CAACA,KAAK,EAAE;IACnC;;EAGF,MAAM;IAAEE,CAAC,EAAEC,MAAM;IAAEC,CAAC,EAAEC;EAAM,CAAE,GAAGJ,cAAc,CAACD,KAAK;EAErDM,MAAM,CAACC,MAAM,CAACP,KAAK,CAACQ,KAAK,EAAE;IACzBC,IAAI,EAAE,GAAGN,MAAM,IAAI;IACnBO,GAAG,EAAE,GAAGL,MAAM;GACf,CAAC;AACJ;AAZAM","names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/utils/writeArrowUpdates.ts"],"sourcesContent":["import { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }) {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`,\n });\n}\n"]}
@@ -1,42 +1,50 @@
1
1
  "use strict";
2
+
2
3
  Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "writeContainerUpdates", {
6
- enumerable: true,
7
- get: ()=>writeContainerUpdates
4
+ value: true
8
5
  });
9
- const _constants = require("../constants");
6
+ exports.writeContainerUpdates = void 0;
7
+ const constants_1 = /*#__PURE__*/require("../constants");
8
+ /**
9
+ * Writes all container element position updates after the position is computed
10
+ */
10
11
  function writeContainerUpdates(options) {
11
- var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;
12
- const { container , placement , middlewareData , strategy , lowPPI , coordinates } = options;
13
- if (!container) {
14
- return;
15
- }
16
- container.setAttribute(_constants.DATA_POSITIONING_PLACEMENT, placement);
17
- container.removeAttribute(_constants.DATA_POSITIONING_INTERSECTING);
18
- if (middlewareData.intersectionObserver.intersecting) {
19
- container.setAttribute(_constants.DATA_POSITIONING_INTERSECTING, '');
20
- }
21
- container.removeAttribute(_constants.DATA_POSITIONING_ESCAPED);
22
- if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {
23
- container.setAttribute(_constants.DATA_POSITIONING_ESCAPED, '');
24
- }
25
- container.removeAttribute(_constants.DATA_POSITIONING_HIDDEN);
26
- if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {
27
- container.setAttribute(_constants.DATA_POSITIONING_HIDDEN, '');
28
- }
29
- // Round so that the coordinates land on device pixels.
30
- // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like
31
- // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.
32
- // See https://github.com/microsoft/fluentui/issues/26764 for more info.
33
- const devicePixelRatio = ((_container_ownerDocument_defaultView = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;
34
- const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;
35
- const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;
36
- Object.assign(container.style, {
37
- transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
38
- position: strategy
39
- });
40
- } //# sourceMappingURL=writeContainerupdates.js.map
41
-
12
+ var _a, _b, _c;
13
+ const {
14
+ container,
15
+ placement,
16
+ middlewareData,
17
+ strategy,
18
+ lowPPI,
19
+ coordinates
20
+ } = options;
21
+ if (!container) {
22
+ return;
23
+ }
24
+ container.setAttribute(constants_1.DATA_POSITIONING_PLACEMENT, placement);
25
+ container.removeAttribute(constants_1.DATA_POSITIONING_INTERSECTING);
26
+ if (middlewareData.intersectionObserver.intersecting) {
27
+ container.setAttribute(constants_1.DATA_POSITIONING_INTERSECTING, '');
28
+ }
29
+ container.removeAttribute(constants_1.DATA_POSITIONING_ESCAPED);
30
+ if ((_a = middlewareData.hide) === null || _a === void 0 ? void 0 : _a.escaped) {
31
+ container.setAttribute(constants_1.DATA_POSITIONING_ESCAPED, '');
32
+ }
33
+ container.removeAttribute(constants_1.DATA_POSITIONING_HIDDEN);
34
+ if ((_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) {
35
+ container.setAttribute(constants_1.DATA_POSITIONING_HIDDEN, '');
36
+ }
37
+ // Round so that the coordinates land on device pixels.
38
+ // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like
39
+ // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.
40
+ // See https://github.com/microsoft/fluentui/issues/26764 for more info.
41
+ const devicePixelRatio = ((_c = container.ownerDocument.defaultView) === null || _c === void 0 ? void 0 : _c.devicePixelRatio) || 1;
42
+ const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;
43
+ const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;
44
+ Object.assign(container.style, {
45
+ transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
46
+ position: strategy
47
+ });
48
+ }
49
+ exports.writeContainerUpdates = writeContainerUpdates;
42
50
  //# sourceMappingURL=writeContainerupdates.js.map
@@ -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 } = 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 transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy\n });\n}\n//# sourceMappingURL=writeContainerupdates.js.map"],"names":["writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","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","transform","position"],"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,EACZ,GAAGT;IACJ,IAAI,CAACI,WAAW;QACd;IACF,CAAC;IACDA,UAAUM,YAAY,CAACC,qCAA0B,EAAEN;IACnDD,UAAUQ,eAAe,CAACC,wCAA6B;IACvD,IAAIP,eAAeQ,oBAAoB,CAACC,YAAY,EAAE;QACpDX,UAAUM,YAAY,CAACG,wCAA6B,EAAE;IACxD,CAAC;IACDT,UAAUQ,eAAe,CAACI,mCAAwB;IAClD,IAAI,AAACf,CAAAA,uBAAuBK,eAAeW,IAAI,AAAD,MAAO,IAAI,IAAIhB,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBiB,OAAO,EAAE;QACpId,UAAUM,YAAY,CAACM,mCAAwB,EAAE;IACnD,CAAC;IACDZ,UAAUQ,eAAe,CAACO,kCAAuB;IACjD,IAAI,AAACjB,CAAAA,wBAAwBI,eAAeW,IAAI,AAAD,MAAO,IAAI,IAAIf,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBkB,eAAe,EAAE;QAC/IhB,UAAUM,YAAY,CAACS,kCAAuB,EAAE;IAClD,CAAC;IACD,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAME,mBAAmB,AAAC,CAAA,AAAClB,CAAAA,uCAAuCC,UAAUkB,aAAa,CAACC,WAAW,AAAD,MAAO,IAAI,IAAIpB,yCAAyC,KAAK,IAAI,KAAK,IAAIA,qCAAqCkB,gBAAgB,AAAD,KAAM;IACxO,MAAMG,IAAIC,KAAKC,KAAK,CAACjB,YAAYe,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAACjB,YAAYkB,CAAC,GAAGN,oBAAoBA;IACzDO,OAAOC,MAAM,CAACzB,UAAU0B,KAAK,EAAE;QAC7BC,WAAWvB,SAAS,CAAC,UAAU,EAAEgB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QAClFK,UAAUzB;IACZ;AACF,EACA,iDAAiD"}
1
+ {"version":3,"mappings":";;;;;;AACA;AAOA;;;AAGA,SAAgBA,qBAAqB,CAACC,OAYrC;;EACC,MAAM;IAAEC,SAAS;IAAEC,SAAS;IAAEC,cAAc;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAW,CAAE,GAAGN,OAAO;EACvF,IAAI,CAACC,SAAS,EAAE;IACd;;EAEFA,SAAS,CAACM,YAAY,CAACC,sCAA0B,EAAEN,SAAS,CAAC;EAC7DD,SAAS,CAACQ,eAAe,CAACD,yCAA6B,CAAC;EACxD,IAAIL,cAAc,CAACO,oBAAoB,CAACC,YAAY,EAAE;IACpDV,SAAS,CAACM,YAAY,CAACC,yCAA6B,EAAE,EAAE,CAAC;;EAG3DP,SAAS,CAACQ,eAAe,CAACD,oCAAwB,CAAC;EACnD,IAAI,oBAAc,CAACI,IAAI,0CAAEC,OAAO,EAAE;IAChCZ,SAAS,CAACM,YAAY,CAACC,oCAAwB,EAAE,EAAE,CAAC;;EAGtDP,SAAS,CAACQ,eAAe,CAACD,mCAAuB,CAAC;EAClD,IAAI,oBAAc,CAACI,IAAI,0CAAEE,eAAe,EAAE;IACxCb,SAAS,CAACM,YAAY,CAACC,mCAAuB,EAAE,EAAE,CAAC;;EAGrD;EACA;EACA;EACA;EACA,MAAMO,gBAAgB,GAAG,gBAAS,CAACC,aAAa,CAACC,WAAW,0CAAEF,gBAAgB,KAAI,CAAC;EACnF,MAAMG,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACd,WAAW,CAACY,CAAC,GAAGH,gBAAgB,CAAC,GAAGA,gBAAgB;EACzE,MAAMM,CAAC,GAAGF,IAAI,CAACC,KAAK,CAACd,WAAW,CAACe,CAAC,GAAGN,gBAAgB,CAAC,GAAGA,gBAAgB;EAEzEO,MAAM,CAACC,MAAM,CAACtB,SAAS,CAACuB,KAAK,EAAE;IAC7BC,SAAS,EAAEpB,MAAM,GAAG,aAAaa,CAAC,OAAOG,CAAC,KAAK,GAAG,eAAeH,CAAC,OAAOG,CAAC,QAAQ;IAClFK,QAAQ,EAAEtB;GACX,CAAC;AACJ;AA7CAuB","names":["writeContainerUpdates","options","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","constants_1","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","transform","position","exports"],"sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/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}) {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates } = 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 transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "0.0.0-nightly-20230223-2115.1",
3
+ "version": "0.0.0-nightly-20230228-0425.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",
@@ -20,7 +20,7 @@
20
20
  "lint": "just-scripts lint",
21
21
  "test": "jest --passWithNoTests",
22
22
  "type-check": "tsc -b tsconfig.json",
23
- "generate-api": "just-scripts generate-api"
23
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@fluentui/eslint-plugin": "*",
@@ -29,11 +29,11 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@floating-ui/dom": "^1.2.0",
32
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230223-2115.1",
33
- "@fluentui/react-theme": "0.0.0-nightly-20230223-2115.1",
34
- "@fluentui/react-utilities": "0.0.0-nightly-20230223-2115.1",
32
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230228-0425.1",
33
+ "@fluentui/react-theme": "0.0.0-nightly-20230228-0425.1",
34
+ "@fluentui/react-utilities": "0.0.0-nightly-20230228-0425.1",
35
35
  "@griffel/react": "^1.5.2",
36
- "@swc/helpers": "^0.4.14"
36
+ "tslib": "^2.1.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@types/react": ">=16.8.0 <19.0.0",
package/.swcrc DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/swcrc",
3
- "env": {
4
- "targets": {
5
- "chrome": "84",
6
- "edge": "84",
7
- "firefox": "75",
8
- "opera": "73",
9
- "safari": "14.1"
10
- }
11
- },
12
- "exclude": [
13
- "/testing",
14
- "/**/*.cy.ts",
15
- "/**/*.cy.tsx",
16
- "/**/*.spec.ts",
17
- "/**/*.spec.tsx",
18
- "/**/*.test.ts",
19
- "/**/*.test.tsx"
20
- ],
21
- "jsc": {
22
- "parser": {
23
- "syntax": "typescript",
24
- "tsx": true,
25
- "decorators": false,
26
- "dynamicImport": false
27
- },
28
- "target": "es2019",
29
- "externalHelpers": true
30
- },
31
- "minify": false,
32
- "sourceMaps": true
33
- }