@arcblock/ux 2.4.2 → 2.4.5
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/lib/ActivityIndicator/index.js +4 -6
- package/lib/Alert/index.js +3 -4
- package/lib/AnimationWaiter/index.js +3 -4
- package/lib/Badge/index.js +3 -3
- package/lib/Blocklet/blocklet.js +4 -6
- package/lib/Blocklet/utils.js +2 -5
- package/lib/BlockletNFT/index.js +4 -6
- package/lib/Center/index.js +3 -4
- package/lib/ClickToCopy/index.js +3 -3
- package/lib/CodeBlock/index.js +3 -4
- package/lib/ContactForm/index.js +3 -3
- package/lib/CookieConsent/index.js +3 -4
- package/lib/CountDown/index.js +3 -4
- package/lib/Datatable/CustomToolbar.js +5 -9
- package/lib/Datatable/TableSearch.js +3 -4
- package/lib/Datatable/index.js +5 -7
- package/lib/Dialog/dialog.js +5 -9
- package/lib/Earth/index.js +4 -6
- package/lib/Empty/index.js +3 -3
- package/lib/ErrorBoundary/fallback.js +4 -7
- package/lib/Footer/index.js +3 -4
- package/lib/Header/auto-hidden.js +3 -3
- package/lib/Header/header.js +4 -8
- package/lib/Header/responsive-header.js +5 -7
- package/lib/Icon/image.js +3 -4
- package/lib/Icon/index.js +3 -4
- package/lib/Img/index.js +3 -3
- package/lib/InfoRow/index.js +3 -5
- package/lib/Layout/dashboard/index.js +5 -9
- package/lib/Layout/dashboard/sidebar.js +3 -5
- package/lib/Layout/dashboard-legacy/header.js +3 -3
- package/lib/Layout/dashboard-legacy/index.js +3 -3
- package/lib/Layout/dashboard-legacy/sidebar.js +5 -7
- package/lib/Layout/index.js +4 -6
- package/lib/Locale/selector.js +4 -7
- package/lib/Logo/index.js +2 -3
- package/lib/Metric/index.js +3 -4
- package/lib/NFTDisplay/aspect-ratio-container.js +2 -4
- package/lib/NFTDisplay/broken.js +3 -3
- package/lib/NFTDisplay/index.js +3 -4
- package/lib/NFTDisplay/loading.js +2 -4
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +4 -6
- package/lib/NavMenu/style.js +4 -7
- package/lib/PricingTable/PricingPlan.js +3 -3
- package/lib/PricingTable/index.js +3 -4
- package/lib/Result/common.js +4 -4
- package/lib/Result/result.js +3 -5
- package/lib/Screenshot/BaseScreenshot/index.js +84 -0
- package/lib/Screenshot/BaseScreenshot/shells/Phone.js +57 -0
- package/lib/Screenshot/index.js +123 -10
- package/lib/SplitButton/index.js +4 -4
- package/lib/Switch/index.js +3 -3
- package/lib/Tabs/index.js +3 -3
- package/lib/Tag/index.js +4 -6
- package/lib/TextCollapse/index.js +2 -2
- package/lib/Theme/index.js +16 -0
- package/lib/Theme/theme-provider.js +3 -8
- package/lib/Theme/theme.js +4 -2
- package/lib/Video/index.js +3 -4
- package/lib/Wallet/Action.js +3 -4
- package/lib/Wallet/Download.js +3 -4
- package/lib/Wallet/Open.js +3 -3
- package/lib/WechatPrompt/index.js +3 -3
- package/lib/withTheme/index.js +18 -40
- package/package.json +4 -4
- package/src/ActivityIndicator/index.js +3 -3
- package/src/Alert/index.js +2 -2
- package/src/AnimationWaiter/index.js +3 -2
- package/src/Badge/index.js +1 -2
- package/src/Blocklet/blocklet.js +2 -3
- package/src/Blocklet/utils.js +2 -2
- package/src/BlockletNFT/index.js +2 -3
- package/src/Center/index.js +3 -2
- package/src/ClickToCopy/index.js +2 -1
- package/src/CodeBlock/index.js +2 -2
- package/src/ContactForm/index.js +2 -3
- package/src/CookieConsent/index.js +3 -2
- package/src/CountDown/index.js +2 -2
- package/src/Datatable/CustomToolbar.js +3 -4
- package/src/Datatable/TableSearch.js +2 -2
- package/src/Datatable/index.js +4 -4
- package/src/Dialog/dialog.js +3 -3
- package/src/Earth/index.js +3 -3
- package/src/Empty/index.js +3 -2
- package/src/ErrorBoundary/fallback.js +2 -3
- package/src/Footer/index.js +2 -2
- package/src/Header/auto-hidden.js +2 -1
- package/src/Header/header.js +2 -3
- package/src/Header/responsive-header.js +1 -2
- package/src/Icon/image.js +2 -2
- package/src/Icon/index.js +2 -2
- package/src/Img/index.js +1 -1
- package/src/InfoRow/index.js +3 -2
- package/src/Layout/dashboard/index.js +2 -3
- package/src/Layout/dashboard/sidebar.js +3 -3
- package/src/Layout/dashboard-legacy/header.js +1 -1
- package/src/Layout/dashboard-legacy/index.js +2 -2
- package/src/Layout/dashboard-legacy/sidebar.js +2 -4
- package/src/Layout/index.js +3 -3
- package/src/Locale/selector.js +2 -4
- package/src/Logo/index.js +3 -2
- package/src/Metric/index.js +2 -2
- package/src/NFTDisplay/aspect-ratio-container.js +3 -2
- package/src/NFTDisplay/broken.js +2 -1
- package/src/NFTDisplay/index.js +3 -2
- package/src/NFTDisplay/loading.js +2 -2
- package/src/NFTDisplay/svg-embedder/inline-svg.js +3 -2
- package/src/NavMenu/style.js +4 -4
- package/src/PricingTable/PricingPlan.js +2 -2
- package/src/PricingTable/index.js +2 -2
- package/src/Result/common.js +1 -1
- package/src/Result/result.js +3 -2
- package/src/Screenshot/BaseScreenshot/index.jsx +77 -0
- package/src/Screenshot/BaseScreenshot/shells/Phone.jsx +33 -0
- package/src/Screenshot/index.js +99 -7
- package/src/SplitButton/index.js +2 -1
- package/src/Switch/index.js +1 -1
- package/src/Tabs/index.js +1 -1
- package/src/Tag/index.js +1 -3
- package/src/TextCollapse/index.js +2 -2
- package/src/Theme/index.js +1 -0
- package/src/Theme/theme-provider.js +4 -7
- package/src/Theme/theme.js +5 -3
- package/src/Video/index.js +2 -3
- package/src/Wallet/Action.js +2 -3
- package/src/Wallet/Download.js +2 -3
- package/src/Wallet/Open.js +2 -1
- package/src/WechatPrompt/index.js +2 -3
- package/src/withTheme/index.js +41 -54
package/lib/Metric/index.js
CHANGED
@@ -7,10 +7,10 @@ exports.default = Metric;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _image = _interopRequireDefault(require("../Icon/image"));
|
13
11
|
|
12
|
+
var _Theme = require("../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
var _templateObject;
|
@@ -74,5 +74,4 @@ Metric.defaultProps = {
|
|
74
74
|
LinkComponent: null,
|
75
75
|
prefix: '/images'
|
76
76
|
};
|
77
|
-
|
78
|
-
const Container = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-left: 1px solid ", ";\n padding: 10px 0 10px 16px;\n @media (max-width: ", "px) {\n padding: 0 0 0 8px;\n }\n\n display: flex;\n justify-items: center;\n align-items: flex-start;\n\n a {\n display: flex;\n justify-items: center;\n align-items: flex-start;\n }\n\n .metric__image {\n margin-right: 8px;\n }\n\n .metric__number {\n margin-bottom: 8px;\n font-size: ", "px;\n font-weight: 600;\n line-height: 36px;\n color: ", ";\n\n small {\n font-size: 12px;\n line-height: 12px;\n }\n\n @media (max-width: ", "px) {\n font-size: ", "px;\n line-height: ", "px;\n margin-bottom: 2px;\n }\n }\n\n .metric__number--animated {\n animation-name: blink-opacity;\n animation-duration: 250ms;\n animation-timing-function: linear;\n animation-iteration-count: 1;\n background-color: transparent !important;\n }\n\n .metric__name {\n font-size: 14px;\n text-transform: capitalize;\n line-height: 1.2;\n font-weight: 500;\n color: ", ";\n @media (max-width: ", "px) {\n font-size: 10px;\n line-height: 1;\n }\n }\n\n @keyframes blink-opacity {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n }\n"])), props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm, props => props.size === 'small' ? 32 : 36, props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm, props => props.size === 'small' ? 24 : 28, props => props.size === 'small' ? 24 : 28, props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm);
|
77
|
+
const Container = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-left: 1px solid ", ";\n padding: 10px 0 10px 16px;\n @media (max-width: ", "px) {\n padding: 0 0 0 8px;\n }\n\n display: flex;\n justify-items: center;\n align-items: flex-start;\n\n a {\n display: flex;\n justify-items: center;\n align-items: flex-start;\n }\n\n .metric__image {\n margin-right: 8px;\n }\n\n .metric__number {\n margin-bottom: 8px;\n font-size: ", "px;\n font-weight: 600;\n line-height: 36px;\n color: ", ";\n\n small {\n font-size: 12px;\n line-height: 12px;\n }\n\n @media (max-width: ", "px) {\n font-size: ", "px;\n line-height: ", "px;\n margin-bottom: 2px;\n }\n }\n\n .metric__number--animated {\n animation-name: blink-opacity;\n animation-duration: 250ms;\n animation-timing-function: linear;\n animation-iteration-count: 1;\n background-color: transparent !important;\n }\n\n .metric__name {\n font-size: 14px;\n text-transform: capitalize;\n line-height: 1.2;\n font-weight: 500;\n color: ", ";\n @media (max-width: ", "px) {\n font-size: 10px;\n line-height: 1;\n }\n }\n\n @keyframes blink-opacity {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n }\n"])), props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm, props => props.size === 'small' ? 32 : 36, props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm, props => props.size === 'small' ? 24 : 28, props => props.size === 'small' ? 24 : 28, props => props.theme.typography.color.main, props => props.theme.breakpoints.values.sm);
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _Theme = require("../Theme");
|
11
11
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
13
13
|
|
@@ -50,13 +50,11 @@ AspectRatioContainer.propTypes = {
|
|
50
50
|
aspect: _propTypes.default.number.isRequired,
|
51
51
|
children: _propTypes.default.node.isRequired
|
52
52
|
};
|
53
|
-
|
54
|
-
const Root = _styled.default.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n position: relative;\n width: 100%;\n height: 0;\n padding-bottom: ", "%;\n\n .aspect-ratio-container__inner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n"])), _ref2 => {
|
53
|
+
const Root = (0, _Theme.styled)('span')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n position: relative;\n width: 100%;\n height: 0;\n padding-bottom: ", "%;\n\n .aspect-ratio-container__inner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n }\n"])), _ref2 => {
|
55
54
|
let {
|
56
55
|
aspect
|
57
56
|
} = _ref2;
|
58
57
|
return 1 / aspect * 100;
|
59
58
|
});
|
60
|
-
|
61
59
|
var _default = AspectRatioContainer;
|
62
60
|
exports.default = _default;
|
package/lib/NFTDisplay/broken.js
CHANGED
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = Broken;
|
7
7
|
|
8
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
9
|
-
|
10
8
|
var _BrokenImage = _interopRequireDefault(require("@mui/icons-material/BrokenImage"));
|
11
9
|
|
10
|
+
var _Theme = require("../Theme");
|
11
|
+
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
13
13
|
|
14
14
|
var _templateObject;
|
@@ -23,4 +23,4 @@ function Broken() {
|
|
23
23
|
});
|
24
24
|
}
|
25
25
|
|
26
|
-
const Root = (0,
|
26
|
+
const Root = (0, _Theme.styled)(_BrokenImage.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n width: 100%;\n max-width: 200px;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n fill: #ddd;\n }\n"])));
|
package/lib/NFTDisplay/index.js
CHANGED
@@ -10,8 +10,6 @@ var _react = require("react");
|
|
10
10
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
12
12
|
|
13
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
14
|
-
|
15
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
16
14
|
|
17
15
|
var _buffer = require("buffer");
|
@@ -34,6 +32,8 @@ var _loading = _interopRequireDefault(require("./loading"));
|
|
34
32
|
|
35
33
|
var _broken = _interopRequireDefault(require("./broken"));
|
36
34
|
|
35
|
+
var _Theme = require("../Theme");
|
36
|
+
|
37
37
|
var _jsxRuntime = require("react/jsx-runtime");
|
38
38
|
|
39
39
|
var _templateObject;
|
@@ -296,8 +296,7 @@ NFTDisplay.defaultProps = {
|
|
296
296
|
minimumLoadingTime: 0,
|
297
297
|
onCompleted: () => {}
|
298
298
|
};
|
299
|
-
|
300
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n /* \u9ED8\u8BA4\u5C3A\u5BF8 */\n width: 150px;\n height: 150px;\n overflow: hidden;\n\n &,\n img {\n max-width: 100%;\n max-height: 100%;\n }\n\n img {\n width: 100%;\n height: 100%;\n }\n\n &.nft-display--inset {\n width: 100%;\n height: 100%;\n }\n"])));
|
299
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n /* \u9ED8\u8BA4\u5C3A\u5BF8 */\n width: 150px;\n height: 150px;\n overflow: hidden;\n\n &,\n img {\n max-width: 100%;\n max-height: 100%;\n }\n\n img {\n width: 100%;\n height: 100%;\n }\n\n &.nft-display--inset {\n width: 100%;\n height: 100%;\n }\n"])));
|
301
300
|
|
302
301
|
function withAspectRatio(Component) {
|
303
302
|
// eslint-disable-next-line func-names, react/prop-types
|
@@ -5,14 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = Loading;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _Theme = require("../Theme");
|
9
9
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
11
11
|
|
12
12
|
var _templateObject;
|
13
13
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
17
15
|
|
18
16
|
function Loading() {
|
@@ -22,4 +20,4 @@ function Loading() {
|
|
22
20
|
});
|
23
21
|
}
|
24
22
|
|
25
|
-
const Root =
|
23
|
+
const Root = (0, _Theme.styled)('span')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n color: #ccc;\n background-color: #eee;\n"])));
|
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _emotion = _interopRequireDefault(require("react-shadow/emotion"));
|
13
11
|
|
12
|
+
var _Theme = require("../../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
var _templateObject, _templateObject2;
|
@@ -52,9 +52,7 @@ function InlineSvg(_ref) {
|
|
52
52
|
InlineSvg.propTypes = {
|
53
53
|
svg: _propTypes.default.string.isRequired
|
54
54
|
};
|
55
|
-
const Root = (0,
|
56
|
-
|
57
|
-
const Inner = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &,\n & > svg {\n height: 100%;\n width: 100%;\n min-width: 100%;\n max-width: 100%;\n }\n"])));
|
58
|
-
|
55
|
+
const Root = (0, _Theme.styled)(_emotion.default.span)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n height: 100%;\n"])));
|
56
|
+
const Inner = (0, _Theme.styled)('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &,\n & > svg {\n height: 100%;\n width: 100%;\n min-width: 100%;\n max-width: 100%;\n }\n"])));
|
59
57
|
var _default = InlineSvg;
|
60
58
|
exports.default = _default;
|
package/lib/NavMenu/style.js
CHANGED
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.InlineStyle = exports.HorizontalStyle = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _Theme = require("../Theme");
|
9
9
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3;
|
11
11
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
15
13
|
|
16
|
-
const NavMenuBase =
|
17
|
-
|
18
|
-
const HorizontalStyle = (0, _styled.default)(NavMenuBase)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 16px;\n .navmenu-root {\n display: flex;\n align-items: center;\n }\n /* \u9876\u7EA7\u83DC\u5355\u95F4\u9694 */\n .navmenu-root > .navmenu-item,\n .navmenu-root > .navmenu-sub {\n margin-left: 24px;\n }\n .navmenu-root > .navmenu-item:first-child,\n .navmenu-root > .navmenu-sub:first-child {\n margin-left: 0;\n }\n\n /* \u5B50\u7EA7\u5217\u8868 */\n .navmenu-sub-container {\n display: none;\n position: absolute;\n top: 100%;\n }\n .navmenu-sub-list {\n padding: 16px;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n .navmenu-item + .navmenu-item {\n margin-top: 8px;\n }\n }\n /* \u4E8C\u7EA7 sub menu */\n .navmenu-root > .navmenu-sub {\n > .navmenu-sub-container {\n left: 50%;\n transform: translateX(-50%);\n padding-top: 16px;\n }\n &.navmenu-sub--opened > .navmenu-sub-container {\n display: block;\n }\n }\n"])));
|
14
|
+
const NavMenuBase = (0, _Theme.styled)('nav')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n font-size: 16px;\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n .navmenu-item,\n .navmenu-sub {\n display: flex;\n align-items: center;\n }\n a {\n color: inherit;\n }\n /* active/hover */\n .navmenu-item,\n .navmenu-sub {\n color: ", ";\n }\n .navmenu-item--active,\n .navmenu-item:hover,\n .navmenu-sub--opened {\n color: ", ";\n }\n\n .navmenu-item {\n position: relative;\n cursor: pointer;\n transition: color 0.2s ease-in-out;\n a {\n text-decoration: none;\n white-space: nowrap;\n }\n a::before {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: transparent;\n content: '';\n }\n }\n\n .navmenu-sub {\n position: relative;\n cursor: pointer;\n }\n /* icon & expand icon */\n .navmenu-item-icon,\n .navmenu-sub-icon,\n .navmenu-sub-expand-icon {\n display: flex;\n line-height: 1;\n }\n .navmenu-item-icon,\n .navmenu-sub-icon {\n margin-right: 4px;\n }\n .navmenu-item-icon > *,\n .navmenu-sub-icon > * {\n width: auto;\n height: 22px;\n max-height: 22px;\n font-size: 1.5em;\n }\n .navmenu-sub-expand-icon {\n margin-left: 8px;\n > * {\n width: 0.8em;\n height: 0.8em;\n transition: transform 0.2s ease-in-out;\n }\n }\n"])), props => props.$bgColor, props => props.$textColor, props => props.$activeTextColor);
|
15
|
+
const HorizontalStyle = (0, _Theme.styled)(NavMenuBase)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 16px;\n .navmenu-root {\n display: flex;\n align-items: center;\n }\n /* \u9876\u7EA7\u83DC\u5355\u95F4\u9694 */\n .navmenu-root > .navmenu-item,\n .navmenu-root > .navmenu-sub {\n margin-left: 24px;\n }\n .navmenu-root > .navmenu-item:first-child,\n .navmenu-root > .navmenu-sub:first-child {\n margin-left: 0;\n }\n\n /* \u5B50\u7EA7\u5217\u8868 */\n .navmenu-sub-container {\n display: none;\n position: absolute;\n top: 100%;\n }\n .navmenu-sub-list {\n padding: 16px;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n .navmenu-item + .navmenu-item {\n margin-top: 8px;\n }\n }\n /* \u4E8C\u7EA7 sub menu */\n .navmenu-root > .navmenu-sub {\n > .navmenu-sub-container {\n left: 50%;\n transform: translateX(-50%);\n padding-top: 16px;\n }\n &.navmenu-sub--opened > .navmenu-sub-container {\n display: block;\n }\n }\n"])));
|
19
16
|
/* inline mode */
|
20
17
|
|
21
18
|
exports.HorizontalStyle = HorizontalStyle;
|
22
|
-
const InlineStyle = (0,
|
19
|
+
const InlineStyle = (0, _Theme.styled)(NavMenuBase)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 16px;\n .navmenu-root {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n }\n .navmenu-item,\n .navmenu-sub {\n padding: 0 16px;\n }\n & .navmenu-sub {\n flex-wrap: wrap;\n }\n /* \u9876\u7EA7 */\n .navmenu-root > .navmenu-item,\n .navmenu-root > .navmenu-sub {\n line-height: 48px;\n border-bottom: 1px solid #eee;\n }\n /* icon */\n .navmenu-item-icon,\n .navmenu-sub-icon {\n width: 30px;\n margin: 0;\n }\n .navmenu-sub-expand-icon {\n margin-left: auto;\n }\n /* \u5B50\u7EA7\u5217\u8868 */\n .navmenu-sub-container {\n display: none;\n flex: 1 0 100%;\n margin: 0 -16px;\n padding-bottom: 8px;\n .navmenu-item,\n .navmenu-sub {\n line-height: 32px;\n }\n }\n .navmenu-sub-list {\n padding-left: 16px;\n .navmenu-item,\n .navmenu-sub {\n padding-left: 30px;\n font-size: 13px;\n }\n }\n /* \u4E8C\u7EA7 menu */\n .navmenu-sub--opened > .navmenu-sub-container {\n display: block;\n }\n"])));
|
23
20
|
exports.InlineStyle = InlineStyle;
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Card = _interopRequireDefault(require("@mui/material/Card"));
|
13
11
|
|
14
12
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
@@ -17,6 +15,8 @@ var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
|
|
17
15
|
|
18
16
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
19
17
|
|
18
|
+
var _Theme = require("../Theme");
|
19
|
+
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
21
21
|
|
22
22
|
var _templateObject;
|
@@ -78,4 +78,4 @@ exports.default = _default;
|
|
78
78
|
PricingPlan.propTypes = {
|
79
79
|
plan: _propTypes.default.object.isRequired
|
80
80
|
};
|
81
|
-
const PlanCard = (0,
|
81
|
+
const PlanCard = (0, _Theme.styled)(_Card.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 500px;\n display: flex;\n flex-direction: column;\n @media (max-width: 320px) {\n margin-top: 20px;\n }\n\n && {\n ", "\n }\n\n .card-header {\n height: 80px;\n background-color: #f1fbfb;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n .title {\n font-size: 18px;\n font-weight: 600;\n text-align: center;\n color: #404040;\n margin: 0;\n }\n }\n\n .card-content {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n flex-grow: 1;\n }\n\n .plan-content {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n\n .plan-pricing {\n display: flex;\n justify-content: center;\n align-items: baseline;\n margin-bottom: 12px;\n color: #4e6af6;\n text-align: center;\n }\n\n .price-number {\n font-size: 30px;\n font-weight: 600;\n color: #4e6af6;\n }\n\n .plan-services strong {\n color: #4e6af6;\n font-weight: 500;\n }\n }\n\n .plan-actions {\n width: 100%;\n }\n"])), props => props.$shadow ? '' : 'box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.1)');
|
@@ -7,12 +7,12 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
13
11
|
|
14
12
|
var _PricingPlan = _interopRequireDefault(require("./PricingPlan"));
|
15
13
|
|
14
|
+
var _Theme = require("../Theme");
|
15
|
+
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
17
17
|
|
18
18
|
var _templateObject;
|
@@ -58,5 +58,4 @@ exports.default = _default;
|
|
58
58
|
PricingTable.propTypes = {
|
59
59
|
plans: _propTypes.default.array.isRequired
|
60
60
|
};
|
61
|
-
|
62
|
-
const Div = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 100px 0;\n text-align: center;\n background-color: ", ";\n @media (max-width: 320px) {\n padding: 50px 0;\n }\n .plan-item {\n @media (max-width: 320px) {\n margin-bottom: 30px;\n }\n }\n"])), props => props.variant === 'even' ? '#fbfbfb' : '#ffffff');
|
61
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 100px 0;\n text-align: center;\n background-color: ", ";\n @media (max-width: 320px) {\n padding: 50px 0;\n }\n .plan-item {\n @media (max-width: 320px) {\n margin-bottom: 30px;\n }\n }\n"])), props => props.variant === 'even' ? '#fbfbfb' : '#ffffff');
|
package/lib/Result/common.js
CHANGED
@@ -11,8 +11,6 @@ exports.InternalServerError = InternalServerError;
|
|
11
11
|
exports.Maintenance = Maintenance;
|
12
12
|
exports.PageNotFound = PageNotFound;
|
13
13
|
|
14
|
-
var _styles = require("@mui/material/styles");
|
15
|
-
|
16
14
|
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
17
15
|
|
18
16
|
var _CancelRounded = _interopRequireDefault(require("@mui/icons-material/CancelRounded"));
|
@@ -23,6 +21,8 @@ var _translations = _interopRequireDefault(require("./translations"));
|
|
23
21
|
|
24
22
|
var _context = require("../Locale/context");
|
25
23
|
|
24
|
+
var _Theme = require("../Theme");
|
25
|
+
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
27
27
|
|
28
28
|
const _excluded = ["locale"],
|
@@ -161,7 +161,7 @@ function Info(props) {
|
|
161
161
|
Info.status = 'info';
|
162
162
|
|
163
163
|
function StyledErrorIcon(props) {
|
164
|
-
const theme = (0,
|
164
|
+
const theme = (0, _Theme.useTheme)();
|
165
165
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CancelRounded.default, _objectSpread({
|
166
166
|
style: {
|
167
167
|
color: theme.palette.error.main,
|
@@ -171,7 +171,7 @@ function StyledErrorIcon(props) {
|
|
171
171
|
}
|
172
172
|
|
173
173
|
function StyledInfoIcon(props) {
|
174
|
-
const theme = (0,
|
174
|
+
const theme = (0, _Theme.useTheme)();
|
175
175
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Info.default, _objectSpread({
|
176
176
|
style: {
|
177
177
|
color: theme.palette.info.main,
|
package/lib/Result/result.js
CHANGED
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
9
|
|
10
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
11
|
-
|
12
10
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
13
11
|
|
12
|
+
var _Theme = require("../Theme");
|
13
|
+
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
15
15
|
|
16
16
|
var _templateObject;
|
@@ -75,8 +75,6 @@ Result.defaultProps = {
|
|
75
75
|
actions: null,
|
76
76
|
extra: undefined
|
77
77
|
};
|
78
|
-
|
79
|
-
const Root = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n padding: 16px;\n\n background-color: #f7f8fb;\n"])));
|
80
|
-
|
78
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n padding: 16px;\n\n background-color: #f7f8fb;\n"])));
|
81
79
|
var _default = Result;
|
82
80
|
exports.default = _default;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _Theme = require("@arcblock/ux/lib/Theme");
|
9
|
+
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
|
+
|
12
|
+
var _Phone = _interopRequireDefault(require("./shells/Phone"));
|
13
|
+
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
15
|
+
|
16
|
+
var _templateObject;
|
17
|
+
|
18
|
+
const _excluded = ["width", "children", "type", "sx"];
|
19
|
+
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
29
|
+
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
31
|
+
|
32
|
+
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
|
+
|
34
|
+
const map = {
|
35
|
+
phone: _Phone.default
|
36
|
+
};
|
37
|
+
|
38
|
+
function Screenshot(_ref) {
|
39
|
+
let {
|
40
|
+
width,
|
41
|
+
children,
|
42
|
+
type,
|
43
|
+
sx
|
44
|
+
} = _ref,
|
45
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
46
|
+
|
47
|
+
const _type = type.toLowerCase();
|
48
|
+
|
49
|
+
const {
|
50
|
+
Shell,
|
51
|
+
ratio,
|
52
|
+
screenData,
|
53
|
+
width: defaultWidth
|
54
|
+
} = map[_type || 'phone'];
|
55
|
+
const Root = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n width: ", ";\n &:after {\n display: block;\n content: '';\n padding-bottom: ", "%;\n }\n > svg {\n display: block;\n }\n\n .screenshot--container {\n position: absolute;\n left: ", "%;\n top: ", "%;\n width: ", "%;\n height: ", "%;\n ", ";\n background-color: #fff;\n overflow: hidden;\n > img {\n display: block;\n width: 100%;\n height: 100%;\n min-width: 100%;\n min-height: 100%;\n }\n }\n\n .absolute-size {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n }\n "])), width || "".concat(defaultWidth, "px"), ratio * 100, screenData.x * 100, screenData.y * 100, screenData.width * 100, screenData.height * 100, screenData.radius ? "border-radius: ".concat(screenData.radius) : '');
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
57
|
+
style: {
|
58
|
+
display: 'flex',
|
59
|
+
justifyContent: 'center'
|
60
|
+
},
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, _objectSpread(_objectSpread({}, rest), {}, {
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Shell, {
|
63
|
+
className: "absolute-size"
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
65
|
+
className: "screenshot--container",
|
66
|
+
children: children
|
67
|
+
})]
|
68
|
+
}))
|
69
|
+
});
|
70
|
+
}
|
71
|
+
|
72
|
+
Screenshot.propTypes = {
|
73
|
+
width: _propTypes.default.number,
|
74
|
+
type: _propTypes.default.string,
|
75
|
+
children: _propTypes.default.node.isRequired,
|
76
|
+
sx: _propTypes.default.object
|
77
|
+
};
|
78
|
+
Screenshot.defaultProps = {
|
79
|
+
width: 0,
|
80
|
+
type: 'phone',
|
81
|
+
sx: {}
|
82
|
+
};
|
83
|
+
var _default = Screenshot;
|
84
|
+
exports.default = _default;
|
@@ -0,0 +1,57 @@
|
|
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
|
+
const width = 268;
|
18
|
+
exports.width = width;
|
19
|
+
const height = 554;
|
20
|
+
exports.height = height;
|
21
|
+
|
22
|
+
function Shell(_ref) {
|
23
|
+
let rest = Object.assign({}, _ref);
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({
|
25
|
+
width: "268",
|
26
|
+
height: "554",
|
27
|
+
viewBox: "0 0 268 554",
|
28
|
+
fill: "none",
|
29
|
+
xmlns: "http://www.w3.org/2000/svg"
|
30
|
+
}, rest), {}, {
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
32
|
+
d: "M37 7.5H230.929C247.222 7.5 260.429 20.7076 260.429 37V517C260.429 533.292 247.222 546.5 230.929 546.5H37C20.7076 546.5 7.5 533.292 7.5 517V37C7.5 20.7076 20.7076 7.5 37 7.5Z",
|
33
|
+
fill: "#2F2F2F",
|
34
|
+
stroke: "#2F2F2F",
|
35
|
+
strokeWidth: "15"
|
36
|
+
})
|
37
|
+
}));
|
38
|
+
}
|
39
|
+
|
40
|
+
const ratio = 798 / 386;
|
41
|
+
exports.ratio = ratio;
|
42
|
+
const screenData = {
|
43
|
+
x: 15 / 384,
|
44
|
+
y: 15 / 794,
|
45
|
+
width: 354 / 384,
|
46
|
+
height: 764 / 794,
|
47
|
+
radius: '10% / 5%'
|
48
|
+
};
|
49
|
+
exports.screenData = screenData;
|
50
|
+
var _default = {
|
51
|
+
Shell,
|
52
|
+
ratio,
|
53
|
+
screenData,
|
54
|
+
width,
|
55
|
+
height
|
56
|
+
};
|
57
|
+
exports.default = _default;
|
package/lib/Screenshot/index.js
CHANGED
@@ -9,17 +9,20 @@ var _react = require("react");
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
13
|
-
|
14
12
|
var _Util = require("../Util");
|
15
13
|
|
14
|
+
var _Theme = require("../Theme");
|
15
|
+
|
16
|
+
var _BaseScreenshot = _interopRequireDefault(require("./BaseScreenshot"));
|
17
|
+
|
16
18
|
require("./devices.css");
|
17
19
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
19
21
|
|
20
|
-
var _templateObject;
|
22
|
+
var _templateObject, _templateObject2;
|
21
23
|
|
22
|
-
const _excluded = ["type", "children", "style", "className", "width", "height"]
|
24
|
+
const _excluded = ["type", "children", "style", "className", "width", "height"],
|
25
|
+
_excluded2 = ["type", "src", "children", "style", "sx"];
|
23
26
|
|
24
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
28
|
|
@@ -143,8 +146,8 @@ const findChildren = function findChildren(children) {
|
|
143
146
|
// If neither of them are found, the whole child tree is rendered
|
144
147
|
|
145
148
|
|
146
|
-
function
|
147
|
-
const newProps = (0, _Util.mergeProps)(props,
|
149
|
+
function OldScreenshot(props) {
|
150
|
+
const newProps = (0, _Util.mergeProps)(props, OldScreenshot, ['style', 'width', 'height']);
|
148
151
|
|
149
152
|
const {
|
150
153
|
type,
|
@@ -188,9 +191,8 @@ function Screenshot(props) {
|
|
188
191
|
}));
|
189
192
|
}
|
190
193
|
|
191
|
-
const Div =
|
192
|
-
|
193
|
-
Screenshot.propTypes = {
|
194
|
+
const Div = (0, _Theme.styled)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n @media (max-width: ", "px) {\n transform-origin: 0 0;\n transform: scale(", ");\n }\n .device-content {\n overflow: hidden;\n }\n .device-content video,\n .device-content img {\n border-radius: ", "px;\n background-color: #fff;\n background-position: center center;\n background-size: cover;\n object-fit: cover;\n width: 100.1%;\n height: 100.1%;\n }\n"])), props => types[props.type].width, props => types[props.type].scale, props => props.contentRadius);
|
195
|
+
OldScreenshot.propTypes = {
|
194
196
|
type: _propTypes.default.oneOf(Object.keys(types)),
|
195
197
|
children: _propTypes.default.any.isRequired,
|
196
198
|
className: _propTypes.default.string,
|
@@ -198,12 +200,123 @@ Screenshot.propTypes = {
|
|
198
200
|
height: _propTypes.default.number,
|
199
201
|
style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string])
|
200
202
|
};
|
201
|
-
|
203
|
+
OldScreenshot.defaultProps = {
|
202
204
|
type: 'iphone-x',
|
203
205
|
className: '',
|
204
206
|
style: '{}',
|
205
207
|
width: 0,
|
206
208
|
height: 0
|
207
209
|
};
|
210
|
+
/**
|
211
|
+
* 用于修正旧版 Screenshot 无法匹配尺寸的问题
|
212
|
+
* @param {*} props params to OldScreenshot
|
213
|
+
* @returns <OldScreenshot />
|
214
|
+
*/
|
215
|
+
|
216
|
+
function ScreenFixer(props) {
|
217
|
+
const screenEl = (0, _react.useRef)(null);
|
218
|
+
const [height, setHeight] = (0, _react.useState)(undefined);
|
219
|
+
const [scale, setScale] = (0, _react.useState)(null);
|
220
|
+
(0, _react.useEffect)(() => {
|
221
|
+
let resizeObs;
|
222
|
+
|
223
|
+
const fixSize = () => {
|
224
|
+
const {
|
225
|
+
clientWidth
|
226
|
+
} = screenEl.current; // 获取内部元素的宽高
|
227
|
+
|
228
|
+
const {
|
229
|
+
clientWidth: targetWidth,
|
230
|
+
clientHeight: targetHeight
|
231
|
+
} = screenEl.current.children[0];
|
232
|
+
const realScale = clientWidth / targetWidth;
|
233
|
+
|
234
|
+
if (realScale < 1) {
|
235
|
+
setScale(realScale);
|
236
|
+
setHeight(realScale * targetHeight);
|
237
|
+
} else {
|
238
|
+
setScale(null);
|
239
|
+
setHeight(undefined);
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
if (screenEl.current) {
|
244
|
+
resizeObs = new ResizeObserver(fixSize);
|
245
|
+
resizeObs.observe(screenEl.current);
|
246
|
+
}
|
247
|
+
|
248
|
+
return () => {
|
249
|
+
if (resizeObs) {
|
250
|
+
resizeObs.disconnect();
|
251
|
+
}
|
252
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
253
|
+
}, [screenEl.current]);
|
254
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ReScreen, {
|
255
|
+
ref: screenEl,
|
256
|
+
style: {
|
257
|
+
height
|
258
|
+
},
|
259
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OldScreenshot, _objectSpread(_objectSpread({}, props), {}, {
|
260
|
+
style: {
|
261
|
+
transform: scale ? "scale(".concat(scale, ")") : undefined
|
262
|
+
}
|
263
|
+
}))
|
264
|
+
});
|
265
|
+
}
|
266
|
+
|
267
|
+
const ReScreen = (0, _Theme.styled)('div')(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n div[type] {\n transform: scale(1);\n transform-origin: 0 0;\n }\n"])));
|
268
|
+
|
269
|
+
function Screenshot(_ref) {
|
270
|
+
let {
|
271
|
+
type,
|
272
|
+
src,
|
273
|
+
children,
|
274
|
+
style,
|
275
|
+
sx
|
276
|
+
} = _ref,
|
277
|
+
rest = _objectWithoutProperties(_ref, _excluded2);
|
278
|
+
|
279
|
+
const _type = type.toLowerCase(); // 新版采用容器采用BaseScreenshot,svg集成,更容易拓展,响应式更好
|
280
|
+
|
281
|
+
|
282
|
+
if (['phone'].includes(_type)) {
|
283
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseScreenshot.default, _objectSpread(_objectSpread({
|
284
|
+
type: _type,
|
285
|
+
sx: _objectSpread(_objectSpread({}, sx), style)
|
286
|
+
}, rest), {}, {
|
287
|
+
children: children || (src ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
288
|
+
src: src,
|
289
|
+
alt: "screenshot"
|
290
|
+
}) : null)
|
291
|
+
}));
|
292
|
+
} // 旧版采用纯css制作,定制性欠缺,暂时保留使用
|
293
|
+
|
294
|
+
|
295
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScreenFixer, _objectSpread(_objectSpread({
|
296
|
+
type: type
|
297
|
+
}, rest), {}, {
|
298
|
+
sx: _objectSpread(_objectSpread(_objectSpread({}, sx), style), {}, {
|
299
|
+
margin: 'auto'
|
300
|
+
}),
|
301
|
+
children: children || (src ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
302
|
+
src: src,
|
303
|
+
alt: "screenshot"
|
304
|
+
}) : null)
|
305
|
+
}));
|
306
|
+
}
|
307
|
+
|
308
|
+
Screenshot.propTypes = {
|
309
|
+
type: _propTypes.default.string.isRequired,
|
310
|
+
src: _propTypes.default.string,
|
311
|
+
style: _propTypes.default.object,
|
312
|
+
sx: _propTypes.default.object,
|
313
|
+
children: _propTypes.default.any
|
314
|
+
};
|
315
|
+
Screenshot.defaultProps = {
|
316
|
+
src: '',
|
317
|
+
children: null,
|
318
|
+
style: {},
|
319
|
+
sx: {}
|
320
|
+
};
|
208
321
|
var _default = Screenshot;
|
209
322
|
exports.default = _default;
|
package/lib/SplitButton/index.js
CHANGED
@@ -9,8 +9,6 @@ var _react = require("react");
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
13
|
-
|
14
12
|
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
15
13
|
|
16
14
|
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
@@ -27,6 +25,8 @@ var _ButtonGroup = _interopRequireDefault(require("@mui/material/ButtonGroup"));
|
|
27
25
|
|
28
26
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
29
27
|
|
28
|
+
var _Theme = require("../Theme");
|
29
|
+
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
31
31
|
|
32
32
|
var _templateObject, _templateObject2;
|
@@ -144,5 +144,5 @@ SplitButton.defaultProps = {
|
|
144
144
|
menuButtonProps: {}
|
145
145
|
};
|
146
146
|
SplitButton.Item = _MenuItem.default;
|
147
|
-
const StyledButtonGroup = (0,
|
148
|
-
const StyledPopper = (0,
|
147
|
+
const StyledButtonGroup = (0, _Theme.styled)(_ButtonGroup.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > .MuiButtonBase-root:last-child {\n min-width: 2em;\n padding-left: 0;\n padding-right: 0;\n }\n"])));
|
148
|
+
const StyledPopper = (0, _Theme.styled)(_Popper.default)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .MuiList-root {\n padding: 4px 0;\n }\n .MuiListItem-root {\n padding-top: 4px;\n padding-bottom: 4px;\n }\n"])));
|