@fluentui/react-dialog 9.11.13 → 9.11.14

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 CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Tue, 10 Sep 2024 10:15:06 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 13 Sep 2024 00:48:48 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.11.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.11.14)
8
+
9
+ Fri, 13 Sep 2024 00:48:48 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.11.13..@fluentui/react-dialog_v9.11.14)
11
+
12
+ ### Patches
13
+
14
+ - fix: Adjust window height comparison in fractional cases. ([PR #32480](https://github.com/microsoft/fluentui/pull/32480) by owcampbe@microsoft.com)
15
+
7
16
  ## [9.11.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.11.13)
8
17
 
9
- Tue, 10 Sep 2024 10:15:06 GMT
18
+ Tue, 10 Sep 2024 10:19:06 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.11.12..@fluentui/react-dialog_v9.11.13)
11
20
 
12
21
  ### Patches
@@ -14,7 +14,9 @@ import { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodySc
14
14
  return;
15
15
  }
16
16
  var _targetDocument_defaultView_innerHeight;
17
- const isHorizontalScrollbarVisible = targetDocument.body.clientHeight > ((_targetDocument_defaultView_innerHeight = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerHeight) !== null && _targetDocument_defaultView_innerHeight !== void 0 ? _targetDocument_defaultView_innerHeight : 0);
17
+ const isHorizontalScrollbarVisible = // When the window is a fractional height, `innerHeight` always rounds down but `clientHeight` rounds either up or down depending on the value.
18
+ // To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.
19
+ Math.floor(targetDocument.body.getBoundingClientRect().height) > ((_targetDocument_defaultView_innerHeight = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerHeight) !== null && _targetDocument_defaultView_innerHeight !== void 0 ? _targetDocument_defaultView_innerHeight : 0);
18
20
  if (!isHorizontalScrollbarVisible) {
19
21
  return;
20
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nimport { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * @internal\n * A React *hook* that disables body scrolling through `overflowY: hidden` CSS property\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyles = useHTMLNoScrollStyles();\n const bodyNoScrollStyles = useBodyNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isHorizontalScrollbarVisible =\n targetDocument.body.clientHeight > (targetDocument.defaultView?.innerHeight ?? 0);\n if (!isHorizontalScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyles);\n targetDocument.body.classList.add(bodyNoScrollStyles);\n return;\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n const enableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyles);\n targetDocument.body.classList.remove(bodyNoScrollStyles);\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["useFluent_unstable","useCallback","useBodyNoScrollStyles","useHTMLNoScrollStyles","useDisableBodyScroll","htmlNoScrollStyles","bodyNoScrollStyles","targetDocument","disableBodyScroll","isHorizontalScrollbarVisible","body","clientHeight","defaultView","innerHeight","documentElement","classList","add","enableBodyScroll","remove"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,SAASC,qBAAqB,EAAEC,qBAAqB,QAAQ,gCAAgC;AAE7F;;;CAGC,GACD,OAAO,SAASC;IAId,MAAMC,qBAAqBF;IAC3B,MAAMG,qBAAqBJ;IAC3B,MAAM,EAAEK,cAAc,EAAE,GAAGP;IAE3B,MAAMQ,oBAAoBP,YAAY;YAKEM;QAJtC,IAAI,CAACA,gBAAgB;YACnB;QACF;YAEsCA;QADtC,MAAME,+BACJF,eAAeG,IAAI,CAACC,YAAY,GAAIJ,CAAAA,CAAAA,2CAAAA,8BAAAA,eAAeK,WAAW,cAA1BL,kDAAAA,4BAA4BM,WAAW,cAAvCN,qDAAAA,0CAA2C,CAAA;QACjF,IAAI,CAACE,8BAA8B;YACjC;QACF;QACAF,eAAeO,eAAe,CAACC,SAAS,CAACC,GAAG,CAACX;QAC7CE,eAAeG,IAAI,CAACK,SAAS,CAACC,GAAG,CAACV;QAClC;IACF,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,MAAMW,mBAAmBhB,YAAY;QACnC,IAAI,CAACM,gBAAgB;YACnB;QACF;QACAA,eAAeO,eAAe,CAACC,SAAS,CAACG,MAAM,CAACb;QAChDE,eAAeG,IAAI,CAACK,SAAS,CAACG,MAAM,CAACZ;IACvC,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,OAAO;QACLE;QACAS;IACF;AACF"}
1
+ {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nimport { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * @internal\n * A React *hook* that disables body scrolling through `overflowY: hidden` CSS property\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyles = useHTMLNoScrollStyles();\n const bodyNoScrollStyles = useBodyNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isHorizontalScrollbarVisible =\n // When the window is a fractional height, `innerHeight` always rounds down but `clientHeight` rounds either up or down depending on the value.\n // To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.\n Math.floor(targetDocument.body.getBoundingClientRect().height) > (targetDocument.defaultView?.innerHeight ?? 0);\n if (!isHorizontalScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyles);\n targetDocument.body.classList.add(bodyNoScrollStyles);\n return;\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n const enableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyles);\n targetDocument.body.classList.remove(bodyNoScrollStyles);\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["useFluent_unstable","useCallback","useBodyNoScrollStyles","useHTMLNoScrollStyles","useDisableBodyScroll","htmlNoScrollStyles","bodyNoScrollStyles","targetDocument","disableBodyScroll","isHorizontalScrollbarVisible","Math","floor","body","getBoundingClientRect","height","defaultView","innerHeight","documentElement","classList","add","enableBodyScroll","remove"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,WAAW,QAAQ,QAAQ;AAEpC,SAASC,qBAAqB,EAAEC,qBAAqB,QAAQ,gCAAgC;AAE7F;;;CAGC,GACD,OAAO,SAASC;IAId,MAAMC,qBAAqBF;IAC3B,MAAMG,qBAAqBJ;IAC3B,MAAM,EAAEK,cAAc,EAAE,GAAGP;IAE3B,MAAMQ,oBAAoBP,YAAY;YAOgCM;QANpE,IAAI,CAACA,gBAAgB;YACnB;QACF;YAIoEA;QAHpE,MAAME,+BACJ,+IAA+I;QAC/I,oJAAoJ;QACpJC,KAAKC,KAAK,CAACJ,eAAeK,IAAI,CAACC,qBAAqB,GAAGC,MAAM,IAAKP,CAAAA,CAAAA,2CAAAA,8BAAAA,eAAeQ,WAAW,cAA1BR,kDAAAA,4BAA4BS,WAAW,cAAvCT,qDAAAA,0CAA2C,CAAA;QAC/G,IAAI,CAACE,8BAA8B;YACjC;QACF;QACAF,eAAeU,eAAe,CAACC,SAAS,CAACC,GAAG,CAACd;QAC7CE,eAAeK,IAAI,CAACM,SAAS,CAACC,GAAG,CAACb;QAClC;IACF,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,MAAMc,mBAAmBnB,YAAY;QACnC,IAAI,CAACM,gBAAgB;YACnB;QACF;QACAA,eAAeU,eAAe,CAACC,SAAS,CAACG,MAAM,CAAChB;QAChDE,eAAeK,IAAI,CAACM,SAAS,CAACG,MAAM,CAACf;IACvC,GAAG;QAACC;QAAgBF;QAAoBC;KAAmB;IAE3D,OAAO;QACLE;QACAY;IACF;AACF"}
@@ -21,7 +21,8 @@ function useDisableBodyScroll() {
21
21
  return;
22
22
  }
23
23
  var _targetDocument_defaultView_innerHeight;
24
- const isHorizontalScrollbarVisible = targetDocument.body.clientHeight > ((_targetDocument_defaultView_innerHeight = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerHeight) !== null && _targetDocument_defaultView_innerHeight !== void 0 ? _targetDocument_defaultView_innerHeight : 0);
24
+ const isHorizontalScrollbarVisible = // To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.
25
+ Math.floor(targetDocument.body.getBoundingClientRect().height) > ((_targetDocument_defaultView_innerHeight = (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.innerHeight) !== null && _targetDocument_defaultView_innerHeight !== void 0 ? _targetDocument_defaultView_innerHeight : 0);
25
26
  if (!isHorizontalScrollbarVisible) {
26
27
  return;
27
28
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nimport { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * @internal\n * A React *hook* that disables body scrolling through `overflowY: hidden` CSS property\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyles = useHTMLNoScrollStyles();\n const bodyNoScrollStyles = useBodyNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isHorizontalScrollbarVisible =\n targetDocument.body.clientHeight > (targetDocument.defaultView?.innerHeight ?? 0);\n if (!isHorizontalScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyles);\n targetDocument.body.classList.add(bodyNoScrollStyles);\n return;\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n const enableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyles);\n targetDocument.body.classList.remove(bodyNoScrollStyles);\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["useDisableBodyScroll","htmlNoScrollStyles","useHTMLNoScrollStyles","bodyNoScrollStyles","useBodyNoScrollStyles","targetDocument","useFluent_unstable","disableBodyScroll","useCallback","isHorizontalScrollbarVisible","body","clientHeight","defaultView","innerHeight","documentElement","classList","add","enableBodyScroll","remove"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;qCATmB;uBACP;4CAEiC;AAMtD,SAASA;IAId,MAAMC,qBAAqBC,IAAAA,iDAAAA;IAC3B,MAAMC,qBAAqBC,IAAAA,iDAAAA;IAC3B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAE3B,MAAMC,oBAAoBC,IAAAA,kBAAAA,EAAY;YAKEH;QAJtC,IAAI,CAACA,gBAAgB;YACnB;QACF;YAEsCA;QADtC,MAAMI,+BACJJ,eAAeK,IAAI,CAACC,YAAY,GAAIN,CAAAA,CAAAA,0CAAAA,CAAAA,8BAAAA,eAAeO,WAAW,AAAXA,MAAW,QAA1BP,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA4BQ,WAAW,AAAXA,MAAW,QAAvCR,4CAAAA,KAAAA,IAAAA,0CAA2C,CAAA;QACjF,IAAI,CAACI,8BAA8B;YACjC;QACF;QACAJ,eAAeS,eAAe,CAACC,SAAS,CAACC,GAAG,CAACf;QAC7CI,eAAeK,IAAI,CAACK,SAAS,CAACC,GAAG,CAACb;QAClC;IACF,GAAG;QAACE;QAAgBJ;QAAoBE;KAAmB;IAE3D,MAAMc,mBAAmBT,IAAAA,kBAAAA,EAAY;QACnC,IAAI,CAACH,gBAAgB;YACnB;QACF;QACAA,eAAeS,eAAe,CAACC,SAAS,CAACG,MAAM,CAACjB;QAChDI,eAAeK,IAAI,CAACK,SAAS,CAACG,MAAM,CAACf;IACvC,GAAG;QAACE;QAAgBJ;QAAoBE;KAAmB;IAE3D,OAAO;QACLI;QACAU;IACF;AACF"}
1
+ {"version":3,"sources":["useDisableBodyScroll.ts"],"sourcesContent":["import { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport { useCallback } from 'react';\n\nimport { useBodyNoScrollStyles, useHTMLNoScrollStyles } from './useDisableBodyScroll.styles';\n\n/**\n * @internal\n * A React *hook* that disables body scrolling through `overflowY: hidden` CSS property\n */\nexport function useDisableBodyScroll(): {\n disableBodyScroll: () => void;\n enableBodyScroll: () => void;\n} {\n const htmlNoScrollStyles = useHTMLNoScrollStyles();\n const bodyNoScrollStyles = useBodyNoScrollStyles();\n const { targetDocument } = useFluent_unstable();\n\n const disableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n const isHorizontalScrollbarVisible =\n // When the window is a fractional height, `innerHeight` always rounds down but `clientHeight` rounds either up or down depending on the value.\n // To properly compare the body clientHeight to the window innerHeight, manually round down the fractional value to match innerHeight's calculation.\n Math.floor(targetDocument.body.getBoundingClientRect().height) > (targetDocument.defaultView?.innerHeight ?? 0);\n if (!isHorizontalScrollbarVisible) {\n return;\n }\n targetDocument.documentElement.classList.add(htmlNoScrollStyles);\n targetDocument.body.classList.add(bodyNoScrollStyles);\n return;\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n const enableBodyScroll = useCallback(() => {\n if (!targetDocument) {\n return;\n }\n targetDocument.documentElement.classList.remove(htmlNoScrollStyles);\n targetDocument.body.classList.remove(bodyNoScrollStyles);\n }, [targetDocument, htmlNoScrollStyles, bodyNoScrollStyles]);\n\n return {\n disableBodyScroll,\n enableBodyScroll,\n };\n}\n"],"names":["useDisableBodyScroll","htmlNoScrollStyles","useHTMLNoScrollStyles","bodyNoScrollStyles","useBodyNoScrollStyles","targetDocument","useFluent_unstable","disableBodyScroll","useCallback","isHorizontalScrollbarVisible","Math","floor","body","getBoundingClientRect","height","defaultView","innerHeight","documentElement","classList","add","enableBodyScroll","remove"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;qCATmB;uBACP;4CAEiC;AAMtD,SAASA;IAId,MAAMC,qBAAqBC,IAAAA,iDAAAA;IAC3B,MAAMC,qBAAqBC,IAAAA,iDAAAA;IAC3B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAE3B,MAAMC,oBAAoBC,IAAAA,kBAAAA,EAAY;YAOgCH;QANpE,IAAI,CAACA,gBAAgB;YACnB;QACF;YAIoEA;QAHpE,MAAMI,+BAEJ,oJAAoJ;QACpJC,KAAKC,KAAK,CAACN,eAAeO,IAAI,CAACC,qBAAqB,GAAGC,MAAM,IAAKT,CAAAA,CAAAA,0CAAAA,CAAAA,8BAAAA,eAAeU,WAAW,AAAXA,MAAW,QAA1BV,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA4BW,WAAW,AAAXA,MAAW,QAAvCX,4CAAAA,KAAAA,IAAAA,0CAA2C,CAAA;QAC/G,IAAI,CAACI,8BAA8B;YACjC;QACF;QACAJ,eAAeY,eAAe,CAACC,SAAS,CAACC,GAAG,CAAClB;QAC7CI,eAAeO,IAAI,CAACM,SAAS,CAACC,GAAG,CAAChB;QAClC;IACF,GAAG;QAACE;QAAgBJ;QAAoBE;KAAmB;IAE3D,MAAMiB,mBAAmBZ,IAAAA,kBAAAA,EAAY;QACnC,IAAI,CAACH,gBAAgB;YACnB;QACF;QACAA,eAAeY,eAAe,CAACC,SAAS,CAACG,MAAM,CAACpB;QAChDI,eAAeO,IAAI,CAACM,SAAS,CAACG,MAAM,CAAClB;IACvC,GAAG;QAACE;QAAgBJ;QAAoBE;KAAmB;IAE3D,OAAO;QACLI;QACAa;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.11.13",
3
+ "version": "9.11.14",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",