@micromag/element-webview 0.4.71 → 0.4.76
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 +106 -42
- package/package.json +10 -8
package/es/index.js
CHANGED
|
@@ -1,44 +1,66 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Close } from '@micromag/core/components';
|
|
5
5
|
import Button from '@micromag/element-button';
|
|
6
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var styles = {"container":"micromag-element-webview-container","iframe":"micromag-element-webview-iframe","top":"micromag-element-webview-top","close":"micromag-element-webview-close"};
|
|
9
9
|
|
|
10
|
-
function WebView(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
width
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
function WebView(t0) {
|
|
11
|
+
const $ = c(24);
|
|
12
|
+
const {
|
|
13
|
+
url: t1,
|
|
14
|
+
width: t2,
|
|
15
|
+
height: t3,
|
|
16
|
+
closeable: t4,
|
|
17
|
+
focusable: t5,
|
|
18
|
+
onClose: t6,
|
|
19
|
+
className: t7
|
|
20
|
+
} = t0;
|
|
21
|
+
const url = t1 === undefined ? null : t1;
|
|
22
|
+
const width = t2 === undefined ? null : t2;
|
|
23
|
+
const height = t3 === undefined ? null : t3;
|
|
24
|
+
const closeable = t4 === undefined ? false : t4;
|
|
25
|
+
const focusable = t5 === undefined ? false : t5;
|
|
26
|
+
const onClose = t6 === undefined ? null : t6;
|
|
27
|
+
const className = t7 === undefined ? null : t7;
|
|
28
|
+
const intl = useIntl();
|
|
29
|
+
const t8 = !focusable;
|
|
30
|
+
let t9;
|
|
31
|
+
if ($[0] !== className || $[1] !== closeable || $[2] !== t8) {
|
|
32
|
+
t9 = classNames([styles.container, className, {
|
|
33
|
+
[styles.hidden]: t8,
|
|
34
|
+
[styles.closeable]: closeable
|
|
35
|
+
}]);
|
|
36
|
+
$[0] = className;
|
|
37
|
+
$[1] = closeable;
|
|
38
|
+
$[2] = t8;
|
|
39
|
+
$[3] = t9;
|
|
40
|
+
} else {
|
|
41
|
+
t9 = $[3];
|
|
42
|
+
}
|
|
43
|
+
let t10;
|
|
44
|
+
if ($[4] !== height || $[5] !== width) {
|
|
45
|
+
t10 = {
|
|
46
|
+
width,
|
|
47
|
+
height
|
|
48
|
+
};
|
|
49
|
+
$[4] = height;
|
|
50
|
+
$[5] = width;
|
|
51
|
+
$[6] = t10;
|
|
52
|
+
} else {
|
|
53
|
+
t10 = $[6];
|
|
54
|
+
}
|
|
55
|
+
let t11;
|
|
56
|
+
if ($[7] !== closeable || $[8] !== focusable || $[9] !== intl || $[10] !== onClose) {
|
|
57
|
+
t11 = closeable ? /*#__PURE__*/jsx("div", {
|
|
33
58
|
className: styles.top,
|
|
34
59
|
children: /*#__PURE__*/jsx(Button, {
|
|
35
60
|
className: styles.close,
|
|
36
61
|
"aria-label": intl.formatMessage({
|
|
37
62
|
id: "cXt3NU",
|
|
38
|
-
defaultMessage:
|
|
39
|
-
"type": 0,
|
|
40
|
-
"value": "Close Popup"
|
|
41
|
-
}]
|
|
63
|
+
defaultMessage: "Close Popup"
|
|
42
64
|
}),
|
|
43
65
|
focusable: focusable,
|
|
44
66
|
onClick: onClose,
|
|
@@ -46,23 +68,65 @@ function WebView(_ref) {
|
|
|
46
68
|
className: styles.closeIcon
|
|
47
69
|
})
|
|
48
70
|
})
|
|
49
|
-
}) : null
|
|
71
|
+
}) : null;
|
|
72
|
+
$[7] = closeable;
|
|
73
|
+
$[8] = focusable;
|
|
74
|
+
$[9] = intl;
|
|
75
|
+
$[10] = onClose;
|
|
76
|
+
$[11] = t11;
|
|
77
|
+
} else {
|
|
78
|
+
t11 = $[11];
|
|
79
|
+
}
|
|
80
|
+
const t12 = !focusable ? "true" : null;
|
|
81
|
+
const t13 = focusable ? "0" : "-1";
|
|
82
|
+
let t14;
|
|
83
|
+
if ($[12] !== intl) {
|
|
84
|
+
t14 = intl.formatMessage({
|
|
85
|
+
id: "17zT4Q",
|
|
86
|
+
defaultMessage: "Popup"
|
|
87
|
+
});
|
|
88
|
+
$[12] = intl;
|
|
89
|
+
$[13] = t14;
|
|
90
|
+
} else {
|
|
91
|
+
t14 = $[13];
|
|
92
|
+
}
|
|
93
|
+
const t15 = url || "about:blank";
|
|
94
|
+
let t16;
|
|
95
|
+
if ($[14] !== t12 || $[15] !== t13 || $[16] !== t14 || $[17] !== t15) {
|
|
96
|
+
t16 = /*#__PURE__*/jsx("iframe", {
|
|
50
97
|
className: styles.iframe,
|
|
51
|
-
"aria-hidden":
|
|
52
|
-
tabIndex:
|
|
53
|
-
title:
|
|
54
|
-
|
|
55
|
-
defaultMessage: [{
|
|
56
|
-
"type": 0,
|
|
57
|
-
"value": "Popup"
|
|
58
|
-
}]
|
|
59
|
-
}),
|
|
60
|
-
src: url || 'about:blank',
|
|
98
|
+
"aria-hidden": t12,
|
|
99
|
+
tabIndex: t13,
|
|
100
|
+
title: t14,
|
|
101
|
+
src: t15,
|
|
61
102
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
62
103
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
63
104
|
allowFullScreen: true
|
|
64
|
-
})
|
|
65
|
-
|
|
105
|
+
});
|
|
106
|
+
$[14] = t12;
|
|
107
|
+
$[15] = t13;
|
|
108
|
+
$[16] = t14;
|
|
109
|
+
$[17] = t15;
|
|
110
|
+
$[18] = t16;
|
|
111
|
+
} else {
|
|
112
|
+
t16 = $[18];
|
|
113
|
+
}
|
|
114
|
+
let t17;
|
|
115
|
+
if ($[19] !== t10 || $[20] !== t11 || $[21] !== t16 || $[22] !== t9) {
|
|
116
|
+
t17 = /*#__PURE__*/jsxs("div", {
|
|
117
|
+
className: t9,
|
|
118
|
+
style: t10,
|
|
119
|
+
children: [t11, t16]
|
|
120
|
+
});
|
|
121
|
+
$[19] = t10;
|
|
122
|
+
$[20] = t11;
|
|
123
|
+
$[21] = t16;
|
|
124
|
+
$[22] = t9;
|
|
125
|
+
$[23] = t17;
|
|
126
|
+
} else {
|
|
127
|
+
t17 = $[23];
|
|
128
|
+
}
|
|
129
|
+
return t17;
|
|
66
130
|
}
|
|
67
131
|
|
|
68
132
|
export { WebView as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-webview",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.76",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"style": "./assets/css/styles.css",
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
37
38
|
"types": "./es/index.d.ts",
|
|
39
|
+
"style": "./assets/css/styles.css",
|
|
38
40
|
"import": "./es/index.js"
|
|
39
41
|
},
|
|
40
42
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -51,17 +53,17 @@
|
|
|
51
53
|
"build": "../../scripts/prepare-package.sh --types"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
60
62
|
},
|
|
61
63
|
"dependencies": {
|
|
62
64
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
64
|
-
"@micromag/element-button": "^0.4.
|
|
65
|
+
"@micromag/core": "^0.4.74",
|
|
66
|
+
"@micromag/element-button": "^0.4.76",
|
|
65
67
|
"classnames": "^2.2.6",
|
|
66
68
|
"lodash": "^4.17.23",
|
|
67
69
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -71,6 +73,6 @@
|
|
|
71
73
|
"access": "public",
|
|
72
74
|
"registry": "https://registry.npmjs.org/"
|
|
73
75
|
},
|
|
74
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "42a24f578994b23090271013f136b7f78956b632",
|
|
75
77
|
"types": "es/index.d.ts"
|
|
76
78
|
}
|