@fonixtree/magic-design 0.0.124 → 0.0.126

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.
Files changed (61) hide show
  1. package/es/common/GroupList/index.js +2 -2
  2. package/es/common/ImageModal/index.js +1 -1
  3. package/es/common/ImgArea/components/Crop.js +5 -2
  4. package/es/common/ImgArea/components/MultiCrops.js +24 -17
  5. package/es/common/LinkModal/CustomTable/index.js +2 -1
  6. package/es/common/LinkModal/SelectVideoModal/index.js +183 -0
  7. package/es/common/LinkModal/SelectVideoModal/index.less +0 -0
  8. package/es/common/LinkModal/index.js +191 -14
  9. package/es/common/Video/components/index.js +92 -0
  10. package/es/common/Video/components/index.less +62 -0
  11. package/es/common/Video/index.js +35 -11
  12. package/es/common/Video/index.less +3 -2
  13. package/es/composite-comp/bol/components/Button/defaultJSON.js +12 -2
  14. package/es/composite-comp/bol/components/Carousel/mobile/index.less +8 -5
  15. package/es/composite-comp/bol/components/Carousel/pc/index.less +9 -4
  16. package/es/composite-comp/bol/components/Video/components/ShareBtn/index.less +1 -0
  17. package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
  18. package/es/composite-comp/bol/components/Video/components/VideoTag/index.less +10 -4
  19. package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +5 -0
  20. package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -1
  21. package/es/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +9 -0
  22. package/es/composite-comp/dito/components/Recommend/mobile/index.less +3 -3
  23. package/es/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  24. package/es/composite-comp/dito/components/Recommend/pc/index.less +4 -4
  25. package/es/composite-comp/dito/components/SearchBar/pc/index.less +4 -0
  26. package/es/core/Designer/index.js +1 -0
  27. package/es/core/Renderer/index.js +5 -2
  28. package/es/decorator/compositeDecorator.js +7 -6
  29. package/es/meta-comp/components/Image/index.js +1 -0
  30. package/es/utils/commonUtil.js +76 -4
  31. package/lib/common/GroupList/index.js +2 -2
  32. package/lib/common/ImageModal/index.js +1 -1
  33. package/lib/common/ImgArea/components/Crop.js +5 -2
  34. package/lib/common/ImgArea/components/MultiCrops.js +24 -17
  35. package/lib/common/LinkModal/CustomTable/index.js +2 -1
  36. package/lib/common/LinkModal/SelectVideoModal/index.js +183 -0
  37. package/lib/common/LinkModal/SelectVideoModal/index.less +0 -0
  38. package/lib/common/LinkModal/index.js +191 -14
  39. package/lib/common/Video/components/index.js +92 -0
  40. package/lib/common/Video/components/index.less +62 -0
  41. package/lib/common/Video/index.js +35 -11
  42. package/lib/common/Video/index.less +3 -2
  43. package/lib/composite-comp/bol/components/Button/defaultJSON.js +12 -2
  44. package/lib/composite-comp/bol/components/Carousel/mobile/index.less +8 -5
  45. package/lib/composite-comp/bol/components/Carousel/pc/index.less +9 -4
  46. package/lib/composite-comp/bol/components/Video/components/ShareBtn/index.less +1 -0
  47. package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +7 -3
  48. package/lib/composite-comp/bol/components/Video/components/VideoTag/index.less +10 -4
  49. package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +5 -0
  50. package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +8 -1
  51. package/lib/composite-comp/bol/config-panels/VideoConfig/VideoConfigGroup/index.js +9 -0
  52. package/lib/composite-comp/dito/components/Recommend/mobile/index.less +3 -3
  53. package/lib/composite-comp/dito/components/Recommend/pc/index.js +1 -1
  54. package/lib/composite-comp/dito/components/Recommend/pc/index.less +4 -4
  55. package/lib/composite-comp/dito/components/SearchBar/pc/index.less +4 -0
  56. package/lib/core/Designer/index.js +1 -0
  57. package/lib/core/Renderer/index.js +5 -2
  58. package/lib/decorator/compositeDecorator.js +7 -6
  59. package/lib/meta-comp/components/Image/index.js +1 -0
  60. package/lib/utils/commonUtil.js +76 -4
  61. package/package.json +1 -2
