pb-sxp-ui 1.0.100 → 1.0.102

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 (48) hide show
  1. package/dist/index.cjs +188 -139
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +10 -3
  4. package/dist/index.js +189 -139
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +188 -139
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/ExpandableText.js +3 -1
  15. package/es/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
  16. package/es/core/components/SxpPageRender/Nudge/index.js +5 -2
  17. package/es/core/components/SxpPageRender/Tagbar.d.ts +1 -0
  18. package/es/core/components/SxpPageRender/Tagbar.js +2 -2
  19. package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
  20. package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +22 -0
  21. package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
  22. package/es/core/components/SxpPageRender/VideoWidget/index.js +93 -85
  23. package/es/core/components/SxpPageRender/index.js +10 -27
  24. package/es/materials/sxp/popup/AppointForm/settingRender.js +2 -2
  25. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
  26. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  27. package/es/materials/sxp/popup/Prompt/index.d.ts +1 -0
  28. package/es/materials/sxp/popup/Prompt/index.js +4 -2
  29. package/es/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
  30. package/es/materials/sxp/popup/Prompt/settingRender.js +33 -4
  31. package/lib/core/components/SxpPageRender/ExpandableText.js +3 -1
  32. package/lib/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
  33. package/lib/core/components/SxpPageRender/Nudge/index.js +5 -2
  34. package/lib/core/components/SxpPageRender/Tagbar.d.ts +1 -0
  35. package/lib/core/components/SxpPageRender/Tagbar.js +2 -2
  36. package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
  37. package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +26 -0
  38. package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
  39. package/lib/core/components/SxpPageRender/VideoWidget/index.js +93 -85
  40. package/lib/core/components/SxpPageRender/index.js +10 -27
  41. package/lib/materials/sxp/popup/AppointForm/settingRender.js +2 -2
  42. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
  43. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
  44. package/lib/materials/sxp/popup/Prompt/index.d.ts +1 -0
  45. package/lib/materials/sxp/popup/Prompt/index.js +4 -2
  46. package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
  47. package/lib/materials/sxp/popup/Prompt/settingRender.js +33 -4
  48. package/package.json +1 -1
@@ -29,14 +29,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
29
29
  const { schema } = (0, hooks_1.useEditor)();
30
30
  const [activeIndex, setActiveIndex] = (0, react_1.useState)(0);
31
31
  const viewImageStartTime = (0, react_1.useRef)(0);
32
- const [isInit, setIsInit] = (0, react_1.useState)(false);
33
32
  const [isMuted, setIsMuted] = (0, react_1.useState)(true);
34
33
  const viewTime = (0, react_1.useRef)();
35
34
  const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
36
35
  const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
37
36
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
38
37
  const { backMainFeed } = (0, useEventReport_1.useEventReport)();
39
- const videoRef = (0, react_1.useRef)();
40
38
  const { productView } = (0, useEventReport_1.useEventReport)();
41
39
  const isShowFingerTip = (0, react_1.useMemo)(() => {
42
40
  return data.length > 0 && !loading && (0, localStore_1.getFeUserId)();
@@ -64,16 +62,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
64
62
  });
65
63
  }
66
64
  }, [data.length, bffFbReport, h5EnterLink]);
67
- const firstRef = (0, react_1.useRef)();
68
- (0, react_1.useEffect)(() => {
69
- var _a, _b, _c, _d;
70
- if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
71
- firstRef.current = true;
72
- if ((_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.url) {
73
- videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
74
- }
75
- }
76
- }, [videoRef, data]);
77
65
  (0, react_1.useEffect)(() => {
78
66
  var _a;
79
67
  const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
@@ -171,11 +159,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
171
159
  }
172
160
  return h;
173
161
  }, [tagList, waterFallData]);
