pb-sxp-ui 1.15.14 → 1.15.15-alpha.2

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 (51) hide show
  1. package/dist/index.cjs +781 -129
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +779 -128
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +6 -6
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +6 -6
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +781 -129
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +6 -6
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  14. package/es/core/components/DiyStoryPreview/PictureGroup.js +34 -0
  15. package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +27 -0
  16. package/es/core/components/DiyStoryPreview/VideoWidget.js +195 -0
  17. package/es/core/components/DiyStoryPreview/index.d.ts +51 -0
  18. package/es/core/components/DiyStoryPreview/index.js +411 -0
  19. package/es/core/components/SxpPageCore/index.d.ts +1 -0
  20. package/es/core/components/SxpPageCore/index.js +7 -7
  21. package/es/core/components/SxpPageRender/ExpandableText.js +10 -2
  22. package/es/core/components/SxpPageRender/RenderCard.js +4 -4
  23. package/es/core/context/EditorContext.js +1 -1
  24. package/es/core/context/SxpDataSourceProvider.d.ts +1 -1
  25. package/es/core/context/SxpDataSourceProvider.js +28 -41
  26. package/es/index.d.ts +1 -0
  27. package/es/index.js +1 -0
  28. package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
  29. package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
  30. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
  31. package/es/materials/sxp/template/components/EventProvider.js +2 -2
  32. package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  33. package/lib/core/components/DiyStoryPreview/PictureGroup.js +37 -0
  34. package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +27 -0
  35. package/lib/core/components/DiyStoryPreview/VideoWidget.js +198 -0
  36. package/lib/core/components/DiyStoryPreview/index.d.ts +51 -0
  37. package/lib/core/components/DiyStoryPreview/index.js +414 -0
  38. package/lib/core/components/SxpPageCore/index.d.ts +1 -0
  39. package/lib/core/components/SxpPageCore/index.js +7 -7
  40. package/lib/core/components/SxpPageRender/ExpandableText.js +10 -2
  41. package/lib/core/components/SxpPageRender/RenderCard.js +4 -4
  42. package/lib/core/context/EditorContext.js +1 -1
  43. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -1
  44. package/lib/core/context/SxpDataSourceProvider.js +28 -41
  45. package/lib/index.d.ts +1 -0
  46. package/lib/index.js +3 -1
  47. package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
  48. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
  49. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
  50. package/lib/materials/sxp/template/components/EventProvider.js +2 -2
  51. package/package.json +1 -1
@@ -114,12 +114,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
114
114
  }
115
115
  if (options.type === 'beacon' && navigator.sendBeacon) {
116
116
  return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
117
- JSON.stringify({
118
- body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
119
- })
120
- ], {
121
- type: 'application/json;charset=UTF-8'
122
- }));
117
+ JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
118
+ ], { type: 'application/json;charset=UTF-8' }));
123
119
  }
124
120
  return window
125
121
  .fetch(`${url}/api/${path}`, {
@@ -148,17 +144,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
148
144
  .catch((err) => Promise.reject(err));
149
145
  }, [bffDataSource]);
150
146
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
151
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
152
- query = Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
147
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
148
+ query = Object.assign({ maxSize: 50, defaultSize: 50, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
153
149
  if (channel) {
154
150
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
155
151
  }
156
152
  else if (utmVal) {
157
- const val = (_k = (_j = (_h = splitUrlParams(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
158
- var _a, _b;
153
+ const val = (_h = (_g = (_f = splitUrlParams(utmVal)) === null || _f === void 0 ? void 0 : _f.filter((val) => {
159
154
  const key = val.split('=')[0];
160
- return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
161
- })) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
155
+ return key;
156
+ })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
162
157
  if (val)
163
158
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
164
159
  }
@@ -172,19 +167,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
172
167
  let list = [];
173
168
  let result = null;
174
169
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
175
- var _v, _w, _x, _y, _z, _0;
170
+ var _t, _u, _v, _w, _x, _y;
176
171
  query.pageNum = pageNum;
177
172
  result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
178
173
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
179
174
  return undefined;
180
175
  }
181
176
  setLoading(false);
182
- list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
177
+ list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
183
178
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
184
179
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
185
180
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
186
181
  }
187
- const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
182
+ const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
188
183
  if (isNotNullList) {
189
184
  pageNum = pageNum + 1;
190
185
  yield recurveRecList(query);
@@ -192,13 +187,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
192
187
  });
193
188
  yield recurveRecList(query);
194
189
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
195
- setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
190
+ setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
196
191
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
197
192
  }
198
193
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
199
- query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
194
+ query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
200
195
  }
