@arcblock/ux 1.15.5 → 1.15.9
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.
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UXCookieConsent = UXCookieConsent;
|
|
7
|
+
exports.default = DefaultCookieConsent;
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
|
|
13
|
+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
14
|
+
|
|
15
|
+
var _reactCookieConsent = _interopRequireDefault(require("react-cookie-consent"));
|
|
16
|
+
|
|
17
|
+
const _excluded = ["style", "contentStyle"];
|
|
18
|
+
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* UXCookieConsent, 目前直接返回 CookieConsent 组件, 定制化要求高的场景可以使用该组件
|
|
33
|
+
* 使用文档参考:https://github.com/Mastermindzh/react-cookie-consent
|
|
34
|
+
*/
|
|
35
|
+
function UXCookieConsent(props) {
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_reactCookieConsent.default, props);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* DefaultCookieConsent, 对 react-cookie-consent package 封装, 以便 arcblock 内部产品可以快速使用
|
|
40
|
+
* - 默认内容
|
|
41
|
+
* - 默认配置/样式
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
function DefaultCookieConsent(_ref) {
|
|
46
|
+
let {
|
|
47
|
+
style,
|
|
48
|
+
contentStyle
|
|
49
|
+
} = _ref,
|
|
50
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_reactCookieConsent.default, Object.assign({
|
|
53
|
+
disableButtonStyles: true,
|
|
54
|
+
ButtonComponent: _Button.default,
|
|
55
|
+
buttonClasses: "MuiButton-contained MuiButton-containedPrimary",
|
|
56
|
+
buttonStyle: {
|
|
57
|
+
margin: '0 16px',
|
|
58
|
+
padding: '6px 16px'
|
|
59
|
+
},
|
|
60
|
+
contentStyle: _objectSpread({
|
|
61
|
+
margin: 16
|
|
62
|
+
}, contentStyle),
|
|
63
|
+
style: _objectSpread({
|
|
64
|
+
boxSizing: 'border-box',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
padding: 16
|
|
67
|
+
}, style)
|
|
68
|
+
}, rest));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
DefaultCookieConsent.propTypes = {
|
|
72
|
+
children: _propTypes.default.any,
|
|
73
|
+
style: _propTypes.default.object,
|
|
74
|
+
contentStyle: _propTypes.default.object
|
|
75
|
+
};
|
|
76
|
+
DefaultCookieConsent.defaultProps = {
|
|
77
|
+
children: /*#__PURE__*/_react.default.createElement("p", {
|
|
78
|
+
style: {
|
|
79
|
+
margin: 0,
|
|
80
|
+
textAlign: 'justify'
|
|
81
|
+
}
|
|
82
|
+
}, "We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from."),
|
|
83
|
+
style: {},
|
|
84
|
+
contentStyle: {}
|
|
85
|
+
};
|
|
@@ -27,7 +27,7 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
27
27
|
|
|
28
28
|
var _Logo = _interopRequireDefault(require("../../Logo"));
|
|
29
29
|
|
|
30
|
-
const _excluded = ["children", "brand", "brandAddon", "description", "addons", "onToggleMenu"];
|
|
30
|
+
const _excluded = ["children", "brand", "brandAddon", "description", "addons", "onToggleMenu", "homeUrl"];
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
@@ -47,7 +47,8 @@ function Header(_ref) {
|
|
|
47
47
|
brandAddon,
|
|
48
48
|
description,
|
|
49
49
|
addons,
|
|
50
|
-
onToggleMenu
|
|
50
|
+
onToggleMenu,
|
|
51
|
+
homeUrl
|
|
51
52
|
} = _ref,
|
|
52
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
53
54
|
|
|
@@ -64,7 +65,7 @@ function Header(_ref) {
|
|
|
64
65
|
className: "header-menu",
|
|
65
66
|
onClick: onToggleMenu
|
|
66
67
|
}, /*#__PURE__*/_react.default.createElement(_Menu.default, null)), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
67
|
-
to:
|
|
68
|
+
to: homeUrl,
|
|
68
69
|
className: "header-link"
|
|
69
70
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
71
|
className: "header-logo"
|
|
@@ -95,10 +96,12 @@ Header.propTypes = {
|
|
|
95
96
|
brandAddon: _propTypes.default.object,
|
|
96
97
|
description: _propTypes.default.string.isRequired,
|
|
97
98
|
children: _propTypes.default.any,
|
|
98
|
-
addons: _propTypes.default.any
|
|
99
|
+
addons: _propTypes.default.any,
|
|
100
|
+
homeUrl: _propTypes.default.string
|
|
99
101
|
};
|
|
100
102
|
Header.defaultProps = {
|
|
101
103
|
children: null,
|
|
102
104
|
addons: null,
|
|
103
|
-
brandAddon: null
|
|
105
|
+
brandAddon: null,
|
|
106
|
+
homeUrl: '/'
|
|
104
107
|
};
|
|
@@ -27,7 +27,7 @@ var _header = _interopRequireDefault(require("./header"));
|
|
|
27
27
|
|
|
28
28
|
var _Footer = _interopRequireDefault(require("../../Footer"));
|
|
29
29
|
|
|
30
|
-
const _excluded = ["children", "title", "brand", "description", "brandAddon", "headerAddon", "images", "links", "prefix", "fullWidth", "contentLayout", "className"];
|
|
30
|
+
const _excluded = ["children", "title", "brand", "description", "brandAddon", "headerAddon", "images", "links", "prefix", "fullWidth", "contentLayout", "className", "homeUrl"];
|
|
31
31
|
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
|
|
@@ -57,7 +57,8 @@ function Dashboard(_ref) {
|
|
|
57
57
|
prefix,
|
|
58
58
|
fullWidth,
|
|
59
59
|
contentLayout,
|
|
60
|
-
className
|
|
60
|
+
className,
|
|
61
|
+
homeUrl
|
|
61
62
|
} = _ref,
|
|
62
63
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
63
64
|
|
|
@@ -88,7 +89,8 @@ function Dashboard(_ref) {
|
|
|
88
89
|
brand: brand,
|
|
89
90
|
brandAddon: brandAddon,
|
|
90
91
|
description: description,
|
|
91
|
-
addons: headerAddon
|
|
92
|
+
addons: headerAddon,
|
|
93
|
+
homeUrl: homeUrl
|
|
92
94
|
}), /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
93
95
|
display: "flex",
|
|
94
96
|
className: "dashboard__body"
|
|
@@ -132,7 +134,8 @@ Dashboard.propTypes = {
|
|
|
132
134
|
// 兼容旧版的设置,新版使用 fullWidth 进行设置
|
|
133
135
|
contentLayout: _propTypes.default.oneOf(['row', 'column']),
|
|
134
136
|
fullWidth: _propTypes.default.bool,
|
|
135
|
-
className: _propTypes.default.string
|
|
137
|
+
className: _propTypes.default.string,
|
|
138
|
+
homeUrl: _propTypes.default.string
|
|
136
139
|
};
|
|
137
140
|
Dashboard.defaultProps = {
|
|
138
141
|
title: 'Home',
|
|
@@ -141,5 +144,6 @@ Dashboard.defaultProps = {
|
|
|
141
144
|
brandAddon: null,
|
|
142
145
|
prefix: '/images',
|
|
143
146
|
fullWidth: false,
|
|
144
|
-
className: ''
|
|
147
|
+
className: '',
|
|
148
|
+
homeUrl: '/'
|
|
145
149
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.9",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=16.12.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "99730b4f055aef5bbc7f67170c17c1fae544f95a",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^1.15.
|
|
58
|
-
"@arcblock/react-hooks": "^1.15.
|
|
57
|
+
"@arcblock/icons": "^1.15.9",
|
|
58
|
+
"@arcblock/react-hooks": "^1.15.9",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@material-ui/core": "^4.12.3",
|
|
61
61
|
"@material-ui/icons": "4.11.2",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"js-cookie": "^2.2.0",
|
|
75
75
|
"lodash": "^4.17.21",
|
|
76
76
|
"mdi-material-ui": "^6.22.1",
|
|
77
|
+
"react-cookie-consent": "^6.4.1",
|
|
77
78
|
"react-helmet": "^5.2.1",
|
|
78
79
|
"react-intersection-observer": "^8.31.1",
|
|
79
80
|
"react-load-script": "^0.0.6",
|