@fluentui/react-context-selector 0.0.0-nightlyff78d1e27a20220217.1 → 0.0.0

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,22 +2,223 @@
2
2
  "name": "@fluentui/react-context-selector",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 17 Feb 2022 11:41:18 GMT",
6
- "tag": "@fluentui/react-context-selector_v0.0.0-nightlyff78d1e27a20220217.1",
7
- "version": "0.0.0-nightlyff78d1e27a20220217.1",
5
+ "date": "Tue, 28 Jun 2022 04:30:52 GMT",
6
+ "tag": "@fluentui/react-context-selector_v0.0.0",
7
+ "version": "0.0.0",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
- "author": "email not defined",
11
+ "author": "lingfangao@hotmail.com",
12
+ "package": "@fluentui/react-context-selector",
13
+ "commit": "2da4428ae7d6e464c538b7ed10e425ce0e531144",
14
+ "comment": "chore: Mark teams-prg owned APIs with @internal"
15
+ },
16
+ {
17
+ "author": "lingfangao@hotmail.com",
18
+ "package": "@fluentui/react-context-selector",
19
+ "commit": "e0aabd850b15adf9c151ebd4e332f7c50ad6cfdf",
20
+ "comment": "Update 9.0.0-rc dependencies to use caret range"
21
+ }
22
+ ],
23
+ "patch": [
24
+ {
25
+ "author": "lingfangao@hotmail.com",
26
+ "package": "@fluentui/react-context-selector",
27
+ "commit": "c7b1348bdad7aa883c29bfbc96ef2a32e6ebc7dd",
28
+ "comment": "feat: Initial 9.0.0 release"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-context-selector",
33
+ "comment": "Bump @fluentui/react-utilities to v0.0.0",
34
+ "commit": "3dd54b72d321c3345a21b4175ffe89e7c457c094"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "date": "Tue, 31 May 2022 21:28:50 GMT",
41
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.10",
42
+ "version": "9.0.0-rc.10",
43
+ "comments": {
44
+ "prerelease": [
45
+ {
46
+ "author": "beachball",
47
+ "package": "@fluentui/react-context-selector",
48
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.10",
49
+ "commit": "335ebfcfd47005003901b5e319782bfe9ccd89fd"
50
+ }
51
+ ]
52
+ }
53
+ },
54
+ {
55
+ "date": "Thu, 26 May 2022 21:01:25 GMT",
56
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.9",
57
+ "version": "9.0.0-rc.9",
58
+ "comments": {
59
+ "none": [
60
+ {
61
+ "author": "lingfangao@hotmail.com",
62
+ "package": "@fluentui/react-context-selector",
63
+ "commit": "fff6a012b8a3b165b364ef2c412b9edee0bc05a9",
64
+ "comment": "Add eslint ignore for context export"
65
+ }
66
+ ]
67
+ }
68
+ },
69
+ {
70
+ "date": "Mon, 23 May 2022 12:14:24 GMT",
71
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.9",
72
+ "version": "9.0.0-rc.9",
73
+ "comments": {
74
+ "prerelease": [
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-context-selector",
78
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.9",
79
+ "commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
80
+ }
81
+ ]
82
+ }
83
+ },
84
+ {
85
+ "date": "Thu, 05 May 2022 18:26:23 GMT",
86
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.8",
87
+ "version": "9.0.0-rc.8",
88
+ "comments": {
89
+ "prerelease": [
90
+ {
91
+ "author": "martinhochel@microsoft.com",
92
+ "package": "@fluentui/react-context-selector",
93
+ "commit": "e465622ca241f3dd0534da50823a51e7311fd9ef",
94
+ "comment": "feat: ship rolluped only dts"
95
+ },
96
+ {
97
+ "author": "humberto_makoto@hotmail.com",
98
+ "package": "@fluentui/react-context-selector",
99
+ "commit": "982f68bd9b216ed71dc5e4fb7e77b56e73a8a468",
100
+ "comment": "Removing star exports."
101
+ },
102
+ {
103
+ "author": "beachball",
104
+ "package": "@fluentui/react-context-selector",
105
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.8",
106
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ {
112
+ "date": "Wed, 04 May 2022 13:26:42 GMT",
113
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.7",
114
+ "version": "9.0.0-rc.7",
115
+ "comments": {
116
+ "none": [
117
+ {
118
+ "author": "tristan.watanabe@gmail.com",
119
+ "package": "@fluentui/react-context-selector",
120
+ "commit": "8997f88bdd280b6831338d6c231b387fd554046e",
121
+ "comment": "react-context-selector: Move to new common folder."
122
+ }
123
+ ],
124
+ "prerelease": [
125
+ {
126
+ "author": "beachball",
127
+ "package": "@fluentui/react-context-selector",
128
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.7",
129
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
130
+ }
131
+ ]
132
+ }
133
+ },
134
+ {
135
+ "date": "Tue, 19 Apr 2022 19:17:22 GMT",
136
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.6",
137
+ "version": "9.0.0-rc.6",
138
+ "comments": {
139
+ "none": [
140
+ {
141
+ "author": "elcraig@microsoft.com",
142
+ "package": "@fluentui/react-context-selector",
143
+ "commit": "b48c03cff249019cf845af18a7f63dacf46d5218",
144
+ "comment": "Hoist react-is devDependencies to the repo root"
145
+ },
146
+ {
147
+ "author": "mgodbolt@microsoft.com",
148
+ "package": "@fluentui/react-context-selector",
149
+ "commit": "905e46db07ada986fd7885531f72a71b7bbaabdc",
150
+ "comment": "create v9 api extractor config and set all v9 packags to use it, suppress forgotten export"
151
+ }
152
+ ],
153
+ "prerelease": [
154
+ {
155
+ "author": "elcraig@microsoft.com",
156
+ "package": "@fluentui/react-context-selector",
157
+ "commit": "b7f17e976f9e058f39c9fce4f0f9bb6eb4dfa577",
158
+ "comment": "Move `scheduler` to a peer dependency and allow appropriate versions for React 16 or 17"
159
+ },
160
+ {
161
+ "author": "beachball",
162
+ "package": "@fluentui/react-context-selector",
163
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.6",
164
+ "commit": "f94b48c825ca8c8b2e3b6755bdd29fe15c7d435d"
165
+ }
166
+ ]
167
+ }
168
+ },
169
+ {
170
+ "date": "Fri, 04 Mar 2022 05:17:36 GMT",
171
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.5",
172
+ "version": "9.0.0-rc.5",
173
+ "comments": {
174
+ "prerelease": [
175
+ {
176
+ "author": "dzearing@microsoft.com",
177
+ "package": "@fluentui/react-context-selector",
178
+ "commit": "f2f1c0ea948cc3517eeb442c05433eb0918def29",
179
+ "comment": "Adding explicit export maps on all consumer packages for FUIR 8 and 9."
180
+ },
181
+ {
182
+ "author": "beachball",
183
+ "package": "@fluentui/react-context-selector",
184
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.5",
185
+ "commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
186
+ }
187
+ ]
188
+ }
189
+ },
190
+ {
191
+ "date": "Tue, 01 Mar 2022 02:17:40 GMT",
192
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.4",
193
+ "version": "9.0.0-rc.4",
194
+ "comments": {
195
+ "prerelease": [
196
+ {
197
+ "author": "beachball",
198
+ "package": "@fluentui/react-context-selector",
199
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.4",
200
+ "commit": "0bc1e755543ed69443d5d03e1976c630583242f7"
201
+ }
202
+ ]
203
+ }
204
+ },
205
+ {
206
+ "date": "Fri, 18 Feb 2022 13:35:31 GMT",
207
+ "tag": "@fluentui/react-context-selector_v9.0.0-rc.3",
208
+ "version": "9.0.0-rc.3",
209
+ "comments": {
210
+ "prerelease": [
211
+ {
212
+ "author": "lingfangao@hotmail.com",
12
213
  "package": "@fluentui/react-context-selector",
13
- "commit": "966e16625ca79f990ad8ca408ba47857adc522b3",
14
- "comment": "Release nightly v9"
214
+ "commit": "1aa9e691fcccd9a64168cea7941c0f1e71fa1d14",
215
+ "comment": "fix: Source maps contain original source code"
15
216
  },
16
217
  {
17
218
  "author": "beachball",
18
219
  "package": "@fluentui/react-context-selector",
19
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyff78d1e27a20220217.1",
20
- "commit": "966e16625ca79f990ad8ca408ba47857adc522b3"
220
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.3",
221
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
21
222
  }
22
223
  ]
23
224
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,104 @@
1
1
  # Change Log - @fluentui/react-context-selector
2
2
 
3
- This log was last generated on Thu, 17 Feb 2022 11:41:18 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 28 Jun 2022 04:30:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightlyff78d1e27a20220217.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.0.0-nightlyff78d1e27a20220217.1)
7
+ ## [0.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.0.0)
8
8
 
9
- Thu, 17 Feb 2022 11:41:18 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.1..@fluentui/react-context-selector_v0.0.0-nightlyff78d1e27a20220217.1)
9
+ Tue, 28 Jun 2022 04:30:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.10..@fluentui/react-context-selector_v0.0.0)
11
+
12
+ ### Patches
13
+
14
+ - feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
15
+ - Bump @fluentui/react-utilities to v0.0.0 ([commit](https://github.com/microsoft/fluentui/commit/3dd54b72d321c3345a21b4175ffe89e7c457c094) by beachball)
16
+
17
+ ### Changes
18
+
19
+ - chore: Mark teams-prg owned APIs with @internal ([PR #23689](https://github.com/microsoft/fluentui/pull/23689) by lingfangao@hotmail.com)
20
+ - Update 9.0.0-rc dependencies to use caret range ([PR #23732](https://github.com/microsoft/fluentui/pull/23732) by lingfangao@hotmail.com)
21
+
22
+ ## [9.0.0-rc.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.10)
23
+
24
+ Tue, 31 May 2022 21:28:50 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.9..@fluentui/react-context-selector_v9.0.0-rc.10)
26
+
27
+ ### Changes
28
+
29
+ - Bump @fluentui/react-utilities to v9.0.0-rc.10 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
30
+
31
+ ## [9.0.0-rc.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.9)
32
+
33
+ Mon, 23 May 2022 12:14:24 GMT
34
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.8..@fluentui/react-context-selector_v9.0.0-rc.9)
35
+
36
+ ### Changes
37
+
38
+ - Bump @fluentui/react-utilities to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
39
+
40
+ ## [9.0.0-rc.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.8)
41
+
42
+ Thu, 05 May 2022 18:26:23 GMT
43
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.7..@fluentui/react-context-selector_v9.0.0-rc.8)
44
+
45
+ ### Changes
46
+
47
+ - feat: ship rolluped only dts ([PR #22823](https://github.com/microsoft/fluentui/pull/22823) by martinhochel@microsoft.com)
48
+ - Removing star exports. ([PR #22801](https://github.com/microsoft/fluentui/pull/22801) by humberto_makoto@hotmail.com)
49
+ - Bump @fluentui/react-utilities to v9.0.0-rc.8 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
50
+
51
+ ## [9.0.0-rc.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.7)
52
+
53
+ Wed, 04 May 2022 13:26:42 GMT
54
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.6..@fluentui/react-context-selector_v9.0.0-rc.7)
55
+
56
+ ### Changes
57
+
58
+ - Bump @fluentui/react-utilities to v9.0.0-rc.7 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
59
+
60
+ ## [9.0.0-rc.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.6)
61
+
62
+ Tue, 19 Apr 2022 19:17:22 GMT
63
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.5..@fluentui/react-context-selector_v9.0.0-rc.6)
64
+
65
+ ### Changes
66
+
67
+ - Move `scheduler` to a peer dependency and allow appropriate versions for React 16 or 17 ([PR #21769](https://github.com/microsoft/fluentui/pull/21769) by elcraig@microsoft.com)
68
+ - Bump @fluentui/react-utilities to v9.0.0-rc.6 ([PR #21995](https://github.com/microsoft/fluentui/pull/21995) by beachball)
69
+
70
+ ## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.5)
71
+
72
+ Fri, 04 Mar 2022 05:17:36 GMT
73
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.4..@fluentui/react-context-selector_v9.0.0-rc.5)
74
+
75
+ ### Changes
76
+
77
+ - Adding explicit export maps on all consumer packages for FUIR 8 and 9. ([PR #21508](https://github.com/microsoft/fluentui/pull/21508) by dzearing@microsoft.com)
78
+ - Bump @fluentui/react-utilities to v9.0.0-rc.5 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
79
+
80
+ ## [9.0.0-rc.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.4)
81
+
82
+ Tue, 01 Mar 2022 02:17:40 GMT
83
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.3..@fluentui/react-context-selector_v9.0.0-rc.4)
84
+
85
+ ### Changes
86
+
87
+ - Bump @fluentui/react-utilities to v9.0.0-rc.4 ([PR #21884](https://github.com/microsoft/fluentui/pull/21884) by beachball)
88
+
89
+ ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.3)
90
+
91
+ Fri, 18 Feb 2022 13:35:31 GMT
92
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-rc.1..@fluentui/react-context-selector_v9.0.0-rc.3)
11
93
 
12
94
  ### Changes
13
95
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/966e16625ca79f990ad8ca408ba47857adc522b3) by email not defined)
15
- - Bump @fluentui/react-utilities to v0.0.0-nightlyff78d1e27a20220217.1 ([commit](https://github.com/microsoft/fluentui/commit/966e16625ca79f990ad8ca408ba47857adc522b3) by beachball)
96
+ - fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
97
+ - Bump @fluentui/react-utilities to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
16
98
 
17
99
  ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-rc.1)
18
100
 
19
- Thu, 10 Feb 2022 08:51:09 GMT
101
+ Thu, 10 Feb 2022 08:51:09 GMT
20
102
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-beta.4..@fluentui/react-context-selector_v9.0.0-rc.1)
21
103
 
22
104
  ### Changes
@@ -27,7 +109,7 @@ Thu, 10 Feb 2022 08:51:09 GMT
27
109
 
28
110
  ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-beta.4)
29
111
 
30
- Thu, 25 Nov 2021 08:34:13 GMT
112
+ Thu, 25 Nov 2021 08:34:13 GMT
31
113
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-beta.3..@fluentui/react-context-selector_v9.0.0-beta.4)
32
114
 
33
115
  ### Changes
@@ -36,7 +118,7 @@ Thu, 25 Nov 2021 08:34:13 GMT
36
118
 
37
119
  ## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-beta.3)
38
120
 
39
- Fri, 12 Nov 2021 13:25:22 GMT
121
+ Fri, 12 Nov 2021 13:25:22 GMT
40
122
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-beta.2..@fluentui/react-context-selector_v9.0.0-beta.3)
41
123
 
42
124
  ### Changes
@@ -46,7 +128,7 @@ Fri, 12 Nov 2021 13:25:22 GMT
46
128
 
47
129
  ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-beta.2)
48
130
 
49
- Wed, 27 Oct 2021 12:14:24 GMT
131
+ Wed, 27 Oct 2021 12:14:24 GMT
50
132
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-beta.1..@fluentui/react-context-selector_v9.0.0-beta.2)
51
133
 
52
134
  ### Changes
@@ -55,7 +137,7 @@ Wed, 27 Oct 2021 12:14:24 GMT
55
137
 
56
138
  ## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-beta.1)
57
139
 
58
- Wed, 06 Oct 2021 10:37:22 GMT
140
+ Wed, 06 Oct 2021 10:37:22 GMT
59
141
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.39..@fluentui/react-context-selector_v9.0.0-beta.1)
60
142
 
61
143
  ### Changes
@@ -65,7 +147,7 @@ Wed, 06 Oct 2021 10:37:22 GMT
65
147
 
66
148
  ## [9.0.0-alpha.39](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.39)
67
149
 
68
- Tue, 05 Oct 2021 09:28:07 GMT
150
+ Tue, 05 Oct 2021 09:28:07 GMT
69
151
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.38..@fluentui/react-context-selector_v9.0.0-alpha.39)
70
152
 
71
153
  ### Changes
@@ -74,7 +156,7 @@ Tue, 05 Oct 2021 09:28:07 GMT
74
156
 
75
157
  ## [9.0.0-alpha.38](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.38)
76
158
 
77
- Fri, 01 Oct 2021 14:13:08 GMT
159
+ Fri, 01 Oct 2021 14:13:08 GMT
78
160
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.36..@fluentui/react-context-selector_v9.0.0-alpha.38)
79
161
 
80
162
  ### Changes
@@ -84,7 +166,7 @@ Fri, 01 Oct 2021 14:13:08 GMT
84
166
 
85
167
  ## [9.0.0-alpha.36](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.36)
86
168
 
87
- Mon, 27 Sep 2021 08:06:00 GMT
169
+ Mon, 27 Sep 2021 08:06:00 GMT
88
170
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.35..@fluentui/react-context-selector_v9.0.0-alpha.36)
89
171
 
90
172
  ### Changes
@@ -93,7 +175,7 @@ Mon, 27 Sep 2021 08:06:00 GMT
93
175
 
94
176
  ## [9.0.0-alpha.35](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.35)
95
177
 
96
- Fri, 24 Sep 2021 09:17:17 GMT
178
+ Fri, 24 Sep 2021 09:17:17 GMT
97
179
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.34..@fluentui/react-context-selector_v9.0.0-alpha.35)
98
180
 
