@fluentui/react-dialog 9.5.0 → 9.5.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,7 +2,52 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 06 Apr 2023 23:59:47 GMT",
5
+ "date": "Wed, 12 Apr 2023 09:28:15 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.5.1",
7
+ "version": "9.5.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "841ea75d516d85b88eb826030718c19c3239ee4d",
14
+ "comment": "fix: use tabster to focus on trigger, instead of manually invoking .focus"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-dialog",
19
+ "comment": "Bump @fluentui/react-utilities to v9.7.4",
20
+ "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-dialog",
25
+ "comment": "Bump @fluentui/react-context-selector to v9.1.17",
26
+ "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-dialog",
31
+ "comment": "Bump @fluentui/react-aria to v9.3.17",
32
+ "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-dialog",
37
+ "comment": "Bump @fluentui/react-tabster to v9.6.4",
38
+ "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-dialog",
43
+ "comment": "Bump @fluentui/react-portal to v9.2.5",
44
+ "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Fri, 07 Apr 2023 00:01:38 GMT",
6
51
  "tag": "@fluentui/react-dialog_v9.5.0",
7
52
  "version": "9.5.0",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,26 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Thu, 06 Apr 2023 23:59:47 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 12 Apr 2023 09:28:15 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.1)
8
+
9
+ Wed, 12 Apr 2023 09:28:15 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.5.0..@fluentui/react-dialog_v9.5.1)
11
+
12
+ ### Patches
13
+
14
+ - fix: use tabster to focus on trigger, instead of manually invoking .focus ([PR #27512](https://github.com/microsoft/fluentui/pull/27512) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-utilities to v9.7.4 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.17 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
17
+ - Bump @fluentui/react-aria to v9.3.17 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.6.4 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
19
+ - Bump @fluentui/react-portal to v9.2.5 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
20
+
7
21
  ## [9.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.5.0)
8
22
 
9
- Thu, 06 Apr 2023 23:59:47 GMT
23
+ Fri, 07 Apr 2023 00:01:38 GMT
10
24
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.4.3..@fluentui/react-dialog_v9.5.0)
11
25
 
12
26
  ### Minor changes
@@ -12,13 +12,10 @@ export function useFocusFirstElement(open, modalType) {
12
12
  targetDocument
13
13
  } = useFluent_unstable();
14
14
  const dialogRef = React.useRef(null);
15
- const triggerRef = React.useRef();
16
15
  React.useEffect(() => {
17
16
  if (!open) {
18
- var _triggerRef_current;
19
- return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
17
+ return;
20
18
  }
21
- triggerRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
22
19
  const element = dialogRef.current && findFirstFocusable(dialogRef.current);
23
20
  if (element) {
24
21
  element.focus();
@@ -1 +1 @@
1
- {"version":3,"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","triggerRef","useEffect","_triggerRef_current","current","focus","activeElement","element","_dialogRef_current","process","env","NODE_ENV","console","warn","join"],"sources":["../../src/utils/useFocusFirstElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n const triggerRef = React.useRef<HTMLElement>();\n\n React.useEffect(() => {\n if (!open) {\n return triggerRef.current?.focus();\n }\n triggerRef.current = targetDocument?.activeElement as HTMLElement | undefined;\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.',\n 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`',\n ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AAInC;;;AAGA,OAAO,SAASC,qBAAqBC,IAAa,EAAEC,SAA0B,EAAE;EAC9E,MAAM;IAAEC;EAAkB,CAAE,GAAGL,eAAA;EAC/B,MAAM;IAAEM;EAAc,CAAE,GAAGL,kBAAA;EAC3B,MAAMM,SAAA,GAAYR,KAAA,CAAMS,MAAM,CAAuB,IAAI;EACzD,MAAMC,UAAA,GAAaV,KAAA,CAAMS,MAAM;EAE/BT,KAAA,CAAMW,SAAS,CAAC,MAAM;IACpB,IAAI,CAACP,IAAA,EAAM;UACFQ,mBAAA;MAAP,OAAO,CAAAA,mBAAA,GAAAF,UAAA,CAAWG,OAAO,cAAlBD,mBAAA,uBAAAA,mBAAA,CAAoBE,KAAA;IAC7B;IACAJ,UAAA,CAAWG,OAAO,GAAGN,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBQ,aAAa;IAClD,MAAMC,OAAA,GAAUR,SAAA,CAAUK,OAAO,IAAIP,kBAAA,CAAmBE,SAAA,CAAUK,OAAO;IACzE,IAAIG,OAAA,EAAS;MACXA,OAAA,CAAQF,KAAK;IACf,OAAO;UACLG,kBAAA;MAAA,CAAAA,kBAAA,GAAAT,SAAA,CAAUK,OAAO,cAAjBI,kBAAA,uBAAAA,kBAAA,CAAmBH,KAAA,IAAS;MAC5B,IAAII,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;QACAC,OAAA,CAAQC,IAAI,CACV,CACE,qGACA,mGACD,CAACC,IAAI,CAAC;MAEX;IACF;EACF,GAAG,CAACjB,kBAAA,EAAoBF,IAAA,EAAMC,SAAA,EAAWE,cAAA,CAAe;EAExD,OAAOC,SAAA;AACT"}
1
+ {"version":3,"names":["React","useFocusFinders","useFluent_unstable","useFocusFirstElement","open","modalType","findFirstFocusable","targetDocument","dialogRef","useRef","useEffect","element","current","focus","_dialogRef_current","process","env","NODE_ENV","console","warn","join"],"sources":["../../src/utils/useFocusFirstElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\nimport type { DialogSurfaceElement } from '../DialogSurface';\nimport type { DialogModalType } from '../Dialog';\n\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open: boolean, modalType: DialogModalType) {\n const { findFirstFocusable } = useFocusFinders();\n const { targetDocument } = useFluent_unstable();\n const dialogRef = React.useRef<DialogSurfaceElement>(null);\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n dialogRef.current?.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n [\n '@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.',\n 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`',\n ].join('\\n'),\n );\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n\n return dialogRef;\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AAInC;;;AAGA,OAAO,SAASC,qBAAqBC,IAAa,EAAEC,SAA0B,EAAE;EAC9E,MAAM;IAAEC;EAAkB,CAAE,GAAGL,eAAA;EAC/B,MAAM;IAAEM;EAAc,CAAE,GAAGL,kBAAA;EAC3B,MAAMM,SAAA,GAAYR,KAAA,CAAMS,MAAM,CAAuB,IAAI;EAEzDT,KAAA,CAAMU,SAAS,CAAC,MAAM;IACpB,IAAI,CAACN,IAAA,EAAM;MACT;IACF;IACA,MAAMO,OAAA,GAAUH,SAAA,CAAUI,OAAO,IAAIN,kBAAA,CAAmBE,SAAA,CAAUI,OAAO;IACzE,IAAID,OAAA,EAAS;MACXA,OAAA,CAAQE,KAAK;IACf,OAAO;UACLC,kBAAA;MAAA,CAAAA,kBAAA,GAAAN,SAAA,CAAUI,OAAO,cAAjBE,kBAAA,uBAAAA,kBAAA,CAAmBD,KAAA,IAAS;MAC5B,IAAIE,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC;QACAC,OAAA,CAAQC,IAAI,CACV,CACE,qGACA,mGACD,CAACC,IAAI,CAAC;MAEX;IACF;EACF,GAAG,CAACd,kBAAA,EAAoBF,IAAA,EAAMC,SAAA,EAAWE,cAAA,CAAe;EAExD,OAAOC,SAAA;AACT"}
@@ -14,13 +14,10 @@ function useFocusFirstElement(open, modalType) {
14
14
  const { findFirstFocusable } = (0, _reactTabster.useFocusFinders)();
15
15
  const { targetDocument } = (0, _reactSharedContexts.useFluent_unstable)();
16
16
  const dialogRef = _react.useRef(null);
17
- const triggerRef = _react.useRef();
18
17
  _react.useEffect(()=>{
19
18
  if (!open) {
20
- var _triggerRef_current;
21
- return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
19
+ return;
22
20
  }
23
- triggerRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
24
21
  const element = dialogRef.current && findFirstFocusable(dialogRef.current);
25
22
  if (element) {
26
23
  element.focus();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useFocusFirstElement.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open, modalType) {\n const {\n findFirstFocusable\n } = useFocusFinders();\n const {\n targetDocument\n } = useFluent_unstable();\n const dialogRef = React.useRef(null);\n const triggerRef = React.useRef();\n React.useEffect(() => {\n if (!open) {\n var _triggerRef_current;\n return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }\n triggerRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n var _dialogRef_current;\n (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(['@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.', 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`'].join('\\n'));\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n return dialogRef;\n}\n//# sourceMappingURL=useFocusFirstElement.js.map"],"names":["useFocusFirstElement","open","modalType","findFirstFocusable","useFocusFinders","targetDocument","useFluent_unstable","dialogRef","React","useRef","triggerRef","useEffect","_triggerRef_current","current","focus","activeElement","element","_dialogRef_current","process","env","NODE_ENV","console","warn","join"],"mappings":";;;;+BAMgBA;;aAAAA;;;6DANO;8BACS;qCACG;AAI5B,SAASA,qBAAqBC,IAAI,EAAEC,SAAS,EAAE;IACpD,MAAM,EACJC,mBAAkB,EACnB,GAAGC,IAAAA,6BAAe;IACnB,MAAM,EACJC,eAAc,EACf,GAAGC,IAAAA,uCAAkB;IACtB,MAAMC,YAAYC,OAAMC,MAAM,CAAC,IAAI;IACnC,MAAMC,aAAaF,OAAMC,MAAM;IAC/BD,OAAMG,SAAS,CAAC,IAAM;QACpB,IAAI,CAACV,MAAM;YACT,IAAIW;YACJ,OAAO,AAACA,CAAAA,sBAAsBF,WAAWG,OAAO,AAAD,MAAO,IAAI,IAAID,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBE,KAAK,EAAE;QACrI,CAAC;QACDJ,WAAWG,OAAO,GAAGR,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeU,aAAa;QACjH,MAAMC,UAAUT,UAAUM,OAAO,IAAIV,mBAAmBI,UAAUM,OAAO;QACzE,IAAIG,SAAS;YACXA,QAAQF,KAAK;QACf,OAAO;YACL,IAAIG;YACHA,CAAAA,qBAAqBV,UAAUM,OAAO,AAAD,MAAO,IAAI,IAAII,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBH,KAAK,EAAE,EAAE,qDAAqD;YAC/K,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,IAAI,CAAC;oBAAC;oBAAqG;iBAAmG,CAACC,IAAI,CAAC;YAC9N,CAAC;QACH,CAAC;IACH,GAAG;QAACpB;QAAoBF;QAAMC;QAAWG;KAAe;IACxD,OAAOE;AACT,EACA,gDAAgD"}
1
+ {"version":3,"sources":["../../lib/utils/useFocusFirstElement.js"],"sourcesContent":["import * as React from 'react';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Focus first element on content when dialog is opened,\n */\nexport function useFocusFirstElement(open, modalType) {\n const {\n findFirstFocusable\n } = useFocusFinders();\n const {\n targetDocument\n } = useFluent_unstable();\n const dialogRef = React.useRef(null);\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const element = dialogRef.current && findFirstFocusable(dialogRef.current);\n if (element) {\n element.focus();\n } else {\n var _dialogRef_current;\n (_dialogRef_current = dialogRef.current) === null || _dialogRef_current === void 0 ? void 0 : _dialogRef_current.focus(); // https://github.com/microsoft/fluentui/issues/25150\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(['@fluentui/react-dialog: a Dialog should have at least one focusable element inside DialogSurface.', 'Please add at least a close button either on `DialogTitle` action slot or inside `DialogActions`'].join('\\n'));\n }\n }\n }, [findFirstFocusable, open, modalType, targetDocument]);\n return dialogRef;\n}\n//# sourceMappingURL=useFocusFirstElement.js.map"],"names":["useFocusFirstElement","open","modalType","findFirstFocusable","useFocusFinders","targetDocument","useFluent_unstable","dialogRef","React","useRef","useEffect","element","current","focus","_dialogRef_current","process","env","NODE_ENV","console","warn","join"],"mappings":";;;;+BAMgBA;;aAAAA;;;6DANO;8BACS;qCACG;AAI5B,SAASA,qBAAqBC,IAAI,EAAEC,SAAS,EAAE;IACpD,MAAM,EACJC,mBAAkB,EACnB,GAAGC,IAAAA,6BAAe;IACnB,MAAM,EACJC,eAAc,EACf,GAAGC,IAAAA,uCAAkB;IACtB,MAAMC,YAAYC,OAAMC,MAAM,CAAC,IAAI;IACnCD,OAAME,SAAS,CAAC,IAAM;QACpB,IAAI,CAACT,MAAM;YACT;QACF,CAAC;QACD,MAAMU,UAAUJ,UAAUK,OAAO,IAAIT,mBAAmBI,UAAUK,OAAO;QACzE,IAAID,SAAS;YACXA,QAAQE,KAAK;QACf,OAAO;YACL,IAAIC;YACHA,CAAAA,qBAAqBP,UAAUK,OAAO,AAAD,MAAO,IAAI,IAAIE,uBAAuB,KAAK,IAAI,KAAK,IAAIA,mBAAmBD,KAAK,EAAE,EAAE,qDAAqD;YAC/K,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,sCAAsC;gBACtCC,QAAQC,IAAI,CAAC;oBAAC;oBAAqG;iBAAmG,CAACC,IAAI,CAAC;YAC9N,CAAC;QACH,CAAC;IACH,GAAG;QAACjB;QAAoBF;QAAMC;QAAWG;KAAe;IACxD,OAAOE;AACT,EACA,gDAAgD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.5.0",
3
+ "version": "9.5.1",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@griffel/react": "^1.5.2",
39
- "@fluentui/react-utilities": "^9.7.3",
39
+ "@fluentui/react-utilities": "^9.7.4",
40
40
  "@fluentui/keyboard-keys": "^9.0.2",
41
- "@fluentui/react-context-selector": "^9.1.16",
41
+ "@fluentui/react-context-selector": "^9.1.17",
42
42
  "@fluentui/react-shared-contexts": "^9.3.3",
43
- "@fluentui/react-aria": "^9.3.16",
43
+ "@fluentui/react-aria": "^9.3.17",
44
44
  "@fluentui/react-icons": "^2.0.196",
45
- "@fluentui/react-tabster": "^9.6.3",
45
+ "@fluentui/react-tabster": "^9.6.4",
46
46
  "@fluentui/react-theme": "^9.1.7",
47
- "@fluentui/react-portal": "^9.2.4",
47
+ "@fluentui/react-portal": "^9.2.5",
48
48
  "@swc/helpers": "^0.4.14"
49
49
  },
50
50
  "peerDependencies": {