pb-sxp-ui 1.9.8 → 1.10.0

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 (66) hide show
  1. package/dist/index.cjs +520 -162
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +35 -0
  4. package/dist/index.js +520 -162
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +7 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +7 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +520 -162
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +7 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/Pagebuilder/index.js +3 -4
  15. package/es/core/components/SxpPageCore/index.d.ts +1 -1
  16. package/es/core/components/SxpPageCore/index.js +7 -6
  17. package/es/core/components/SxpPageRender/NavBack.d.ts +9 -0
  18. package/es/core/components/SxpPageRender/NavBack.js +16 -0
  19. package/es/core/components/SxpPageRender/PictureGroup/index.js +3 -1
  20. package/es/core/components/SxpPageRender/index.d.ts +2 -0
  21. package/es/core/components/SxpPageRender/index.js +30 -22
  22. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  23. package/es/core/context/EditorContext.d.ts +2 -0
  24. package/es/core/context/EditorContext.js +9 -3
  25. package/es/core/context/EditorDataProvider.d.ts +2 -0
  26. package/es/core/context/EditorDataProvider.js +4 -1
  27. package/es/core/context/SxpDataSourceProvider.d.ts +4 -2
  28. package/es/core/context/SxpDataSourceProvider.js +83 -52
  29. package/es/core/utils/materials.d.ts +1 -1
  30. package/es/materials/sxp/MultiPosts/index.d.ts +26 -0
  31. package/es/materials/sxp/MultiPosts/index.js +98 -0
  32. package/es/materials/sxp/MultiPosts/interactionRender.d.ts +9 -0
  33. package/es/materials/sxp/MultiPosts/interactionRender.js +42 -0
  34. package/es/materials/sxp/MultiPosts/material.d.ts +2 -0
  35. package/es/materials/sxp/MultiPosts/material.js +22 -0
  36. package/es/materials/sxp/MultiPosts/settingRender.d.ts +73 -0
  37. package/es/materials/sxp/MultiPosts/settingRender.js +115 -0
  38. package/es/materials/sxp/index.d.ts +1 -0
  39. package/es/materials/sxp/index.js +1 -0
  40. package/lib/core/Pagebuilder/index.js +3 -4
  41. package/lib/core/components/SxpPageCore/index.d.ts +1 -1
  42. package/lib/core/components/SxpPageCore/index.js +6 -5
  43. package/lib/core/components/SxpPageRender/NavBack.d.ts +9 -0
  44. package/lib/core/components/SxpPageRender/NavBack.js +19 -0
  45. package/lib/core/components/SxpPageRender/PictureGroup/index.js +3 -1
  46. package/lib/core/components/SxpPageRender/index.d.ts +2 -0
  47. package/lib/core/components/SxpPageRender/index.js +30 -22
  48. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  49. package/lib/core/context/EditorContext.d.ts +2 -0
  50. package/lib/core/context/EditorContext.js +9 -3
  51. package/lib/core/context/EditorDataProvider.d.ts +2 -0
  52. package/lib/core/context/EditorDataProvider.js +4 -1
  53. package/lib/core/context/SxpDataSourceProvider.d.ts +4 -2
  54. package/lib/core/context/SxpDataSourceProvider.js +83 -52
  55. package/lib/core/utils/materials.d.ts +1 -1
  56. package/lib/materials/sxp/MultiPosts/index.d.ts +26 -0
  57. package/lib/materials/sxp/MultiPosts/index.js +100 -0
  58. package/lib/materials/sxp/MultiPosts/interactionRender.d.ts +9 -0
  59. package/lib/materials/sxp/MultiPosts/interactionRender.js +44 -0
  60. package/lib/materials/sxp/MultiPosts/material.d.ts +2 -0
  61. package/lib/materials/sxp/MultiPosts/material.js +26 -0
  62. package/lib/materials/sxp/MultiPosts/settingRender.d.ts +73 -0
  63. package/lib/materials/sxp/MultiPosts/settingRender.js +117 -0
  64. package/lib/materials/sxp/index.d.ts +1 -0
  65. package/lib/materials/sxp/index.js +1 -0
  66. package/package.json +1 -1
