@fluentui/react-context-selector 9.2.18 → 9.2.20

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,12 +1,32 @@
1
1
  # Change Log - @fluentui/react-context-selector
2
2
 
3
- This log was last generated on Wed, 24 Jun 2026 11:03:59 GMT and should not be manually modified.
3
+ <!-- This log was last generated on Mon, 21 Sep 2026 16:12:52 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.2.20)
8
+
9
+ Mon, 21 Sep 2026 16:12:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.2.19..@fluentui/react-context-selector_v9.2.20)
11
+
12
+ ### Patches
13
+
14
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+
17
+ ## [9.2.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.2.19)
18
+
19
+ Tue, 11 Aug 2026 17:20:15 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.2.18..@fluentui/react-context-selector_v9.2.19)
21
+
22
+ ### Patches
23
+
24
+ - Ship ESM-first (type:module): valid ESM under lib/, CommonJS under lib-commonjs/*.cjs, and drop the `node` export condition - bare-Node `import` resolves ESM, `require` resolves CJS; node-targeted bundlers tree-shake. ([PR #36327](https://github.com/microsoft/fluentui/pull/36327) by martinhochel@microsoft.com)
25
+ - Bump @fluentui/react-utilities to v9.26.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
26
+
7
27
  ## [9.2.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.2.18)
8
28
 
9
- Wed, 24 Jun 2026 11:03:59 GMT
29
+ Wed, 24 Jun 2026 11:10:10 GMT
10
30
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.2.17..@fluentui/react-context-selector_v9.2.18)
11
31
 
12
32
  ### Patches
@@ -0,0 +1,51 @@
1
+ import type * as React_2 from 'react';
2
+
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare type Context<Value> = React_2.Context<Value> & {
7
+ Provider: React_2.FC<React_2.ProviderProps<Value>>;
8
+ Consumer: never;
9
+ };
10
+
11
+ export declare type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;
12
+
13
+ /**
14
+ * @internal
15
+ */
16
+ export declare type ContextValue<Value> = {
17
+ /** Holds a set of subscribers from components. */
18
+ listeners: ((payload: Value) => void)[];
19
+ /** Holds an actual value of React's context that will be propagated down for computations. */
20
+ value: {
21
+ current: Value;
22
+ };
23
+ /** Indicates if a context holds default value. */
24
+ isDefault?: boolean;
25
+ };
26
+
27
+ /**
28
+ * @internal
29
+ */
30
+ export declare const createContext: <Value>(defaultValue: Value) => Context<Value>;
31
+
32
+ /**
33
+ * This hook returns context selected value by selector.
34
+ * It will only accept context created by `createContext`.
35
+ * It will trigger re-render if only the selected value is referentially changed.
36
+ *
37
+ * @internal
38
+ */
39
+ export declare const useContextSelector: <Value, SelectedValue>(context: Context<Value>, selectorFn: ContextSelector<Value, SelectedValue>) => SelectedValue;
40
+
41
+ /**
42
+ * Utility hook for contexts created by react-context-selector to determine if a parent context exists
43
+ * WARNING: This hook will not work for native React contexts
44
+ *
45
+ * @internal
46
+ * @param context - context created by react-context-selector
47
+ * @returns whether the hook is wrapped by a parent context
48
+ */
49
+ export declare function useHasParentContext<Value>(context: Context<Value>): boolean;
50
+
51
+ export { }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
3
- import * as React from 'react';
4
- import { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';
2
+ import { useIsomorphicLayoutEffect } from "@fluentui/react-utilities";
3
+ import * as React from "react";
4
+ import { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from "scheduler";
5
5
  const createProvider = (Original)=>{
6
6
  const Provider = (props)=>{
7
7
  // Holds an actual "props.value"
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { createContext } from './createContext';
2
- export { useContextSelector } from './useContextSelector';
3
- export { useHasParentContext } from './useHasParentContext';
1
+ export { createContext } from "./createContext.js";
2
+ export { useContextSelector } from "./useContextSelector.js";
3
+ export { useHasParentContext } from "./useHasParentContext.js";
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { createContext } from './createContext';\nexport { useContextSelector } from './useContextSelector';\nexport { useHasParentContext } from './useHasParentContext';\n// eslint-disable-next-line @fluentui/ban-context-export\nexport type { Context, ContextSelector, ContextValue } from './types';\n"],"names":["createContext","useContextSelector","useHasParentContext"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,mBAAmB,QAAQ,wBAAwB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { createContext } from './createContext';\nexport { useContextSelector } from './useContextSelector';\nexport { useHasParentContext } from './useHasParentContext';\n// eslint-disable-next-line @fluentui/ban-context-export\nexport type { Context, ContextSelector, ContextValue } from './types';\n"],"names":["createContext","useContextSelector","useHasParentContext"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAkB;AAChD,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,mBAAmB,QAAQ,2BAAwB"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
3
- import * as React from 'react';
2
+ import { useIsomorphicLayoutEffect } from "@fluentui/react-utilities";
3
+ import * as React from "react";
4
4
  /**
5
5
  * This hook returns context selected value by selector.
6
6
  * It will only accept context created by `createContext`.
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
3
  /**
4
4
  * Utility hook for contexts created by react-context-selector to determine if a parent context exists
5
5
  * WARNING: This hook will not work for native React contexts
@@ -19,6 +19,6 @@ _export(exports, {
19
19
  return _useHasParentContext.useHasParentContext;
20
20
  }
21
21
  });
22
- const _createContext = require("./createContext");
23
- const _useContextSelector = require("./useContextSelector");
24
- const _useHasParentContext = require("./useHasParentContext");
22
+ const _createContext = require("./createContext.cjs");
23
+ const _useContextSelector = require("./useContextSelector.cjs");
24
+ const _useHasParentContext = require("./useHasParentContext.cjs");
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@fluentui/react-context-selector",
3
- "version": "9.2.18",
3
+ "version": "9.2.20",
4
4
  "description": "React useContextSelector hook in userland",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui/react-utilities": "^9.26.5",
15
+ "@fluentui/react-utilities": "^9.26.7",
16
16
  "@swc/helpers": "^0.5.1"
17
17
  },
18
18
  "devDependencies": {
@@ -20,11 +20,14 @@
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@types/react": ">=16.14.0 <20.0.0",
23
- "@types/react-dom": ">=16.9.0 <20.0.0",
24
23
  "react": ">=16.14.0 <20.0.0",
25
- "react-dom": ">=16.14.0 <20.0.0",
26
24
  "scheduler": ">=0.19.0"
27
25
  },
26
+ "peerDependenciesMeta": {
27
+ "@types/react": {
28
+ "optional": true
29
+ }
30
+ },
28
31
  "beachball": {
29
32
  "disallowedChangeTypes": [
30
33
  "major",
@@ -33,17 +36,23 @@
33
36
  },
34
37
  "exports": {
35
38
  ".": {
36
- "types": "./dist/index.d.ts",
37
- "node": "./lib-commonjs/index.js",
38
- "import": "./lib/index.js",
39
- "require": "./lib-commonjs/index.js"
39
+ "import": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./lib/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/index.d.cts",
45
+ "default": "./lib-commonjs/index.cjs"
46
+ }
40
47
  },
41
48
  "./package.json": "./package.json"
42
49
  },
43
50
  "files": [
44
51
  "*.md",
45
52
  "dist/*.d.ts",
53
+ "dist/*.d.cts",
46
54
  "lib",
47
55
  "lib-commonjs"
48
- ]
56
+ ],
57
+ "type": "module"
49
58
  }
File without changes
File without changes
File without changes