@fluentui/react-tree 9.15.13 → 9.15.14

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,18 +1,29 @@
1
1
  # Change Log - @fluentui/react-tree
2
2
 
3
- This log was last generated on Wed, 11 Mar 2026 09:20:38 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 26 Mar 2026 08:10:44 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.15.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.15.14)
8
+
9
+ Thu, 26 Mar 2026 08:10:44 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.15.13..@fluentui/react-tree_v9.15.14)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-avatar to v9.10.3 ([PR #35824](https://github.com/microsoft/fluentui/pull/35824) by beachball)
15
+ - Bump @fluentui/react-button to v9.9.0 ([PR #35824](https://github.com/microsoft/fluentui/pull/35824) by beachball)
16
+ - Bump @fluentui/react-checkbox to v9.5.17 ([PR #35824](https://github.com/microsoft/fluentui/pull/35824) by beachball)
17
+
7
18
  ## [9.15.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.15.13)
8
19
 
9
- Wed, 11 Mar 2026 09:20:38 GMT
20
+ Wed, 11 Mar 2026 09:22:22 GMT
10
21
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tree_v9.15.12..@fluentui/react-tree_v9.15.13)
11
22
 
12
23
  ### Patches
13
24
 
14
- - Bump @fluentui/react-checkbox to v9.5.16 ([PR #35854](https://github.com/microsoft/fluentui/pull/35854) by beachball)
15
- - Bump @fluentui/react-radio to v9.5.16 ([PR #35854](https://github.com/microsoft/fluentui/pull/35854) by beachball)
25
+ - Bump @fluentui/react-checkbox to v9.5.16 ([PR #35859](https://github.com/microsoft/fluentui/pull/35859) by beachball)
26
+ - Bump @fluentui/react-radio to v9.5.16 ([PR #35859](https://github.com/microsoft/fluentui/pull/35859) by beachball)
16
27
 
17
28
  ## [9.15.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-tree_v9.15.12)
18
29
 
package/dist/index.d.ts CHANGED
@@ -317,10 +317,10 @@ declare class ImmutableMap<Key, Value> implements Iterable<[Key, Value]> {
317
317
  }
318
318
 
319
319
  /**
320
- * @public
321
- *
322
320
  * Small immutable wrapper around the native Set implementation.
323
321
  * Every operation that would modify the set returns a new copy instance.
322
+ *
323
+ * @public
324
324
  */
325
325
  declare class ImmutableSet<T> implements Iterable<T> {
326
326
  static empty: ImmutableSet<never>;
@@ -10,8 +10,9 @@ const findTreeItemRoot = (element)=>{
10
10
  return parent;
11
11
  };
12
12
  /**
13
- * @internal
14
13
  * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
14
+ *
15
+ * @internal
15
16
  */ export function useRovingTabIndex() {
16
17
  const currentElementRef = React.useRef(null);
17
18
  const walkerRef = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useRovingTabIndexes.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { HTMLElementWalker } from '../utils/createHTMLElementWalker';\nimport { useFocusedElementChange } from '@fluentui/react-tabster';\n\nconst findTreeItemRoot = (element: HTMLElement) => {\n let parent = element.parentElement;\n while (parent && parent.getAttribute('role') !== 'tree') {\n parent = parent.parentElement;\n }\n return parent;\n};\n\n/**\n * @internal\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n */\nexport function useRovingTabIndex(): {\n rove: (nextElement: HTMLElement, focusOptions?: FocusOptions) => void;\n initialize: (walker: HTMLElementWalker) => void;\n forceUpdate: () => void;\n} {\n const currentElementRef = React.useRef<HTMLElement | null>(null);\n const walkerRef = React.useRef<HTMLElementWalker | null>(null);\n const { targetDocument } = useFluent();\n\n useFocusedElementChange(element => {\n if (element?.getAttribute('role') === 'treeitem' && walkerRef.current && walkerRef.current.root.contains(element)) {\n const treeitemRoot = findTreeItemRoot(element);\n if (walkerRef.current.root !== treeitemRoot) {\n return;\n }\n rove(element);\n }\n });\n\n const initialize = React.useCallback((walker: HTMLElementWalker) => {\n walkerRef.current = walker;\n walker.currentElement = walker.root;\n let tabbableChild = walker.firstChild(element =>\n element.tabIndex === 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n );\n walker.currentElement = walker.root;\n tabbableChild ??= walker.firstChild();\n if (!tabbableChild) {\n return;\n }\n tabbableChild.tabIndex = 0;\n currentElementRef.current = tabbableChild;\n let nextElement: HTMLElement | null = null;\n while ((nextElement = walker.nextElement()) && nextElement !== tabbableChild) {\n nextElement.tabIndex = -1;\n }\n }, []);\n const rove = React.useCallback((nextElement: HTMLElement, focusOptions?: FocusOptions) => {\n if (!currentElementRef.current) {\n return;\n }\n currentElementRef.current.tabIndex = -1;\n nextElement.tabIndex = 0;\n nextElement.focus(focusOptions);\n currentElementRef.current = nextElement;\n }, []);\n\n const forceUpdate = React.useCallback(() => {\n if (\n (currentElementRef.current === null || !targetDocument?.body.contains(currentElementRef.current)) &&\n walkerRef.current\n ) {\n initialize(walkerRef.current);\n }\n }, [targetDocument, initialize]);\n\n return {\n rove,\n initialize,\n forceUpdate,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","useFocusedElementChange","findTreeItemRoot","element","parent","parentElement","getAttribute","useRovingTabIndex","currentElementRef","useRef","walkerRef","targetDocument","current","root","contains","treeitemRoot","rove","initialize","useCallback","walker","currentElement","tabbableChild","firstChild","tabIndex","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","nextElement","focusOptions","focus","forceUpdate","body"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAASC,uBAAuB,QAAQ,0BAA0B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,aAA0BC;QACxD,IAAI,CAACpB,kBAAkBI,OAAO,EAAE;YAC9B;QACF;QACAJ,kBAAkBI,OAAO,CAACW,QAAQ,GAAG,CAAC;QACtCI,YAAYJ,QAAQ,GAAG;QACvBI,YAAYE,KAAK,CAACD;QAClBpB,kBAAkBI,OAAO,GAAGe;IAC9B,GAAG,EAAE;IAEL,MAAMG,cAAchC,MAAMoB,WAAW,CAAC;QACpC,IACE,AAACV,CAAAA,kBAAkBI,OAAO,KAAK,QAAQ,EAACD,2BAAAA,qCAAAA,eAAgBoB,IAAI,CAACjB,QAAQ,CAACN,kBAAkBI,OAAO,EAAA,KAC/FF,UAAUE,OAAO,EACjB;YACAK,WAAWP,UAAUE,OAAO;QAC9B;IACF,GAAG;QAACD;QAAgBM;KAAW;IAE/B,OAAO;QACLD;QACAC;QACAa;IACF;AACF"}
1
+ {"version":3,"sources":["../src/hooks/useRovingTabIndexes.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { HTMLElementWalker } from '../utils/createHTMLElementWalker';\nimport { useFocusedElementChange } from '@fluentui/react-tabster';\n\nconst findTreeItemRoot = (element: HTMLElement) => {\n let parent = element.parentElement;\n while (parent && parent.getAttribute('role') !== 'tree') {\n parent = parent.parentElement;\n }\n return parent;\n};\n\n/**\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n *\n * @internal\n */\nexport function useRovingTabIndex(): {\n rove: (nextElement: HTMLElement, focusOptions?: FocusOptions) => void;\n initialize: (walker: HTMLElementWalker) => void;\n forceUpdate: () => void;\n} {\n const currentElementRef = React.useRef<HTMLElement | null>(null);\n const walkerRef = React.useRef<HTMLElementWalker | null>(null);\n const { targetDocument } = useFluent();\n\n useFocusedElementChange(element => {\n if (element?.getAttribute('role') === 'treeitem' && walkerRef.current && walkerRef.current.root.contains(element)) {\n const treeitemRoot = findTreeItemRoot(element);\n if (walkerRef.current.root !== treeitemRoot) {\n return;\n }\n rove(element);\n }\n });\n\n const initialize = React.useCallback((walker: HTMLElementWalker) => {\n walkerRef.current = walker;\n walker.currentElement = walker.root;\n let tabbableChild = walker.firstChild(element =>\n element.tabIndex === 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n );\n walker.currentElement = walker.root;\n tabbableChild ??= walker.firstChild();\n if (!tabbableChild) {\n return;\n }\n tabbableChild.tabIndex = 0;\n currentElementRef.current = tabbableChild;\n let nextElement: HTMLElement | null = null;\n while ((nextElement = walker.nextElement()) && nextElement !== tabbableChild) {\n nextElement.tabIndex = -1;\n }\n }, []);\n const rove = React.useCallback((nextElement: HTMLElement, focusOptions?: FocusOptions) => {\n if (!currentElementRef.current) {\n return;\n }\n currentElementRef.current.tabIndex = -1;\n nextElement.tabIndex = 0;\n nextElement.focus(focusOptions);\n currentElementRef.current = nextElement;\n }, []);\n\n const forceUpdate = React.useCallback(() => {\n if (\n (currentElementRef.current === null || !targetDocument?.body.contains(currentElementRef.current)) &&\n walkerRef.current\n ) {\n initialize(walkerRef.current);\n }\n }, [targetDocument, initialize]);\n\n return {\n rove,\n initialize,\n forceUpdate,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","useFocusedElementChange","findTreeItemRoot","element","parent","parentElement","getAttribute","useRovingTabIndex","currentElementRef","useRef","walkerRef","targetDocument","current","root","contains","treeitemRoot","rove","initialize","useCallback","walker","currentElement","tabbableChild","firstChild","tabIndex","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","nextElement","focusOptions","focus","forceUpdate","body"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAASC,uBAAuB,QAAQ,0BAA0B;AAElE,MAAMC,mBAAmB,CAACC;IACxB,IAAIC,SAASD,QAAQE,aAAa;IAClC,MAAOD,UAAUA,OAAOE,YAAY,CAAC,YAAY,OAAQ;QACvDF,SAASA,OAAOC,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GAAG;QACvBI,YAAYE,KAAK,CAACD;QAClBpB,kBAAkBI,OAAO,GAAGe;IAC9B,GAAG,EAAE;IAEL,MAAMG,cAAchC,MAAMoB,WAAW,CAAC;QACpC,IACE,AAACV,CAAAA,kBAAkBI,OAAO,KAAK,QAAQ,EAACD,2BAAAA,qCAAAA,eAAgBoB,IAAI,CAACjB,QAAQ,CAACN,kBAAkBI,OAAO,EAAA,KAC/FF,UAAUE,OAAO,EACjB;YACAK,WAAWP,UAAUE,OAAO;QAC9B;IACF,GAAG;QAACD;QAAgBM;KAAW;IAE/B,OAAO;QACLD;QACAC;QACAa;IACF;AACF"}
@@ -2,10 +2,10 @@ import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
2
  const internalSetSymbol = Symbol('#internalSet');
3
3
  let _internalSetSymbol = internalSetSymbol;
4
4
  /**
5
- * @public
6
- *
7
5
  * Small immutable wrapper around the native Set implementation.
8
6
  * Every operation that would modify the set returns a new copy instance.
7
+ *
8
+ * @public
9
9
  */ export class ImmutableSet {
10
10
  static dangerouslyGetInternalSet(set) {
11
11
  return set[internalSetSymbol];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/ImmutableSet.ts"],"sourcesContent":["const internalSetSymbol = Symbol('#internalSet');\n\n/**\n * @public\n *\n * Small immutable wrapper around the native Set implementation.\n * Every operation that would modify the set returns a new copy instance.\n */\nexport class ImmutableSet<T> implements Iterable<T> {\n public static empty: ImmutableSet<never> = new ImmutableSet(new Set());\n public readonly size: number;\n\n private [internalSetSymbol]: Set<T>;\n\n public static dangerouslyGetInternalSet<Value>(set: ImmutableSet<Value>): Set<Value> {\n return set[internalSetSymbol];\n }\n\n public static copy<T>(immutableSet: ImmutableSet<T>): ImmutableSet<T> {\n return new ImmutableSet(new Set(immutableSet[internalSetSymbol]));\n }\n\n /**\n * Creates a new {@link ImmutableSet} from an iterable.\n * If the iterable is undefined, {@link ImmutableSet.empty} will be returned.\n * If the iterable is already an {@link ImmutableSet}, it will be returned as is no copy will be made.\n */\n public static from<Value>(iterable?: Iterable<Value>): ImmutableSet<Value> {\n if (iterable === undefined) {\n return this.empty;\n }\n if (iterable instanceof this) {\n return iterable;\n }\n return new this(new Set(iterable));\n }\n\n public static [Symbol.hasInstance](instance: unknown): boolean {\n return Boolean(typeof instance === 'object' && instance && internalSetSymbol in instance);\n }\n\n /**\n * Do not use this constructor directly, use {@link ImmutableSet.from} instead.\n * {@link ImmutableSet.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),\n * avoid unnecessary copies, supports iterables and ensures that the internal set is never exposed.\n *\n *⚠️⚠️ _By using this constructor directly, you might end up with a mutable set, as it is not guaranteed that the internal set is not exposed._ ⚠️⚠️\n */\n constructor(internalSet: Set<T>) {\n this[internalSetSymbol] = internalSet;\n this.size = this[internalSetSymbol].size;\n }\n\n public add(value: T): ImmutableSet<T> {\n if (this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].add(value);\n return copy;\n }\n\n public delete(value: T): ImmutableSet<T> {\n if (!this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].delete(value);\n return copy;\n }\n\n public has(value: T): boolean {\n return this[internalSetSymbol].has(value);\n }\n\n public [Symbol.iterator](): Iterator<T> {\n return this[internalSetSymbol].values();\n }\n}\n"],"names":["internalSetSymbol","Symbol","ImmutableSet","dangerouslyGetInternalSet","set","copy","immutableSet","Set","from","iterable","undefined","empty","hasInstance","instance","Boolean","add","value","has","delete","iterator","values","constructor","internalSet","size"],"mappings":";AAAA,MAAMA,oBAAoBC,OAAO;IAYtBD,qBAAAA;AAVX;;;;;CAKC,GACD,OAAO,MAAME;IAMX,OAAcC,0BAAiCC,GAAwB,EAAc;QACnF,OAAOA,GAAG,CAACJ,kBAAkB;IAC/B;IAEA,OAAcK,KAAQC,YAA6B,EAAmB;QACpE,OAAO,IAAIJ,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IT,aAAa,IAAIK"}
1
+ {"version":3,"sources":["../src/utils/ImmutableSet.ts"],"sourcesContent":["const internalSetSymbol = Symbol('#internalSet');\n\n/**\n * Small immutable wrapper around the native Set implementation.\n * Every operation that would modify the set returns a new copy instance.\n *\n * @public\n */\nexport class ImmutableSet<T> implements Iterable<T> {\n public static empty: ImmutableSet<never> = new ImmutableSet(new Set());\n public readonly size: number;\n\n private [internalSetSymbol]: Set<T>;\n\n public static dangerouslyGetInternalSet<Value>(set: ImmutableSet<Value>): Set<Value> {\n return set[internalSetSymbol];\n }\n\n public static copy<T>(immutableSet: ImmutableSet<T>): ImmutableSet<T> {\n return new ImmutableSet(new Set(immutableSet[internalSetSymbol]));\n }\n\n /**\n * Creates a new {@link ImmutableSet} from an iterable.\n * If the iterable is undefined, {@link ImmutableSet.empty} will be returned.\n * If the iterable is already an {@link ImmutableSet}, it will be returned as is no copy will be made.\n */\n public static from<Value>(iterable?: Iterable<Value>): ImmutableSet<Value> {\n if (iterable === undefined) {\n return this.empty;\n }\n if (iterable instanceof this) {\n return iterable;\n }\n return new this(new Set(iterable));\n }\n\n public static [Symbol.hasInstance](instance: unknown): boolean {\n return Boolean(typeof instance === 'object' && instance && internalSetSymbol in instance);\n }\n\n /**\n * Do not use this constructor directly, use {@link ImmutableSet.from} instead.\n * {@link ImmutableSet.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),\n * avoid unnecessary copies, supports iterables and ensures that the internal set is never exposed.\n *\n *⚠️⚠️ _By using this constructor directly, you might end up with a mutable set, as it is not guaranteed that the internal set is not exposed._ ⚠️⚠️\n */\n constructor(internalSet: Set<T>) {\n this[internalSetSymbol] = internalSet;\n this.size = this[internalSetSymbol].size;\n }\n\n public add(value: T): ImmutableSet<T> {\n if (this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].add(value);\n return copy;\n }\n\n public delete(value: T): ImmutableSet<T> {\n if (!this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].delete(value);\n return copy;\n }\n\n public has(value: T): boolean {\n return this[internalSetSymbol].has(value);\n }\n\n public [Symbol.iterator](): Iterator<T> {\n return this[internalSetSymbol].values();\n }\n}\n"],"names":["internalSetSymbol","Symbol","ImmutableSet","dangerouslyGetInternalSet","set","copy","immutableSet","Set","from","iterable","undefined","empty","hasInstance","instance","Boolean","add","value","has","delete","iterator","values","constructor","internalSet","size"],"mappings":";AAAA,MAAMA,oBAAoBC,OAAO;IAYtBD,qBAAAA;AAVX;;;;;CAKC,GACD,OAAO,MAAME;IAMX,OAAcC,0BAAiCC,GAAwB,EAAc;QACnF,OAAOA,GAAG,CAACJ,kBAAkB;IAC/B;IAEA,OAAcK,KAAQC,YAA6B,EAAmB;QACpE,OAAO,IAAIJ,aAAa,IAAIK,IAAID,YAAY,CAACN,kBAAkB;IACjE;IAEA;;;;GAIC,GACD,OAAcQ,KAAYC,QAA0B,EAAuB;QACzE,IAAIA,aAAaC,WAAW;YAC1B,OAAO,IAAI,CAACC,KAAK;QACnB;QACA,IAAIF,oBAAoB,IAAI,EAAE;YAC5B,OAAOA;QACT;QACA,OAAO,IAAI,IAAI,CAAC,IAAIF,IAAIE;IAC1B;IAEA,OAAc,CAACR,OAAOW,WAAW,CAAC,CAACC,QAAiB,EAAW;QAC7D,OAAOC,QAAQ,OAAOD,aAAa,YAAYA,YAAYb,qBAAqBa;IAClF;IAcOE,IAAIC,KAAQ,EAAmB;QACpC,IAAI,IAAI,CAACC,GAAG,CAACD,QAAQ;YACnB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACe,GAAG,CAACC;QAC5B,OAAOX;IACT;IAEOa,OAAOF,KAAQ,EAAmB;QACvC,IAAI,CAAC,IAAI,CAACC,GAAG,CAACD,QAAQ;YACpB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACkB,MAAM,CAACF;QAC/B,OAAOX;IACT;IAEOY,IAAID,KAAQ,EAAW;QAC5B,OAAO,IAAI,CAAChB,kBAAkB,CAACiB,GAAG,CAACD;IACrC;IAEO,CAACf,OAAOkB,QAAQ,CAAC,GAAgB;QACtC,OAAO,IAAI,CAACnB,kBAAkB,CAACoB,MAAM;IACvC;IApCA;;;;;;GAMC,GACDC,YAAYC,WAAmB,CAAE;QAtCjC,uBAAgBC,QAAhB,KAAA;QAEA,uBAASvB,oBAAT,KAAA;QAqCE,IAAI,CAACA,kBAAkB,GAAGsB;QAC1B,IAAI,CAACC,IAAI,GAAG,IAAI,CAACvB,kBAAkB,CAACuB,IAAI;IAC1C;AA2BF;AArEE,iBADWrB,cACGS,SAA6B,IAAIT,aAAa,IAAIK"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useRovingTabIndexes.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { HTMLElementWalker } from '../utils/createHTMLElementWalker';\nimport { useFocusedElementChange } from '@fluentui/react-tabster';\n\nconst findTreeItemRoot = (element: HTMLElement) => {\n let parent = element.parentElement;\n while (parent && parent.getAttribute('role') !== 'tree') {\n parent = parent.parentElement;\n }\n return parent;\n};\n\n/**\n * @internal\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n */\nexport function useRovingTabIndex(): {\n rove: (nextElement: HTMLElement, focusOptions?: FocusOptions) => void;\n initialize: (walker: HTMLElementWalker) => void;\n forceUpdate: () => void;\n} {\n const currentElementRef = React.useRef<HTMLElement | null>(null);\n const walkerRef = React.useRef<HTMLElementWalker | null>(null);\n const { targetDocument } = useFluent();\n\n useFocusedElementChange(element => {\n if (element?.getAttribute('role') === 'treeitem' && walkerRef.current && walkerRef.current.root.contains(element)) {\n const treeitemRoot = findTreeItemRoot(element);\n if (walkerRef.current.root !== treeitemRoot) {\n return;\n }\n rove(element);\n }\n });\n\n const initialize = React.useCallback((walker: HTMLElementWalker) => {\n walkerRef.current = walker;\n walker.currentElement = walker.root;\n let tabbableChild = walker.firstChild(element =>\n element.tabIndex === 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n );\n walker.currentElement = walker.root;\n tabbableChild ??= walker.firstChild();\n if (!tabbableChild) {\n return;\n }\n tabbableChild.tabIndex = 0;\n currentElementRef.current = tabbableChild;\n let nextElement: HTMLElement | null = null;\n while ((nextElement = walker.nextElement()) && nextElement !== tabbableChild) {\n nextElement.tabIndex = -1;\n }\n }, []);\n const rove = React.useCallback((nextElement: HTMLElement, focusOptions?: FocusOptions) => {\n if (!currentElementRef.current) {\n return;\n }\n currentElementRef.current.tabIndex = -1;\n nextElement.tabIndex = 0;\n nextElement.focus(focusOptions);\n currentElementRef.current = nextElement;\n }, []);\n\n const forceUpdate = React.useCallback(() => {\n if (\n (currentElementRef.current === null || !targetDocument?.body.contains(currentElementRef.current)) &&\n walkerRef.current\n ) {\n initialize(walkerRef.current);\n }\n }, [targetDocument, initialize]);\n\n return {\n rove,\n initialize,\n forceUpdate,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","useFocusedElementChange","findTreeItemRoot","element","parent","parentElement","getAttribute","useRovingTabIndex","currentElementRef","useRef","walkerRef","targetDocument","current","root","contains","treeitemRoot","rove","initialize","useCallback","walker","currentElement","tabbableChild","firstChild","tabIndex","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","nextElement","focusOptions","focus","forceUpdate","body"],"mappings":"AAAA;;;;;+BAmBgBS;;;;;;;iEAjBO,QAAQ;qCACiB,kCAAkC;8BAE1C,0BAA0B;AAElE,MAAML,mBAAmB,CAACC;IACxB,IAAIC,SAASD,QAAQE,aAAa;IAClC,MAAOD,UAAUA,OAAOE,YAAY,CAAC,YAAY,OAAQ;QAC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ACAJ,kBAAkBI,OAAO,CAACW,QAAQ,GAAG,CAAC;QACtCI,YAAYJ,QAAQ,GAAG;QACvBI,YAAYE,KAAK,CAACD;QAClBpB,kBAAkBI,OAAO,GAAGe;IAC9B,GAAG,EAAE;IAEL,MAAMG,cAAchC,OAAMoB,WAAW,CAAC;QACpC,IACGV,CAAAA,kBAAkBI,OAAO,KAAK,QAAQ,EAACD,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBoB,IAAI,CAACjB,QAAQ,CAACN,kBAAkBI,QAAO,CAAA,CAAA,IAC/FF,UAAUE,OAAO,EACjB;YACAK,WAAWP,UAAUE,OAAO;QAC9B;IACF,GAAG;QAACD;QAAgBM;KAAW;IAE/B,OAAO;QACLD;QACAC;QACAa;IACF;AACF"}
1
+ {"version":3,"sources":["../src/hooks/useRovingTabIndexes.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { HTMLElementWalker } from '../utils/createHTMLElementWalker';\nimport { useFocusedElementChange } from '@fluentui/react-tabster';\n\nconst findTreeItemRoot = (element: HTMLElement) => {\n let parent = element.parentElement;\n while (parent && parent.getAttribute('role') !== 'tree') {\n parent = parent.parentElement;\n }\n return parent;\n};\n\n/**\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n *\n * @internal\n */\nexport function useRovingTabIndex(): {\n rove: (nextElement: HTMLElement, focusOptions?: FocusOptions) => void;\n initialize: (walker: HTMLElementWalker) => void;\n forceUpdate: () => void;\n} {\n const currentElementRef = React.useRef<HTMLElement | null>(null);\n const walkerRef = React.useRef<HTMLElementWalker | null>(null);\n const { targetDocument } = useFluent();\n\n useFocusedElementChange(element => {\n if (element?.getAttribute('role') === 'treeitem' && walkerRef.current && walkerRef.current.root.contains(element)) {\n const treeitemRoot = findTreeItemRoot(element);\n if (walkerRef.current.root !== treeitemRoot) {\n return;\n }\n rove(element);\n }\n });\n\n const initialize = React.useCallback((walker: HTMLElementWalker) => {\n walkerRef.current = walker;\n walker.currentElement = walker.root;\n let tabbableChild = walker.firstChild(element =>\n element.tabIndex === 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP,\n );\n walker.currentElement = walker.root;\n tabbableChild ??= walker.firstChild();\n if (!tabbableChild) {\n return;\n }\n tabbableChild.tabIndex = 0;\n currentElementRef.current = tabbableChild;\n let nextElement: HTMLElement | null = null;\n while ((nextElement = walker.nextElement()) && nextElement !== tabbableChild) {\n nextElement.tabIndex = -1;\n }\n }, []);\n const rove = React.useCallback((nextElement: HTMLElement, focusOptions?: FocusOptions) => {\n if (!currentElementRef.current) {\n return;\n }\n currentElementRef.current.tabIndex = -1;\n nextElement.tabIndex = 0;\n nextElement.focus(focusOptions);\n currentElementRef.current = nextElement;\n }, []);\n\n const forceUpdate = React.useCallback(() => {\n if (\n (currentElementRef.current === null || !targetDocument?.body.contains(currentElementRef.current)) &&\n walkerRef.current\n ) {\n initialize(walkerRef.current);\n }\n }, [targetDocument, initialize]);\n\n return {\n rove,\n initialize,\n forceUpdate,\n };\n}\n"],"names":["React","useFluent_unstable","useFluent","useFocusedElementChange","findTreeItemRoot","element","parent","parentElement","getAttribute","useRovingTabIndex","currentElementRef","useRef","walkerRef","targetDocument","current","root","contains","treeitemRoot","rove","initialize","useCallback","walker","currentElement","tabbableChild","firstChild","tabIndex","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","nextElement","focusOptions","focus","forceUpdate","body"],"mappings":"AAAA;;;;;+BAoBgBS;;;;;;;iEAlBO,QAAQ;qCACiB,kCAAkC;8BAE1C,0BAA0B;AAElE,MAAML,mBAAmB,CAACC;IACxB,IAAIC,SAASD,QAAQE,aAAa;IAClC,MAAOD,UAAUA,OAAOE,YAAY,CAAC,YAAY,OAAQ;QACvDF,SAASA,OAAOC,aAAa;IAC/B;IACA,OAAOD;AACT;AAOO;IAKL,MAAMI,oBAAoBV,OAAM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,YAAYE,KAAK,CAACD;QAClBpB,kBAAkBI,OAAO,GAAGe;IAC9B,GAAG,EAAE;IAEL,MAAMG,cAAchC,OAAMoB,WAAW,CAAC;QACpC,IACGV,CAAAA,kBAAkBI,OAAO,KAAK,QAAQ,EAACD,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAgBoB,IAAI,CAACjB,QAAQ,CAACN,kBAAkBI,QAAO,CAAA,CAAA,IAC/FF,UAAUE,OAAO,EACjB;YACAK,WAAWP,UAAUE,OAAO;QAC9B;IACF,GAAG;QAACD;QAAgBM;KAAW;IAE/B,OAAO;QACLD;QACAC;QACAa;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/ImmutableSet.ts"],"sourcesContent":["const internalSetSymbol = Symbol('#internalSet');\n\n/**\n * @public\n *\n * Small immutable wrapper around the native Set implementation.\n * Every operation that would modify the set returns a new copy instance.\n */\nexport class ImmutableSet<T> implements Iterable<T> {\n public static empty: ImmutableSet<never> = new ImmutableSet(new Set());\n public readonly size: number;\n\n private [internalSetSymbol]: Set<T>;\n\n public static dangerouslyGetInternalSet<Value>(set: ImmutableSet<Value>): Set<Value> {\n return set[internalSetSymbol];\n }\n\n public static copy<T>(immutableSet: ImmutableSet<T>): ImmutableSet<T> {\n return new ImmutableSet(new Set(immutableSet[internalSetSymbol]));\n }\n\n /**\n * Creates a new {@link ImmutableSet} from an iterable.\n * If the iterable is undefined, {@link ImmutableSet.empty} will be returned.\n * If the iterable is already an {@link ImmutableSet}, it will be returned as is no copy will be made.\n */\n public static from<Value>(iterable?: Iterable<Value>): ImmutableSet<Value> {\n if (iterable === undefined) {\n return this.empty;\n }\n if (iterable instanceof this) {\n return iterable;\n }\n return new this(new Set(iterable));\n }\n\n public static [Symbol.hasInstance](instance: unknown): boolean {\n return Boolean(typeof instance === 'object' && instance && internalSetSymbol in instance);\n }\n\n /**\n * Do not use this constructor directly, use {@link ImmutableSet.from} instead.\n * {@link ImmutableSet.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),\n * avoid unnecessary copies, supports iterables and ensures that the internal set is never exposed.\n *\n *⚠️⚠️ _By using this constructor directly, you might end up with a mutable set, as it is not guaranteed that the internal set is not exposed._ ⚠️⚠️\n */\n constructor(internalSet: Set<T>) {\n this[internalSetSymbol] = internalSet;\n this.size = this[internalSetSymbol].size;\n }\n\n public add(value: T): ImmutableSet<T> {\n if (this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].add(value);\n return copy;\n }\n\n public delete(value: T): ImmutableSet<T> {\n if (!this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].delete(value);\n return copy;\n }\n\n public has(value: T): boolean {\n return this[internalSetSymbol].has(value);\n }\n\n public [Symbol.iterator](): Iterator<T> {\n return this[internalSetSymbol].values();\n }\n}\n"],"names":["internalSetSymbol","Symbol","ImmutableSet","dangerouslyGetInternalSet","set","copy","immutableSet","Set","from","iterable","undefined","empty","hasInstance","instance","Boolean","add","value","has","delete","iterator","values","constructor","internalSet","size"],"mappings":";;;;+BAQaE;;;;;;;AARb,MAAMF,oBAAoBC,OAAO;IAYtBD,qBAAAA;AAJJ;IAML,OAAcG,0BAAiCC,GAAwB,EAAc;QACnF,OAAOA,GAAG,CAACJ,kBAAkB;IAC/B;IAEA,OAAcK,KAAQC,YAA6B,EAAmB;QACpE,OAAO,IAAIJ,aAAa,IAAIK,IAAID,YAAY,CAACN,kBAAkB;IACjE;IAEA;;;;GAIC,GACD,OAAcQ,KAAYC,QAA0B,EAAuB;QACzE,IAAIA,aAAaC,WAAW;YAC1B,OAAO,IAAI,CAACC,KAAK;QACnB;QACA,IAAIF,oBAAoB,IAAI,EAAE;YAC5B,OAAOA;QACT;QACA,OAAO,IAAI,IAAI,CAAC,IAAIF,IAAIE;IAC1B;IAEA,OAAc,CAACR,OAAOW,WAAW,CAAC,CAACC,QAAiB,EAAW;QAC7D,OAAOC,QAAQ,OAAOD,aAAa,YAAYA,YAAYb,qBAAqBa;IAClF;IAcOE,IAAIC,KAAQ,EAAmB;QACpC,IAAI,IAAI,CAACC,GAAG,CAACD,QAAQ;YACnB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACe,GAAG,CAACC;QAC5B,OAAOX;IACT;IAEOa,OAAOF,KAAQ,EAAmB;QACvC,IAAI,CAAC,IAAI,CAACC,GAAG,CAACD,QAAQ;YACpB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACkB,MAAM,CAACF;QAC/B,OAAOX;IACT;IAEOY,IAAID,KAAQ,EAAW;QAC5B,OAAO,IAAI,CAAChB,kBAAkB,CAACiB,GAAG,CAACD;IACrC;IAEO,CAACf,OAAOkB,QAAQ,CAAC,GAAgB;QACtC,OAAO,IAAI,CAACnB,kBAAkB,CAACoB,MAAM;IACvC;IApCA;;;;;;GAMC,GACDC,YAAYC,WAAmB,CAAE;YAtCjC,kBAAA,EAAA,IAAA,EAAgBC,QAAhB,KAAA;YAEA,kBAAA,EAAA,IAAA,EAASvB,oBAAT,KAAA;QAqCE,IAAI,CAACA,kBAAkB,GAAGsB;QAC1B,IAAI,CAACC,IAAI,GAAG,IAAI,CAACvB,kBAAkB,CAACuB,IAAI;IAC1C;AA2BF;IArEE,kBAAA,EADWrB,cACGS,SAA6B,IAAIT,aAAa,IAAIK"}
1
+ {"version":3,"sources":["../src/utils/ImmutableSet.ts"],"sourcesContent":["const internalSetSymbol = Symbol('#internalSet');\n\n/**\n * Small immutable wrapper around the native Set implementation.\n * Every operation that would modify the set returns a new copy instance.\n *\n * @public\n */\nexport class ImmutableSet<T> implements Iterable<T> {\n public static empty: ImmutableSet<never> = new ImmutableSet(new Set());\n public readonly size: number;\n\n private [internalSetSymbol]: Set<T>;\n\n public static dangerouslyGetInternalSet<Value>(set: ImmutableSet<Value>): Set<Value> {\n return set[internalSetSymbol];\n }\n\n public static copy<T>(immutableSet: ImmutableSet<T>): ImmutableSet<T> {\n return new ImmutableSet(new Set(immutableSet[internalSetSymbol]));\n }\n\n /**\n * Creates a new {@link ImmutableSet} from an iterable.\n * If the iterable is undefined, {@link ImmutableSet.empty} will be returned.\n * If the iterable is already an {@link ImmutableSet}, it will be returned as is no copy will be made.\n */\n public static from<Value>(iterable?: Iterable<Value>): ImmutableSet<Value> {\n if (iterable === undefined) {\n return this.empty;\n }\n if (iterable instanceof this) {\n return iterable;\n }\n return new this(new Set(iterable));\n }\n\n public static [Symbol.hasInstance](instance: unknown): boolean {\n return Boolean(typeof instance === 'object' && instance && internalSetSymbol in instance);\n }\n\n /**\n * Do not use this constructor directly, use {@link ImmutableSet.from} instead.\n * {@link ImmutableSet.from} handles instance verification (which might be problematic on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms | multiple realms}),\n * avoid unnecessary copies, supports iterables and ensures that the internal set is never exposed.\n *\n *⚠️⚠️ _By using this constructor directly, you might end up with a mutable set, as it is not guaranteed that the internal set is not exposed._ ⚠️⚠️\n */\n constructor(internalSet: Set<T>) {\n this[internalSetSymbol] = internalSet;\n this.size = this[internalSetSymbol].size;\n }\n\n public add(value: T): ImmutableSet<T> {\n if (this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].add(value);\n return copy;\n }\n\n public delete(value: T): ImmutableSet<T> {\n if (!this.has(value)) {\n return this;\n }\n const copy = ImmutableSet.copy(this);\n copy[internalSetSymbol].delete(value);\n return copy;\n }\n\n public has(value: T): boolean {\n return this[internalSetSymbol].has(value);\n }\n\n public [Symbol.iterator](): Iterator<T> {\n return this[internalSetSymbol].values();\n }\n}\n"],"names":["internalSetSymbol","Symbol","ImmutableSet","dangerouslyGetInternalSet","set","copy","immutableSet","Set","from","iterable","undefined","empty","hasInstance","instance","Boolean","add","value","has","delete","iterator","values","constructor","internalSet","size"],"mappings":";;;;+BAQaE;;;;;;;AARb,MAAMF,oBAAoBC,OAAO;IAYtBD,qBAAAA;AAJJ;IAML,OAAcG,0BAAiCC,GAAwB,EAAc;QACnF,OAAOA,GAAG,CAACJ,kBAAkB;IAC/B;IAEA,OAAcK,KAAQC,YAA6B,EAAmB;QACpE,OAAO,IAAIJ,aAAa,IAAIK,IAAID,YAAY,CAACN,kBAAkB;IACjE;IAEA;;;;GAIC,GACD,OAAcQ,KAAYC,QAA0B,EAAuB;QACzE,IAAIA,aAAaC,WAAW;YAC1B,OAAO,IAAI,CAACC,KAAK;QACnB;QACA,IAAIF,oBAAoB,IAAI,EAAE;YAC5B,OAAOA;QACT;QACA,OAAO,IAAI,IAAI,CAAC,IAAIF,IAAIE;IAC1B;IAEA,OAAc,CAACR,OAAOW,WAAW,CAAC,CAACC,QAAiB,EAAW;QAC7D,OAAOC,QAAQ,OAAOD,aAAa,YAAYA,YAAYb,qBAAqBa;IAClF;IAcOE,IAAIC,KAAQ,EAAmB;QACpC,IAAI,IAAI,CAACC,GAAG,CAACD,QAAQ;YACnB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACe,GAAG,CAACC;QAC5B,OAAOX;IACT;IAEOa,OAAOF,KAAQ,EAAmB;QACvC,IAAI,CAAC,IAAI,CAACC,GAAG,CAACD,QAAQ;YACpB,OAAO,IAAI;QACb;QACA,MAAMX,OAAOH,aAAaG,IAAI,CAAC,IAAI;QACnCA,IAAI,CAACL,kBAAkB,CAACkB,MAAM,CAACF;QAC/B,OAAOX;IACT;IAEOY,IAAID,KAAQ,EAAW;QAC5B,OAAO,IAAI,CAAChB,kBAAkB,CAACiB,GAAG,CAACD;IACrC;IAEO,CAACf,OAAOkB,QAAQ,CAAC,GAAgB;QACtC,OAAO,IAAI,CAACnB,kBAAkB,CAACoB,MAAM;IACvC;IApCA;;;;;;GAMC,GACDC,YAAYC,WAAmB,CAAE;YAtCjC,kBAAA,EAAA,IAAA,EAAgBC,QAAhB,KAAA;YAEA,kBAAA,EAAA,IAAA,EAASvB,oBAAT,KAAA;QAqCE,IAAI,CAACA,kBAAkB,GAAGsB;QAC1B,IAAI,CAACC,IAAI,GAAG,IAAI,CAACvB,kBAAkB,CAACuB,IAAI;IAC1C;AA2BF;IArEE,kBAAA,EADWrB,cACGS,SAA6B,IAAIT,aAAa,IAAIK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tree",
3
- "version": "9.15.13",
3
+ "version": "9.15.14",
4
4
  "description": "Tree component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -14,9 +14,9 @@
14
14
  "dependencies": {
15
15
  "@fluentui/keyboard-keys": "^9.0.8",
16
16
  "@fluentui/react-aria": "^9.17.10",
17
- "@fluentui/react-avatar": "^9.10.2",
18
- "@fluentui/react-button": "^9.8.2",
19
- "@fluentui/react-checkbox": "^9.5.16",
17
+ "@fluentui/react-avatar": "^9.10.3",
18
+ "@fluentui/react-button": "^9.9.0",
19
+ "@fluentui/react-checkbox": "^9.5.17",
20
20
  "@fluentui/react-context-selector": "^9.2.15",
21
21
  "@fluentui/react-icons": "^2.0.245",
22
22
  "@fluentui/react-motion-components-preview": "^0.15.2",