@@ -0,0 +1,115 @@
1
+ export default [
2
+ {
3
+ title: '背景设置',
4
+ child: [
5
+ {
6
+ label: '背景图',
7
+ type: 'Upload',
8
+ name: ['props', 'bgImgUrl']
9
+ },
10
+ {
11
+ type: 'Group',
12
+ label: '返回按钮',
13
+ child: [
14
+ {
15
+ type: 'Switch',
16
+ name: ['props', 'backButton', 'enable']
17
+ },
18
+ {
19
+ type: 'Upload',
20
+ name: ['props', 'backButton', 'icon'],
21
+ text: '建议尺寸:100 * 76'
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ type: 'Group',
27
+ label: '',
28
+ child: [
29
+ {
30
+ type: 'Select',
31
+ name: ['props', 'backButton', 'xPosit'],
32
+ options: [
33
+ {
34
+ label: '相对左侧',
35
+ value: 'left'
36
+ },
37
+ {
38
+ label: '相对右侧',
39
+ value: 'right'
40
+ }
41
+ ],
42
+ initialValue: 'left'
43
+ },
44
+ {
45
+ type: 'Number',
46
+ name: ['props', 'backButton', 'x'],
47
+ addonAfter: 'X'
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ type: 'Group',
53
+ label: '',
54
+ child: [
55
+ {
56
+ type: 'Select',
57
+ name: ['props', 'backButton', 'yPosit'],
58
+ options: [
59
+ {
60
+ label: '相对底部',
61
+ value: 'bottom'
62
+ },
63
+ {
64
+ label: '相对顶部',
65
+ value: 'top'
66
+ }
67
+ ],
68
+ initialValue: 'top'
69
+ },
70
+ {
71
+ type: 'Number',
72
+ name: ['props', 'backButton', 'y'],
73
+ addonAfter: 'Y',
74
+ initialValue: 0
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ title: '按钮设置',
82
+ child: [
83
+ {
84
+ type: 'Group',
85
+ child: [
86
+ {
87
+ type: 'Upload',
88
+ name: ['props', 'button1Url'],
89
+ text: '按钮1'
90
+ },
91
+ {
92
+ type: 'Upload',
93
+ name: ['props', 'button2Url'],
94
+ text: '按钮2'
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ type: 'Group',
100
+ child: [
101
+ {
102
+ type: 'Upload',
103
+ name: ['props', 'button3Url'],
104
+ text: '按钮3'
105
+ },
106
+ {
107
+ type: 'Upload',
108
+ name: ['props', 'button4Url'],
109
+ text: '按钮4'
110
+ }
111
+ ]
112
+ }
113
+ ]
114
+ }
115
+ ];
@@ -4,3 +4,4 @@ export * from './HashTag/material';
4
4
  export * from './Consent/material';
5
5
  export * from './cta';
6
6
  export * from './consentPopup';
7
+ export * from './MultiPosts/material';
@@ -4,3 +4,4 @@ export * from './HashTag/material';
4
4
  export * from './Consent/material';
5
5
  export * from './cta';
6
6
  export * from './consentPopup';
7
+ export * from './MultiPosts/material';
@@ -51,7 +51,7 @@ const Pagebuilder = {
51
51
  const tenantId = builder.getTenantId();
52
52
  const appId = builder.getAppId();
53
53
  const apiUrl = builder.getApiUrl();
54
- return fetch(`${apiUrl}/storefront/v1/page?id=` + id, {
54
+ return fetch(`${apiUrl}/storefront/v1/page/build?id=` + id, {
55
55
  method: 'get',
56
56
  headers: {
57
57
  'x-tenant-id': tenantId || '',
@@ -63,9 +63,8 @@ const Pagebuilder = {
63
63
  if (!result.success) {
64
64
  return undefined;
65
65
  }
66
- const decodeData = (0, unzip_1.unzip)((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.data);
67
- result.data.data = decodeData;
68
- return result.data;
66
+ const dataList = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.map((item) => (Object.assign(Object.assign({}, item), { data: (0, unzip_1.unzip)(item === null || item === void 0 ? void 0 : item.data) })));
67
+ return dataList;
69
68
  }));
70
69
  }),
71
70
  getSxpRecommendVideoData: (dataId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
@@ -7,8 +7,8 @@ export interface ISxpPageCoreProps {
7
7
  hashTagSize?: number;
8
8
  loadingImage?: string;
9
9
  appDomain?: string;
10
- licenseUrl?: String;
11
10
  enabledMetaConversionApi?: boolean;
11
+ dataList?: PageData[];
12
12
  }
13
13
  declare const _default: React.NamedExoticComponent<ISxpPageCoreProps>;
14
14
  export default _default;
@@ -11,18 +11,19 @@ const RESOLVER = {};
11
11
  Object.values(_materials_).forEach((v) => {
12
12
  RESOLVER[v.extend.type] = v;
13
13
  });
14
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
15
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
14
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
15
+ var _a, _b, _c, _d, _e, _f;
16
16
  const utmVal = (0, react_1.useMemo)(() => {
17
17
  var _a;
18
18
  const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
19
19
  return searchParams;
20
20
  }, []);
21
- return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
22
- react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, globalConfig: (_l = (_k = data === null || data === void 0 ? void 0 : data.data) === null || _k === void 0 ? void 0 : _k.sxpPageConf) === null || _l === void 0 ? void 0 : _l.globalConfig, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, render: ({ rtcList, tagList }) => {
21
+ const [_schema, setSchema] = (0, react_1.useState)(data === null || data === void 0 ? void 0 : data.data);
22
+ return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: utmVal },
23
+ react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), render: ({ rtcList, tagList, pageData }) => {
23
24
  var _a;
24
25
  return (react_1.default.createElement(react_1.default.Fragment, null,
25
- react_1.default.createElement(SxpPageRender_1.default, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
26
+ react_1.default.createElement(SxpPageRender_1.default, Object.assign({}, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
26
27
  react_1.default.createElement(Popup_1.default, null)));
27
28
  } })));
28
29
  };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface INavbarProps {
3
+ data: any;
4
+ minusHeight: number;
5
+ tagHeight: number;
6
+ onClick: () => void;
7
+ }
8
+ declare const _default: React.NamedExoticComponent<INavbarProps>;
9
+ export default _default;
@@ -0,0 +1,19 @@
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 left_png_1 = tslib_1.__importDefault(require("./left.png"));
6
+ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
7
+ var _a, _b, _c, _d, _e;
8
+ return (react_1.default.createElement("button", { style: {
9
+ position: 'absolute',
10
+ [(_a = data === null || data === void 0 ? void 0 : data.xPosit) !== null && _a !== void 0 ? _a : 'left']: (_c = (_b = data === null || data === void 0 ? void 0 : data.backButton) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0,
11
+ [(_d = data === null || data === void 0 ? void 0 : data.yPosit) !== null && _d !== void 0 ? _d : 'top']: ((data === null || data === void 0 ? void 0 : data.yPosit) == 'top' ? minusHeight + tagHeight : 0) + ((_e = data === null || data === void 0 ? void 0 : data.y) !== null && _e !== void 0 ? _e : 0),
12
+ zIndex: 8,
13
+ border: 'none',
14
+ padding: 0,
15
+ background: 'transparent'
16
+ }, role: 'button', "aria-label": 'back button', onClick: onClick },
17
+ react_1.default.createElement("img", { src: (data === null || data === void 0 ? void 0 : data.icon) || left_png_1.default, alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
18
+ };
19
+ exports.default = (0, react_1.memo)(NavBack);
@@ -41,6 +41,8 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
41
41
  }
42
42
  }), [isLoad]);
43
43
  (0, react_1.useEffect)(() => {
44
+ if (!isActive)
45
+ return;
44
46
  const onShow = () => onViewImageStartEvent(index, imgInfo);
45
47
  const onHide = () => onViewImageEndEvent(rec);
46
48
  event_1.default.on(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
@@ -49,7 +51,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
49
51
  event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
50
52
  event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
51
53
  };
52
- }, [imgInfo]);
54
+ }, [isActive, imgInfo]);
53
55
  const handleMouseEnter = (0, react_1.useCallback)(() => {
54
56
  if (swiperRef.current && swiperRef.current.swiper && isAlly) {
55
57
  swiperRef.current.swiper.autoplay.stop();
@@ -68,6 +68,8 @@ export interface ISxpPageRenderProps {
68
68
  };
69
69
  converApi?: any;
70
70
  consentPopup?: any;
71
+ multiPosts?: any;
72
+ playbook?: 'paid media' | 'organic menu';
71
73
  };
72
74
  descStyle?: CSSProperties;
73
75
  tipText?: {
@@ -26,11 +26,15 @@ const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
26
26
  const localStore_1 = require("../../../core/utils/localStore");
27
27
  const lodash_1 = require("lodash");
28
28
  const ConsentPopup_1 = tslib_1.__importDefault(require("./ConsentPopup"));
29
+ const MultiPosts_1 = tslib_1.__importDefault(require("../../../materials/sxp/MultiPosts"));
30
+ const EditorDataProvider_1 = require("../../../core/context/EditorDataProvider");
31
+ const NavBack_1 = tslib_1.__importDefault(require("./NavBack"));
29
32
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
30
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
33
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
31
34
  const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
32
35
  const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
33
- const { schema } = (0, hooks_1.useEditor)();
36
+ const { schema, channel } = (0, hooks_1.useEditor)();
37
+ const { openMultiPosts } = (0, EditorDataProvider_1.useEditorDataProvider)();
34
38
  const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
35
39
  const viewImageStartTime = (0, react_1.useRef)(0);
36
40
  const [isMuted, setIsMuted] = (0, react_1.useState)(true);
@@ -212,15 +216,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
212
216
  return null;
213
217
  }, [globalConfig, activeIndex, visList]);
214
218
  const renderContent = (0, react_1.useCallback)((rec, index) => {
215
- var _a, _b, _c, _d;
216
- if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
219
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
220
+ if (rec === 'organic menu') {
221
+ return (react_1.default.createElement(MultiPosts_1.default, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
222
+ }
223
+ if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
217
224
  return (react_1.default.createElement(VideoWidget_1.default, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
218
225
  }
219
- if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
226
+ if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
220
227
  return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
221
228
  }
222
- if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
223
- return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
229
+ if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
230
+ return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
224
231
  var _a, _b, _c, _d, _e, _f, _g, _h;
225
232
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
226
233
  const Component = (0, withBindDataSource_1.default)(t);
@@ -376,7 +383,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
376
383
  const item = data[swiper.previousIndex];
377
384
  if (!item)
378
385
  return;
379
- let fromKName = '';
380
386
  let contentFormat = null;
381
387
  if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
382
388
  contentFormat = 'video';
@@ -525,18 +531,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
525
531
  react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
526
532
  top: minusHeight
527
533
  } }),
528
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (react_1.default.createElement("button", { style: {
529
- position: 'absolute',
530
- [(_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _g === void 0 ? void 0 : _g.xPosit) !== null && _h !== void 0 ? _h : 'left']: (_k = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _j === void 0 ? void 0 : _j.x) !== null && _k !== void 0 ? _k : 0,
531
- [(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (((_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.yPosit) == 'top' ? minusHeight + tagHeight : 0) +
532
- ((_q = (_p = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _p === void 0 ? void 0 : _p.y) !== null && _q !== void 0 ? _q : 0),
533
- zIndex: 8,
534
- border: 'none',
535
- padding: 0,
536
- background: 'transparent'
537
- }, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
538
- react_1.default.createElement("img", { src: ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _r === void 0 ? void 0 : _r.icon) || left_png_1.default, alt: 'back button', width: 100, style: { objectFit: 'cover' } }))),
539
- isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _s !== void 0 ? _s : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
534
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && (react_1.default.createElement(NavBack_1.default, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
535
+ ((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel && (react_1.default.createElement(NavBack_1.default, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
536
+ var _a, _b, _c;
537
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
538
+ eventInfo: {
539
+ eventSubject: 'backMultiPostClick',
540
+ eventDescription: 'backMultiPostClick',
541
+ traceinfo: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : ''
542
+ }
543
+ });
544
+ location === null || location === void 0 ? void 0 : location.reload();
545
+ } })),
546
+ isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
540
547
  react_1.default.createElement(react_2.Swiper, { style: {
541
548
  marginTop: tagHeight
542
549
  }, ref: swiperRef, onSlideChange: () => {
@@ -567,7 +574,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
567
574
  renderView,
568
575
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
569
576
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
570
- react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_v = (_u = (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.item) === null || _v === void 0 ? void 0 : _v.props)),
571
- react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig })));
577
+ react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
578
+ react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
579
+ openMultiPosts && (react_1.default.createElement(MultiPosts_1.default, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))));
572
580
  };
573
581
  exports.default = SxpPageRender;
@@ -69,4 +69,5 @@ export type VideoInfoType = {
69
69
  export type RecommendVideoResultType = {
70
70
  recList: Array<RecItemType>;
71
71
  tag: TagType;
72
+ layoutVariantId?: string;
72
73
  };
@@ -62,6 +62,8 @@ export interface IEditorContext {
62
62
  getCurPageConf?: any;
63
63
  popup: IPopupType;
64
64
  setPopup: React.Dispatch<React.SetStateAction<IPopupType>>;
65
+ channel?: string | undefined;
66
+ setChannel?: React.Dispatch<React.SetStateAction<string | undefined>>;
65
67
  }
66
68
  export interface IEditorCoreProps {
67
69
  resolver: Record<string, MaterialComponet>;
@@ -59,6 +59,7 @@ exports.EditorContext = react_1.default.createContext({
59
59
  });
60
60
  const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
61
61
  const [currentNode, setCurrentNode] = (0, react_1.useState)(null);
62
+ const [channel, setChannel] = (0, react_1.useState)();
62
63
  const [_schema, setSchema] = (0, react_1.useState)(schema || {
63
64
  pointData: [item],
64
65
  dataSource: [],
@@ -74,6 +75,9 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
74
75
  const [undoStack, setUndoStack] = (0, react_1.useState)([[item]]);
75
76
  const [redoStack, setRedoStack] = (0, react_1.useState)([]);
76
77
  const [popup, setPopup] = (0, react_1.useState)(popupInit);
78
+ const channelParams = (0, react_1.useMemo)(() => {
79
+ return channel || utmVal;
80
+ }, [channel, utmVal]);
77
81
  typeof window !== 'undefined' &&
78
82
  (window.sxpPopup = (type, aniType) => {
79
83
  setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
@@ -82,10 +86,10 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
82
86
  (window.getJointUtmLink = (url) => {
83
87
  (0, localStore_1.setSlideSkipState)();
84
88
  if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
85
- return url + (utmVal ? '&' + utmVal : '');
89
+ return url + (channelParams ? '&' + channelParams : '');
86
90
  }
87
91
  else {
88
- return url + (utmVal ? '?' + utmVal : '');
92
+ return url + (channelParams ? '?' + channelParams : '');
89
93
  }
90
94
  });
91
95
  (0, react_1.useEffect)(() => {
@@ -146,7 +150,9 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
146
150
  setUndoStack,
147
151
  getCurPageConf,
148
152
  popup,
149
- setPopup
153
+ setPopup,
154
+ channel,
155
+ setChannel
150
156
  } },
151
157
  react_1.default.createElement(DataSourceProvider_1.default, { isSsr: isSsr, enable: enableDataSource }, children)));
152
158
  });
@@ -26,6 +26,8 @@ interface IEditorDataContext {
26
26
  };
27
27
  consentPopupCate?: string;
28
28
  setConsentPopupCate?: React.Dispatch<React.SetStateAction<string>>;
29
+ openMultiPosts?: boolean;
30
+ setOpenMultiPosts?: React.Dispatch<React.SetStateAction<boolean>>;
29
31
  }
30
32
  interface IEditorProviderProps {
31
33
  data?: any;
@@ -9,6 +9,7 @@ const EditorDataProvider = ({ children, data }) => {
9
9
  const [openHashtag, setOpenHashtag] = (0, react_1.useState)(false);
10
10
  const [openConsent, setOpenConsent] = (0, react_1.useState)(false);
11
11
  const [consentPopupCate, setConsentPopupCate] = (0, react_1.useState)('');
12
+ const [openMultiPosts, setOpenMultiPosts] = (0, react_1.useState)(false);
12
13
  return (react_1.default.createElement(EditorDataContext.Provider, { value: {
13
14
  sxpPrameter: {
14
15
  bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
@@ -33,7 +34,9 @@ const EditorDataProvider = ({ children, data }) => {
33
34
  sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks,
34
35
  utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter,
35
36
  consentPopupCate,
36
- setConsentPopupCate
37
+ setConsentPopupCate,
38
+ openMultiPosts,
39
+ setOpenMultiPosts
37
40
  } }, children));
38
41
  };
39
42
  function useEditorDataProvider() {
@@ -36,7 +36,6 @@ export interface ISxpDataSourceContext {
36
36
  contentFilter?: Array<string>;
37
37
  productFilter?: Array<string>;
38
38
  }) => Promise<RecommendVideoResultType | undefined>;
39
- utmVal?: string;
40
39
  bffEventReport?: (body: {
41
40
  userInfo?: object;
42
41
  eventInfo: object;
@@ -100,6 +99,7 @@ export interface SxpDataSourceProviderProps {
100
99
  mutateLike: (body: {
101
100
  content: string;
102
101
  }) => Promise<boolean>;
102
+ pageData?: PageData;
103
103
  }) => ReactNode;
104
104
  utmVal?: string;
105
105
  enableReportEvent?: boolean;
@@ -112,7 +112,6 @@ export interface SxpDataSourceProviderProps {
112
112
  loadingImage?: string;
113
113
  isOpenHashTag?: boolean;
114
114
  enabledMetaConversionApi?: boolean;
115
- isShowTag?: boolean;
116
115
  consentWidth?: number;
117
116
  consentHeight?: number;
118
117
  isOpenConsent?: boolean;
@@ -120,6 +119,9 @@ export interface SxpDataSourceProviderProps {
120
119
  isEditor?: boolean;
121
120
  utmParameter?: PageData['utm_parameter'];
122
121
  channelQueryList?: any[];
122
+ data?: PageData;
123
+ dataList?: PageData[];
124
+ onUpdateSchema?: (d: PageData['data']) => void;
123
125
  }
124
126
  export declare const DEFAULT_TAG = "FOR U";
125
127
  declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;