pb-sxp-ui 1.0.2 → 1.0.3-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.
- package/dist/index.cjs +3624 -1460
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +143 -245
- package/dist/index.js +3625 -1461
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -5
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -5
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +3624 -1460
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -5
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.d.ts +1 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/es/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +3 -3
- package/es/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/Modal/index.js +7 -4
- package/es/core/components/SxpPageRender/Navbar.d.ts +1 -0
- package/es/core/components/SxpPageRender/Navbar.js +3 -2
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +11 -7
- package/es/core/components/SxpPageRender/Popup/index.js +3 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/es/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +24 -14
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -14
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
- package/es/core/components/SxpPageRender/index.d.ts +22 -1
- package/es/core/components/SxpPageRender/index.js +22 -19
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/es/core/components/SxpPageRender/useIconLink.js +8 -3
- package/es/core/context/EditorContext.d.ts +5 -0
- package/es/core/context/EditorContext.js +21 -3
- package/es/core/context/EditorDataProvider.d.ts +3 -1
- package/es/core/context/EditorDataProvider.js +5 -2
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -0
- package/es/core/context/SxpDataSourceProvider.js +8 -4
- package/es/core/create.d.ts +1 -1
- package/es/materials/sxp/HashTag/index.d.ts +14 -0
- package/es/materials/sxp/HashTag/index.js +6 -0
- package/es/materials/sxp/HashTag/material.d.ts +2 -0
- package/es/materials/sxp/HashTag/material.js +52 -0
- package/es/materials/sxp/HashTag/settingRender.d.ts +122 -0
- package/es/materials/sxp/HashTag/settingRender.js +153 -0
- package/es/materials/sxp/index.d.ts +1 -0
- package/es/materials/sxp/index.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +44 -21
- package/es/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +167 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +171 -0
- package/es/materials/sxp/popup/index.d.ts +0 -1
- package/es/materials/sxp/popup/index.js +0 -1
- package/es/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/es/materials/sxp/template/Appoint/index.js +4 -18
- package/es/materials/sxp/template/Appoint/material.js +22 -6
- package/es/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/es/materials/sxp/template/Commodity/index.js +5 -22
- package/es/materials/sxp/template/Commodity/material.js +31 -6
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/es/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/Link/index.d.ts +2 -0
- package/es/materials/sxp/template/Link/index.js +4 -13
- package/es/materials/sxp/template/Link/material.js +22 -5
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +8 -24
- package/es/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -27
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +8 -25
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/es/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/es/materials/sxp/template/components/EventProvider.js +5 -4
- package/es/materials/sxp/template/components/settingRender.d.ts +123 -0
- package/es/materials/sxp/template/components/settingRender.js +215 -0
- package/es/materials/sxp/template/components/typing.d.ts +6 -0
- package/es/materials/sxp/template/components/typing.js +1 -0
- package/lib/core/components/SxpPageCore/index.d.ts +1 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +1 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +17 -10
- package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -3
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +7 -4
- package/lib/core/components/SxpPageRender/Navbar.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Navbar.js +3 -2
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +16 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +10 -6
- package/lib/core/components/SxpPageRender/Popup/index.js +3 -3
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +30 -21
- package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +23 -14
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +15 -13
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/WaterFall/preview.json +1242 -0
- package/lib/core/components/SxpPageRender/index.d.ts +22 -1
- package/lib/core/components/SxpPageRender/index.js +22 -19
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -1
- package/lib/core/components/SxpPageRender/useIconLink.js +8 -3
- package/lib/core/context/EditorContext.d.ts +5 -0
- package/lib/core/context/EditorContext.js +21 -3
- package/lib/core/context/EditorDataProvider.d.ts +3 -1
- package/lib/core/context/EditorDataProvider.js +4 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -0
- package/lib/core/context/SxpDataSourceProvider.js +8 -4
- package/lib/core/create.d.ts +1 -1
- package/lib/materials/sxp/HashTag/index.d.ts +14 -0
- package/lib/materials/sxp/HashTag/index.js +9 -0
- package/lib/materials/sxp/HashTag/material.d.ts +2 -0
- package/lib/materials/sxp/HashTag/material.js +56 -0
- package/lib/materials/sxp/HashTag/settingRender.d.ts +122 -0
- package/lib/materials/sxp/HashTag/settingRender.js +155 -0
- package/lib/materials/sxp/index.d.ts +1 -0
- package/lib/materials/sxp/index.js +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +20 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -20
- package/lib/materials/sxp/popup/CommodityDetail/material.js +36 -1
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +169 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +20 -17
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +46 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +134 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +173 -0
- package/lib/materials/sxp/popup/index.d.ts +0 -1
- package/lib/materials/sxp/popup/index.js +0 -1
- package/lib/materials/sxp/template/Appoint/index.d.ts +2 -0
- package/lib/materials/sxp/template/Appoint/index.js +4 -18
- package/lib/materials/sxp/template/Appoint/material.js +22 -6
- package/lib/materials/sxp/template/Commodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/Commodity/index.js +5 -22
- package/lib/materials/sxp/template/Commodity/material.js +31 -6
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiro/material.js +30 -5
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +5 -24
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/Link/index.d.ts +2 -0
- package/lib/materials/sxp/template/Link/index.js +4 -13
- package/lib/materials/sxp/template/Link/material.js +22 -5
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +7 -23
- package/lib/materials/sxp/template/MultiCommodity/material.js +30 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +7 -26
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +31 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -24
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +32 -6
- package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -1
- package/lib/materials/sxp/template/components/EventProvider.js +4 -3
- package/lib/materials/sxp/template/components/settingRender.d.ts +123 -0
- package/lib/materials/sxp/template/components/settingRender.js +217 -0
- package/lib/materials/sxp/template/components/typing.d.ts +6 -0
- package/lib/materials/sxp/template/components/typing.js +2 -0
- package/package.json +1 -1
@@ -10,19 +10,39 @@ interface ISxpPageRenderProps {
|
|
10
10
|
likeIcon?: string;
|
11
11
|
unlikeIcon?: string;
|
12
12
|
color?: string;
|
13
|
-
productPost?:
|
13
|
+
productPost?: any[];
|
14
14
|
muteIconX?: number;
|
15
15
|
muteIconY?: number;
|
16
16
|
likeIconX?: number;
|
17
17
|
likeIconY?: number;
|
18
18
|
isShowLike?: boolean;
|
19
19
|
swipeTipIcon?: string;
|
20
|
+
hashTag?: any[];
|
20
21
|
};
|
21
22
|
descStyle?: CSSProperties;
|
22
23
|
tipText?: {
|
23
24
|
foldText: string;
|
24
25
|
unfoldText: string;
|
25
26
|
};
|
27
|
+
nudge?: {
|
28
|
+
isOpen: boolean;
|
29
|
+
icon?: string;
|
30
|
+
backgroundColor: string;
|
31
|
+
content?: string;
|
32
|
+
marginBottom: number;
|
33
|
+
borderRadius: number;
|
34
|
+
size: {
|
35
|
+
height: number;
|
36
|
+
width: number;
|
37
|
+
};
|
38
|
+
textStyle: {
|
39
|
+
color: string;
|
40
|
+
fontFamily: string;
|
41
|
+
fontSize: number;
|
42
|
+
fontStyle: string;
|
43
|
+
textAlign: string;
|
44
|
+
};
|
45
|
+
};
|
26
46
|
containerHeight?: number;
|
27
47
|
containerWidth?: number;
|
28
48
|
tempMap?: Record<string, any>;
|
@@ -30,6 +50,7 @@ interface ISxpPageRenderProps {
|
|
30
50
|
resolver: any;
|
31
51
|
ctaType?: string;
|
32
52
|
_schema?: any;
|
53
|
+
hashTagStyle?: CSSProperties;
|
33
54
|
}
|
34
55
|
declare const SxpPageRender: FC<ISxpPageRenderProps>;
|
35
56
|
export default SxpPageRender;
|
@@ -10,21 +10,21 @@ const VideoWidget_1 = tslib_1.__importDefault(require("./VideoWidget"));
|
|
10
10
|
const ToggleButton_1 = tslib_1.__importDefault(require("./ToggleButton"));
|
11
11
|
const FingerSwipeTip_1 = tslib_1.__importDefault(require("./FingerSwipeTip"));
|
12
12
|
const PictureGroup_1 = tslib_1.__importDefault(require("./PictureGroup"));
|
13
|
-
const ProductInfo_1 = tslib_1.__importDefault(require("./ProductInfo"));
|
14
13
|
const Hashtag_1 = tslib_1.__importDefault(require("./Hashtag"));
|
15
14
|
const Navbar_1 = tslib_1.__importDefault(require("./Navbar"));
|
16
15
|
const left_png_1 = tslib_1.__importDefault(require("./left.png"));
|
17
16
|
const RenderCard_1 = tslib_1.__importDefault(require("./RenderCard"));
|
18
17
|
const useIconLink_1 = require("./useIconLink");
|
19
18
|
const WaterFall_1 = tslib_1.__importDefault(require("./WaterFall"));
|
20
|
-
const
|
19
|
+
const Nudge_1 = tslib_1.__importDefault(require("./Nudge"));
|
21
20
|
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
22
21
|
const hooks_1 = require("../../../core/hooks");
|
23
22
|
const sessionStore_1 = require("../../../core/utils/sessionStore");
|
24
23
|
require("./index.less");
|
25
24
|
const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
26
|
-
const
|
27
|
-
|
25
|
+
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
26
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
28
28
|
const { schema } = (0, hooks_1.useEditor)();
|
29
29
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
|
30
30
|
const viewImageStartTime = (0, react_1.useRef)(0);
|
@@ -152,39 +152,37 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
152
152
|
return null;
|
153
153
|
}, [globalConfig]);
|
154
154
|
const renderContent = (0, react_1.useCallback)((rec, index) => {
|
155
|
-
var _a, _b;
|
155
|
+
var _a, _b, _c, _d;
|
156
156
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
157
157
|
return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex }));
|
158
158
|
}
|
159
159
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
160
160
|
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent }));
|
161
161
|
}
|
162
|
-
if (rec.product) {
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
default:
|
169
|
-
return (react_1.default.createElement(ProductInfo_1.default, { key: rec.product.itemId, viewTime: viewTime.current, data: rec, height: height, tipText: tipText, width: containerWidth }));
|
170
|
-
}
|
162
|
+
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) {
|
163
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
|
164
|
+
var _a, _b, _c, _d, _e, _f;
|
165
|
+
const Component = (0, withBindDataSource_1.default)(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
|
166
|
+
return (react_1.default.createElement(Component, Object.assign({ key: index, textStyle: (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.textStyle, bindDatas: (_d = (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.bindDatas) !== null && _d !== void 0 ? _d : [] }, (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.props, { event: ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: { height: '100%', overflow: 'auto' } })));
|
167
|
+
});
|
171
168
|
}
|
172
169
|
return null;
|
173
|
-
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText]);
|
170
|
+
}, [containerWidth, data, height, isMuted, activeIndex, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost, viewTime, tipText, resolver, schema]);
|
174
171
|
const renderBottom = (0, react_1.useCallback)((rec, index) => {
|
175
172
|
var _a, _b, _c, _d, _e, _f, _g;
|
176
173
|
if (rec.video) {
|
177
174
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
178
175
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
179
176
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
|
177
|
+
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
180
178
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
181
179
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
182
180
|
react_1.default.createElement("div", { className: 'clc-sxp-bottom-text' },
|
183
|
-
react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
184
|
-
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.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec }))));
|
181
|
+
react_1.default.createElement(ExpandableText_1.default, { 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.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
|
182
|
+
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.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
185
183
|
}
|
186
184
|
return null;
|
187
|
-
}, [descStyle, activeIndex, tempMap, resolver, tipText]);
|
185
|
+
}, [descStyle, activeIndex, tempMap, resolver, tipText, nudge, hashTagStyle]);
|
188
186
|
const renderLikeButton = (0, react_1.useCallback)((rec) => {
|
189
187
|
var _a, _b;
|
190
188
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
@@ -260,6 +258,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
260
258
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current);
|
261
259
|
}
|
262
260
|
};
|
261
|
+
(0, react_1.useEffect)(() => {
|
262
|
+
const item = data[activeIndex];
|
263
|
+
if (openHashtag)
|
264
|
+
handleReportProductView(item);
|
265
|
+
}, [openHashtag, data, activeIndex]);
|
263
266
|
const handleViewImageStartEvent = (activeIndex) => {
|
264
267
|
var _a, _b, _c, _d, _e, _f;
|
265
268
|
const item = data[activeIndex];
|
@@ -343,6 +346,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
343
346
|
zIndex: 999
|
344
347
|
}, 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 }),
|
345
348
|
renderView),
|
346
|
-
react_1.default.createElement(WaterFall_1.default, null)));
|
349
|
+
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))));
|
347
350
|
};
|
348
351
|
exports.default = SxpPageRender;
|
@@ -1 +1 @@
|
|
1
|
-
export declare function useIconLink(path: string): string;
|
1
|
+
export declare function useIconLink(path: string, domain?: string): string;
|
@@ -3,10 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useIconLink = void 0;
|
4
4
|
const react_1 = require("react");
|
5
5
|
const hooks_1 = require("../../../core/hooks");
|
6
|
-
function useIconLink(path) {
|
6
|
+
function useIconLink(path, domain) {
|
7
7
|
const { appDomain } = (0, hooks_1.useSxpDataSource)();
|
8
8
|
return (0, react_1.useMemo)(() => {
|
9
|
-
|
10
|
-
|
9
|
+
if (domain) {
|
10
|
+
return `https://${domain}${path}`;
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
return appDomain ? `https://${appDomain}${path}` : `${window.location.origin}${path}`;
|
14
|
+
}
|
15
|
+
}, [appDomain, path, domain]);
|
11
16
|
}
|
12
17
|
exports.useIconLink = useIconLink;
|
@@ -15,6 +15,10 @@ export interface IPageParams {
|
|
15
15
|
h5_url?: string;
|
16
16
|
mp_rul?: string;
|
17
17
|
}
|
18
|
+
export type IPopupAniType = {
|
19
|
+
name: string;
|
20
|
+
duration: number;
|
21
|
+
};
|
18
22
|
export interface IEditorContext {
|
19
23
|
resolver: Record<string, MaterialComponet>;
|
20
24
|
currentNode: any | null;
|
@@ -55,6 +59,7 @@ export interface IEditorContext {
|
|
55
59
|
getCurPageConf?: any;
|
56
60
|
popup: string;
|
57
61
|
setPopup: React.Dispatch<React.SetStateAction<string>>;
|
62
|
+
popupAni: IPopupAniType;
|
58
63
|
}
|
59
64
|
export interface IEditorCoreProps {
|
60
65
|
resolver: Record<string, MaterialComponet>;
|
@@ -49,7 +49,11 @@ exports.EditorContext = react_1.default.createContext({
|
|
49
49
|
undoStack: [item],
|
50
50
|
redoStack: [],
|
51
51
|
popup: '',
|
52
|
-
setPopup: () => { }
|
52
|
+
setPopup: () => { },
|
53
|
+
popupAni: {
|
54
|
+
name: 'none',
|
55
|
+
duration: 0
|
56
|
+
}
|
53
57
|
});
|
54
58
|
const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
55
59
|
const [currentNode, setCurrentNode] = (0, react_1.useState)(null);
|
@@ -68,9 +72,22 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
68
72
|
const [undoStack, setUndoStack] = (0, react_1.useState)([[item]]);
|
69
73
|
const [redoStack, setRedoStack] = (0, react_1.useState)([]);
|
70
74
|
const [popup, setPopup] = (0, react_1.useState)('');
|
75
|
+
const [popupAni, setPopupAni] = (0, react_1.useState)({
|
76
|
+
name: 'none',
|
77
|
+
duration: 0
|
78
|
+
});
|
71
79
|
typeof window !== 'undefined' &&
|
72
|
-
(window.sxpPopup = (type) => {
|
80
|
+
(window.sxpPopup = (type, aniType) => {
|
73
81
|
setPopup(type);
|
82
|
+
if (aniType && (aniType === null || aniType === void 0 ? void 0 : aniType.name) !== 'none') {
|
83
|
+
setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
setPopupAni({
|
87
|
+
name: 'none',
|
88
|
+
duration: 0
|
89
|
+
});
|
90
|
+
}
|
74
91
|
});
|
75
92
|
typeof window !== 'undefined' &&
|
76
93
|
(window.getJointUtmLink = (url) => {
|
@@ -139,7 +156,8 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
|
|
139
156
|
setUndoStack,
|
140
157
|
getCurPageConf,
|
141
158
|
popup,
|
142
|
-
setPopup
|
159
|
+
setPopup,
|
160
|
+
popupAni
|
143
161
|
} },
|
144
162
|
react_1.default.createElement(DataSourceProvider_1.default, { isSsr: isSsr, enable: enableDataSource }, children)));
|
145
163
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
2
2
|
interface IEditorDataContext {
|
3
3
|
sxpPrameter?: {
|
4
4
|
bottomImage: string;
|
@@ -9,6 +9,8 @@ interface IEditorDataContext {
|
|
9
9
|
loadingImage: string;
|
10
10
|
};
|
11
11
|
appDomain?: string;
|
12
|
+
openHashtag?: boolean;
|
13
|
+
setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
12
14
|
}
|
13
15
|
interface IEditorProviderProps {
|
14
16
|
data?: any;
|
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const EditorDataContext = (0, react_1.createContext)({});
|
7
7
|
const EditorDataProvider = ({ children, data }) => {
|
8
8
|
var _a, _b, _c, _d, _e, _f;
|
9
|
+
const [openHashtag, setOpenHashtag] = (0, react_1.useState)(false);
|
9
10
|
return (react_1.default.createElement(EditorDataContext.Provider, { value: {
|
10
11
|
sxpPrameter: {
|
11
12
|
bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
|
@@ -15,7 +16,9 @@ const EditorDataProvider = ({ children, data }) => {
|
|
15
16
|
hashTagSize: (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size,
|
16
17
|
loadingImage: (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.loading_image
|
17
18
|
},
|
18
|
-
appDomain: data === null || data === void 0 ? void 0 : data.appDomain
|
19
|
+
appDomain: data === null || data === void 0 ? void 0 : data.appDomain,
|
20
|
+
openHashtag,
|
21
|
+
setOpenHashtag
|
19
22
|
} }, children));
|
20
23
|
};
|
21
24
|
function useEditorDataProvider() {
|
@@ -57,6 +57,7 @@ export interface ISxpDataSourceContext {
|
|
57
57
|
appDomain?: string;
|
58
58
|
hashTagSize?: number;
|
59
59
|
loadingImage?: string;
|
60
|
+
isOpenHashTag?: boolean;
|
60
61
|
}
|
61
62
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
62
63
|
export interface SxpDataSourceProviderProps {
|
@@ -85,6 +86,7 @@ export interface SxpDataSourceProviderProps {
|
|
85
86
|
sxpParameter?: PageData['sxp_parameter'];
|
86
87
|
appDomain?: string;
|
87
88
|
loadingImage?: string;
|
89
|
+
isOpenHashTag?: boolean;
|
88
90
|
}
|
89
91
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
90
92
|
export default _default;
|
@@ -15,7 +15,7 @@ var DataSourceType;
|
|
15
15
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
16
16
|
})(DataSourceType || (DataSourceType = {}));
|
17
17
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
18
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage }) => {
|
18
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
19
19
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
20
20
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
21
21
|
const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
|
@@ -23,10 +23,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
23
23
|
const isInit = (0, react_1.useRef)(false);
|
24
24
|
const [popupDetailData, setPopupDetailData] = (0, react_1.useState)();
|
25
25
|
const [waterFallData, setWaterFallData] = (0, react_1.useState)();
|
26
|
-
const [openHashtag, setOpenHashtag] = (0, react_1.useState)(
|
26
|
+
const [openHashtag, setOpenHashtag] = (0, react_1.useState)(isOpenHashTag);
|
27
27
|
const [cacheRtcList, setCacheRtcList] = (0, react_1.useState)([]);
|
28
28
|
const [cacheActiveIndex, setCacheActiveIndex] = (0, react_1.useState)(0);
|
29
29
|
const [isFromHashtag, setIsFromHashtag] = (0, react_1.useState)(false);
|
30
|
+
(0, react_1.useEffect)(() => {
|
31
|
+
setOpenHashtag(isOpenHashTag);
|
32
|
+
}, [isOpenHashTag]);
|
30
33
|
const bffDataSource = (0, react_1.useMemo)(() => {
|
31
34
|
return dataSources === null || dataSources === void 0 ? void 0 : dataSources.find((d) => d.type === DataSourceType.BFF);
|
32
35
|
}, [dataSources]);
|
@@ -171,7 +174,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
171
174
|
setLoading(false);
|
172
175
|
});
|
173
176
|
}, [getRecommendVideos]);
|
174
|
-
const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif');
|
177
|
+
const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
175
178
|
return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
|
176
179
|
rtcList,
|
177
180
|
setRtcList,
|
@@ -201,7 +204,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
201
204
|
setIsFromHashtag,
|
202
205
|
appDomain,
|
203
206
|
hashTagSize,
|
204
|
-
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage
|
207
|
+
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
208
|
+
isOpenHashTag
|
205
209
|
} }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
|
206
210
|
};
|
207
211
|
exports.default = (0, react_1.memo)(SxpDataSourceProvider);
|
package/lib/core/create.d.ts
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
|
+
export interface IHashTagProps {
|
3
|
+
lineClamp: number;
|
4
|
+
space: number;
|
5
|
+
buttonStyle: CSSProperties;
|
6
|
+
textStyles: {
|
7
|
+
hashTagTitle: CSSProperties;
|
8
|
+
hashTagDesc: CSSProperties;
|
9
|
+
title: CSSProperties;
|
10
|
+
price: CSSProperties;
|
11
|
+
};
|
12
|
+
}
|
13
|
+
declare const _default: React.NamedExoticComponent<IHashTagProps>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,9 @@
|
|
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 WaterFall_1 = tslib_1.__importDefault(require("../../../core/components/SxpPageRender/WaterFall"));
|
6
|
+
const HashTag = (props) => {
|
7
|
+
return react_1.default.createElement(WaterFall_1.default, Object.assign({}, props));
|
8
|
+
};
|
9
|
+
exports.default = (0, react_1.memo)(HashTag);
|
@@ -0,0 +1,56 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.HashTag = 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 HashTag = (0, create_1.createMaterial)(_1.default, {
|
9
|
+
displayName: '',
|
10
|
+
icon: '',
|
11
|
+
category: 'base',
|
12
|
+
type: 'HashTag',
|
13
|
+
related: {
|
14
|
+
settingRender: settingRender_1.default,
|
15
|
+
bindableProps: []
|
16
|
+
},
|
17
|
+
defaulSetting: {
|
18
|
+
props: {
|
19
|
+
lineClamp: 1,
|
20
|
+
space: 40,
|
21
|
+
textStyles: {
|
22
|
+
hashTagTitle: {
|
23
|
+
fontSize: 16,
|
24
|
+
color: '#000'
|
25
|
+
},
|
26
|
+
hashTagDesc: {
|
27
|
+
fontSize: 12,
|
28
|
+
textAlign: 'center',
|
29
|
+
color: '#000'
|
30
|
+
},
|
31
|
+
title: {
|
32
|
+
fontSize: 12,
|
33
|
+
color: '#000'
|
34
|
+
},
|
35
|
+
price: {
|
36
|
+
fontSize: 12,
|
37
|
+
fontWeight: 'bold',
|
38
|
+
color: '#000'
|
39
|
+
}
|
40
|
+
},
|
41
|
+
buttonStyle: {
|
42
|
+
backgroundColor: '#000',
|
43
|
+
fontSize: 12,
|
44
|
+
height: 52,
|
45
|
+
fontWeight: 'bold',
|
46
|
+
textAlign: 'center',
|
47
|
+
color: '#fff',
|
48
|
+
borderRadius: 25
|
49
|
+
}
|
50
|
+
}
|
51
|
+
},
|
52
|
+
w: 100,
|
53
|
+
h: 40,
|
54
|
+
sort: 2
|
55
|
+
});
|
56
|
+
exports.HashTag = HashTag;
|
@@ -0,0 +1,122 @@
|
|
1
|
+
declare const _default: ({
|
2
|
+
title: string;
|
3
|
+
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
name: string[];
|
7
|
+
addonAfter?: undefined;
|
8
|
+
} | {
|
9
|
+
type: string;
|
10
|
+
label: string;
|
11
|
+
name: string[];
|
12
|
+
addonAfter: string;
|
13
|
+
})[];
|
14
|
+
} | {
|
15
|
+
title: string;
|
16
|
+
child: {
|
17
|
+
name: string[];
|
18
|
+
type: string;
|
19
|
+
child: ({
|
20
|
+
label: string;
|
21
|
+
type: string;
|
22
|
+
options: {
|
23
|
+
label: string;
|
24
|
+
value: string;
|
25
|
+
}[];
|
26
|
+
name: string[];
|
27
|
+
initialValue: string;
|
28
|
+
child?: undefined;
|
29
|
+
} | {
|
30
|
+
type: string;
|
31
|
+
label: string;
|
32
|
+
child: ({
|
33
|
+
type: string;
|
34
|
+
name: string[];
|
35
|
+
options?: undefined;
|
36
|
+
addonAfter?: undefined;
|
37
|
+
} | {
|
38
|
+
type: string;
|
39
|
+
options: {
|
40
|
+
label: string;
|
41
|
+
value: string;
|
42
|
+
}[];
|
43
|
+
name: string[];
|
44
|
+
addonAfter?: undefined;
|
45
|
+
} | {
|
46
|
+
type: string;
|
47
|
+
addonAfter: string;
|
48
|
+
name: string[];
|
49
|
+
options?: undefined;
|
50
|
+
})[];
|
51
|
+
options?: undefined;
|
52
|
+
name?: undefined;
|
53
|
+
initialValue?: undefined;
|
54
|
+
} | {
|
55
|
+
label: string;
|
56
|
+
type: string;
|
57
|
+
options?: undefined;
|
58
|
+
name?: undefined;
|
59
|
+
initialValue?: undefined;
|
60
|
+
child?: undefined;
|
61
|
+
})[];
|
62
|
+
}[];
|
63
|
+
} | {
|
64
|
+
title: string;
|
65
|
+
child: ({
|
66
|
+
type: string;
|
67
|
+
label: string;
|
68
|
+
name: string[];
|
69
|
+
initialValue: string;
|
70
|
+
child?: undefined;
|
71
|
+
} | {
|
72
|
+
type: string;
|
73
|
+
label: string;
|
74
|
+
child: ({
|
75
|
+
type: string;
|
76
|
+
name: string[];
|
77
|
+
max: number;
|
78
|
+
addonAfter?: undefined;
|
79
|
+
} | {
|
80
|
+
type: string;
|
81
|
+
name: string[];
|
82
|
+
addonAfter: string;
|
83
|
+
max: number;
|
84
|
+
})[];
|
85
|
+
name?: undefined;
|
86
|
+
initialValue?: undefined;
|
87
|
+
} | {
|
88
|
+
type: string;
|
89
|
+
name: string[];
|
90
|
+
label?: undefined;
|
91
|
+
initialValue?: undefined;
|
92
|
+
child?: undefined;
|
93
|
+
} | {
|
94
|
+
type: string;
|
95
|
+
label: string;
|
96
|
+
child: ({
|
97
|
+
type: string;
|
98
|
+
name: string[];
|
99
|
+
initialValue: string;
|
100
|
+
options?: undefined;
|
101
|
+
addonAfter?: undefined;
|
102
|
+
} | {
|
103
|
+
type: string;
|
104
|
+
name: string[];
|
105
|
+
options: {
|
106
|
+
label: string;
|
107
|
+
value: string;
|
108
|
+
}[];
|
109
|
+
initialValue?: undefined;
|
110
|
+
addonAfter?: undefined;
|
111
|
+
} | {
|
112
|
+
type: string;
|
113
|
+
name: string[];
|
114
|
+
addonAfter: string;
|
115
|
+
initialValue?: undefined;
|
116
|
+
options?: undefined;
|
117
|
+
})[];
|
118
|
+
name?: undefined;
|
119
|
+
initialValue?: undefined;
|
120
|
+
})[];
|
121
|
+
})[];
|
122
|
+
export default _default;
|