99
181
  ### Changes
@@ -102,7 +184,7 @@ Fri, 24 Sep 2021 09:17:17 GMT
102
184
 
103
185
  ## [9.0.0-alpha.34](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.34)
104
186
 
105
- Thu, 23 Sep 2021 08:21:34 GMT
187
+ Thu, 23 Sep 2021 08:21:34 GMT
106
188
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.33..@fluentui/react-context-selector_v9.0.0-alpha.34)
107
189
 
108
190
  ### Changes
@@ -111,7 +193,7 @@ Thu, 23 Sep 2021 08:21:34 GMT
111
193
 
112
194
  ## [9.0.0-alpha.33](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.33)
113
195
 
114
- Wed, 22 Sep 2021 10:10:07 GMT
196
+ Wed, 22 Sep 2021 10:10:07 GMT
115
197
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.32..@fluentui/react-context-selector_v9.0.0-alpha.33)
116
198
 
117
199
  ### Changes
@@ -120,7 +202,7 @@ Wed, 22 Sep 2021 10:10:07 GMT
120
202
 
121
203
  ## [9.0.0-alpha.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.32)
122
204
 
123
- Fri, 17 Sep 2021 07:35:26 GMT
205
+ Fri, 17 Sep 2021 07:35:26 GMT
124
206
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.31..@fluentui/react-context-selector_v9.0.0-alpha.32)
125
207
 
126
208
  ### Changes
@@ -129,7 +211,7 @@ Fri, 17 Sep 2021 07:35:26 GMT
129
211
 
130
212
  ## [9.0.0-alpha.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.31)
131
213
 
132
- Thu, 16 Sep 2021 07:38:39 GMT
214
+ Thu, 16 Sep 2021 07:38:39 GMT
133
215
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.30..@fluentui/react-context-selector_v9.0.0-alpha.31)
134
216
 
135
217
  ### Changes
@@ -138,7 +220,7 @@ Thu, 16 Sep 2021 07:38:39 GMT
138
220
 
139
221
  ## [9.0.0-alpha.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.30)
140
222
 