@@ -148,7 +148,7 @@ function (_super) {
148
148
  var dragId = this.state.dragId;
149
149
  return /*#__PURE__*/_react["default"].createElement("div", {
150
150
  className: "group_list"
151
- }, source.length > 0 && source.map(function (src) {
151
+ }, source.length > 0 && source.map(function (src, index) {
152
152
  return /*#__PURE__*/_react["default"].createElement("div", {
153
153
  key: "card" + src.id,
154
154
  className: "group_item",
@@ -176,7 +176,7 @@ function (_super) {
176
176
  type: "icon-drag"
177
177
  }), /*#__PURE__*/_react["default"].createElement("span", {
178
178
  className: "middle_info ml8"
179
- }, renderCard(src) || 'image name')), /*#__PURE__*/_react["default"].createElement("div", {
179
+ }, renderCard(src, index) || 'image name')), /*#__PURE__*/_react["default"].createElement("div", {
180
180
  className: "right"
181
181
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
182
182
  className: "icon_copy",
@@ -462,7 +462,7 @@ function ImageModal(_a) {
462
462
  };
463
463
 
464
464
  var onUpload = function onUpload(data) {
465
- return fetch('/operation/v1/upload/contents', {
465
+ return fetch(window.magicDesign.MBaseUrl + "/upload/contents", {
466
466
  method: 'POST',
467
467
  body: data,
468
468
  headers: headers
@@ -89,6 +89,7 @@ function (_super) {
89
89
  onResize = _a.onResize,
90
90
  onChange = _a.onChange,
91
91
  onSave = _a.onSave;
92
+ console.log(e);
92
93
  var _c = e.rect,
93
94
  width = _c.width,
94
95
  height = _c.height;
@@ -96,8 +97,10 @@ function (_super) {
96
97
  left = _d.left,
97
98
  top = _d.top; // console.log(x, left, y, top);
98
99
  // if (x + left < 0 || y + top < 0 || x + left + width > 500 || y + top + height > 500) {
99
- // return;
100
- // }
100
+
101
+ if (x + left < 0 || y + top < 0 || x + left + width > 600 || y + top + height > _this.props.maxHeight) {
102
+ return;
103
+ }
101
104
 
102
105
  var nextCoordinate = __assign(__assign({}, coordinate), {
103
106
  x: x + left,
@@ -73,6 +73,7 @@ function (_super) {
73
73
 
74
74
  _this.drawingIndex = -1;
75
75
  _this.pointA = {};
76
+ _this.maxHeight = 100;
76
77
  _this.id = _shortid["default"].generate();
77
78
 
78
79
  _this.renderCrops = function (props) {
@@ -81,9 +82,11 @@ function (_super) {
81
82
  return /*#__PURE__*/_react["default"].createElement(_Crop["default"] // improve performance when delet crop in middle array
82
83
  , _extends({
83
84
  key: coor.id || index,
84
- index: index,
85
- coordinate: coor
86
- }, props));
85
+ coordinate: coor,
86
+ index: index
87
+ }, props, {
88
+ maxHeight: _this.maxHeight
89
+ }));
87
90
  })(props.coordinates);
88
91
  };
89
92
 
@@ -150,6 +153,12 @@ function (_super) {
150
153
  _this.pointA = {};
151
154
  };
152
155
 
156
+ _this.imgOnLoad = function (e) {
157
+ _this.maxHeight = e.target.height || 100; // console.log(e.target.height);
158
+
159
+ _this.props.onLoad(e);
160
+ };
161
+
153
162
  return _this;
154
163
  }
155
164
 
@@ -159,31 +168,29 @@ function (_super) {
159
168
  var _a = this.props,
160
169
  src = _a.src,
161
170
  width = _a.width,
162
- height = _a.height,
163
- onLoad = _a.onLoad; // const { clicked } = this.state
164
-
171
+ height = _a.height;
165
172
  return /*#__PURE__*/_react["default"].createElement("div", {
166
- style: {
167
- display: 'inline-block',
168
- position: 'relative',
169
- width: '600px'
173
+ ref: function ref(container) {
174
+ return _this.container = container;
170
175
  },
171
176
  onMouseDown: this.handleMouseDown,
172
177
  onMouseMove: this.handleMouseMove,
173
178
  onMouseUp: this.handlMouseUp,
174
- ref: function ref(container) {
175
- return _this.container = container;
179
+ style: {
180
+ display: 'inline-block',
181
+ position: 'relative',
182
+ width: '600px'
176
183
  }
177
184
  }, /*#__PURE__*/_react["default"].createElement("img", {
178
185
  ref: function ref(img) {
179
186
  return _this.img = img;
180
187
  },
181
- src: src,
182
- width: width,
183
- height: height,
184
- onLoad: onLoad,
185
188
  alt: "",
186
- draggable: false
189
+ draggable: false,
190
+ height: height,
191
+ onLoad: this.imgOnLoad,
192
+ src: src,
193
+ width: width
187
194
  }), this.renderCrops(this.props));
188
195
  };
189
196
 
@@ -201,7 +201,8 @@ function CustomTable(props) {
201
201
  pageType: 'Customized',
202
202
  verType: 'Formal',
203
203
  configVersion: 'V2',
204
- state: 'Using'
204
+ state: 'Using',
205
+ siteId: window.magicDesign.siteId
205
206
  });
206
207
  }, []);
207
208
  var columns = [{
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _antd = require("antd");
11
+
12
+ var _Field = _interopRequireDefault(require("../../Field"));
13
+
14
+ var _Iconfont = _interopRequireDefault(require("../../Iconfont"));
15
+
16
+ var _VideoUpload = _interopRequireDefault(require("../../VideoUpload"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ var __extends = void 0 && (void 0).__extends || function () {
21
+ var _extendStatics = function extendStatics(d, b) {
22
+ _extendStatics = Object.setPrototypeOf || {
23
+ __proto__: []
24
+ } instanceof Array && function (d, b) {
25
+ d.__proto__ = b;
26
+ } || function (d, b) {
27
+ for (var p in b) {
28
+ if (b.hasOwnProperty(p)) d[p] = b[p];
29
+ }
30
+ };
31
+
32
+ return _extendStatics(d, b);
33
+ };
34
+
35
+ return function (d, b) {
36
+ _extendStatics(d, b);
37
+
38
+ function __() {
39
+ this.constructor = d;
40
+ }
41
+
42
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
43
+ };
44
+ }();
45
+
46
+ var debug = require('debug')('worker:AComponent');
47
+
48
+ var AComponent =
49
+ /** @class */
50
+ function (_super) {
51
+ __extends(AComponent, _super);
52
+
53
+ function AComponent() {
54
+ var _this = _super !== null && _super.apply(this, arguments) || this;
55
+
56
+ _this.state = {
57
+ ready: false
58
+ };
59
+ _this.search = {};
60
+ return _this;
61
+ }
62
+
63
+ AComponent.prototype.render = function () {
64
+ var _this = this;
65
+
66
+ var title = this.props.title;
67
+ var ready = this.state.ready;
68
+ return /*#__PURE__*/_react["default"].createElement("div", {
69
+ className: "container"
70
+ }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, "Select Video"), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Field["default"], {
71
+ title: "Select Video"
72
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
73
+ onChange: function onChange(v) {
74
+ _this.search.sourceType = v;
75
+
76
+ _this.reRender();
77
+ },
78
+ value: this.search.sourceType
79
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
80
+ value: "Upload"
81
+ }, "Upload"), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
82
+ value: "URL"
83
+ }, "URL"))), this.search.sourceType === 'URL' && /*#__PURE__*/_react["default"].createElement(_Field["default"], {
84
+ title: "URL"
85
+ }, /*#__PURE__*/_react["default"].createElement("div", {
86
+ className: "input-url"
87
+ }, /*#__PURE__*/_react["default"].createElement("input", {
88
+ onChange: function onChange(e) {
89
+ _this.search.sourceUrl = e.target.value;
90
+
91
+ _this.reRender();
92
+ },
93
+ placeholder: i18n('PLEASE_ADD_A_LINK'),
94
+ type: "text",
95
+ value: this.search.sourceUrl
96
+ }), /*#__PURE__*/_react["default"].createElement("div", {
97
+ className: "icon-btns"
98
+ }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
99
+ color: "#FF4141",
100
+ onClick: function onClick() {
101
+ _this.search.sourceUrl = '';
102
+
103
+ _this.reRender();
104
+ },
105
+ size: "20px",
106
+ type: "icon-delete1"
107
+ })))), this.search.sourceType === 'Upload' && /*#__PURE__*/_react["default"].createElement(_VideoUpload["default"], {
108
+ onChange: function onChange(v) {
109
+ _this.search.sourceUrl = v;
110
+
111
+ _this.reRender();
112
+ },
113
+ value: this.search.sourceUrl
114
+ }))), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, "Setting"), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Field["default"], {
115
+ layout: "horizontal",
116
+ split: true,
117
+ title: "Progress bar"
118
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
119
+ checked: this.search.progressBar,
120
+ onChange: function onChange(v) {
121
+ _this.search.progressBar = v;
122
+
123
+ _this.reRender();
124
+ }
125
+ })), /*#__PURE__*/_react["default"].createElement(_Field["default"], {
126
+ layout: "horizontal",
127
+ split: true,
128
+ title: "Play in loop"
129
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
130
+ checked: this.search.loop,
131
+ onChange: function onChange(v) {
132
+ _this.search.loop = v;
133
+
134
+ _this.reRender();
135
+ }
136
+ })), /*#__PURE__*/_react["default"].createElement(_Field["default"], {
137
+ layout: "horizontal",
138
+ split: true,
139
+ title: "Autoplays"
140
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
141
+ checked: this.search.autoplay,
142
+ onChange: function onChange(v) {
143
+ _this.search.autoplay = v;
144
+
145
+ _this.reRender();
146
+ }
147
+ })), /*#__PURE__*/_react["default"].createElement(_Field["default"], {
148
+ layout: "horizontal",
149
+ split: true,
150
+ title: "Video Sound"
151
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
152
+ checked: this.search.videoSound,
153
+ onChange: function onChange(v) {
154
+ _this.search.videoSound = v;
155
+
156
+ _this.reRender();
157
+ }
158
+ })), /*#__PURE__*/_react["default"].createElement(_Field["default"], {
159
+ title: "Play Speed"
160
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Slider, {
161
+ inputType: "float",
162
+ maxVal: 2,
163
+ minVal: 0.5,
164
+ onChange: function onChange(_a) {
165
+ var count = _a.count;
166
+ _this.search.speed = count;
167
+
168
+ _this.reRender();
169
+ },
170
+ value: {
171
+ count: this.search.speed
172
+ }
173
+ })))));
174
+ };
175
+
176
+ AComponent.defaultProps = {
177
+ title: 'title'
178
+ };
179
+ return AComponent;
180
+ }(_react["default"].Component);
181
+
182
+ var _default = AComponent;
183
+ exports["default"] = _default;
@@ -27,6 +27,8 @@ var _BundleCampaign = _interopRequireDefault(require("./BundleCampaign"));
27
27
 
