@fluentui/react-tabster 9.3.7 → 9.4.0
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 +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/index.d.ts +4 -0
- package/lib/hooks/useModalAttributes.js +1 -1
- package/lib/hooks/useModalAttributes.js.map +1 -1
- package/lib-amd/hooks/useModalAttributes.js +1 -1
- package/lib-amd/hooks/useModalAttributes.js.map +1 -1
- package/lib-commonjs/hooks/useModalAttributes.js +1 -1
- package/lib-commonjs/hooks/useModalAttributes.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,22 @@
|
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Wed, 18 Jan 2023 16:30:58 GMT",
|
6
|
+
"tag": "@fluentui/react-tabster_v9.4.0",
|
7
|
+
"version": "9.4.0",
|
8
|
+
"comments": {
|
9
|
+
"minor": [
|
10
|
+
{
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
12
|
+
"package": "@fluentui/react-tabster",
|
13
|
+
"commit": "2dd64b998750525c3e6a4c1652c33305d772ada7",
|
14
|
+
"comment": "feat: add modalizer id to `useModalAttributes` option"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"date": "Mon, 16 Jan 2023 08:38:49 GMT",
|
6
21
|
"tag": "@fluentui/react-tabster_v9.3.7",
|
7
22
|
"version": "9.3.7",
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
# Change Log - @fluentui/react-tabster
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 18 Jan 2023 16:30:58 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.4.0)
|
8
|
+
|
9
|
+
Wed, 18 Jan 2023 16:30:58 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.7..@fluentui/react-tabster_v9.4.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- feat: add modalizer id to `useModalAttributes` option ([PR #26387](https://github.com/microsoft/fluentui/pull/26387) by yuanboxue@microsoft.com)
|
15
|
+
|
7
16
|
## [9.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.7)
|
8
17
|
|
9
|
-
Mon, 16 Jan 2023 08:
|
18
|
+
Mon, 16 Jan 2023 08:38:49 GMT
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.6..@fluentui/react-tabster_v9.3.7)
|
11
20
|
|
12
21
|
### Patches
|
package/dist/index.d.ts
CHANGED
@@ -159,6 +159,10 @@ export declare interface UseModalAttributesOptions {
|
|
159
159
|
* Always reachabled in Tab order
|
160
160
|
*/
|
161
161
|
alwaysFocusable?: boolean;
|
162
|
+
/**
|
163
|
+
* Id to use for the modalizer. An id will be generated if not provided.
|
164
|
+
*/
|
165
|
+
id?: string;
|
162
166
|
}
|
163
167
|
|
164
168
|
/**
|
@@ -21,7 +21,7 @@ export const useModalAttributes = (options = {}) => {
|
|
21
21
|
getModalizer(tabster);
|
22
22
|
getDeloser(tabster);
|
23
23
|
}
|
24
|
-
const id = useId('modal-');
|
24
|
+
const id = useId('modal-', options.id);
|
25
25
|
const modalAttributes = useTabsterAttributes({
|
26
26
|
deloser: {},
|
27
27
|
modalizer: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"mappings":"AAAA,SAASA,KAAK,QAAQ,2BAA2B;AACjD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,UAAU,EAAEC,YAAY,QAA+B,SAAS;AACzE,SAASC,UAAU,QAAQ,cAAc;
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,KAAK,QAAQ,2BAA2B;AACjD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,UAAU,EAAEC,YAAY,QAA+B,SAAS;AACzE,SAASC,UAAU,QAAQ,cAAc;AA8BzC;;;;;;;AAOA,OAAO,MAAMC,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGN,UAAU,EAAE;EAC5B;EACA,IAAIM,OAAO,EAAE;IACXP,YAAY,CAACO,OAAO,CAAC;IACrBR,UAAU,CAACQ,OAAO,CAAC;;EAGrB,MAAMC,EAAE,GAAGX,KAAK,CAAC,QAAQ,EAAEM,OAAO,CAACK,EAAE,CAAC;EACtC,MAAMC,eAAe,GAAGX,oBAAoB,CAAC;IAC3CY,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTH,EAAE;MACFI,kBAAkB,EAAE,CAACR,SAAS;MAC9BS,kBAAkB,EAAER,eAAe;MACnCS,SAAS,EAAER;;GAEd,CAAC;EAEF,MAAMS,iBAAiB,GAAGjB,oBAAoB,CAAC;IAC7CY,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAED,eAAe;IAAEM;EAAiB,CAAE;AAC/C,CAAC","names":["useId","useTabsterAttributes","getDeloser","getModalizer","useTabster","useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","id","modalAttributes","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, 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 deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"]}
|
@@ -18,7 +18,7 @@ define(["require", "exports", "@fluentui/react-utilities", "./useTabsterAttribut
|
|
18
18
|
tabster_1.getModalizer(tabster);
|
19
19
|
tabster_1.getDeloser(tabster);
|
20
20
|
}
|
21
|
-
var id = react_utilities_1.useId('modal-');
|
21
|
+
var id = react_utilities_1.useId('modal-', options.id);
|
22
22
|
var modalAttributes = useTabsterAttributes_1.useTabsterAttributes({
|
23
23
|
deloser: {},
|
24
24
|
modalizer: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useModalAttributes.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;
|
1
|
+
{"version":3,"file":"useModalAttributes.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;IAiCA;;;;;;OAMG;IACI,IAAM,kBAAkB,GAAG,UAChC,OAAuC;QAAvC,wBAAA,EAAA,YAAuC;QAE/B,IAAA,SAAS,GAAuC,OAAO,UAA9C,EAAE,eAAe,GAAsB,OAAO,gBAA7B,EAAE,eAAe,GAAK,OAAO,gBAAZ,CAAa;QAChE,IAAM,OAAO,GAAG,uBAAU,EAAE,CAAC;QAC7B,6CAA6C;QAC7C,IAAI,OAAO,EAAE;YACX,sBAAY,CAAC,OAAO,CAAC,CAAC;YACtB,oBAAU,CAAC,OAAO,CAAC,CAAC;SACrB;QAED,IAAM,EAAE,GAAG,uBAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACvC,IAAM,eAAe,GAAG,2CAAoB,CAAC;YAC3C,OAAO,EAAE,EAAE;YACX,SAAS,EAAE;gBACT,EAAE,IAAA;gBACF,kBAAkB,EAAE,CAAC,SAAS;gBAC9B,kBAAkB,EAAE,eAAe;gBACnC,SAAS,EAAE,eAAe;aAC3B;SACF,CAAC,CAAC;QAEH,IAAM,iBAAiB,GAAG,2CAAoB,CAAC;YAC7C,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,OAAO,EAAE,eAAe,iBAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAC;IAChD,CAAC,CAAC;IA3BW,QAAA,kBAAkB,sBA2B7B","sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, 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 deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"]}
|
@@ -27,7 +27,7 @@ const useModalAttributes = (options = {}) => {
|
|
27
27
|
tabster_1.getModalizer(tabster);
|
28
28
|
tabster_1.getDeloser(tabster);
|
29
29
|
}
|
30
|
-
const id = react_utilities_1.useId('modal-');
|
30
|
+
const id = react_utilities_1.useId('modal-', options.id);
|
31
31
|
const modalAttributes = useTabsterAttributes_1.useTabsterAttributes({
|
32
32
|
deloser: {},
|
33
33
|
modalizer: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AA8BA;;;;;;;AAOO,MAAMA,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGC,uBAAU,EAAE;EAC5B;EACA,IAAID,OAAO,EAAE;IACXE,sBAAY,CAACF,OAAO,CAAC;IACrBE,oBAAU,CAACF,OAAO,CAAC;;EAGrB,MAAMG,EAAE,GAAGC,uBAAK,CAAC,QAAQ,EAAER,OAAO,CAACO,EAAE,CAAC;EACtC,MAAME,eAAe,GAAGC,2CAAoB,CAAC;IAC3CC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTL,EAAE;MACFM,kBAAkB,EAAE,CAACZ,SAAS;MAC9Ba,kBAAkB,EAAEZ,eAAe;MACnCa,SAAS,EAAEZ;;GAEd,CAAC;EAEF,MAAMa,iBAAiB,GAAGN,2CAAoB,CAAC;IAC7CC,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAEF,eAAe;IAAEO;EAAiB,CAAE;AAC/C,CAAC;AA3BYC,0BAAkB","names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster_1","tabster_1","id","react_utilities_1","modalAttributes","useTabsterAttributes_1","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, 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 deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-', options.id);\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"]}
|