@fluentui/react-aria 9.10.2 → 9.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,20 +1,42 @@
1
1
  # Change Log - @fluentui/react-aria
2
2
 
3
- This log was last generated on Mon, 18 Mar 2024 19:44:52 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 17 Apr 2024 21:47:16 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.10.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.10.4)
8
+
9
+ Wed, 17 Apr 2024 21:47:16 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.10.3..@fluentui/react-aria_v9.10.4)
11
+
12
+ ### Patches
13
+
14
+ - fix: End key should move activeOption ([PR #30864](https://github.com/microsoft/fluentui/pull/30864) by sarah.higley@microsoft.com)
15
+ - Bump @fluentui/react-tabster to v9.20.0 ([PR #31100](https://github.com/microsoft/fluentui/pull/31100) by beachball)
16
+
17
+ ## [9.10.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.10.3)
18
+
19
+ Tue, 02 Apr 2024 09:48:01 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.10.2..@fluentui/react-aria_v9.10.3)
21
+
22
+ ### Patches
23
+
24
+ - Bump @fluentui/react-shared-contexts to v9.16.0 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
25
+ - Bump @fluentui/react-jsx-runtime to v9.0.35 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
26
+ - Bump @fluentui/react-tabster to v9.19.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
27
+ - Bump @fluentui/react-utilities to v9.18.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
28
+
7
29
  ## [9.10.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.10.2)
8
30
 
9
- Mon, 18 Mar 2024 19:44:52 GMT
31
+ Mon, 18 Mar 2024 19:50:46 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.10.1..@fluentui/react-aria_v9.10.2)
11
33
 
12
34
  ### Patches
13
35
 
14
- - Bump @fluentui/react-shared-contexts to v9.15.2 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
15
- - Bump @fluentui/react-jsx-runtime to v9.0.34 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
16
- - Bump @fluentui/react-tabster to v9.19.5 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
17
- - Bump @fluentui/react-utilities to v9.18.5 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
36
+ - Bump @fluentui/react-shared-contexts to v9.15.2 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
37
+ - Bump @fluentui/react-jsx-runtime to v9.0.34 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
38
+ - Bump @fluentui/react-tabster to v9.19.5 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
39
+ - Bump @fluentui/react-utilities to v9.18.5 ([PR #30600](https://github.com/microsoft/fluentui/pull/30600) by beachball)
18
40
 
19
41
  ## [9.10.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.10.1)
20
42
 
@@ -37,6 +37,7 @@ export function useOptionWalker(options) {
37
37
  if (!treeWalkerRef.current || !listboxRef.current) {
38
38
  return null;
39
39
  }
40
+ treeWalkerRef.current.currentNode = listboxRef.current;
40
41
  return treeWalkerRef.current.lastChild();
41
42
  },
42
43
  next: ()=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["useOptionWalker.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n\ninterface UseOptionWalkerOptions {\n matchOption: (el: HTMLElement) => boolean;\n}\n\nexport function useOptionWalker<TListboxElement extends HTMLElement>(options: UseOptionWalkerOptions) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef<TreeWalker | null>(null);\n const listboxRef = React.useRef<TListboxElement | null>(null);\n\n const optionFilter = React.useCallback(\n (node: Node) => {\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n [matchOption],\n );\n\n const setListbox = React.useCallback(\n (el: TListboxElement) => {\n if (el && targetDocument) {\n listboxRef.current = el;\n treeWalkerRef.current = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, optionFilter);\n } else {\n listboxRef.current = null;\n }\n },\n [targetDocument, optionFilter],\n );\n\n const optionWalker = React.useMemo(\n () => ({\n first: () => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.firstChild() as HTMLElement | null;\n },\n last: () => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.lastChild() as HTMLElement | null;\n },\n next: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.nextNode() as HTMLElement | null;\n },\n prev: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.previousNode() as HTMLElement | null;\n },\n find: (predicate: (id: string) => boolean, startFrom?: string) => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n const start = startFrom ? targetDocument?.getElementById(startFrom) : null;\n treeWalkerRef.current.currentNode = start ?? listboxRef.current;\n let cur: HTMLElement | null = treeWalkerRef.current.currentNode as HTMLElement;\n while (cur && !predicate(cur.id)) {\n cur = treeWalkerRef.current.nextNode() as HTMLElement | null;\n }\n\n return cur;\n },\n setCurrent: (el: HTMLElement) => {\n if (!treeWalkerRef.current) {\n return;\n }\n\n treeWalkerRef.current.currentNode = el;\n },\n }),\n [targetDocument],\n );\n\n return {\n optionWalker,\n listboxCallbackRef: setListbox,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","isHTMLElement","useOptionWalker","options","matchOption","targetDocument","treeWalkerRef","useRef","listboxRef","optionFilter","useCallback","node","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","setListbox","el","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","currentNode","firstChild","last","lastChild","next","nextNode","prev","previousNode","find","predicate","startFrom","start","getElementById","cur","id","setCurrent","listboxCallbackRef"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,aAAa,QAAQ,4BAA4B;AAM1D,OAAO,SAASC,gBAAqDC,OAA+B;IAClG,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAM,EAAEE,cAAc,EAAE,GAAGL;IAC3B,MAAMM,gBAAgBR,MAAMS,MAAM,CAAoB;IACtD,MAAMC,aAAaV,MAAMS,MAAM,CAAyB;IAExD,MAAME,eAAeX,MAAMY,WAAW,CACpC,CAACC;QACC,IAAIV,cAAcU,SAASP,YAAYO,OAAO;YAC5C,OAAOC,WAAWC,aAAa;QACjC;QAEA,OAAOD,WAAWE,WAAW;IAC/B,GACA;QAACV;KAAY;IAGf,MAAMW,aAAajB,MAAMY,WAAW,CAClC,CAACM;QACC,IAAIA,MAAMX,gBAAgB;YACxBG,WAAWS,OAAO,GAAGD;YACrBV,cAAcW,OAAO,GAAGZ,eAAea,gBAAgB,CAACF,IAAIJ,WAAWO,YAAY,EAAEV;QACvF,OAAO;YACLD,WAAWS,OAAO,GAAG;QACvB;IACF,GACA;QAACZ;QAAgBI;KAAa;IAGhC,MAAMW,eAAetB,MAAMuB,OAAO,CAChC,IAAO,CAAA;YACLC,OAAO;gBACL,IAAI,CAAChB,cAAcW,OAAO,IAAI,CAACT,WAAWS,OAAO,EAAE;oBACjD,OAAO;gBACT;gBAEAX,cAAcW,OAAO,CAACM,WAAW,GAAGf,WAAWS,OAAO;gBACtD,OAAOX,cAAcW,OAAO,CAACO,UAAU;YACzC;YACAC,MAAM;gBACJ,IAAI,CAACnB,cAAcW,OAAO,IAAI,CAACT,WAAWS,OAAO,EAAE;oBACjD,OAAO;gBACT;gBAEA,OAAOX,cAAcW,OAAO,CAACS,SAAS;YACxC;YACAC,MAAM;gBACJ,IAAI,CAACrB,cAAcW,OAAO,EAAE;oBAC1B,OAAO;gBACT;gBAEA,OAAOX,cAAcW,OAAO,CAACW,QAAQ;YACvC;YACAC,MAAM;gBACJ,IAAI,CAACvB,cAAcW,OAAO,EAAE;oBAC1B,OAAO;gBACT;gBAEA,OAAOX,cAAcW,OAAO,CAACa,YAAY;YAC3C;YACAC,MAAM,CAACC,WAAoCC;gBACzC,IAAI,CAAC3B,cAAcW,OAAO,IAAI,CAACT,WAAWS,OAAO,EAAE;oBACjD,OAAO;gBACT;gBAEA,MAAMiB,QAAQD,YAAY5B,2BAAAA,qCAAAA,eAAgB8B,cAAc,CAACF,aAAa;gBACtE3B,cAAcW,OAAO,CAACM,WAAW,GAAGW,kBAAAA,mBAAAA,QAAS1B,WAAWS,OAAO;gBAC/D,IAAImB,MAA0B9B,cAAcW,OAAO,CAACM,WAAW;gBAC/D,MAAOa,OAAO,CAACJ,UAAUI,IAAIC,EAAE,EAAG;oBAChCD,MAAM9B,cAAcW,OAAO,CAACW,QAAQ;gBACtC;gBAEA,OAAOQ;YACT;YACAE,YAAY,CAACtB;gBACX,IAAI,CAACV,cAAcW,OAAO,EAAE;oBAC1B;gBACF;gBAEAX,cAAcW,OAAO,CAACM,WAAW,GAAGP;YACtC;QACF,CAAA,GACA;QAACX;KAAe;IAGlB,OAAO;QACLe;QACAmB,oBAAoBxB;IACtB;AACF"}
1
+ {"version":3,"sources":["useOptionWalker.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n\ninterface UseOptionWalkerOptions {\n matchOption: (el: HTMLElement) => boolean;\n}\n\nexport function useOptionWalker<TListboxElement extends HTMLElement>(options: UseOptionWalkerOptions) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef<TreeWalker | null>(null);\n const listboxRef = React.useRef<TListboxElement | null>(null);\n\n const optionFilter = React.useCallback(\n (node: Node) => {\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n\n return NodeFilter.FILTER_SKIP;\n },\n [matchOption],\n );\n\n const setListbox = React.useCallback(\n (el: TListboxElement) => {\n if (el && targetDocument) {\n listboxRef.current = el;\n treeWalkerRef.current = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, optionFilter);\n } else {\n listboxRef.current = null;\n }\n },\n [targetDocument, optionFilter],\n );\n\n const optionWalker = React.useMemo(\n () => ({\n first: () => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.firstChild() as HTMLElement | null;\n },\n last: () => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.lastChild() as HTMLElement | null;\n },\n next: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.nextNode() as HTMLElement | null;\n },\n prev: () => {\n if (!treeWalkerRef.current) {\n return null;\n }\n\n return treeWalkerRef.current.previousNode() as HTMLElement | null;\n },\n find: (predicate: (id: string) => boolean, startFrom?: string) => {\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n\n const start = startFrom ? targetDocument?.getElementById(startFrom) : null;\n treeWalkerRef.current.currentNode = start ?? listboxRef.current;\n let cur: HTMLElement | null = treeWalkerRef.current.currentNode as HTMLElement;\n while (cur && !predicate(cur.id)) {\n cur = treeWalkerRef.current.nextNode() as HTMLElement | null;\n }\n\n return cur;\n },\n setCurrent: (el: HTMLElement) => {\n if (!treeWalkerRef.current) {\n return;\n }\n\n treeWalkerRef.current.currentNode = el;\n },\n }),\n [targetDocument],\n );\n\n return {\n optionWalker,\n listboxCallbackRef: setListbox,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","isHTMLElement","useOptionWalker","options","matchOption","targetDocument","treeWalkerRef","useRef","listboxRef","optionFilter","useCallback","node","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","setListbox","el","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","currentNode","firstChild","last","lastChild","next","nextNode","prev","previousNode","find","predicate","startFrom","start","getElementById","cur","id","setCurrent","listboxCallbackRef"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,aAAa,QAAQ,4BAA4B;AAM1D,OAAO,SAASC,gBAAqDC,OAA+B;IAClG,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAM,EAAEE,cAAc,EAAE,GAAGL;IAC3B,MAAMM,gBAAgBR,MAAMS,MAAM,CAAoB;IACtD,MAAMC,aAAaV,MAAMS,MAAM,CAAyB;IAExD,MAAME,eAAeX,MAAMY,WAAW,CACpC,CAACC;QACC,IAAIV,cAAcU,SAASP,YAAYO,OAAO;YAC5C,OAAOC,WAAWC,aAAa;QACjC;QAEA,OAAOD,WAAWE,WAAW;IAC/B,GACA;QAACV;KAAY;IAGf,MAAMW,aAAajB,MAAMY,WAAW,CAClC,CAACM;QACC,IAAIA,MAAMX,gBAAgB;YACxBG,WAAWS,OAAO,GAAGD;YACrBV,cAAcW,OAAO,GAAGZ,eAAea,gBAAgB,CAACF,IAAIJ,WAAWO,YAAY,EAAEV;QACvF,OAAO;YACLD,WAAWS,OAAO,GAAG;QACvB;IACF,GACA;QAACZ;QAAgBI;KAAa;IAGhC,MAAMW,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QACF,CAAA,GACA;QAACX;KAAe;IAGlB,OAAO;QACLe;QACAmB,oBAAoBxB;IACtB;AACF"}
@@ -48,6 +48,7 @@ function useOptionWalker(options) {
48
48
  if (!treeWalkerRef.current || !listboxRef.current) {
49
49
  return null;
50
50
  }
51
+ treeWalkerRef.current.currentNode = listboxRef.current;
51
52
  return treeWalkerRef.current.lastChild();
52
53
  },
53
54
  next: ()=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["useOptionWalker.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement } from '@fluentui/react-utilities';\nexport function useOptionWalker(options) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n const optionFilter = React.useCallback((node)=>{\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n return NodeFilter.FILTER_SKIP;\n }, [\n matchOption\n ]);\n const setListbox = React.useCallback((el)=>{\n if (el && targetDocument) {\n listboxRef.current = el;\n treeWalkerRef.current = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, optionFilter);\n } else {\n listboxRef.current = null;\n }\n }, [\n targetDocument,\n optionFilter\n ]);\n const optionWalker = React.useMemo(()=>({\n first: ()=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.firstChild();\n },\n last: ()=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n return treeWalkerRef.current.lastChild();\n },\n next: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.nextNode();\n },\n prev: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.previousNode();\n },\n find: (predicate, startFrom)=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n const start = startFrom ? targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.getElementById(startFrom) : null;\n treeWalkerRef.current.currentNode = start !== null && start !== void 0 ? start : listboxRef.current;\n let cur = treeWalkerRef.current.currentNode;\n while(cur && !predicate(cur.id)){\n cur = treeWalkerRef.current.nextNode();\n }\n return cur;\n },\n setCurrent: (el)=>{\n if (!treeWalkerRef.current) {\n return;\n }\n treeWalkerRef.current.currentNode = el;\n }\n }), [\n targetDocument\n ]);\n return {\n optionWalker,\n listboxCallbackRef: setListbox\n };\n}\n"],"names":["useOptionWalker","options","matchOption","targetDocument","useFluent","treeWalkerRef","React","useRef","listboxRef","optionFilter","useCallback","node","isHTMLElement","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","setListbox","el","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","currentNode","firstChild","last","lastChild","next","nextNode","prev","previousNode","find","predicate","startFrom","start","getElementById","cur","id","setCurrent","listboxCallbackRef"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;iEAHO;qCACyB;gCAClB;AACvB,SAASA,gBAAgBC,OAAO;IACnC,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAM,EAAEE,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,gBAAgBC,OAAMC,MAAM,CAAC;IACnC,MAAMC,aAAaF,OAAMC,MAAM,CAAC;IAChC,MAAME,eAAeH,OAAMI,WAAW,CAAC,CAACC;QACpC,IAAIC,IAAAA,6BAAa,EAACD,SAAST,YAAYS,OAAO;YAC1C,OAAOE,WAAWC,aAAa;QACnC;QACA,OAAOD,WAAWE,WAAW;IACjC,GAAG;QACCb;KACH;IACD,MAAMc,aAAaV,OAAMI,WAAW,CAAC,CAACO;QAClC,IAAIA,MAAMd,gBAAgB;YACtBK,WAAWU,OAAO,GAAGD;YACrBZ,cAAca,OAAO,GAAGf,eAAegB,gBAAgB,CAACF,IAAIJ,WAAWO,YAAY,EAAEX;QACzF,OAAO;YACHD,WAAWU,OAAO,GAAG;QACzB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P;YACxC;QACJ,CAAA,GAAI;QACJd;KACH;IACD,OAAO;QACHkB;QACAmB,oBAAoBxB;IACxB;AACJ"}
1
+ {"version":3,"sources":["useOptionWalker.js"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { isHTMLElement } from '@fluentui/react-utilities';\nexport function useOptionWalker(options) {\n const { matchOption } = options;\n const { targetDocument } = useFluent();\n const treeWalkerRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n const optionFilter = React.useCallback((node)=>{\n if (isHTMLElement(node) && matchOption(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n return NodeFilter.FILTER_SKIP;\n }, [\n matchOption\n ]);\n const setListbox = React.useCallback((el)=>{\n if (el && targetDocument) {\n listboxRef.current = el;\n treeWalkerRef.current = targetDocument.createTreeWalker(el, NodeFilter.SHOW_ELEMENT, optionFilter);\n } else {\n listboxRef.current = null;\n }\n }, [\n targetDocument,\n optionFilter\n ]);\n const optionWalker = React.useMemo(()=>({\n first: ()=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.firstChild();\n },\n last: ()=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n treeWalkerRef.current.currentNode = listboxRef.current;\n return treeWalkerRef.current.lastChild();\n },\n next: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.nextNode();\n },\n prev: ()=>{\n if (!treeWalkerRef.current) {\n return null;\n }\n return treeWalkerRef.current.previousNode();\n },\n find: (predicate, startFrom)=>{\n if (!treeWalkerRef.current || !listboxRef.current) {\n return null;\n }\n const start = startFrom ? targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.getElementById(startFrom) : null;\n treeWalkerRef.current.currentNode = start !== null && start !== void 0 ? start : listboxRef.current;\n let cur = treeWalkerRef.current.currentNode;\n while(cur && !predicate(cur.id)){\n cur = treeWalkerRef.current.nextNode();\n }\n return cur;\n },\n setCurrent: (el)=>{\n if (!treeWalkerRef.current) {\n return;\n }\n treeWalkerRef.current.currentNode = el;\n }\n }), [\n targetDocument\n ]);\n return {\n optionWalker,\n listboxCallbackRef: setListbox\n };\n}\n"],"names":["useOptionWalker","options","matchOption","targetDocument","useFluent","treeWalkerRef","React","useRef","listboxRef","optionFilter","useCallback","node","isHTMLElement","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","setListbox","el","current","createTreeWalker","SHOW_ELEMENT","optionWalker","useMemo","first","currentNode","firstChild","last","lastChild","next","nextNode","prev","previousNode","find","predicate","startFrom","start","getElementById","cur","id","setCurrent","listboxCallbackRef"],"mappings":";;;;+BAGgBA;;;eAAAA;;;;iEAHO;qCACyB;gCAClB;AACvB,SAASA,gBAAgBC,OAAO;IACnC,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAM,EAAEE,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,gBAAgBC,OAAMC,MAAM,CAAC;IACnC,MAAMC,aAAaF,OAAMC,MAAM,CAAC;IAChC,MAAME,eAAeH,OAAMI,WAAW,CAAC,CAACC;QACpC,IAAIC,IAAAA,6BAAa,EAACD,SAAST,YAAYS,OAAO;YAC1C,OAAOE,WAAWC,aAAa;QACnC;QACA,OAAOD,WAAWE,WAAW;IACjC,GAAG;QACCb;KACH;IACD,MAAMc,aAAaV,OAAMI,WAAW,CAAC,CAACO;QAClC,IAAIA,MAAMd,gBAAgB;YACtBK,WAAWU,OAAO,GAAGD;YACrBZ,cAAca,OAAO,GAAGf,eAAegB,gBAAgB,CAACF,IAAIJ,WAAWO,YAAY,EAAEX;QACzF,OAAO;YACHD,WAAWU,OAAO,GAAG;QACzB;IACJ,GAAG;QACCf;QACAM;KACH;IACD,MAAMY,eAAef,OAAMgB,OAAO,CAAC,IAAK,CAAA;YAChCC,OAAO;gBACH,IAAI,CAAClB,cAAca,OAAO,IAAI,CAACV,WAAWU,OAAO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HANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-aria",
3
- "version": "9.10.2",
3
+ "version": "9.10.4",
4
4
  "description": "React helper to ensure ARIA",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -34,10 +34,10 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@fluentui/keyboard-keys": "^9.0.7",
37
- "@fluentui/react-shared-contexts": "^9.15.2",
38
- "@fluentui/react-jsx-runtime": "^9.0.34",
39
- "@fluentui/react-tabster": "^9.19.5",
40
- "@fluentui/react-utilities": "^9.18.5",
37
+ "@fluentui/react-shared-contexts": "^9.16.0",
38
+ "@fluentui/react-jsx-runtime": "^9.0.35",
39
+ "@fluentui/react-tabster": "^9.20.0",
40
+ "@fluentui/react-utilities": "^9.18.6",
41
41
  "@swc/helpers": "^0.5.1"
42
42
  },
43
43
  "peerDependencies": {