@fluentui/react-tabster 9.22.1 → 9.22.2

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/lib/focus/constants.js.map +1 -1
  3. package/lib/focus/createCustomFocusIndicatorStyle.js.map +1 -1
  4. package/lib/focus/createFocusOutlineStyle.js.map +1 -1
  5. package/lib/focus/focusVisiblePolyfill.js.map +1 -1
  6. package/lib/focus/focusWithinPolyfill.js.map +1 -1
  7. package/lib/focus/index.js.map +1 -1
  8. package/lib/hooks/index.js.map +1 -1
  9. package/lib/hooks/useArrowNavigationGroup.js.map +1 -1
  10. package/lib/hooks/useFocusFinders.js.map +1 -1
  11. package/lib/hooks/useFocusObserved.js.map +1 -1
  12. package/lib/hooks/useFocusVisible.js.map +1 -1
  13. package/lib/hooks/useFocusWithin.js.map +1 -1
  14. package/lib/hooks/useFocusableGroup.js.map +1 -1
  15. package/lib/hooks/useFocusedElementChange.js.map +1 -1
  16. package/lib/hooks/useKeyboardNavAttribute.js.map +1 -1
  17. package/lib/hooks/useKeyborgRef.js.map +1 -1
  18. package/lib/hooks/useMergeTabsterAttributes.js.map +1 -1
  19. package/lib/hooks/useModalAttributes.js.map +1 -1
  20. package/lib/hooks/useObservedElement.js.map +1 -1
  21. package/lib/hooks/useOnKeyboardNavigationChange.js.map +1 -1
  22. package/lib/hooks/useRestoreFocus.js.map +1 -1
  23. package/lib/hooks/useSetKeyboardNavigation.js.map +1 -1
  24. package/lib/hooks/useTabster.js.map +1 -1
  25. package/lib/hooks/useTabsterAttributes.js.map +1 -1
  26. package/lib/hooks/useUncontrolledFocus.js.map +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/tabster-types-6.0.1-do-not-use.js.map +1 -1
  29. package/lib-commonjs/focus/constants.js +6 -6
  30. package/lib-commonjs/focus/constants.js.map +1 -1
  31. package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js.map +1 -1
  32. package/lib-commonjs/focus/createFocusOutlineStyle.js.map +1 -1
  33. package/lib-commonjs/focus/focusVisiblePolyfill.js.map +1 -1
  34. package/lib-commonjs/focus/focusWithinPolyfill.js.map +1 -1
  35. package/lib-commonjs/focus/index.js.map +1 -1
  36. package/lib-commonjs/hooks/index.js.map +1 -1
  37. package/lib-commonjs/hooks/useArrowNavigationGroup.js.map +1 -1
  38. package/lib-commonjs/hooks/useFocusFinders.js.map +1 -1
  39. package/lib-commonjs/hooks/useFocusObserved.js.map +1 -1
  40. package/lib-commonjs/hooks/useFocusVisible.js.map +1 -1
  41. package/lib-commonjs/hooks/useFocusWithin.js.map +1 -1
  42. package/lib-commonjs/hooks/useFocusableGroup.js.map +1 -1
  43. package/lib-commonjs/hooks/useFocusedElementChange.js.map +1 -1
  44. package/lib-commonjs/hooks/useKeyboardNavAttribute.js.map +1 -1
  45. package/lib-commonjs/hooks/useKeyborgRef.js.map +1 -1
  46. package/lib-commonjs/hooks/useMergeTabsterAttributes.js.map +1 -1
  47. package/lib-commonjs/hooks/useModalAttributes.js.map +1 -1
  48. package/lib-commonjs/hooks/useObservedElement.js.map +1 -1
  49. package/lib-commonjs/hooks/useOnKeyboardNavigationChange.js.map +1 -1
  50. package/lib-commonjs/hooks/useRestoreFocus.js +3 -3
  51. package/lib-commonjs/hooks/useRestoreFocus.js.map +1 -1
  52. package/lib-commonjs/hooks/useSetKeyboardNavigation.js.map +1 -1
  53. package/lib-commonjs/hooks/useTabster.js.map +1 -1
  54. package/lib-commonjs/hooks/useTabsterAttributes.js.map +1 -1
  55. package/lib-commonjs/hooks/useUncontrolledFocus.js.map +1 -1
  56. package/lib-commonjs/index.js +67 -67
  57. package/lib-commonjs/index.js.map +1 -1
  58. package/lib-commonjs/tabster-types-6.0.1-do-not-use.js +38 -38
  59. package/lib-commonjs/tabster-types-6.0.1-do-not-use.js.map +1 -1
  60. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["useModalAttributes.js"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, RestorerTypes } 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: 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: 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","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"mappings":";;;;+BAUiBA;;;eAAAA;;;gCAVK;sCACe;yBACoB;4BAC9B;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,sBAAa,CAACC,MAAM;QAC9B;QACA,GAAGd,aAAa;YACZe,WAAW;gBACPR;gBACAS,oBAAoB,CAAChB;gBACrBiB,oBAAoBhB;gBACpBiB,WAAWhB,mBAAmBF;YAClC;QACJ,CAAC;IACL;IACA,MAAMmB,oBAAoBT,IAAAA,0CAAoB,EAAC;QAC3CC,UAAU;YACNC,MAAMC,sBAAa,CAACO,MAAM;QAC9B;IACJ;IACA,OAAO;QACHX;QACAU;IACJ;AACJ"}
1
+ {"version":3,"sources":["useModalAttributes.ts"],"sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getModalizer, getRestorer, Types as TabsterTypes, RestorerTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied.\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 traditional force-focus behavior to match previous versions of Fluent.\n * Without this, users can tab out of the focus trap and into the browser chrome.\n * This matches the behavior of the native <dialog> element and inert.\n * We recommend setting this to true based on user feedback and consistency.\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: 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: RestorerTypes.Target },\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster","getModalizer","getRestorer","id","useId","modalAttributes","useTabsterAttributes","restorer","type","RestorerTypes","Source","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","Target"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuCaA;;;eAAAA;;;gCAvCS;sCACe;yBAC2C;4BACrD;AAoCpB,MAAMA,qBAAqB,CAChCC,UAAqC,CAAC,CAAC;IAEvC,MAAM,EAAEC,SAAS,EAAEC,eAAe,EAAEC,eAAe,EAAE,GAAGH;IACxD,MAAMI,UAAUC,IAAAA,sBAAAA;IAChB,8CAA8C;IAC9C,IAAID,SAAS;QACXE,IAAAA,qBAAAA,EAAaF;QACbG,IAAAA,oBAAAA,EAAYH;IACd;IAEA,MAAMI,KAAKC,IAAAA,qBAAAA,EAAM,UAAUT,QAAQQ,EAAE;IACrC,MAAME,kBAAkBC,IAAAA,0CAAAA,EAAqB;QAC3CC,UAAU;YAAEC,MAAMC,sBAAAA,CAAcC,MAAM;QAAC;QACvC,GAAId,aAAa;YACfe,WAAW;gBACTR;gBACAS,oBAAoB,CAAChB;gBACrBiB,oBAAoBhB;gBACpBiB,WAAWhB,mBAAmBF;YAChC;QACF,CAAC;IACH;IAEA,MAAMmB,oBAAoBT,IAAAA,0CAAAA,EAAqB;QAC7CC,UAAU;YAAEC,MAAMC,sBAAAA,CAAcO,MAAM;QAAC;IACzC;IAEA,OAAO;QAAEX;QAAiBU;IAAkB;AAC9C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useObservedElement.js"],"sourcesContent":["import { useTabster } from './useTabster';\nimport { getObservedElement } from 'tabster';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nexport function useObservedElement(name) {\n const tabster = useTabster();\n if (tabster) {\n getObservedElement(tabster);\n }\n return useTabsterAttributes({\n observed: {\n names: Array.isArray(name) ? name : [\n name\n ]\n }\n });\n}\n"],"names":["useObservedElement","name","tabster","useTabster","getObservedElement","useTabsterAttributes","observed","names","Array","isArray"],"mappings":";;;;+BAGgBA;;;eAAAA;;;4BAHW;yBACQ;sCACE;AAC9B,SAASA,mBAAmBC,IAAI;IACnC,MAAMC,UAAUC,IAAAA,sBAAU;IAC1B,IAAID,SAAS;QACTE,IAAAA,2BAAkB,EAACF;IACvB;IACA,OAAOG,IAAAA,0CAAoB,EAAC;QACxBC,UAAU;YACNC,OAAOC,MAAMC,OAAO,CAACR,QAAQA,OAAO;gBAChCA;aACH;QACL;IACJ;AACJ"}
1
+ {"version":3,"sources":["useObservedElement.ts"],"sourcesContent":["import { useTabster } from './useTabster';\nimport { getObservedElement, Types as TabsterTypes } from 'tabster';\nimport { useTabsterAttributes } from './useTabsterAttributes';\n\nexport function useObservedElement(name: string | string[]): TabsterTypes.TabsterDOMAttribute {\n const tabster = useTabster();\n if (tabster) {\n getObservedElement(tabster);\n }\n\n return useTabsterAttributes({ observed: { names: Array.isArray(name) ? name : [name] } });\n}\n"],"names":["useObservedElement","name","tabster","useTabster","getObservedElement","useTabsterAttributes","observed","names","Array","isArray"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIgBA;;;eAAAA;;;4BAJW;yBAC+B;sCACrB;AAE9B,SAASA,mBAAmBC,IAAuB;IACxD,MAAMC,UAAUC,IAAAA,sBAAAA;IAChB,IAAID,SAAS;QACXE,IAAAA,2BAAAA,EAAmBF;IACrB;IAEA,OAAOG,IAAAA,0CAAAA,EAAqB;QAAEC,UAAU;YAAEC,OAAOC,MAAMC,OAAO,CAACR,QAAQA,OAAO;gBAACA;aAAK;QAAC;IAAE;AACzF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useOnKeyboardNavigationChange.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useKeyborgRef } from './useKeyborgRef';\n/**\n * Instantiates [keyborg](https://github.com/microsoft/keyborg) and subscribes to changes\n * in the keyboard navigation mode.\n *\n * @param callback - called every time the keyboard navigation state changes\n */ export function useOnKeyboardNavigationChange(callback) {\n const keyborgRef = useKeyborgRef();\n const eventCallback = useEventCallback(callback);\n React.useEffect(()=>{\n const keyborg = keyborgRef.current;\n if (keyborg) {\n const cb = (next)=>{\n eventCallback(next);\n };\n keyborg.subscribe(cb);\n cb(keyborg.isNavigatingWithKeyboard());\n return ()=>{\n keyborg.unsubscribe(cb);\n };\n }\n }, [\n keyborgRef,\n eventCallback\n ]);\n}\n"],"names":["useOnKeyboardNavigationChange","callback","keyborgRef","useKeyborgRef","eventCallback","useEventCallback","React","useEffect","keyborg","current","cb","next","subscribe","isNavigatingWithKeyboard","unsubscribe"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;iEARG;gCACU;+BACH;AAMnB,SAASA,8BAA8BC,QAAQ;IACtD,MAAMC,aAAaC,IAAAA,4BAAa;IAChC,MAAMC,gBAAgBC,IAAAA,gCAAgB,EAACJ;IACvCK,OAAMC,SAAS,CAAC;QACZ,MAAMC,UAAUN,WAAWO,OAAO;QAClC,IAAID,SAAS;YACT,MAAME,KAAK,CAACC;gBACRP,cAAcO;YAClB;YACAH,QAAQI,SAAS,CAACF;YAClBA,GAAGF,QAAQK,wBAAwB;YACnC,OAAO;gBACHL,QAAQM,WAAW,CAACJ;YACxB;QACJ;IACJ,GAAG;QACCR;QACAE;KACH;AACL"}
1
+ {"version":3,"sources":["useOnKeyboardNavigationChange.ts"],"sourcesContent":["import type { KeyborgCallback } from 'keyborg';\nimport * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\n\nimport { useKeyborgRef } from './useKeyborgRef';\n\n/**\n * Instantiates [keyborg](https://github.com/microsoft/keyborg) and subscribes to changes\n * in the keyboard navigation mode.\n *\n * @param callback - called every time the keyboard navigation state changes\n */\nexport function useOnKeyboardNavigationChange(callback: (isNavigatingWithKeyboard: boolean) => void) {\n const keyborgRef = useKeyborgRef();\n const eventCallback = useEventCallback(callback);\n\n React.useEffect(() => {\n const keyborg = keyborgRef.current;\n\n if (keyborg) {\n const cb: KeyborgCallback = next => {\n eventCallback(next);\n };\n\n keyborg.subscribe(cb);\n cb(keyborg.isNavigatingWithKeyboard());\n\n return () => {\n keyborg.unsubscribe(cb);\n };\n }\n }, [keyborgRef, eventCallback]);\n}\n"],"names":["useOnKeyboardNavigationChange","callback","keyborgRef","useKeyborgRef","eventCallback","useEventCallback","React","useEffect","keyborg","current","cb","next","subscribe","isNavigatingWithKeyboard","unsubscribe"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYgBA;;;eAAAA;;;;iEAXO;gCACU;+BAEH;AAQvB,SAASA,8BAA8BC,QAAqD;IACjG,MAAMC,aAAaC,IAAAA,4BAAAA;IACnB,MAAMC,gBAAgBC,IAAAA,gCAAAA,EAAiBJ;IAEvCK,OAAMC,SAAS,CAAC;QACd,MAAMC,UAAUN,WAAWO,OAAO;QAElC,IAAID,SAAS;YACX,MAAME,KAAsBC,CAAAA;gBAC1BP,cAAcO;YAChB;YAEAH,QAAQI,SAAS,CAACF;YAClBA,GAAGF,QAAQK,wBAAwB;YAEnC,OAAO;gBACLL,QAAQM,WAAW,CAACJ;YACtB;QACF;IACF,GAAG;QAACR;QAAYE;KAAc;AAChC"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- useRestoreFocusTarget: function() {
13
- return useRestoreFocusTarget;
14
- },
15
12
  useRestoreFocusSource: function() {
16
13
  return useRestoreFocusSource;
14
+ },
15
+ useRestoreFocusTarget: function() {
16
+ return useRestoreFocusTarget;
17
17
  }
18
18
  });