201
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
196
+ const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct', { method: 'POST', body: query }));
202
197
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
203
198
  return undefined;
204
199
  }
@@ -206,8 +201,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
206
201
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
207
202
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
208
203
  let list = [];
209
- list = list.concat((_s = (_r = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.filter) === null || _r === void 0 ? void 0 : _r.call(_q, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _s !== void 0 ? _s : []);
210
- const isNotNullList = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
204
+ list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
205
+ const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
211
206
  if (!isNotNullList) {
212
207
  setIsNoMoreData(true);
213
208
  }
@@ -216,12 +211,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
216
211
  return result === null || result === void 0 ? void 0 : result.data;
217
212
  }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
218
213
  const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
219
- var _1, _2, _3, _4;
214
+ var _z, _0, _1, _2;
220
215
  if (rtcList.length <= 0) {
221
216
  return;
222
217
  }
223
218
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
224
- const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
219
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: [(_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId] })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
225
220
  setRtcList(rtcList.concat(getFilterRecList(data)));
226
221
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
227
222
  return data;
@@ -273,7 +268,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
273
268
  console.log('userInfo:', userInfo);
274
269
  console.log('eventInfo:', ef);
275
270
  console.log('========= 结束 =========');
276
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/cld/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
271
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
277
272
  method: 'POST',
278
273
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
279
274
  type: 'beacon'
@@ -289,7 +284,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
289
284
  bffDataSource
290
285
  ]);
291
286
  const bffFbReport = useCallback(({ eventName, product }) => {
292
- var _a, _b, _c, _d, _e, _f, _g;
287
+ var _a, _b, _c, _d, _e, _f;
293
288
  if (!enableReportEvent ||
294
289
  !enabledMetaConversionApi ||
295
290
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -353,15 +348,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
353
348
  }
354
349
  };
355
350
  getEventParams(jsonParams);
356
- const params = {};
357
- const queryString = location.search.slice(1);
358
- (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
359
- const key = val.split('=')[0];
360
- const value = val.split('=')[1];
361
- params[key] = value;
362
- });
363
- const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
364
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
351
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
365
352
  method: 'POST',
366
353
  body: jsonParams,
367
354
  type: 'beacon'
@@ -388,18 +375,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
388
375
  return res === null || res === void 0 ? void 0 : res.success;
389
376
  }), [bffFetch]);
390
377
  const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
391
- var _5, _6, _7, _8, _9, _10, _11, _12;
392
- const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
378
+ var _3, _4, _5, _6, _7, _8, _9, _10;
379
+ const isShowTag = !!((_5 = (_4 = (_3 = data === null || data === void 0 ? void 0 : data.data) === null || _3 === void 0 ? void 0 : _3.sxpPageConf) === null || _4 === void 0 ? void 0 : _4.globalConfig) === null || _5 === void 0 ? void 0 : _5.isShowTag);
393
380
  if (!utmVal || !isShowTag)
394
381
  return;
395
382
  try {
396
- const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
383
+ const val = (_8 = (_7 = (_6 = splitUrlParams(utmVal)) === null || _6 === void 0 ? void 0 : _6.filter((val) => {
397
384
  var _a, _b;
398
385
  const key = val.split('=')[0];
399
386
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
400
- })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
387
+ })) === null || _7 === void 0 ? void 0 : _7.join('&')) !== null && _8 !== void 0 ? _8 : '';
401
388
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
402
- setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
389
+ setTagList((_10 = (_9 = result === null || result === void 0 ? void 0 : result.data) === null || _9 === void 0 ? void 0 : _9.tags) !== null && _10 !== void 0 ? _10 : []);
403
390
  }
