@micromag/element-webview 0.3.829 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +14 -0
- package/es/index.js +15 -29
- package/es/styles.css +1 -0
- package/package.json +13 -12
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{height:100%;position:relative;width:100%}.container .iframe{display:block;height:100%;width:100%}.container .top{display:-ms-flexbox;display:flex;left:0;position:absolute;right:0;top:0;width:100%;-ms-flex-pack:end;justify-content:flex-end;padding:5px}.container .close,.container .top{-ms-flex-align:center;align-items:center}.container .close{display:inline-block;display:-ms-flexbox;display:flex;height:32px;position:relative;width:32px;-ms-flex-pack:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;color:#222;cursor:pointer;-webkit-filter:invert(100%);filter:invert(100%);font-family:inherit;justify-content:center;padding:0}.container .icon{line-height:1;margin:0;padding:0;width:1em}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface WebViewProps {
|
|
4
|
+
url?: string | null;
|
|
5
|
+
width?: number | string | null;
|
|
6
|
+
height?: number | string | null;
|
|
7
|
+
closeable?: boolean;
|
|
8
|
+
focusable?: boolean;
|
|
9
|
+
onClose?: ((...args: unknown[]) => void) | null;
|
|
10
|
+
className?: string | null;
|
|
11
|
+
}
|
|
12
|
+
declare function WebView({ url, width, height, closeable, focusable, onClose, className, }: WebViewProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { WebView as default };
|
package/es/index.js
CHANGED
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { useIntl } from 'react-intl';
|
|
6
5
|
import { Close } from '@micromag/core/components';
|
|
7
6
|
import Button from '@micromag/element-button';
|
|
8
7
|
|
|
9
|
-
var styles = {"container":"
|
|
8
|
+
var styles = {"container":"container","iframe":"iframe","top":"top","close":"close"};
|
|
10
9
|
|
|
11
|
-
var propTypes = {
|
|
12
|
-
url: PropTypes.string,
|
|
13
|
-
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
14
|
-
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
15
|
-
closeable: PropTypes.bool,
|
|
16
|
-
focusable: PropTypes.bool,
|
|
17
|
-
onClose: PropTypes.func,
|
|
18
|
-
className: PropTypes.string
|
|
19
|
-
};
|
|
20
|
-
var defaultProps = {
|
|
21
|
-
url: null,
|
|
22
|
-
width: null,
|
|
23
|
-
height: null,
|
|
24
|
-
closeable: false,
|
|
25
|
-
focusable: false,
|
|
26
|
-
onClose: null,
|
|
27
|
-
className: null
|
|
28
|
-
};
|
|
29
10
|
function WebView(_ref) {
|
|
30
|
-
var url = _ref.url,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
var _ref$url = _ref.url,
|
|
12
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
13
|
+
_ref$width = _ref.width,
|
|
14
|
+
width = _ref$width === void 0 ? null : _ref$width,
|
|
15
|
+
_ref$height = _ref.height,
|
|
16
|
+
height = _ref$height === void 0 ? null : _ref$height,
|
|
17
|
+
_ref$closeable = _ref.closeable,
|
|
18
|
+
closeable = _ref$closeable === void 0 ? false : _ref$closeable,
|
|
19
|
+
_ref$focusable = _ref.focusable,
|
|
20
|
+
focusable = _ref$focusable === void 0 ? false : _ref$focusable,
|
|
21
|
+
_ref$onClose = _ref.onClose,
|
|
22
|
+
onClose = _ref$onClose === void 0 ? null : _ref$onClose,
|
|
23
|
+
_ref$className = _ref.className,
|
|
24
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
37
25
|
var intl = useIntl();
|
|
38
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
27
|
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty({}, styles.hidden, !focusable), styles.closeable, closeable), className, className !== null)]),
|
|
@@ -75,7 +63,5 @@ function WebView(_ref) {
|
|
|
75
63
|
allowFullScreen: true
|
|
76
64
|
}));
|
|
77
65
|
}
|
|
78
|
-
WebView.propTypes = propTypes;
|
|
79
|
-
WebView.defaultProps = defaultProps;
|
|
80
66
|
|
|
81
67
|
export { WebView as default };
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{height:100%;position:relative;width:100%}.container .iframe{display:block;height:100%;width:100%}.container .top{display:-ms-flexbox;display:flex;left:0;position:absolute;right:0;top:0;width:100%;-ms-flex-pack:end;justify-content:flex-end;padding:5px}.container .close,.container .top{-ms-flex-align:center;align-items:center}.container .close{display:inline-block;display:-ms-flexbox;display:flex;height:32px;position:relative;width:32px;-ms-flex-pack:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;color:#222;cursor:pointer;-webkit-filter:invert(100%);filter:invert(100%);font-family:inherit;justify-content:center;padding:0}.container .icon{line-height:1;margin:0;padding:0;width:1em}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-webview",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,29 +48,29 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.
|
|
63
|
-
"@micromag/element-button": "^0.
|
|
63
|
+
"@micromag/core": "^0.4.4",
|
|
64
|
+
"@micromag/element-button": "^0.4.4",
|
|
64
65
|
"classnames": "^2.2.6",
|
|
65
|
-
"lodash": "^4.17.
|
|
66
|
-
"
|
|
67
|
-
"react-intl": "^6.6.4",
|
|
66
|
+
"lodash": "^4.17.23",
|
|
67
|
+
"react-intl": "^8.1.3",
|
|
68
68
|
"uuid": "^9.0.0"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public",
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
75
|
+
"types": "es/index.d.ts"
|
|
75
76
|
}
|