@fluentui/react-positioning 9.3.3 → 9.3.5

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,61 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 05 Dec 2022 18:25:26 GMT",
5
+ "date": "Wed, 21 Dec 2022 10:17:16 GMT",
6
+ "tag": "@fluentui/react-positioning_v9.3.5",
7
+ "version": "9.3.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-positioning",
13
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.4",
14
+ "commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-positioning",
19
+ "comment": "Bump @fluentui/react-theme to v9.1.5",
20
+ "commit": "66bf89f634cad4a275e957d7a2214c7e73ff8c2e"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Tue, 20 Dec 2022 14:59:26 GMT",
27
+ "tag": "@fluentui/react-positioning_v9.3.4",
28
+ "version": "9.3.4",
29
+ "comments": {
30
+ "patch": [
31
+ {
32
+ "author": "lingfangao@hotmail.com",
33
+ "package": "@fluentui/react-positioning",
34
+ "commit": "905b3b2e74e472bd2d9cb825c0dc12d3dee4aa46",
35
+ "comment": "fix: Coordinates should be rounded to integers"
36
+ },
37
+ {
38
+ "author": "beachball",
39
+ "package": "@fluentui/react-positioning",
40
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.3",
41
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-positioning",
46
+ "comment": "Bump @fluentui/react-theme to v9.1.4",
47
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-positioning",
52
+ "comment": "Bump @fluentui/react-utilities to v9.3.0",
53
+ "commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Mon, 05 Dec 2022 18:29:28 GMT",
6
60
  "tag": "@fluentui/react-positioning_v9.3.3",
7
61
  "version": "9.3.3",
8
62
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Mon, 05 Dec 2022 18:25:26 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 21 Dec 2022 10:17:16 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.3.5)
8
+
9
+ Wed, 21 Dec 2022 10:17:16 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.3.4..@fluentui/react-positioning_v9.3.5)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-shared-contexts to v9.1.4 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
15
+ - Bump @fluentui/react-theme to v9.1.5 ([commit](https://github.com/microsoft/fluentui/commit/66bf89f634cad4a275e957d7a2214c7e73ff8c2e) by beachball)
16
+
17
+ ## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.3.4)
18
+
19
+ Tue, 20 Dec 2022 14:59:26 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.3.3..@fluentui/react-positioning_v9.3.4)
21
+
22
+ ### Patches
23
+
24
+ - fix: Coordinates should be rounded to integers ([PR #26038](https://github.com/microsoft/fluentui/pull/26038) by lingfangao@hotmail.com)
25
+ - Bump @fluentui/react-shared-contexts to v9.1.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
26
+ - Bump @fluentui/react-theme to v9.1.4 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
27
+ - Bump @fluentui/react-utilities to v9.3.0 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
28
+
7
29
  ## [9.3.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.3.3)
8
30
 
9
- Mon, 05 Dec 2022 18:25:26 GMT
31
+ Mon, 05 Dec 2022 18:29:28 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.3.2..@fluentui/react-positioning_v9.3.3)
11
33
 
12
34
  ### Patches
@@ -12,10 +12,7 @@ export function writeContainerUpdates(options) {
12
12
  middlewareData,
13
13
  strategy,
14
14
  lowPPI,
15
- coordinates: {
16
- x,
17
- y
18
- }
15
+ coordinates
19
16
  } = options;
20
17
 
21
18
  if (!container) {
@@ -41,6 +38,8 @@ export function writeContainerUpdates(options) {
41
38
  container.setAttribute(DATA_POSITIONING_HIDDEN, '');
42
39
  }
43
40
 
41
+ const x = Math.round(coordinates.x);
42
+ const y = Math.round(coordinates.y);
44
43
  Object.assign(container.style, {
45
44
  transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
46
45
  position: strategy
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":"AACA,SACE,wBADF,EAEE,uBAFF,EAGE,6BAHF,EAIE,0BAJF,QAKO,cALP;AAOA;;AAEG;;AACH,OAAM,SAAU,qBAAV,CAAgC,OAAhC,EAYL;;;EACC,MAAM;IACJ,SADI;IAEJ,SAFI;IAGJ,cAHI;IAIJ,QAJI;IAKJ,MALI;IAMJ,WAAW,EAAE;MAAE,CAAF;MAAK;IAAL;EANT,IAOF,OAPJ;;EAQA,IAAI,CAAC,SAAL,EAAgB;IACd;EACD;;EACD,SAAS,CAAC,YAAV,CAAuB,0BAAvB,EAAmD,SAAnD;EACA,SAAS,CAAC,eAAV,CAA0B,6BAA1B;;EACA,IAAI,cAAc,CAAC,oBAAf,CAAoC,YAAxC,EAAsD;IACpD,SAAS,CAAC,YAAV,CAAuB,6BAAvB,EAAsD,EAAtD;EACD;;EAED,SAAS,CAAC,eAAV,CAA0B,wBAA1B;;EACA,IAAI,CAAA,EAAA,GAAA,cAAc,CAAC,IAAf,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,KAAA,CAAnB,GAAmB,EAAA,CAAE,OAAzB,EAAkC;IAChC,SAAS,CAAC,YAAV,CAAuB,wBAAvB,EAAiD,EAAjD;EACD;;EAED,SAAS,CAAC,eAAV,CAA0B,uBAA1B;;EACA,IAAI,CAAA,EAAA,GAAA,cAAc,CAAC,IAAf,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,KAAA,CAAnB,GAAmB,EAAA,CAAE,eAAzB,EAA0C;IACxC,SAAS,CAAC,YAAV,CAAuB,uBAAvB,EAAgD,EAAhD;EACD;;EAED,MAAM,CAAC,MAAP,CAAc,SAAS,CAAC,KAAxB,EAA+B;IAC7B,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,KAAzB,GAAiC,eAAe,CAAC,OAAO,CAAC,QAD7C;IAE7B,QAAQ,EAAE;EAFmB,CAA/B;AAID","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 {\n container,\n placement,\n middlewareData,\n strategy,\n lowPPI,\n coordinates: { x, y },\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\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 Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":"AACA,SACE,wBADF,EAEE,uBAFF,EAGE,6BAHF,EAIE,0BAJF,QAKO,cALP;AAOA;;AAEG;;AACH,OAAM,SAAU,qBAAV,CAAgC,OAAhC,EAYL;;;EACC,MAAM;IAAE,SAAF;IAAa,SAAb;IAAwB,cAAxB;IAAwC,QAAxC;IAAkD,MAAlD;IAA0D;EAA1D,IAA0E,OAAhF;;EACA,IAAI,CAAC,SAAL,EAAgB;IACd;EACD;;EACD,SAAS,CAAC,YAAV,CAAuB,0BAAvB,EAAmD,SAAnD;EACA,SAAS,CAAC,eAAV,CAA0B,6BAA1B;;EACA,IAAI,cAAc,CAAC,oBAAf,CAAoC,YAAxC,EAAsD;IACpD,SAAS,CAAC,YAAV,CAAuB,6BAAvB,EAAsD,EAAtD;EACD;;EAED,SAAS,CAAC,eAAV,CAA0B,wBAA1B;;EACA,IAAI,CAAA,EAAA,GAAA,cAAc,CAAC,IAAf,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,KAAA,CAAnB,GAAmB,EAAA,CAAE,OAAzB,EAAkC;IAChC,SAAS,CAAC,YAAV,CAAuB,wBAAvB,EAAiD,EAAjD;EACD;;EAED,SAAS,CAAC,eAAV,CAA0B,uBAA1B;;EACA,IAAI,CAAA,EAAA,GAAA,cAAc,CAAC,IAAf,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,KAAA,CAAnB,GAAmB,EAAA,CAAE,eAAzB,EAA0C;IACxC,SAAS,CAAC,YAAV,CAAuB,uBAAvB,EAAgD,EAAhD;EACD;;EAED,MAAM,CAAC,GAAG,IAAI,CAAC,KAAL,CAAW,WAAW,CAAC,CAAvB,CAAV;EACA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAL,CAAW,WAAW,CAAC,CAAvB,CAAV;EAEA,MAAM,CAAC,MAAP,CAAc,SAAS,CAAC,KAAxB,EAA+B;IAC7B,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,KAAzB,GAAiC,eAAe,CAAC,OAAO,CAAC,QAD7C;IAE7B,QAAQ,EAAE;EAFmB,CAA/B;AAID","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 const x = Math.round(coordinates.x);\n const y = Math.round(coordinates.y);\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"],"sourceRoot":"../src/"}
@@ -7,7 +7,7 @@ define(["require", "exports", "../constants"], function (require, exports, const
7
7
  */
8
8
  function writeContainerUpdates(options) {
9
9
  var _a, _b;
10
- var container = options.container, placement = options.placement, middlewareData = options.middlewareData, strategy = options.strategy, lowPPI = options.lowPPI, _c = options.coordinates, x = _c.x, y = _c.y;
10
+ var container = options.container, placement = options.placement, middlewareData = options.middlewareData, strategy = options.strategy, lowPPI = options.lowPPI, coordinates = options.coordinates;
11
11
  if (!container) {
12
12
  return;
13
13
  }
@@ -24,6 +24,8 @@ define(["require", "exports", "../constants"], function (require, exports, const
24
24
  if ((_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) {
25
25
  container.setAttribute(constants_1.DATA_POSITIONING_HIDDEN, '');
26
26
  }
27
+ var x = Math.round(coordinates.x);
28
+ var y = Math.round(coordinates.y);
27
29
  Object.assign(container.style, {
28
30
  transform: lowPPI ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)",
29
31
  position: strategy,
@@ -1 +1 @@
1
- {"version":3,"file":"writeContainerupdates.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":";;;;IAQA;;OAEG;IACH,SAAgB,qBAAqB,CAAC,OAYrC;;QAEG,IAAA,SAAS,GAMP,OAAO,UANA,EACT,SAAS,GAKP,OAAO,UALA,EACT,cAAc,GAIZ,OAAO,eAJK,EACd,QAAQ,GAGN,OAAO,SAHD,EACR,MAAM,GAEJ,OAAO,OAFH,EACN,KACE,OAAO,YADY,EAAN,CAAC,OAAA,EAAE,CAAC,OAAE,CACX;QACZ,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,SAAS,CAAC,YAAY,CAAC,sCAA0B,EAAE,SAAS,CAAC,CAAC;QAC9D,SAAS,CAAC,eAAe,CAAC,yCAA6B,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,oBAAoB,CAAC,YAAY,EAAE;YACpD,SAAS,CAAC,YAAY,CAAC,yCAA6B,EAAE,EAAE,CAAC,CAAC;SAC3D;QAED,SAAS,CAAC,eAAe,CAAC,oCAAwB,CAAC,CAAC;QACpD,IAAI,MAAA,cAAc,CAAC,IAAI,0CAAE,OAAO,EAAE;YAChC,SAAS,CAAC,YAAY,CAAC,oCAAwB,EAAE,EAAE,CAAC,CAAC;SACtD;QAED,SAAS,CAAC,eAAe,CAAC,mCAAuB,CAAC,CAAC;QACnD,IAAI,MAAA,cAAc,CAAC,IAAI,0CAAE,eAAe,EAAE;YACxC,SAAS,CAAC,YAAY,CAAC,mCAAuB,EAAE,EAAE,CAAC,CAAC;SACrD;QAED,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;YAC7B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,eAAa,CAAC,YAAO,CAAC,QAAK,CAAC,CAAC,CAAC,iBAAe,CAAC,YAAO,CAAC,WAAQ;YAClF,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;IACL,CAAC;IA5CD,sDA4CC","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 {\n container,\n placement,\n middlewareData,\n strategy,\n lowPPI,\n coordinates: { x, y },\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\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 Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"]}
1
+ {"version":3,"file":"writeContainerupdates.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":";;;;IAQA;;OAEG;IACH,SAAgB,qBAAqB,CAAC,OAYrC;;QACS,IAAA,SAAS,GAA+D,OAAO,UAAtE,EAAE,SAAS,GAAoD,OAAO,UAA3D,EAAE,cAAc,GAAoC,OAAO,eAA3C,EAAE,QAAQ,GAA0B,OAAO,SAAjC,EAAE,MAAM,GAAkB,OAAO,OAAzB,EAAE,WAAW,GAAK,OAAO,YAAZ,CAAa;QACxF,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,SAAS,CAAC,YAAY,CAAC,sCAA0B,EAAE,SAAS,CAAC,CAAC;QAC9D,SAAS,CAAC,eAAe,CAAC,yCAA6B,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,oBAAoB,CAAC,YAAY,EAAE;YACpD,SAAS,CAAC,YAAY,CAAC,yCAA6B,EAAE,EAAE,CAAC,CAAC;SAC3D;QAED,SAAS,CAAC,eAAe,CAAC,oCAAwB,CAAC,CAAC;QACpD,IAAI,MAAA,cAAc,CAAC,IAAI,0CAAE,OAAO,EAAE;YAChC,SAAS,CAAC,YAAY,CAAC,oCAAwB,EAAE,EAAE,CAAC,CAAC;SACtD;QAED,SAAS,CAAC,eAAe,CAAC,mCAAuB,CAAC,CAAC;QACnD,IAAI,MAAA,cAAc,CAAC,IAAI,0CAAE,eAAe,EAAE;YACxC,SAAS,CAAC,YAAY,CAAC,mCAAuB,EAAE,EAAE,CAAC,CAAC;SACrD;QAED,IAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACpC,IAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;YAC7B,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,eAAa,CAAC,YAAO,CAAC,QAAK,CAAC,CAAC,CAAC,iBAAe,CAAC,YAAO,CAAC,WAAQ;YAClF,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;IACL,CAAC;IAxCD,sDAwCC","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 const x = Math.round(coordinates.x);\n const y = Math.round(coordinates.y);\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"]}
@@ -20,10 +20,7 @@ function writeContainerUpdates(options) {
20
20
  middlewareData,
21
21
  strategy,
22
22
  lowPPI,
23
- coordinates: {
24
- x,
25
- y
26
- }
23
+ coordinates
27
24
  } = options;
28
25
 
29
26
  if (!container) {
@@ -49,6 +46,8 @@ function writeContainerUpdates(options) {
49
46
  container.setAttribute(constants_1.DATA_POSITIONING_HIDDEN, '');
50
47
  }
51
48
 
49
+ const x = Math.round(coordinates.x);
50
+ const y = Math.round(coordinates.y);
52
51
  Object.assign(container.style, {
53
52
  transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
54
53
  position: strategy
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAOA;;AAEG;;;AACH,SAAgB,qBAAhB,CAAsC,OAAtC,EAYC;;;EACC,MAAM;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ating-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 {\n container,\n placement,\n middlewareData,\n strategy,\n lowPPI,\n coordinates: { x, y },\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\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 Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAOA;;AAEG;;;AACH,SAAgB,qBAAhB,CAAsC,OAAtC,EAYC;;;EACC,MAAM;IAAE,SAAF;IAAa,SAAb;IAAwB,cAAxB;IAAwC,QAAxC;IAAkD,MAAlD;IAA0D;EAA1D,IAA0E,OAAhF;;EACA,IAAI,CAAC,SAAL,EAAgB;IACd;EACD;;EAC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SITIONING_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 const x = Math.round(coordinates.x);\n const y = Math.round(coordinates.y);\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"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.3.3",
3
+ "version": "9.3.5",
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",
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@floating-ui/dom": "^1.0.0",
31
- "@fluentui/react-shared-contexts": "^9.1.2",
32
- "@fluentui/react-theme": "^9.1.3",
33
- "@fluentui/react-utilities": "^9.2.2",
31
+ "@fluentui/react-shared-contexts": "^9.1.4",
32
+ "@fluentui/react-theme": "^9.1.5",
33
+ "@fluentui/react-utilities": "^9.3.0",
34
34
  "@griffel/react": "^1.4.2",
35
35
  "tslib": "^2.1.0"
36
36
  },