141
- Tue, 14 Sep 2021 20:09:02 GMT
223
+ Tue, 14 Sep 2021 20:09:02 GMT
142
224
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.29..@fluentui/react-context-selector_v9.0.0-alpha.30)
143
225
 
144
226
  ### Changes
@@ -147,7 +229,7 @@ Tue, 14 Sep 2021 20:09:02 GMT
147
229
 
148
230
  ## [9.0.0-alpha.29](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.29)
149
231
 
150
- Fri, 10 Sep 2021 16:31:53 GMT
232
+ Fri, 10 Sep 2021 16:31:53 GMT
151
233
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.28..@fluentui/react-context-selector_v9.0.0-alpha.29)
152
234
 
153
235
  ### Changes
@@ -157,7 +239,7 @@ Fri, 10 Sep 2021 16:31:53 GMT
157
239
 
158
240
  ## [9.0.0-alpha.28](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.28)
159
241
 
160
- Fri, 10 Sep 2021 07:39:51 GMT
242
+ Fri, 10 Sep 2021 07:39:51 GMT
161
243
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.27..@fluentui/react-context-selector_v9.0.0-alpha.28)
162
244
 
163
245
  ### Changes
@@ -166,7 +248,7 @@ Fri, 10 Sep 2021 07:39:51 GMT
166
248
 
167
249
  ## [9.0.0-alpha.27](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.27)
168
250
 
169
- Mon, 06 Sep 2021 07:34:53 GMT
251
+ Mon, 06 Sep 2021 07:34:53 GMT
170
252
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.26..@fluentui/react-context-selector_v9.0.0-alpha.27)
171
253
 
172
254
  ### Changes
@@ -175,7 +257,7 @@ Mon, 06 Sep 2021 07:34:53 GMT
175
257
 
176
258
  ## [9.0.0-alpha.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.26)
177
259
 
178
- Wed, 01 Sep 2021 07:39:56 GMT
260
+ Wed, 01 Sep 2021 07:39:56 GMT
179
261
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.25..@fluentui/react-context-selector_v9.0.0-alpha.26)
180
262
 
181
263
  ### Changes
@@ -184,7 +266,7 @@ Wed, 01 Sep 2021 07:39:56 GMT
184
266
 
185
267
  ## [9.0.0-alpha.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.25)
186
268
 
187
- Tue, 31 Aug 2021 07:37:47 GMT
269
+ Tue, 31 Aug 2021 07:37:47 GMT
188
270
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.24..@fluentui/react-context-selector_v9.0.0-alpha.25)
189
271
 
190
272
  ### Changes
@@ -193,7 +275,7 @@ Tue, 31 Aug 2021 07:37:47 GMT
193
275
 
194
276
  ## [9.0.0-alpha.24](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.24)
195
277
 
196
- Fri, 20 Aug 2021 07:37:28 GMT
278
+ Fri, 20 Aug 2021 07:37:28 GMT
197
279
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.23..@fluentui/react-context-selector_v9.0.0-alpha.24)
198
280
 
199
281
  ### Changes
@@ -202,7 +284,7 @@ Fri, 20 Aug 2021 07:37:28 GMT
202
284
 
203
285
  ## [9.0.0-alpha.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.23)
204
286
 
205
- Thu, 19 Aug 2021 07:41:35 GMT
287
+ Thu, 19 Aug 2021 07:41:35 GMT
206
288
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.22..@fluentui/react-context-selector_v9.0.0-alpha.23)
207
289
 
208
290
  ### Changes
@@ -211,7 +293,7 @@ Thu, 19 Aug 2021 07:41:35 GMT
211
293
 
212
294
  ## [9.0.0-alpha.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.22)
213
295
 
214
- Fri, 06 Aug 2021 07:35:14 GMT
296
+ Fri, 06 Aug 2021 07:35:14 GMT
215
297
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.21..@fluentui/react-context-selector_v9.0.0-alpha.22)
216
298
 
217
299
  ### Changes
@@ -220,7 +302,7 @@ Fri, 06 Aug 2021 07:35:14 GMT
220
302
 
221
303
  ## [9.0.0-alpha.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.21)
222
304
 
223
- Tue, 03 Aug 2021 07:39:30 GMT
305
+ Tue, 03 Aug 2021 07:39:30 GMT
224
306
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.20..@fluentui/react-context-selector_v9.0.0-alpha.21)
225
307
 
226
308
  ### Patches
@@ -234,7 +316,7 @@ Tue, 03 Aug 2021 07:39:30 GMT
234
316
 
235
317
  ## [9.0.0-alpha.20](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.20)
236
318
 
237
- Mon, 02 Aug 2021 07:36:20 GMT
319
+ Mon, 02 Aug 2021 07:36:20 GMT
238
320
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.19..@fluentui/react-context-selector_v9.0.0-alpha.20)
239
321
 
240
322
  ### Changes
@@ -243,7 +325,7 @@ Mon, 02 Aug 2021 07:36:20 GMT
243
325
 
244
326
  ## [9.0.0-alpha.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.19)
245
327
 
246
- Fri, 23 Jul 2021 07:38:19 GMT
328
+ Fri, 23 Jul 2021 07:38:19 GMT
247
329
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.18..@fluentui/react-context-selector_v9.0.0-alpha.19)
248
330
 
249
331
  ### Changes
@@ -252,7 +334,7 @@ Fri, 23 Jul 2021 07:38:19 GMT
252
334
 
253
335
  ## [9.0.0-alpha.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.18)
254
336
 
255
- Thu, 22 Jul 2021 07:36:55 GMT
337
+ Thu, 22 Jul 2021 07:36:55 GMT
256
338
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.17..@fluentui/react-context-selector_v9.0.0-alpha.18)
257
339
 
258
340
  ### Changes
@@ -261,7 +343,7 @@ Thu, 22 Jul 2021 07:36:55 GMT
261
343
 
262
344
  ## [9.0.0-alpha.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.17)
263
345
 
264
- Thu, 15 Jul 2021 07:36:18 GMT
346
+ Thu, 15 Jul 2021 07:36:18 GMT
265
347
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.16..@fluentui/react-context-selector_v9.0.0-alpha.17)
266
348
 
267
349
  ### Changes
@@ -270,7 +352,7 @@ Thu, 15 Jul 2021 07:36:18 GMT
270
352
 
271
353
  ## [9.0.0-alpha.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.16)
272
354
 
273
- Fri, 09 Jul 2021 07:39:31 GMT
355
+ Fri, 09 Jul 2021 07:39:31 GMT
274
356
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.15..@fluentui/react-context-selector_v9.0.0-alpha.16)
275
357
 
276
358
  ### Patches
@@ -284,7 +366,7 @@ Fri, 09 Jul 2021 07:39:31 GMT
284
366
 
285
367
  ## [9.0.0-alpha.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.15)
286
368
 
287
- Fri, 02 Jul 2021 23:15:55 GMT
369
+ Fri, 02 Jul 2021 23:15:55 GMT
288
370
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.14..@fluentui/react-context-selector_v9.0.0-alpha.15)
289
371
 
290
372
  ### Changes
@@ -293,7 +375,7 @@ Fri, 02 Jul 2021 23:15:55 GMT
293
375
 
294
376
  ## [9.0.0-alpha.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.14)
295
377
 
296
- Fri, 02 Jul 2021 07:37:06 GMT
378
+ Fri, 02 Jul 2021 07:37:06 GMT
297
379
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.13..@fluentui/react-context-selector_v9.0.0-alpha.14)
298
380
 
299
381
  ### Changes
@@ -302,7 +384,7 @@ Fri, 02 Jul 2021 07:37:06 GMT
302
384
 
303
385
  ## [9.0.0-alpha.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.13)
304
386
 
305
- Tue, 15 Jun 2021 07:40:20 GMT
387
+ Tue, 15 Jun 2021 07:40:20 GMT
306
388
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.12..@fluentui/react-context-selector_v9.0.0-alpha.13)
307
389
 
308
390
  ### Changes
@@ -311,7 +393,7 @@ Tue, 15 Jun 2021 07:40:20 GMT
311
393
 
312
394
  ## [9.0.0-alpha.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.12)
313
395
 
314
- Mon, 07 Jun 2021 07:38:15 GMT
396
+ Mon, 07 Jun 2021 07:38:15 GMT
315
397
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.11..@fluentui/react-context-selector_v9.0.0-alpha.12)
316
398
 
317
399
  ### Patches
@@ -325,7 +407,7 @@ Mon, 07 Jun 2021 07:38:15 GMT
325
407
 
326
408
  ## [9.0.0-alpha.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.11)
327
409
 
328
- Fri, 04 Jun 2021 07:37:23 GMT
410
+ Fri, 04 Jun 2021 07:37:23 GMT
329
411
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.10..@fluentui/react-context-selector_v9.0.0-alpha.11)
330
412
 
331
413
  ### Changes
@@ -334,7 +416,7 @@ Fri, 04 Jun 2021 07:37:23 GMT
334
416
 
335
417
  ## [9.0.0-alpha.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.10)
336
418
 
337
- Wed, 26 May 2021 07:35:43 GMT
419
+ Wed, 26 May 2021 07:35:43 GMT
338
420
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.9..@fluentui/react-context-selector_v9.0.0-alpha.10)
339
421
 
340
422
  ### Changes
@@ -343,7 +425,7 @@ Wed, 26 May 2021 07:35:43 GMT
343
425
 
344
426
  ## [9.0.0-alpha.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.9)
345
427
 
346
- Fri, 21 May 2021 07:34:54 GMT
428
+ Fri, 21 May 2021 07:34:54 GMT
347
429
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.8..@fluentui/react-context-selector_v9.0.0-alpha.9)
348
430
 
349
431
  ### Changes
@@ -352,7 +434,7 @@ Fri, 21 May 2021 07:34:54 GMT
352
434
 