19
19
  const _tabster = require("tabster");
@@ -1 +1 @@
1
- {"version":3,"sources":["useRestoreFocus.js"],"sourcesContent":["import { getRestorer, getTabsterAttribute, RestorerTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n/**\n * Focus will be restored to the most recent target element when it is lost from a source\n * @returns Attribute to apply to the target element where focus is restored\n */ export function useRestoreFocusTarget() {\n const tabster = useTabster();\n // Initializes the restorer API\n if (tabster) {\n getRestorer(tabster);\n }\n return getTabsterAttribute({\n restorer: {\n type: RestorerTypes.Target\n }\n });\n}\n/**\n * Focus will be restored to the most recent target element when it is lost from a source\n * @returns Attribute to apply to the element that might lose focus\n */ export function useRestoreFocusSource() {\n const tabster = useTabster();\n // Initializes the restorer API\n if (tabster) {\n getRestorer(tabster);\n }\n return getTabsterAttribute({\n restorer: {\n type: RestorerTypes.Source\n }\n });\n}\n"],"names":["useRestoreFocusTarget","useRestoreFocusSource","tabster","useTabster","getRestorer","getTabsterAttribute","restorer","type","RestorerTypes","Target","Source"],"mappings":";;;;;;;;;;;IAKoBA,qBAAqB;eAArBA;;IAeAC,qBAAqB;eAArBA;;;yBApB4C;4BACrC;AAIhB,SAASD;IAChB,MAAME,UAAUC,IAAAA,sBAAU;IAC1B,+BAA+B;IAC/B,IAAID,SAAS;QACTE,IAAAA,oBAAW,EAACF;IAChB;IACA,OAAOG,IAAAA,4BAAmB,EAAC;QACvBC,UAAU;YACNC,MAAMC,sBAAa,CAACC,MAAM;QAC9B;IACJ;AACJ;AAIW,SAASR;IAChB,MAAMC,UAAUC,IAAAA,sBAAU;IAC1B,+BAA+B;IAC/B,IAAID,SAAS;QACTE,IAAAA,oBAAW,EAACF;IAChB;IACA,OAAOG,IAAAA,4BAAmB,EAAC;QACvBC,UAAU;YACNC,MAAMC,sBAAa,CAACE,MAAM;QAC9B;IACJ;AACJ"}
1
+ {"version":3,"sources":["useRestoreFocus.ts"],"sourcesContent":["import { getRestorer, getTabsterAttribute, Types as TabsterTypes, RestorerTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Focus will be restored to the most recent target element when it is lost from a source\n * @returns Attribute to apply to the target element where focus is restored\n */\nexport function useRestoreFocusTarget(): TabsterTypes.TabsterDOMAttribute {\n const tabster = useTabster();\n // Initializes the restorer API\n if (tabster) {\n getRestorer(tabster);\n }\n\n return getTabsterAttribute({ restorer: { type: RestorerTypes.Target } });\n}\n\n/**\n * Focus will be restored to the most recent target element when it is lost from a source\n * @returns Attribute to apply to the element that might lose focus\n */\nexport function useRestoreFocusSource(): TabsterTypes.TabsterDOMAttribute {\n const tabster = useTabster();\n // Initializes the restorer API\n if (tabster) {\n getRestorer(tabster);\n }\n\n return getTabsterAttribute({ restorer: { type: RestorerTypes.Source } });\n}\n"],"names":["useRestoreFocusSource","useRestoreFocusTarget","tabster","useTabster","getRestorer","getTabsterAttribute","restorer","type","RestorerTypes","Target","Source"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAqBgBA,qBAAAA;eAAAA;;IAdAC,qBAAAA;eAAAA;;;yBAPuE;4BAC5D;AAMpB,SAASA;IACd,MAAMC,UAAUC,IAAAA,sBAAAA;IAChB,+BAA+B;IAC/B,IAAID,SAAS;QACXE,IAAAA,oBAAAA,EAAYF;IACd;IAEA,OAAOG,IAAAA,4BAAAA,EAAoB;QAAEC,UAAU;YAAEC,MAAMC,sBAAAA,CAAcC,MAAM;QAAC;IAAE;AACxE;AAMO,SAAST;IACd,MAAME,UAAUC,IAAAA,sBAAAA;IAChB,+BAA+B;IAC/B,IAAID,SAAS;QACXE,IAAAA,oBAAAA,EAAYF;IACd;IAEA,OAAOG,IAAAA,4BAAAA,EAAoB;QAAEC,UAAU;YAAEC,MAAMC,sBAAAA,CAAcE,MAAM;QAAC;IAAE;AACxE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useSetKeyboardNavigation.js"],"sourcesContent":["import * as React from 'react';\nimport { useKeyborgRef } from './useKeyborgRef';\n/**\n */ export function useSetKeyboardNavigation() {\n const keyborgRef = useKeyborgRef();\n return React.useCallback((isNavigatingWithKeyboard)=>{\n var _keyborgRef_current;\n (_keyborgRef_current = keyborgRef.current) === null || _keyborgRef_current === void 0 ? void 0 : _keyborgRef_current.setVal(isNavigatingWithKeyboard);\n }, [\n keyborgRef\n ]);\n}\n"],"names":["useSetKeyboardNavigation","keyborgRef","useKeyborgRef","React","useCallback","isNavigatingWithKeyboard","_keyborgRef_current","current","setVal"],"mappings":";;;;+BAGoBA;;;eAAAA;;;;iEAHG;+BACO;AAEnB,SAASA;IAChB,MAAMC,aAAaC,IAAAA,4BAAa;IAChC,OAAOC,OAAMC,WAAW,CAAC,CAACC;QACtB,IAAIC;QACHA,CAAAA,sBAAsBL,WAAWM,OAAO,AAAD,MAAO,QAAQD,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBE,MAAM,CAACH;IAChI,GAAG;QACCJ;KACH;AACL"}
1
+ {"version":3,"sources":["useSetKeyboardNavigation.ts"],"sourcesContent":["import * as React from 'react';\nimport { useKeyborgRef } from './useKeyborgRef';\n\n/**\n */\nexport function useSetKeyboardNavigation() {\n const keyborgRef = useKeyborgRef();\n\n return React.useCallback(\n (isNavigatingWithKeyboard: boolean) => {\n keyborgRef.current?.setVal(isNavigatingWithKeyboard);\n },\n [keyborgRef],\n );\n}\n"],"names":["useSetKeyboardNavigation","keyborgRef","useKeyborgRef","React","useCallback","isNavigatingWithKeyboard","current","setVal"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;+BACO;AAIvB,SAASA;IACd,MAAMC,aAAaC,IAAAA,4BAAAA;IAEnB,OAAOC,OAAMC,WAAW,CACtB,CAACC;YACCJ;QAAAA,CAAAA,sBAAAA,WAAWK,OAAO,AAAPA,MAAO,QAAlBL,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAoBM,MAAM,CAACF;IAC7B,GACA;QAACJ;KAAW;AAEhB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useTabster.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createTabster, disposeTabster } from 'tabster';\nimport { useIsomorphicLayoutEffect, getParent } from '@fluentui/react-utilities';\n/**\n * Tries to get a tabster instance on the current window or creates a new one\n * Since Tabster is single instance only, feel free to call this hook to ensure Tabster exists if necessary\n *\n * @internal\n * @returns Tabster core instance\n */ export const useTabster = ()=>{\n const { targetDocument } = useFluent();\n const defaultView = (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) || undefined;\n const shadowDOMAPI = defaultView === null || defaultView === void 0 ? void 0 : defaultView.__tabsterShadowDOMAPI;\n const tabster = React.useMemo(()=>{\n if (!defaultView) {\n return null;\n }\n return createTabster(defaultView, {\n autoRoot: {},\n controlTab: false,\n getParent,\n checkUncontrolledTrappingFocus: (element)=>{\n var _element_firstElementChild;\n return !!((_element_firstElementChild = element.firstElementChild) === null || _element_firstElementChild === void 0 ? void 0 : _element_firstElementChild.hasAttribute('data-is-focus-trap-zone-bumper'));\n },\n DOMAPI: shadowDOMAPI\n });\n }, [\n defaultView,\n shadowDOMAPI\n ]);\n useIsomorphicLayoutEffect(()=>{\n return ()=>{\n if (tabster) {\n disposeTabster(tabster);\n }\n };\n }, [\n tabster\n ]);\n return tabster;\n};\n"],"names":["useTabster","targetDocument","useFluent","defaultView","undefined","shadowDOMAPI","__tabsterShadowDOMAPI","tabster","React","useMemo","createTabster","autoRoot","controlTab","getParent","checkUncontrolledTrappingFocus","element","_element_firstElementChild","firstElementChild","hasAttribute","DOMAPI","useIsomorphicLayoutEffect","disposeTabster"],"mappings":";;;;+BAUiBA;;;eAAAA;;;;iEAVM;qCACyB;yBACF;gCACO;AAO1C,MAAMA,aAAa;IAC1B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,cAAc,AAACF,CAAAA,mBAAmB,QAAQA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeE,WAAW,AAAD,KAAMC;IACpH,MAAMC,eAAeF,gBAAgB,QAAQA,gBAAgB,KAAK,IAAI,KAAK,IAAIA,YAAYG,qBAAqB;IAChH,MAAMC,UAAUC,OAAMC,OAAO,CAAC;QAC1B,IAAI,CAACN,aAAa;YACd,OAAO;QACX;QACA,OAAOO,IAAAA,sBAAa,EAACP,aAAa;YAC9BQ,UAAU,CAAC;YACXC,YAAY;YACZC,WAAAA,yBAAS;YACTC,gCAAgC,CAACC;gBAC7B,IAAIC;gBACJ,OAAO,CAAC,CAAE,CAAA,AAACA,CAAAA,6BAA6BD,QAAQE,iBAAiB,AAAD,MAAO,QAAQD,+BAA+B,KAAK,IAAI,KAAK,IAAIA,2BAA2BE,YAAY,CAAC,iCAAgC;YAC5M;YACAC,QAAQd;QACZ;IACJ,GAAG;QACCF;QACAE;KACH;IACDe,IAAAA,yCAAyB,EAAC;QACtB,OAAO;YACH,IAAIb,SAAS;gBACTc,IAAAA,uBAAc,EAACd;YACnB;QACJ;IACJ,GAAG;QACCA;KACH;IACD,OAAOA;AACX"}
1
+ {"version":3,"sources":["useTabster.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { createTabster, disposeTabster, Types as TabsterTypes } from 'tabster';\nimport { useIsomorphicLayoutEffect, getParent } from '@fluentui/react-utilities';\n\ninterface WindowWithTabsterShadowDOMAPI extends Window {\n __tabsterShadowDOMAPI?: TabsterTypes.DOMAPI;\n}\n\n/**\n * Tries to get a tabster instance on the current window or creates a new one\n * Since Tabster is single instance only, feel free to call this hook to ensure Tabster exists if necessary\n *\n * @internal\n * @returns Tabster core instance\n */\nexport const useTabster = (): TabsterTypes.TabsterCore | null => {\n const { targetDocument } = useFluent();\n\n const defaultView = targetDocument?.defaultView || undefined;\n\n const shadowDOMAPI = (defaultView as WindowWithTabsterShadowDOMAPI | undefined)?.__tabsterShadowDOMAPI;\n\n const tabster = React.useMemo(() => {\n if (!defaultView) {\n return null;\n }\n\n return createTabster(defaultView, {\n autoRoot: {},\n controlTab: false,\n getParent,\n checkUncontrolledTrappingFocus: element =>\n !!element.firstElementChild?.hasAttribute('data-is-focus-trap-zone-bumper'),\n DOMAPI: shadowDOMAPI,\n });\n }, [defaultView, shadowDOMAPI]);\n\n useIsomorphicLayoutEffect(() => {\n return () => {\n if (tabster) {\n disposeTabster(tabster);\n }\n };\n }, [tabster]);\n\n return tabster;\n};\n"],"names":["useTabster","targetDocument","useFluent","defaultView","undefined","shadowDOMAPI","__tabsterShadowDOMAPI","tabster","React","useMemo","createTabster","autoRoot","controlTab","getParent","checkUncontrolledTrappingFocus","element","firstElementChild","hasAttribute","DOMAPI","useIsomorphicLayoutEffect","disposeTabster"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;qCACyB;yBACqB;gCAChB;AAa9C,MAAMA,aAAa;IACxB,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAE3B,MAAMC,cAAcF,CAAAA,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBE,WAAW,AAAXA,KAAeC;IAEnD,MAAMC,eAAgBF,gBAAAA,QAAAA,gBAAAA,KAAAA,IAAAA,KAAAA,IAADA,YAA4DG,qBAAqB;IAEtG,MAAMC,UAAUC,OAAMC,OAAO,CAAC;QAC5B,IAAI,CAACN,aAAa;YAChB,OAAO;QACT;QAEA,OAAOO,IAAAA,sBAAAA,EAAcP,aAAa;YAChCQ,UAAU,CAAC;YACXC,YAAY;YACZC,WAAAA,yBAAAA;YACAC,gCAAgCC,CAAAA;oBAC5BA;uBAAF,CAAC,CAAA,CAAA,AAACA,CAAAA,6BAAAA,QAAQC,iBAAiB,AAAjBA,MAAiB,QAAzBD,+BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,2BAA2BE,YAAY,CAAC,iCAAA;;YAC5CC,QAAQb;QACV;IACF,GAAG;QAACF;QAAaE;KAAa;IAE9Bc,IAAAA,yCAAAA,EAA0B;QACxB,OAAO;YACL,IAAIZ,SAAS;gBACXa,IAAAA,uBAAAA,EAAeb;YACjB;QACF;IACF,GAAG;QAACA;KAAQ;IAEZ,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useTabsterAttributes.js"],"sourcesContent":["import { getTabsterAttribute, TABSTER_ATTRIBUTE_NAME } from 'tabster';\nimport { useTabster } from './useTabster';\nimport * as React from 'react';\n/**\n * @internal\n * Hook that returns tabster attributes while ensuring tabster exists\n */ export const useTabsterAttributes = (props)=>{\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n const strAttr = getTabsterAttribute(props, true);\n return React.useMemo(()=>({\n [TABSTER_ATTRIBUTE_NAME]: strAttr\n }), [\n strAttr\n ]);\n};\n"],"names":["useTabsterAttributes","props","useTabster","strAttr","getTabsterAttribute","React","useMemo","TABSTER_ATTRIBUTE_NAME"],"mappings":";;;;+BAMiBA;;;eAAAA;;;;yBAN2C;4BACjC;iEACJ;AAIZ,MAAMA,uBAAuB,CAACC;IACrC,qEAAqE;IACrE,iHAAiH;IACjHC,IAAAA,sBAAU;IACV,MAAMC,UAAUC,IAAAA,4BAAmB,EAACH,OAAO;IAC3C,OAAOI,OAAMC,OAAO,CAAC,IAAK,CAAA;YAClB,CAACC,+BAAsB,CAAC,EAAEJ;QAC9B,CAAA,GAAI;QACJA;KACH;AACL"}
1
+ {"version":3,"sources":["useTabsterAttributes.ts"],"sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes, TABSTER_ATTRIBUTE_NAME } from 'tabster';\nimport { useTabster } from './useTabster';\nimport * as React from 'react';\n\n/**\n * @internal\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = (props: TabsterTypes.TabsterAttributeProps): TabsterTypes.TabsterDOMAttribute => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n\n const strAttr = getTabsterAttribute(props, true);\n\n return React.useMemo(\n () => ({\n [TABSTER_ATTRIBUTE_NAME]: strAttr,\n }),\n [strAttr],\n );\n};\n"],"names":["useTabsterAttributes","props","useTabster","strAttr","getTabsterAttribute","React","useMemo","TABSTER_ATTRIBUTE_NAME"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;yBARsE;4BACxD;iEACJ;AAMhB,MAAMA,uBAAuB,CAACC;IACnC,qEAAqE;IACrE,iHAAiH;IACjHC,IAAAA,sBAAAA;IAEA,MAAMC,UAAUC,IAAAA,4BAAAA,EAAoBH,OAAO;IAE3C,OAAOI,OAAMC,OAAO,CAClB,IAAO,CAAA;YACL,CAACC,+BAAAA,CAAuB,EAAEJ;QAC5B,CAAA,GACA;QAACA;KAAQ;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useUncontrolledFocus.js"],"sourcesContent":["import { getTabsterAttribute } from 'tabster';\nimport { useTabster } from './useTabster';\n/**\n * Designates an area where tabster does not control focus\n * @returns Attribute to apply to the target element that should be uncontrolled by tabster\n */ export function useUncontrolledFocus() {\n useTabster();\n return getTabsterAttribute({\n uncontrolled: {}\n });\n}\n"],"names":["useUncontrolledFocus","useTabster","getTabsterAttribute","uncontrolled"],"mappings":";;;;+BAKoBA;;;eAAAA;;;yBALgB;4BACT;AAIhB,SAASA;IAChBC,IAAAA,sBAAU;IACV,OAAOC,IAAAA,4BAAmB,EAAC;QACvBC,cAAc,CAAC;IACnB;AACJ"}
1
+ {"version":3,"sources":["useUncontrolledFocus.ts"],"sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Designates an area where tabster does not control focus\n * @returns Attribute to apply to the target element that should be uncontrolled by tabster\n */\nexport function useUncontrolledFocus(): TabsterTypes.TabsterDOMAttribute {\n useTabster();\n\n return getTabsterAttribute({ uncontrolled: {} });\n}\n"],"names":["useUncontrolledFocus","useTabster","getTabsterAttribute","uncontrolled"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BAOgBA;;;eAAAA;;;yBAP2C;4BAChC;AAMpB,SAASA;IACdC,IAAAA,sBAAAA;IAEA,OAAOC,IAAAA,4BAAAA,EAAoB;QAAEC,cAAc,CAAC;IAAE;AAChD"}
@@ -9,56 +9,44 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- useArrowNavigationGroup: function() {
13
- return _index.useArrowNavigationGroup;
14
- },
15
- useFocusableGroup: function() {
16
- return _index.useFocusableGroup;
17
- },
18
- useFocusFinders: function() {
19
- return _index.useFocusFinders;
20
- },
21
- useFocusVisible: function() {
22
- return _index.useFocusVisible;
23
- },
24
- useFocusWithin: function() {
25
- return _index.useFocusWithin;
12
+ GroupperMoveFocusActions: function() {
13
+ return _tabster.GroupperMoveFocusActions;
26
14
  },
27
- useKeyboardNavAttribute: function() {
28
- return _index.useKeyboardNavAttribute;
15
+ GroupperMoveFocusEvent: function() {
16
+ return _tabster.GroupperMoveFocusEvent;
29
17
  },
30
- useModalAttributes: function() {
31
- return _index.useModalAttributes;
18
+ GroupperMoveFocusEventName: function() {
19
+ return _tabster.GroupperMoveFocusEventName;
32
20
  },
33
- useTabsterAttributes: function() {
34
- return _index.useTabsterAttributes;
21
+ KEYBORG_FOCUSIN: function() {
22
+ return _keyborg.KEYBORG_FOCUSIN;
35
23
  },
36
- useObservedElement: function() {
37
- return _index.useObservedElement;
24
+ MoverKeys: function() {
25
+ return _tabster.MoverKeys;
38
26
  },
39
- useFocusObserved: function() {
40
- return _index.useFocusObserved;
27
+ MoverMemorizedElementEvent: function() {
28
+ return _tabster.MoverMemorizedElementEvent;
41
29
  },
42
- useMergedTabsterAttributes_unstable: function() {
43
- return _index.useMergedTabsterAttributes_unstable;
30
+ MoverMemorizedElementEventName: function() {
31
+ return _tabster.MoverMemorizedElementEventName;
44
32
  },
45
- useRestoreFocusSource: function() {
46
- return _index.useRestoreFocusSource;
33
+ MoverMoveFocusEvent: function() {
34
+ return _tabster.MoverMoveFocusEvent;
47
35
  },
48
- useRestoreFocusTarget: function() {
49
- return _index.useRestoreFocusTarget;
36
+ MoverMoveFocusEventName: function() {
37
+ return _tabster.MoverMoveFocusEventName;
50
38
  },
51
- useUncontrolledFocus: function() {
52
- return _index.useUncontrolledFocus;
39
+ TabsterMoveFocusEvent: function() {
40
+ return _tabster.TabsterMoveFocusEvent;
53
41
  },
54
- useOnKeyboardNavigationChange: function() {
55
- return _index.useOnKeyboardNavigationChange;
42
+ TabsterMoveFocusEventName: function() {
43
+ return _tabster.TabsterMoveFocusEventName;
56
44
  },
57
- useSetKeyboardNavigation: function() {
58
- return _index.useSetKeyboardNavigation;
45
+ TabsterTypes: function() {
46
+ return _tabstertypes601donotuse;
59
47
  },
60
- useFocusedElementChange: function() {
61
- return _index.useFocusedElementChange;
48
+ applyFocusVisiblePolyfill: function() {
49
+ return _index1.applyFocusVisiblePolyfill;
62
50
  },
63
51
  createCustomFocusIndicatorStyle: function() {
64
52
  return _index1.createCustomFocusIndicatorStyle;
@@ -66,50 +54,62 @@ _export(exports, {
66
54
  createFocusOutlineStyle: function() {
67
55
  return _index1.createFocusOutlineStyle;
68
56
  },
69
- applyFocusVisiblePolyfill: function() {
70
- return _index1.applyFocusVisiblePolyfill;
71
- },
72
- KEYBORG_FOCUSIN: function() {
73
- return _keyborg.KEYBORG_FOCUSIN;
74
- },
75
- TabsterTypes: function() {
76
- return _tabstertypes601donotuse;
77
- },
78
57
  /** @deprecated Use element.dispatchEvent(new GroupperMoveFocusEvent({ action: GroupperMoveFocusActions.Escape })) */ dispatchGroupperMoveFocusEvent: function() {
79
58
  return _tabster.dispatchGroupperMoveFocusEvent;
80
59
  },
81
60
  /** @deprecated Use element.dispatchEvent(new MoverMoveFocusEvent({ key: MoverKeys.ArrowDown })) */ dispatchMoverMoveFocusEvent: function() {
82
61
  return _tabster.dispatchMoverMoveFocusEvent;
83
62
  },
84
- MoverMoveFocusEventName: function() {
85
- return _tabster.MoverMoveFocusEventName;
63
+ useArrowNavigationGroup: function() {
64
+ return _index.useArrowNavigationGroup;
86
65
  },
87
- MoverMoveFocusEvent: function() {
88
- return _tabster.MoverMoveFocusEvent;
66
+ useFocusFinders: function() {
67
+ return _index.useFocusFinders;
89
68
  },
90
- MoverKeys: function() {
91
- return _tabster.MoverKeys;
69
+ useFocusObserved: function() {
70
+ return _index.useFocusObserved;
92
71
  },
93
- GroupperMoveFocusEventName: function() {
94
- return _tabster.GroupperMoveFocusEventName;
72
+ useFocusVisible: function() {
73
+ return _index.useFocusVisible;
95
74
  },
96
- GroupperMoveFocusEvent: function() {
97
- return _tabster.GroupperMoveFocusEvent;
75
+ useFocusWithin: function() {
76
+ return _index.useFocusWithin;
98
77
  },
99
- GroupperMoveFocusActions: function() {
100
- return _tabster.GroupperMoveFocusActions;
78
+ useFocusableGroup: function() {
79
+ return _index.useFocusableGroup;
101
80
  },
102
- MoverMemorizedElementEventName: function() {
103
- return _tabster.MoverMemorizedElementEventName;
81
+ useFocusedElementChange: function() {
82
+ return _index.useFocusedElementChange;
104
83
  },
105
- MoverMemorizedElementEvent: function() {
106
- return _tabster.MoverMemorizedElementEvent;
84
+ useKeyboardNavAttribute: function() {
85
+ return _index.useKeyboardNavAttribute;
107
86
  },
108
- TabsterMoveFocusEventName: function() {
109
- return _tabster.TabsterMoveFocusEventName;
87
+ useMergedTabsterAttributes_unstable: function() {
88
+ return _index.useMergedTabsterAttributes_unstable;
110
89
  },
111
- TabsterMoveFocusEvent: function() {
112
- return _tabster.TabsterMoveFocusEvent;
90
+ useModalAttributes: function() {
91
+ return _index.useModalAttributes;
92
+ },
93
+ useObservedElement: function() {
94
+ return _index.useObservedElement;
95
+ },
96
+ useOnKeyboardNavigationChange: function() {
97
+ return _index.useOnKeyboardNavigationChange;
98
+ },
99
+ useRestoreFocusSource: function() {
100
+ return _index.useRestoreFocusSource;
101
+ },
102
+ useRestoreFocusTarget: function() {
103
+ return _index.useRestoreFocusTarget;
104
+ },
105
+ useSetKeyboardNavigation: function() {
106
+ return _index.useSetKeyboardNavigation;
107
+ },
108
+ useTabsterAttributes: function() {
109
+ return _index.useTabsterAttributes;
110
+ },
111
+ useUncontrolledFocus: function() {
112
+ return _index.useUncontrolledFocus;
113
113
  }
114
114
  });
115
115
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { useArrowNavigationGroup, useFocusableGroup, useFocusFinders, useFocusVisible, useFocusWithin, useKeyboardNavAttribute, useModalAttributes, useTabsterAttributes, useObservedElement, useFocusObserved, useMergedTabsterAttributes_unstable, useRestoreFocusSource, useRestoreFocusTarget, useUncontrolledFocus, useOnKeyboardNavigationChange, useSetKeyboardNavigation, useFocusedElementChange } from './hooks/index';\nexport { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from './focus/index';\nexport { applyFocusVisiblePolyfill } from './focus/index';\nimport { dispatchGroupperMoveFocusEvent, dispatchMoverMoveFocusEvent, MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys, GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions, MoverMemorizedElementEventName, MoverMemorizedElementEvent, TabsterMoveFocusEventName, TabsterMoveFocusEvent } from 'tabster';\nexport { KEYBORG_FOCUSIN } from 'keyborg';\n// WARNING! ATTENTION! Tabster.Types was exported from here by mistake. To avoid breaking changes,\n// we are putting a snapshot of Tabster.Types@6.0.1 and marking the entire export as deprecated.\nimport * as TabsterTypes6_0_1_DoNotUse from './tabster-types-6.0.1-do-not-use';\nexport { /** @deprecated (Do not use! Exposed by mistake and will be removed in the next major version.) */ TabsterTypes6_0_1_DoNotUse as TabsterTypes, /** @deprecated Use element.dispatchEvent(new GroupperMoveFocusEvent({ action: GroupperMoveFocusActions.Escape })) */ // eslint-disable-next-line deprecation/deprecation\ndispatchGroupperMoveFocusEvent, /** @deprecated Use element.dispatchEvent(new MoverMoveFocusEvent({ key: MoverKeys.ArrowDown })) */ // eslint-disable-next-line deprecation/deprecation\ndispatchMoverMoveFocusEvent };\n/**\n * For all exports below, we don't do wildcard exports to keep Tabster API flexible. We export only required\n * parts when they are needed.\n */ export { MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys };\nexport { GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions };\nexport { MoverMemorizedElementEventName, MoverMemorizedElementEvent };\nexport { TabsterMoveFocusEventName, TabsterMoveFocusEvent };\n"],"names":["useArrowNavigationGroup","useFocusableGroup","useFocusFinders","useFocusVisible","useFocusWithin","useKeyboardNavAttribute","useModalAttributes","useTabsterAttributes","useObservedElement","useFocusObserved","useMergedTabsterAttributes_unstable","useRestoreFocusSource","useRestoreFocusTarget","useUncontrolledFocus","useOnKeyboardNavigationChange","useSetKeyboardNavigation","useFocusedElementChange","createCustomFocusIndicatorStyle","createFocusOutlineStyle","applyFocusVisiblePolyfill","KEYBORG_FOCUSIN","TabsterTypes","TabsterTypes6_0_1_DoNotUse","dispatchGroupperMoveFocusEvent","dispatchMoverMoveFocusEvent","MoverMoveFocusEventName","MoverMoveFocusEvent","MoverKeys","GroupperMoveFocusEventName","GroupperMoveFocusEvent","GroupperMoveFocusActions","MoverMemorizedElementEventName","MoverMemorizedElementEvent","TabsterMoveFocusEventName","TabsterMoveFocusEvent"],"mappings":";;;;;;;;;;;IAASA,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;IAAEC,eAAe;eAAfA,sBAAe;;IAAEC,eAAe;eAAfA,sBAAe;;IAAEC,cAAc;eAAdA,qBAAc;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,kBAAkB;eAAlBA,yBAAkB;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,kBAAkB;eAAlBA,yBAAkB;;IAAEC,gBAAgB;eAAhBA,uBAAgB;;IAAEC,mCAAmC;eAAnCA,0CAAmC;;IAAEC,qBAAqB;eAArBA,4BAAqB;;IAAEC,qBAAqB;eAArBA,4BAAqB;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,6BAA6B;eAA7BA,oCAA6B;;IAAEC,wBAAwB;eAAxBA,+BAAwB;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAChYC,+BAA+B;eAA/BA,uCAA+B;;IAAEC,uBAAuB;eAAvBA,+BAAuB;;IACxDC,yBAAyB;eAAzBA,iCAAyB;;IAEzBC,eAAe;eAAfA,wBAAe;;IAImHC,YAAY;eAA1CC;;IAA4C,mHAAmH,GAC5QC,8BAA8B;eAA9BA,uCAA8B;;IAAE,iGAAiG,GACjIC,2BAA2B;eAA3BA,oCAA2B;;IAIdC,uBAAuB;eAAvBA,gCAAuB;;IAAEC,mBAAmB;eAAnBA,4BAAmB;;IAAEC,SAAS;eAATA,kBAAS;;IAC3DC,0BAA0B;eAA1BA,mCAA0B;;IAAEC,sBAAsB;eAAtBA,+BAAsB;;IAAEC,wBAAwB;eAAxBA,iCAAwB;;IAC5EC,8BAA8B;eAA9BA,uCAA8B;;IAAEC,0BAA0B;eAA1BA,mCAA0B;;IAC1DC,yBAAyB;eAAzBA,kCAAyB;;IAAEC,qBAAqB;eAArBA,8BAAqB;;;;uBAjBwV;wBACxU;yBAEwP;yBACjS;mFAGY"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n useArrowNavigationGroup,\n useFocusableGroup,\n useFocusFinders,\n useFocusVisible,\n useFocusWithin,\n useKeyboardNavAttribute,\n useModalAttributes,\n useTabsterAttributes,\n useObservedElement,\n useFocusObserved,\n useMergedTabsterAttributes_unstable,\n useRestoreFocusSource,\n useRestoreFocusTarget,\n useUncontrolledFocus,\n useOnKeyboardNavigationChange,\n useSetKeyboardNavigation,\n useFocusedElementChange,\n} from './hooks/index';\nexport type {\n UseArrowNavigationGroupOptions,\n UseFocusableGroupOptions,\n UseModalAttributesOptions,\n} from './hooks/index';\n\nexport { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from './focus/index';\n\nexport type {\n CreateCustomFocusIndicatorStyleOptions,\n CreateFocusOutlineStyleOptions,\n FocusOutlineOffset,\n FocusOutlineStyleOptions,\n} from './focus/index';\n\nexport { applyFocusVisiblePolyfill } from './focus/index';\nimport {\n type Types,\n type EventsTypes,\n dispatchGroupperMoveFocusEvent,\n dispatchMoverMoveFocusEvent,\n MoverMoveFocusEventName,\n MoverMoveFocusEvent,\n MoverKeys,\n GroupperMoveFocusEventName,\n GroupperMoveFocusEvent,\n GroupperMoveFocusActions,\n MoverMemorizedElementEventName,\n MoverMemorizedElementEvent,\n TabsterMoveFocusEventName,\n TabsterMoveFocusEvent,\n} from 'tabster';\n\nexport type TabsterDOMAttribute = Types.TabsterDOMAttribute;\n\nexport type { KeyborgFocusInEvent } from 'keyborg';\nexport { KEYBORG_FOCUSIN } from 'keyborg';\n\n// WARNING! ATTENTION! Tabster.Types was exported from here by mistake. To avoid breaking changes,\n// we are putting a snapshot of Tabster.Types@6.0.1 and marking the entire export as deprecated.\nimport * as TabsterTypes6_0_1_DoNotUse from './tabster-types-6.0.1-do-not-use';\nexport {\n /** @deprecated (Do not use! Exposed by mistake and will be removed in the next major version.) */\n TabsterTypes6_0_1_DoNotUse as TabsterTypes,\n /** @deprecated Use element.dispatchEvent(new GroupperMoveFocusEvent({ action: GroupperMoveFocusActions.Escape })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchGroupperMoveFocusEvent,\n /** @deprecated Use element.dispatchEvent(new MoverMoveFocusEvent({ key: MoverKeys.ArrowDown })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchMoverMoveFocusEvent,\n};\n\n/**\n * For all exports below, we don't do wildcard exports to keep Tabster API flexible. We export only required\n * parts when they are needed.\n */\n\nexport { MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys };\nexport type MoverMoveFocusEventDetail = EventsTypes.MoverMoveFocusEventDetail;\n\nexport { GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions };\nexport type GroupperMoveFocusEventDetail = EventsTypes.GroupperMoveFocusEventDetail;\n\nexport { MoverMemorizedElementEventName, MoverMemorizedElementEvent };\nexport type MoverMemorizedElementEventDetail = EventsTypes.MoverMemorizedElementEventDetail;\n\nexport { TabsterMoveFocusEventName, TabsterMoveFocusEvent };\nexport type TabsterMoveFocusEventDetail = EventsTypes.TabsterMoveFocusEventDetail;\n"],"names":["GroupperMoveFocusActions","GroupperMoveFocusEvent","GroupperMoveFocusEventName","KEYBORG_FOCUSIN","MoverKeys","MoverMemorizedElementEvent","MoverMemorizedElementEventName","MoverMoveFocusEvent","MoverMoveFocusEventName","TabsterMoveFocusEvent","TabsterMoveFocusEventName","TabsterTypes","TabsterTypes6_0_1_DoNotUse","applyFocusVisiblePolyfill","createCustomFocusIndicatorStyle","createFocusOutlineStyle","dispatchGroupperMoveFocusEvent","dispatchMoverMoveFocusEvent","useArrowNavigationGroup","useFocusFinders","useFocusObserved","useFocusVisible","useFocusWithin","useFocusableGroup","useFocusedElementChange","useKeyboardNavAttribute","useMergedTabsterAttributes_unstable","useModalAttributes","useObservedElement","useOnKeyboardNavigationChange","useRestoreFocusSource","useRestoreFocusTarget","useSetKeyboardNavigation","useTabsterAttributes","useUncontrolledFocus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA+E6DA,wBAAwB;eAAxBA,iCAAwB;;IAAhDC,sBAAsB;eAAtBA,+BAAsB;;IAAlDC,0BAA0B;eAA1BA,mCAA0B;;IAxB1BC,eAAe;eAAfA,wBAAe;;IAqB+BC,SAAS;eAATA,kBAAS;;IAMvBC,0BAA0B;eAA1BA,mCAA0B;;IAA1DC,8BAA8B;eAA9BA,uCAA8B;;IANLC,mBAAmB;eAAnBA,4BAAmB;;IAA5CC,uBAAuB;eAAvBA,gCAAuB;;IASIC,qBAAqB;eAArBA,8BAAqB;;IAAhDC,yBAAyB;eAAzBA,kCAAyB;;IAvBFC,YAAY;eAA1CC;;IA5BOC,yBAAyB;eAAzBA,iCAAyB;;IATzBC,+BAA+B;eAA/BA,uCAA+B;;IAAEC,uBAAuB;eAAvBA,+BAAuB;;IAsC/D,mHAAmH,GAEnHC,8BAA8B;eAA9BA,uCAA8B;;IAC9B,iGAAiG,GAEjGC,2BAA2B;eAA3BA,oCAA2B;;IAnE3BC,uBAAuB;eAAvBA,8BAAuB;;IAEvBC,eAAe;eAAfA,sBAAe;;IAOfC,gBAAgB;eAAhBA,uBAAgB;;IANhBC,eAAe;eAAfA,sBAAe;;IACfC,cAAc;eAAdA,qBAAc;;IAHdC,iBAAiB;eAAjBA,wBAAiB;;IAejBC,uBAAuB;eAAvBA,8BAAuB;;IAXvBC,uBAAuB;eAAvBA,8BAAuB;;IAKvBC,mCAAmC;eAAnCA,0CAAmC;;IAJnCC,kBAAkB;eAAlBA,yBAAkB;;IAElBC,kBAAkB;eAAlBA,yBAAkB;;IAMlBC,6BAA6B;eAA7BA,oCAA6B;;IAH7BC,qBAAqB;eAArBA,4BAAqB;;IACrBC,qBAAqB;eAArBA,4BAAqB;;IAGrBC,wBAAwB;eAAxBA,+BAAwB;;IARxBC,oBAAoB;eAApBA,2BAAoB;;IAMpBC,oBAAoB;eAApBA,2BAAoB;;;;uBAIf;wBAOkE;yBAyBlE;yBAKyB;mFAIY"}
@@ -23,20 +23,32 @@ function _export(target, all) {
23
23
  });
24
24
  }
25
25
  _export(exports, {
26
- TabsterAttributeName: function() {
27
- return TabsterAttributeName;
28
- },
29
- TabsterDummyInputAttributeName: function() {
30
- return TabsterDummyInputAttributeName;
31
- },
32
26
  DeloserEventName: function() {
33
27
  return DeloserEventName;
34
28
  },
29
+ FocusInEventName: function() {
30
+ return FocusInEventName;
31
+ },
32
+ FocusOutEventName: function() {
33
+ return FocusOutEventName;
34
+ },
35
+ FocusableSelector: function() {
36
+ return FocusableSelector;
37
+ },
38
+ GroupperMoveFocusActions: function() {
39
+ return GroupperMoveFocusActions;
40
+ },
41
+ GroupperMoveFocusEventName: function() {
42
+ return GroupperMoveFocusEventName;
43
+ },
44
+ GroupperTabbabilities: function() {
45
+ return GroupperTabbabilities;
46
+ },
35
47
  ModalizerActiveEventName: function() {
36
48
  return ModalizerActiveEventName;
37
49
  },
38
- ModalizerInactiveEventName: function() {
39
- return ModalizerInactiveEventName;
50
+ ModalizerBeforeFocusOutEventName: function() {
51
+ return ModalizerBeforeFocusOutEventName;
40
52
  },
41
53
  ModalizerFocusInEventName: function() {
42
54
  return ModalizerFocusInEventName;
@@ -44,32 +56,23 @@ _export(exports, {
44
56
  ModalizerFocusOutEventName: function() {
45
57
  return ModalizerFocusOutEventName;
46
58
  },
47
- ModalizerBeforeFocusOutEventName: function() {
48
- return ModalizerBeforeFocusOutEventName;
49
- },
50
- MoverEventName: function() {
51
- return MoverEventName;
52
- },
53
- FocusInEventName: function() {
54
- return FocusInEventName;
55
- },
56
- FocusOutEventName: function() {
57
- return FocusOutEventName;
59
+ ModalizerInactiveEventName: function() {
60
+ return ModalizerInactiveEventName;
58
61
  },
59
62
  MoveFocusEventName: function() {
60
63
  return MoveFocusEventName;
61
64
  },
62
- MoverMoveFocusEventName: function() {
63
- return MoverMoveFocusEventName;
65
+ MoverDirections: function() {
66
+ return MoverDirections;
64
67
  },
65
- GroupperMoveFocusEventName: function() {
66
- return GroupperMoveFocusEventName;
68
+ MoverEventName: function() {
69
+ return MoverEventName;
67
70
  },
68
- FocusableSelector: function() {
69
- return FocusableSelector;
71
+ MoverKeys: function() {
72
+ return MoverKeys;
70
73
  },
71
- GroupperMoveFocusActions: function() {
72
- return GroupperMoveFocusActions;
74
+ MoverMoveFocusEventName: function() {
75
+ return MoverMoveFocusEventName;
73
76
  },
74
77
  ObservedElementAccesibilities: function() {
75
78
  return ObservedElementAccesibilities;
@@ -77,23 +80,20 @@ _export(exports, {
77
80
  RestoreFocusOrders: function() {
78
81
  return RestoreFocusOrders;
79
82
  },
80
- Visibilities: function() {
81
- return Visibilities;
82
- },
83
83
  RestorerTypes: function() {
84
84
  return RestorerTypes;
85
85
  },
86
- MoverDirections: function() {
87
- return MoverDirections;
86
+ SysDummyInputsPositions: function() {
87
+ return SysDummyInputsPositions;
88
88
  },
89
- MoverKeys: function() {
90
- return MoverKeys;
89
+ TabsterAttributeName: function() {
90
+ return TabsterAttributeName;
91
91
  },
92
- GroupperTabbabilities: function() {
93
- return GroupperTabbabilities;
92
+ TabsterDummyInputAttributeName: function() {
93
+ return TabsterDummyInputAttributeName;
94
94
  },
95
- SysDummyInputsPositions: function() {
96
- return SysDummyInputsPositions;
95
+ Visibilities: function() {
96
+ return Visibilities;
97
97
  }
98
98
  });
99
99
  const TabsterAttributeName = 'data-tabster';
@@ -1 +1 @@
1
- {"version":3,"sources":["tabster-types-6.0.1-do-not-use.js"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */ /**\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n *\n * Do not use anything from this file. It is a snapshot of the older Tabster typings exposed by a mistake.\n * The exposed typings should have been removed, but we don't do it in minor versions to avoid breaking changes.\n * Everything reexported from this file as react-tabster/TabsterTypes is marked as deprecated and shouldn't\n * be used anywhre.\n *\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n */ export const TabsterAttributeName = 'data-tabster';\nexport const TabsterDummyInputAttributeName = 'data-tabster-dummy';\nexport const DeloserEventName = 'tabster:deloser';\nexport const ModalizerActiveEventName = 'tabster:modalizer:active';\nexport const ModalizerInactiveEventName = 'tabster:modalizer:inactive';\nexport const ModalizerFocusInEventName = 'tabster:modalizer:focusin';\nexport const ModalizerFocusOutEventName = 'tabster:modalizer:focusout';\nexport const ModalizerBeforeFocusOutEventName = 'tabster:modalizer:beforefocusout';\nexport const MoverEventName = 'tabster:mover';\nexport const FocusInEventName = 'tabster:focusin';\nexport const FocusOutEventName = 'tabster:focusout';\n// Event to be triggered when Tabster wants to move focus as the result of\n// keyboard event. This allows to preventDefault() if you want to have\n// some custom logic.\nexport const MoveFocusEventName = 'tabster:movefocus';\n// Event that can be triggered by the application to programmatically move\n// focus inside Mover.\nexport const MoverMoveFocusEventName = 'tabster:mover:movefocus';\n// Event that can be triggered by the application to programmatically enter\n// or escape Groupper.\nexport const GroupperMoveFocusEventName = 'tabster:groupper:movefocus';\nexport const FocusableSelector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '*[tabindex]',\n '*[contenteditable]'\n].join(', ');\nexport const GroupperMoveFocusActions = {\n Enter: 1,\n Escape: 2\n};\nexport const ObservedElementAccesibilities = {\n Any: 0,\n Accessible: 1,\n Focusable: 2\n};\nexport const RestoreFocusOrders = {\n History: 0,\n DeloserDefault: 1,\n RootDefault: 2,\n DeloserFirst: 3,\n RootFirst: 4\n};\nexport const Visibilities = {\n Invisible: 0,\n PartiallyVisible: 1,\n Visible: 2\n};\nexport const RestorerTypes = {\n Source: 0,\n Target: 1\n};\nexport const MoverDirections = {\n Both: 0,\n Vertical: 1,\n Horizontal: 2,\n Grid: 3,\n GridLinear: 4\n};\nexport const MoverKeys = {\n ArrowUp: 1,\n ArrowDown: 2,\n ArrowLeft: 3,\n ArrowRight: 4,\n PageUp: 5,\n PageDown: 6,\n Home: 7,\n End: 8\n};\nexport const GroupperTabbabilities = {\n Unlimited: 0,\n Limited: 1,\n LimitedTrapFocus: 2\n};\nexport const SysDummyInputsPositions = {\n Auto: 0,\n Inside: 1,\n Outside: 2\n};\n"],"names":["TabsterAttributeName","TabsterDummyInputAttributeName","DeloserEventName","ModalizerActiveEventName","ModalizerInactiveEventName","ModalizerFocusInEventName","ModalizerFocusOutEventName","ModalizerBeforeFocusOutEventName","MoverEventName","FocusInEventName","FocusOutEventName","MoveFocusEventName","MoverMoveFocusEventName","GroupperMoveFocusEventName","FocusableSelector","GroupperMoveFocusActions","ObservedElementAccesibilities","RestoreFocusOrders","Visibilities","RestorerTypes","MoverDirections","MoverKeys","GroupperTabbabilities","SysDummyInputsPositions","join","Enter","Escape","Any","Accessible","Focusable","History","DeloserDefault","RootDefault","DeloserFirst","RootFirst","Invisible","PartiallyVisible","Visible","Source","Target","Both","Vertical","Horizontal","Grid","GridLinear","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Unlimited","Limited","LimitedTrapFocus","Auto","Inside","Outside"],"mappings":"AAAA;;;CAGC,GAAG;;;;;;;;;;;CAWH;;;;;;;;;;;IAAgBA,oBAAoB;eAApBA;;IACJC,8BAA8B;eAA9BA;;IACAC,gBAAgB;eAAhBA;;IACAC,wBAAwB;eAAxBA;;IACAC,0BAA0B;eAA1BA;;IACAC,yBAAyB;eAAzBA;;IACAC,0BAA0B;eAA1BA;;IACAC,gCAAgC;eAAhCA;;IACAC,cAAc;eAAdA;;IACAC,gBAAgB;eAAhBA;;IACAC,iBAAiB;eAAjBA;;IAIAC,kBAAkB;eAAlBA;;IAGAC,uBAAuB;eAAvBA;;IAGAC,0BAA0B;eAA1BA;;IACAC,iBAAiB;eAAjBA;;IASAC,wBAAwB;eAAxBA;;IAIAC,6BAA6B;eAA7BA;;IAKAC,kBAAkB;eAAlBA;;IAOAC,YAAY;eAAZA;;IAKAC,aAAa;eAAbA;;IAIAC,eAAe;eAAfA;;IAOAC,SAAS;eAATA;;IAUAC,qBAAqB;eAArBA;;IAKAC,uBAAuB;eAAvBA;;;AA7EF,MAAMvB,uBAAuB;AACjC,MAAMC,iCAAiC;AACvC,MAAMC,mBAAmB;AACzB,MAAMC,2BAA2B;AACjC,MAAMC,6BAA6B;AACnC,MAAMC,4BAA4B;AAClC,MAAMC,6BAA6B;AACnC,MAAMC,mCAAmC;AACzC,MAAMC,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,oBAAoB;AAI1B,MAAMC,qBAAqB;AAG3B,MAAMC,0BAA0B;AAGhC,MAAMC,6BAA6B;AACnC,MAAMC,oBAAoB;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;CACH,CAACU,IAAI,CAAC;AACA,MAAMT,2BAA2B;IACpCU,OAAO;IACPC,QAAQ;AACZ;AACO,MAAMV,gCAAgC;IACzCW,KAAK;IACLC,YAAY;IACZC,WAAW;AACf;AACO,MAAMZ,qBAAqB;IAC9Ba,SAAS;IACTC,gBAAgB;IAChBC,aAAa;IACbC,cAAc;IACdC,WAAW;AACf;AACO,MAAMhB,eAAe;IACxBiB,WAAW;IACXC,kBAAkB;IAClBC,SAAS;AACb;AACO,MAAMlB,gBAAgB;IACzBmB,QAAQ;IACRC,QAAQ;AACZ;AACO,MAAMnB,kBAAkB;IAC3BoB,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,MAAM;IACNC,YAAY;AAChB;AACO,MAAMvB,YAAY;IACrBwB,SAAS;IACTC,WAAW;IACXC,WAAW;IACXC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;IACNC,KAAK;AACT;AACO,MAAM9B,wBAAwB;IACjC+B,WAAW;IACXC,SAAS;IACTC,kBAAkB;AACtB;AACO,MAAMhC,0BAA0B;IACnCiC,MAAM;IACNC,QAAQ;IACRC,SAAS;AACb"}
1
+ {"version":3,"sources":["tabster-types-6.0.1-do-not-use.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n *\n * Do not use anything from this file. It is a snapshot of the older Tabster typings exposed by a mistake.\n * The exposed typings should have been removed, but we don't do it in minor versions to avoid breaking changes.\n * Everything reexported from this file as react-tabster/TabsterTypes is marked as deprecated and shouldn't\n * be used anywhre.\n *\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n */\n\nexport const TabsterAttributeName = 'data-tabster';\nexport const TabsterDummyInputAttributeName = 'data-tabster-dummy';\nexport const DeloserEventName = 'tabster:deloser';\nexport const ModalizerActiveEventName = 'tabster:modalizer:active';\nexport const ModalizerInactiveEventName = 'tabster:modalizer:inactive';\nexport const ModalizerFocusInEventName = 'tabster:modalizer:focusin';\nexport const ModalizerFocusOutEventName = 'tabster:modalizer:focusout';\nexport const ModalizerBeforeFocusOutEventName = 'tabster:modalizer:beforefocusout';\nexport const MoverEventName = 'tabster:mover';\nexport const FocusInEventName = 'tabster:focusin';\nexport const FocusOutEventName = 'tabster:focusout';\n\n// Event to be triggered when Tabster wants to move focus as the result of\n// keyboard event. This allows to preventDefault() if you want to have\n// some custom logic.\nexport const MoveFocusEventName = 'tabster:movefocus';\n\n// Event that can be triggered by the application to programmatically move\n// focus inside Mover.\nexport const MoverMoveFocusEventName = 'tabster:mover:movefocus';\n// Event that can be triggered by the application to programmatically enter\n// or escape Groupper.\nexport const GroupperMoveFocusEventName = 'tabster:groupper:movefocus';\n\nexport const FocusableSelector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '*[tabindex]',\n '*[contenteditable]',\n].join(', ');\n\n// Trigger move focus event on a Mover element.\nexport type MoverMoveFocusEvent = CustomEvent<{ key: MoverKey } | undefined>;\n\nexport interface GroupperMoveFocusActions {\n Enter: 1;\n Escape: 2;\n}\nexport type GroupperMoveFocusAction = GroupperMoveFocusActions[keyof GroupperMoveFocusActions];\nexport const GroupperMoveFocusActions: GroupperMoveFocusActions = {\n Enter: 1,\n Escape: 2,\n};\n\n// Enter or escape Groupper. Enter when `enter` is true, escape when `enter` is false.\nexport type GroupperMoveFocusEvent = CustomEvent<{ action: GroupperMoveFocusAction } | undefined>;\n\nexport type TabsterEventWithDetails<D> = CustomEvent<D | undefined>;\n\nexport interface TabsterMoveFocusEventDetails {\n by: 'mover' | 'groupper' | 'modalizer' | 'root';\n owner: HTMLElement; // Mover, Groupper, Modalizer or Root, the initiator.\n next: HTMLElement | null; // Next element to focus or null if Tabster wants to go outside of Root (i.e. to the address bar of the browser).\n relatedEvent?: KeyboardEvent; // The original keyboard event that triggered the move.\n}\n\nexport type TabsterMoveFocusEvent = TabsterEventWithDetails<TabsterMoveFocusEventDetails>;\n\nexport interface TabsterDOMAttribute {\n [TabsterAttributeName]: string | undefined;\n}\n\nexport interface TabsterCoreProps {\n autoRoot?: RootProps;\n /**\n * Allows all tab key presses under the tabster root to be controlled by tabster\n * @default true\n */\n controlTab?: boolean;\n /**\n * When controlTab is false, Root doesn't have dummy inputs by default.\n * This option allows to enable dummy inputs on Root.\n */\n rootDummyInputs?: boolean;\n /**\n * A callback that will be called for the uncontrolled areas when Tabster wants\n * to know is the uncontrolled element wants complete control (for example it\n * is trapping focus) and Tabster should not interfere with handling Tab.\n * If the callback returns undefined, then the default behaviour is to return\n * the uncontrolled.completely value from the element. If the callback returns\n * non-undefined value, the callback's value will dominate the element's\n * uncontrolled.completely value.\n */\n checkUncontrolledCompletely?: (\n element: HTMLElement,\n completely: boolean, // A uncontrolled.completely value from the element.\n ) => boolean | undefined;\n /**\n * @deprecated use checkUncontrolledCompletely.\n */\n checkUncontrolledTrappingFocus?: (element: HTMLElement) => boolean;\n /**\n * Custom getter for parent elements. Defaults to the default .parentElement call\n * Currently only used to detect tabster contexts\n */\n getParent?(el: Node): Node | null;\n /**\n * Ability to redefine all DOM API calls used by Tabster. For example, for\n * ShadowDOM support.\n */\n DOMAPI?: Partial<DOMAPI>;\n}\n\nexport interface DOMAPI {\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n createMutationObserver: (callback: MutationCallback) => MutationObserver;\n createTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;\n getParentNode(node: Node | null | undefined): ParentNode | null;\n getParentElement(element: HTMLElement | null | undefined): HTMLElement | null;\n nodeContains(parent: Node | null | undefined, child: Node | null | undefined): boolean;\n getActiveElement(doc: Document): Element | null;\n querySelector(element: ParentNode, selector: string): Element | null;\n querySelectorAll(element: ParentNode, selector: string): Element[];\n getElementById(doc: Document, id: string): HTMLElement | null;\n getFirstChild(node: Node | null | undefined): ChildNode | null;\n getLastChild(node: Node | null | undefined): ChildNode | null;\n getNextSibling(node: Node | null | undefined): ChildNode | null;\n getPreviousSibling(node: Node | null | undefined): ChildNode | null;\n getFirstElementChild(element: Element | null | undefined): Element | null;\n getLastElementChild(element: Element | null | undefined): Element | null;\n getNextElementSibling(element: Element | null | undefined): Element | null;\n getPreviousElementSibling(element: Element | null | undefined): Element | null;\n appendChild(parent: Node, child: Node): Node;\n insertBefore(parent: Node, child: Node, referenceChild: Node | null): Node;\n getSelection(ref: Node): Selection | null;\n}\n\nexport type GetTabster = () => TabsterCore;\nexport type GetWindow = () => Window;\n\nexport type SubscribableCallback<A, B = undefined> = (val: A, details: B) => void;\n\nexport interface Disposable {\n /** @internal */\n dispose(): void;\n}\n\nexport interface Subscribable<A, B = undefined> {\n subscribe(callback: SubscribableCallback<A, B>): void;\n /** @internal */\n subscribeFirst(callback: SubscribableCallback<A, B>): void;\n unsubscribe(callback: SubscribableCallback<A, B>): void;\n}\n\nexport interface KeyboardNavigationState extends Subscribable<boolean>, Disposable {\n isNavigatingWithKeyboard(): boolean;\n setNavigatingWithKeyboard(isNavigatingWithKeyboard: boolean): void;\n}\n\nexport interface FocusedElementDetails {\n relatedTarget?: HTMLElement;\n isFocusedProgrammatically?: boolean;\n modalizerId?: string;\n}\n\nexport interface FocusedElementState extends Subscribable<HTMLElement | undefined, FocusedElementDetails>, Disposable {\n getFocusedElement(): HTMLElement | undefined;\n getLastFocusedElement(): HTMLElement | undefined;\n focus(element: HTMLElement, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): boolean;\n focusDefault(container: HTMLElement): boolean;\n /** @internal */\n getFirstOrLastTabbable(\n isFirst: boolean,\n props: Pick<FindFocusableProps, 'container' | 'ignoreAccessibility'>,\n ): HTMLElement | undefined;\n focusFirst(props: FindFirstProps): boolean;\n focusLast(props: FindFirstProps): boolean;\n resetFocus(container: HTMLElement): boolean;\n}\n\nexport interface WeakHTMLElement<D = undefined> {\n get(): HTMLElement | undefined;\n getData(): D | undefined;\n}\n\nexport interface TabsterPart<P> {\n readonly id: string;\n getElement(): HTMLElement | undefined;\n getProps(): P;\n setProps(props: P): void;\n}\n\nexport interface TabsterPartWithFindNextTabbable {\n findNextTabbable(\n current?: HTMLElement,\n reference?: HTMLElement,\n isBackward?: boolean,\n ignoreAccessibility?: boolean,\n ): NextTabbable | null;\n}\n\nexport interface TabsterPartWithAcceptElement {\n acceptElement(element: HTMLElement, state: FocusableAcceptElementState): number | undefined;\n}\n\nexport interface ObservedElementProps {\n names: string[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n details?: any;\n}\n\nexport interface ObservedElementDetails extends ObservedElementProps {\n accessibility?: ObservedElementAccesibility;\n}\n\nexport interface ObservedElementAccesibilities {\n Any: 0;\n Accessible: 1;\n Focusable: 2;\n}\nexport type ObservedElementAccesibility = ObservedElementAccesibilities[keyof ObservedElementAccesibilities];\nexport const ObservedElementAccesibilities: ObservedElementAccesibilities = {\n Any: 0,\n Accessible: 1,\n Focusable: 2,\n};\n\nexport interface ObservedElementAsyncRequest<T> {\n result: Promise<T>;\n cancel(): void;\n}\n\ninterface ObservedElementAPIInternal {\n /** @internal */\n onObservedElementUpdate(element: HTMLElement): void;\n}\n\nexport interface ObservedElementAPI\n extends Subscribable<HTMLElement, ObservedElementDetails>,\n Disposable,\n ObservedElementAPIInternal {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): HTMLElement | null;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): ObservedElementAsyncRequest<HTMLElement | null>;\n requestFocus(observedName: string, timeout: number): ObservedElementAsyncRequest<boolean>;\n}\n\nexport interface CrossOriginElement {\n readonly uid: string;\n readonly ownerId: string;\n readonly id?: string;\n readonly rootId?: string;\n readonly observedName?: string;\n readonly observedDetails?: string;\n focus(noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;\n}\n\nexport interface CrossOriginSentTo {\n [id: string]: true;\n}\n\nexport interface CrossOriginTransactionTypes {\n Bootstrap: 1;\n FocusElement: 2;\n State: 3;\n GetElement: 4;\n RestoreFocusInDeloser: 5;\n Ping: 6;\n}\nexport type CrossOriginTransactionType = CrossOriginTransactionTypes[keyof CrossOriginTransactionTypes];\n\nexport interface CrossOriginTransactionData<I, O> {\n transaction: string;\n type: CrossOriginTransactionType;\n isResponse: boolean;\n timestamp: number;\n owner: string;\n sentto: CrossOriginSentTo;\n timeout?: number;\n target?: string;\n beginData?: I;\n endData?: O;\n}\n\nexport type CrossOriginTransactionSend = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>,\n) => void;\n\nexport interface CrossOriginMessage {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>;\n send: CrossOriginTransactionSend;\n}\n\nexport interface CrossOriginFocusedElementState\n extends Subscribable<CrossOriginElement | undefined, FocusedElementDetails>,\n Disposable {\n focus(\n element: CrossOriginElement,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusById(\n elementId: string,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusByObservedName(\n observedName: string,\n timeout?: number,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n}\n\nexport interface CrossOriginObservedElementState\n extends Subscribable<CrossOriginElement, ObservedElementProps>,\n Disposable {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): Promise<CrossOriginElement | null>;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): Promise<CrossOriginElement | null>;\n requestFocus(observedName: string, timeout: number): Promise<boolean>;\n}\n\nexport interface CrossOriginAPI {\n focusedElement: CrossOriginFocusedElementState;\n observedElement: CrossOriginObservedElementState;\n\n setup(sendUp?: CrossOriginTransactionSend | null): (msg: CrossOriginMessage) => void;\n isSetUp(): boolean;\n dispose(): void;\n}\n\nexport interface OutlineProps {\n areaClass: string;\n outlineClass: string;\n outlineColor: string;\n outlineWidth: number;\n zIndex: number;\n}\n\nexport interface OutlinedElementProps {\n isIgnored?: boolean;\n}\n\nexport interface OutlineAPI extends Disposable {\n setup(props?: Partial<OutlineProps>): void;\n}\n\nexport interface DeloserElementActions {\n focusDefault: () => boolean;\n focusFirst: () => boolean;\n resetFocus: () => boolean;\n clearHistory: (preserveExisting?: boolean) => void;\n setSnapshot: (index: number) => void;\n isActive: () => boolean;\n}\n\nexport interface RestoreFocusOrders {\n History: 0;\n DeloserDefault: 1;\n RootDefault: 2;\n DeloserFirst: 3;\n RootFirst: 4;\n}\nexport type RestoreFocusOrder = RestoreFocusOrders[keyof RestoreFocusOrders];\nexport const RestoreFocusOrders: RestoreFocusOrders = {\n History: 0,\n DeloserDefault: 1,\n RootDefault: 2,\n DeloserFirst: 3,\n RootFirst: 4,\n};\n\nexport interface DeloserProps {\n restoreFocusOrder?: RestoreFocusOrder;\n noSelectorCheck?: boolean;\n}\n\nexport interface Deloser extends TabsterPart<DeloserProps> {\n readonly uid: string;\n dispose(): void;\n isActive(): boolean;\n setActive(active: boolean): void;\n getActions(): DeloserElementActions;\n setSnapshot(index: number): void;\n focusFirst(): boolean;\n unshift(element: HTMLElement): void;\n focusDefault(): boolean;\n resetFocus(): boolean;\n findAvailable(): HTMLElement | null;\n clearHistory(preserveExisting?: boolean): void;\n customFocusLostHandler(element: HTMLElement): boolean;\n}\n\nexport type DeloserConstructor = (element: HTMLElement, props: DeloserProps) => Deloser;\n\ninterface DeloserInterfaceInternal {\n /** @internal */\n createDeloser(element: HTMLElement, props: DeloserProps): Deloser;\n}\n\nexport interface DeloserAPI extends DeloserInterfaceInternal, Disposable {\n getActions(element: HTMLElement): DeloserElementActions | undefined;\n pause(): void;\n resume(restore?: boolean): void;\n}\n\nexport interface FocusableProps {\n isDefault?: boolean;\n isIgnored?: boolean;\n /**\n * Do not determine an element's focusability based on aria-disabled.\n */\n ignoreAriaDisabled?: boolean;\n /**\n * Exclude element (and all subelements) from Mover navigation.\n */\n excludeFromMover?: boolean;\n /**\n * Prevents tabster from handling the keydown event\n */\n ignoreKeydown?: {\n Tab?: boolean;\n Escape?: boolean;\n Enter?: boolean;\n ArrowUp?: boolean;\n ArrowDown?: boolean;\n ArrowLeft?: boolean;\n ArrowRight?: boolean;\n PageUp?: boolean;\n PageDown?: boolean;\n Home?: boolean;\n End?: boolean;\n };\n}\n\nexport interface FocusableAcceptElementState {\n container: HTMLElement;\n modalizerUserId?: string;\n currentCtx?: TabsterContext;\n from: HTMLElement;\n fromCtx?: TabsterContext;\n isBackward?: boolean;\n found?: boolean;\n foundElement?: HTMLElement;\n foundBackward?: HTMLElement;\n rejectElementsFrom?: HTMLElement;\n uncontrolled?: HTMLElement;\n acceptCondition: (el: HTMLElement) => boolean;\n hasCustomCondition?: boolean;\n includeProgrammaticallyFocusable?: boolean;\n ignoreAccessibility?: boolean;\n cachedGrouppers: {\n [id: string]: {\n isActive: boolean | undefined;\n first?: HTMLElement | null;\n };\n };\n isFindAll?: boolean;\n /**\n * A flag that indicates that some focusable elements were skipped\n * during the search and the found element is not the one the browser\n * would normally focus if the user pressed Tab.\n */\n skippedFocusable?: boolean;\n}\n\nexport interface FindFocusableProps {\n /**\n * The container used for the search.\n */\n container: HTMLElement;\n /**\n * The elemet to start from.\n */\n currentElement?: HTMLElement;\n /**\n * See `referenceElement` of GetTabsterContextOptions for description.\n */\n referenceElement?: HTMLElement;\n /**\n * Includes elements that can be focused programmatically.\n */\n includeProgrammaticallyFocusable?: boolean;\n /**\n * Ignore accessibility check.\n */\n ignoreAccessibility?: boolean;\n /**\n * Take active modalizer into account when searching for elements\n * (the elements out of active modalizer will not be returned).\n */\n useActiveModalizer?: boolean;\n /**\n * Search withing the specified modality, null for everything outside of modalizers, string within\n * a specific id, undefined for search within the current application state.\n */\n modalizerId?: string | null;\n /**\n * If true, find previous element instead of the next one.\n */\n isBackward?: boolean;\n /**\n * @param el - element visited.\n * @returns if an element should be accepted.\n */\n acceptCondition?(el: HTMLElement): boolean;\n /**\n * A callback that will be called for every focusable element found during findAll().\n * If false is returned from this callback, the search will stop.\n */\n onElement?: FindElementCallback;\n}\n\nexport interface FindFocusableOutputProps {\n /**\n * An output parameter. Will be true after the findNext/findPrev() call if some focusable\n * elements were skipped during the search and the result element not immediately next\n * focusable after the currentElement.\n */\n outOfDOMOrder?: boolean;\n /**\n * An output parameter. Will be true if the found element is uncontrolled.\n */\n uncontrolled?: HTMLElement | null;\n}\n\nexport type FindFirstProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindNextProps = Pick<\n FindFocusableProps,\n | 'currentElement'\n | 'referenceElement'\n | 'container'\n | 'modalizerId'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'ignoreAccessibility'\n>;\n\nexport type FindDefaultProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindAllProps = Pick<\n FindFocusableProps,\n | 'container'\n | 'modalizerId'\n | 'currentElement'\n | 'isBackward'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'acceptCondition'\n | 'ignoreAccessibility'\n | 'onElement'\n>;\n\n/**\n * A callback that is called for every found element during search. Returning false stops search.\n */\nexport type FindElementCallback = (element: HTMLElement) => boolean;\n\nexport interface FocusableAPI extends Disposable {\n getProps(element: HTMLElement): FocusableProps;\n\n isFocusable(\n element: HTMLElement,\n includeProgrammaticallyFocusable?: boolean,\n noVisibleCheck?: boolean,\n noAccessibleCheck?: boolean,\n ): boolean;\n isVisible(element: HTMLElement): boolean;\n isAccessible(element: HTMLElement): boolean;\n // find* return null when there is no element and undefined when there is an uncontrolled area.\n findFirst(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findLast(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findNext(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findPrev(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findDefault(options: FindDefaultProps, out?: FindFocusableOutputProps): HTMLElement | null;\n /**\n * @returns All focusables in a given context that satisfy an given condition\n */\n findAll(options: FindAllProps): HTMLElement[];\n findElement(options: FindFocusableProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n}\n\nexport interface DummyInputManager {\n moveOut: (backwards: boolean) => void;\n moveOutWithDefaultAction: (backwards: boolean, relatedEvent: KeyboardEvent) => void;\n}\n\nexport interface Visibilities {\n Invisible: 0;\n PartiallyVisible: 1;\n Visible: 2;\n}\nexport const Visibilities: Visibilities = {\n Invisible: 0,\n PartiallyVisible: 1,\n Visible: 2,\n};\nexport type Visibility = Visibilities[keyof Visibilities];\n\nexport interface MoverElementState {\n isCurrent: boolean | undefined; // Tri-state bool. Undefined when there is no current in the container.\n visibility: Visibility;\n}\n\nexport interface MoverDirections {\n Both: 0; // Default, both left/up keys move to the previous, right/down move to the next.\n Vertical: 1; // Only up/down arrows move to the next/previous.\n Horizontal: 2; // Only left/right arrows move to the next/previous.\n Grid: 3; // Two-dimentional movement depending on the visual placement.\n GridLinear: 4; // Two-dimentional movement depending on the visual placement. Allows linear movement.\n}\n\nexport const RestorerTypes = {\n Source: 0,\n Target: 1,\n} as const;\n\nexport type RestorerType = (typeof RestorerTypes)[keyof typeof RestorerTypes];\n\nexport const MoverDirections: MoverDirections = {\n Both: 0,\n Vertical: 1,\n Horizontal: 2,\n Grid: 3,\n GridLinear: 4,\n};\nexport type MoverDirection = MoverDirections[keyof MoverDirections];\n\nexport type NextTabbable = {\n element: HTMLElement | null | undefined;\n uncontrolled?: HTMLElement | null;\n outOfDOMOrder?: boolean;\n};\n\nexport interface MoverProps {\n direction?: MoverDirection;\n memorizeCurrent?: boolean;\n tabbable?: boolean;\n /**\n * Whether to allow cyclic navigation in the mover\n * Can only be applied if navigationType is MoverKeys.Arrows\n *\n * @defaultValue false\n */\n cyclic?: boolean;\n /**\n * In case we need a rich state of the elements inside a Mover,\n * we can track it. It takes extra resourses and might affect\n * performance when a Mover has many elements inside, so make sure\n * you use this prop when it is really needed.\n */\n trackState?: boolean;\n /**\n * When set to Visibility.Visible or Visibility.PartiallyVisible,\n * uses the visibility part of the trackState prop to be able to\n * go to first/last visible element (instead of first/last focusable\n * element in DOM) when tabbing from outside of the mover.\n */\n visibilityAware?: Visibility;\n /**\n * When true, Mover will try to locate a focusable with Focusable.isDefault\n * property as a prioritized element to focus. True by default.\n */\n hasDefault?: boolean;\n /**\n * A value between 0 and 1 that specifies the tolerance allowed\n * when testing for visibility.\n *\n * @example\n * an element of height 100px has 10px that are above the viewport\n * hidden by scroll. This element is a valid visible element to focus.\n *\n * @default 0.8\n */\n visibilityTolerance?: number;\n}\n\nexport type MoverEvent = TabsterEventWithDetails<MoverElementState>;\n\nexport interface Mover extends TabsterPart<MoverProps>, TabsterPartWithFindNextTabbable, TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n readonly visibilityTolerance: NonNullable<MoverProps['visibilityTolerance']>;\n dispose(): void;\n setCurrent(element: HTMLElement | undefined): void;\n getCurrent(): HTMLElement | null;\n getState(element: HTMLElement): MoverElementState | undefined;\n}\n\nexport type MoverConstructor = (tabster: TabsterCore, element: HTMLElement, props: MoverProps) => Mover;\n\ninterface MoverAPIInternal {\n /** @internal */\n createMover(element: HTMLElement, props: MoverProps, sys: SysProps | undefined): Mover;\n}\n\nexport interface MoverKeys {\n ArrowUp: 1;\n ArrowDown: 2;\n ArrowLeft: 3;\n ArrowRight: 4;\n PageUp: 5;\n PageDown: 6;\n Home: 7;\n End: 8;\n}\nexport type MoverKey = MoverKeys[keyof MoverKeys];\nexport const MoverKeys: MoverKeys = {\n ArrowUp: 1,\n ArrowDown: 2,\n ArrowLeft: 3,\n ArrowRight: 4,\n PageUp: 5,\n PageDown: 6,\n Home: 7,\n End: 8,\n};\n\nexport interface MoverAPI extends MoverAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(fromElement: HTMLElement, key: MoverKey): HTMLElement | null;\n}\n\nexport interface GroupperTabbabilities {\n Unlimited: 0;\n Limited: 1; // The tabbability is limited to the container and explicit Enter is needed to go inside.\n LimitedTrapFocus: 2; // The focus is limited as above, plus trapped when inside.\n}\nexport const GroupperTabbabilities: GroupperTabbabilities = {\n Unlimited: 0,\n Limited: 1,\n LimitedTrapFocus: 2,\n};\nexport type GroupperTabbability = GroupperTabbabilities[keyof GroupperTabbabilities];\n\nexport interface GroupperProps {\n tabbability?: GroupperTabbability;\n delegated?: boolean; // This allows to tweak the groupper behaviour for the cases when\n // the groupper container is not focusable and groupper has Limited or LimitedTrapFocus\n // tabbability. By default, the groupper will automatically become active once the focus\n // goes to first focusable element inside the groupper during tabbing. When true, the\n // groupper will become active only after Enter is pressed on first focusable element\n // inside the groupper.\n}\n\nexport interface Groupper\n extends TabsterPart<GroupperProps>,\n TabsterPartWithFindNextTabbable,\n TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n dispose(): void;\n makeTabbable(isUnlimited: boolean): void;\n isActive(noIfFirstIsFocused?: boolean): boolean | undefined; // Tri-state boolean, undefined when parent is not active, false when parent is active.\n setFirst(element: HTMLElement | undefined): void;\n getFirst(orContainer: boolean): HTMLElement | undefined;\n}\n\nexport type GroupperConstructor = (tabster: TabsterCore, element: HTMLElement, props: GroupperProps) => Groupper;\n\nexport interface GroupperAPIInternal {\n /** @internal */\n createGroupper(element: HTMLElement, props: GroupperProps, sys: SysProps | undefined): Groupper;\n /** @internal */\n handleKeyPress(element: HTMLElement, event: KeyboardEvent, fromModalizer?: boolean): void;\n}\n\nexport interface GroupperAPI extends GroupperAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(element: HTMLElement, action: GroupperMoveFocusAction): HTMLElement | null;\n}\n\nexport interface GroupperAPIInternal {\n forgetCurrentGrouppers(): void;\n}\n\nexport interface ModalizerProps {\n id: string;\n isOthersAccessible?: boolean;\n isAlwaysAccessible?: boolean;\n isNoFocusFirst?: boolean;\n isNoFocusDefault?: boolean;\n /** A focus trap variant, keeps focus inside the modal when tabbing */\n isTrapped?: boolean;\n}\n\nexport type ModalizerEventName =\n | typeof ModalizerActiveEventName\n | typeof ModalizerInactiveEventName\n | typeof ModalizerBeforeFocusOutEventName\n | typeof ModalizerFocusInEventName\n | typeof ModalizerFocusOutEventName;\n\nexport type ModalizerEventDetails = {\n id: string;\n element: HTMLElement;\n eventName: ModalizerEventName;\n};\n\nexport type ModalizerEvent = TabsterEventWithDetails<ModalizerEventDetails>;\n\nexport interface Modalizer extends TabsterPart<ModalizerProps>, TabsterPartWithFindNextTabbable {\n readonly userId: string;\n readonly dummyManager: DummyInputManager | undefined;\n /**\n * @returns - Whether the element is inside the modalizer\n */\n contains(element: HTMLElement): boolean;\n dispose(): void;\n isActive(): boolean;\n makeActive(isActive: boolean): void;\n focused(noIncrement?: boolean): number;\n triggerFocusEvent(eventName: ModalizerEventName, allElements: boolean): boolean;\n}\n\nexport type ModalizerConstructor = (tabster: TabsterCore, element: HTMLElement, props: ModalizerProps) => Modalizer;\n\nexport interface RootProps {\n restoreFocusOrder?: RestoreFocusOrder;\n}\n\nexport interface Root extends TabsterPart<RootProps> {\n /**@internal*/\n addDummyInputs(): void;\n\n readonly uid: string;\n dispose(): void;\n moveOutWithDefaultAction(backwards: boolean, relatedEvent: KeyboardEvent): void;\n}\n\nexport type RootConstructor = (tabster: TabsterCore, element: HTMLElement, props: RootProps) => Root;\n\nexport interface SysDummyInputsPositions {\n Auto: 0; // Tabster will place dummy inputs depending on the container tag name and on the default behaviour.\n Inside: 1; // Tabster will always place dummy inputs inside the container.\n Outside: 2; // Tabster will always place dummy inputs outside of the container.\n}\nexport const SysDummyInputsPositions: SysDummyInputsPositions = {\n Auto: 0,\n Inside: 1,\n Outside: 2,\n};\nexport type SysDummyInputsPosition = SysDummyInputsPositions[keyof SysDummyInputsPositions];\n/**\n * Ability to fine-tune Tabster internal behaviour in rare cases of need.\n * Normally, should not be used. A deep understanding of the intention and the effect\n * is required.\n */\nexport interface SysProps {\n /**\n * Force dummy input position outside or inside of the element.\n * By default (when undefined), the position is determined dynamically\n * (for example inside for <li> elements and outside for <table> elements,\n * plus a default Groupper/Mover/Modalizer implementation position).\n * Setting to true will force the dummy inputs to be always outside of the element,\n * setting to false will force the dummy inputs to be always inside.\n */\n dummyInputsPosition?: SysDummyInputsPosition;\n}\n\nexport interface GetTabsterContextOptions {\n /**\n * Should visit **all** element ancestors to verify if `dir='rtl'` is set\n */\n checkRtl?: boolean;\n /**\n * The element to start computing the context from. Useful when dealing\n * with nested structures. For example, if we have an element inside a groupper\n * inside another groupper, the `groupper` prop in this element's contexts will\n * be the inner groupper, but when we pass the inner groupper's parent element\n * as `referenceElement`, the context groupper will be the outer one. Having\n * this option simplifies searching for the next tabbable element in the\n * environment of nested movers and grouppers.\n */\n referenceElement?: HTMLElement;\n}\n\nexport type TabsterContextMoverGroupper = { isMover: true; mover: Mover } | { isMover: false; groupper: Groupper };\n\nexport interface TabsterContext {\n root: Root;\n modalizer?: Modalizer;\n groupper?: Groupper;\n mover?: Mover;\n groupperBeforeMover?: boolean;\n modalizerInGroupper?: Groupper;\n /**\n * Whether `dir='rtl'` is set on an ancestor\n */\n rtl?: boolean;\n excludedFromMover?: boolean;\n uncontrolled?: HTMLElement | null;\n ignoreKeydown: (e: KeyboardEvent) => boolean;\n}\n\nexport interface RootFocusEventDetails {\n element: HTMLElement;\n}\n\ninterface RootAPIInternal {\n /**@internal*/\n createRoot(element: HTMLElement, props: RootProps, sys: SysProps | undefined): Root;\n /**@internal*/\n onRoot(root: Root, removed?: boolean): void;\n /**@internal*/\n addDummyInputs(): void;\n}\n\nexport interface RootAPI extends Disposable, RootAPIInternal {\n eventTarget: EventTarget;\n}\n\nexport interface UncontrolledAPI {\n isUncontrolledCompletely(element: HTMLElement, completely: boolean): boolean;\n}\n\ninterface ModalizerAPIInternal extends TabsterPartWithAcceptElement {\n /** @internal */\n activeId: string | undefined; // currently active Modalizer user id.\n /** @internal */\n currentIsOthersAccessible: boolean | undefined; // isOthersAccessible value of the currently active Modalizer.\n /** @internal */\n activeElements: WeakHTMLElement<HTMLElement>[];\n /** @internal */\n createModalizer(element: HTMLElement, props: ModalizerProps, sys: SysProps | undefined): Modalizer;\n /**\n * Sets active modalizers.\n * When active, everything outside of the modalizers with the specific user\n * defined id gets `aria-hidden`.\n *\n * @param userId - user defined identifier or undefined (if nothing is modal).\n */\n /** @internal */\n setActive(modalizer: Modalizer | undefined): void;\n /** @internal */\n hiddenUpdate(): void;\n /** @internal */\n isAugmented(element: HTMLElement): boolean;\n}\n\nexport interface ModalizerAPI extends ModalizerAPIInternal, Disposable {\n /**\n * Activates a Modalizer and focuses the first or default element within\n *\n * @param elementFromModalizer - An element that belongs to a Modalizer\n * @param noFocusFirst - Do not focus on the first element in the Modalizer\n * @param noFocusDefault - Do not focus the default element in the Modalizre\n */\n focus(elementFromModalizer: HTMLElement, noFocusFirst?: boolean, noFocusDefault?: boolean): boolean;\n}\n\ninterface RestorerAPIInternal {\n /** @internal */\n createRestorer(element: HTMLElement, props: RestorerProps): Restorer;\n}\n\nexport interface RestorerAPI extends RestorerAPIInternal, Disposable {}\n\nexport interface Restorer extends Disposable, TabsterPart<RestorerProps> {}\n/**\n * A signature for the accessibleCheck callback from getModalizer().\n * It is called when active Modalizer sets aria-hidden on elements outsidef of it.\n *\n * @param element - The element that is about to receive aria-hidden.\n * @param activeModalizerElements - The container elements of the active modalizer.\n * @returns true if the element should remain accessible and should not receive\n * aria-hidden.\n */\nexport type ModalizerElementAccessibleCheck = (\n element: HTMLElement,\n activeModalizerElements?: HTMLElement[],\n) => boolean;\n\nexport interface UncontrolledProps {\n // Normally, even uncontrolled areas should not be completely uncontrolled\n // to be able to interact with the rest of the application properly.\n // For example, if an uncontrolled area implements something like\n // roving tabindex, it should be uncontrolled inside the area, but it\n // still should be able to be an organic part of the application.\n // However, in some cases, third party component might want to be able\n // to gain full control of the area, for example, if it implements\n // some custom trap focus logic.\n // `completely` indicates that uncontrolled area must gain full control over\n // Tab handling. If not set, Tabster might still handle Tab in the\n // uncontrolled area, when, for example, there is an inactive Modalizer\n // (that needs to be skipped) after the last focusable element of the\n // uncontrolled area.\n // WARNING: Use with caution, as it might break the normal keyboard navigation\n // between the uncontrolled area and the rest of the application.\n completely?: boolean;\n}\n\nexport interface DeloserOnElement {\n deloser: Deloser;\n}\n\nexport interface RootOnElement {\n root: Root;\n}\n\nexport interface ModalizerOnElement {\n modalizer: Modalizer;\n}\n\nexport interface RestorerOnElement {\n restorer: Restorer;\n}\n\nexport interface FocusableOnElement {\n focusable: FocusableProps;\n}\n\nexport interface MoverOnElement {\n mover: Mover;\n}\n\nexport interface GroupperOnElement {\n groupper: Groupper;\n}\n\nexport interface UncontrolledOnElement {\n uncontrolled: UncontrolledProps;\n}\n\nexport interface ObservedOnElement {\n observed: ObservedElementProps;\n}\n\nexport interface OutlineOnElement {\n outline: OutlinedElementProps;\n}\n\nexport interface SysOnElement {\n sys: SysProps;\n}\n\nexport interface RestorerProps {\n type: RestorerType;\n}\n\nexport type TabsterAttributeProps = Partial<{\n deloser: DeloserProps;\n root: RootProps;\n uncontrolled: UncontrolledProps;\n modalizer: ModalizerProps;\n focusable: FocusableProps;\n groupper: GroupperProps;\n mover: MoverProps;\n observed: ObservedElementProps;\n outline: OutlinedElementProps;\n sys: SysProps;\n restorer: RestorerProps;\n}>;\n\nexport interface TabsterAttributeOnElement {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n string: string;\n object: TabsterAttributeProps;\n}\n\nexport interface TabsterAugmentedAttributes {\n [name: string]: string | null;\n}\n\nexport type TabsterOnElement = Partial<\n RootOnElement &\n DeloserOnElement &\n ModalizerOnElement &\n FocusableOnElement &\n MoverOnElement &\n GroupperOnElement &\n ObservedOnElement &\n OutlineOnElement &\n UncontrolledOnElement &\n SysOnElement &\n RestorerOnElement\n>;\n\nexport interface OutlineElements {\n container: HTMLDivElement;\n left: HTMLDivElement;\n top: HTMLDivElement;\n right: HTMLDivElement;\n bottom: HTMLDivElement;\n}\n\nexport interface TabsterElementStorageEntry {\n tabster?: TabsterOnElement;\n attr?: TabsterAttributeOnElement;\n aug?: TabsterAugmentedAttributes;\n}\n\nexport interface TabsterElementStorage {\n [uid: string]: TabsterElementStorageEntry;\n}\n\nexport type DisposeFunc = () => void;\n\nexport interface InternalAPI {\n stopObserver(): void;\n resumeObserver(syncState: boolean): void;\n}\n\nexport interface DummyInputObserver {\n add(dummy: HTMLElement, callback: () => void): void;\n remove(dummy: HTMLElement): void;\n dispose(): void;\n domChanged?(parent: HTMLElement): void;\n updatePositions(\n compute: (scrollTopLeftCache: Map<HTMLElement, { scrollTop: number; scrollLeft: number } | null>) => () => void,\n ): void;\n}\n\ninterface TabsterCoreInternal {\n /** @internal */\n groupper?: GroupperAPI;\n /** @internal */\n mover?: MoverAPI;\n /** @internal */\n outline?: OutlineAPI;\n /** @internal */\n deloser?: DeloserAPI;\n /** @internal */\n modalizer?: ModalizerAPI;\n /** @internal */\n observedElement?: ObservedElementAPI;\n /** @internal */\n crossOrigin?: CrossOriginAPI;\n /** @internal */\n internal: InternalAPI;\n /** @internal */\n restorer?: RestorerAPI;\n\n /** @internal */\n _dummyObserver: DummyInputObserver;\n\n // The version of the tabster package this instance is on\n /** @internal */\n _version: string;\n\n // No operation flag for the debugging purposes\n /** @internal */\n _noop: boolean;\n\n /** @internal */\n storageEntry(element: HTMLElement, addremove?: boolean): TabsterElementStorageEntry | undefined;\n /** @internal */\n getWindow: GetWindow;\n\n /** @internal */\n createTabster(noRefCount?: boolean, props?: TabsterCoreProps): Tabster;\n /** @internal */\n disposeTabster(wrapper: Tabster, allInstances?: boolean): void;\n /** @internal */\n forceCleanup(): void;\n\n /** @internal */\n queueInit(callback: () => void): void;\n /** @internal */\n drainInitQueue(): void;\n /** @internal */\n getParent: (el: Node) => Node | null;\n}\n\nexport interface Tabster {\n keyboardNavigation: KeyboardNavigationState;\n focusedElement: FocusedElementState;\n focusable: FocusableAPI;\n root: RootAPI;\n uncontrolled: UncontrolledAPI;\n\n /** @internal */\n core: TabsterCore;\n}\n\nexport interface TabsterCore\n extends Pick<TabsterCoreProps, 'controlTab' | 'rootDummyInputs'>,\n Disposable,\n TabsterCoreInternal,\n Omit<Tabster, 'core'> {}\n\nexport interface TabsterCompat {\n attributeTransform?: <P>(old: P) => TabsterAttributeProps;\n}\n"],"names":["DeloserEventName","FocusInEventName","FocusOutEventName","FocusableSelector","GroupperMoveFocusActions","GroupperMoveFocusEventName","GroupperTabbabilities","ModalizerActiveEventName","ModalizerBeforeFocusOutEventName","ModalizerFocusInEventName","ModalizerFocusOutEventName","ModalizerInactiveEventName","MoveFocusEventName","MoverDirections","MoverEventName","MoverKeys","MoverMoveFocusEventName","ObservedElementAccesibilities","RestoreFocusOrders","RestorerTypes","SysDummyInputsPositions","TabsterAttributeName","TabsterDummyInputAttributeName","Visibilities","join","Enter","Escape","Any","Accessible","Focusable","History","DeloserDefault","RootDefault","DeloserFirst","RootFirst","Invisible","PartiallyVisible","Visible","Source","Target","Both","Vertical","Horizontal","Grid","GridLinear","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","Unlimited","Limited","LimitedTrapFocus","Auto","Inside","Outside"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC,GAED;;;;;;;;;;;CAWC;;;;;;;;;;;IAIYA,gBAAAA;eAAAA;;IAOAC,gBAAAA;eAAAA;;IACAC,iBAAAA;eAAAA;;IAcAC,iBAAAA;eAAAA;;IAkBAC,wBAAAA;eAAAA;;IApBAC,0BAAAA;eAAAA;;IA8sBAC,qBAAAA;eAAAA;;IAjuBAC,wBAAAA;eAAAA;;IAIAC,gCAAAA;eAAAA;;IAFAC,yBAAAA;eAAAA;;IACAC,0BAAAA;eAAAA;;IAFAC,0BAAAA;eAAAA;;IAWAC,kBAAAA;eAAAA;;IAwmBAC,eAAAA;eAAAA;;IA/mBAC,cAAAA;eAAAA;;IAusBAC,SAAAA;eAAAA;;IA5rBAC,uBAAAA;eAAAA;;IAoMAC,6BAAAA;eAAAA;;IA0JAC,kBAAAA;eAAAA;;IA+PAC,aAAAA;eAAAA;;IAiOAC,uBAAAA;eAAAA;;IAj1BAC,oBAAAA;eAAAA;;IACAC,8BAAAA;eAAAA;;IA2lBAC,YAAAA;eAAAA;;;AA5lBN,MAAMF,uBAAuB;AAC7B,MAAMC,iCAAiC;AACvC,MAAMtB,mBAAmB;AACzB,MAAMO,2BAA2B;AACjC,MAAMI,6BAA6B;AACnC,MAAMF,4BAA4B;AAClC,MAAMC,6BAA6B;AACnC,MAAMF,mCAAmC;AACzC,MAAMM,iBAAiB;AACvB,MAAMb,mBAAmB;AACzB,MAAMC,oBAAoB;AAK1B,MAAMU,qBAAqB;AAI3B,MAAMI,0BAA0B;AAGhC,MAAMX,6BAA6B;AAEnC,MAAMF,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAACqB,IAAI,CAAC;AAUA,MAAMpB,2BAAqD;IAChEqB,OAAO;IACPC,QAAQ;AACV;AA0KO,MAAMT,gCAA+D;IAC1EU,KAAK;IACLC,YAAY;IACZC,WAAW;AACb;AAsJO,MAAMX,qBAAyC;IACpDY,SAAS;IACTC,gBAAgB;IAChBC,aAAa;IACbC,cAAc;IACdC,WAAW;AACb;AAqOO,MAAMX,eAA6B;IACxCY,WAAW;IACXC,kBAAkB;IAClBC,SAAS;AACX;AAgBO,MAAMlB,gBAAgB;IAC3BmB,QAAQ;IACRC,QAAQ;AACV;AAIO,MAAM1B,kBAAmC;IAC9C2B,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,MAAM;IACNC,YAAY;AACd;AAkFO,MAAM7B,YAAuB;IAClC8B,SAAS;IACTC,WAAW;IACXC,WAAW;IACXC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;IACNC,KAAK;AACP;AAYO,MAAM9C,wBAA+C;IAC1D+C,WAAW;IACXC,SAAS;IACTC,kBAAkB;AACpB;AAyGO,MAAMnC,0BAAmD;IAC9DoC,MAAM;IACNC,QAAQ;IACRC,SAAS;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabster",
3
- "version": "9.22.1",
3
+ "version": "9.22.2",
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,13 +31,13 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/react-shared-contexts": "^9.19.0",
34
+ "@fluentui/react-shared-contexts": "^9.19.1",
35
35
  "@fluentui/react-theme": "^9.1.19",
36
- "@fluentui/react-utilities": "^9.18.11",
36
+ "@fluentui/react-utilities": "^9.18.12",
37
37
  "@griffel/react": "^1.5.22",
38
38
  "@swc/helpers": "^0.5.1",
39
39
  "keyborg": "^2.6.0",
40
- "tabster": "^8.0.0"
40
+ "tabster": "^8.0.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@types/react": ">=16.14.0 <19.0.0",