@ringcentral/juno 3.0.0-alpha.12 → 3.0.0-alpha.13

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.
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useEffect, useRef } from 'react';
2
+ import { useRcPortalWindowContext } from '../../contexts/PortalWindowContext';
2
3
  import { useId } from '../useId';
3
4
  export var visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n";
4
5
  /**
@@ -14,7 +15,9 @@ export var visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px
14
15
  export var useAnnouncer = function (id) {
15
16
  var _id = useId(id ? "rc-announcer-".concat(id) : 'rc-announcer', !id);
16
17
  var ref = useRef(null);
18
+ var _a = useRcPortalWindowContext().externalWindow, externalWindow = _a === void 0 ? window : _a;
17
19
  useEffect(function () {
20
+ var document = externalWindow.document;
18
21
  var el = document.createElement('div');
19
22
  ref.current = el;
20
23
  el.id = _id;
@@ -34,7 +37,7 @@ export var useAnnouncer = function (id) {
34
37
  }
35
38
  });
36
39
  };
37
- }, [_id]);
40
+ }, [_id, externalWindow]);
38
41
  /** announce method, call with message that want let reader speak */
39
42
  var announce = useCallback(function (message) {
40
43
  var el = ref.current;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useAnnouncer = exports.visuallyHiddenStyles = void 0;
4
4
  var react_1 = require("react");
5
+ var PortalWindowContext_1 = require("../../contexts/PortalWindowContext");
5
6
  var useId_1 = require("../useId");
6
7
  exports.visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n";
7
8
  /**
@@ -17,7 +18,9 @@ exports.visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1
17
18
  var useAnnouncer = function (id) {
18
19
  var _id = (0, useId_1.useId)(id ? "rc-announcer-".concat(id) : 'rc-announcer', !id);
19
20
  var ref = (0, react_1.useRef)(null);
21
+ var _a = (0, PortalWindowContext_1.useRcPortalWindowContext)().externalWindow, externalWindow = _a === void 0 ? window : _a;
20
22
  (0, react_1.useEffect)(function () {
23
+ var document = externalWindow.document;
21
24
  var el = document.createElement('div');
22
25
  ref.current = el;
23
26
  el.id = _id;
@@ -37,7 +40,7 @@ var useAnnouncer = function (id) {
37
40
  }
38
41
  });
39
42
  };
40
- }, [_id]);
43
+ }, [_id, externalWindow]);
41
44
  /** announce method, call with message that want let reader speak */
42
45
  var announce = (0, react_1.useCallback)(function (message) {
43
46
  var el = ref.current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "3.0.0-alpha.12",
3
+ "version": "3.0.0-alpha.13",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",
@@ -22,15 +22,16 @@
22
22
  "@material-ui/styles": "^4.11.4",
23
23
  "@types/lodash": "^4.14.169",
24
24
  "@types/react-beautiful-dnd": "^13.0.0",
25
+ "@types/styled-components": "5.1.36",
25
26
  "clsx": "^1.0.4",
26
27
  "focus-visible": "^5.1.0",
27
28
  "lodash": "^4.17.21",
28
29
  "react-beautiful-dnd": "^13.0.0",
29
30
  "react-virtuoso": "^4.6.2",
30
31
  "resize-observer-polyfill": "^1.5.1",
31
- "typeface-lato": "^0.0.75",
32
+ "tslib": ">=2.0.0",
32
33
  "type-fest": "^2.12.2",
33
- "tslib": ">=2.0.0"
34
+ "typeface-lato": "^0.0.75"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "@ringcentral/juno-icon": "^1.0.0 || ^2.0.0-alpha.0 || ^3.0.0-alpha.0",