404
391
  catch (e) {
405
392
  console.log('e', e);
@@ -459,10 +446,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
459
446
  });
460
447
  }, [bffEventReport]);
461
448
  const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
462
- var _13, _14;
449
+ var _11, _12;
463
450
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
464
- setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
465
- return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
451
+ setChatlabsId((_11 = res === null || res === void 0 ? void 0 : res.data) === null || _11 === void 0 ? void 0 : _11.chatLabsId);
452
+ return ((_12 = res === null || res === void 0 ? void 0 : res.data) === null || _12 === void 0 ? void 0 : _12.consentResult) === 'true';
466
453
  }), [bffFetch]);
467
454
  const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
468
455
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
package/es/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * as core from './core';
4
4
  export * as materials from './materials';
5
5
  export { default as SxpPageRender } from './core/components/SxpPageRender';
6
6
  export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
7
+ export { default as DiyStoryPreview } from './core/components/DiyStoryPreview';
7
8
  export { default as Modal } from './core/components/SxpPageRender/Modal';
8
9
  export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
9
10
  export { default as SxpPageCore } from './core/components/SxpPageCore';
package/es/index.js CHANGED
@@ -6,6 +6,7 @@ import * as materials_1 from './materials';
6
6
  export { materials_1 as materials };
7
7
  export { default as SxpPageRender } from './core/components/SxpPageRender';
8
8
  export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
9
+ export { default as DiyStoryPreview } from './core/components/DiyStoryPreview';
9
10
  export { default as Modal } from './core/components/SxpPageRender/Modal';
10
11
  export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
11
12
  export { default as SxpPageCore } from './core/components/SxpPageCore';
@@ -4,10 +4,10 @@ import React, { memo, useState } from 'react';
4
4
  import { SwiperSlide } from 'swiper/react';
5
5
  import Img from '../components/Img';
6
6
  import Scroll from '../components/Scroll';
7
+ import EventProvider from '../components/EventProvider';
7
8
  import styles from './index.module.less';
8
9
  import { useSxpDataSource } from '../../../../core/hooks';
9
10
  import { setFontForText } from '../../../../core/utils/tool';