353
435
  ## [9.0.0-alpha.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.8)
354
436
 
355
- Thu, 20 May 2021 07:41:54 GMT
437
+ Thu, 20 May 2021 07:41:54 GMT
356
438
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.7..@fluentui/react-context-selector_v9.0.0-alpha.8)
357
439
 
358
440
  ### Patches
@@ -366,7 +448,7 @@ Thu, 20 May 2021 07:41:54 GMT
366
448
 
367
449
  ## [9.0.0-alpha.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.7)
368
450
 
369
- Wed, 19 May 2021 07:34:20 GMT
451
+ Wed, 19 May 2021 07:34:20 GMT
370
452
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.6..@fluentui/react-context-selector_v9.0.0-alpha.7)
371
453
 
372
454
  ### Changes
@@ -375,7 +457,7 @@ Wed, 19 May 2021 07:34:20 GMT
375
457
 
376
458
  ## [9.0.0-alpha.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.6)
377
459
 
378
- Mon, 03 May 2021 07:45:19 GMT
460
+ Mon, 03 May 2021 07:45:19 GMT
379
461
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.5..@fluentui/react-context-selector_v9.0.0-alpha.6)
380
462
 
381
463
  ### Changes
@@ -384,7 +466,7 @@ Mon, 03 May 2021 07:45:19 GMT
384
466
 
385
467
  ## [9.0.0-alpha.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.5)
386
468
 
387
- Fri, 30 Apr 2021 07:42:23 GMT
469
+ Fri, 30 Apr 2021 07:42:23 GMT
388
470
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.4..@fluentui/react-context-selector_v9.0.0-alpha.5)
389
471
 
390
472
  ### Patches
@@ -398,7 +480,7 @@ Fri, 30 Apr 2021 07:42:23 GMT
398
480
 
399
481
  ## [9.0.0-alpha.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.4)
400
482
 
401
- Fri, 23 Apr 2021 07:37:10 GMT
483
+ Fri, 23 Apr 2021 07:37:10 GMT
402
484
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.3..@fluentui/react-context-selector_v9.0.0-alpha.4)
403
485
 
404
486
  ### Patches
@@ -412,7 +494,7 @@ Fri, 23 Apr 2021 07:37:10 GMT
412
494
 
413
495
  ## [9.0.0-alpha.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.3)
414
496
 
415
- Thu, 22 Apr 2021 07:33:28 GMT
497
+ Thu, 22 Apr 2021 07:33:28 GMT
416
498
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.2..@fluentui/react-context-selector_v9.0.0-alpha.3)
417
499
 
418
500
  ### Changes
@@ -421,7 +503,7 @@ Thu, 22 Apr 2021 07:33:28 GMT
421
503
 
422
504
  ## [9.0.0-alpha.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.2)
423
505
 
424
- Wed, 31 Mar 2021 00:53:43 GMT
506
+ Wed, 31 Mar 2021 00:53:43 GMT
425
507
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.0.0-alpha.1..@fluentui/react-context-selector_v9.0.0-alpha.2)
426
508
 
427
509
  ### Patches
@@ -431,7 +513,7 @@ Wed, 31 Mar 2021 00:53:43 GMT
431
513
 
432
514
  ## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.0.0-alpha.1)
433
515
 
434
- Tue, 30 Mar 2021 07:34:45 GMT
516
+ Tue, 30 Mar 2021 07:34:45 GMT
435
517
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v0.53.4..@fluentui/react-context-selector_v9.0.0-alpha.1)
436
518
 
437
519
  ### Changes
@@ -441,7 +523,7 @@ Tue, 30 Mar 2021 07:34:45 GMT
441
523
 
442
524
  ## [0.53.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.53.4)
443
525
 
444
- Mon, 15 Mar 2021 07:36:20 GMT
526
+ Mon, 15 Mar 2021 07:36:20 GMT
445
527
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v0.53.3..@fluentui/react-context-selector_v0.53.4)
446
528
 
447
529
  ### Patches
@@ -450,7 +532,7 @@ Mon, 15 Mar 2021 07:36:20 GMT
450
532
 
451
533
  ## [0.53.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.53.3)
452
534
 
453
- Fri, 26 Feb 2021 01:16:27 GMT
535
+ Fri, 26 Feb 2021 01:16:27 GMT
454
536
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v0.53.2..@fluentui/react-context-selector_v0.53.3)
455
537
 
456
538
  ### Patches
@@ -459,7 +541,7 @@ Fri, 26 Feb 2021 01:16:27 GMT
459
541
 
460
542
  ## [0.53.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.53.2)
461
543
 
462
- Mon, 22 Feb 2021 12:26:22 GMT
544
+ Mon, 22 Feb 2021 12:26:22 GMT
463
545
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v0.53.0..@fluentui/react-context-selector_v0.53.2)
464
546
 
465
547
  ### Patches
@@ -1,12 +1,21 @@
1
1
  import * as React_2 from 'react';
2
2
 
3
+ /**
4
+ * @internal
5
+ */
3
6
  export declare type Context<Value> = React_2.Context<Value> & {
4
7
  Provider: React_2.FC<React_2.ProviderProps<Value>>;
5
8
  Consumer: never;
6
9
  };
7
10
 
11
+ /**
12
+ * @internal
13
+ */
8
14
  export declare type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;
9
15
 
16
+ /**
17
+ * @internal
18
+ */
10
19
  export declare type ContextValue<Value> = {
11
20
  /** Holds a set of subscribers from components. */
12
21
  listeners: ((payload: readonly [ContextVersion, Value]) => void)[];
@@ -16,16 +25,26 @@ export declare type ContextValue<Value> = {
16
25
  version: React_2.MutableRefObject<ContextVersion>;
17
26
  };
18
27
 
28
+ /**
29
+ * @internal
30
+ */
19
31
  export declare type ContextValues<Value> = ContextValue<Value> & {
20
32
  /** List of listners to publish changes */
21
33
  listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];
22
34
  };
23
35
 
36
+ /**
37
+ * @internal
38
+ */
24
39
  export declare type ContextVersion = number;
25
40
 
41
+ /**
42
+ * @internal
43
+ */
26
44
  export declare const createContext: <Value>(defaultValue: Value) => Context<Value>;
27
45
 
28
46
  /**
47
+ * @internal
29
48
  * This hook returns context selected value by selector.
30
49
  * It will only accept context created by `createContext`.
31
50
  * It will trigger re-render if only the selected value is referencially changed.
@@ -33,6 +52,7 @@ export declare const createContext: <Value>(defaultValue: Value) => Context<Valu
33
52
  export declare const useContextSelector: <Value, SelectedValue>(context: Context<Value>, selector: ContextSelector<Value, SelectedValue>) => SelectedValue;
34
53
 
35
54
  /**
55
+ * @internal
36
56
  * Utility hook for contexts created by react-context-selector to determine if a parent context exists
37
57
  * WARNING: This hook will not work for native React contexts
38
58
  *
File without changes
@@ -41,6 +41,10 @@ const createProvider = Original => {
41
41
 
42
42
  return Provider;
43
43
  };
44
+ /**
45
+ * @internal
46
+ */
47
+
44
48
 
