@fonixtree/magic-design 0.1.61 → 0.1.63
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 +1 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +3 -3
- 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/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +34 -169
- package/lib/composite-comp/bol/components/Video/index.js +1 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +3 -3
- 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/meta-comp/config-panels/PlayIconConfig/PlaySvg/index.js +34 -169
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ function (_super) {
|
|
|
74
74
|
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
75
75
|
var nodeData = this.props.nodeData;
|
|
76
76
|
|
|
77
|
-
if (nodeData.groupSource
|
|
77
|
+
if (nodeData.groupSource && nodeData.groupSource.length > 0) {
|
|
78
78
|
nodeData.groupSource.forEach(function (group) {
|
|
79
79
|
if (!group.playIcon) {
|
|
80
80
|
group.playIcon = {
|
|
@@ -118,7 +118,7 @@ function (_super) {
|
|
|
118
118
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
119
119
|
className: "video-layout1-wrap"
|
|
120
120
|
}, data.groupSource.map(function (group) {
|
|
121
|
-
var _a, _b;
|
|
121
|
+
var _a, _b, _c;
|
|
122
122
|
/** 当前是否在播放 */
|
|
123
123
|
|
|
124
124
|
|
|
@@ -151,14 +151,14 @@ function (_super) {
|
|
|
151
151
|
}),
|
|
152
152
|
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
153
153
|
videoId: group.id
|
|
154
|
-
}), !isPlaying && group.video.playButton == 'Middle' && group.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
|
+
}), !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", {
|
|
155
155
|
className: "play-btn center",
|
|
156
156
|
onClick: function onClick() {
|
|
157
157
|
_this.playOrPause(group);
|
|
158
158
|
}
|
|
159
159
|
}, /*#__PURE__*/_react["default"].createElement(_PlaySvg["default"], {
|
|
160
160
|
imgName: group.playIcon.iconType,
|
|
161
|
-
imgWidth: group.playIcon.size
|
|
161
|
+
imgWidth: group === null || group === void 0 ? void 0 : group.playIcon.size
|
|
162
162
|
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
163
163
|
data: data
|
|
164
164
|
}), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -74,7 +74,7 @@ function (_super) {
|
|
|
74
74
|
// 兼容新开发的功能: video新增播放按钮 的设置
|
|
75
75
|
var nodeData = this.props.nodeData;
|
|
76
76
|
|
|
77
|
-
if (nodeData.groupSource
|
|
77
|
+
if (nodeData.groupSource && nodeData.groupSource.length > 0) {
|
|
78
78
|
nodeData.groupSource.forEach(function (group) {
|
|
79
79
|
if (!group.playIcon) {
|
|
80
80
|
group.playIcon = {
|
|
@@ -118,7 +118,7 @@ function (_super) {
|
|
|
118
118
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
119
119
|
className: "video-layout1-wrap"
|
|
120
120
|
}, data.groupSource.map(function (group) {
|
|
121
|
-
var _a, _b;
|
|
121
|
+
var _a, _b, _c;
|
|
122
122
|
/** 当前是否在播放 */
|
|
123
123
|
|
|
124
124
|
|
|
@@ -151,14 +151,14 @@ function (_super) {
|
|
|
151
151
|
}),
|
|
152
152
|
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
153
153
|
videoId: group.id
|
|
154
|
-
}), !isPlaying && group.video.playButton == 'Middle' && group.playIcon.open && /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
|
+
}), !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", {
|
|
155
155
|
className: "play-btn center",
|
|
156
156
|
onClick: function onClick() {
|
|
157
157
|
_this.playOrPause(group);
|
|
158
158
|
}
|
|
159
159
|
}, /*#__PURE__*/_react["default"].createElement(_PlaySvg["default"], {
|
|
160
160
|
imgName: group.playIcon.iconType,
|
|
161
|
-
imgWidth: group.playIcon.size
|
|
161
|
+
imgWidth: group === null || group === void 0 ? void 0 : group.playIcon.size
|
|
162
162
|
})), data.share.open && !isPlaying && /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
163
163
|
data: data
|
|
164
164
|
}), !isPlaying && /*#__PURE__*/_react["default"].createElement(_VideoTag["default"], {
|
|
@@ -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);
|
|
@@ -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
|
}
|