@fluentui/react-tabster 9.12.8 → 9.12.10

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,37 @@
2
2
  "name": "@fluentui/react-tabster",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 06 Sep 2023 13:27:23 GMT",
5
+ "date": "Wed, 20 Sep 2023 14:13:59 GMT",
6
+ "tag": "@fluentui/react-tabster_v9.12.10",
7
+ "version": "9.12.10",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-tabster",
13
+ "comment": "Bump @fluentui/react-shared-contexts to v9.8.0",
14
+ "commit": "c60d4e7169457535c8d23701f6b951d1fff478ab"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 12 Sep 2023 08:51:33 GMT",
21
+ "tag": "@fluentui/react-tabster_v9.12.9",
22
+ "version": "9.12.9",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "lingfangao@hotmail.com",
27
+ "package": "@fluentui/react-tabster",
28
+ "commit": "bb8a191dbdd562a2ef077c1bd5fa3dbfd00f0fdf",
29
+ "comment": "fix: don't apply modalizer attributes when focus trap isn't configured"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Wed, 06 Sep 2023 13:31:31 GMT",
6
36
  "tag": "@fluentui/react-tabster_v9.12.8",
7
37
  "version": "9.12.8",
8
38
  "comments": {
@@ -11,7 +41,7 @@
11
41
  "author": "beachball",
12
42
  "package": "@fluentui/react-tabster",
13
43
  "comment": "Bump @fluentui/react-utilities to v9.13.3",
14
- "commit": "8582884f9000d15185fe7b074c6fde00d84e961c"
44
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
15
45
  }
16
46
  ]
17
47
  }
package/CHANGELOG.md CHANGED
@@ -1,17 +1,35 @@
1
1
  # Change Log - @fluentui/react-tabster
2
2
 