28
28
  var _locale = require("../../locale");
29
29
 
30
+ var _commonUtil = require("../../utils/commonUtil");
31
+
30
32
  require("./index.less");
31
33
 
32
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -35,6 +37,149 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
35
37
 
36
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
39
 
40
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
41
+ function adopt(value) {
42
+ return value instanceof P ? value : new P(function (resolve) {
43
+ resolve(value);
44
+ });
45
+ }
46
+
47
+ return new (P || (P = Promise))(function (resolve, reject) {
48
+ function fulfilled(value) {
49
+ try {
50
+ step(generator.next(value));
51
+ } catch (e) {
52
+ reject(e);
53
+ }
54
+ }
55
+
56
+ function rejected(value) {
57
+ try {
58
+ step(generator["throw"](value));
59
+ } catch (e) {
60
+ reject(e);
61
+ }
62
+ }
63
+
64
+ function step(result) {
65
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
66
+ }
67
+
68
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
69
+ });
70
+ };
71
+
72
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
73
+ var _ = {
74
+ label: 0,
75
+ sent: function sent() {
76
+ if (t[0] & 1) throw t[1];
77
+ return t[1];
78
+ },
79
+ trys: [],
80
+ ops: []
81
+ },
82
+ f,
83
+ y,
84
+ t,
85
+ g;
86
+ return g = {
87
+ next: verb(0),
88
+ "throw": verb(1),
89
+ "return": verb(2)
90
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
91
+ return this;
92
+ }), g;
93
+
94
+ function verb(n) {
95
+ return function (v) {
96
+ return step([n, v]);
97
+ };
98
+ }
99
+
100
+ function step(op) {
101
+ if (f) throw new TypeError("Generator is already executing.");
102
+
103
+ while (_) {
104
+ try {
105
+ 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;
106
+ if (y = 0, t) op = [op[0] & 2, t.value];
107
+
108
+ switch (op[0]) {
109
+ case 0:
110
+ case 1:
111
+ t = op;
112
+ break;
113
+
114
+ case 4:
115
+ _.label++;
116
+ return {
117
+ value: op[1],
118
+ done: false
119
+ };
120
+
121
+ case 5:
122
+ _.label++;
123
+ y = op[1];
124
+ op = [0];
125
+ continue;
126
+
127
+ case 7:
128
+ op = _.ops.pop();
129
+
130
+ _.trys.pop();
131
+
132
+ continue;
133
+
134
+ default:
135
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
136
+ _ = 0;
137
+ continue;
138
+ }
139
+
140
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
141
+ _.label = op[1];
142
+ break;
143
+ }
144
+
145
+ if (op[0] === 6 && _.label < t[1]) {
146
+ _.label = t[1];
147
+ t = op;
148
+ break;
149
+ }
150
+
151
+ if (t && _.label < t[2]) {
152
+ _.label = t[2];
153
+
154
+ _.ops.push(op);
155
+
156
+ break;
157
+ }
158
+
159
+ if (t[2]) _.ops.pop();
160
+
161
+ _.trys.pop();
162
+
163
+ continue;
164
+ }
165
+
166
+ op = body.call(thisArg, _);
167
+ } catch (e) {
168
+ op = [6, e];
169
+ y = 0;
170
+ } finally {
171
+ f = t = 0;
172
+ }
173
+ }
174
+
175
+ if (op[0] & 5) throw op[1];
176
+ return {
177
+ value: op[0] ? op[1] : void 0,
178
+ done: true
179
+ };
180
+ }
181
+ };
182
+
38
183
  var LinkModal = function LinkModal(props) {
39
184
  var onConfirm = props.onConfirm,
40
185
  onClose = props.onClose,
@@ -46,14 +191,42 @@ var LinkModal = function LinkModal(props) {
46
191
 
47
192
  var _b = (0, _react.useState)('Category'),
48
193
  selected = _b[0],
49
- setSelected = _b[1];
194
+ setSelected = _b[1]; // const list = ['Category', 'Customized Page', 'Product Details Page', 'Filtered Products', 'Function Page', 'Coupons', 'Bundle Campaign', 'Video'];
50
195
 
51
- var list = ['Category', 'Customized Page', 'Product Details Page', 'Filtered Products', 'Function Page', 'Coupons', 'Bundle Campaign'];
52
196
 
53
- var _c = (0, _react.useState)(0),
54
- total = _c[0],
55
- setTotal = _c[1];
197
+ var _c = (0, _react.useState)([]),
198
+ linkTypes = _c[0],
199
+ setLinkTypes = _c[1];
56
200
 
201
+ var _d = (0, _react.useState)(0),
202
+ total = _d[0],
203
+ setTotal = _d[1];
204
+
205
+ var getLinkTypes = function getLinkTypes() {
206
+ return __awaiter(void 0, void 0, void 0, function () {
207
+ var types;
208
+ return __generator(this, function (_a) {
209
+ switch (_a.label) {
210
+ case 0:
211
+ return [4
212
+ /*yield*/
213
+ , (0, _commonUtil.commonFetch)(window.magicDesign.MBaseUrl + "/linktypes")];
214
+
215
+ case 1:
216
+ types = _a.sent();
217
+ setLinkTypes(types);
218
+ setSelected(types[0].linkTypeCode);
219
+ return [2
220
+ /*return*/
221
+ ];
222
+ }
223
+ });
224
+ });
225
+ };
226
+
227
+ (0, _react.useEffect)(function () {
228
+ getLinkTypes();
229
+ }, []);
57
230
  (0, _react.useEffect)(function () {
58
231
  setTotal(0);
59
232
  }, [visible]);
@@ -85,34 +258,34 @@ var LinkModal = function LinkModal(props) {
85
258
  className: "linkType"
86
259
  }, /*#__PURE__*/_react["default"].createElement("div", {
87
260
  className: "typeTitle"
88
- }, (0, _locale.i18n)('LINK_TYPE'), ":"), list.map(function (item, index) {
261
+ }, (0, _locale.i18n)('LINK_TYPE'), ":"), linkTypes.map(function (item, index) {
89
262
  return /*#__PURE__*/_react["default"].createElement("div", {
90
263
  key: index,
91
- className: "typeItem " + (selected === item ? 'selected' : ''),
264
+ className: "typeItem " + (selected === item.linkTypeCode ? 'selected' : ''),
92
265
  onClick: function onClick() {
93
- return setSelected(item);
266
+ return setSelected(item.linkTypeCode);
94
267
  }
95
- }, item);
268
+ }, item.linkTypeName);
96
269
  })), /*#__PURE__*/_react["default"].createElement("div", {
97
270
  className: "content"
98
271
  }, selected === 'Category' && /*#__PURE__*/_react["default"].createElement(_CatgTable["default"], {
99
272
  onChange: function onChange(value) {
100
273
  return setLinkUrl(value);
101
274
  }
102
- }), selected === 'Customized Page' && /*#__PURE__*/_react["default"].createElement(_CustomTable["default"], {
275
+ }), selected === 'CustomizedPage' && /*#__PURE__*/_react["default"].createElement(_CustomTable["default"], {
103
276
  onChange: function onChange(value) {
104
277
  return setLinkUrl(value);
105
278
  }
106
- }), selected === 'Product Details Page' && /*#__PURE__*/_react["default"].createElement(_ProductDetailPage["default"], {
279
+ }), selected === 'ProductDetailsPage' && /*#__PURE__*/_react["default"].createElement(_ProductDetailPage["default"], {
107
280
  setUrl: function setUrl(url) {
108
281
  return setLinkUrl(url);
109
282
  }
110
- }), selected === 'Filtered Products' && /*#__PURE__*/_react["default"].createElement(_FilteredProductModal["default"], {
283
+ }), selected === 'FilteredProducts' && /*#__PURE__*/_react["default"].createElement(_FilteredProductModal["default"], {
111
284
  onDataChange: function onDataChange(url, t) {
112
285
  setLinkUrl(url);
113
286
  setTotal(t);
114
287
  }
115
- }), selected === 'Function Page' && /*#__PURE__*/_react["default"].createElement(_FunctionTable["default"], {
288
+ }), selected === 'FunctionPage' && /*#__PURE__*/_react["default"].createElement(_FunctionTable["default"], {
116
289
  onChange: function onChange(value) {
117
290
  return setLinkUrl(value);
118
291
  }
@@ -120,7 +293,11 @@ var LinkModal = function LinkModal(props) {
120
293
  onChange: function onChange(value) {
121
294
  return setLinkUrl(value);
122
295
  }
123
- }), selected === 'Bundle Campaign' && /*#__PURE__*/_react["default"].createElement(_BundleCampaign["default"], {
296
+ }), selected === 'BundleCampaign' && /*#__PURE__*/_react["default"].createElement(_BundleCampaign["default"], {
297
+ setUrl: function setUrl(url) {
298
+ return setLinkUrl(url);
299
+ }
300
+ }), selected === 'Video' && /*#__PURE__*/_react["default"].createElement(_BundleCampaign["default"], {
124
301
  setUrl: function setUrl(url) {
125
302
  return setLinkUrl(url);
126
303
  }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ require("./index.less");
9
+
10
+ function parseDom(html) {
11
+ var ele = document.createElement('div');
12
+ ele.innerHTML = html;
13
+ return ele.childNodes[0];
14
+ }
15
+
16
+ var rateHtml = "<div class=\"rate-components\">\n <div class=\"current-rate\">1.0x</div>\n <ul class=\"rate-list\">\n <li data-rate=\"2.0\">2.0x</li>\n <li data-rate=\"1.5\">1.5x</li>\n <li data-rate=\"1.25\">1.25x</li>\n <li data-rate=\"1.0\" class=\"current\">1.0x</li>\n <li data-rate=\"0.5\">0.5x</li>\n </ul>\n</div>";
17
+ /**
18
+ * 倍速播放组件
19
+ */
20
+
21
+ var RateComponent =
22
+ /** @class */
23
+ function () {
24
+ /**
25
+ * @constructor 倍速播放组件构造函数
26
+ */
27
+ function RateComponent() {
28
+ this.html = parseDom(rateHtml);
29
+ }
30
+
31
+ RateComponent.prototype.createEl = function (el) {
32
+ var eleControlbar = el.querySelector('.prism-controlbar');
33
+ eleControlbar.appendChild(this.html);
34
+ };
35
+
36
+ RateComponent.prototype.ready = function (player, e) {
37
+ var currentRateEle = this.html.querySelector('.current-rate');
38
+ var rateListEle = this.html.querySelector('.rate-list');
39
+ var timeId = null; // 隐藏设置里面的倍速播放
40
+
41
+ var settingRate = document.querySelector('.prism-setting-item.prism-setting-speed');
42
+
43
+ if (settingRate) {
44
+ settingRate.classList.add('player-hidden');
45
+ }
46
+
47
+ currentRateEle.onclick = function () {
48
+ rateListEle.style.display = 'block';
49
+ };
50
+
51
+ currentRateEle.onmouseleave = function () {
52
+ timeId = setTimeout(function () {
53
+ rateListEle.style.display = 'none';
54
+ }, 100);
55
+ };
56
+
57
+ rateListEle.onmouseenter = function () {
58
+ clearTimeout(timeId);
59
+ };
60
+
61
+ rateListEle.onmouseleave = function () {
62
+ rateListEle.style.display = 'none';
63
+ };
64
+
65
+ rateListEle.onclick = function (_a) {
66
+ var target = _a.target;
67
+ var rate = target.dataset.rate;
68
+
69
+ if (rate) {
70
+ player.setSpeed(rate);
71
+
72
+ if (target.className !== 'current') {
73
+ var currentEle = rateListEle.querySelector('.current');
74
+
75
+ if (currentEle) {
76
+ currentEle.className = '';
77
+ }
78
+
79
+ target.className = 'current';
80
+ }
81
+
82
+ rateListEle.style.display = 'none';
83
+ currentRateEle.innerText = rate + 'x';
84
+ }
85
+ };
86
+ };
87
+
88
+ return RateComponent;
89
+ }();
90
+
91
+ var _default = RateComponent;
92
+ exports["default"] = _default;