@fluentui/react-shared-contexts 9.0.0 → 9.0.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 CHANGED
@@ -2,7 +2,63 @@
2
2
  "name": "@fluentui/react-shared-contexts",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 28 Jun 2022 15:09:09 GMT",
5
+ "date": "Thu, 15 Sep 2022 09:44:42 GMT",
6
+ "tag": "@fluentui/react-shared-contexts_v9.0.1",
7
+ "version": "9.0.1",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-shared-contexts",
13
+ "commit": "e6cf183695d6d67a24e038c49a876224e5ed35e5",
14
+ "comment": "chore: update package scaffold"
15
+ },
16
+ {
17
+ "author": "martinhochel@microsoft.com",
18
+ "package": "@fluentui/react-shared-contexts",
19
+ "commit": "16aa65dcae8f75c6a221225fd0eb43800650ac66",
20
+ "comment": "docs(react-shared-contexts): re-generate api.md"
21
+ }
22
+ ],
23
+ "patch": [
24
+ {
25
+ "author": "lingfangao@hotmail.com",
26
+ "package": "@fluentui/react-shared-contexts",
27
+ "commit": "a0cfab0e5f74e3a3bfa9c269fff574295042d7f2",
28
+ "comment": "chore: fix no-context-default-value lint violations"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-shared-contexts",
33
+ "comment": "Bump @fluentui/react-theme to v9.1.0",
34
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "date": "Wed, 03 Aug 2022 16:03:59 GMT",
41
+ "tag": "@fluentui/react-shared-contexts_v9.0.0",
42
+ "version": "9.0.0",
43
+ "comments": {
44
+ "none": [
45
+ {
46
+ "author": "bernardo.sunderhus@gmail.com",
47
+ "package": "@fluentui/react-shared-contexts",
48
+ "commit": "d966ea3d9169f2e8d69f0d2a4daf86fe4ca328d6",
49
+ "comment": "disables eslint rule @fluentui/no-context-default-value for local component context"
50
+ },
51
+ {
52
+ "author": "lingfangao@hotmail.com",
53
+ "package": "@fluentui/react-shared-contexts",
54
+ "commit": "99cc385631d04a76ee10ebc143cb9fecd99640b6",
55
+ "comment": "chore: Add `prerelease` as disallowed changetype for 9.0.0 packages"
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "date": "Tue, 28 Jun 2022 15:13:58 GMT",
6
62
  "tag": "@fluentui/react-shared-contexts_v9.0.0",
7
63
  "version": "9.0.0",
8
64
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/react-shared-contexts
2
2
 
3
- This log was last generated on Tue, 28 Jun 2022 15:09:09 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 15 Sep 2022 09:44:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-shared-contexts_v9.0.1)
8
+
9
+ Thu, 15 Sep 2022 09:44:42 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-shared-contexts_v9.0.0..@fluentui/react-shared-contexts_v9.0.1)
11
+
12
+ ### Patches
13
+
14
+ - chore: fix no-context-default-value lint violations ([PR #24276](https://github.com/microsoft/fluentui/pull/24276) by lingfangao@hotmail.com)
15
+ - Bump @fluentui/react-theme to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
16
+
7
17
  ## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-shared-contexts_v9.0.0)
8
18
 
9
- Tue, 28 Jun 2022 15:09:09 GMT
19
+ Tue, 28 Jun 2022 15:13:58 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-shared-contexts_v9.0.0-rc.11..@fluentui/react-shared-contexts_v9.0.0)
11
21
 
12
22
  ### Patches
@@ -3,16 +3,19 @@ import * as React from 'react';
3
3
  * @internal
4
4
  */
5
5
 
6
- const ProviderContext = /*#__PURE__*/React.createContext({
6
+ const ProviderContext = /*#__PURE__*/React.createContext(undefined);
7
+ const providerContextDefaultValue = {
7
8
  targetDocument: typeof document === 'object' ? document : undefined,
8
9
  dir: 'ltr'
9
- });
10
+ };
10
11
  /**
11
12
  * @internal
12
13
  */
13
14
 
14
15
  export const Provider = ProviderContext.Provider;
15
16
  export function useFluent() {
16
- return React.useContext(ProviderContext);
17
+ var _a;
18
+
19
+ return (_a = React.useContext(ProviderContext)) !== null && _a !== void 0 ? _a : providerContextDefaultValue;
17
20
  }
18
21
  //# sourceMappingURL=ProviderContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ProviderContext/ProviderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAUA;;AAEG;;AACH,MAAM,eAAe,gBAAG,KAAK,CAAC,aAAN,CAA0C;EAChE,cAAc,EAAE,OAAO,QAAP,KAAoB,QAApB,GAA+B,QAA/B,GAA0C,SADM;EAEhE,GAAG,EAAE;AAF2D,CAA1C,CAAxB;AAKA;;AAEG;;AACH,OAAO,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAjC;AAEP,OAAM,SAAU,SAAV,GAAmB;EACvB,OAAO,KAAK,CAAC,UAAN,CAAiB,eAAjB,CAAP;AACD","sourcesContent":["import * as React from 'react';\n\nexport type ProviderContextValue = {\n /** Sets the direction of text & generated styles. */\n dir: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n};\n\n/**\n * @internal\n */\nconst ProviderContext = React.createContext<ProviderContextValue>({\n targetDocument: typeof document === 'object' ? document : undefined,\n dir: 'ltr',\n});\n\n/**\n * @internal\n */\nexport const Provider = ProviderContext.Provider;\n\nexport function useFluent(): ProviderContextValue {\n return React.useContext(ProviderContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["ProviderContext/ProviderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAUA;;AAEG;;AACH,MAAM,eAAe,gBAAG,KAAK,CAAC,aAAN,CACtB,SADsB,CAAxB;AAIA,MAAM,2BAA2B,GAAyB;EACxD,cAAc,EAAE,OAAO,QAAP,KAAoB,QAApB,GAA+B,QAA/B,GAA0C,SADF;EAExD,GAAG,EAAE;AAFmD,CAA1D;AAKA;;AAEG;;AACH,OAAO,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAjC;AAEP,OAAM,SAAU,SAAV,GAAmB;;;EACvB,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,eAAjB,CAAA,MAAiC,IAAjC,IAAiC,EAAA,KAAA,KAAA,CAAjC,GAAiC,EAAjC,GAAqC,2BAA5C;AACD","sourcesContent":["import * as React from 'react';\n\nexport type ProviderContextValue = {\n /** Sets the direction of text & generated styles. */\n dir: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n};\n\n/**\n * @internal\n */\nconst ProviderContext = React.createContext<ProviderContextValue | undefined>(\n undefined,\n) as React.Context<ProviderContextValue>;\n\nconst providerContextDefaultValue: ProviderContextValue = {\n targetDocument: typeof document === 'object' ? document : undefined,\n dir: 'ltr' as const,\n};\n\n/**\n * @internal\n */\nexport const Provider = ProviderContext.Provider;\n\nexport function useFluent(): ProviderContextValue {\n return React.useContext(ProviderContext) ?? providerContextDefaultValue;\n}\n"],"sourceRoot":"../src/"}
@@ -6,7 +6,8 @@ import * as React from 'react';
6
6
  * Useful for elements in the React tree (can read context) but not in the DOM Tree. E.g. Portals
7
7
  */
8
8
 
9
- const ThemeClassNameContext = /*#__PURE__*/React.createContext('');
9
+ const ThemeClassNameContext = /*#__PURE__*/React.createContext(undefined);
10
+ const themeClassNameContextDefaultVaue = '';
10
11
  export const ThemeClassNameProvider = ThemeClassNameContext.Provider;
11
12
  /**
12
13
  * @internal
@@ -14,6 +15,8 @@ export const ThemeClassNameProvider = ThemeClassNameContext.Provider;
14
15
  */
15
16
 
16
17
  export function useThemeClassName() {
17
- return React.useContext(ThemeClassNameContext);
18
+ var _a;
19
+
20
+ return (_a = React.useContext(ThemeClassNameContext)) !== null && _a !== void 0 ? _a : themeClassNameContextDefaultVaue;
18
21
  }
19
22
  //# sourceMappingURL=ThemeClassNameContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeClassNameContext/ThemeClassNameContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAIA;;;;;AAKG;;AACH,MAAM,qBAAqB,gBAAG,KAAK,CAAC,aAAN,CAAgD,EAAhD,CAA9B;AAEA,OAAO,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,QAArD;AAEP;;;AAGG;;AACH,OAAM,SAAU,iBAAV,GAA2B;EAC/B,OAAO,KAAK,CAAC,UAAN,CAAiB,qBAAjB,CAAP;AACD","sourcesContent":["import * as React from 'react';\n\nexport type ThemeClassNameContextValue = string;\n\n/**\n * @internal\n * Used to provide a CSS class that applies theme css variables\n *\n * Useful for elements in the React tree (can read context) but not in the DOM Tree. E.g. Portals\n */\nconst ThemeClassNameContext = React.createContext<ThemeClassNameContextValue>('');\n\nexport const ThemeClassNameProvider = ThemeClassNameContext.Provider;\n\n/**\n * @internal\n * @returns CSS class that applies css variables\n */\nexport function useThemeClassName(): ThemeClassNameContextValue {\n return React.useContext(ThemeClassNameContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["ThemeClassNameContext/ThemeClassNameContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAIA;;;;;AAKG;;AACH,MAAM,qBAAqB,gBAAG,KAAK,CAAC,aAAN,CAC5B,SAD4B,CAA9B;AAIA,MAAM,gCAAgC,GAAG,EAAzC;AAEA,OAAO,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,QAArD;AAEP;;;AAGG;;AACH,OAAM,SAAU,iBAAV,GAA2B;;;EAC/B,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,qBAAjB,CAAA,MAAuC,IAAvC,IAAuC,EAAA,KAAA,KAAA,CAAvC,GAAuC,EAAvC,GAA2C,gCAAlD;AACD","sourcesContent":["import * as React from 'react';\n\nexport type ThemeClassNameContextValue = string;\n\n/**\n * @internal\n * Used to provide a CSS class that applies theme css variables\n *\n * Useful for elements in the React tree (can read context) but not in the DOM Tree. E.g. Portals\n */\nconst ThemeClassNameContext = React.createContext<ThemeClassNameContextValue | undefined>(\n undefined,\n) as React.Context<ThemeClassNameContextValue>;\n\nconst themeClassNameContextDefaultVaue = '';\n\nexport const ThemeClassNameProvider = ThemeClassNameContext.Provider;\n\n/**\n * @internal\n * @returns CSS class that applies css variables\n */\nexport function useThemeClassName(): ThemeClassNameContextValue {\n return React.useContext(ThemeClassNameContext) ?? themeClassNameContextDefaultVaue;\n}\n"],"sourceRoot":"../src/"}
@@ -4,7 +4,8 @@ import * as React from 'react';
4
4
  * Context shared by all of the tooltips in the app
5
5
  */
6
6
 
7
- const TooltipVisibilityContext = /*#__PURE__*/React.createContext({});
7
+ const TooltipVisibilityContext = /*#__PURE__*/React.createContext(undefined);
8
+ const tooltipVisibilityContextDefaultValue = {};
8
9
  /**
9
10
  * @internal
10
11
  */
@@ -15,6 +16,8 @@ export const TooltipVisibilityProvider = TooltipVisibilityContext.Provider;
15
16
  */
16
17
 
17
18
  export function useTooltipVisibility() {
18
- return React.useContext(TooltipVisibilityContext);
19
+ var _a;
20
+
21
+ return (_a = React.useContext(TooltipVisibilityContext)) !== null && _a !== void 0 ? _a : tooltipVisibilityContextDefaultValue;
19
22
  }
20
23
  //# sourceMappingURL=TooltipContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["TooltipVisibilityContext/TooltipContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAgBA;;;AAGG;;AACH,MAAM,wBAAwB,gBAAG,KAAK,CAAC,aAAN,CAAmD,EAAnD,CAAjC;AAEA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAG,wBAAwB,CAAC,QAA3D;AAEP;;AAEG;;AACH,OAAM,SAAU,oBAAV,GAA8B;EAClC,OAAO,KAAK,CAAC,UAAN,CAAiB,wBAAjB,CAAP;AACD","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * The context provided by TooltipProvider\n */\nexport type TooltipVisibilityContextValue = {\n /**\n * When a tooltip is shown, it sets itself as the visibleTooltip.\n * The next tooltip to become visible can use it to hide the previous tooltip immediately.\n */\n visibleTooltip?: {\n hide: () => void;\n };\n};\n\n/**\n * @internal\n * Context shared by all of the tooltips in the app\n */\nconst TooltipVisibilityContext = React.createContext<TooltipVisibilityContextValue>({});\n\n/**\n * @internal\n */\nexport const TooltipVisibilityProvider = TooltipVisibilityContext.Provider;\n\n/**\n * @internal\n */\nexport function useTooltipVisibility(): TooltipVisibilityContextValue {\n return React.useContext(TooltipVisibilityContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["TooltipVisibilityContext/TooltipContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAgBA;;;AAGG;;AACH,MAAM,wBAAwB,gBAAG,KAAK,CAAC,aAAN,CAC/B,SAD+B,CAAjC;AAIA,MAAM,oCAAoC,GAAkC,EAA5E;AAEA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAG,wBAAwB,CAAC,QAA3D;AAEP;;AAEG;;AACH,OAAM,SAAU,oBAAV,GAA8B;;;EAClC,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,wBAAjB,CAAA,MAA0C,IAA1C,IAA0C,EAAA,KAAA,KAAA,CAA1C,GAA0C,EAA1C,GAA8C,oCAArD;AACD","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * The context provided by TooltipProvider\n */\nexport type TooltipVisibilityContextValue = {\n /**\n * When a tooltip is shown, it sets itself as the visibleTooltip.\n * The next tooltip to become visible can use it to hide the previous tooltip immediately.\n */\n visibleTooltip?: {\n hide: () => void;\n };\n};\n\n/**\n * @internal\n * Context shared by all of the tooltips in the app\n */\nconst TooltipVisibilityContext = React.createContext<TooltipVisibilityContextValue | undefined>(\n undefined,\n) as React.Context<TooltipVisibilityContextValue>;\n\nconst tooltipVisibilityContextDefaultValue: TooltipVisibilityContextValue = {};\n\n/**\n * @internal\n */\nexport const TooltipVisibilityProvider = TooltipVisibilityContext.Provider;\n\n/**\n * @internal\n */\nexport function useTooltipVisibility(): TooltipVisibilityContextValue {\n return React.useContext(TooltipVisibilityContext) ?? tooltipVisibilityContextDefaultValue;\n}\n"],"sourceRoot":"../src/"}
@@ -11,10 +11,11 @@ const React = /*#__PURE__*/require("react");
11
11
  */
12
12
 
13
13
 
14
- const ProviderContext = /*#__PURE__*/React.createContext({
14
+ const ProviderContext = /*#__PURE__*/React.createContext(undefined);
15
+ const providerContextDefaultValue = {
15
16
  targetDocument: typeof document === 'object' ? document : undefined,
16
17
  dir: 'ltr'
17
- });
18
+ };
18
19
  /**
19
20
  * @internal
20
21
  */
@@ -22,7 +23,9 @@ const ProviderContext = /*#__PURE__*/React.createContext({
22
23
  exports.Provider = ProviderContext.Provider;
23
24
 
24
25
  function useFluent() {
25
- return React.useContext(ProviderContext);
26
+ var _a;
27
+
28
+ return (_a = React.useContext(ProviderContext)) !== null && _a !== void 0 ? _a : providerContextDefaultValue;
26
29
  }
27
30
 
28
31
  exports.useFluent = useFluent;
@@ -1 +1 @@
1
- {"version":3,"sources":["ProviderContext/ProviderContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAUA;;AAEG;;;AACH,MAAM,eAAe,gBAAG,KAAK,CAAC,aAAN,CAA0C;EAChE,cAAc,EAAE,OAAO,QAAP,KAAoB,QAApB,GAA+B,QAA/B,GAA0C,SADM;EAEhE,GAAG,EAAE;AAF2D,CAA1C,CAAxB;AAKA;;AAEG;;AACU,OAAA,CAAA,QAAA,GAAW,eAAe,CAAC,QAA3B;;AAEb,SAAgB,SAAhB,GAAyB;EACvB,OAAO,KAAK,CAAC,UAAN,CAAiB,eAAjB,CAAP;AACD;;AAFD,OAAA,CAAA,SAAA,GAAA,SAAA","sourcesContent":["import * as React from 'react';\n\nexport type ProviderContextValue = {\n /** Sets the direction of text & generated styles. */\n dir: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n};\n\n/**\n * @internal\n */\nconst ProviderContext = React.createContext<ProviderContextValue>({\n targetDocument: typeof document === 'object' ? document : undefined,\n dir: 'ltr',\n});\n\n/**\n * @internal\n */\nexport const Provider = ProviderContext.Provider;\n\nexport function useFluent(): ProviderContextValue {\n return React.useContext(ProviderContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["ProviderContext/ProviderContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAUA;;AAEG;;;AACH,MAAM,eAAe,gBAAG,KAAK,CAAC,aAAN,CACtB,SADsB,CAAxB;AAIA,MAAM,2BAA2B,GAAyB;EACxD,cAAc,EAAE,OAAO,QAAP,KAAoB,QAApB,GAA+B,QAA/B,GAA0C,SADF;EAExD,GAAG,EAAE;AAFmD,CAA1D;AAKA;;AAEG;;AACU,OAAA,CAAA,QAAA,GAAW,eAAe,CAAC,QAA3B;;AAEb,SAAgB,SAAhB,GAAyB;;;EACvB,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,eAAjB,CAAA,MAAiC,IAAjC,IAAiC,EAAA,KAAA,KAAA,CAAjC,GAAiC,EAAjC,GAAqC,2BAA5C;AACD;;AAFD,OAAA,CAAA,SAAA,GAAA,SAAA","sourcesContent":["import * as React from 'react';\n\nexport type ProviderContextValue = {\n /** Sets the direction of text & generated styles. */\n dir: 'ltr' | 'rtl';\n\n /** Provides the document, can be undefined during SSR render. */\n targetDocument?: Document;\n};\n\n/**\n * @internal\n */\nconst ProviderContext = React.createContext<ProviderContextValue | undefined>(\n undefined,\n) as React.Context<ProviderContextValue>;\n\nconst providerContextDefaultValue: ProviderContextValue = {\n targetDocument: typeof document === 'object' ? document : undefined,\n dir: 'ltr' as const,\n};\n\n/**\n * @internal\n */\nexport const Provider = ProviderContext.Provider;\n\nexport function useFluent(): ProviderContextValue {\n return React.useContext(ProviderContext) ?? providerContextDefaultValue;\n}\n"],"sourceRoot":"../src/"}
@@ -14,7 +14,8 @@ const React = /*#__PURE__*/require("react");
14
14
  */
15
15
 
16
16
 
17
- const ThemeClassNameContext = /*#__PURE__*/React.createContext('');
17
+ const ThemeClassNameContext = /*#__PURE__*/React.createContext(undefined);
18
+ const themeClassNameContextDefaultVaue = '';
18
19
  exports.ThemeClassNameProvider = ThemeClassNameContext.Provider;
19
20
  /**
20
21
  * @internal
@@ -22,7 +23,9 @@ exports.ThemeClassNameProvider = ThemeClassNameContext.Provider;
22
23
  */
23
24
 
24
25
  function useThemeClassName() {
25
- return React.useContext(ThemeClassNameContext);
26
+ var _a;
27
+
28
+ return (_a = React.useContext(ThemeClassNameContext)) !== null && _a !== void 0 ? _a : themeClassNameContextDefaultVaue;
26
29
  }
27
30
 
28
31
  exports.useThemeClassName = useThemeClassName;
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeClassNameContext/ThemeClassNameContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAIA;;;;;AAKG;;;AACH,MAAM,qBAAqB,gBAAG,KAAK,CAAC,aAAN,CAAgD,EAAhD,CAA9B;AAEa,OAAA,CAAA,sBAAA,GAAyB,qBAAqB,CAAC,QAA/C;AAEb;;;AAGG;;AACH,SAAgB,iBAAhB,GAAiC;EAC/B,OAAO,KAAK,CAAC,UAAN,CAAiB,qBAAjB,CAAP;AACD;;AAFD,OAAA,CAAA,iBAAA,GAAA,iBAAA","sourcesContent":["import * as React from 'react';\n\nexport type ThemeClassNameContextValue = string;\n\n/**\n * @internal\n * Used to provide a CSS class that applies theme css variables\n *\n * Useful for elements in the React tree (can read context) but not in the DOM Tree. E.g. Portals\n */\nconst ThemeClassNameContext = React.createContext<ThemeClassNameContextValue>('');\n\nexport const ThemeClassNameProvider = ThemeClassNameContext.Provider;\n\n/**\n * @internal\n * @returns CSS class that applies css variables\n */\nexport function useThemeClassName(): ThemeClassNameContextValue {\n return React.useContext(ThemeClassNameContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["ThemeClassNameContext/ThemeClassNameContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAIA;;;;;AAKG;;;AACH,MAAM,qBAAqB,gBAAG,KAAK,CAAC,aAAN,CAC5B,SAD4B,CAA9B;AAIA,MAAM,gCAAgC,GAAG,EAAzC;AAEa,OAAA,CAAA,sBAAA,GAAyB,qBAAqB,CAAC,QAA/C;AAEb;;;AAGG;;AACH,SAAgB,iBAAhB,GAAiC;;;EAC/B,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,qBAAjB,CAAA,MAAuC,IAAvC,IAAuC,EAAA,KAAA,KAAA,CAAvC,GAAuC,EAAvC,GAA2C,gCAAlD;AACD;;AAFD,OAAA,CAAA,iBAAA,GAAA,iBAAA","sourcesContent":["import * as React from 'react';\n\nexport type ThemeClassNameContextValue = string;\n\n/**\n * @internal\n * Used to provide a CSS class that applies theme css variables\n *\n * Useful for elements in the React tree (can read context) but not in the DOM Tree. E.g. Portals\n */\nconst ThemeClassNameContext = React.createContext<ThemeClassNameContextValue | undefined>(\n undefined,\n) as React.Context<ThemeClassNameContextValue>;\n\nconst themeClassNameContextDefaultVaue = '';\n\nexport const ThemeClassNameProvider = ThemeClassNameContext.Provider;\n\n/**\n * @internal\n * @returns CSS class that applies css variables\n */\nexport function useThemeClassName(): ThemeClassNameContextValue {\n return React.useContext(ThemeClassNameContext) ?? themeClassNameContextDefaultVaue;\n}\n"],"sourceRoot":"../src/"}
@@ -12,7 +12,8 @@ const React = /*#__PURE__*/require("react");
12
12
  */
13
13
 
14
14
 
15
- const TooltipVisibilityContext = /*#__PURE__*/React.createContext({});
15
+ const TooltipVisibilityContext = /*#__PURE__*/React.createContext(undefined);
16
+ const tooltipVisibilityContextDefaultValue = {};
16
17
  /**
17
18
  * @internal
18
19
  */
@@ -23,7 +24,9 @@ exports.TooltipVisibilityProvider = TooltipVisibilityContext.Provider;
23
24
  */
24
25
 
25
26
  function useTooltipVisibility() {
26
- return React.useContext(TooltipVisibilityContext);
27
+ var _a;
28
+
29
+ return (_a = React.useContext(TooltipVisibilityContext)) !== null && _a !== void 0 ? _a : tooltipVisibilityContextDefaultValue;
27
30
  }
28
31
 
29
32
  exports.useTooltipVisibility = useTooltipVisibility;
@@ -1 +1 @@
1
- {"version":3,"sources":["TooltipVisibilityContext/TooltipContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAgBA;;;AAGG;;;AACH,MAAM,wBAAwB,gBAAG,KAAK,CAAC,aAAN,CAAmD,EAAnD,CAAjC;AAEA;;AAEG;;AACU,OAAA,CAAA,yBAAA,GAA4B,wBAAwB,CAAC,QAArD;AAEb;;AAEG;;AACH,SAAgB,oBAAhB,GAAoC;EAClC,OAAO,KAAK,CAAC,UAAN,CAAiB,wBAAjB,CAAP;AACD;;AAFD,OAAA,CAAA,oBAAA,GAAA,oBAAA","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * The context provided by TooltipProvider\n */\nexport type TooltipVisibilityContextValue = {\n /**\n * When a tooltip is shown, it sets itself as the visibleTooltip.\n * The next tooltip to become visible can use it to hide the previous tooltip immediately.\n */\n visibleTooltip?: {\n hide: () => void;\n };\n};\n\n/**\n * @internal\n * Context shared by all of the tooltips in the app\n */\nconst TooltipVisibilityContext = React.createContext<TooltipVisibilityContextValue>({});\n\n/**\n * @internal\n */\nexport const TooltipVisibilityProvider = TooltipVisibilityContext.Provider;\n\n/**\n * @internal\n */\nexport function useTooltipVisibility(): TooltipVisibilityContextValue {\n return React.useContext(TooltipVisibilityContext);\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["TooltipVisibilityContext/TooltipContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAgBA;;;AAGG;;;AACH,MAAM,wBAAwB,gBAAG,KAAK,CAAC,aAAN,CAC/B,SAD+B,CAAjC;AAIA,MAAM,oCAAoC,GAAkC,EAA5E;AAEA;;AAEG;;AACU,OAAA,CAAA,yBAAA,GAA4B,wBAAwB,CAAC,QAArD;AAEb;;AAEG;;AACH,SAAgB,oBAAhB,GAAoC;;;EAClC,OAAO,CAAA,EAAA,GAAA,KAAK,CAAC,UAAN,CAAiB,wBAAjB,CAAA,MAA0C,IAA1C,IAA0C,EAAA,KAAA,KAAA,CAA1C,GAA0C,EAA1C,GAA8C,oCAArD;AACD;;AAFD,OAAA,CAAA,oBAAA,GAAA,oBAAA","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * The context provided by TooltipProvider\n */\nexport type TooltipVisibilityContextValue = {\n /**\n * When a tooltip is shown, it sets itself as the visibleTooltip.\n * The next tooltip to become visible can use it to hide the previous tooltip immediately.\n */\n visibleTooltip?: {\n hide: () => void;\n };\n};\n\n/**\n * @internal\n * Context shared by all of the tooltips in the app\n */\nconst TooltipVisibilityContext = React.createContext<TooltipVisibilityContextValue | undefined>(\n undefined,\n) as React.Context<TooltipVisibilityContextValue>;\n\nconst tooltipVisibilityContextDefaultValue: TooltipVisibilityContextValue = {};\n\n/**\n * @internal\n */\nexport const TooltipVisibilityProvider = TooltipVisibilityContext.Provider;\n\n/**\n * @internal\n */\nexport function useTooltipVisibility(): TooltipVisibilityContextValue {\n return React.useContext(TooltipVisibilityContext) ?? tooltipVisibilityContextDefaultValue;\n}\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-shared-contexts",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "Fluent UI React Contexts shared by multiple components.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,7 +27,7 @@
27
27
  "@fluentui/scripts": "^1.0.0"
28
28
  },
29
29
  "dependencies": {
30
- "@fluentui/react-theme": "^9.0.0",
30
+ "@fluentui/react-theme": "^9.1.0",
31
31
  "tslib": "^2.1.0"
32
32
  },
33
33
  "peerDependencies": {
@@ -36,7 +36,8 @@
36
36
  },
37
37
  "beachball": {
38
38
  "disallowedChangeTypes": [
39
- "major"
39
+ "major",
40
+ "prerelease"
40
41
  ]
41
42
  },
42
43
  "exports": {
@@ -1,11 +0,0 @@
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
- }