174
- const height = (0, react_1.useMemo)(() => {
162
+ const minusHeight = (0, react_1.useMemo)(() => {
175
163
  let minusHeight = 0;
176
164
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
177
165
  minusHeight += 45;
178
166
  }
167
+ return minusHeight;
168
+ }, []);
169
+ const height = (0, react_1.useMemo)(() => {
179
170
  return containerHeight - minusHeight - tagHeight;
180
171
  }, [globalConfig, containerHeight, tagHeight]);
181
172
  const renderLogo = (0, react_1.useMemo)(() => {
@@ -188,7 +179,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
188
179
  const renderContent = (0, react_1.useCallback)((rec, index) => {
189
180
  var _a, _b, _c, _d;
190
181
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
191
- return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
182
+ return (react_1.default.createElement(VideoWidget_1.default, { 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 }));
192
183
  }
193
184
  if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
194
185
  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, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
@@ -214,8 +205,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
214
205
  viewTime,
215
206
  tipText,
216
207
  resolver,
217
- schema,
218
- videoRef.current
208
+ schema
219
209
  ]);
220
210
  const onExpandableChange = (0, react_1.useCallback)((v) => {
221
211
  setIsShowMore(v);
@@ -408,7 +398,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
408
398
  setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
409
399
  } })),
410
400
  renderLogo,
411
- react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex }),
401
+ react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
402
+ top: minusHeight
403
+ } }),
412
404
  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,
413
405
  react_1.default.createElement(react_2.Swiper, { style: {
414
406
  marginTop: tagHeight
@@ -441,15 +433,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
441
433
  [(_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
442
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 }),
443
435
  renderView),
444
- 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)),
445
- react_1.default.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
446
- react_1.default.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
447
- backgroundColor: 'transparent',
448
- width: '100%',
449
- height: '100%',
450
- objectFit: 'cover',
451
- pointerEvents: 'none'
452
- } }),
453
- react_1.default.createElement("div", { id: 'player-container-id-copy' }))));
436
+ 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))));
454
437
  };
455
438
  exports.default = SxpPageRender;
@@ -20,12 +20,12 @@ exports.default = [
20
20
  child: [
21
21
  {
22
22
  type: 'Select',
23
- name: ['testStyle', 'fontFamily-cn'],
23
+ name: ['textStyle', 'fontFamily-cn'],
24
24
  bottomText: '中文字体'
25
25
  },
26
26
  {
27
27
  type: 'Select',
28
- name: ['testStyle', 'fontFamily-en'],
28
+ name: ['textStyle', 'fontFamily-en'],
29
29
  bottomText: '英文/其他字体'
30
30
  }
31
31
  ]
@@ -83,9 +83,10 @@ const CommodityDetail = (_a) => {
83
83
  };
84
84
  const renderBtn = () => {
85
85
  var _a, _b;
86
- return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle, dangerouslySetInnerHTML: {
87
- __html: (0, tool_1.setFontForText)((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
88
- } }))));
86
+ return (react_1.default.createElement(react_1.default.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
87
+ react_1.default.createElement("span", { dangerouslySetInnerHTML: {
88
+ __html: (0, tool_1.setFontForText)((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
89
+ } })))));
89
90
  };
