@fluentui/react-dialog 9.10.3 → 9.10.4
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.md +14 -2
- package/lib/utils/useDisableBodyScroll.js +1 -9
- package/lib/utils/useDisableBodyScroll.js.map +1 -1
- package/lib/utils/useDisableBodyScroll.styles.js +4 -0
- package/lib/utils/useDisableBodyScroll.styles.js.map +1 -0
- package/lib-commonjs/utils/useDisableBodyScroll.js +5 -13
- package/lib-commonjs/utils/useDisableBodyScroll.js.map +1 -1
- package/lib-commonjs/utils/useDisableBodyScroll.styles.js +14 -0
- package/lib-commonjs/utils/useDisableBodyScroll.styles.js.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-dialog
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 09 May 2024 19:31:56 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.10.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.10.4)
|
|
8
|
+
|
|
9
|
+
Thu, 09 May 2024 19:31:56 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.10.3..@fluentui/react-dialog_v9.10.4)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: move styles declared in useDisableBodyScroll() to a separate file ([PR #31299](https://github.com/microsoft/fluentui/pull/31299) by olfedias@microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-aria to v9.11.2 ([PR #31321](https://github.com/microsoft/fluentui/pull/31321) by beachball)
|
|
16
|
+
- Bump @fluentui/react-tabster to v9.21.2 ([PR #31321](https://github.com/microsoft/fluentui/pull/31321) by beachball)
|
|
17
|
+
- Bump @fluentui/react-portal to v9.4.24 ([PR #31321](https://github.com/microsoft/fluentui/pull/31321) by beachball)
|
|
18
|
+
|
|
7
19
|
## [9.10.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.10.3)
|
|
8
20
|
|
|
9
|
-
Mon, 06 May 2024 12:
|
|
21
|
+
Mon, 06 May 2024 12:55:02 GMT
|
|
10
22
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.10.2..@fluentui/react-dialog_v9.10.3)
|
|
11
23
|
|
|
12
24
|
### Patches
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { useFluent_unstable } from '@fluentui/react-shared-contexts';
|
|
2
|
-
import { makeResetStyles } from '@griffel/react';
|
|
3
2
|
import { useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
const useHTMLNoScrollStyles = makeResetStyles({
|
|
6
|
-
overflowY: [
|
|
7
|
-
'hidden',
|
|
8
|
-
'clip'
|
|
9
|
-
],
|
|
10
|
-
scrollbarGutter: 'stable'
|
|
11
|
-
});
|
|
3
|
+
import { useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';
|
|
12
4
|
/**
|
|
13
5
|
* hook that disables body scrolling through `overflowY: hidden` CSS property
|
|
14
6
|
*/ export function useDisableBodyScroll() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport {
|
|
1
|
+
{"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nimport { useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * hook that disables body scrolling through `overflowY: hidden` CSS property\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyle = useHTMLNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isScrollbarVisible =\n (targetDocument.defaultView?.innerWidth ?? 0) > targetDocument.documentElement.clientWidth;\n if (!isScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyle);\n return;\n }, [targetDocument, htmlNoScrollStyle]);\n\n const enableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyle);\n }, [targetDocument, htmlNoScrollStyle]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["useFluent_unstable","useCallback","useHTMLNoScrollStyles","useDisableBodyScroll","htmlNoScrollStyle","targetDocument","disableBodyScroll","isScrollbarVisible","defaultView","innerWidth","documentElement","clientWidth","classList","add","enableBodyScroll","remove"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE;;CAEC,GACD,OAAO,SAASC;IAId,MAAMC,oBAAoBF;IAC1B,MAAM,EAAEG,cAAc,EAAE,GAAGL;IAE3B,MAAMM,oBAAoBL,YAAY;YAKjCI;QAJH,IAAI,CAACA,gBAAgB;YACnB;QACF;YAEGA;QADH,MAAME,qBACJ,AAACF,CAAAA,CAAAA,0CAAAA,8BAAAA,eAAeG,WAAW,cAA1BH,kDAAAA,4BAA4BI,UAAU,cAAtCJ,oDAAAA,yCAA0C,CAAA,IAAKA,eAAeK,eAAe,CAACC,WAAW;QAC5F,IAAI,CAACJ,oBAAoB;YACvB;QACF;QACAF,eAAeK,eAAe,CAACE,SAAS,CAACC,GAAG,CAACT;QAC7C;IACF,GAAG;QAACC;QAAgBD;KAAkB;IAEtC,MAAMU,mBAAmBb,YAAY;QACnC,IAAI,CAACI,gBAAgB;YACnB;QACF;QACAA,eAAeK,eAAe,CAACE,SAAS,CAACG,MAAM,CAACX;IAClD,GAAG;QAACC;QAAgBD;KAAkB;IAEtC,OAAO;QACLE;QACAQ;IACF;AACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { __resetStyles } from '@griffel/react';
|
|
2
|
+
// this style must be applied to the html element to disable scrolling
|
|
3
|
+
export const useHTMLNoScrollStyles = /*#__PURE__*/__resetStyles("r6pzz3z", null, [".r6pzz3z{overflow-y:hidden;overflow-y:clip;scrollbar-gutter:stable;}"]);
|
|
4
|
+
//# sourceMappingURL=useDisableBodyScroll.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__resetStyles","useHTMLNoScrollStyles"],"sources":["useDisableBodyScroll.styles.js"],"sourcesContent":["import { makeResetStyles } from '@griffel/react';\n// this style must be applied to the html element to disable scrolling\nexport const useHTMLNoScrollStyles = makeResetStyles({\n overflowY: [\n 'hidden',\n 'clip'\n ],\n scrollbarGutter: 'stable'\n});\n"],"mappings":"AAAA,SAAAA,aAAA,QAAgC,gBAAgB;AAChD;AACA,OAAO,MAAMC,qBAAqB,gBAAGD,aAAA,0FAMpC,CAAC"}
|
|
@@ -9,20 +9,12 @@ Object.defineProperty(exports, "useDisableBodyScroll", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
12
|
-
const _react = require("
|
|
13
|
-
const
|
|
14
|
-
// this style must be applied to the html element to disable scrolling
|
|
15
|
-
const useHTMLNoScrollStyles = (0, _react.makeResetStyles)({
|
|
16
|
-
overflowY: [
|
|
17
|
-
'hidden',
|
|
18
|
-
'clip'
|
|
19
|
-
],
|
|
20
|
-
scrollbarGutter: 'stable'
|
|
21
|
-
});
|
|
12
|
+
const _react = require("react");
|
|
13
|
+
const _useDisableBodyScrollstyles = require("./useDisableBodyScroll.styles");
|
|
22
14
|
function useDisableBodyScroll() {
|
|
23
|
-
const htmlNoScrollStyle = useHTMLNoScrollStyles();
|
|
15
|
+
const htmlNoScrollStyle = (0, _useDisableBodyScrollstyles.useHTMLNoScrollStyles)();
|
|
24
16
|
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
25
|
-
const disableBodyScroll = (0,
|
|
17
|
+
const disableBodyScroll = (0, _react.useCallback)(()=>{
|
|
26
18
|
var _targetDocument_defaultView;
|
|
27
19
|
if (!targetDocument) {
|
|
28
20
|
return;
|
|
@@ -38,7 +30,7 @@ function useDisableBodyScroll() {
|
|
|
38
30
|
targetDocument,
|
|
39
31
|
htmlNoScrollStyle
|
|
40
32
|
]);
|
|
41
|
-
const enableBodyScroll = (0,
|
|
33
|
+
const enableBodyScroll = (0, _react.useCallback)(()=>{
|
|
42
34
|
if (!targetDocument) {
|
|
43
35
|
return;
|
|
44
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDisableBodyScroll.js"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport {
|
|
1
|
+
{"version":3,"sources":["useDisableBodyScroll.js"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\nimport { useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n/**\n * hook that disables body scrolling through `overflowY: hidden` CSS property\n */ export function useDisableBodyScroll() {\n const htmlNoScrollStyle = useHTMLNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n const disableBodyScroll = useCallback(()=>{\n var _targetDocument_defaultView;\n if (!targetDocument) {\n return;\n }\n var _targetDocument_defaultView_innerWidth;\n const isScrollbarVisible = ((_targetDocument_defaultView_innerWidth = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerWidth) !== null && _targetDocument_defaultView_innerWidth !== void 0 ? _targetDocument_defaultView_innerWidth : 0) > targetDocument.documentElement.clientWidth;\n if (!isScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyle);\n return;\n }, [\n targetDocument,\n htmlNoScrollStyle\n ]);\n const enableBodyScroll = useCallback(()=>{\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyle);\n }, [\n targetDocument,\n htmlNoScrollStyle\n ]);\n return {\n disableBodyScroll,\n enableBodyScroll\n };\n}\n"],"names":["useDisableBodyScroll","htmlNoScrollStyle","useHTMLNoScrollStyles","targetDocument","useFluent_unstable","disableBodyScroll","useCallback","_targetDocument_defaultView","_targetDocument_defaultView_innerWidth","isScrollbarVisible","defaultView","innerWidth","documentElement","clientWidth","classList","add","enableBodyScroll","remove"],"mappings":";;;;+BAKoBA;;;eAAAA;;;qCALe;uBACP;4CACU;AAG3B,SAASA;IAChB,MAAMC,oBAAoBC,IAAAA,iDAAqB;IAC/C,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAkB;IAC7C,MAAMC,oBAAoBC,IAAAA,kBAAW,EAAC;QAClC,IAAIC;QACJ,IAAI,CAACJ,gBAAgB;YACjB;QACJ;QACA,IAAIK;QACJ,MAAMC,qBAAqB,AAAC,CAAA,AAACD,CAAAA,yCAAyC,AAACD,CAAAA,8BAA8BJ,eAAeO,WAAW,AAAD,MAAO,QAAQH,gCAAgC,KAAK,IAAI,KAAK,IAAIA,4BAA4BI,UAAU,AAAD,MAAO,QAAQH,2CAA2C,KAAK,IAAIA,yCAAyC,CAAA,IAAKL,eAAeS,eAAe,CAACC,WAAW;QAC/X,IAAI,CAACJ,oBAAoB;YACrB;QACJ;QACAN,eAAeS,eAAe,CAACE,SAAS,CAACC,GAAG,CAACd;QAC7C;IACJ,GAAG;QACCE;QACAF;KACH;IACD,MAAMe,mBAAmBV,IAAAA,kBAAW,EAAC;QACjC,IAAI,CAACH,gBAAgB;YACjB;QACJ;QACAA,eAAeS,eAAe,CAACE,SAAS,CAACG,MAAM,CAAChB;IACpD,GAAG;QACCE;QACAF;KACH;IACD,OAAO;QACHI;QACAW;IACJ;AACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useHTMLNoScrollStyles", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useHTMLNoScrollStyles;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _react = require("@griffel/react");
|
|
12
|
+
const useHTMLNoScrollStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r6pzz3z", null, [
|
|
13
|
+
".r6pzz3z{overflow-y:hidden;overflow-y:clip;scrollbar-gutter:stable;}"
|
|
14
|
+
]); //# sourceMappingURL=useDisableBodyScroll.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useDisableBodyScroll.styles.js"],"sourcesContent":["import { __resetStyles } from '@griffel/react';\n// this style must be applied to the html element to disable scrolling\nexport const useHTMLNoScrollStyles = /*#__PURE__*/__resetStyles(\"r6pzz3z\", null, [\".r6pzz3z{overflow-y:hidden;overflow-y:clip;scrollbar-gutter:stable;}\"]);\n//# sourceMappingURL=useDisableBodyScroll.styles.js.map"],"names":["useHTMLNoScrollStyles","__resetStyles"],"mappings":";;;;+BAEaA;;;eAAAA;;;uBAFiB;AAEvB,MAAMA,wBAAwB,WAAW,GAAEC,IAAAA,oBAAa,EAAC,WAAW,MAAM;IAAC;CAAuE,GACzJ,uDAAuD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-dialog",
|
|
3
|
-
"version": "9.10.
|
|
3
|
+
"version": "9.10.4",
|
|
4
4
|
"description": "Dialog component for Fluent UI React",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@fluentui/keyboard-keys": "^9.0.7",
|
|
47
47
|
"@fluentui/react-context-selector": "^9.1.59",
|
|
48
48
|
"@fluentui/react-shared-contexts": "^9.18.0",
|
|
49
|
-
"@fluentui/react-aria": "^9.11.
|
|
49
|
+
"@fluentui/react-aria": "^9.11.2",
|
|
50
50
|
"@fluentui/react-icons": "^2.0.237",
|
|
51
|
-
"@fluentui/react-tabster": "^9.21.
|
|
51
|
+
"@fluentui/react-tabster": "^9.21.2",
|
|
52
52
|
"@fluentui/react-theme": "^9.1.19",
|
|
53
|
-
"@fluentui/react-portal": "^9.4.
|
|
53
|
+
"@fluentui/react-portal": "^9.4.24",
|
|
54
54
|
"@griffel/react": "^1.5.14",
|
|
55
55
|
"@swc/helpers": "^0.5.1"
|
|
56
56
|
},
|