45
49
  export const createContext = defaultValue => {
46
50
  const context = /*#__PURE__*/React.createContext({
@@ -1 +1 @@
1
- {"version":3,"sources":["createContext.ts"],"names":[],"mappings":"AAAA,SAAS,yBAAT,QAA0C,2BAA1C;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAuB,IAAI,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AACD;;AAED,SAAQ,QAAR;AACD,CAtCD;;AAwCA,OAAO,MAAM,aAAa,GAAW,YAAR,IAA+C;AAC1E,QAAM,OAAO,gBAAG,KAAK,CAAC,aAAN,CAAyC;AACvD,IAAA,KAAK,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KADgD;AAEvD,IAAA,OAAO,EAAE;AAAE,MAAA,OAAO,EAAE,CAAC;AAAZ,KAF8C;AAGvD,IAAA,SAAS,EAAE;AAH4C,GAAzC,CAAhB;AAMA,EAAA,OAAO,CAAC,QAAR,GAAmB,cAAc,CAAQ,OAAO,CAAC,QAAhB,CAAjC,CAP0E,CAS1E;;AACA,SAAS,OAAsC,CAAC,QAAhD;AAEA,SAAQ,OAAR;AACD,CAbM","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';\n\nimport { Context, ContextValue } from './types';\n\nconst createProvider = <Value>(Original: React.Provider<ContextValue<Value>>) => {\n const Provider: React.FC<React.ProviderProps<Value>> = props => {\n // Holds an actual \"props.value\"\n const valueRef = React.useRef(props.value);\n // Used to sync context updates and avoid stale values, can be considered as render/effect counter of Provider.\n const versionRef = React.useRef(0);\n\n // A stable object, is used to avoid context updates via mutation of its values.\n const contextValue = React.useRef<ContextValue<Value>>();\n\n if (!contextValue.current) {\n contextValue.current = {\n value: valueRef,\n version: versionRef,\n listeners: [],\n };\n }\n\n useIsomorphicLayoutEffect(() => {\n valueRef.current = props.value;\n versionRef.current += 1;\n\n runWithPriority(NormalPriority, () => {\n (contextValue.current as ContextValue<Value>).listeners.forEach(listener => {\n listener([versionRef.current, props.value]);\n });\n });\n }, [props.value]);\n\n return React.createElement(Original, { value: contextValue.current }, props.children);\n };\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n Provider.displayName = 'ContextSelector.Provider';\n }\n\n return (Provider as unknown) as React.Provider<ContextValue<Value>>;\n};\n\nexport const createContext = <Value>(defaultValue: Value): Context<Value> => {\n const context = React.createContext<ContextValue<Value>>({\n value: { current: defaultValue },\n version: { current: -1 },\n listeners: [],\n });\n\n context.Provider = createProvider<Value>(context.Provider);\n\n // We don't support Consumer API\n delete ((context as unknown) as Context<Value>).Consumer;\n\n return (context as unknown) as Context<Value>;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["createContext.ts"],"names":[],"mappings":"AAAA,SAAS,yBAAT,QAA0C,2BAA1C;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,uBAAuB,IAAI,cAApC,EAAoD,wBAAwB,IAAI,eAAhF,QAAuG,WAAvG;;AAIA,MAAM,cAAc,GAAW,QAAR,IAAyD;EAC9E,MAAM,QAAQ,GAAyC,KAAK,IAAG;IAC7D;IACA,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAN,CAAa,KAAK,CAAC,KAAnB,CAAjB,CAF6D,CAG7D;;IACA,MAAM,UAAU,GAAG,KAAK,CAAC,MAAN,CAAa,CAAb,CAAnB,CAJ6D,CAM7D;;IACA,MAAM,YAAY,GAAG,KAAK,CAAC,MAAN,EAArB;;IAEA,IAAI,CAAC,YAAY,CAAC,OAAlB,EAA2B;MACzB,YAAY,CAAC,OAAb,GAAuB;QACrB,KAAK,EAAE,QADc;QAErB,OAAO,EAAE,UAFY;QAGrB,SAAS,EAAE;MAHU,CAAvB;IAKD;;IAED,yBAAyB,CAAC,MAAK;MAC7B,QAAQ,CAAC,OAAT,GAAmB,KAAK,CAAC,KAAzB;MACA,UAAU,CAAC,OAAX,IAAsB,CAAtB;MAEA,eAAe,CAAC,cAAD,EAAiB,MAAK;QAClC,YAAY,CAAC,OAAb,CAA6C,SAA7C,CAAuD,OAAvD,CAA+D,QAAQ,IAAG;UACzE,QAAQ,CAAC,CAAC,UAAU,CAAC,OAAZ,EAAqB,KAAK,CAAC,KAA3B,CAAD,CAAR;QACD,CAFA;MAGF,CAJc,CAAf;IAKD,CATwB,EAStB,CAAC,KAAK,CAAC,KAAP,CATsB,CAAzB;IAWA,oBAAO,KAAK,CAAC,aAAN,CAAoB,QAApB,EAA8B;MAAE,KAAK,EAAE,YAAY,CAAC;IAAtB,CAA9B,EAA+D,KAAK,CAAC,QAArE,CAAP;EACD,CA7BD;EA+BA;;;EACA,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC,QAAQ,CAAC,WAAT,GAAuB,0BAAvB;EACD;;EAED,OAAQ,QAAR;AACD,CAtCD;AAwCA;;AAEG;;;AACH,OAAO,MAAM,aAAa,GAAW,YAAR,IAA+C;EAC1E,MAAM,OAAO,gBAAG,KAAK,CAAC,aAAN,CAAyC;IACvD,KAAK,EAAE;MAAE,OAAO,EAAE;IAAX,CADgD;IAEvD,OAAO,EAAE;MAAE,OAAO,EAAE,CAAC;IAAZ,CAF8C;IAGvD,SAAS,EAAE;EAH4C,CAAzC,CAAhB;EAMA,OAAO,CAAC,QAAR,GAAmB,cAAc,CAAQ,OAAO,CAAC,QAAhB,CAAjC,CAP0E,CAS1E;;EACA,OAAS,OAAsC,CAAC,QAAhD;EAEA,OAAQ,OAAR;AACD,CAbM","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';\n\nimport { Context, ContextValue } from './types';\n\nconst createProvider = <Value>(Original: React.Provider<ContextValue<Value>>) => {\n const Provider: React.FC<React.ProviderProps<Value>> = props => {\n // Holds an actual \"props.value\"\n const valueRef = React.useRef(props.value);\n // Used to sync context updates and avoid stale values, can be considered as render/effect counter of Provider.\n const versionRef = React.useRef(0);\n\n // A stable object, is used to avoid context updates via mutation of its values.\n const contextValue = React.useRef<ContextValue<Value>>();\n\n if (!contextValue.current) {\n contextValue.current = {\n value: valueRef,\n version: versionRef,\n listeners: [],\n };\n }\n\n useIsomorphicLayoutEffect(() => {\n valueRef.current = props.value;\n versionRef.current += 1;\n\n runWithPriority(NormalPriority, () => {\n (contextValue.current as ContextValue<Value>).listeners.forEach(listener => {\n listener([versionRef.current, props.value]);\n });\n });\n }, [props.value]);\n\n return React.createElement(Original, { value: contextValue.current }, props.children);\n };\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n Provider.displayName = 'ContextSelector.Provider';\n }\n\n return (Provider as unknown) as React.Provider<ContextValue<Value>>;\n};\n\n/**\n * @internal\n */\nexport const createContext = <Value>(defaultValue: Value): Context<Value> => {\n const context = React.createContext<ContextValue<Value>>({\n value: { current: defaultValue },\n version: { current: -1 },\n listeners: [],\n });\n\n context.Provider = createProvider<Value>(context.Provider);\n\n // We don't support Consumer API\n delete ((context as unknown) as Context<Value>).Consumer;\n\n return (context as unknown) as Context<Value>;\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export { createContext } from './createContext';
2
2
  export { useContextSelector } from './useContextSelector';
3
3
  export { useHasParentContext } from './useHasParentContext';
4
- export * from './types';
5
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,SAAS,CAAC","sourcesContent":["export { createContext } from './createContext';\nexport { useContextSelector } from './useContextSelector';\nexport { useHasParentContext } from './useHasParentContext';\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC","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, ContextValues, ContextVersion } from './types';\n"]}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type Context<Value> = React.Context<Value> & {\n Provider: React.FC<React.ProviderProps<Value>>;\n Consumer: never;\n};\n\nexport type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;\n\nexport type ContextVersion = number;\n\nexport type ContextValue<Value> = {\n /** Holds a set of subscribers from components. */\n listeners: ((payload: readonly [ContextVersion, Value]) => void)[];\n\n /** Holds an actual value of React's context that will be propagated down for computations. */\n value: React.MutableRefObject<Value>;\n\n /** A version field is used to sync a context value and consumers. */\n version: React.MutableRefObject<ContextVersion>;\n};\n\nexport type ContextValues<Value> = ContextValue<Value> & {\n /** List of listners to publish changes */\n listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport type Context<Value> = React.Context<Value> & {\n Provider: React.FC<React.ProviderProps<Value>>;\n Consumer: never;\n};\n\n/**\n * @internal\n */\nexport type ContextSelector<Value, SelectedValue> = (value: Value) => SelectedValue;\n\n/**\n * @internal\n */\nexport type ContextVersion = number;\n\n/**\n * @internal\n */\nexport type ContextValue<Value> = {\n /** Holds a set of subscribers from components. */\n listeners: ((payload: readonly [ContextVersion, Value]) => void)[];\n\n /** Holds an actual value of React's context that will be propagated down for computations. */\n value: React.MutableRefObject<Value>;\n\n /** A version field is used to sync a context value and consumers. */\n version: React.MutableRefObject<ContextVersion>;\n};\n\n/**\n * @internal\n */\nexport type ContextValues<Value> = ContextValue<Value> & {\n /** List of listners to publish changes */\n listeners: ((payload: readonly [ContextVersion, Record<string, Value>]) => void)[];\n};\n"]}
@@ -1,6 +1,7 @@
1
1
  import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
2
2
  import * as React from 'react';
3
3
  /**
4
+ * @internal
4
5
  * This hook returns context selected value by selector.
5
6
  * It will only accept context created by `createContext`.
6
7
  * It will trigger re-render if only the selected value is referencially changed.
@@ -1 +1 @@
1
- {"version":3,"sources":["useContextSelector.ts"],"names":[],"mappings":"AAAA,SAAS,yBAAT,QAA0C,2BAA1C;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAaA;;;;AAIG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,OADgC,EAEhC,QAFgC,KAGf;AACjB,QAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;AAEA,QAAM;AACJ,IAAA,KAAK,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KADH;AAEJ,IAAA,OAAO,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KAFL;AAGJ,IAAA;AAHI,MAIF,YAJJ;AAKA,QAAM,QAAQ,GAAG,QAAQ,CAAC,KAAD,CAAzB;AAEA,QAAM,CAAC,KAAD,EAAQ,QAAR,IAAoB,KAAK,CAAC,UAAN,CACxB,CACE,SADF,EAEE,OAFF,KAKqC;AACnC,QAAI,CAAC,OAAL,EAAc;AACZ;AACA,aAAO,CAAC,KAAD,EAAQ,QAAR,CAAP;AACD;;AAED,QAAI,OAAO,CAAC,CAAD,CAAP,IAAc,OAAlB,EAA2B;AACzB,UAAI,QAAQ,CAAC,SAAS,CAAC,CAAD,CAAV,EAAe,QAAf,CAAZ,EAAsC;AACpC,eAAO,SAAP,CADoC,CAClB;AACnB;;AAED,aAAO,CAAC,KAAD,EAAQ,QAAR,CAAP;AACD;;AAED,QAAI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AK,CAAN,IAAW,CAAC,KAAK,CADjE,CACoE;AADpE;AAGD,C,CAED;;;AACA,MAAM,QAAQ,GACZ;AACA;AACA,OAAO,MAAM,CAAC,EAAd,KAAqB,UAArB,GAAkC,MAAM,CAAC,EAAzC,GAA8C,EAHhD","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { Context, ContextSelector, ContextValue, ContextVersion } from './types';\n\n/**\n * Narrowing React.Reducer type to be more easily usable below.\n * No need to export this as it's for internal reducer usage.\n */\ntype ContextReducer<Value, SelectedValue> = React.Reducer<\n readonly [Value, SelectedValue],\n undefined | readonly [ContextVersion, Value]\n>;\n\n/**\n * This hook returns context selected value by selector.\n * It will only accept context created by `createContext`.\n * It will trigger re-render if only the selected value is referencially changed.\n */\nexport const useContextSelector = <Value, SelectedValue>(\n context: Context<Value>,\n selector: ContextSelector<Value, SelectedValue>,\n): SelectedValue => {\n const contextValue = React.useContext((context as unknown) as Context<ContextValue<Value>>);\n\n const {\n value: { current: value },\n version: { current: version },\n listeners,\n } = contextValue;\n const selected = selector(value);\n\n const [state, dispatch] = React.useReducer<ContextReducer<Value, SelectedValue>>(\n (\n prevState: readonly [Value /* contextValue */, SelectedValue /* selector(value) */],\n payload:\n | undefined // undefined from render below\n | readonly [ContextVersion, Value], // from provider effect\n ): readonly [Value, SelectedValue] => {\n if (!payload) {\n // early bail out when is dispatched during render\n return [value, selected] as const;\n }\n\n if (payload[0] <= version) {\n if (objectIs(prevState[1], selected)) {\n return prevState; // bail out\n }\n\n return [value, selected] as const;\n }\n\n try {\n if (objectIs(prevState[0], payload[1])) {\n return prevState; // do not update\n }\n\n const nextSelected = selector(payload[1]);\n\n if (objectIs(prevState[1], nextSelected)) {\n return prevState; // do not update\n }\n\n return [payload[1], nextSelected] as const;\n } catch (e) {\n // ignored (stale props or some other reason)\n }\n\n // explicitly spread to enforce typing\n return [prevState[0], prevState[1]] as const; // schedule update\n },\n [value, selected] as const,\n );\n\n if (!objectIs(state[1], selected)) {\n // schedule re-render\n // this is safe because it's self contained\n dispatch(undefined);\n }\n\n useIsomorphicLayoutEffect(() => {\n listeners.push(dispatch);\n\n return () => {\n const index = listeners.indexOf(dispatch);\n listeners.splice(index, 1);\n };\n }, [listeners]);\n\n return state[1] as SelectedValue;\n};\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction is(x: any, y: any) {\n return (\n (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst objectIs: (x: any, y: any) => boolean =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore fallback to native if it exists (not in IE11)\n typeof Object.is === 'function' ? Object.is : is;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["useContextSelector.ts"],"names":[],"mappings":"AAAA,SAAS,yBAAT,QAA0C,2BAA1C;AACA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAaA;;;;;AAKG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,OADgC,EAEhC,QAFgC,KAGf;EACjB,MAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;EAEA,MAAM;IACJ,KAAK,EAAE;MAAE,OAAO,EAAE;IAAX,CADH;IAEJ,OAAO,EAAE;MAAE,OAAO,EAAE;IAAX,CAFL;IAGJ;EAHI,IAIF,YAJJ;EAKA,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAD,CAAzB;EAEA,MAAM,CAAC,KAAD,EAAQ,QAAR,IAAoB,KAAK,CAAC,UAAN,CACxB,CACE,SADF,EAEE,OAFF,KAKqC;IACnC,IAAI,CAAC,OAAL,EAAc;MACZ;MACA,OAAO,CAAC,KAAD,EAAQ,QAAR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CAAC,CAAD,CAAZ;AACD,CAvEM;AAyEP;;;AAGG;AACH;;AACA,SAAS,EAAT,CAAY,CAAZ,EAAoB,CAApB,EAA0B;EACxB,OACG,CAAC,KAAK,CAAN,KAAY,CAAC,KAAK,CAAN,IAAW,IAAI,CAAJ,KAAU,IAAI,CAArC,CAAD,IAA8C,CAAC,KAAK,CAAN,IAAW,CAAC,KAAK,CADjE,CACoE;EADpE;AAGD,C,CAED;;;AACA,MAAM,QAAQ,GACZ;AACA;AACA,OAAO,MAAM,CAAC,EAAd,KAAqB,UAArB,GAAkC,MAAM,CAAC,EAAzC,GAA8C,EAHhD","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { Context, ContextSelector, ContextValue, ContextVersion } from './types';\n\n/**\n * Narrowing React.Reducer type to be more easily usable below.\n * No need to export this as it's for internal reducer usage.\n */\ntype ContextReducer<Value, SelectedValue> = React.Reducer<\n readonly [Value, SelectedValue],\n undefined | readonly [ContextVersion, Value]\n>;\n\n/**\n * @internal\n * This hook returns context selected value by selector.\n * It will only accept context created by `createContext`.\n * It will trigger re-render if only the selected value is referencially changed.\n */\nexport const useContextSelector = <Value, SelectedValue>(\n context: Context<Value>,\n selector: ContextSelector<Value, SelectedValue>,\n): SelectedValue => {\n const contextValue = React.useContext((context as unknown) as Context<ContextValue<Value>>);\n\n const {\n value: { current: value },\n version: { current: version },\n listeners,\n } = contextValue;\n const selected = selector(value);\n\n const [state, dispatch] = React.useReducer<ContextReducer<Value, SelectedValue>>(\n (\n prevState: readonly [Value /* contextValue */, SelectedValue /* selector(value) */],\n payload:\n | undefined // undefined from render below\n | readonly [ContextVersion, Value], // from provider effect\n ): readonly [Value, SelectedValue] => {\n if (!payload) {\n // early bail out when is dispatched during render\n return [value, selected] as const;\n }\n\n if (payload[0] <= version) {\n if (objectIs(prevState[1], selected)) {\n return prevState; // bail out\n }\n\n return [value, selected] as const;\n }\n\n try {\n if (objectIs(prevState[0], payload[1])) {\n return prevState; // do not update\n }\n\n const nextSelected = selector(payload[1]);\n\n if (objectIs(prevState[1], nextSelected)) {\n return prevState; // do not update\n }\n\n return [payload[1], nextSelected] as const;\n } catch (e) {\n // ignored (stale props or some other reason)\n }\n\n // explicitly spread to enforce typing\n return [prevState[0], prevState[1]] as const; // schedule update\n },\n [value, selected] as const,\n );\n\n if (!objectIs(state[1], selected)) {\n // schedule re-render\n // this is safe because it's self contained\n dispatch(undefined);\n }\n\n useIsomorphicLayoutEffect(() => {\n listeners.push(dispatch);\n\n return () => {\n const index = listeners.indexOf(dispatch);\n listeners.splice(index, 1);\n };\n }, [listeners]);\n\n return state[1] as SelectedValue;\n};\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction is(x: any, y: any) {\n return (\n (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst objectIs: (x: any, y: any) => boolean =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore fallback to native if it exists (not in IE11)\n typeof Object.is === 'function' ? Object.is : is;\n"],"sourceRoot":"../src/"}
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  /**
3
+ * @internal
3
4
  * Utility hook for contexts created by react-context-selector to determine if a parent context exists
4
5
  * WARNING: This hook will not work for native React contexts
5
6
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["useHasParentContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA;;;;;;AAMG;;AACH,OAAM,SAAU,mBAAV,CAAqC,OAArC,EAA4D;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","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/"}
1
+ {"version":3,"sources":["useHasParentContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA;;;;;;;AAOG;;AACH,OAAM,SAAU,mBAAV,CAAqC,OAArC,EAA4D;EAChE,MAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;;EAEA,IAAI,YAAY,CAAC,OAAjB,EAA0B;IACxB,OAAO,YAAY,CAAC,OAAb,CAAqB,OAArB,KAAiC,CAAC,CAAzC;EACD;;EAED,OAAO,KAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { Context, ContextValue } from './types';\n\n/**\n * @internal\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/"}
@@ -50,6 +50,10 @@ const createProvider = Original => {
50
50
 
51
51
  return Provider;
52
52
  };
53
+ /**
54
+ * @internal
55
+ */
56
+
53
57
 
54
58
  const createContext = defaultValue => {
55
59
  const context = React.createContext({
@@ -1 +1 @@
1
- {"version":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EAA+D,KAAK,CAAC,QAArE,CAAP;AACD,GA7BD;AA+BA;;;AACA,MAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;AACzC,IAAA,QAAQ,CAAC,WAAT,GAAuB,0BAAvB;AACD;;AAED,SAAQ,QAAR;AACD,CAtCD;;AAwCO,MAAM,aAAa,GAAW,YAAR,IAA+C;AAC1E,QAAM,OAAO,GAAG,KAAK,CAAC,aAAN,CAAyC;AACvD,IAAA,KAAK,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KADgD;AAEvD,IAAA,OAAO,EAAE;AAAE,MAAA,OAAO,EAAE,CAAC;AAAZ,KAF8C;AAGvD,IAAA,SAAS,EAAE;AAH4C,GAAzC,CAAhB;AAMA,EAAA,OAAO,CAAC,QAAR,GAAmB,cAAc,CAAQ,OAAO,CAAC,QAAhB,CAAjC,CAP0E,CAS1E;;AACA,SAAS,OAAsC,CAAC,QAAhD;AAEA,SAAQ,OAAR;AACD,CAbM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';\n\nimport { Context, ContextValue } from './types';\n\nconst createProvider = <Value>(Original: React.Provider<ContextValue<Value>>) => {\n const Provider: React.FC<React.ProviderProps<Value>> = props => {\n // Holds an actual \"props.value\"\n const valueRef = React.useRef(props.value);\n // Used to sync context updates and avoid stale values, can be considered as render/effect counter of Provider.\n const versionRef = React.useRef(0);\n\n // A stable object, is used to avoid context updates via mutation of its values.\n const contextValue = React.useRef<ContextValue<Value>>();\n\n if (!contextValue.current) {\n contextValue.current = {\n value: valueRef,\n version: versionRef,\n listeners: [],\n };\n }\n\n useIsomorphicLayoutEffect(() => {\n valueRef.current = props.value;\n versionRef.current += 1;\n\n runWithPriority(NormalPriority, () => {\n (contextValue.current as ContextValue<Value>).listeners.forEach(listener => {\n listener([versionRef.current, props.value]);\n });\n });\n }, [props.value]);\n\n return React.createElement(Original, { value: contextValue.current }, props.children);\n };\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n Provider.displayName = 'ContextSelector.Provider';\n }\n\n return (Provider as unknown) as React.Provider<ContextValue<Value>>;\n};\n\nexport const createContext = <Value>(defaultValue: Value): Context<Value> => {\n const context = React.createContext<ContextValue<Value>>({\n value: { current: defaultValue },\n version: { current: -1 },\n listeners: [],\n });\n\n context.Provider = createProvider<Value>(context.Provider);\n\n // We don't support Consumer API\n delete ((context as unknown) as Context<Value>).Consumer;\n\n return (context as unknown) as Context<Value>;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["createContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAIA,MAAM,cAAc,GAAW,QAAR,IAAyD;EAC9E,MAAM,QAAQ,GAAyC,KAAK,IAAG;IAC7D;IACA,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAN,CAAa,KAAK,CAAC,KAAnB,CAAjB,CAF6D,CAG7D;;IACA,MAAM,UAAU,GAAG,KAAK,CAAC,MAAN,CAAa,CAAb,CAAnB,CAJ6D,CAM7D;;IACA,MAAM,YAAY,GAAG,KAAK,CAAC,MAAN,EAArB;;IAEA,IAAI,CAAC,YAAY,CAAC,OAAlB,EAA2B;MACzB,YAAY,CAAC,OAAb,GAAuB;QACrB,KAAK,EAAE,QADc;QAErB,OAAO,EAAE,UAFY;QAGrB,SAAS,EAAE;MAHU,CAAvB;IAKD;;IAED,iBAAA,CAAA,yBAAA,CAA0B,MAAK;MAC7B,QAAQ,CAAC,OAAT,GAAmB,KAAK,CAAC,KAAzB;MACA,UAAU,CAAC,OAAX,IAAsB,CAAtB;MAEA,WAAA,CAAA,wBAAA,CAAgB,WAAA,CAAA,uBAAhB,EAAgC,MAAK;QAClC,YAAY,CAAC,OAAb,CAA6C,SAA7C,CAAuD,OAAvD,CAA+D,QAAQ,IAAG;UACzE,QAAQ,CAAC,CAAC,UAAU,CAAC,OAAZ,EAAqB,KAAK,CAAC,KAA3B,CAAD,CAAR;QACD,CAFA;MAGF,CAJD;IAKD,CATD,EASG,CAAC,KAAK,CAAC,KAAP,CATH;IAWA,OAAO,KAAK,CAAC,aAAN,CAAoB,QAApB,EAA8B;MAAE,KAAK,EAAE,YAAY,CAAC;IAAtB,CAA9B,EAA+D,KAAK,CAAC,QAArE,CAAP;EACD,CA7BD;EA+BA;;;EACA,IAAI,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAA7B,EAA2C;IACzC,QAAQ,CAAC,WAAT,GAAuB,0BAAvB;EACD;;EAED,OAAQ,QAAR;AACD,CAtCD;AAwCA;;AAEG;;;AACI,MAAM,aAAa,GAAW,YAAR,IAA+C;EAC1E,MAAM,OAAO,GAAG,KAAK,CAAC,aAAN,CAAyC;IACvD,KAAK,EAAE;MAAE,OAAO,EAAE;IAAX,CADgD;IAEvD,OAAO,EAAE;MAAE,OAAO,EAAE,CAAC;IAAZ,CAF8C;IAGvD,SAAS,EAAE;EAH4C,CAAzC,CAAhB;EAMA,OAAO,CAAC,QAAR,GAAmB,cAAc,CAAQ,OAAO,CAAC,QAAhB,CAAjC,CAP0E,CAS1E;;EACA,OAAS,OAAsC,CAAC,QAAhD;EAEA,OAAQ,OAAR;AACD,CAbM;;AAAM,OAAA,CAAA,aAAA,GAAa,aAAb","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport { unstable_NormalPriority as NormalPriority, unstable_runWithPriority as runWithPriority } from 'scheduler';\n\nimport { Context, ContextValue } from './types';\n\nconst createProvider = <Value>(Original: React.Provider<ContextValue<Value>>) => {\n const Provider: React.FC<React.ProviderProps<Value>> = props => {\n // Holds an actual \"props.value\"\n const valueRef = React.useRef(props.value);\n // Used to sync context updates and avoid stale values, can be considered as render/effect counter of Provider.\n const versionRef = React.useRef(0);\n\n // A stable object, is used to avoid context updates via mutation of its values.\n const contextValue = React.useRef<ContextValue<Value>>();\n\n if (!contextValue.current) {\n contextValue.current = {\n value: valueRef,\n version: versionRef,\n listeners: [],\n };\n }\n\n useIsomorphicLayoutEffect(() => {\n valueRef.current = props.value;\n versionRef.current += 1;\n\n runWithPriority(NormalPriority, () => {\n (contextValue.current as ContextValue<Value>).listeners.forEach(listener => {\n listener([versionRef.current, props.value]);\n });\n });\n }, [props.value]);\n\n return React.createElement(Original, { value: contextValue.current }, props.children);\n };\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n Provider.displayName = 'ContextSelector.Provider';\n }\n\n return (Provider as unknown) as React.Provider<ContextValue<Value>>;\n};\n\n/**\n * @internal\n */\nexport const createContext = <Value>(defaultValue: Value): Context<Value> => {\n const context = React.createContext<ContextValue<Value>>({\n value: { current: defaultValue },\n version: { current: -1 },\n listeners: [],\n });\n\n context.Provider = createProvider<Value>(context.Provider);\n\n // We don't support Consumer API\n delete ((context as unknown) as Context<Value>).Consumer;\n\n return (context as unknown) as Context<Value>;\n};\n"],"sourceRoot":"../src/"}
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useHasParentContext = exports.useContextSelector = exports.createContext = void 0;
7
7
 
8
- const tslib_1 = /*#__PURE__*/require("tslib");
9
-
10
8
  var createContext_1 = /*#__PURE__*/require("./createContext");
11
9
 
12
10
  Object.defineProperty(exports, "createContext", {
@@ -33,6 +31,4 @@ Object.defineProperty(exports, "useHasParentContext", {
33
31
  return useHasParentContext_1.useHasParentContext;
34
32
  }
35
33
  });
36
-
37
- tslib_1.__exportStar(require("./types"), exports);
38
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,aAAA;AAAa;AAAb,CAAA;;AACT,IAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,oBAAA,CAAA,kBAAA;AAAkB;AAAlB,CAAA;;AACT,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,qBAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA;;AACT,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourcesContent":["export { createContext } from './createContext';\nexport { useContextSelector } from './useContextSelector';\nexport { useHasParentContext } from './useHasParentContext';\nexport * from './types';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,eAAA,CAAA,aAAA;EAAa;AAAb,CAAA;;AACT,IAAA,oBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,oBAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;;AACT,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,qBAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA","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, ContextValues, ContextVersion } from './types';\n"],"sourceRoot":"../src/"}
@@ -9,6 +9,7 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
9
 
10
10
  const React = /*#__PURE__*/require("react");
11
11
  /**
12
+ * @internal
12
13
  * This hook returns context selected value by selector.
13
14
  * It will only accept context created by `createContext`.
14
15
  * It will trigger re-render if only the selected value is referencially changed.
@@ -1 +1 @@
1
- {"version":3,"sources":["useContextSelector.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAaA;;;;AAIG;;;AACI,MAAM,kBAAkB,GAAG,CAChC,OADgC,EAEhC,QAFgC,KAGf;AACjB,QAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;AAEA,QAAM;AACJ,IAAA,KAAK,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KADH;AAEJ,IAAA,OAAO,EAAE;AAAE,MAAA,OAAO,EAAE;AAAX,KAFL;AAGJ,IAAA;AAHI,MAIF,YAJJ;AAKA,QAAM,QAAQ,GAAG,QAAQ,CAAC,KAAD,CAAzB;AAEA,QAAM,CAAC,KAAD,EAAQ,QAAR,IAAoB,KAAK,CAAC,UAAN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QAAlB,CAAd;AACA,MAAA,SAAS,CAAC,MAAV,CAAiB,KAAjB,EAAwB,CAAxB;AACD,KAHD;AAID,GAPD,EAOG,CAAC,SAAD,CAPH;AASA,SAAO,KAAK,CAAC,CAAD,CAAZ;AACD,CAvEM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB;AAyEb;;;AAGG;AACH;;AACA,SAAS,EAAT,CAAY,CAAZ,EAAoB,CAApB,EAA0B;AACxB,SACG,CAAC,KAAK,CAAN,KAAY,CAAC,KAAK,CAAN,IAAW,IAAI,CAAJ,KAAU,IAAI,CAArC,CAAD,IAA8C,CAAC,KAAK,CAAN,IAAW,CAAC,KAAK,CADjE,CACoE;AADpE;AAGD,C,CAED;;;AACA,MAAM,QAAQ,GACZ;AACA;AACA,OAAO,MAAM,CAAC,EAAd,KAAqB,UAArB,GAAkC,MAAM,CAAC,EAAzC,GAA8C,EAHhD","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { Context, ContextSelector, ContextValue, ContextVersion } from './types';\n\n/**\n * Narrowing React.Reducer type to be more easily usable below.\n * No need to export this as it's for internal reducer usage.\n */\ntype ContextReducer<Value, SelectedValue> = React.Reducer<\n readonly [Value, SelectedValue],\n undefined | readonly [ContextVersion, Value]\n>;\n\n/**\n * This hook returns context selected value by selector.\n * It will only accept context created by `createContext`.\n * It will trigger re-render if only the selected value is referencially changed.\n */\nexport const useContextSelector = <Value, SelectedValue>(\n context: Context<Value>,\n selector: ContextSelector<Value, SelectedValue>,\n): SelectedValue => {\n const contextValue = React.useContext((context as unknown) as Context<ContextValue<Value>>);\n\n const {\n value: { current: value },\n version: { current: version },\n listeners,\n } = contextValue;\n const selected = selector(value);\n\n const [state, dispatch] = React.useReducer<ContextReducer<Value, SelectedValue>>(\n (\n prevState: readonly [Value /* contextValue */, SelectedValue /* selector(value) */],\n payload:\n | undefined // undefined from render below\n | readonly [ContextVersion, Value], // from provider effect\n ): readonly [Value, SelectedValue] => {\n if (!payload) {\n // early bail out when is dispatched during render\n return [value, selected] as const;\n }\n\n if (payload[0] <= version) {\n if (objectIs(prevState[1], selected)) {\n return prevState; // bail out\n }\n\n return [value, selected] as const;\n }\n\n try {\n if (objectIs(prevState[0], payload[1])) {\n return prevState; // do not update\n }\n\n const nextSelected = selector(payload[1]);\n\n if (objectIs(prevState[1], nextSelected)) {\n return prevState; // do not update\n }\n\n return [payload[1], nextSelected] as const;\n } catch (e) {\n // ignored (stale props or some other reason)\n }\n\n // explicitly spread to enforce typing\n return [prevState[0], prevState[1]] as const; // schedule update\n },\n [value, selected] as const,\n );\n\n if (!objectIs(state[1], selected)) {\n // schedule re-render\n // this is safe because it's self contained\n dispatch(undefined);\n }\n\n useIsomorphicLayoutEffect(() => {\n listeners.push(dispatch);\n\n return () => {\n const index = listeners.indexOf(dispatch);\n listeners.splice(index, 1);\n };\n }, [listeners]);\n\n return state[1] as SelectedValue;\n};\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction is(x: any, y: any) {\n return (\n (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst objectIs: (x: any, y: any) => boolean =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore fallback to native if it exists (not in IE11)\n typeof Object.is === 'function' ? Object.is : is;\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["useContextSelector.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAaA;;;;;AAKG;;;AACI,MAAM,kBAAkB,GAAG,CAChC,OADgC,EAEhC,QAFgC,KA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,QAAR,CAvCwB,CAA1B;;EA0CA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAD,CAAN,EAAW,QAAX,CAAb,EAAmC;IACjC;IACA;IACA,QAAQ,CAAC,SAAD,CAAR;EACD;;EAED,iBAAA,CAAA,yBAAA,CAA0B,MAAK;IAC7B,SAAS,CAAC,IAAV,CAAe,QAAf;IAEA,OAAO,MAAK;MACV,MAAM,KAAK,GAAG,SAAS,CAAC,OAAV,CAAkB,QAAlB,CAAd;MACA,SAAS,CAAC,MAAV,CAAiB,KAAjB,EAAwB,CAAxB;IACD,CAHD;EAID,CAPD,EAOG,CAAC,SAAD,CAPH;EASA,OAAO,KAAK,CAAC,CAAD,CAAZ;AACD,CAvEM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB;AAyEb;;;AAGG;AACH;;AACA,SAAS,EAAT,CAAY,CAAZ,EAAoB,CAApB,EAA0B;EACxB,OACG,CAAC,KAAK,CAAN,KAAY,CAAC,KAAK,CAAN,IAAW,IAAI,CAAJ,KAAU,IAAI,CAArC,CAAD,IAA8C,CAAC,KAAK,CAAN,IAAW,CAAC,KAAK,CADjE,CACoE;EADpE;AAGD,C,CAED;;;AACA,MAAM,QAAQ,GACZ;AACA;AACA,OAAO,MAAM,CAAC,EAAd,KAAqB,UAArB,GAAkC,MAAM,CAAC,EAAzC,GAA8C,EAHhD","sourcesContent":["import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport { Context, ContextSelector, ContextValue, ContextVersion } from './types';\n\n/**\n * Narrowing React.Reducer type to be more easily usable below.\n * No need to export this as it's for internal reducer usage.\n */\ntype ContextReducer<Value, SelectedValue> = React.Reducer<\n readonly [Value, SelectedValue],\n undefined | readonly [ContextVersion, Value]\n>;\n\n/**\n * @internal\n * This hook returns context selected value by selector.\n * It will only accept context created by `createContext`.\n * It will trigger re-render if only the selected value is referencially changed.\n */\nexport const useContextSelector = <Value, SelectedValue>(\n context: Context<Value>,\n selector: ContextSelector<Value, SelectedValue>,\n): SelectedValue => {\n const contextValue = React.useContext((context as unknown) as Context<ContextValue<Value>>);\n\n const {\n value: { current: value },\n version: { current: version },\n listeners,\n } = contextValue;\n const selected = selector(value);\n\n const [state, dispatch] = React.useReducer<ContextReducer<Value, SelectedValue>>(\n (\n prevState: readonly [Value /* contextValue */, SelectedValue /* selector(value) */],\n payload:\n | undefined // undefined from render below\n | readonly [ContextVersion, Value], // from provider effect\n ): readonly [Value, SelectedValue] => {\n if (!payload) {\n // early bail out when is dispatched during render\n return [value, selected] as const;\n }\n\n if (payload[0] <= version) {\n if (objectIs(prevState[1], selected)) {\n return prevState; // bail out\n }\n\n return [value, selected] as const;\n }\n\n try {\n if (objectIs(prevState[0], payload[1])) {\n return prevState; // do not update\n }\n\n const nextSelected = selector(payload[1]);\n\n if (objectIs(prevState[1], nextSelected)) {\n return prevState; // do not update\n }\n\n return [payload[1], nextSelected] as const;\n } catch (e) {\n // ignored (stale props or some other reason)\n }\n\n // explicitly spread to enforce typing\n return [prevState[0], prevState[1]] as const; // schedule update\n },\n [value, selected] as const,\n );\n\n if (!objectIs(state[1], selected)) {\n // schedule re-render\n // this is safe because it's self contained\n dispatch(undefined);\n }\n\n useIsomorphicLayoutEffect(() => {\n listeners.push(dispatch);\n\n return () => {\n const index = listeners.indexOf(dispatch);\n listeners.splice(index, 1);\n };\n }, [listeners]);\n\n return state[1] as SelectedValue;\n};\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction is(x: any, y: any) {\n return (\n (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y) // eslint-disable-line no-self-compare\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst objectIs: (x: any, y: any) => boolean =\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore fallback to native if it exists (not in IE11)\n typeof Object.is === 'function' ? Object.is : is;\n"],"sourceRoot":"../src/"}
@@ -7,6 +7,7 @@ exports.useHasParentContext = void 0;
7
7
 
8
8
  const React = /*#__PURE__*/require("react");
9
9
  /**
10
+ * @internal
10
11
  * Utility hook for contexts created by react-context-selector to determine if a parent context exists
11
12
  * WARNING: This hook will not work for native React contexts
12
13
  *
@@ -1 +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/"}
1
+ {"version":3,"sources":["useHasParentContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAGA;;;;;;;AAOG;;;AACH,SAAgB,mBAAhB,CAA2C,OAA3C,EAAkE;EAChE,MAAM,YAAY,GAAG,KAAK,CAAC,UAAN,CAAkB,OAAlB,CAArB;;EAEA,IAAI,YAAY,CAAC,OAAjB,EAA0B;IACxB,OAAO,YAAY,CAAC,OAAb,CAAqB,OAArB,KAAiC,CAAC,CAAzC;EACD;;EAED,OAAO,KAAP;AACD;;AARD,OAAA,CAAA,mBAAA,GAAA,mBAAA","sourcesContent":["import * as React from 'react';\nimport { Context, ContextValue } from './types';\n\n/**\n * @internal\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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-context-selector",
3
- "version": "0.0.0-nightlyff78d1e27a20220217.1",
3
+ "version": "0.0.0",
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",
@@ -19,37 +19,34 @@
19
19
  "lint": "just-scripts lint",
20
20
  "test": "jest --passWithNoTests",
21
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",
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
23
  "type-check": "tsc -b tsconfig.json"
24
24
  },
25
25
  "devDependencies": {
26
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"
27
+ "@fluentui/scripts": "^1.0.0"
36
28
  },
37
29
  "dependencies": {
38
- "@fluentui/react-utilities": "0.0.0-nightlyff78d1e27a20220217.1",
39
- "scheduler": "^0.20.1",
30
+ "@fluentui/react-utilities": "^0.0.0",
40
31
  "tslib": "^2.1.0"
41
32
  },
42
33
  "peerDependencies": {
43
34
  "@types/react": ">=16.8.0 <18.0.0",
44
35
  "@types/react-dom": ">=16.8.0 <18.0.0",
45
36
  "react": ">=16.8.0 <18.0.0",
46
- "react-dom": ">=16.8.0 <18.0.0"
37
+ "react-dom": ">=16.8.0 <18.0.0",
38
+ "scheduler": "^0.19.0 || ^0.20.0"
47
39
  },
48
40
  "beachball": {
49
41
  "disallowedChangeTypes": [
50
- "major",
51
- "minor",
52
- "patch"
42
+ "major"
53
43
  ]
44
+ },
45
+ "exports": {
46
+ ".": {
47
+ "types": "./lib/index.d.ts",
48
+ "import": "./lib/index.js",
49
+ "require": "./lib-commonjs/index.js"
50
+ }
54
51
  }
55
52
  }
@@ -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;