@arcblock/ux 2.4.22 → 2.4.23

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.
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _Phone = _interopRequireDefault(require("./shells/Phone"));
13
13
 
14
+ var _Macbook = _interopRequireDefault(require("./shells/Macbook"));
15
+
14
16
  var _jsxRuntime = require("react/jsx-runtime");
15
17
 
16
18
  var _templateObject;
@@ -32,7 +34,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
32
34
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
33
35
 
34
36
  const map = {
35
- phone: _Phone.default
37
+ phone: _Phone.default,
38
+ macbook: _Macbook.default
36
39
  };
37
40
 
38
41
  function Screenshot(_ref) {
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Shell = Shell;
7
+ exports.width = exports.screenData = exports.ratio = exports.height = exports.default = void 0;
8
+
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14
+
15
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
+
17
+ function Shell(_ref) {
18
+ let rest = Object.assign({}, _ref);
19
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", _objectSpread(_objectSpread({
20
+ width: "909",
21
+ height: "517",
22
+ viewBox: "0 0 909 517",
23
+ fill: "none",
24
+ xmlns: "http://www.w3.org/2000/svg"
25
+ }, rest), {}, {
26
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
27
+ d: "M48 16C48 7.16343 55.1634 0 64 0H845C853.837 0 861 7.16344 861 16V490H48V16Z",
28
+ fill: "black"
29
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
30
+ fillRule: "evenodd",
31
+ clipRule: "evenodd",
32
+ d: "M62 28H847V466H62V28Z"
33
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
34
+ d: "M0 490H909V493C909 506.255 898.255 517 885 517H24C10.7452 517 0 506.255 0 493V490Z",
35
+ fill: "#282828"
36
+ })]
37
+ }));
38
+ } // 设备截图的实际尺寸
39
+
40
+
41
+ const width = 909;
42
+ exports.width = width;
43
+ const height = 517; // 屏幕的比例
44
+
45
+ exports.height = height;
46
+ const ratio = 438 / 785; // 屏幕相关数据
47
+
48
+ exports.ratio = ratio;
49
+ const screenData = {
50
+ // 屏幕坐标轴相对图片的百分比
51
+ x: 68 / 909,
52
+ y: 28 / 517,
53
+ // 屏幕尺寸相对图片尺寸的百分比
54
+ width: 773 / 909,
55
+ height: 438 / 517,
56
+ // 是否有圆角
57
+ radius: 'none'
58
+ };
59
+ exports.screenData = screenData;
60
+ var _default = {
61
+ Shell,
62
+ ratio,
63
+ screenData,
64
+ width,
65
+ height
66
+ };
67
+ exports.default = _default;
@@ -279,7 +279,7 @@ function Screenshot(_ref) {
279
279
  const _type = type.toLowerCase(); // 新版采用容器采用BaseScreenshot,svg集成,更容易拓展,响应式更好
280
280
 
281
281
 
282
- if (['phone'].includes(_type)) {
282
+ if (['phone', 'macbook'].includes(_type)) {
283
283
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseScreenshot.default, _objectSpread(_objectSpread({
284
284
  type: _type,
285
285
  sx: _objectSpread(_objectSpread({}, sx), style)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.4.22",
3
+ "version": "2.4.23",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -47,10 +47,10 @@
47
47
  "react": ">=18.1.0",
48
48
  "react-ga": "^2.7.0"
49
49
  },
50
- "gitHead": "a8e5f9c2a89b99064c6a085b6cc1a3042095ecf4",
50
+ "gitHead": "2a53c85d0567c3534060d8f38ab05279d7e39d15",
51
51
  "dependencies": {
52
- "@arcblock/icons": "^2.4.22",
53
- "@arcblock/react-hooks": "^2.4.22",
52
+ "@arcblock/icons": "^2.4.23",
53
+ "@arcblock/react-hooks": "^2.4.23",
54
54
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
55
  "@emotion/react": "^11.10.0",
56
56
  "@emotion/styled": "^11.10.0",
@@ -2,9 +2,11 @@ import { styled } from '@arcblock/ux/lib/Theme';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  import phone from './shells/Phone';
5
+ import macbook from './shells/Macbook';
5
6
 
6
7
  const map = {
7
8
  phone,
9
+ macbook,
8
10
  };
9
11
 
10
12
  function Screenshot({ width, children, type, sx, ...rest }) {
@@ -0,0 +1,36 @@
1
+ export function Shell({ ...rest }) {
2
+ return (
3
+ <svg width="909" height="517" viewBox="0 0 909 517" fill="none" xmlns="http://www.w3.org/2000/svg" {...rest}>
4
+ <path d="M48 16C48 7.16343 55.1634 0 64 0H845C853.837 0 861 7.16344 861 16V490H48V16Z" fill="black" />
5
+ <path fillRule="evenodd" clipRule="evenodd" d="M62 28H847V466H62V28Z" />
6
+ <path d="M0 490H909V493C909 506.255 898.255 517 885 517H24C10.7452 517 0 506.255 0 493V490Z" fill="#282828" />
7
+ </svg>
8
+ );
9
+ }
10
+
11
+ // 设备截图的实际尺寸
12
+ export const width = 909;
13
+ export const height = 517;
14
+
15
+ // 屏幕的比例
16
+ export const ratio = 438 / 785;
17
+
18
+ // 屏幕相关数据
19
+ export const screenData = {
20
+ // 屏幕坐标轴相对图片的百分比
21
+ x: 68 / 909,
22
+ y: 28 / 517,
23
+ // 屏幕尺寸相对图片尺寸的百分比
24
+ width: 773 / 909,
25
+ height: 438 / 517,
26
+ // 是否有圆角
27
+ radius: 'none',
28
+ };
29
+
30
+ export default {
31
+ Shell,
32
+ ratio,
33
+ screenData,
34
+ width,
35
+ height,
36
+ };
@@ -242,7 +242,7 @@ function Screenshot({ type, src, children, style, sx, ...rest }) {
242
242
  const _type = type.toLowerCase();
243
243
 
244
244
  // 新版采用容器采用BaseScreenshot,svg集成,更容易拓展,响应式更好
245
- if (['phone'].includes(_type)) {
245
+ if (['phone', 'macbook'].includes(_type)) {
246
246
  return (
247
247
  <BaseScreenshot type={_type} sx={{ ...sx, ...style }} {...rest}>
248
248
  {children || (src ? <img src={src} alt="screenshot" /> : null)}