@fluentui/react-context-selector 0.0.0-nightly-20220302-0405.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useHasParentContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAGA;;;;;;AAMG;;;AACH,SAAgB,mBAAhB,CAA2C,OAA3C,EAAkE;AAChE,QAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;;AAEA,MAAI,YAAY,CAAC,OAAjB,EAA0B;AACxB,WAAO,YAAY,CAAC,OAAb,CAAqB,OAArB,KAAiC,CAAC,CAAzC;AACD;;AAED,SAAO,KAAP;AACD;;AARD,OAAA,CAAA,mBAAA,GAAA,mBAAA","sourcesContent":["import * as React from 'react';\nimport { Context, ContextValue } from './types';\n\n/**\n * Utility hook for contexts created by react-context-selector to determine if a parent context exists\n * WARNING: This hook will not work for native React contexts\n *\n * @param context - context created by react-context-selector\n * @returns whether the hook is wrapped by a parent context\n */\nexport function useHasParentContext<Value>(context: Context<Value>) {\n const contextValue = React.useContext((context as unknown) as Context<ContextValue<Value>>);\n\n if (contextValue.version) {\n return contextValue.version.current !== -1;\n }\n\n return false;\n}\n"],"sourceRoot":"../src/"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@fluentui/react-context-selector",
3
+ "version": "0.0.0-nightly-20220302-0405.1",
4
+ "description": "React useContextSelector hook in userland",
5
+ "main": "lib-commonjs/index.js",
6
+ "module": "lib/index.js",
7
+ "typings": "lib/index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/microsoft/fluentui"
12
+ },
13
+ "license": "MIT",
14
+ "scripts": {
15
+ "build": "just-scripts build",
16
+ "clean": "just-scripts clean",
17
+ "code-style": "just-scripts code-style",
18
+ "just": "just-scripts",
19
+ "lint": "just-scripts lint",
20
+ "test": "jest --passWithNoTests",
21
+ "docs": "api-extractor run --config=config/api-extractor.local.json --local",
22
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-context-selector/src && yarn docs",
23
+ "type-check": "tsc -b tsconfig.json"
24
+ },
25
+ "devDependencies": {
26
+ "@fluentui/eslint-plugin": "*",
27
+ "@fluentui/scripts": "^1.0.0",
28
+ "@types/scheduler": "^0.16.1",
29
+ "@types/react": "16.9.42",
30
+ "@types/react-dom": "16.9.10",
31
+ "@types/react-test-renderer": "^16.0.0",
32
+ "react": "16.8.6",
33
+ "react-dom": "16.8.6",
34
+ "react-is": "^16.6.3",
35
+ "react-test-renderer": "^16.3.0"
36
+ },
37
+ "dependencies": {
38
+ "@fluentui/react-utilities": "0.0.0-nightly-20220302-0405.1",
39
+ "scheduler": "^0.20.1",
40
+ "tslib": "^2.1.0"
41
+ },
42
+ "peerDependencies": {
43
+ "@types/react": ">=16.8.0 <18.0.0",
44
+ "@types/react-dom": ">=16.8.0 <18.0.0",
45
+ "react": ">=16.8.0 <18.0.0",
46
+ "react-dom": ">=16.8.0 <18.0.0"
47
+ },
48
+ "beachball": {
49
+ "disallowedChangeTypes": [
50
+ "major",
51
+ "minor",
52
+ "patch"
53
+ ]
54
+ }
55
+ }