90
91
  const getStyle = (0, react_1.useCallback)((style) => {
91
92
  if (style === null || style === void 0 ? void 0 : style.lineClamp) {
@@ -158,9 +158,10 @@ Made in Italy` })));
158
158
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
159
159
  __html: (0, tool_1.setFontForText)((_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
160
160
  } }))),
161
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle, dangerouslySetInnerHTML: {
162
- __html: (0, tool_1.setFontForText)((_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now', buttonStyle)
163
- } })),
161
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
162
+ react_1.default.createElement("span", { dangerouslySetInnerHTML: {
163
+ __html: (0, tool_1.setFontForText)((_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now', buttonStyle)
164
+ } }))),
164
165
  productInfoText({ isPost }))),
165
166
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
166
167
  };
@@ -10,6 +10,7 @@ export interface IPromptProps {
10
10
  onClose?: () => void;
11
11
  onClick?: () => void;
12
12
  submitButtonStyle?: CSSProperties;
13
+ contentStyle?: CSSProperties;
13
14
  }
14
15
  declare const _default: React.NamedExoticComponent<IPromptProps>;
15
16
  export default _default;
@@ -10,7 +10,7 @@ const hooks_1 = require("../../../../core/hooks");
10
10
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
11
11
  const tool_1 = require("../../../../core/utils/tool");
12
12
  const Prompt = (_a) => {
13
- var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle"]);
13
+ var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
14
14
  const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
15
15
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
16
16
  const iconSrc = typeof icon === 'string' ? icon : (0, materials_1.getMediaValueByMode)(icon);
@@ -31,7 +31,9 @@ const Prompt = (_a) => {
31
31
  return (react_1.default.createElement("div", Object.assign({ className: `pb-prompt ${(0, css_1.css)(Object.assign({}, style))}` }, props),
32
32
  react_1.default.createElement("div", { className: 'pb-prompt-icon' },
33
33
  react_1.default.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success_png_1.default, alt: 'success image' })),
34
- react_1.default.createElement("div", { className: 'pb-prompt-content' }, content),
34
+ react_1.default.createElement("div", { className: 'pb-prompt-content', style: contentStyle, dangerouslySetInnerHTML: {
35
+ __html: (0, tool_1.setFontForText)(content, contentStyle)
36
+ } }),
35
37
  react_1.default.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk, dangerouslySetInnerHTML: {
36
38
  __html: (0, tool_1.setFontForText)(btnText, submitButtonStyle)
37
39
  } })));
@@ -6,12 +6,14 @@ declare const _default: {
6
6
  name: string[];
7
7
  mediaType: string;
8
8
  child?: undefined;
9
+ initialValue?: undefined;
9
10
  } | {
10
11
  type: string;
11
12
  label: string;
12
13
  name: string[];
13
14
  mediaType?: undefined;
14
15
  child?: undefined;
16
+ initialValue?: undefined;
15
17
  } | {
16
18
  type: string;
17
19
  label: string;
@@ -22,6 +24,7 @@ declare const _default: {
22
24
  }[];
23
25
  name?: undefined;
24
26
  mediaType?: undefined;
27
+ initialValue?: undefined;
25
28
  } | {
26
29
  type: string;
27
30
  label: string;
@@ -38,12 +41,21 @@ declare const _default: {
38
41
  })[];
39
42
  name?: undefined;
40
43
  mediaType?: undefined;
44
+ initialValue?: undefined;
41
45
  } | {
42
46
  type: string;
43
47
  name: string[];
44
48
  label?: undefined;
45
49
  mediaType?: undefined;
46
50
  child?: undefined;
51
+ initialValue?: undefined;
52
+ } | {
53
+ label: string;
54
+ type: string;
55
+ name: string[];
56
+ initialValue: string;
57
+ mediaType?: undefined;
58
+ child?: undefined;
47
59
  })[];
48
60
  }[];
49
61
  export default _default;
@@ -16,9 +16,37 @@ exports.default = [
16
16
  name: ['props', 'content']
17
17
  },
18
18
  {
19
- type: 'Text',
20
- label: '按钮文案',
21
- name: ['props', 'btnText']
19
+ type: 'Group',
20
+ label: '内容字体',
21
+ child: [
22
+ {
23
+ type: 'Select',
24
+ name: ['props', 'contentStyle', 'fontFamily-cn'],
25
+ bottomText: '中文字体'
26
+ },
27
+ {
28
+ type: 'Select',
29
+ name: ['props', 'contentStyle', 'fontFamily-en'],
30
+ bottomText: '英文/其他字体'
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ type: 'Group',
36
+ label: '',
37
+ child: [
38
+ {
39
+ type: 'Color',
40
+ name: ['props', 'contentStyle', 'color'],
41
+ initialValue: '#000'
42
+ },
43
+ {
44
+ type: 'Number',
45
+ name: ['props', 'contentStyle', 'fontSize'],
46
+ addonAfter: 'px',
47
+ initialValue: 14
48
+ }
49
+ ]
22
50
  },
23
51
  {
24
52
  type: 'Group',
@@ -64,7 +92,8 @@ exports.default = [
64
92
  {
65
93
  label: '提交按钮颜色',
66
94
  type: 'Color',
67
- name: ['props', 'submitButtonStyle', 'backgroundColor']
95
+ name: ['props', 'submitButtonStyle', 'backgroundColor'],
96
+ initialValue: '#000'
68
97
  }
69
98
  ]
70
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",