@micromag/element-webview 0.3.488 → 0.3.497
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/es/index.js +24 -9
- package/lib/index.js +24 -9
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -2,41 +2,41 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
5
6
|
import { Close } from '@micromag/core/components';
|
|
6
7
|
import Button from '@micromag/element-button';
|
|
7
8
|
|
|
8
9
|
var styles = {"container":"micromag-element-webview-container","close":"micromag-element-webview-close","iframe":"micromag-element-webview-iframe","top":"micromag-element-webview-top","icon":"micromag-element-webview-icon"};
|
|
9
10
|
|
|
10
11
|
var propTypes = {
|
|
11
|
-
iframeRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
12
|
-
current: PropTypes.any // eslint-disable-line
|
|
13
|
-
})]),
|
|
14
12
|
url: PropTypes.string,
|
|
15
13
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
16
14
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
17
15
|
closeable: PropTypes.bool,
|
|
16
|
+
focusable: PropTypes.bool,
|
|
18
17
|
onClose: PropTypes.func,
|
|
19
18
|
className: PropTypes.string
|
|
20
19
|
};
|
|
21
20
|
var defaultProps = {
|
|
22
|
-
iframeRef: null,
|
|
23
21
|
url: null,
|
|
24
22
|
width: null,
|
|
25
23
|
height: null,
|
|
26
24
|
closeable: false,
|
|
25
|
+
focusable: false,
|
|
27
26
|
onClose: null,
|
|
28
27
|
className: null
|
|
29
28
|
};
|
|
30
29
|
function WebView(_ref) {
|
|
31
|
-
var
|
|
32
|
-
url = _ref.url,
|
|
30
|
+
var url = _ref.url,
|
|
33
31
|
width = _ref.width,
|
|
34
32
|
height = _ref.height,
|
|
35
33
|
closeable = _ref.closeable,
|
|
34
|
+
focusable = _ref.focusable,
|
|
36
35
|
onClose = _ref.onClose,
|
|
37
36
|
className = _ref.className;
|
|
37
|
+
var intl = useIntl();
|
|
38
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.closeable, closeable), className, className !== null)]),
|
|
39
|
+
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty({}, styles.hidden, !focusable), styles.closeable, closeable), className, className !== null)]),
|
|
40
40
|
style: {
|
|
41
41
|
width: width,
|
|
42
42
|
height: height
|
|
@@ -45,13 +45,28 @@ function WebView(_ref) {
|
|
|
45
45
|
className: styles.top
|
|
46
46
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
47
47
|
className: styles.close,
|
|
48
|
+
"aria-label": intl.formatMessage({
|
|
49
|
+
id: "cXt3NU",
|
|
50
|
+
defaultMessage: [{
|
|
51
|
+
"type": 0,
|
|
52
|
+
"value": "Close Popup"
|
|
53
|
+
}]
|
|
54
|
+
}),
|
|
55
|
+
focusable: focusable,
|
|
48
56
|
onClick: onClose
|
|
49
57
|
}, /*#__PURE__*/React.createElement(Close, {
|
|
50
58
|
className: styles.closeIcon
|
|
51
59
|
}))) : null, /*#__PURE__*/React.createElement("iframe", {
|
|
52
60
|
className: styles.iframe,
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
"aria-hidden": !focusable ? 'true' : null,
|
|
62
|
+
tabIndex: focusable ? '0' : '-1',
|
|
63
|
+
title: intl.formatMessage({
|
|
64
|
+
id: "17zT4Q",
|
|
65
|
+
defaultMessage: [{
|
|
66
|
+
"type": 0,
|
|
67
|
+
"value": "Popup"
|
|
68
|
+
}]
|
|
69
|
+
}),
|
|
55
70
|
src: url || 'about:blank'
|
|
56
71
|
}));
|
|
57
72
|
}
|
package/lib/index.js
CHANGED
|
@@ -4,41 +4,41 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var PropTypes = require('prop-types');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var reactIntl = require('react-intl');
|
|
7
8
|
var components = require('@micromag/core/components');
|
|
8
9
|
var Button = require('@micromag/element-button');
|
|
9
10
|
|
|
10
11
|
var styles = {"container":"micromag-element-webview-container","close":"micromag-element-webview-close","iframe":"micromag-element-webview-iframe","top":"micromag-element-webview-top","icon":"micromag-element-webview-icon"};
|
|
11
12
|
|
|
12
13
|
var propTypes = {
|
|
13
|
-
iframeRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
14
|
-
current: PropTypes.any // eslint-disable-line
|
|
15
|
-
})]),
|
|
16
14
|
url: PropTypes.string,
|
|
17
15
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
18
16
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
19
17
|
closeable: PropTypes.bool,
|
|
18
|
+
focusable: PropTypes.bool,
|
|
20
19
|
onClose: PropTypes.func,
|
|
21
20
|
className: PropTypes.string
|
|
22
21
|
};
|
|
23
22
|
var defaultProps = {
|
|
24
|
-
iframeRef: null,
|
|
25
23
|
url: null,
|
|
26
24
|
width: null,
|
|
27
25
|
height: null,
|
|
28
26
|
closeable: false,
|
|
27
|
+
focusable: false,
|
|
29
28
|
onClose: null,
|
|
30
29
|
className: null
|
|
31
30
|
};
|
|
32
31
|
function WebView(_ref) {
|
|
33
|
-
var
|
|
34
|
-
url = _ref.url,
|
|
32
|
+
var url = _ref.url,
|
|
35
33
|
width = _ref.width,
|
|
36
34
|
height = _ref.height,
|
|
37
35
|
closeable = _ref.closeable,
|
|
36
|
+
focusable = _ref.focusable,
|
|
38
37
|
onClose = _ref.onClose,
|
|
39
38
|
className = _ref.className;
|
|
39
|
+
var intl = reactIntl.useIntl();
|
|
40
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.closeable, closeable), className, className !== null)]),
|
|
41
|
+
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty({}, styles.hidden, !focusable), styles.closeable, closeable), className, className !== null)]),
|
|
42
42
|
style: {
|
|
43
43
|
width: width,
|
|
44
44
|
height: height
|
|
@@ -47,13 +47,28 @@ function WebView(_ref) {
|
|
|
47
47
|
className: styles.top
|
|
48
48
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
49
49
|
className: styles.close,
|
|
50
|
+
"aria-label": intl.formatMessage({
|
|
51
|
+
id: "cXt3NU",
|
|
52
|
+
defaultMessage: [{
|
|
53
|
+
"type": 0,
|
|
54
|
+
"value": "Close Popup"
|
|
55
|
+
}]
|
|
56
|
+
}),
|
|
57
|
+
focusable: focusable,
|
|
50
58
|
onClick: onClose
|
|
51
59
|
}, /*#__PURE__*/React.createElement(components.Close, {
|
|
52
60
|
className: styles.closeIcon
|
|
53
61
|
}))) : null, /*#__PURE__*/React.createElement("iframe", {
|
|
54
62
|
className: styles.iframe,
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
"aria-hidden": !focusable ? 'true' : null,
|
|
64
|
+
tabIndex: focusable ? '0' : '-1',
|
|
65
|
+
title: intl.formatMessage({
|
|
66
|
+
id: "17zT4Q",
|
|
67
|
+
defaultMessage: [{
|
|
68
|
+
"type": 0,
|
|
69
|
+
"value": "Popup"
|
|
70
|
+
}]
|
|
71
|
+
}),
|
|
57
72
|
src: url || 'about:blank'
|
|
58
73
|
}));
|
|
59
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-webview",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.497",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
64
64
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
65
65
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
66
|
-
"@micromag/core": "^0.3.
|
|
67
|
-
"@micromag/element-button": "^0.3.
|
|
66
|
+
"@micromag/core": "^0.3.497",
|
|
67
|
+
"@micromag/element-button": "^0.3.497",
|
|
68
68
|
"classnames": "^2.2.6",
|
|
69
69
|
"lodash": "^4.17.21",
|
|
70
70
|
"prop-types": "^15.7.2",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"access": "public",
|
|
76
76
|
"registry": "https://registry.npmjs.org/"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "94e795f19f551f20411fb12fada0906c5cdb0d4b"
|
|
79
79
|
}
|