@micromag/element-webview 0.3.39
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 -0
- package/es/index.js +68 -0
- package/lib/index.js +79 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.micromag-element-webview-container{position:relative;background-color:#343434}.micromag-element-webview-container,.micromag-element-webview-container .micromag-element-webview-iframe{width:100%;height:100%}.micromag-element-webview-container .micromag-element-webview-close{position:absolute;top:10px;right:10px;border-radius:50%}
|
package/es/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Button from '@micromag/element-button';
|
|
9
|
+
|
|
10
|
+
var styles = {"container":"micromag-element-webview-container","iframe":"micromag-element-webview-iframe","close":"micromag-element-webview-close"};
|
|
11
|
+
|
|
12
|
+
var propTypes = {
|
|
13
|
+
iframeRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
14
|
+
current: PropTypes.any // eslint-disable-line
|
|
15
|
+
|
|
16
|
+
})]),
|
|
17
|
+
src: PropTypes.string,
|
|
18
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
19
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
20
|
+
closeable: PropTypes.bool,
|
|
21
|
+
onClose: PropTypes.func,
|
|
22
|
+
className: PropTypes.string
|
|
23
|
+
};
|
|
24
|
+
var defaultProps = {
|
|
25
|
+
iframeRef: null,
|
|
26
|
+
src: null,
|
|
27
|
+
width: null,
|
|
28
|
+
height: null,
|
|
29
|
+
closeable: false,
|
|
30
|
+
onClose: null,
|
|
31
|
+
className: null
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function WebView(_ref) {
|
|
35
|
+
var _ref2;
|
|
36
|
+
|
|
37
|
+
var iframeRef = _ref.iframeRef,
|
|
38
|
+
src = _ref.src,
|
|
39
|
+
width = _ref.width,
|
|
40
|
+
height = _ref.height,
|
|
41
|
+
closeable = _ref.closeable,
|
|
42
|
+
onClose = _ref.onClose,
|
|
43
|
+
className = _ref.className;
|
|
44
|
+
var size = {
|
|
45
|
+
width: width,
|
|
46
|
+
height: height
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: classNames([styles.container, (_ref2 = {}, _defineProperty(_ref2, styles.closeable, closeable), _defineProperty(_ref2, className, className !== null), _ref2)]),
|
|
50
|
+
style: _objectSpread({}, size)
|
|
51
|
+
}, closeable ? /*#__PURE__*/React.createElement(Button, {
|
|
52
|
+
className: styles.close,
|
|
53
|
+
onClick: onClose
|
|
54
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
55
|
+
className: styles.icon,
|
|
56
|
+
icon: faTimes
|
|
57
|
+
})) : null, /*#__PURE__*/React.createElement("iframe", Object.assign({
|
|
58
|
+
className: styles.iframe,
|
|
59
|
+
ref: iframeRef,
|
|
60
|
+
title: "Popup",
|
|
61
|
+
src: src
|
|
62
|
+
}, size)));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
WebView.propTypes = propTypes;
|
|
66
|
+
WebView.defaultProps = defaultProps;
|
|
67
|
+
|
|
68
|
+
export { WebView as default };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
4
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
6
|
+
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
7
|
+
var classNames = require('classnames');
|
|
8
|
+
var PropTypes = require('prop-types');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var Button = require('@micromag/element-button');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
15
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
17
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
20
|
+
|
|
21
|
+
var styles = {"container":"micromag-element-webview-container","iframe":"micromag-element-webview-iframe","close":"micromag-element-webview-close"};
|
|
22
|
+
|
|
23
|
+
var propTypes = {
|
|
24
|
+
iframeRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
25
|
+
current: PropTypes__default["default"].any // eslint-disable-line
|
|
26
|
+
|
|
27
|
+
})]),
|
|
28
|
+
src: PropTypes__default["default"].string,
|
|
29
|
+
width: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
30
|
+
height: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
31
|
+
closeable: PropTypes__default["default"].bool,
|
|
32
|
+
onClose: PropTypes__default["default"].func,
|
|
33
|
+
className: PropTypes__default["default"].string
|
|
34
|
+
};
|
|
35
|
+
var defaultProps = {
|
|
36
|
+
iframeRef: null,
|
|
37
|
+
src: null,
|
|
38
|
+
width: null,
|
|
39
|
+
height: null,
|
|
40
|
+
closeable: false,
|
|
41
|
+
onClose: null,
|
|
42
|
+
className: null
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function WebView(_ref) {
|
|
46
|
+
var _ref2;
|
|
47
|
+
|
|
48
|
+
var iframeRef = _ref.iframeRef,
|
|
49
|
+
src = _ref.src,
|
|
50
|
+
width = _ref.width,
|
|
51
|
+
height = _ref.height,
|
|
52
|
+
closeable = _ref.closeable,
|
|
53
|
+
onClose = _ref.onClose,
|
|
54
|
+
className = _ref.className;
|
|
55
|
+
var size = {
|
|
56
|
+
width: width,
|
|
57
|
+
height: height
|
|
58
|
+
};
|
|
59
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
60
|
+
className: classNames__default["default"]([styles.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, styles.closeable, closeable), _defineProperty__default["default"](_ref2, className, className !== null), _ref2)]),
|
|
61
|
+
style: _objectSpread__default["default"]({}, size)
|
|
62
|
+
}, closeable ? /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
63
|
+
className: styles.close,
|
|
64
|
+
onClick: onClose
|
|
65
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
66
|
+
className: styles.icon,
|
|
67
|
+
icon: freeSolidSvgIcons.faTimes
|
|
68
|
+
})) : null, /*#__PURE__*/React__default["default"].createElement("iframe", Object.assign({
|
|
69
|
+
className: styles.iframe,
|
|
70
|
+
ref: iframeRef,
|
|
71
|
+
title: "Popup",
|
|
72
|
+
src: src
|
|
73
|
+
}, size)));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
WebView.propTypes = propTypes;
|
|
77
|
+
WebView.defaultProps = defaultProps;
|
|
78
|
+
|
|
79
|
+
module.exports = WebView;
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@micromag/element-webview",
|
|
3
|
+
"version": "0.3.39",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"javascript"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/urbania-media/micromag-js",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/urbania-media/micromag-js.git"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Folklore",
|
|
15
|
+
"email": "info@folklore.email"
|
|
16
|
+
},
|
|
17
|
+
"contributors": [
|
|
18
|
+
{
|
|
19
|
+
"name": "David Mongeau-Petitpas",
|
|
20
|
+
"email": "dmp@folklore.email"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "Nicolas Roy-Bourdages",
|
|
24
|
+
"email": "nrb@folklore.email"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "Julien Carignan",
|
|
28
|
+
"email": "jc@folklore.email"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"main": "lib/index.js",
|
|
33
|
+
"module": "es/index.js",
|
|
34
|
+
"files": [
|
|
35
|
+
"lib",
|
|
36
|
+
"es",
|
|
37
|
+
"assets"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"prepare": "../../scripts/prepare-package.sh"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
44
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
48
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@babel/runtime": "^7.13.10",
|
|
52
|
+
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
53
|
+
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
54
|
+
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
55
|
+
"@micromag/core": "^0.3.39",
|
|
56
|
+
"@micromag/element-button": "^0.3.39",
|
|
57
|
+
"classnames": "^2.2.6",
|
|
58
|
+
"lodash": "^4.17.21",
|
|
59
|
+
"prop-types": "^15.7.2",
|
|
60
|
+
"react-intl": "^5.12.1",
|
|
61
|
+
"uuid": "^8.3.2"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"gitHead": "cda0a9924ae03347ffb2cdbc86d25b0f7e3ae70e"
|
|
67
|
+
}
|