@fluentui/react-positioning 0.0.0-nightly-20230210-0425.1 → 0.0.0-nightly-20230214-0419.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.
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 10 Feb 2023 04:35:03 GMT",
6
- "tag": "@fluentui/react-positioning_v0.0.0-nightly-20230210-0425.1",
7
- "version": "0.0.0-nightly-20230210-0425.1",
5
+ "date": "Tue, 14 Feb 2023 04:26:23 GMT",
6
+ "tag": "@fluentui/react-positioning_v0.0.0-nightly-20230214-0419.1",
7
+ "version": "0.0.0-nightly-20230214-0419.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,20 +16,71 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-positioning",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230210-0425.1",
20
- "commit": "2bff813d044bb7e74e91670eda0a208027033ccb"
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230214-0419.1",
20
+ "commit": "646eca374604906a66a017b72fe9f52135e6449a"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-positioning",
25
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230210-0425.1",
26
- "commit": "2bff813d044bb7e74e91670eda0a208027033ccb"
25
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230214-0419.1",
26
+ "commit": "646eca374604906a66a017b72fe9f52135e6449a"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-positioning",
31
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230210-0425.1",
32
- "commit": "2bff813d044bb7e74e91670eda0a208027033ccb"
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230214-0419.1",
32
+ "commit": "646eca374604906a66a017b72fe9f52135e6449a"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Mon, 13 Feb 2023 23:43:14 GMT",
39
+ "tag": "@fluentui/react-positioning_v9.4.2",
40
+ "version": "9.4.2",
41
+ "comments": {
42
+ "patch": [
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-positioning",
46
+ "comment": "Bump @fluentui/react-utilities to v9.5.3",
47
+ "commit": "29e62b13706c2845b21d665d43cdacf1ef1b1513"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Mon, 13 Feb 2023 09:35:47 GMT",
54
+ "tag": "@fluentui/react-positioning_v9.4.1",
55
+ "version": "9.4.1",
56
+ "comments": {
57
+ "patch": [
58
+ {
59
+ "author": "behowell@microsoft.com",
60
+ "package": "@fluentui/react-positioning",
61
+ "commit": "0565ec044c06af355f951e158c0e68611a1d8861",
62
+ "comment": "fix: Coordinates should be rounded to device pixels to prevent blurriness"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "date": "Fri, 10 Feb 2023 08:49:59 GMT",
69
+ "tag": "@fluentui/react-positioning_v9.4.0",
70
+ "version": "9.4.0",
71
+ "comments": {
72
+ "minor": [
73
+ {
74
+ "author": "lingfangao@hotmail.com",
75
+ "package": "@fluentui/react-positioning",
76
+ "commit": "95a7b63876ccdc142172d93fe30b035d80f4fe88",
77
+ "comment": "feat: Add `overflowBoundaryPadding` positioning prop"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-positioning",
82
+ "comment": "Bump @fluentui/react-utilities to v9.5.2",
83
+ "commit": "cc62f050f8231e8f21a2cf7dddf33003e0ba3931"
33
84
  }
34
85
  ]
35
86
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,48 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Fri, 10 Feb 2023 04:35:03 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 14 Feb 2023 04:26:23 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230210-0425.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly-20230210-0425.1)
7
+ ## [0.0.0-nightly-20230214-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly-20230214-0419.1)
8
8
 
9
- Fri, 10 Feb 2023 04:35:03 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.3.11..@fluentui/react-positioning_v0.0.0-nightly-20230210-0425.1)
9
+ Tue, 14 Feb 2023 04:26:23 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.2..@fluentui/react-positioning_v0.0.0-nightly-20230214-0419.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230210-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/2bff813d044bb7e74e91670eda0a208027033ccb) by beachball)
16
- - Bump @fluentui/react-theme to v0.0.0-nightly-20230210-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/2bff813d044bb7e74e91670eda0a208027033ccb) by beachball)
17
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230210-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/2bff813d044bb7e74e91670eda0a208027033ccb) by beachball)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230214-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/646eca374604906a66a017b72fe9f52135e6449a) by beachball)
16
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20230214-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/646eca374604906a66a017b72fe9f52135e6449a) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230214-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/646eca374604906a66a017b72fe9f52135e6449a) by beachball)
18
+
19
+ ## [9.4.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.4.2)
20
+
21
+ Mon, 13 Feb 2023 23:43:14 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.1..@fluentui/react-positioning_v9.4.2)
23
+
24
+ ### Patches
25
+
26
+ - Bump @fluentui/react-utilities to v9.5.3 ([PR #26814](https://github.com/microsoft/fluentui/pull/26814) by beachball)
27
+
28
+ ## [9.4.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.4.1)
29
+
30
+ Mon, 13 Feb 2023 09:35:47 GMT
31
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.4.0..@fluentui/react-positioning_v9.4.1)
32
+
33
+ ### Patches
34
+
35
+ - fix: Coordinates should be rounded to device pixels to prevent blurriness ([PR #26766](https://github.com/microsoft/fluentui/pull/26766) by behowell@microsoft.com)
36
+
37
+ ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.4.0)
38
+
39
+ Fri, 10 Feb 2023 08:49:59 GMT
40
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.3.11..@fluentui/react-positioning_v9.4.0)
41
+
42
+ ### Minor changes
43
+
44
+ - feat: Add `overflowBoundaryPadding` positioning prop ([PR #26730](https://github.com/microsoft/fluentui/pull/26730) by lingfangao@hotmail.com)
45
+ - Bump @fluentui/react-utilities to v9.5.2 ([commit](https://github.com/microsoft/fluentui/commit/cc62f050f8231e8f21a2cf7dddf33003e0ba3931) by beachball)
18
46
 
19
47
  ## [9.3.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.3.11)
20
48
 
@@ -3,7 +3,7 @@ import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INT
3
3
  * Writes all container element position updates after the position is computed
4
4
  */
5
5
  export function writeContainerUpdates(options) {
6
- var _a, _b;
6
+ var _a, _b, _c;
7
7
  const {
8
8
  container,
9
9
  placement,
@@ -28,8 +28,13 @@ export function writeContainerUpdates(options) {
28
28
  if ((_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) {
29
29
  container.setAttribute(DATA_POSITIONING_HIDDEN, '');
30
30
  }
31
- const x = Math.round(coordinates.x);
32
- const y = Math.round(coordinates.y);
31
+ // Round so that the coordinates land on device pixels.
32
+ // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like
33
+ // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.
34
+ // See https://github.com/microsoft/fluentui/issues/26764 for more info.
35
+ const devicePixelRatio = ((_c = container.ownerDocument.defaultView) === null || _c === void 0 ? void 0 : _c.devicePixelRatio) || 1;
36
+ const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;
37
+ const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;
33
38
  Object.assign(container.style, {
34
39
  transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
35
40
  position: strategy
@@ -1 +1 @@
1
- {"version":3,"mappings":"AACA,SACEA,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB,cAAc;AAErB;;;AAGA,OAAM,SAAUC,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,CAACT,0BAA0B,EAAEI,SAAS,CAAC;EAC7DD,SAAS,CAACO,eAAe,CAACX,6BAA6B,CAAC;EACxD,IAAIM,cAAc,CAACM,oBAAoB,CAACC,YAAY,EAAE;IACpDT,SAAS,CAACM,YAAY,CAACV,6BAA6B,EAAE,EAAE,CAAC;;EAG3DI,SAAS,CAACO,eAAe,CAACb,wBAAwB,CAAC;EACnD,IAAI,oBAAc,CAACgB,IAAI,0CAAEC,OAAO,EAAE;IAChCX,SAAS,CAACM,YAAY,CAACZ,wBAAwB,EAAE,EAAE,CAAC;;EAGtDM,SAAS,CAACO,eAAe,CAACZ,uBAAuB,CAAC;EAClD,IAAI,oBAAc,CAACe,IAAI,0CAAEE,eAAe,EAAE;IACxCZ,SAAS,CAACM,YAAY,CAACX,uBAAuB,EAAE,EAAE,CAAC;;EAGrD,MAAMkB,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACV,WAAW,CAACQ,CAAC,CAAC;EACnC,MAAMG,CAAC,GAAGF,IAAI,CAACC,KAAK,CAACV,WAAW,CAACW,CAAC,CAAC;EAEnCC,MAAM,CAACC,MAAM,CAAClB,SAAS,CAACmB,KAAK,EAAE;IAC7BC,SAAS,EAAEhB,MAAM,GAAG,aAAaS,CAAC,OAAOG,CAAC,KAAK,GAAG,eAAeH,CAAC,OAAOG,CAAC,QAAQ;IAClFK,QAAQ,EAAElB;GACX,CAAC;AACJ","names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","x","Math","round","y","Object","assign","style","transform","position"],"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 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"]}
1
+ {"version":3,"mappings":"AACA,SACEA,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB,cAAc;AAErB;;;AAGA,OAAM,SAAUC,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,CAACT,0BAA0B,EAAEI,SAAS,CAAC;EAC7DD,SAAS,CAACO,eAAe,CAACX,6BAA6B,CAAC;EACxD,IAAIM,cAAc,CAACM,oBAAoB,CAACC,YAAY,EAAE;IACpDT,SAAS,CAACM,YAAY,CAACV,6BAA6B,EAAE,EAAE,CAAC;;EAG3DI,SAAS,CAACO,eAAe,CAACb,wBAAwB,CAAC;EACnD,IAAI,oBAAc,CAACgB,IAAI,0CAAEC,OAAO,EAAE;IAChCX,SAAS,CAACM,YAAY,CAACZ,wBAAwB,EAAE,EAAE,CAAC;;EAGtDM,SAAS,CAACO,eAAe,CAACZ,uBAAuB,CAAC;EAClD,IAAI,oBAAc,CAACe,IAAI,0CAAEE,eAAe,EAAE;IACxCZ,SAAS,CAACM,YAAY,CAACX,uBAAuB,EAAE,EAAE,CAAC;;EAGrD;EACA;EACA;EACA;EACA,MAAMkB,gBAAgB,GAAG,gBAAS,CAACC,aAAa,CAACC,WAAW,0CAAEF,gBAAgB,KAAI,CAAC;EACnF,MAAMG,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACb,WAAW,CAACW,CAAC,GAAGH,gBAAgB,CAAC,GAAGA,gBAAgB;EACzE,MAAMM,CAAC,GAAGF,IAAI,CAACC,KAAK,CAACb,WAAW,CAACc,CAAC,GAAGN,gBAAgB,CAAC,GAAGA,gBAAgB;EAEzEO,MAAM,CAACC,MAAM,CAACrB,SAAS,CAACsB,KAAK,EAAE;IAC7BC,SAAS,EAAEnB,MAAM,GAAG,aAAaY,CAAC,OAAOG,CAAC,KAAK,GAAG,eAAeH,CAAC,OAAOG,CAAC,QAAQ;IAClFK,QAAQ,EAAErB;GACX,CAAC;AACJ","names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","transform","position"],"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"]}
@@ -9,7 +9,7 @@ const constants_1 = /*#__PURE__*/require("../constants");
9
9
  * Writes all container element position updates after the position is computed
10
10
  */
11
11
  function writeContainerUpdates(options) {
12
- var _a, _b;
12
+ var _a, _b, _c;
13
13
  const {
14
14
  container,
15
15
  placement,
@@ -34,8 +34,13 @@ function writeContainerUpdates(options) {
34
34
  if ((_b = middlewareData.hide) === null || _b === void 0 ? void 0 : _b.referenceHidden) {
35
35
  container.setAttribute(constants_1.DATA_POSITIONING_HIDDEN, '');
36
36
  }
37
- const x = Math.round(coordinates.x);
38
- const y = Math.round(coordinates.y);
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;
39
44
  Object.assign(container.style, {
40
45
  transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
41
46
  position: strategy
@@ -1 +1 @@
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,MAAMO,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACX,WAAW,CAACS,CAAC,CAAC;EACnC,MAAMG,CAAC,GAAGF,IAAI,CAACC,KAAK,CAACX,WAAW,CAACY,CAAC,CAAC;EAEnCC,MAAM,CAACC,MAAM,CAACnB,SAAS,CAACoB,KAAK,EAAE;IAC7BC,SAAS,EAAEjB,MAAM,GAAG,aAAaU,CAAC,OAAOG,CAAC,KAAK,GAAG,eAAeH,CAAC,OAAOG,CAAC,QAAQ;IAClFK,QAAQ,EAAEnB;GACX,CAAC;AACJ;AAxCAoB","names":["writeContainerUpdates","options","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","constants_1","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","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 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"]}
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-20230210-0425.1",
3
+ "version": "0.0.0-nightly-20230214-0419.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",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@floating-ui/dom": "^1.2.0",
32
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230210-0425.1",
33
- "@fluentui/react-theme": "0.0.0-nightly-20230210-0425.1",
34
- "@fluentui/react-utilities": "0.0.0-nightly-20230210-0425.1",
32
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230214-0419.1",
33
+ "@fluentui/react-theme": "0.0.0-nightly-20230214-0419.1",
34
+ "@fluentui/react-utilities": "0.0.0-nightly-20230214-0419.1",
35
35
  "@griffel/react": "^1.5.2",
36
36
  "tslib": "^2.1.0"
37
37
  },