@fluentui/global-context 0.0.0-nightly-20220624-0419.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.
package/CHANGELOG.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@fluentui/global-context",
3
+ "entries": [
4
+ {
5
+ "date": "Fri, 24 Jun 2022 04:33:28 GMT",
6
+ "tag": "@fluentui/global-context_v0.0.0-nightly-20220624-0419.1",
7
+ "version": "0.0.0-nightly-20220624-0419.1",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "Humberto.Morimoto@microsoft.com",
12
+ "package": "@fluentui/global-context",
13
+ "commit": "ddf16d80c50d80bc07331b478f567629775f2898",
14
+ "comment": "chore: Adding scheduler as a peer dependency since this package has a dependency on @fluentui/react-context-selector."
15
+ },
16
+ {
17
+ "author": "lingfangao@hotmail.com",
18
+ "package": "@fluentui/global-context",
19
+ "commit": "f36aa2ce92a7ac67bcdc246604d675a91b561e53",
20
+ "comment": "feat: beta release"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/global-context",
25
+ "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20220624-0419.1",
26
+ "commit": "5197053e8e0ad04d319248954fcfa61d4f63b97a"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/global-context",
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220624-0419.1",
32
+ "commit": "5197053e8e0ad04d319248954fcfa61d4f63b97a"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Tue, 31 May 2022 21:28:50 GMT",
39
+ "tag": "@fluentui/global-context_v9.0.0-alpha.0",
40
+ "version": "9.0.0-alpha.0",
41
+ "comments": {
42
+ "prerelease": [
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/global-context",
46
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.10",
47
+ "commit": "335ebfcfd47005003901b5e319782bfe9ccd89fd"
48
+ }
49
+ ]
50
+ }
51
+ }
52
+ ]
53
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Change Log - @fluentui/global-context
2
+
3
+ This log was last generated on Fri, 24 Jun 2022 04:33:28 GMT and should not be manually modified.
4
+
5
+ <!-- Start content -->
6
+
7
+ ## [0.0.0-nightly-20220624-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v0.0.0-nightly-20220624-0419.1)
8
+
9
+ Fri, 24 Jun 2022 04:33:28 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-alpha.0..@fluentui/global-context_v0.0.0-nightly-20220624-0419.1)
11
+
12
+ ### Changes
13
+
14
+ - chore: Adding scheduler as a peer dependency since this package has a dependency on @fluentui/react-context-selector. ([PR #23681](https://github.com/microsoft/fluentui/pull/23681) by Humberto.Morimoto@microsoft.com)
15
+ - feat: beta release ([PR #23623](https://github.com/microsoft/fluentui/pull/23623) by lingfangao@hotmail.com)
16
+ - Bump @fluentui/react-context-selector to v0.0.0-nightly-20220624-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/5197053e8e0ad04d319248954fcfa61d4f63b97a) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220624-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/5197053e8e0ad04d319248954fcfa61d4f63b97a) by beachball)
18
+
19
+ ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-alpha.0)
20
+
21
+ Tue, 31 May 2022 21:28:50 GMT
22
+
23
+ ### Changes
24
+
25
+ - Bump @fluentui/react-utilities to v9.0.0-rc.10 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ @fluentui/global-context
2
+
3
+ Copyright (c) Microsoft Corporation
4
+
5
+ All rights reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+
15
+ Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # @fluentui/global-context
2
+
3
+ **Global Context for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
4
+
5
+ This package contains a shim for `React.createContext` API that will register the context object to the global
6
+ scope (`window` for browsers, `global` for nodejs). This means that contexts will be real singletons.
7
+
8
+ > ⚠️ The recommended approach is not to use this package and deduplicate affected packages in node_modules
9
+
10
+ This package is is a workaround when multiple context objects are included into a bundle. This can happen when
11
+ there are multiple copies of the same package installed in `node_modules`.
12
+
13
+ **This package is not inteded to be used directly in code, but through a [Babel transform](/todo)**
@@ -0,0 +1,33 @@
1
+ import * as React_2 from 'react';
2
+
3
+ /**
4
+ * Wrapper around @see React.createContext that implements context registration
5
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
6
+ * a unique sybmol for the package name, version and name of the context.
7
+ *
8
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
9
+ *
10
+ * @param defaultValue - @see React.createContext
11
+ * @param name - name of the context
12
+ * @param packageName - name of the npm package where the module is used
13
+ * @param packageVersion - version of the npm package where the module is used
14
+ * @returns @see React.createContext
15
+ */
16
+ export declare const createContext: <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => React_2.Context<T>;
17
+
18
+ /**
19
+ * Wrapper around @see createContext from \@fluentui/react-context-selector that implements context registration
20
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
21
+ * a unique sybmol for the package name, version and name of the context.
22
+ *
23
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
24
+ *
25
+ * @param defaultValue - @see React.createContext
26
+ * @param name - name of the context
27
+ * @param packageName - name of the npm package where the module is used
28
+ * @param packageVersion - version of the npm package where the module is used
29
+ * @returns @see React.createContext
30
+ */
31
+ export declare const createContextSelector: <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => React_2.Context<T>;
32
+
33
+ export { }
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.18.1"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,52 @@
1
+ import { createContext as baseCreateContext } from '@fluentui/react-context-selector';
2
+ import { canUseDOM } from '@fluentui/react-utilities';
3
+ import { getMajorVersion } from './utils';
4
+ const isBrowser = /*#__PURE__*/canUseDOM();
5
+ const globalObject = isBrowser ? window : global; // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
6
+ // Useful for clearning global object during SSR reloads
7
+
8
+ export const SYMBOL_NAMESPACE = 'global-context-selector:'; // During SSR the global object persists with the server process
9
+ // Clean out the global object during server reload during development
10
+
11
+ if (!isBrowser && process.env.NODE_ENV !== 'production') {
12
+ const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
13
+ globalSymbols.forEach(sym => {
14
+ var _a;
15
+
16
+ if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(SYMBOL_NAMESPACE)) {
17
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
18
+ delete globalObject[sym];
19
+ }
20
+ });
21
+ }
22
+ /**
23
+ * Wrapper around @see createContext from \@fluentui/react-context-selector that implements context registration
24
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
25
+ * a unique sybmol for the package name, version and name of the context.
26
+ *
27
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
28
+ *
29
+ * @param defaultValue - @see React.createContext
30
+ * @param name - name of the context
31
+ * @param packageName - name of the npm package where the module is used
32
+ * @param packageVersion - version of the npm package where the module is used
33
+ * @returns @see React.createContext
34
+ */
35
+
36
+
37
+ export const createContext = (defaultValue, name, packageName, packageVersion) => {
38
+ // Symbol guaranteed to be unique for the entire runtime
39
+ const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`); // Objects keyed with symbols are not visible with console.log
40
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
41
+
42
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
43
+
44
+ if (!globalSymbols.includes(sym)) {
45
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
46
+ globalObject[sym] = baseCreateContext(defaultValue);
47
+ } // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
48
+
49
+
50
+ return globalObject[sym];
51
+ };
52
+ //# sourceMappingURL=global-context-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["global-context-selector.ts"],"names":[],"mappings":"AACA,SAAS,aAAa,IAAI,iBAA1B,QAAmD,kCAAnD;AACA,SAAS,SAAT,QAA0B,2BAA1B;AACA,SAAS,eAAT,QAAgC,SAAhC;AAGA,MAAM,SAAS,gBAAG,SAAS,EAA3B;AACA,MAAM,YAAY,GAAiB,SAAS,GAAG,MAAH,GAAY,MAAxD,C,CAEA;AACA;;AACA,OAAO,MAAM,gBAAgB,GAAG,0BAAzB,C,CAEP;AACA;;AACA,IAAI,CAAC,SAAD,IAAc,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA3C,EAAyD;EACvD,MAAM,aAAa,gBAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;EACA,aAAa,CAAC,OAAd,CAAsB,GAAG,IAAG;;;IAC1B,IAAI,CAAA,EAAA,GAAA,MAAM,CAAC,MAAP,CAAc,GAAd,CAAA,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,UAAF,CAAa,gBAAb,CAAtB,EAAsD;MACpD;MACA,OAAO,YAAY,CAAC,GAAD,CAAnB;IACD;EACF,CALD;AAMD;AAED;;;;;;;;;;;;AAYG;;;AACH,OAAO,MAAM,aAAa,GAAG,CAAI,YAAJ,EAAqB,IAArB,EAAmC,WAAnC,EAAwD,cAAxD,KAAkF;EAC7G;EACA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAP,CAAW,GAAG,gBAAgB,GAAG,WAAW,IAAI,IAAI,KAAK,eAAe,CAAC,cAAD,CAAgB,EAAxF,CAAZ,CAF6G,CAI7G;EACA;;EACA,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;;EACA,IAAI,CAAC,aAAa,CAAC,QAAd,CAAuB,GAAvB,CAAL,EAAkC;IAChC;IACA,YAAY,CAAC,GAAD,CAAZ,GAAoB,iBAAiB,CAAC,YAAD,CAArC;EACD,CAV4G,CAY7G;;;EACA,OAAO,YAAY,CAAC,GAAD,CAAnB;AACD,CAdM","sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nimport { GlobalObject } from './types';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import { canUseDOM } from '@fluentui/react-utilities';
3
+ import { getMajorVersion } from './utils';
4
+ const isBrowser = /*#__PURE__*/canUseDOM();
5
+ const globalObject = isBrowser ? window : global; // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
6
+ // Useful for clearning global object during SSR reloads
7
+
8
+ export const SYMBOL_NAMESPACE = 'global-context:'; // During SSR the global object persists with the server process
9
+ // Clean out the global object during server reload during development
10
+
11
+ if (!isBrowser && process.env.NODE_ENV !== 'production') {
12
+ const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
13
+ globalSymbols.forEach(sym => {
14
+ var _a;
15
+
16
+ if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(SYMBOL_NAMESPACE)) {
17
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
18
+ delete globalObject[sym];
19
+ }
20
+ });
21
+ }
22
+ /**
23
+ * Wrapper around @see React.createContext that implements context registration
24
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
25
+ * a unique sybmol for the package name, version and name of the context.
26
+ *
27
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
28
+ *
29
+ * @param defaultValue - @see React.createContext
30
+ * @param name - name of the context
31
+ * @param packageName - name of the npm package where the module is used
32
+ * @param packageVersion - version of the npm package where the module is used
33
+ * @returns @see React.createContext
34
+ */
35
+
36
+
37
+ export const createContext = (defaultValue, name, packageName, packageVersion) => {
38
+ // Symbol guaranteed to be unique for the entire runtime
39
+ const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`); // Objects keyed with symbols are not visible with console.log
40
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
41
+
42
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
43
+
44
+ if (!globalSymbols.includes(sym)) {
45
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
46
+ globalObject[sym] = /*#__PURE__*/React.createContext(defaultValue);
47
+ } // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
48
+
49
+
50
+ return globalObject[sym];
51
+ };
52
+ //# sourceMappingURL=global-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["global-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,SAAT,QAA0B,2BAA1B;AAEA,SAAS,eAAT,QAAgC,SAAhC;AAEA,MAAM,SAAS,gBAAG,SAAS,EAA3B;AACA,MAAM,YAAY,GAAiB,SAAS,GAAG,MAAH,GAAY,MAAxD,C,CAEA;AACA;;AACA,OAAO,MAAM,gBAAgB,GAAG,iBAAzB,C,CAEP;AACA;;AACA,IAAI,CAAC,SAAD,IAAc,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA3C,EAAyD;EACvD,MAAM,aAAa,gBAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;EACA,aAAa,CAAC,OAAd,CAAsB,GAAG,IAAG;;;IAC1B,IAAI,CAAA,EAAA,GAAA,MAAM,CAAC,MAAP,CAAc,GAAd,CAAA,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,UAAF,CAAa,gBAAb,CAAtB,EAAsD;MACpD;MACA,OAAO,YAAY,CAAC,GAAD,CAAnB;IACD;EACF,CALD;AAMD;AAED;;;;;;;;;;;;AAYG;;;AACH,OAAO,MAAM,aAAa,GAAG,CAAI,YAAJ,EAAqB,IAArB,EAAmC,WAAnC,EAAwD,cAAxD,KAAkF;EAC7G;EACA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAP,CAAW,GAAG,gBAAgB,GAAG,WAAW,IAAI,IAAI,KAAK,eAAe,CAAC,cAAD,CAAgB,EAAxF,CAAZ,CAF6G,CAI7G;EACA;;EACA,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;;EACA,IAAI,CAAC,aAAa,CAAC,QAAd,CAAuB,GAAvB,CAAL,EAAkC;IAChC;IACA,YAAY,CAAC,GAAD,CAAZ,gBAAoB,KAAK,CAAC,aAAN,CAAoB,YAApB,CAApB;EACD,CAV4G,CAY7G;;;EACA,OAAO,YAAY,CAAC,GAAD,CAAnB;AACD,CAdM","sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n globalObject[sym] = React.createContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createContext } from './global-context';
2
+ export { createContext as createContextSelector } from './global-context-selector';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n"]}
package/lib/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type GlobalObject = (typeof globalThis | NodeJS.Global) & Record<symbol, React.Context<unknown>>;\n"]}
package/lib/utils.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @param version - semver version string
3
+ * @returns The major version number
4
+ */
5
+ export function getMajorVersion(version) {
6
+ return Number(version.split('.')[0]);
7
+ }
8
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils.ts"],"names":[],"mappings":"AAAA;;;AAGG;AACH,OAAM,SAAU,eAAV,CAA0B,OAA1B,EAAyC;EAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAR,CAAc,GAAd,EAAmB,CAAnB,CAAD,CAAb;AACD","sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */\nexport function getMajorVersion(version: string) {\n return Number(version.split('.')[0]);\n}\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContext = exports.SYMBOL_NAMESPACE = void 0;
7
+
8
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const utils_1 = /*#__PURE__*/require("./utils");
13
+
14
+ const isBrowser = /*#__PURE__*/react_utilities_1.canUseDOM();
15
+ const globalObject = isBrowser ? window : global; // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
16
+ // Useful for clearning global object during SSR reloads
17
+
18
+ exports.SYMBOL_NAMESPACE = 'global-context-selector:'; // During SSR the global object persists with the server process
19
+ // Clean out the global object during server reload during development
20
+
21
+ if (!isBrowser && process.env.NODE_ENV !== 'production') {
22
+ const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
23
+ globalSymbols.forEach(sym => {
24
+ var _a;
25
+
26
+ if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(exports.SYMBOL_NAMESPACE)) {
27
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
28
+ delete globalObject[sym];
29
+ }
30
+ });
31
+ }
32
+ /**
33
+ * Wrapper around @see createContext from \@fluentui/react-context-selector that implements context registration
34
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
35
+ * a unique sybmol for the package name, version and name of the context.
36
+ *
37
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
38
+ *
39
+ * @param defaultValue - @see React.createContext
40
+ * @param name - name of the context
41
+ * @param packageName - name of the npm package where the module is used
42
+ * @param packageVersion - version of the npm package where the module is used
43
+ * @returns @see React.createContext
44
+ */
45
+
46
+
47
+ const createContext = (defaultValue, name, packageName, packageVersion) => {
48
+ // Symbol guaranteed to be unique for the entire runtime
49
+ const sym = Symbol.for(`${exports.SYMBOL_NAMESPACE}${packageName}/${name}/@${utils_1.getMajorVersion(packageVersion)}`); // Objects keyed with symbols are not visible with console.log
50
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
51
+
52
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
53
+
54
+ if (!globalSymbols.includes(sym)) {
55
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
56
+ globalObject[sym] = react_context_selector_1.createContext(defaultValue);
57
+ } // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
58
+
59
+
60
+ return globalObject[sym];
61
+ };
62
+
63
+ exports.createContext = createContext;
64
+ //# sourceMappingURL=global-context-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["global-context-selector.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAGA,MAAM,SAAS,gBAAG,iBAAA,CAAA,SAAA,EAAlB;AACA,MAAM,YAAY,GAAiB,SAAS,GAAG,MAAH,GAAY,MAAxD,C,CAEA;AACA;;AACa,OAAA,CAAA,gBAAA,GAAmB,0BAAnB,C,CAEb;AACA;;AACA,IAAI,CAAC,SAAD,IAAc,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA3C,EAAyD;EACvD,MAAM,aAAa,gBAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;EACA,aAAa,CAAC,OAAd,CAAsB,GAAG,IAAG;;;IAC1B,IAAI,CAAA,EAAA,GAAA,MAAM,CAAC,MAAP,CAAc,GAAd,CAAA,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,UAAF,CAAa,OAAA,CAAA,gBAAb,CAAtB,EAAsD;MACpD;MACA,OAAO,YAAY,CAAC,GAAD,CAAnB;IACD;EACF,CALD;AAMD;AAED;;;;;;;;;;;;AAYG;;;AACI,MAAM,aAAa,GAAG,CAAI,YAAJ,EAAqB,IAArB,EAAmC,WAAnC,EAAwD,cAAxD,KAAkF;EAC7G;EACA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAP,CAAW,GAAG,OAAA,CAAA,gBAAgB,GAAG,WAAW,IAAI,IAAI,KAAK,OAAA,CAAA,eAAA,CAAgB,cAAhB,CAA+B,EAAxF,CAAZ,CAF6G,CAI7G;EACA;;EACA,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;;EACA,IAAI,CAAC,aAAa,CAAC,QAAd,CAAuB,GAAvB,CAAL,EAAkC;IAChC;IACA,YAAY,CAAC,GAAD,CAAZ,GAAoB,wBAAA,CAAA,aAAA,CAAkB,YAAlB,CAApB;EACD,CAV4G,CAY7G;;;EACA,OAAO,YAAY,CAAC,GAAD,CAAnB;AACD,CAdM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nimport { GlobalObject } from './types';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContext = exports.SYMBOL_NAMESPACE = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ const utils_1 = /*#__PURE__*/require("./utils");
13
+
14
+ const isBrowser = /*#__PURE__*/react_utilities_1.canUseDOM();
15
+ const globalObject = isBrowser ? window : global; // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
16
+ // Useful for clearning global object during SSR reloads
17
+
18
+ exports.SYMBOL_NAMESPACE = 'global-context:'; // During SSR the global object persists with the server process
19
+ // Clean out the global object during server reload during development
20
+
21
+ if (!isBrowser && process.env.NODE_ENV !== 'production') {
22
+ const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
23
+ globalSymbols.forEach(sym => {
24
+ var _a;
25
+
26
+ if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(exports.SYMBOL_NAMESPACE)) {
27
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
28
+ delete globalObject[sym];
29
+ }
30
+ });
31
+ }
32
+ /**
33
+ * Wrapper around @see React.createContext that implements context registration
34
+ * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
35
+ * a unique sybmol for the package name, version and name of the context.
36
+ *
37
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
38
+ *
39
+ * @param defaultValue - @see React.createContext
40
+ * @param name - name of the context
41
+ * @param packageName - name of the npm package where the module is used
42
+ * @param packageVersion - version of the npm package where the module is used
43
+ * @returns @see React.createContext
44
+ */
45
+
46
+
47
+ const createContext = (defaultValue, name, packageName, packageVersion) => {
48
+ // Symbol guaranteed to be unique for the entire runtime
49
+ const sym = Symbol.for(`${exports.SYMBOL_NAMESPACE}${packageName}/${name}/@${utils_1.getMajorVersion(packageVersion)}`); // Objects keyed with symbols are not visible with console.log
50
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
51
+
52
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
53
+
54
+ if (!globalSymbols.includes(sym)) {
55
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
56
+ globalObject[sym] = React.createContext(defaultValue);
57
+ } // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
58
+
59
+
60
+ return globalObject[sym];
61
+ };
62
+
63
+ exports.createContext = createContext;
64
+ //# sourceMappingURL=global-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["global-context.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAEA,MAAM,SAAS,gBAAG,iBAAA,CAAA,SAAA,EAAlB;AACA,MAAM,YAAY,GAAiB,SAAS,GAAG,MAAH,GAAY,MAAxD,C,CAEA;AACA;;AACa,OAAA,CAAA,gBAAA,GAAmB,iBAAnB,C,CAEb;AACA;;AACA,IAAI,CAAC,SAAD,IAAc,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA3C,EAAyD;EACvD,MAAM,aAAa,gBAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;EACA,aAAa,CAAC,OAAd,CAAsB,GAAG,IAAG;;;IAC1B,IAAI,CAAA,EAAA,GAAA,MAAM,CAAC,MAAP,CAAc,GAAd,CAAA,MAAkB,IAAlB,IAAkB,EAAA,KAAA,KAAA,CAAlB,GAAkB,KAAA,CAAlB,GAAkB,EAAA,CAAE,UAAF,CAAa,OAAA,CAAA,gBAAb,CAAtB,EAAsD;MACpD;MACA,OAAO,YAAY,CAAC,GAAD,CAAnB;IACD;EACF,CALD;AAMD;AAED;;;;;;;;;;;;AAYG;;;AACI,MAAM,aAAa,GAAG,CAAI,YAAJ,EAAqB,IAArB,EAAmC,WAAnC,EAAwD,cAAxD,KAAkF;EAC7G;EACA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAP,CAAW,GAAG,OAAA,CAAA,gBAAgB,GAAG,WAAW,IAAI,IAAI,KAAK,OAAA,CAAA,eAAA,CAAgB,cAAhB,CAA+B,EAAxF,CAAZ,CAF6G,CAI7G;EACA;;EACA,MAAM,aAAa,GAAG,MAAM,CAAC,qBAAP,CAA6B,YAA7B,CAAtB;;EACA,IAAI,CAAC,aAAa,CAAC,QAAd,CAAuB,GAAvB,CAAL,EAAkC;IAChC;IACA,YAAY,CAAC,GAAD,CAAZ,GAAoB,KAAK,CAAC,aAAN,CAAoB,YAApB,CAApB;EACD,CAV4G,CAY7G;;;EACA,OAAO,YAAY,CAAC,GAAD,CAAnB;AACD,CAdM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n globalObject[sym] = React.createContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContextSelector = exports.createContext = void 0;
7
+
8
+ var global_context_1 = /*#__PURE__*/require("./global-context");
9
+
10
+ Object.defineProperty(exports, "createContext", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return global_context_1.createContext;
14
+ }
15
+ });
16
+
17
+ var global_context_selector_1 = /*#__PURE__*/require("./global-context-selector");
18
+
19
+ Object.defineProperty(exports, "createContextSelector", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return global_context_selector_1.createContext;
23
+ }
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,gBAAA,CAAA,aAAA;EAAa;AAAb,CAAA;;AACT,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,yBAAA,CAAA,aAAA;EAAa;AAAb,CAAA","sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getMajorVersion = void 0;
7
+ /**
8
+ * @param version - semver version string
9
+ * @returns The major version number
10
+ */
11
+
12
+ function getMajorVersion(version) {
13
+ return Number(version.split('.')[0]);
14
+ }
15
+
16
+ exports.getMajorVersion = getMajorVersion;
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils.ts"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;;AACH,SAAgB,eAAhB,CAAgC,OAAhC,EAA+C;EAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAR,CAAc,GAAd,EAAmB,CAAnB,CAAD,CAAb;AACD;;AAFD,OAAA,CAAA,eAAA,GAAA,eAAA","sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */\nexport function getMajorVersion(version: string) {\n return Number(version.split('.')[0]);\n}\n"],"sourceRoot":"../src/"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@fluentui/global-context",
3
+ "version": "0.0.0-nightly-20220624-0419.1",
4
+ "description": "Extension of React createContext to be a true singleton on the global scope",
5
+ "main": "lib-commonjs/index.js",
6
+ "module": "lib/index.js",
7
+ "typings": "dist/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
+ "bundle-size": "bundle-size measure",
17
+ "clean": "just-scripts clean",
18
+ "code-style": "just-scripts code-style",
19
+ "e2e": "yarn cypress run --component",
20
+ "e2e:local": "yarn cypress open --component",
21
+ "just": "just-scripts",
22
+ "lint": "just-scripts lint",
23
+ "start": "yarn storybook",
24
+ "test": "jest --passWithNoTests",
25
+ "docs": "api-extractor run --config=config/api-extractor.local.json --local",
26
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/global-context/src && yarn docs",
27
+ "storybook": "node ../../../scripts/storybook/runner",
28
+ "type-check": "tsc -b tsconfig.json"
29
+ },
30
+ "devDependencies": {
31
+ "@fluentui/eslint-plugin": "*",
32
+ "@fluentui/scripts": "^1.0.0"
33
+ },
34
+ "dependencies": {
35
+ "@fluentui/react-context-selector": "0.0.0-nightly-20220624-0419.1",
36
+ "@fluentui/react-utilities": "0.0.0-nightly-20220624-0419.1",
37
+ "tslib": "^2.1.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@types/react": ">=16.8.0 <18.0.0",
41
+ "@types/react-dom": ">=16.8.0 <18.0.0",
42
+ "react": ">=16.8.0 <18.0.0",
43
+ "react-dom": ">=16.8.0 <18.0.0",
44
+ "scheduler": "^0.19.0 || ^0.20.0"
45
+ },
46
+ "beachball": {
47
+ "disallowedChangeTypes": [
48
+ "major",
49
+ "minor",
50
+ "patch"
51
+ ]
52
+ }
53
+ }