@fonixtree/magic-design 0.1.62 → 0.1.65
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/composite-comp/bol/components/Video/index.js +4 -2
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +4 -4
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +3 -1
- package/es/core/Designer/index.js +1 -0
- package/es/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +34 -169
- package/es/utils/commonUtil.js +35 -1
- package/lib/composite-comp/bol/components/Video/index.js +4 -2
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +4 -4
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +3 -1
- package/lib/core/Designer/index.js +1 -0
- package/lib/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +34 -169
- package/lib/utils/commonUtil.js +35 -1
- package/package.json +1 -1
|
@@ -71,15 +71,17 @@ function (_super) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
Video.prototype.componentWillMount = function () {
|
|
74
|
-
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
74
|
+
console.log('--video WillMount'); // 兼容新开发的功能: video新增播放按钮 的设置
|
|
75
|
+
|
|
75
76
|
var nodeData = this.props.nodeData;
|
|
76
77
|
|
|
77
78
|
if (nodeData.groupSource && nodeData.groupSource.length > 0) {
|
|
78
79
|
nodeData.groupSource.forEach(function (group) {
|
|
79
80
|
if (!group.playIcon) {
|
|
81
|
+
console.log('--video add group.playIcon ');
|
|
80
82
|
group.playIcon = {
|
|
81
83
|
open: true,
|
|
82
|
-
parentId:
|
|
84
|
+
parentId: group.id,
|
|
83
85
|
id: (0, _uuid.v4)(),
|
|
84
86
|
type: 'PLAY',
|
|
85
87
|
size: 48,
|
|
@@ -117,7 +117,7 @@ function (_super) {
|
|
|
117
117
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
118
118
|
className: "video-pc-layout1-wrap"
|
|
119
119
|
}, /*#__PURE__*/_react["default"].createElement("div", null, data.groupSource.map(function (group) {
|
|
120
|
-
var _a, _b;
|
|
120
|
+
var _a, _b, _c, _d, _e;
|
|
121
121
|
/** 当前是否在播放 */
|
|
122
122
|
|
|
123
123
|
|
|
@@ -150,14 +150,14 @@ function (_super) {
|
|
|
150
150
|
}),
|
|
151
151
|
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
152
152
|
videoId: group.id
|
|
153
|
-
}), !isPlaying && group.video.playButton == 'Middle' && group.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
153
|
+
}), !isPlaying && group.video.playButton == 'Middle' && ((_c = group === null || group === void 0 ? void 0 : group.playIcon) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
154
|
className: "play-btn center",
|
|
155
155
|
onClick: function onClick() {
|
|
156
156
|
_this.playOrPause(group);
|
|
157
157
|
}
|
|
158
158
|
}, /*#__PURE__*/_react["default"].createElement(_PlaySvg["default"], {
|
|
159
|
-
imgName: group.playIcon.iconType,
|
|
160
|
-
imgWidth: group.playIcon.pcSize
|
|
159
|
+
imgName: (_d = group === null || group === void 0 ? void 0 : group.playIcon) === null || _d === void 0 ? void 0 : _d.iconType,
|
|
160
|
+
imgWidth: (_e = group === null || group === void 0 ? void 0 : group.playIcon) === null || _e === void 0 ? void 0 : _e.pcSize
|
|
161
161
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
162
162
|
customize: data.customize,
|
|
163
163
|
data: group,
|
|
@@ -108,6 +108,8 @@ function (_super) {
|
|
|
108
108
|
Layout2.prototype.render = function () {
|
|
109
109
|
var _this = this;
|
|
110
110
|
|
|
111
|
+
var _a;
|
|
112
|
+
|
|
111
113
|
var data = this.props.data;
|
|
112
114
|
var GAData = {
|
|
113
115
|
moduleId: data.id,
|
|
@@ -152,7 +154,7 @@ function (_super) {
|
|
|
152
154
|
}),
|
|
153
155
|
play: isFirstGroupPlaying,
|
|
154
156
|
videoId: firstGroup.id
|
|
155
|
-
}), !isFirstGroupPlaying && firstGroup.video.playButton == 'Middle' && firstGroup.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
157
|
+
}), !isFirstGroupPlaying && firstGroup.video.playButton == 'Middle' && ((_a = firstGroup === null || firstGroup === void 0 ? void 0 : firstGroup.playIcon) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
158
|
className: "play-btn center",
|
|
157
159
|
onClick: function onClick() {
|
|
158
160
|
_this.playOrPause(firstGroup);
|
|
@@ -615,6 +615,7 @@ function (_super) {
|
|
|
615
615
|
config = props.config,
|
|
616
616
|
outputType = props.outputType,
|
|
617
617
|
locale = props.locale;
|
|
618
|
+
(0, _commonUtil.compatibleNewPageData)(pageData);
|
|
618
619
|
var MPageData = pageData.childNodes || [];
|
|
619
620
|
_this.configRef = /*#__PURE__*/_react["default"].createRef(); // this.viewAreaRef = React.createRef();
|
|
620
621
|
|
|
@@ -5,192 +5,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = PlaySvg;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var _darkPlayicon = _interopRequireDefault(require("./images/dark-playicon-01.svg"));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var _darkPlayicon2 = _interopRequireDefault(require("./images/dark-playicon-02.svg"));
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
var _darkPlayicon3 = _interopRequireDefault(require("./images/dark-playicon-03.svg"));
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
function adopt(value) {
|
|
18
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
19
|
-
resolve(value);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
16
|
+
var _darkPlayicon4 = _interopRequireDefault(require("./images/dark-playicon-04.svg"));
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
function fulfilled(value) {
|
|
25
|
-
try {
|
|
26
|
-
step(generator.next(value));
|
|
27
|
-
} catch (e) {
|
|
28
|
-
reject(e);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function rejected(value) {
|
|
33
|
-
try {
|
|
34
|
-
step(generator["throw"](value));
|
|
35
|
-
} catch (e) {
|
|
36
|
-
reject(e);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function step(result) {
|
|
41
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
49
|
-
var _ = {
|
|
50
|
-
label: 0,
|
|
51
|
-
sent: function sent() {
|
|
52
|
-
if (t[0] & 1) throw t[1];
|
|
53
|
-
return t[1];
|
|
54
|
-
},
|
|
55
|
-
trys: [],
|
|
56
|
-
ops: []
|
|
57
|
-
},
|
|
58
|
-
f,
|
|
59
|
-
y,
|
|
60
|
-
t,
|
|
61
|
-
g;
|
|
62
|
-
return g = {
|
|
63
|
-
next: verb(0),
|
|
64
|
-
"throw": verb(1),
|
|
65
|
-
"return": verb(2)
|
|
66
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
67
|
-
return this;
|
|
68
|
-
}), g;
|
|
69
|
-
|
|
70
|
-
function verb(n) {
|
|
71
|
-
return function (v) {
|
|
72
|
-
return step([n, v]);
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function step(op) {
|
|
77
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
78
|
-
|
|
79
|
-
while (_) {
|
|
80
|
-
try {
|
|
81
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
82
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
83
|
-
|
|
84
|
-
switch (op[0]) {
|
|
85
|
-
case 0:
|
|
86
|
-
case 1:
|
|
87
|
-
t = op;
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case 4:
|
|
91
|
-
_.label++;
|
|
92
|
-
return {
|
|
93
|
-
value: op[1],
|
|
94
|
-
done: false
|
|
95
|
-
};
|
|
18
|
+
var _darkPlayicon5 = _interopRequireDefault(require("./images/dark-playicon-05.svg"));
|
|
96
19
|
|
|
97
|
-
|
|
98
|
-
_.label++;
|
|
99
|
-
y = op[1];
|
|
100
|
-
op = [0];
|
|
101
|
-
continue;
|
|
20
|
+
var _lightPlayicon = _interopRequireDefault(require("./images/light-playicon-01.svg"));
|
|
102
21
|
|
|
103
|
-
|
|
104
|
-
op = _.ops.pop();
|
|
22
|
+
var _lightPlayicon2 = _interopRequireDefault(require("./images/light-playicon-02.svg"));
|
|
105
23
|
|
|
106
|
-
|
|
24
|
+
var _lightPlayicon3 = _interopRequireDefault(require("./images/light-playicon-03.svg"));
|
|
107
25
|
|
|
108
|
-
|
|
26
|
+
var _lightPlayicon4 = _interopRequireDefault(require("./images/light-playicon-04.svg"));
|
|
109
27
|
|
|
110
|
-
|
|
111
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
112
|
-
_ = 0;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
28
|
+
var _lightPlayicon5 = _interopRequireDefault(require("./images/light-playicon-05.svg"));
|
|
115
29
|
|
|
116
|
-
|
|
117
|
-
_.label = op[1];
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
120
31
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (t[2]) _.ops.pop();
|
|
136
|
-
|
|
137
|
-
_.trys.pop();
|
|
138
|
-
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
op = body.call(thisArg, _);
|
|
143
|
-
} catch (e) {
|
|
144
|
-
op = [6, e];
|
|
145
|
-
y = 0;
|
|
146
|
-
} finally {
|
|
147
|
-
f = t = 0;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (op[0] & 5) throw op[1];
|
|
152
|
-
return {
|
|
153
|
-
value: op[0] ? op[1] : void 0,
|
|
154
|
-
done: true
|
|
155
|
-
};
|
|
156
|
-
}
|
|
32
|
+
var imageSrcMap = {
|
|
33
|
+
'light-playicon-01': _lightPlayicon["default"],
|
|
34
|
+
'light-playicon-02': _lightPlayicon2["default"],
|
|
35
|
+
'light-playicon-03': _lightPlayicon3["default"],
|
|
36
|
+
'light-playicon-04': _lightPlayicon4["default"],
|
|
37
|
+
'light-playicon-05': _lightPlayicon5["default"],
|
|
38
|
+
'dark-playicon-01': _darkPlayicon["default"],
|
|
39
|
+
'dark-playicon-02': _darkPlayicon2["default"],
|
|
40
|
+
'dark-playicon-03': _darkPlayicon3["default"],
|
|
41
|
+
'dark-playicon-04': _darkPlayicon4["default"],
|
|
42
|
+
'dark-playicon-05': _darkPlayicon5["default"]
|
|
157
43
|
};
|
|
158
44
|
|
|
159
45
|
function PlaySvg(props) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
case 0:
|
|
171
|
-
return [4
|
|
172
|
-
/*yield*/
|
|
173
|
-
, Promise.resolve("".concat("./images/" + props.imgName + ".svg")).then(function (s) {
|
|
174
|
-
return _interopRequireWildcard(require(s));
|
|
175
|
-
})];
|
|
176
|
-
|
|
177
|
-
case 1:
|
|
178
|
-
return [2
|
|
179
|
-
/*return*/
|
|
180
|
-
, _a.sent()];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
(0, _react.useEffect)(function () {
|
|
187
|
-
getImageUrl().then(function (v) {
|
|
188
|
-
setImgSrc(v["default"]);
|
|
189
|
-
});
|
|
190
|
-
});
|
|
46
|
+
// const [imgSrc, setImgSrc] = useState(null);
|
|
47
|
+
// const getImageUrl = async () => {
|
|
48
|
+
// console.log('-- imagePath', imageSrcMap[props.imgName]);
|
|
49
|
+
// return await import(`./images/${props.imgName}.svg`);
|
|
50
|
+
// };
|
|
51
|
+
// useEffect(() => {
|
|
52
|
+
// getImageUrl().then(v => {
|
|
53
|
+
// setImgSrc(v.default);
|
|
54
|
+
// });
|
|
55
|
+
// });
|
|
191
56
|
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
192
57
|
alt: "icon",
|
|
193
|
-
src:
|
|
58
|
+
src: imageSrcMap[props.imgName],
|
|
194
59
|
style: {
|
|
195
60
|
width: props.imgWidth
|
|
196
61
|
}
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
|
|
|
7
7
|
exports.asyncDataURLtoImage = asyncDataURLtoImage;
|
|
8
8
|
exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
|
|
9
9
|
exports.commonFetch = commonFetch;
|
|
10
|
+
exports.compatibleNewPageData = void 0;
|
|
10
11
|
exports.convertImageUrl = convertImageUrl;
|
|
11
12
|
exports.convertToRem = void 0;
|
|
12
13
|
exports.copy2ClipBoard = copy2ClipBoard;
|
|
@@ -28,6 +29,8 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
28
29
|
|
|
29
30
|
var _lodash = require("lodash");
|
|
30
31
|
|
|
32
|
+
var _uuid = require("uuid");
|
|
33
|
+
|
|
31
34
|
var _qs = _interopRequireDefault(require("qs"));
|
|
32
35
|
|
|
33
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -767,5 +770,36 @@ var pxToRem = function pxToRem(styleObj) {
|
|
|
767
770
|
|
|
768
771
|
return remObj;
|
|
769
772
|
};
|
|
773
|
+
/**
|
|
774
|
+
* 处理新老数据兼容问题
|
|
775
|
+
* @param pageData 大JSON
|
|
776
|
+
*/
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
exports.pxToRem = pxToRem;
|
|
780
|
+
|
|
781
|
+
var compatibleNewPageData = function compatibleNewPageData(pageData) {
|
|
782
|
+
pageData.childNodes.forEach(function (child) {
|
|
783
|
+
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
784
|
+
if (child.type === 'VIDEO') {
|
|
785
|
+
console.log('--compatibleNewPageData -- video ');
|
|
786
|
+
child.groupSource.forEach(function (group) {
|
|
787
|
+
if (!group.playIcon) {
|
|
788
|
+
console.log('--compatibleNewPageData -- video add group.playIcon ');
|
|
789
|
+
group.playIcon = {
|
|
790
|
+
open: true,
|
|
791
|
+
parentId: group.id,
|
|
792
|
+
id: (0, _uuid.v4)(),
|
|
793
|
+
type: 'PLAY',
|
|
794
|
+
size: 48,
|
|
795
|
+
pcSize: 60,
|
|
796
|
+
iconType: 'light-playicon-01',
|
|
797
|
+
iconColor: 'Light'
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
};
|
|
770
804
|
|
|
771
|
-
exports.
|
|
805
|
+
exports.compatibleNewPageData = compatibleNewPageData;
|
|
@@ -71,15 +71,17 @@ function (_super) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
Video.prototype.componentWillMount = function () {
|
|
74
|
-
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
74
|
+
console.log('--video WillMount'); // 兼容新开发的功能: video新增播放按钮 的设置
|
|
75
|
+
|
|
75
76
|
var nodeData = this.props.nodeData;
|
|
76
77
|
|
|
77
78
|
if (nodeData.groupSource && nodeData.groupSource.length > 0) {
|
|
78
79
|
nodeData.groupSource.forEach(function (group) {
|
|
79
80
|
if (!group.playIcon) {
|
|
81
|
+
console.log('--video add group.playIcon ');
|
|
80
82
|
group.playIcon = {
|
|
81
83
|
open: true,
|
|
82
|
-
parentId:
|
|
84
|
+
parentId: group.id,
|
|
83
85
|
id: (0, _uuid.v4)(),
|
|
84
86
|
type: 'PLAY',
|
|
85
87
|
size: 48,
|
|
@@ -117,7 +117,7 @@ function (_super) {
|
|
|
117
117
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
118
118
|
className: "video-pc-layout1-wrap"
|
|
119
119
|
}, /*#__PURE__*/_react["default"].createElement("div", null, data.groupSource.map(function (group) {
|
|
120
|
-
var _a, _b;
|
|
120
|
+
var _a, _b, _c, _d, _e;
|
|
121
121
|
/** 当前是否在播放 */
|
|
122
122
|
|
|
123
123
|
|
|
@@ -150,14 +150,14 @@ function (_super) {
|
|
|
150
150
|
}),
|
|
151
151
|
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
152
152
|
videoId: group.id
|
|
153
|
-
}), !isPlaying && group.video.playButton == 'Middle' && group.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
153
|
+
}), !isPlaying && group.video.playButton == 'Middle' && ((_c = group === null || group === void 0 ? void 0 : group.playIcon) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
154
|
className: "play-btn center",
|
|
155
155
|
onClick: function onClick() {
|
|
156
156
|
_this.playOrPause(group);
|
|
157
157
|
}
|
|
158
158
|
}, /*#__PURE__*/_react["default"].createElement(_PlaySvg["default"], {
|
|
159
|
-
imgName: group.playIcon.iconType,
|
|
160
|
-
imgWidth: group.playIcon.pcSize
|
|
159
|
+
imgName: (_d = group === null || group === void 0 ? void 0 : group.playIcon) === null || _d === void 0 ? void 0 : _d.iconType,
|
|
160
|
+
imgWidth: (_e = group === null || group === void 0 ? void 0 : group.playIcon) === null || _e === void 0 ? void 0 : _e.pcSize
|
|
161
161
|
})), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
162
162
|
customize: data.customize,
|
|
163
163
|
data: group,
|
|
@@ -108,6 +108,8 @@ function (_super) {
|
|
|
108
108
|
Layout2.prototype.render = function () {
|
|
109
109
|
var _this = this;
|
|
110
110
|
|
|
111
|
+
var _a;
|
|
112
|
+
|
|
111
113
|
var data = this.props.data;
|
|
112
114
|
var GAData = {
|
|
113
115
|
moduleId: data.id,
|
|
@@ -152,7 +154,7 @@ function (_super) {
|
|
|
152
154
|
}),
|
|
153
155
|
play: isFirstGroupPlaying,
|
|
154
156
|
videoId: firstGroup.id
|
|
155
|
-
}), !isFirstGroupPlaying && firstGroup.video.playButton == 'Middle' && firstGroup.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
157
|
+
}), !isFirstGroupPlaying && firstGroup.video.playButton == 'Middle' && ((_a = firstGroup === null || firstGroup === void 0 ? void 0 : firstGroup.playIcon) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
158
|
className: "play-btn center",
|
|
157
159
|
onClick: function onClick() {
|
|
158
160
|
_this.playOrPause(firstGroup);
|
|
@@ -615,6 +615,7 @@ function (_super) {
|
|
|
615
615
|
config = props.config,
|
|
616
616
|
outputType = props.outputType,
|
|
617
617
|
locale = props.locale;
|
|
618
|
+
(0, _commonUtil.compatibleNewPageData)(pageData);
|
|
618
619
|
var MPageData = pageData.childNodes || [];
|
|
619
620
|
_this.configRef = /*#__PURE__*/_react["default"].createRef(); // this.viewAreaRef = React.createRef();
|
|
620
621
|
|
|
@@ -5,192 +5,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = PlaySvg;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var _darkPlayicon = _interopRequireDefault(require("./images/dark-playicon-01.svg"));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var _darkPlayicon2 = _interopRequireDefault(require("./images/dark-playicon-02.svg"));
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
var _darkPlayicon3 = _interopRequireDefault(require("./images/dark-playicon-03.svg"));
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
function adopt(value) {
|
|
18
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
19
|
-
resolve(value);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
16
|
+
var _darkPlayicon4 = _interopRequireDefault(require("./images/dark-playicon-04.svg"));
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
function fulfilled(value) {
|
|
25
|
-
try {
|
|
26
|
-
step(generator.next(value));
|
|
27
|
-
} catch (e) {
|
|
28
|
-
reject(e);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function rejected(value) {
|
|
33
|
-
try {
|
|
34
|
-
step(generator["throw"](value));
|
|
35
|
-
} catch (e) {
|
|
36
|
-
reject(e);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function step(result) {
|
|
41
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
49
|
-
var _ = {
|
|
50
|
-
label: 0,
|
|
51
|
-
sent: function sent() {
|
|
52
|
-
if (t[0] & 1) throw t[1];
|
|
53
|
-
return t[1];
|
|
54
|
-
},
|
|
55
|
-
trys: [],
|
|
56
|
-
ops: []
|
|
57
|
-
},
|
|
58
|
-
f,
|
|
59
|
-
y,
|
|
60
|
-
t,
|
|
61
|
-
g;
|
|
62
|
-
return g = {
|
|
63
|
-
next: verb(0),
|
|
64
|
-
"throw": verb(1),
|
|
65
|
-
"return": verb(2)
|
|
66
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
67
|
-
return this;
|
|
68
|
-
}), g;
|
|
69
|
-
|
|
70
|
-
function verb(n) {
|
|
71
|
-
return function (v) {
|
|
72
|
-
return step([n, v]);
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function step(op) {
|
|
77
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
78
|
-
|
|
79
|
-
while (_) {
|
|
80
|
-
try {
|
|
81
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
82
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
83
|
-
|
|
84
|
-
switch (op[0]) {
|
|
85
|
-
case 0:
|
|
86
|
-
case 1:
|
|
87
|
-
t = op;
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case 4:
|
|
91
|
-
_.label++;
|
|
92
|
-
return {
|
|
93
|
-
value: op[1],
|
|
94
|
-
done: false
|
|
95
|
-
};
|
|
18
|
+
var _darkPlayicon5 = _interopRequireDefault(require("./images/dark-playicon-05.svg"));
|
|
96
19
|
|
|
97
|
-
|
|
98
|
-
_.label++;
|
|
99
|
-
y = op[1];
|
|
100
|
-
op = [0];
|
|
101
|
-
continue;
|
|
20
|
+
var _lightPlayicon = _interopRequireDefault(require("./images/light-playicon-01.svg"));
|
|
102
21
|
|
|
103
|
-
|
|
104
|
-
op = _.ops.pop();
|
|
22
|
+
var _lightPlayicon2 = _interopRequireDefault(require("./images/light-playicon-02.svg"));
|
|
105
23
|
|
|
106
|
-
|
|
24
|
+
var _lightPlayicon3 = _interopRequireDefault(require("./images/light-playicon-03.svg"));
|
|
107
25
|
|
|
108
|
-
|
|
26
|
+
var _lightPlayicon4 = _interopRequireDefault(require("./images/light-playicon-04.svg"));
|
|
109
27
|
|
|
110
|
-
|
|
111
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
112
|
-
_ = 0;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
28
|
+
var _lightPlayicon5 = _interopRequireDefault(require("./images/light-playicon-05.svg"));
|
|
115
29
|
|
|
116
|
-
|
|
117
|
-
_.label = op[1];
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
120
31
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (t[2]) _.ops.pop();
|
|
136
|
-
|
|
137
|
-
_.trys.pop();
|
|
138
|
-
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
op = body.call(thisArg, _);
|
|
143
|
-
} catch (e) {
|
|
144
|
-
op = [6, e];
|
|
145
|
-
y = 0;
|
|
146
|
-
} finally {
|
|
147
|
-
f = t = 0;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (op[0] & 5) throw op[1];
|
|
152
|
-
return {
|
|
153
|
-
value: op[0] ? op[1] : void 0,
|
|
154
|
-
done: true
|
|
155
|
-
};
|
|
156
|
-
}
|
|
32
|
+
var imageSrcMap = {
|
|
33
|
+
'light-playicon-01': _lightPlayicon["default"],
|
|
34
|
+
'light-playicon-02': _lightPlayicon2["default"],
|
|
35
|
+
'light-playicon-03': _lightPlayicon3["default"],
|
|
36
|
+
'light-playicon-04': _lightPlayicon4["default"],
|
|
37
|
+
'light-playicon-05': _lightPlayicon5["default"],
|
|
38
|
+
'dark-playicon-01': _darkPlayicon["default"],
|
|
39
|
+
'dark-playicon-02': _darkPlayicon2["default"],
|
|
40
|
+
'dark-playicon-03': _darkPlayicon3["default"],
|
|
41
|
+
'dark-playicon-04': _darkPlayicon4["default"],
|
|
42
|
+
'dark-playicon-05': _darkPlayicon5["default"]
|
|
157
43
|
};
|
|
158
44
|
|
|
159
45
|
function PlaySvg(props) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
case 0:
|
|
171
|
-
return [4
|
|
172
|
-
/*yield*/
|
|
173
|
-
, Promise.resolve("".concat("./images/" + props.imgName + ".svg")).then(function (s) {
|
|
174
|
-
return _interopRequireWildcard(require(s));
|
|
175
|
-
})];
|
|
176
|
-
|
|
177
|
-
case 1:
|
|
178
|
-
return [2
|
|
179
|
-
/*return*/
|
|
180
|
-
, _a.sent()];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
(0, _react.useEffect)(function () {
|
|
187
|
-
getImageUrl().then(function (v) {
|
|
188
|
-
setImgSrc(v["default"]);
|
|
189
|
-
});
|
|
190
|
-
});
|
|
46
|
+
// const [imgSrc, setImgSrc] = useState(null);
|
|
47
|
+
// const getImageUrl = async () => {
|
|
48
|
+
// console.log('-- imagePath', imageSrcMap[props.imgName]);
|
|
49
|
+
// return await import(`./images/${props.imgName}.svg`);
|
|
50
|
+
// };
|
|
51
|
+
// useEffect(() => {
|
|
52
|
+
// getImageUrl().then(v => {
|
|
53
|
+
// setImgSrc(v.default);
|
|
54
|
+
// });
|
|
55
|
+
// });
|
|
191
56
|
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
192
57
|
alt: "icon",
|
|
193
|
-
src:
|
|
58
|
+
src: imageSrcMap[props.imgName],
|
|
194
59
|
style: {
|
|
195
60
|
width: props.imgWidth
|
|
196
61
|
}
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.addZero = exports.addUrlQuery = void 0;
|
|
|
7
7
|
exports.asyncDataURLtoImage = asyncDataURLtoImage;
|
|
8
8
|
exports.checkFileName = exports.calcLastTime = exports.asyncNextTick = void 0;
|
|
9
9
|
exports.commonFetch = commonFetch;
|
|
10
|
+
exports.compatibleNewPageData = void 0;
|
|
10
11
|
exports.convertImageUrl = convertImageUrl;
|
|
11
12
|
exports.convertToRem = void 0;
|
|
12
13
|
exports.copy2ClipBoard = copy2ClipBoard;
|
|
@@ -28,6 +29,8 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
28
29
|
|
|
29
30
|
var _lodash = require("lodash");
|
|
30
31
|
|
|
32
|
+
var _uuid = require("uuid");
|
|
33
|
+
|
|
31
34
|
var _qs = _interopRequireDefault(require("qs"));
|
|
32
35
|
|
|
33
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -767,5 +770,36 @@ var pxToRem = function pxToRem(styleObj) {
|
|
|
767
770
|
|
|
768
771
|
return remObj;
|
|
769
772
|
};
|
|
773
|
+
/**
|
|
774
|
+
* 处理新老数据兼容问题
|
|
775
|
+
* @param pageData 大JSON
|
|
776
|
+
*/
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
exports.pxToRem = pxToRem;
|
|
780
|
+
|
|
781
|
+
var compatibleNewPageData = function compatibleNewPageData(pageData) {
|
|
782
|
+
pageData.childNodes.forEach(function (child) {
|
|
783
|
+
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
784
|
+
if (child.type === 'VIDEO') {
|
|
785
|
+
console.log('--compatibleNewPageData -- video ');
|
|
786
|
+
child.groupSource.forEach(function (group) {
|
|
787
|
+
if (!group.playIcon) {
|
|
788
|
+
console.log('--compatibleNewPageData -- video add group.playIcon ');
|
|
789
|
+
group.playIcon = {
|
|
790
|
+
open: true,
|
|
791
|
+
parentId: group.id,
|
|
792
|
+
id: (0, _uuid.v4)(),
|
|
793
|
+
type: 'PLAY',
|
|
794
|
+
size: 48,
|
|
795
|
+
pcSize: 60,
|
|
796
|
+
iconType: 'light-playicon-01',
|
|
797
|
+
iconColor: 'Light'
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
};
|
|
770
804
|
|
|
771
|
-
exports.
|
|
805
|
+
exports.compatibleNewPageData = compatibleNewPageData;
|