@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.
Files changed (2) hide show
  1. package/es/index.js +106 -42
  2. package/package.json +10 -8
package/es/index.js CHANGED
@@ -1,44 +1,66 @@
1
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
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 { jsxs, jsx } from 'react/jsx-runtime';
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(_ref) {
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;
25
- var intl = useIntl();
26
- return /*#__PURE__*/jsxs("div", {
27
- className: classNames([styles.container, className, _defineProperty(_defineProperty({}, styles.hidden, !focusable), styles.closeable, closeable)]),
28
- style: {
29
- width: width,
30
- height: height
31
- },
32
- children: [closeable ? /*#__PURE__*/jsx("div", {
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, /*#__PURE__*/jsx("iframe", {
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": !focusable ? 'true' : null,
52
- tabIndex: focusable ? '0' : '-1',
53
- title: intl.formatMessage({
54
- id: "17zT4Q",
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.71",
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": "^18.3.0 || ^19.0.0",
55
- "react-dom": "^18.3.0 || ^19.0.0"
56
+ "react": "^19.0.0",
57
+ "react-dom": "^19.0.0"
56
58
  },
57
59
  "peerDependencies": {
58
- "react": "^18.3.0 || ^19.0.0",
59
- "react-dom": "^18.3.0 || ^19.0.0"
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.71",
64
- "@micromag/element-button": "^0.4.71",
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": "9101554bc5761e32b4a002a10d26800608c69773",
76
+ "gitHead": "42a24f578994b23090271013f136b7f78956b632",
75
77
  "types": "es/index.d.ts"
76
78
  }