@fluentui/react-context-selector 9.2.18 → 9.2.19

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,22 @@
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 Tue, 11 Aug 2026 17:16:03 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.2.19)
8
+
9
+ Tue, 11 Aug 2026 17:16:03 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.2.18..@fluentui/react-context-selector_v9.2.19)
11
+
12
+ ### Patches
13
+
14
+ - 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)
15
+ - Bump @fluentui/react-utilities to v9.26.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+
7
17
  ## [9.2.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.2.18)
8
18
 
9
- Wed, 24 Jun 2026 11:03:59 GMT
19
+ Wed, 24 Jun 2026 11:10:10 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.2.17..@fluentui/react-context-selector_v9.2.18)
11
21
 
12
22
  ### 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.19",
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.6",
16
16
  "@swc/helpers": "^0.5.1"
17
17
  },
18
18
  "devDependencies": {
@@ -33,17 +33,23 @@
33
33
  },
34
34
  "exports": {
35
35
  ".": {
36
- "types": "./dist/index.d.ts",
37
- "node": "./lib-commonjs/index.js",
38
- "import": "./lib/index.js",
39
- "require": "./lib-commonjs/index.js"
36
+ "import": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./lib/index.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/index.d.cts",
42
+ "default": "./lib-commonjs/index.cjs"
43
+ }
40
44
  },
41
45
  "./package.json": "./package.json"
42
46
  },
43
47
  "files": [
44
48
  "*.md",
45
49
  "dist/*.d.ts",
50
+ "dist/*.d.cts",
46
51
  "lib",
47
52
  "lib-commonjs"
48
- ]
53
+ ],
54
+ "type": "module"
49
55
  }
File without changes
File without changes
File without changes