Skip to content

Commit 0a7c680

Browse files
authored
Update version to 2.0.4 (#11)
1 parent 6f6a9fb commit 0a7c680

File tree

6 files changed

+95
-49
lines changed

6 files changed

+95
-49
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.4 (Mar 18, 2019)
2+
3+
Log a warning if the context is missing ([Jeremy Einfeld](https://github.com/JeremyEinfeld))
4+
15
## 2.0.3 (Feb 27, 2019)
26

37
Move live region container to bottom of the announcer to reduce accidental navigation risk.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-aria-live",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "Add aria-live messaging to your React app",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/modules/AnnouncerContext.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
22

33
const AnnouncerContext = React.createContext({
4-
announceAssertive: logContextWarning,
5-
announcePolite: logContextWarning,
4+
announceAssertive: logContextWarning,
5+
announcePolite: logContextWarning,
66
});
77

88
function logContextWarning() {
9-
console.warn('Announcement failed, LiveAnnouncer context is missing');
9+
console.warn('Announcement failed, LiveAnnouncer context is missing');
1010
}
1111

1212
export default AnnouncerContext;

src/modules/__tests__/LiveMessage.spec.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ describe('LiveMessage', () => {
3838
});
3939

4040
it('should fail gracefully for assertive messages without LiveAnnouncer', () => {
41-
const warn = jest.spyOn(console, 'warn').mockImplementation(() => undefined);
41+
const warn = jest
42+
.spyOn(console, 'warn')
43+
.mockImplementation(() => undefined);
4244

43-
expect(() => mount(
44-
<LiveMessage message="Demo message" aria-live="assertive" />
45-
)).not.toThrow();
45+
expect(() =>
46+
mount(<LiveMessage message="Demo message" aria-live="assertive" />)
47+
).not.toThrow();
4648

4749
expect(warn).toHaveBeenCalled();
4850
});
@@ -81,16 +83,18 @@ describe('LiveMessage', () => {
8183
});
8284

8385
it('should fail gracefully for polite messages without LiveAnnouncer', () => {
84-
const warn = jest.spyOn(console, 'warn').mockImplementation(() => undefined);
86+
const warn = jest
87+
.spyOn(console, 'warn')
88+
.mockImplementation(() => undefined);
8589

86-
expect(() => mount(
87-
<LiveMessage message="Demo message" aria-live="polite" />
88-
)).not.toThrow();
90+
expect(() =>
91+
mount(<LiveMessage message="Demo message" aria-live="polite" />)
92+
).not.toThrow();
8993

9094
expect(warn).toHaveBeenCalled();
9195
});
9296

9397
afterEach(() => {
94-
jest.restoreAllMocks()
98+
jest.restoreAllMocks();
9599
});
96100
});

src/modules/__tests__/LiveMessenger.spec.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ describe('LiveMessage', () => {
9292

9393
it('should pass dummy functions without LiveAnnouncer', () => {
9494
mount(
95-
<LiveMessenger>
96-
{context => {
97-
expect(context).toBeDefined();
98-
expect(context).toHaveProperty('announceAssertive');
99-
expect(typeof context.announceAssertive).toBe('function');
100-
expect(context).toHaveProperty('announcePolite');
101-
expect(typeof context.announcePolite).toBe('function');
102-
}}
103-
</LiveMessenger>
95+
<LiveMessenger>
96+
{context => {
97+
expect(context).toBeDefined();
98+
expect(context).toHaveProperty('announceAssertive');
99+
expect(typeof context.announceAssertive).toBe('function');
100+
expect(context).toHaveProperty('announcePolite');
101+
expect(typeof context.announcePolite).toBe('function');
102+
}}
103+
</LiveMessenger>
104104
);
105105
});
106106
});

yarn.lock

+65-27
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ array-equal@^1.0.0:
283283
version "1.0.0"
284284
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
285285

286+
array-filter@^1.0.0:
287+
version "1.0.0"
288+
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
289+
integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
290+
286291
array-filter@~0.0.0:
287292
version "0.0.1"
288293
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
@@ -336,6 +341,15 @@ array-unique@^0.3.2:
336341
version "0.3.2"
337342
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
338343

344+
array.prototype.flat@^1.2.1:
345+
version "1.2.1"
346+
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4"
347+
integrity sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw==
348+
dependencies:
349+
define-properties "^1.1.2"
350+
es-abstract "^1.10.0"
351+
function-bind "^1.1.1"
352+
339353
arraybuffer.slice@~0.0.7:
340354
version "0.0.7"
341355
resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675"
@@ -1290,10 +1304,10 @@ babel-preset-jest@^22.1.0:
12901304
babel-plugin-jest-hoist "^22.1.0"
12911305
babel-plugin-syntax-object-rest-spread "^6.13.0"
12921306

1293-
1294-
version "3.1.1"
1295-
resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-3.1.1.tgz#d3f06a79742f0e89d7afcb72e282d9809c850920"
1296-
integrity sha512-9fRHopNaGL5ScRZdPSoyxRaABKmkS2fx0HUJ5Yphan5G8QDFD7lETsPyY7El6b7YPT3sNrw9gfrWzl4/LsJcfA==
1307+
babel-preset-react-app@^3.1.1:
1308+
version "3.1.2"
1309+
resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-3.1.2.tgz#49ba3681b917c4e5c73a5249d3ef4c48fae064e2"
1310+
integrity sha512-/sh5Qd5T08PYa6t4kuCdKh9tXp6/m/Jwyx7PJTqugsYMfsDUJMlBXOs5EwFODHprzjWrmQ0SydnMZu9FY4MZYg==
12971311
dependencies:
12981312
babel-plugin-dynamic-import-node "1.1.0"
12991313
babel-plugin-syntax-dynamic-import "6.18.0"
@@ -3254,27 +3268,32 @@ [email protected]:
32543268
dependencies:
32553269
lodash "^4.17.4"
32563270

3257-
3258-
version "3.3.0"
3259-
resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479"
3260-
integrity sha512-l8csyPyLmtxskTz6pX9W8eDOyH1ckEtDttXk/vlFWCjv00SkjTjtoUrogqp4yEvMyneU9dUJoOLnqFoiHb8IHA==
3271+
enzyme@^3.3.0:
3272+
version "3.9.0"
3273+
resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.9.0.tgz#2b491f06ca966eb56b6510068c7894a7e0be3909"
3274+
integrity sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg==
32613275
dependencies:
3276+
array.prototype.flat "^1.2.1"
32623277
cheerio "^1.0.0-rc.2"
3263-
function.prototype.name "^1.0.3"
3264-
has "^1.0.1"
3278+
function.prototype.name "^1.1.0"
3279+
has "^1.0.3"
3280+
html-element-map "^1.0.0"
32653281
is-boolean-object "^1.0.0"
3266-
is-callable "^1.1.3"
3282+
is-callable "^1.1.4"
32673283
is-number-object "^1.0.3"
3284+
is-regex "^1.0.4"
32683285
is-string "^1.0.4"
32693286
is-subset "^0.1.1"
3270-
lodash "^4.17.4"
3271-
object-inspect "^1.5.0"
3287+
lodash.escape "^4.0.1"
3288+
lodash.isequal "^4.5.0"
3289+
object-inspect "^1.6.0"
32723290
object-is "^1.0.1"
32733291
object.assign "^4.1.0"
32743292
object.entries "^1.0.4"
32753293
object.values "^1.0.4"
32763294
raf "^3.4.0"
32773295
rst-selector-parser "^2.2.3"
3296+
string.prototype.trim "^1.1.2"
32783297

32793298
errno@^0.1.3:
32803299
version "0.1.4"
@@ -3300,9 +3319,10 @@ [email protected]:
33003319
dependencies:
33013320
stackframe "^0.3.1"
33023321

3303-
es-abstract@^1.11.0, es-abstract@^1.12.0:
3322+
es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.0:
33043323
version "1.13.0"
33053324
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
3325+
integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==
33063326
dependencies:
33073327
es-to-primitive "^1.2.0"
33083328
function-bind "^1.1.1"
@@ -4152,7 +4172,7 @@ function-bind@^1.1.1:
41524172
version "1.1.1"
41534173
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
41544174

4155-
function.prototype.name@^1.0.3, function.prototype.name@^1.1.0:
4175+
function.prototype.name@^1.1.0:
41564176
version "1.1.0"
41574177
resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327"
41584178
dependencies:
@@ -4536,6 +4556,13 @@ html-comment-regex@^1.1.0:
45364556
version "1.1.1"
45374557
resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e"
45384558

4559+
html-element-map@^1.0.0:
4560+
version "1.0.0"
4561+
resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.0.tgz#19a41940225153ecdfead74f8509154ff1cdc18b"
4562+
integrity sha512-/SP6aOiM5Ai9zALvCxDubIeez0LvG3qP7R9GcRDnJEP/HBmv0A8A9K0o8+HFudcFt46+i921ANjzKsjPjb7Enw==
4563+
dependencies:
4564+
array-filter "^1.0.0"
4565+
45394566
html-encoding-sniffer@^1.0.2:
45404567
version "1.0.2"
45414568
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
@@ -5997,10 +6024,20 @@ lodash.cond@^4.3.0:
59976024
version "4.5.2"
59986025
resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5"
59996026

6027+
lodash.escape@^4.0.1:
6028+
version "4.0.1"
6029+
resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
6030+
integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
6031+
60006032
lodash.flattendeep@^4.4.0:
60016033
version "4.4.0"
60026034
resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
60036035

6036+
lodash.isequal@^4.5.0:
6037+
version "4.5.0"
6038+
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
6039+
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
6040+
60046041
lodash.memoize@^4.1.2:
60056042
version "4.1.2"
60066043
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
@@ -6928,9 +6965,10 @@ object-inspect@^1.1.0:
69286965
version "1.2.2"
69296966
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.2.2.tgz#c82115e4fcc888aea14d64c22e4f17f6a70d5e5a"
69306967

6931-
object-inspect@^1.5.0:
6932-
version "1.5.0"
6933-
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.5.0.tgz#9d876c11e40f485c79215670281b767488f9bfe3"
6968+
object-inspect@^1.6.0:
6969+
version "1.6.0"
6970+
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
6971+
integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==
69346972

69356973
object-is@^1.0.1:
69366974
version "1.0.1"
@@ -8053,15 +8091,6 @@ react-proxy@^1.1.7:
80538091
lodash "^4.6.1"
80548092
react-deep-force-update "^1.0.0"
80558093

8056-
react-reconciler@^0.7.0:
8057-
version "0.7.0"
8058-
resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.7.0.tgz#9614894103e5f138deeeb5eabaf3ee80eb1d026d"
8059-
dependencies:
8060-
fbjs "^0.8.16"
8061-
loose-envify "^1.1.0"
8062-
object-assign "^4.1.1"
8063-
prop-types "^15.6.0"
8064-
80658094
80668095
version "16.4.0"
80678096
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.0.tgz#0dbe0e24263e94e1830c7afb1f403707fad313a3"
@@ -9256,6 +9285,15 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
92569285
is-fullwidth-code-point "^2.0.0"
92579286
strip-ansi "^4.0.0"
92589287

9288+
string.prototype.trim@^1.1.2:
9289+
version "1.1.2"
9290+
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
9291+
integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=
9292+
dependencies:
9293+
define-properties "^1.1.2"
9294+
es-abstract "^1.5.0"
9295+
function-bind "^1.0.2"
9296+
92599297
string_decoder@^0.10.25, string_decoder@~0.10.x:
92609298
version "0.10.31"
92619299
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"

0 commit comments

Comments
 (0)