3
- This log was last generated on Wed, 06 Sep 2023 13:27:23 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 20 Sep 2023 14:13:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.12.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.12.10)
8
+
9
+ Wed, 20 Sep 2023 14:13:59 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.12.9..@fluentui/react-tabster_v9.12.10)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-shared-contexts to v9.8.0 ([PR #29193](https://github.com/microsoft/fluentui/pull/29193) by beachball)
15
+
16
+ ## [9.12.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.12.9)
17
+
18
+ Tue, 12 Sep 2023 08:51:33 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.12.8..@fluentui/react-tabster_v9.12.9)
20
+
21
+ ### Patches
22
+
23
+ - fix: don't apply modalizer attributes when focus trap isn't configured ([PR #29110](https://github.com/microsoft/fluentui/pull/29110) by lingfangao@hotmail.com)
24
+
7
25
  ## [9.12.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.12.8)
8
26
 
9
- Wed, 06 Sep 2023 13:27:23 GMT
27
+ Wed, 06 Sep 2023 13:31:31 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.12.7..@fluentui/react-tabster_v9.12.8)
11
29
 
12
30
  ### Patches
13
31
 
14
- - Bump @fluentui/react-utilities to v9.13.3 ([PR #28988](https://github.com/microsoft/fluentui/pull/28988) by beachball)
32
+ - Bump @fluentui/react-utilities to v9.13.3 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
15
33
 
16
34
  ## [9.12.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.12.7)
17
35
 
@@ -21,11 +21,13 @@ import { useTabster } from './useTabster';
21
21
  restorer: {
22
22
  type: TabsterTypes.RestorerTypes.Source
23
23
  },
24
- modalizer: {
25
- id,
26
- isOthersAccessible: !trapFocus,
27
- isAlwaysAccessible: alwaysFocusable,
28
- isTrapped: legacyTrapFocus && trapFocus
24
+ ...trapFocus && {
25
+ modalizer: {
26
+ id,
27
+ isOthersAccessible: !trapFocus,
28
+ isAlwaysAccessible: alwaysFocusable,
29
+ isTrapped: legacyTrapFocus && trapFocus
30
+ }
29
31
  }
30
32
  });
31
33
  const triggerAttributes = useTabsterAttributes({
@@ -1 +1 @@
1
- {"version":3,"sources":["useModalAttributes.ts"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied.\n * Prefer this to `legacyTrapFocus`\n * it forbids users to tab out of the focus trap into the actual browser.\n */\n trapFocus?: boolean;\n\n /**\n * Traps focus inside the elements the attributes are applied.\n * This prop enables legacy behavior to match previous versions of Fluent and is not\n * recommended for general use.\n * Enabling `legacyTrapFocus` prevents users from tabbing out of the focus trap and into\n * the actual browser. Prefer using `trapFocus` instead of this prop.\n */\n legacyTrapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n\n /**\n * Id to use for the modalizer. An id will be generated if not provided.\n */\n id?: string;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and restorer APIs\n if (tabster) {\n getModalizer(tabster);\n getRestorer(tabster);\n }\n\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n restorer: { type: TabsterTypes.RestorerTypes.Source },\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus && trapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n restorer: { type: TabsterTypes.RestorerTypes.Target },\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"names":["useId","useTabsterAttributes","getModalizer","getRestorer","Types","TabsterTypes","useTabster","useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","id","modalAttributes","restorer","type","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"mappings":"AAAA,SAASA,KAAK,QAAQ,4BAA4B;AAClD,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,YAAY,EAAEC,WAAW,EAAEC,SAASC,YAAY,QAAQ,UAAU;AAC3E,SAASC,UAAU,QAAQ,eAAe;AA8B1C;;;;;;CAMC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,UAAqC,CAAC,CAAC;IAEvC,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAEC,eAAe,EAAE,GAAGH;IACxD,MAAMI,UAAUN;IAChB,8CAA8C;IAC9C,IAAIM,SAAS;QACXV,aAAaU;QACbT,YAAYS;IACd;IAEA,MAAMC,KAAKb,MAAM,UAAUQ,QAAQK,EAAE;IACrC,MAAMC,kBAAkBb,qBAAqB;QAC3Cc,UAAU;YAAEC,MAAMX,aAAaY,aAAa,CAACC,MAAM;QAAC;QACpDC,WAAW;YACTN;YACAO,oBAAoB,CAACX;YACrBY,oBAAoBX;YACpBY,WAAWX,mBAAmBF;QAChC;IACF;IAEA,MAAMc,oBAAoBtB,qBAAqB;QAC7Cc,UAAU;YAAEC,MAAMX,aAAaY,aAAa,CAACO,MAAM;QAAC;IACtD;IAEA,OAAO;QAAEV;QAAiBS;IAAkB;AAC9C,EAAE"}
1
+ {"version":3,"sources":["useModalAttributes.ts"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied.\n * Prefer this to `legacyTrapFocus`\n * it forbids users to tab out of the focus trap into the actual browser.\n */\n trapFocus?: boolean;\n\n /**\n * Traps focus inside the elements the attributes are applied.\n * This prop enables legacy behavior to match previous versions of Fluent and is not\n * recommended for general use.\n * Enabling `legacyTrapFocus` prevents users from tabbing out of the focus trap and into\n * the actual browser. Prefer using `trapFocus` instead of this prop.\n */\n legacyTrapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n\n /**\n * Id to use for the modalizer. An id will be generated if not provided.\n */\n id?: string;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and restorer APIs\n if (tabster) {\n getModalizer(tabster);\n getRestorer(tabster);\n }\n\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n restorer: { type: TabsterTypes.RestorerTypes.Source },\n ...(trapFocus && {\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus && trapFocus,\n },\n }),\n });\n\n const triggerAttributes = useTabsterAttributes({\n restorer: { type: TabsterTypes.RestorerTypes.Target },\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"names":["useId","useTabsterAttributes","getModalizer","getRestorer","Types","TabsterTypes","useTabster","useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","id","modalAttributes","restorer","type","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"mappings":"AAAA,SAASA,KAAK,QAAQ,4BAA4B;AAClD,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,YAAY,EAAEC,WAAW,EAAEC,SAASC,YAAY,QAAQ,UAAU;AAC3E,SAASC,UAAU,QAAQ,eAAe;AA8B1C;;;;;;CAMC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,UAAqC,CAAC,CAAC;IAEvC,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAEC,eAAe,EAAE,GAAGH;IACxD,MAAMI,UAAUN;IAChB,8CAA8C;IAC9C,IAAIM,SAAS;QACXV,aAAaU;QACbT,YAAYS;IACd;IAEA,MAAMC,KAAKb,MAAM,UAAUQ,QAAQK,EAAE;IACrC,MAAMC,kBAAkBb,qBAAqB;QAC3Cc,UAAU;YAAEC,MAAMX,aAAaY,aAAa,CAACC,MAAM;QAAC;QACpD,GAAIT,aAAa;YACfU,WAAW;gBACTN;gBACAO,oBAAoB,CAACX;gBACrBY,oBAAoBX;gBACpBY,WAAWX,mBAAmBF;YAChC;QACF,CAAC;IACH;IAEA,MAAMc,oBAAoBtB,qBAAqB;QAC7Cc,UAAU;YAAEC,MAAMX,aAAaY,aAAa,CAACO,MAAM;QAAC;IACtD;IAEA,OAAO;QAAEV;QAAiBS;IAAkB;AAC9C,EAAE"}
@@ -25,11 +25,13 @@ const useModalAttributes = (options = {})=>{
25
25
  restorer: {
26
26
  type: _tabster.Types.RestorerTypes.Source
27
27
  },
28
- modalizer: {
29
- id,
30
- isOthersAccessible: !trapFocus,
31
- isAlwaysAccessible: alwaysFocusable,
32
- isTrapped: legacyTrapFocus && trapFocus
28
+ ...trapFocus && {
29
+ modalizer: {
30
+ id,
31
+ isOthersAccessible: !trapFocus,
32
+ isAlwaysAccessible: alwaysFocusable,
33
+ isTrapped: legacyTrapFocus && trapFocus
34
+ }
33
35
  }
34
36
  });
35
37
  const triggerAttributes = (0, _useTabsterAttributes.useTabsterAttributes)({
@@ -1 +1 @@
1
- {"version":3,"sources":["useModalAttributes.js"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */ export const useModalAttributes = (options = {})=>{\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and restorer APIs\n if (tabster) {\n getModalizer(tabster);\n getRestorer(tabster);\n }\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n restorer: {\n type: TabsterTypes.RestorerTypes.Source\n },\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus && trapFocus\n }\n });\n const triggerAttributes = useTabsterAttributes({\n restorer: {\n type: TabsterTypes.RestorerTypes.Target\n }\n });\n return {\n modalAttributes,\n triggerAttributes\n };\n};\n"],"names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster","getModalizer","getRestorer","id","useId","modalAttributes","useTabsterAttributes","restorer","type","TabsterTypes","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"mappings":";;;;+BAUiBA;;;eAAAA;;;gCAVK;sCACe;yBAC4B;4BACtC;AAOhB,MAAMA,qBAAqB,CAACC,UAAU,CAAC,CAAC;IAC/C,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAEC,eAAe,EAAE,GAAGH;IACxD,MAAMI,UAAUC,IAAAA,sBAAU;IAC1B,8CAA8C;IAC9C,IAAID,SAAS;QACTE,IAAAA,qBAAY,EAACF;QACbG,IAAAA,oBAAW,EAACH;IAChB;IACA,MAAMI,KAAKC,IAAAA,qBAAK,EAAC,UAAUT,QAAQQ,EAAE;IACrC,MAAME,kBAAkBC,IAAAA,0CAAoB,EAAC;QACzCC,UAAU;YACNC,MAAMC,cAAY,CAACC,aAAa,CAACC,MAAM;QAC3C;QACAC,WAAW;YACPT;YACAU,oBAAoB,CAACjB;YACrBkB,oBAAoBjB;YACpBkB,WAAWjB,mBAAmBF;QAClC;IACJ;IACA,MAAMoB,oBAAoBV,IAAAA,0CAAoB,EAAC;QAC3CC,UAAU;YACNC,MAAMC,cAAY,CAACC,aAAa,CAACO,MAAM;QAC3C;IACJ;IACA,OAAO;QACHZ;QACAW;IACJ;AACJ"}
1
+ {"version":3,"sources":["useModalAttributes.js"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */ export const useModalAttributes = (options = {})=>{\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and restorer APIs\n if (tabster) {\n getModalizer(tabster);\n getRestorer(tabster);\n }\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n restorer: {\n type: TabsterTypes.RestorerTypes.Source\n },\n ...trapFocus && {\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus && trapFocus\n }\n }\n });\n const triggerAttributes = useTabsterAttributes({\n restorer: {\n type: TabsterTypes.RestorerTypes.Target\n }\n });\n return {\n modalAttributes,\n triggerAttributes\n };\n};\n"],"names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster","getModalizer","getRestorer","id","useId","modalAttributes","useTabsterAttributes","restorer","type","TabsterTypes","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"mappings":";;;;+BAUiBA;;;eAAAA;;;gCAVK;sCACe;yBAC4B;4BACtC;AAOhB,MAAMA,qBAAqB,CAACC,UAAU,CAAC,CAAC;IAC/C,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAEC,eAAe,EAAE,GAAGH;IACxD,MAAMI,UAAUC,IAAAA,sBAAU;IAC1B,8CAA8C;IAC9C,IAAID,SAAS;QACTE,IAAAA,qBAAY,EAACF;QACbG,IAAAA,oBAAW,EAACH;IAChB;IACA,MAAMI,KAAKC,IAAAA,qBAAK,EAAC,UAAUT,QAAQQ,EAAE;IACrC,MAAME,kBAAkBC,IAAAA,0CAAoB,EAAC;QACzCC,UAAU;YACNC,MAAMC,cAAY,CAACC,aAAa,CAACC,MAAM;QAC3C;QACA,GAAGf,aAAa;YACZgB,WAAW;gBACPT;gBACAU,oBAAoB,CAACjB;gBACrBkB,oBAAoBjB;gBACpBkB,WAAWjB,mBAAmBF;YAClC;QACJ,CAAC;IACL;IACA,MAAMoB,oBAAoBV,IAAAA,0CAAoB,EAAC;QAC3CC,UAAU;YACNC,MAAMC,cAAY,CAACC,aAAa,CAACO,MAAM;QAC3C;IACJ;IACA,OAAO;QACHZ;QACAW;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabster",
3
- "version": "9.12.8",
3
+ "version": "9.12.10",
4
4
  "description": "Utilities for focus management and facade for tabster",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/react-shared-contexts": "^9.7.3",
34
+ "@fluentui/react-shared-contexts": "^9.8.0",
35
35
  "@fluentui/react-theme": "^9.1.12",
36
36
  "@fluentui/react-utilities": "^9.13.3",
37
37
  "@griffel/react": "^1.5.14",