@fonixtree/magic-design 0.0.61 → 0.0.62
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/assets/less/modal.less +7 -2
- package/es/common/ButtonIconLayout/index.less +4 -2
- package/es/common/Collapse/index.js +16 -3
- package/es/common/ImageModal/index.less +6 -1
- package/es/common/UrlPicker/index.js +6 -2
- package/es/common/UrlPicker/index.less +12 -1
- package/es/composite-comp/bol/components/Banner/mobile/index.js +3 -5
- package/es/composite-comp/bol/components/Banner/pc/index.js +3 -2
- package/es/composite-comp/bol/components/ImageText/defaultJSON.js +0 -145
- package/es/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +3 -1
- package/es/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +2 -2
- package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +8 -12
- package/es/composite-comp/dito/components/MobileNavigation/defaultJSON.js +2 -1
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/es/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/es/composite-comp/dito/components/Recommend/defaultJSON.js +20 -4
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
- package/es/composite-comp/dito/components/Recommend/mobile/index.less +14 -7
- package/es/composite-comp/dito/components/Recommend/pc/index.js +4 -2
- package/es/composite-comp/dito/components/Recommend/pc/index.less +14 -7
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +8 -1
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/es/core/Designer/ConfigPanel/TerminalSelect/index.js +3 -3
- package/es/core/Designer/QuickMenuBar/index.js +3 -9
- package/es/core/Designer/index.js +6 -4
- package/es/decorator/metaDecorator.js +5 -3
- package/es/meta-comp/components/Button/index.less +4 -1
- package/es/meta-comp/components/Image/index.less +1 -0
- package/es/meta-comp/components/Text/index.js +8 -0
- package/es/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +12 -9
- package/es/meta-comp/config-panels/ImageConfig/index.js +4 -0
- package/es/mobx/Store.js +5 -2
- package/es/utils/coreUtil.js +1 -1
- package/lib/assets/less/modal.less +7 -2
- package/lib/common/ButtonIconLayout/index.less +4 -2
- package/lib/common/Collapse/index.js +16 -3
- package/lib/common/ImageModal/index.less +6 -1
- package/lib/common/UrlPicker/index.js +6 -2
- package/lib/common/UrlPicker/index.less +12 -1
- package/lib/composite-comp/bol/components/Banner/mobile/index.js +3 -5
- package/lib/composite-comp/bol/components/Banner/pc/index.js +3 -2
- package/lib/composite-comp/bol/components/ImageText/defaultJSON.js +0 -145
- package/lib/composite-comp/bol/config-panels/CarouselConfig/CarouselConfigImageGroup/index.js +3 -1
- package/lib/composite-comp/bol/second-config-panels/ImageTextSecondConfig/index.js +2 -2
- package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +8 -12
- package/lib/composite-comp/dito/components/MobileNavigation/defaultJSON.js +2 -1
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +13 -3
- package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.less +3 -2
- package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +20 -4
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +4 -2
- package/lib/composite-comp/dito/components/Recommend/mobile/index.less +14 -7
- package/lib/composite-comp/dito/components/Recommend/pc/index.js +4 -2
- package/lib/composite-comp/dito/components/Recommend/pc/index.less +14 -7
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +8 -1
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +39 -29
- package/lib/core/Designer/ConfigPanel/TerminalSelect/index.js +3 -3
- package/lib/core/Designer/QuickMenuBar/index.js +3 -9
- package/lib/core/Designer/index.js +6 -4
- package/lib/decorator/metaDecorator.js +5 -3
- package/lib/meta-comp/components/Button/index.less +4 -1
- package/lib/meta-comp/components/Image/index.less +1 -0
- package/lib/meta-comp/components/Text/index.js +8 -0
- package/lib/meta-comp/config-panels/ImageConfig/HotAreaConfig/index.js +12 -9
- package/lib/meta-comp/config-panels/ImageConfig/index.js +4 -0
- package/lib/mobx/Store.js +5 -2
- package/lib/utils/coreUtil.js +1 -1
- package/package.json +1 -86
- package/README.md +0 -320
|
@@ -11,8 +11,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _mobx = require("../../../mobx");
|
|
15
|
-
|
|
16
14
|
var _Button = _interopRequireDefault(require("../../../common/Button"));
|
|
17
15
|
|
|
18
16
|
var _Iconfont = _interopRequireDefault(require("../../../common/Iconfont"));
|
|
@@ -82,13 +80,9 @@ function (_super) {
|
|
|
82
80
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
83
81
|
|
|
84
82
|
_this.onBtnClick = function (event) {
|
|
85
|
-
var code = event.currentTarget.dataset.code;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_mobx.store.setState({
|
|
89
|
-
clickedFloor: ''
|
|
90
|
-
});
|
|
91
|
-
}
|
|
83
|
+
var code = event.currentTarget.dataset.code; // if (code === quickMenuCode.SAVE || code === quickMenuCode.PUBLISH) {
|
|
84
|
+
// store.setState({ clickedFloor: '' });
|
|
85
|
+
// }
|
|
92
86
|
|
|
93
87
|
if (_this.props.device === _constants.deviceTypeMap.PC) {}
|
|
94
88
|
|
|
@@ -97,11 +97,13 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
|
97
97
|
return r;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
+
window.magicDesign = {
|
|
101
|
+
mode: 'designer',
|
|
102
|
+
device: _constants.deviceTypeMap.PHONE
|
|
103
|
+
};
|
|
104
|
+
|
|
100
105
|
var setDesignConfig = function setDesignConfig(data) {
|
|
101
|
-
window.magicDesign = __assign(__assign({
|
|
102
|
-
mode: 'designer',
|
|
103
|
-
device: _constants.deviceTypeMap.PHONE
|
|
104
|
-
}, data), {
|
|
106
|
+
window.magicDesign = __assign(__assign(__assign({}, window.magicDesign), data), {
|
|
105
107
|
MBaseUrl: data.MBaseUrl || ''
|
|
106
108
|
});
|
|
107
109
|
};
|
|
@@ -79,7 +79,8 @@ function metaDecorator(WrappedComponent) {
|
|
|
79
79
|
event.preventDefault();
|
|
80
80
|
event.stopPropagation();
|
|
81
81
|
var parentId = (_a = _this.props.data) === null || _a === void 0 ? void 0 : _a.parentId;
|
|
82
|
-
var
|
|
82
|
+
var conentId = (_b = _this.props.data) === null || _b === void 0 ? void 0 : _b.contentId;
|
|
83
|
+
var metaId = (_c = _this.props.data) === null || _c === void 0 ? void 0 : _c.id;
|
|
83
84
|
var floorId = null; // group中的元组件
|
|
84
85
|
|
|
85
86
|
if (parentId) {
|
|
@@ -90,9 +91,10 @@ function metaDecorator(WrappedComponent) {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
_mobx.store.setState({
|
|
93
|
-
clickedMeta:
|
|
94
|
+
clickedMeta: metaId,
|
|
94
95
|
clickedGroup: parentId,
|
|
95
|
-
clickedFloor: floorId
|
|
96
|
+
clickedFloor: floorId,
|
|
97
|
+
clickedMetaParent: conentId
|
|
96
98
|
});
|
|
97
99
|
};
|
|
98
100
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
.btnContent {
|
|
5
5
|
width: 100%;
|
|
6
6
|
cursor: pointer;
|
|
7
|
-
display:
|
|
7
|
+
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: center;
|
|
10
10
|
flex-direction: column;
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
.item {
|
|
17
17
|
width: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
img {
|
|
@@ -439,6 +439,14 @@ function (_super) {
|
|
|
439
439
|
textDecorationColor: data.underline.textDecorationColor,
|
|
440
440
|
textDecorationStyle: data.underline.textDecorationStyle
|
|
441
441
|
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (data === null || data === void 0 ? void 0 : data.spacing) {
|
|
445
|
+
if ((0, _coreUtil.isPc)()) {
|
|
446
|
+
style = __assign(__assign({}, style), data.spacing.pc);
|
|
447
|
+
} else {
|
|
448
|
+
style = __assign(__assign({}, style), data.spacing.mobile);
|
|
449
|
+
}
|
|
442
450
|
} // const style: React.CSSProperties = {
|
|
443
451
|
// ...contentStyle(data.content),
|
|
444
452
|
// textDecorationLine: data?.underline.open ? 'underline' : 'none',
|
|
@@ -53,12 +53,12 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
53
53
|
};
|
|
54
54
|
}();
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var HotAreaConfig =
|
|
57
57
|
/** @class */
|
|
58
58
|
function (_super) {
|
|
59
|
-
__extends(
|
|
59
|
+
__extends(HotAreaConfig, _super);
|
|
60
60
|
|
|
61
|
-
function
|
|
61
|
+
function HotAreaConfig() {
|
|
62
62
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
63
63
|
|
|
64
64
|
_this.state = {
|
|
@@ -66,11 +66,14 @@ function (_super) {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
_this.onCheckboxChange = function (e) {
|
|
69
|
-
var
|
|
69
|
+
var _a = _this.props,
|
|
70
|
+
option = _a.option,
|
|
71
|
+
onChange = _a.onChange;
|
|
70
72
|
console.log(e.target.checked);
|
|
71
|
-
option.
|
|
73
|
+
option.clickUrl = '';
|
|
74
|
+
option.openHotArea = e.target.checked; // this.setState({});
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
onChange();
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
_this.onAddArea = function () {
|
|
@@ -100,7 +103,7 @@ function (_super) {
|
|
|
100
103
|
return _this;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
HotAreaConfig.prototype.render = function () {
|
|
104
107
|
var option = this.props.option;
|
|
105
108
|
var visible = this.state.visible;
|
|
106
109
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -123,8 +126,8 @@ function (_super) {
|
|
|
123
126
|
}));
|
|
124
127
|
};
|
|
125
128
|
|
|
126
|
-
return
|
|
129
|
+
return HotAreaConfig;
|
|
127
130
|
}(_react.Component);
|
|
128
131
|
|
|
129
|
-
var _default =
|
|
132
|
+
var _default = HotAreaConfig;
|
|
130
133
|
exports["default"] = _default;
|
|
@@ -314,10 +314,14 @@ function (_super) {
|
|
|
314
314
|
value: selectImg
|
|
315
315
|
}), selectImg && /*#__PURE__*/_react["default"].createElement(_HotAreaConfig["default"], {
|
|
316
316
|
imgUrl: selectImg,
|
|
317
|
+
onChange: function onChange() {
|
|
318
|
+
return _this.setState({});
|
|
319
|
+
},
|
|
317
320
|
option: data.content
|
|
318
321
|
}), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
319
322
|
title: "URL"
|
|
320
323
|
}, /*#__PURE__*/_react["default"].createElement(_common.UrlPicker, {
|
|
324
|
+
disabled: data.content.openHotArea,
|
|
321
325
|
onChange: function onChange(v) {
|
|
322
326
|
data.content.clickUrl = v;
|
|
323
327
|
|
package/lib/mobx/Store.js
CHANGED
|
@@ -14,7 +14,7 @@ var _storeUtil = require("../utils/storeUtil");
|
|
|
14
14
|
var debug = require('debug')('worker:mobx');
|
|
15
15
|
|
|
16
16
|
var CACHE_KEY = 'STORE';
|
|
17
|
-
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedFloor', 'textSelection', 'MPageData'];
|
|
17
|
+
var whiteList = ['hoveredMeta', 'clickedMeta', 'clickedGroup', 'clickedMetaParent', 'clickedFloor', 'textSelection', 'MPageData'];
|
|
18
18
|
|
|
19
19
|
var Store =
|
|
20
20
|
/** @class */
|
|
@@ -26,7 +26,9 @@ function () {
|
|
|
26
26
|
|
|
27
27
|
this.clickedMeta = ''; // 点击的元组件Id
|
|
28
28
|
|
|
29
|
-
this.clickedGroup = ''; //
|
|
29
|
+
this.clickedGroup = ''; // 点击的元组的上一层Id,即groupSourceId(元组件在Group中)
|
|
30
|
+
|
|
31
|
+
this.clickedMetaParent = ''; // 点击的元组的上一层Id(元组件不在Group中,Recommend组件)
|
|
30
32
|
|
|
31
33
|
this.clickedFloor = ''; // 点击的楼层Id
|
|
32
34
|
|
|
@@ -42,6 +44,7 @@ function () {
|
|
|
42
44
|
hoveredMeta: _mobx.observable,
|
|
43
45
|
clickedMeta: _mobx.observable,
|
|
44
46
|
clickedGroup: _mobx.observable,
|
|
47
|
+
clickedMetaParent: _mobx.observable,
|
|
45
48
|
clickedFloor: _mobx.observable,
|
|
46
49
|
CarouselStore: _mobx.observable,
|
|
47
50
|
setState: _mobx.action.bound
|
package/lib/utils/coreUtil.js
CHANGED
|
@@ -35,7 +35,7 @@ var _this = void 0;
|
|
|
35
35
|
|
|
36
36
|
/** 根据楼层设置的终端类型,判断是否展示该楼层 */
|
|
37
37
|
var isActiveFloor = function isActiveFloor(activeTerminal) {
|
|
38
|
-
return activeTerminal === 'ALL' || activeTerminal === window.magicDesign.device.toUpperCase();
|
|
38
|
+
return !activeTerminal || activeTerminal === 'ALL' || activeTerminal === window.magicDesign.device.toUpperCase();
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
exports.isActiveFloor = isActiveFloor;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonixtree/magic-design",
|
|
3
3
|
"author": "Cylon Team",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.62",
|
|
5
5
|
"description": "Magic Design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -36,91 +36,6 @@
|
|
|
36
36
|
"shortid": "^2.2.16",
|
|
37
37
|
"slick-carousel": "^1.8.1"
|
|
38
38
|
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@babel/core": "^7.16.0",
|
|
41
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
42
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
43
|
-
"@rollup/plugin-commonjs": "^22.0.0",
|
|
44
|
-
"@rollup/plugin-image": "^2.1.1",
|
|
45
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
46
|
-
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
47
|
-
"@svgr/webpack": "^5.5.0",
|
|
48
|
-
"@types/axios": "^0.14.0",
|
|
49
|
-
"@types/lodash": "^4.14.182",
|
|
50
|
-
"@types/node": "^17.0.36",
|
|
51
|
-
"@types/react": "^18.0.9",
|
|
52
|
-
"@types/react-color": "^3.0.6",
|
|
53
|
-
"@types/react-dom": "^18.0.5",
|
|
54
|
-
"@types/uuid": "^8.3.4",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
56
|
-
"add": "^2.0.6",
|
|
57
|
-
"babel-loader": "^8.2.3",
|
|
58
|
-
"babel-plugin-named-asset-import": "^0.3.8",
|
|
59
|
-
"babel-preset-react-app": "^10.0.1",
|
|
60
|
-
"bfj": "^7.0.2",
|
|
61
|
-
"browserslist": "^4.18.1",
|
|
62
|
-
"camelcase": "^6.2.1",
|
|
63
|
-
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
64
|
-
"child_process": "^1.0.2",
|
|
65
|
-
"classnames": "^2.3.1",
|
|
66
|
-
"css-loader": "^6.5.1",
|
|
67
|
-
"css-minimizer-webpack-plugin": "^3.2.0",
|
|
68
|
-
"dotenv": "^10.0.0",
|
|
69
|
-
"dotenv-expand": "^5.1.0",
|
|
70
|
-
"eslint": "7",
|
|
71
|
-
"eslint-config-next": "^12.1.6",
|
|
72
|
-
"eslint-config-react-app": "^7.0.1",
|
|
73
|
-
"eslint-webpack-plugin": "^3.1.1",
|
|
74
|
-
"extract-zip": "^2.0.1",
|
|
75
|
-
"file-loader": "^6.2.0",
|
|
76
|
-
"fs-extra": "^10.0.0",
|
|
77
|
-
"gulp": "4.0.2",
|
|
78
|
-
"gulp-less": "5.0.0",
|
|
79
|
-
"gulp-postcss": "9.0.1",
|
|
80
|
-
"gulp-rename": "2.0.0",
|
|
81
|
-
"html-webpack-plugin": "^5.5.0",
|
|
82
|
-
"http-proxy-middleware": "^2.0.6",
|
|
83
|
-
"identity-obj-proxy": "^3.0.0",
|
|
84
|
-
"less": "3.13.1",
|
|
85
|
-
"less-loader": "^11.0.0",
|
|
86
|
-
"mini-css-extract-plugin": "^2.4.5",
|
|
87
|
-
"mv": "^2.1.1",
|
|
88
|
-
"ora": "^4.1.1",
|
|
89
|
-
"postcss": "^8.4.4",
|
|
90
|
-
"postcss-flexbugs-fixes": "^5.0.2",
|
|
91
|
-
"postcss-less": "6.0.0",
|
|
92
|
-
"postcss-loader": "^6.2.1",
|
|
93
|
-
"postcss-normalize": "^10.0.1",
|
|
94
|
-
"postcss-preset-env": "^7.0.1",
|
|
95
|
-
"postcss-px-to-viewport": "^1.1.1",
|
|
96
|
-
"postcss-selector-namespace": "^3.0.1",
|
|
97
|
-
"prompts": "^2.4.2",
|
|
98
|
-
"rc-tools": "^9.6.1-alpha.1",
|
|
99
|
-
"react": "^16.11.0",
|
|
100
|
-
"react-app-polyfill": "^3.0.0",
|
|
101
|
-
"react-dev-utils": "^12.0.1",
|
|
102
|
-
"react-dom": "^16.11.0",
|
|
103
|
-
"react-refresh": "^0.11.0",
|
|
104
|
-
"resolve": "^1.20.0",
|
|
105
|
-
"resolve-url-loader": "^4.0.0",
|
|
106
|
-
"rollup-plugin-dts": "^4.2.2",
|
|
107
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
108
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
109
|
-
"rollup-plugin-styles": "^4.0.0",
|
|
110
|
-
"rollup-plugin-typescript2": "^0.32.1",
|
|
111
|
-
"sass-loader": "^12.3.0",
|
|
112
|
-
"semver": "^7.3.5",
|
|
113
|
-
"source-map-loader": "^3.0.0",
|
|
114
|
-
"style-loader": "^3.3.1",
|
|
115
|
-
"tailwindcss": "^3.0.2",
|
|
116
|
-
"terser-webpack-plugin": "^5.2.5",
|
|
117
|
-
"typescript": "^4.7.2",
|
|
118
|
-
"web-vitals": "^2.1.4",
|
|
119
|
-
"webpack": "^5.64.4",
|
|
120
|
-
"webpack-dev-server": "^4.6.0",
|
|
121
|
-
"webpack-manifest-plugin": "^4.0.2",
|
|
122
|
-
"workbox-webpack-plugin": "^6.4.1"
|
|
123
|
-
},
|
|
124
39
|
"peerDependencies": {
|
|
125
40
|
"react": ">=16.11.0",
|
|
126
41
|
"react-dom": ">=16.11.0"
|
package/README.md
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
# 快捷指令使用
|
|
2
|
-
|
|
3
|
-
## 1、发布 -- npm run pub
|
|
4
|
-
|
|
5
|
-
## 2、新增国际化 -- npm run cl "Hello world"
|
|
6
|
-
|
|
7
|
-
## 3、更新iconfont -- npm run iconfont
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# 设计器二期
|
|
11
|
-
|
|
12
|
-
## 1、基本概念
|
|
13
|
-
|
|
14
|
-
### 1.1、元组件:构成复合组件的最小单位
|
|
15
|
-
|
|
16
|
-
Text、Image、Button、Divider、Video 等
|
|
17
|
-
|
|
18
|
-
### 1.2、复合组件:由若干个元组件构成的一个大组件
|
|
19
|
-
|
|
20
|
-
Text、Banner、Image Gallery、Image and Text、Carousel、Reward、Newsletter 等
|
|
21
|
-
|
|
22
|
-
### 1.3、业务公共组件:项目中复用的公共组件
|
|
23
|
-
|
|
24
|
-
所有的公共组件需要开放 value 和 onChange Api(除 Button、Iconfont)
|
|
25
|
-
|
|
26
|
-
Button、Iconfont、AlignSelecter、Collapse、ColorPicker、ImagePicker、LayoutSelecter、Slider、UrlPicker
|
|
27
|
-
|
|
28
|
-
## 2、元组件
|
|
29
|
-
|
|
30
|
-
### 2.1
|
|
31
|
-
|
|
32
|
-
元组件类型:
|
|
33
|
-
|
|
34
|
-
TEXT、IMAGE、BUTTON、DIVIDER、VIDEO
|
|
35
|
-
|
|
36
|
-
元组件报文格式:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
id:'xxxx' //元组件key
|
|
41
|
-
type: 'TYPE', //元组件类型
|
|
42
|
-
style:{
|
|
43
|
-
fontFamily:'xxx', //字体
|
|
44
|
-
...css //属性名称尽量使用标准css名称
|
|
45
|
-
},
|
|
46
|
-
hoverStyle:{
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
动态设置 hover 效果
|
|
53
|
-
|
|
54
|
-
onMouseEnter={e => { e.target.style.color = 'red'; }}
|
|
55
|
-
|
|
56
|
-
onMouseLeave={e => { e.target.style.color = 'white'; }}
|
|
57
|
-
|
|
58
|
-
文本可编辑
|
|
59
|
-
|
|
60
|
-
contenteditable="true"
|
|
61
|
-
|
|
62
|
-
### 2.2 、元组件报文
|
|
63
|
-
|
|
64
|
-
#### Text
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
id:'xxxx' //元组件key
|
|
69
|
-
type: 'TYPE', //元组件类型
|
|
70
|
-
content:'this is text',
|
|
71
|
-
style:{
|
|
72
|
-
fontFamily:'xxx', //字体
|
|
73
|
-
fontSize: '14px',
|
|
74
|
-
width: '200px',
|
|
75
|
-
...css
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
#### Image
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
id:'xxxx' //元组件key
|
|
85
|
-
type: 'IMAGE', //元组件类型
|
|
86
|
-
name:'123.png',
|
|
87
|
-
src:'../image.png', //图片地址
|
|
88
|
-
url:'www.baidu.com', //图片跳转地址
|
|
89
|
-
style:{
|
|
90
|
-
width: '200px',
|
|
91
|
-
...css
|
|
92
|
-
},
|
|
93
|
-
hoverStyle:{ //hover 类型为new时保存src,类型为enlarge时保存scale
|
|
94
|
-
scale: '2',
|
|
95
|
-
src:'../image1.png',
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
#### Button
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
{
|
|
104
|
-
id:'xxxx' //元组件key
|
|
105
|
-
type: 'BUTTON', //元组件类型
|
|
106
|
-
name:'Submit',
|
|
107
|
-
url: 'www.baidu.com',
|
|
108
|
-
style:{
|
|
109
|
-
buttonIconSrc:'../img.png',
|
|
110
|
-
buttonIconPlace: 'left',
|
|
111
|
-
color:'#FEFEFE',
|
|
112
|
-
border: '1px solid red',
|
|
113
|
-
borderRadius:'10px',
|
|
114
|
-
fontFamily:'xxx', //字体
|
|
115
|
-
fontSize: '14px',
|
|
116
|
-
...css
|
|
117
|
-
},
|
|
118
|
-
hoverStyle {
|
|
119
|
-
color:'#FEFEFE',
|
|
120
|
-
border: '1px solid red',
|
|
121
|
-
fontFamily:'xxx', //字体
|
|
122
|
-
fontSize: '14px',
|
|
123
|
-
...css
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## 2、复合组件
|
|
129
|
-
|
|
130
|
-
### 2.1
|
|
131
|
-
|
|
132
|
-
元组件类型:
|
|
133
|
-
|
|
134
|
-
TEXT、BANNER、IMAGE_GALLERT、IMAGE_TEXT、CAROUSEL、REWARD、NEWSLETTER
|
|
135
|
-
|
|
136
|
-
复合组件报文格式:
|
|
137
|
-
|
|
138
|
-
```json
|
|
139
|
-
{
|
|
140
|
-
id:'xxxx' //复合组件key
|
|
141
|
-
type: 'TYPE', //复合组件类型
|
|
142
|
-
setting:{ //开关类型的配置及属性配置放在这里
|
|
143
|
-
autoplays: 3, //3秒轮播
|
|
144
|
-
},
|
|
145
|
-
groupSource:[], //元组件集合组数据放在这里
|
|
146
|
-
metas:{
|
|
147
|
-
title:{
|
|
148
|
-
open:false,
|
|
149
|
-
type:'IMAGE'
|
|
150
|
-
...metaCompJson
|
|
151
|
-
},
|
|
152
|
-
subTitle:{
|
|
153
|
-
open:false,
|
|
154
|
-
type:'IMAGE'
|
|
155
|
-
...metaCompJson
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
customize:{
|
|
159
|
-
layout:'',
|
|
160
|
-
background:{
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
#### Text
|
|
168
|
-
|
|
169
|
-
```js
|
|
170
|
-
{
|
|
171
|
-
id: 'xxxx', //复合组件key
|
|
172
|
-
type: 'TEXT', //复合组件类型
|
|
173
|
-
setting:{
|
|
174
|
-
layout:'left', // 模块布局 left/center/right ,每一个layout可能都是一个不同的组件
|
|
175
|
-
title:{
|
|
176
|
-
type:'TEXT'
|
|
177
|
-
...metaCompJson
|
|
178
|
-
},
|
|
179
|
-
subtitle:{
|
|
180
|
-
type:'TEXT'
|
|
181
|
-
...metaCompJson
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
source:[
|
|
185
|
-
{ //此处可以抽出业务组件
|
|
186
|
-
title:{
|
|
187
|
-
type:'TEXT'
|
|
188
|
-
...metaCompJson
|
|
189
|
-
},
|
|
190
|
-
content:{
|
|
191
|
-
type:'TEXT'
|
|
192
|
-
...metaCompJson
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
style:{
|
|
197
|
-
align:'left', //文本布局 left/center/right
|
|
198
|
-
backgroundColor: 'red',
|
|
199
|
-
backgroundImage:'../image.png'
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
#### Banner
|
|
205
|
-
|
|
206
|
-
modifySetting
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"comositeId": "1111",
|
|
211
|
-
|
|
212
|
-
"value": {
|
|
213
|
-
"autoplays": 4
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
```json
|
|
219
|
-
{
|
|
220
|
-
id: 'xxxx',
|
|
221
|
-
type: 'BANNER',
|
|
222
|
-
setting:{
|
|
223
|
-
open:false
|
|
224
|
-
autoplays: 3, //3秒轮播
|
|
225
|
-
arrows:{ // 滚动箭头
|
|
226
|
-
open:false,
|
|
227
|
-
color:'red',
|
|
228
|
-
size:'',
|
|
229
|
-
hoverSize:'',
|
|
230
|
-
hoverColor:'green',
|
|
231
|
-
},
|
|
232
|
-
dots:{ //面板指示点
|
|
233
|
-
open:false,
|
|
234
|
-
color: 'red',
|
|
235
|
-
size:'',
|
|
236
|
-
hoverSize:''
|
|
237
|
-
hoverColor:'green',
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
groupSource:[
|
|
241
|
-
{ //此处可以作为一个业务组件
|
|
242
|
-
id:'xxxxx',
|
|
243
|
-
image:{
|
|
244
|
-
open:false,
|
|
245
|
-
type:'IMAGE'
|
|
246
|
-
...metaCompJson
|
|
247
|
-
},
|
|
248
|
-
title:{
|
|
249
|
-
open:false,
|
|
250
|
-
type:'TEXT',
|
|
251
|
-
...metaCompJson
|
|
252
|
-
},
|
|
253
|
-
content:{
|
|
254
|
-
open:false,
|
|
255
|
-
type:'TEXT',
|
|
256
|
-
...metaCompJson
|
|
257
|
-
},
|
|
258
|
-
button:{
|
|
259
|
-
type:'BUTTON',
|
|
260
|
-
...metaCompJson
|
|
261
|
-
},
|
|
262
|
-
secondaryButton:{
|
|
263
|
-
type:'BUTTON',
|
|
264
|
-
...metaCompJson
|
|
265
|
-
},
|
|
266
|
-
layout:'center',
|
|
267
|
-
align:'left',
|
|
268
|
-
//文本布局 left/center/right
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
#### Image Gallery
|
|
275
|
-
|
|
276
|
-
```json
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
#### Image and Text
|
|
281
|
-
|
|
282
|
-
```json
|
|
283
|
-
{
|
|
284
|
-
id:'xxxx'
|
|
285
|
-
type: 'IMAGE_TEXT',
|
|
286
|
-
setting:{
|
|
287
|
-
layout:'left',
|
|
288
|
-
title:{},
|
|
289
|
-
subtitle:{},
|
|
290
|
-
button:{},
|
|
291
|
-
secondaryButton:{}
|
|
292
|
-
},
|
|
293
|
-
source:[
|
|
294
|
-
|
|
295
|
-
],
|
|
296
|
-
style:{
|
|
297
|
-
align:'left',
|
|
298
|
-
backgroundColor:'red',
|
|
299
|
-
backgroundImage:'./img.png'
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
疑问:
|
|
305
|
-
|
|
306
|
-
Text 元组件
|
|
307
|
-
|
|
308
|
-
文字链接配置好之后,怎么删除
|
|
309
|
-
|
|
310
|
-
链接配置的规则,按单词还是字符
|
|
311
|
-
|
|
312
|
-
image 元组件
|
|
313
|
-
|
|
314
|
-
属性控制进度条和输入框是否要限制最大最小值
|
|
315
|
-
|
|
316
|
-
button 元组件
|
|
317
|
-
|
|
318
|
-
是否需要 icon 的 hover 效果
|
|
319
|
-
|
|
320
|
-
banner 中的 text Align 放在元组件里?
|