@fluentui/react-context-selector 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-context-selector",
3
- "version": "9.0.0-nightly.d730088d7f.0",
3
+ "version": "9.0.0-rc.10",
4
4
  "description": "React useContextSelector hook in userland",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -17,39 +17,38 @@
17
17
  "code-style": "just-scripts code-style",
18
18
  "just": "just-scripts",
19
19
  "lint": "just-scripts lint",
20
- "test": "jest",
20
+ "test": "jest --passWithNoTests",
21
21
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
22
- "build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-context-selector/src && yarn docs"
22
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-context-selector/src && yarn docs",
23
+ "type-check": "tsc -b tsconfig.json"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@fluentui/eslint-plugin": "*",
26
- "@fluentui/scripts": "^1.0.0",
27
- "@types/scheduler": "^0.16.1",
28
- "@types/react": "16.9.42",
29
- "@types/react-dom": "16.9.10",
30
- "@types/react-test-renderer": "^16.0.0",
31
- "react": "16.8.6",
32
- "react-dom": "16.8.6",
33
- "react-is": "^16.6.3",
34
- "react-test-renderer": "^16.3.0"
27
+ "@fluentui/scripts": "^1.0.0"
35
28
  },
36
29
  "dependencies": {
37
- "@fluentui/react-utilities": "9.0.0-nightly.d730088d7f.0",
38
- "scheduler": "^0.20.1",
30
+ "@fluentui/react-utilities": "9.0.0-rc.10",
39
31
  "tslib": "^2.1.0"
40
32
  },
41
33
  "peerDependencies": {
42
- "@types/react": ">=16.8.0 <17.0.0",
43
- "@types/react-dom": ">=16.8.0 <17.0.0",
44
- "react": ">=16.8.0 <17.0.0",
45
- "react-dom": ">=16.8.0 <17.0.0"
34
+ "@types/react": ">=16.8.0 <18.0.0",
35
+ "@types/react-dom": ">=16.8.0 <18.0.0",
36
+ "react": ">=16.8.0 <18.0.0",
37
+ "react-dom": ">=16.8.0 <18.0.0",
38
+ "scheduler": "^0.19.0 || ^0.20.0"
46
39
  },
47
40
  "beachball": {
48
- "tag": "beta",
49
41
  "disallowedChangeTypes": [
50
42
  "major",
51
43
  "minor",
52
44
  "patch"
53
45
  ]
46
+ },
47
+ "exports": {
48
+ ".": {
49
+ "types": "./lib/index.d.ts",
50
+ "import": "./lib/index.js",
51
+ "require": "./lib-commonjs/index.js"
52
+ }
54
53
  }
55
54
  }
@@ -1,2 +0,0 @@
1
- import { Context } from './types';
2
- export declare const createContext: <Value>(defaultValue: Value) => Context<Value>;
package/lib/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { createContext } from './createContext';
2
- export { useContextSelector } from './useContextSelector';
3
- export { useHasParentContext } from './useHasParentContext';
4
- export * from './types';
package/lib/types.d.ts DELETED
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- export declare type Context<Value> = React.Context<Value> & {
3
- Provider: React.FC<React.ProviderProps<Value>>;
4
- Consumer: never;
5
- };
6
- export declare type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;
7
- export declare type ContextVersion = number;
8
- export declare type ContextValue<Value> = {
9
- /** Holds a set of subscribers from components. */
10
- listeners: ((payload: readonly [ContextVersion, Value]) => void)[];
11
- /** Holds an actual value of React's context that will be propagated down for computations. */
12
- value: React.MutableRefObject<Value>;
13
- /** A version field is used to sync a context value and consumers. */
14
- version: React.MutableRefObject<ContextVersion>;
15
- };
16
- export declare type ContextValues<Value> = ContextValue<Value> & {
17
- /** List of listners to publish changes */
18
- listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];
19
- };
@@ -1,7 +0,0 @@
1
- import { Context, ContextSelector } from './types';
2
- /**
3
- * This hook returns context selected value by selector.
4
- * It will only accept context created by `createContext`.
5
- * It will trigger re-render if only the selected value is referencially changed.
6
- */
7
- export declare const useContextSelector: <Value, SelectedValue>(context: Context<Value>, selector: ContextSelector<Value, SelectedValue>) => SelectedValue;
@@ -1,9 +0,0 @@
1
- import { Context } from './types';
2
- /**
3
- * Utility hook for contexts created by react-context-selector to determine if a parent context exists
4
- * WARNING: This hook will not work for native React contexts
5
- *
6
- * @param context - context created by react-context-selector
7
- * @returns whether the hook is wrapped by a parent context
8
- */
9
- export declare function useHasParentContext<Value>(context: Context<Value>): boolean;
@@ -1,2 +0,0 @@
1
- import { Context } from './types';
2
- export declare const createContext: <Value>(defaultValue: Value) => Context<Value>;
@@ -1,4 +0,0 @@
1
- export { createContext } from './createContext';
2
- export { useContextSelector } from './useContextSelector';
3
- export { useHasParentContext } from './useHasParentContext';
4
- export * from './types';
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- export declare type Context<Value> = React.Context<Value> & {
3
- Provider: React.FC<React.ProviderProps<Value>>;
4
- Consumer: never;
5
- };
6
- export declare type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;
7
- export declare type ContextVersion = number;
8
- export declare type ContextValue<Value> = {
9
- /** Holds a set of subscribers from components. */
10
- listeners: ((payload: readonly [ContextVersion, Value]) => void)[];
11
- /** Holds an actual value of React's context that will be propagated down for computations. */
12
- value: React.MutableRefObject<Value>;
13
- /** A version field is used to sync a context value and consumers. */
14
- version: React.MutableRefObject<ContextVersion>;
15
- };
16
- export declare type ContextValues<Value> = ContextValue<Value> & {
17
- /** List of listners to publish changes */
18
- listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];
19
- };
@@ -1,7 +0,0 @@
1
- import { Context, ContextSelector } from './types';
2
- /**
3
- * This hook returns context selected value by selector.
4
- * It will only accept context created by `createContext`.
5
- * It will trigger re-render if only the selected value is referencially changed.
6
- */
7
- export declare const useContextSelector: <Value, SelectedValue>(context: Context<Value>, selector: ContextSelector<Value, SelectedValue>) => SelectedValue;
@@ -1,9 +0,0 @@
1
- import { Context } from './types';
2
- /**
3
- * Utility hook for contexts created by react-context-selector to determine if a parent context exists
4
- * WARNING: This hook will not work for native React contexts
5
- *
6
- * @param context - context created by react-context-selector
7
- * @returns whether the hook is wrapped by a parent context
8
- */
9
- export declare function useHasParentContext<Value>(context: Context<Value>): boolean;