10
- import EventProvider from '../components/EventProvider';
11
11
  const MultiCommodity = (_a) => {
12
12
  var _b, _c;
13
13
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
@@ -4,15 +4,16 @@ import React, { memo, useState } from 'react';
4
4
  import { SwiperSlide } from 'swiper/react';
5
5
  import Scroll from '../components/Scroll';
6
6
  import Img from '../components/Img';
7
+ import EventProvider from '../components/EventProvider';
7
8
  import styles from './index.module.less';
8
9
  import { useSxpDataSource } from '../../../../core/hooks';
9
10
  import { setFontForText } from '../../../../core/utils/tool';
10
- import EventProvider from '../components/EventProvider';
11
11
  const MultiCommodityDiro = (_a) => {
12
12
  var _b, _c;
13
13
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
14
14
  const { sxpParameter } = useSxpDataSource();
15
15
  const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
16
+ console.log(recData, '222');
16
17
  return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
17
18
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18
19
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -4,15 +4,16 @@ import React, { memo, useState } from 'react';
4
4
  import { SwiperSlide } from 'swiper/react';
5
5
  import Scroll from '../components/Scroll';
6
6
  import Img from '../components/Img';
7
+ import EventProvider from '../components/EventProvider';
7
8
  import styles from './index.module.less';
8
9
  import { useSxpDataSource } from '../../../../core/hooks';
9
10
  import { setFontForText } from '../../../../core/utils/tool';
10
- import EventProvider from '../components/EventProvider';
11
11
  const MultiCommodityDiroNew = (_a) => {
12
12
  var _b, _c;
13
13
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
14
14
  const { sxpParameter } = useSxpDataSource();
15
15
  const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
16
+ console.log(recData, '333');
16
17
  return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
17
18
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18
19
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -13,7 +13,7 @@ const EventProvider = (_a) => {
13
13
  const handleClick = throttle((e) => {
14
14
  var _a, _b, _c, _d, _e, _f;
15
15
  e.preventDefault();
16
- const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
16
+ const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
17
17
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
18
18
  eventSubject: 'clickCta',
19
19
  eventDescription: 'User clicked the CTA'
@@ -40,6 +40,6 @@ const EventProvider = (_a) => {
40
40
  setElement(null);
41
41
  }
42
42
  }, [element, popup]);
43
- return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
43
+ return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ outline: 'none', border: 'none', boxSizing: 'content-box', padding: 0, background: 'transparent', display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
44
44
  };
45
45
  export default memo(EventProvider);
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { postConfigType } from '../SxpPageRender';
3
+ import { IScene, ScenesType } from '.';
4
+ interface IPictureGroupProps {
5
+ imgUrls?: string[];
6
+ width: number;
7
+ height: number;
8
+ rec: IScene;
9
+ index: number;
10
+ imgUrlsPostConfig?: postConfigType;
11
+ swiperRef?: any;
12
+ data?: ScenesType;
13
+ loopPlay?: boolean;
14
+ }
15
+ declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
16
+ export default _default;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
+ const modules_1 = require("swiper/modules");
6
+ const react_2 = require("swiper/react");
7
+ const Picture_1 = tslib_1.__importDefault(require("../SxpPageRender/PictureGroup/Picture"));
8
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
9
+ const { isActive } = (0, react_2.useSwiperSlide)();
10
+ const [isload, setIsLoad] = (0, react_1.useState)(false);
11
+ (0, react_1.useEffect)(() => {
12
+ if (isActive && isload && loopPlay) {
13
+ setTimeout(() => {
14
+ var _a, _b, _c, _d;
15
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
16
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(0);
17
+ }
18
+ else {
19
+ const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
20
+ (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper.slideTo(i + 1);
21
+ }
22
+ }, 3000);
23
+ }
24
+ }, [isActive, isload, data, index, swiperRef, loopPlay]);
25
+ const loadFinishImage = () => {
26
+ setIsLoad(true);
27
+ };
28
+ return (react_1.default.createElement(react_2.Swiper, { defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
29
+ clickable: true,
30
+ bulletActiveClass: 'swipe-item-active-bullet',
31
+ bulletElement: 'button'
32
+ }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
33
+ return (react_1.default.createElement(react_2.SwiperSlide, { key: url },
34
+ react_1.default.createElement(Picture_1.default, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: loadFinishImage })));
35
+ })));
36
+ };
37
+ exports.default = (0, react_1.memo)(PictureGroup);
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { postConfigType } from '../SxpPageRender';
3
+ import { IScene, ScenesType } from '.';
4
+ interface IVideoWidgetProps {
5
+ rec: IScene;
6
+ index: number;
7
+ height: number;
8
+ width: number;
9
+ data: ScenesType;
10
+ muted: boolean;
11
+ activeIndex?: number;
12
+ videoPostConfig?: postConfigType;
13
+ swiperRef?: any;
14
+ videoPlayIcon?: string;
15
+ onUpdateTimeLine?: (index: number, v: number) => void;
16
+ loopPlay: any;
17
+ onPlay?: (index: number, v: number) => void;
18
+ onPause?: () => void;
19
+ }
20
+ export interface IVideoWidgetRef {
21
+ play: () => void;
22
+ pause: () => void;
23
+ setLoopPlay: (v: boolean) => void;
24
+ isPlaying: () => boolean;
25
+ }
26
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IVideoWidgetProps & React.RefAttributes<IVideoWidgetRef>>>;
27
+ export default _default;
@@ -0,0 +1,198 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
+ const react_2 = require("swiper/react");
6
+ const useIconLink_1 = require("../SxpPageRender/useIconLink");
7
+ const VideoPlayer_1 = require("../SxpPageRender/VideoWidget/VideoPlayer");
8
+ const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
9
+ const hooks_1 = require("../../../core/hooks");
10
+ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon, onUpdateTimeLine, loopPlay, onPlay, onPause }, ref) => {
11
+ const { isActive } = (0, react_2.useSwiperSlide)();
12
+ const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
13
+ const videoRef = (0, react_1.useRef)(null);
14
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = (0, hooks_1.useSxpDataSource)();
15
+ const videoStartTime = (0, react_1.useRef)(0);
16
+ const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
17
+ const [isFirstPlay, setIsFirstPlay] = (0, react_1.useState)(true);
18
+ const canvasRef = (0, react_1.useRef)(null);
19
+ const [firstFrameSrc, setFirstFrameSrc] = (0, react_1.useState)('');
20
+ const videoId = `pb-cache-video-${index}`;
21
+ const hlsRef = (0, react_1.useRef)(null);
22
+ const loopPlayRef = (0, react_1.useRef)(loopPlay);
23
+ (0, react_1.useEffect)(() => {
24
+ loopPlayRef.current = loopPlay;
25
+ }, [loopPlay]);
26
+ (0, react_1.useImperativeHandle)(ref, () => {
27
+ return {
28
+ play() {
29
+ var _a;
30
+ if (!videoRef.current)
31
+ return;
32
+ handleTimeUpload();
33
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
34
+ setIsPauseVideo(false);
35
+ },
36
+ pause() {
37
+ var _a;
38
+ if (!videoRef.current)
39
+ return;
40
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
41
+ setIsPauseVideo(true);
42
+ },
43
+ setLoopPlay(v) {
44
+ loopPlayRef.current = v;
45
+ },
46
+ isPlaying() {
47
+ var _a;
48
+ return !((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused);
49
+ }
50
+ };
51
+ });
52
+ (0, react_1.useEffect)(() => {
53
+ if (!videoRef.current)
54
+ return;
55
+ videoRef.current.muted = muted;
56
+ }, [muted]);
57
+ const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
58
+ const handleLoadedMetadata = (0, react_1.useCallback)(() => {
59
+ var _a;
60
+ videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
61
+ (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
62
+ setIsLoadFinish(true);
63
+ }, []);
64
+ const handleClickVideo = (0, react_1.useCallback)((type) => () => {
65
+ var _a, _b, _c, _d, _e, _f;
66
+ if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
67
+ return;
68
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
69
+ switch (type) {
70
+ case 'start':
71
+ if (!isPause)
72
+ return;
73
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
74
+ setIsPauseVideo(false);
75
+ break;
76
+ case 'pause':
77
+ if (isPause)
78
+ return;
79
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
80
+ setIsPauseVideo(true);
81
+ break;
82
+ default:
83
+ if (isPause) {
84
+ if (((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (rec === null || rec === void 0 ? void 0 : rec.endTime)) {
85
+ videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
86
+ }
87
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
88
+ }
89
+ else {
90
+ (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
91
+ }
92
+ setIsPauseVideo(!isPause);
93
+ break;
94
+ }
95
+ }, [isLoadFinish]);
96
+ const blur = (0, react_1.useMemo)(() => {
97
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
98
+ }, [videoPostConfig]);
99
+ const handleTimeUpload = () => {
100
+ if (!videoRef.current)
101
+ return;
102
+ setTimeout(() => {
103
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
104
+ if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
105
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
106
+ if (!loopPlayRef.current)
107
+ return;
108
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
109
+ (_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
110
+ }
111
+ else {
112
+ const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
113
+ (_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
114
+ }
115
+ }
116
+ });
117
+ };
118
+ const handlePause = () => {
119
+ setIsPauseVideo(true);
120
+ onPause === null || onPause === void 0 ? void 0 : onPause();
121
+ };
122
+ const handlePlay = () => {
123
+ var _a;
124
+ const localTime = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) - (rec === null || rec === void 0 ? void 0 : rec.startTime);
125
+ onPlay === null || onPlay === void 0 ? void 0 : onPlay(index, localTime);
126
+ };
127
+ (0, react_1.useEffect)(() => {
128
+ var _a, _b, _c, _d;
129
+ if (!isActive)
130
+ return;
131
+ const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
132
+ if (!videoSrc)
133
+ return;
134
+ setIsPauseVideo(false);
135
+ const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
136
+ if (!videoPlayerWrapperNode)
137
+ return;
138
+ videoRef.current = VideoPlayer_1.mountVideoPlayerAtNode === null || VideoPlayer_1.mountVideoPlayerAtNode === void 0 ? void 0 : (0, VideoPlayer_1.mountVideoPlayerAtNode)(videoPlayerWrapperNode);
139
+ if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
140
+ return;
141
+ const Hls = window === null || window === void 0 ? void 0 : window.Hls;
142
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
143
+ if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
144
+ hls = new Hls();
145
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
146
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
147
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
148
+ var _a;
149
+ videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
150
+ (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
151
+ });
152
+ }
153
+ else {
154
+ videoRef.current.src = videoSrc;
155
+ }
156
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
157
+ (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
158
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('play', handlePlay);
159
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('timeupdate', handleTimeUpload);
160
+ return () => {
161
+ var _a, _b, _c, _d, _e;
162
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
163
+ (_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
164
+ setIsLoadFinish(false);
165
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
166
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
167
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handlePlay);
168
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('timeupdate', handleTimeUpload);
169
+ };
170
+ }, [isActive]);
171
+ const renderPoster = (0, react_1.useMemo)(() => {
172
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
173
+ return null;
174
+ }
175
+ return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
176
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
177
+ const blurStyle = (0, react_1.useMemo)(() => {
178
+ return blur
179
+ ? {
180
+ filter: 'blur(10px)',
181
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
182
+ }
183
+ : {};
184
+ }, [blur]);
185
+ if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
186
+ return null;
187
+ }
188
+ return (react_1.default.createElement("div", { className: 'video-container', key: rec.itemId, style: {
189
+ position: 'relative',
190
+ width: '100%',
191
+ height,
192
+ overflow: 'hidden'
193
+ }, onClick: handleClickVideo() },
194
+ react_1.default.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
195
+ renderPoster,
196
+ isPauseVideo && react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
197
+ });
198
+ exports.default = (0, react_1.memo)(VideoWidget);
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { ISxpPageRenderProps } from '../SxpPageRender';
3
+ import '../SxpPageRender/index.less';
4
+ export interface IScene {
5
+ blueprintStep: number;
6
+ endTime: number;
7
+ itemId: string;
8
+ mediaFileNo: string;
9
+ mediaUrl: string;
10
+ position: number;
11
+ postId: string;
12
+ sceneId: string;
13
+ sceneInfo: string;
14
+ sceneTag: string;
15
+ startTime: number;
16
+ traceInfo: string;
17
+ bindProducts?: any[];
18
+ title?: string;
19
+ }
20
+ export type ScenesType = IScene[];
21
+ export type DiyStoryPreviewType = ISxpPageRenderProps & {
22
+ appDomain?: string;
23
+ scenes?: ScenesType;
24
+ activeIndex?: number;
25
+ onActiveChange?: (v: number) => void;
26
+ loopPlay?: boolean;
27
+ pointerEvents?: any;
28
+ onUpdateTimeLine: (index: number, curTime: number) => void;
29
+ onPlay: (index: number, curTime: number) => void;
30
+ onPause: () => void;
31
+ disabledListener?: boolean;
32
+ };
33
+ export interface IDiyStoryPreviewRef {
34
+ play: () => void;
35
+ pause: () => void;
36
+ slideTo: (n: number) => void;
37
+ isPlaying: () => boolean;
38
+ }
39
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ISxpPageRenderProps & {
40
+ appDomain?: string | undefined;
41
+ scenes?: ScenesType | undefined;
42
+ activeIndex?: number | undefined;
43
+ onActiveChange?: ((v: number) => void) | undefined;
44
+ loopPlay?: boolean | undefined;
45
+ pointerEvents?: any;
46
+ onUpdateTimeLine: (index: number, curTime: number) => void;
47
+ onPlay: (index: number, curTime: number) => void;
48
+ onPause: () => void;
49
+ disabledListener?: boolean | undefined;
50
+ } & React.RefAttributes<IDiyStoryPreviewRef>>>;
51
+ export default _default;