pb-sxp-ui 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2264 -864
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +356 -175
- package/dist/index.js +2264 -864
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +2264 -864
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/Pagebuilder/type.d.ts +1 -0
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
- package/es/core/components/SxpPageRender/Hashtag/index.js +1 -3
- package/es/core/components/SxpPageRender/Modal/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/Modal/index.js +70 -6
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/Popup/index.js +1 -1
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +16 -12
- package/es/core/components/SxpPageRender/VideoWidget/index.js +10 -13
- package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +3 -3
- package/es/core/components/SxpPageRender/index.js +51 -17
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +6 -4
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/HashTag/material.js +1 -2
- package/es/materials/sxp/cta/AniLink/index.d.ts +14 -0
- package/es/materials/sxp/cta/AniLink/index.js +59 -0
- package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
- package/es/materials/sxp/cta/AniLink/interactionRender.js +50 -0
- package/es/materials/sxp/cta/AniLink/material.d.ts +2 -0
- package/es/materials/sxp/cta/AniLink/material.js +38 -0
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +103 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +66 -0
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +50 -0
- package/es/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
- package/es/materials/sxp/cta/AniLinkPopup/material.js +52 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +249 -0
- package/es/materials/sxp/cta/index.d.ts +2 -0
- package/es/materials/sxp/cta/index.js +2 -0
- package/es/materials/sxp/index.d.ts +1 -0
- package/es/materials/sxp/index.js +1 -0
- package/es/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +43 -26
- package/es/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
- package/es/materials/sxp/popup/CommodityDetail/interactionRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetail/material.js +3 -1
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
- package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
- package/es/materials/sxp/popup/CommodityList/index.d.ts +28 -0
- package/es/materials/sxp/popup/CommodityList/index.js +56 -0
- package/es/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
- package/es/materials/sxp/popup/CommodityList/interactionRender.js +11 -0
- package/es/materials/sxp/popup/CommodityList/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityList/material.js +51 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +207 -0
- package/es/materials/sxp/popup/index.d.ts +1 -0
- package/es/materials/sxp/popup/index.js +1 -0
- package/es/materials/sxp/template/Link/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
- package/es/materials/sxp/template/components/CommodityGroup.js +31 -0
- package/es/materials/sxp/template/components/Img.js +1 -1
- package/es/materials/sxp/template/components/Scroll.d.ts +2 -1
- package/es/materials/sxp/template/components/Scroll.js +10 -3
- package/es/materials/sxp/template/components/settingRender.js +0 -5
- package/lib/core/Pagebuilder/type.d.ts +1 -0
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
- package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -3
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +70 -6
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +16 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +10 -13
- package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +3 -3
- package/lib/core/components/SxpPageRender/index.js +50 -16
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +6 -4
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/HashTag/material.js +1 -2
- package/lib/materials/sxp/cta/AniLink/index.d.ts +14 -0
- package/lib/materials/sxp/cta/AniLink/index.js +61 -0
- package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
- package/lib/materials/sxp/cta/AniLink/interactionRender.js +52 -0
- package/lib/materials/sxp/cta/AniLink/material.d.ts +2 -0
- package/lib/materials/sxp/cta/AniLink/material.js +42 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +105 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +68 -0
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +52 -0
- package/lib/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +56 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +251 -0
- package/lib/materials/sxp/cta/index.d.ts +2 -0
- package/lib/materials/sxp/cta/index.js +5 -0
- package/lib/materials/sxp/index.d.ts +1 -0
- package/lib/materials/sxp/index.js +1 -0
- package/lib/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -26
- package/lib/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
- package/lib/materials/sxp/popup/CommodityDetail/interactionRender.js +14 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +14 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +28 -0
- package/lib/materials/sxp/popup/CommodityList/index.js +58 -0
- package/lib/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/popup/CommodityList/interactionRender.js +13 -0
- package/lib/materials/sxp/popup/CommodityList/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityList/material.js +55 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +209 -0
- package/lib/materials/sxp/popup/index.d.ts +1 -0
- package/lib/materials/sxp/popup/index.js +1 -0
- package/lib/materials/sxp/template/Link/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
- package/lib/materials/sxp/template/components/CommodityGroup.js +34 -0
- package/lib/materials/sxp/template/components/Img.js +1 -1
- package/lib/materials/sxp/template/components/Scroll.d.ts +2 -1
- package/lib/materials/sxp/template/components/Scroll.js +9 -2
- package/lib/materials/sxp/template/components/settingRender.js +0 -5
- package/package.json +1 -1
@@ -5,10 +5,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
require("./index.less");
|
6
6
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
7
7
|
const hooks_1 = require("../../../core/hooks");
|
8
|
-
const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
8
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType }) => {
|
9
9
|
const { schema } = (0, hooks_1.useEditor)();
|
10
10
|
const renderComp = (0, react_1.useMemo)(() => {
|
11
|
-
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, _1, _2, _3, _4, _5, _6;
|
11
|
+
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, _1, _2, _3, _4, _5, _6, _7, _8;
|
12
12
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
13
13
|
return null;
|
14
14
|
let cta = null;
|
@@ -22,20 +22,24 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
|
22
22
|
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
23
23
|
}
|
24
24
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
25
|
-
if (
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
(((
|
25
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
26
|
+
return;
|
27
|
+
if (!includesCtaType && ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.category) === 'cta')
|
28
|
+
return;
|
29
|
+
if ((((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'CommodityDiro' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
|
30
|
+
(((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'Commodity' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
|
31
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'CommodityDiroNew' && !((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProduct)) ||
|
32
|
+
(((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.type) === 'MultiCommodity' && !((_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length)) ||
|
33
|
+
(((_s = value === null || value === void 0 ? void 0 : value.item) === null || _s === void 0 ? void 0 : _s.type) === 'MultiCommodityDiro' && !((_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u.length)) ||
|
34
|
+
(((_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.type) === 'MultiCommodityDiroNew' && !((_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindProducts) === null || _x === void 0 ? void 0 : _x.length))) {
|
31
35
|
return null;
|
32
36
|
}
|
33
37
|
if (value && resolver) {
|
34
|
-
const t = resolver[(
|
38
|
+
const t = resolver[(_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.type];
|
35
39
|
const Component = (0, withBindDataSource_1.default)(t);
|
36
|
-
const defaulSetting = (
|
37
|
-
const isExternalLink = ((
|
38
|
-
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (
|
40
|
+
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
41
|
+
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
42
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index })));
|
39
43
|
}
|
40
44
|
else {
|
41
45
|
return null;
|
@@ -224,23 +224,20 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
224
224
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
225
225
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
226
226
|
return () => {
|
227
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
228
|
-
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
229
|
-
if (!isPause)
|
230
|
-
handlePause();
|
227
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
231
228
|
if (hls)
|
232
229
|
hls === null || hls === void 0 ? void 0 : hls.destroy();
|
233
230
|
setIsLoadFinish(false);
|
234
|
-
(
|
235
|
-
(
|
236
|
-
(
|
237
|
-
(
|
238
|
-
(
|
239
|
-
(
|
240
|
-
(
|
241
|
-
(
|
231
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
232
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadeddata', handLoadeddata);
|
233
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('play', handleStartPlay);
|
234
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('playing', handlePlaying);
|
235
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('pause', handlePause);
|
236
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('ended', handlePlay);
|
237
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('canplay', handlePlay);
|
238
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('waiting', handleWaiting);
|
242
239
|
};
|
243
|
-
}, [isActive, videoId, rec
|
240
|
+
}, [isActive, videoId, rec]);
|
244
241
|
(0, react_1.useEffect)(() => {
|
245
242
|
var _a, _b;
|
246
243
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -171,7 +171,7 @@ function WaterfallList(_a) {
|
|
171
171
|
var _a, _b;
|
172
172
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
173
173
|
reportTagsView();
|
174
|
-
window.location.href =
|
174
|
+
window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
|
175
175
|
}
|
176
176
|
};
|
177
177
|
return (react_1.default.createElement(react_1.default.Fragment, null, isLoadingData ? (react_1.default.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -279,7 +279,7 @@ function WaterfallList(_a) {
|
|
279
279
|
var _a, _b;
|
280
280
|
if ((_a = data === null || data === void 0 ? void 0 : data.tag) === null || _a === void 0 ? void 0 : _a.link) {
|
281
281
|
reportTagsView();
|
282
|
-
window.location.href =
|
282
|
+
window.location.href = (_b = data === null || data === void 0 ? void 0 : data.tag) === null || _b === void 0 ? void 0 : _b.link;
|
283
283
|
}
|
284
284
|
};
|
285
285
|
return (react_1.default.createElement(react_1.default.Fragment, null, isLoadingData ? (react_1.default.createElement("div", { style: { height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
@@ -37,9 +37,9 @@ export interface ISxpPageRenderProps {
|
|
37
37
|
swipeTipOffset?: number;
|
38
38
|
consent?: any[];
|
39
39
|
videoPlayIcon?: string;
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
popupCloseIcon?: string;
|
41
|
+
openSlideSkip?: boolean;
|
42
|
+
slideSkipStartTime?: number;
|
43
43
|
};
|
44
44
|
descStyle?: CSSProperties;
|
45
45
|
tipText?: {
|
@@ -33,7 +33,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
33
33
|
const viewTime = (0, react_1.useRef)();
|
34
34
|
const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
|
35
35
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
36
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
|
36
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview } = (0, hooks_1.useSxpDataSource)();
|
37
37
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
38
38
|
const { productView } = (0, useEventReport_1.useEventReport)();
|
39
39
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
@@ -81,7 +81,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
81
81
|
(0, react_1.useEffect)(() => {
|
82
82
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
83
83
|
const visibleChange = () => {
|
84
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
85
85
|
const repCond = !openHashtag && !isShowConsent;
|
86
86
|
if (document.visibilityState === 'hidden') {
|
87
87
|
if (repCond) {
|
@@ -118,7 +118,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
118
118
|
position: activeIndex + '',
|
119
119
|
fromKName,
|
120
120
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
121
|
-
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : ''
|
121
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
|
122
|
+
traceInfo: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : ''
|
122
123
|
}
|
123
124
|
});
|
124
125
|
}
|
@@ -222,17 +223,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
222
223
|
};
|
223
224
|
}, [isShowMore]);
|
224
225
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
225
|
-
var _a, _b, _c, _d, _e, _f, _g
|
226
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
226
227
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
227
228
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
228
229
|
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
229
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom'
|
230
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
|
230
231
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
231
232
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
232
233
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
233
234
|
react_1.default.createElement("div", null,
|
234
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
235
|
-
react_1.default.createElement(
|
235
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
236
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
237
|
+
react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))),
|
238
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'] })));
|
236
239
|
}
|
237
240
|
return null;
|
238
241
|
}, [
|
@@ -285,8 +288,36 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
285
288
|
});
|
286
289
|
}
|
287
290
|
};
|
291
|
+
const handleSlideSkip = (item, position) => {
|
292
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
293
|
+
if (isPreview)
|
294
|
+
return;
|
295
|
+
const t = new Date() - curTime.current;
|
296
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.openSlideSkip) && t >= ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.slideSkipStartTime) !== null && _a !== void 0 ? _a : 0) && (0, localStore_1.getSlideSkipState)() && item) {
|
297
|
+
const link = ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.link) || ((_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindProducts) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
|
298
|
+
const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
|
299
|
+
if (link) {
|
300
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
301
|
+
eventInfo: {
|
302
|
+
eventSubject: 'swipeToWeb',
|
303
|
+
eventDescription: 'User swiped to web',
|
304
|
+
productId: (_l = product === null || product === void 0 ? void 0 : product.itemId) !== null && _l !== void 0 ? _l : '',
|
305
|
+
productName: (_m = product === null || product === void 0 ? void 0 : product.title) !== null && _m !== void 0 ? _m : '',
|
306
|
+
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
307
|
+
productCollection: (_o = product === null || product === void 0 ? void 0 : product.collection) !== null && _o !== void 0 ? _o : '',
|
308
|
+
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
309
|
+
position: position + '',
|
310
|
+
contentId: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
311
|
+
traceInfo: (_r = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _r !== void 0 ? _r : ''
|
312
|
+
}
|
313
|
+
});
|
314
|
+
(0, localStore_1.setSlideSkipState)();
|
315
|
+
window.location.href = window.getJointUtmLink(link);
|
316
|
+
}
|
317
|
+
}
|
318
|
+
};
|
288
319
|
const handleScrollEvent = (swiper) => {
|
289
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
320
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
290
321
|
viewTime.current = new Date();
|
291
322
|
const item = data[swiper.previousIndex];
|
292
323
|
if (!item)
|
@@ -298,26 +329,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
298
329
|
eventDescription: 'User scroll down',
|
299
330
|
contentId: (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
300
331
|
productId: (_d = (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
301
|
-
requestId: null
|
332
|
+
requestId: null,
|
333
|
+
traceInfo: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.traceInfo) !== null && _f !== void 0 ? _f : ''
|
302
334
|
}
|
303
335
|
});
|
304
336
|
handleReportViewImageEnd(item);
|
337
|
+
handleSlideSkip(item, swiper.previousIndex);
|
305
338
|
}
|
306
339
|
else {
|
307
340
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
308
341
|
eventInfo: {
|
309
342
|
eventSubject: 'scrollUp',
|
310
343
|
eventDescription: 'User scroll up',
|
311
|
-
contentId: (
|
312
|
-
productId: (
|
313
|
-
requestId: null
|
344
|
+
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
345
|
+
productId: (_k = (_j = item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
346
|
+
requestId: null,
|
347
|
+
traceInfo: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : ''
|
314
348
|
}
|
315
349
|
});
|
316
350
|
handleReportViewImageEnd(item);
|
317
351
|
}
|
318
352
|
handleReportProductView(item);
|
319
353
|
const curItem = data[swiper.activeIndex];
|
320
|
-
if (!((
|
354
|
+
if (!((_o = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _o === void 0 ? void 0 : _o.url) && !((_p = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _p === void 0 ? void 0 : _p.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
321
355
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
322
356
|
eventName: 'ProductView'
|
323
357
|
});
|
@@ -401,7 +435,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
401
435
|
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
402
436
|
top: minusHeight
|
403
437
|
} }),
|
404
|
-
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50
|
438
|
+
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } })) : null,
|
405
439
|
react_1.default.createElement(react_2.Swiper, { style: {
|
406
440
|
marginTop: tagHeight
|
407
441
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -425,13 +459,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
425
459
|
}
|
426
460
|
}
|
427
461
|
}, direction: 'vertical', height: height },
|
428
|
-
|
462
|
+
react_1.default.createElement(ToggleButton_1.default, { style: {
|
429
463
|
position: 'fixed',
|
430
464
|
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
431
465
|
zIndex: 999,
|
432
466
|
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
433
467
|
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
434
|
-
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted })
|
468
|
+
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted }),
|
435
469
|
renderView),
|
436
470
|
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props))));
|
437
471
|
};
|
@@ -80,6 +80,7 @@ export interface ISxpDataSourceContext {
|
|
80
80
|
isShowConsent?: boolean;
|
81
81
|
selectTag?: string;
|
82
82
|
setSelectTag?: React.Dispatch<React.SetStateAction<string>>;
|
83
|
+
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
83
84
|
}
|
84
85
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
85
86
|
export interface SxpDataSourceProviderProps {
|
@@ -17,7 +17,6 @@ var DataSourceType;
|
|
17
17
|
(function (DataSourceType) {
|
18
18
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
19
19
|
})(DataSourceType || (DataSourceType = {}));
|
20
|
-
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
21
20
|
exports.DEFAULT_TAG = 'FOR U';
|
22
21
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
23
22
|
var _a, _b, _c;
|
@@ -93,8 +92,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
93
92
|
};
|
94
93
|
if (utmVal) {
|
95
94
|
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
95
|
+
var _a, _b;
|
96
96
|
const key = val.split('=')[0];
|
97
|
-
return
|
97
|
+
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
98
98
|
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
99
99
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
100
100
|
}
|
@@ -181,8 +181,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
181
181
|
return;
|
182
182
|
try {
|
183
183
|
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
184
|
+
var _a, _b;
|
184
185
|
const key = val.split('=')[0];
|
185
|
-
return
|
186
|
+
return (_b = ((_a = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
186
187
|
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
187
188
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
188
189
|
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
@@ -320,7 +321,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
320
321
|
themeTag,
|
321
322
|
isShowConsent,
|
322
323
|
selectTag,
|
323
|
-
setSelectTag
|
324
|
+
setSelectTag,
|
325
|
+
globalConfig
|
324
326
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
325
327
|
rtcList,
|
326
328
|
mutateLike: bffMutateLike,
|
@@ -1,6 +1,9 @@
|
|
1
1
|
export declare const FAKE_USER_KEY = "SXP_FAKE_USER_ID";
|
2
2
|
export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
|
3
3
|
export declare const AGREE_POLICY = "AGREE_POLICY";
|
4
|
+
export declare const SLIDE_SKIP_STATE = "SLIDE_SKIP_STATE";
|
4
5
|
export declare const storeAndLoadFeUserId: () => string;
|
5
6
|
export declare const removeFeUserId: () => void;
|
6
7
|
export declare const getFeUserId: () => boolean;
|
8
|
+
export declare const getSlideSkipState: () => boolean;
|
9
|
+
export declare const setSlideSkipState: () => void;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getFeUserId = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
|
3
|
+
exports.setSlideSkipState = exports.getSlideSkipState = exports.getFeUserId = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.SLIDE_SKIP_STATE = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
|
4
4
|
const lodash_1 = require("lodash");
|
5
5
|
const tool_1 = require("./tool");
|
6
6
|
exports.FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
7
7
|
exports.FAKE_USER_STATE = 'FAKE_USER_STATE';
|
8
8
|
exports.AGREE_POLICY = 'AGREE_POLICY';
|
9
|
+
exports.SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
|
9
10
|
const storeAndLoadFeUserId = () => {
|
10
11
|
let fakeUserId = window.localStorage.getItem(exports.FAKE_USER_KEY);
|
11
12
|
if ((0, lodash_1.isEmpty)(fakeUserId)) {
|
@@ -27,3 +28,12 @@ const getFeUserId = () => {
|
|
27
28
|
return (0, lodash_1.isEmpty)(fakeUserState);
|
28
29
|
};
|
29
30
|
exports.getFeUserId = getFeUserId;
|
31
|
+
const getSlideSkipState = () => {
|
32
|
+
const slideSkipState = window.localStorage.getItem(exports.SLIDE_SKIP_STATE);
|
33
|
+
return (0, lodash_1.isEmpty)(slideSkipState);
|
34
|
+
};
|
35
|
+
exports.getSlideSkipState = getSlideSkipState;
|
36
|
+
const setSlideSkipState = () => {
|
37
|
+
window.localStorage.setItem(exports.SLIDE_SKIP_STATE, 'true');
|
38
|
+
};
|
39
|
+
exports.setSlideSkipState = setSlideSkipState;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ICtaTempStylesType } from '../../template/components/typing';
|
3
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
4
|
+
export interface IAniLinkProps {
|
5
|
+
style?: Record<string, any>;
|
6
|
+
recData?: RecItemType;
|
7
|
+
ctaTempStyles?: ICtaTempStylesType;
|
8
|
+
index?: number;
|
9
|
+
event?: any;
|
10
|
+
onClick?: () => void;
|
11
|
+
isExternalLink?: boolean;
|
12
|
+
}
|
13
|
+
declare const _default: React.NamedExoticComponent<IAniLinkProps>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const css_1 = require("@emotion/css");
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
const hooks_1 = require("../../../../core/hooks");
|
7
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
8
|
+
const tool_1 = require("../../../../core/utils/tool");
|
9
|
+
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
10
|
+
const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
|
11
|
+
const AniLink = (_a) => {
|
12
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13
|
+
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = tslib_1.__rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
|
14
|
+
const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
15
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
16
|
+
const ref = (0, react_1.useRef)(null);
|
17
|
+
const isOnScreen = (0, useOnScreen_1.default)(ref);
|
18
|
+
const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
|
19
|
+
const product = ((_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.bindProducts) === null || _j === void 0 ? void 0 : _j[0]) || ((_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.bindProduct);
|
20
|
+
const handleTo = () => {
|
21
|
+
var _a, _b, _c;
|
22
|
+
const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
|
23
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
24
|
+
eventSubject: 'clickCta',
|
25
|
+
eventDescription: 'User clicked the CTA'
|
26
|
+
}, recData, item, index);
|
27
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
|
28
|
+
if (isExternalLink) {
|
29
|
+
jumpToWeb(recData, product, cta, index);
|
30
|
+
}
|
31
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
32
|
+
};
|
33
|
+
const title = (cta === null || cta === void 0 ? void 0 : cta.title) || '查看详情 >';
|
34
|
+
const aniStyle = (0, react_1.useMemo)(() => {
|
35
|
+
var _a, _b;
|
36
|
+
const ani = event === null || event === void 0 ? void 0 : event.animation;
|
37
|
+
if (ani) {
|
38
|
+
const { delay, duration, backgroundColor } = ani;
|
39
|
+
return {
|
40
|
+
':after': {
|
41
|
+
animationDelay: `${(_a = delay / 1000) !== null && _a !== void 0 ? _a : 0}s`,
|
42
|
+
animationDuration: `${(_b = duration / 1000) !== null && _b !== void 0 ? _b : 0}s`,
|
43
|
+
backgroundColor: `${backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : 'transparent'}`
|
44
|
+
}
|
45
|
+
};
|
46
|
+
}
|
47
|
+
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
48
|
+
(0, react_1.useEffect)(() => {
|
49
|
+
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
50
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
51
|
+
eventSubject: 'ctaExposure',
|
52
|
+
eventDescription: 'The cta was shown to the user'
|
53
|
+
}, recData, product, index);
|
54
|
+
}
|
55
|
+
}, [isOnScreen]);
|
56
|
+
return (react_1.default.createElement("div", Object.assign({ ref: ref, style: Object.assign(Object.assign({}, style), { display: 'flex', alignItems: 'center' }) }, props, { className: `${index_module_less_1.default['animated-button']} ${(0, css_1.css)(aniStyle)}`, onClick: handleTo }),
|
57
|
+
react_1.default.createElement("div", { className: 'one-line-ellipsis', style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
|
58
|
+
__html: (0, tool_1.setFontForText)(title, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
59
|
+
} })));
|
60
|
+
};
|
61
|
+
exports.default = (0, react_1.memo)(AniLink);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
declare const _default: ({
|
2
|
+
title: string;
|
3
|
+
child: {
|
4
|
+
type: string;
|
5
|
+
name: string;
|
6
|
+
}[];
|
7
|
+
} | {
|
8
|
+
title: string;
|
9
|
+
child: ({
|
10
|
+
type: string;
|
11
|
+
name: string[];
|
12
|
+
label: string;
|
13
|
+
options?: undefined;
|
14
|
+
initialValue?: undefined;
|
15
|
+
fieldProps?: undefined;
|
16
|
+
addonAfter?: undefined;
|
17
|
+
} | {
|
18
|
+
type: string;
|
19
|
+
name: string[];
|
20
|
+
label: string;
|
21
|
+
options: {
|
22
|
+
label: string;
|
23
|
+
value: number;
|
24
|
+
}[];
|
25
|
+
initialValue: number;
|
26
|
+
fieldProps: {
|
27
|
+
style: {
|
28
|
+
width: string;
|
29
|
+
};
|
30
|
+
};
|
31
|
+
addonAfter?: undefined;
|
32
|
+
} | {
|
33
|
+
type: string;
|
34
|
+
label: string;
|
35
|
+
name: string[];
|
36
|
+
addonAfter: string;
|
37
|
+
options?: undefined;
|
38
|
+
initialValue?: undefined;
|
39
|
+
fieldProps?: undefined;
|
40
|
+
})[];
|
41
|
+
})[];
|
42
|
+
export default _default;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = [
|
4
|
+
{
|
5
|
+
title: '点击事件',
|
6
|
+
child: [
|
7
|
+
{
|
8
|
+
type: 'link',
|
9
|
+
name: 'onClick'
|
10
|
+
}
|
11
|
+
]
|
12
|
+
},
|
13
|
+
{
|
14
|
+
title: '动画效果',
|
15
|
+
child: [
|
16
|
+
{
|
17
|
+
type: 'Color',
|
18
|
+
name: ['animation', 'backgroundColor'],
|
19
|
+
label: '动画颜色'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
type: 'Select',
|
23
|
+
name: ['animation', 'name'],
|
24
|
+
label: '动画',
|
25
|
+
options: [
|
26
|
+
{
|
27
|
+
label: '由左向右/中间扩散',
|
28
|
+
value: 1
|
29
|
+
}
|
30
|
+
],
|
31
|
+
initialValue: 1,
|
32
|
+
fieldProps: {
|
33
|
+
style: {
|
34
|
+
width: '100%'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
38
|
+
{
|
39
|
+
type: 'Number',
|
40
|
+
label: '动画启动时间',
|
41
|
+
name: ['animation', 'delay'],
|
42
|
+
addonAfter: 'ms'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
type: 'Number',
|
46
|
+
label: '动画持续时间',
|
47
|
+
name: ['animation', 'duration'],
|
48
|
+
addonAfter: 'ms'
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
52
|
+
];
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AniLink = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const settingRender_1 = tslib_1.__importDefault(require("./settingRender"));
|
6
|
+
const _1 = tslib_1.__importDefault(require("."));
|
7
|
+
const create_1 = require("../../../../core/create");
|
8
|
+
const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
|
9
|
+
const AniLink = (0, create_1.createMaterial)(_1.default, {
|
10
|
+
displayName: '纯色动效CTA',
|
11
|
+
icon: '',
|
12
|
+
category: 'cta',
|
13
|
+
type: 'AniLink',
|
14
|
+
related: {
|
15
|
+
settingRender: settingRender_1.default,
|
16
|
+
bindableProps: [],
|
17
|
+
interactionRender: interactionRender_1.default
|
18
|
+
},
|
19
|
+
defaulSetting: {
|
20
|
+
props: {
|
21
|
+
ctaTempStyles: {
|
22
|
+
ctaTitle: {
|
23
|
+
fontSize: 15,
|
24
|
+
color: '#fff',
|
25
|
+
textAlign: 'left'
|
26
|
+
}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
style: {
|
30
|
+
width: 236,
|
31
|
+
height: 44,
|
32
|
+
borderRadius: 3,
|
33
|
+
backgroundColor: 'rgba(0,0,0,.3)',
|
34
|
+
paddingLeft: 7,
|
35
|
+
paddingRight: 7
|
36
|
+
}
|
37
|
+
},
|
38
|
+
w: 100,
|
39
|
+
h: 40,
|
40
|
+
sort: 1
|
41
|
+
});
|
42
|
+
exports.AniLink = AniLink;
|